@stratusjs/angular 0.3.6 → 0.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/package.json +1 -1
  2. package/src/angular.modules.js.map +1 -1
  3. package/src/app.module.js +7 -2
  4. package/src/app.module.js.map +1 -1
  5. package/src/app.module.min.js +1 -1
  6. package/src/app.module.ts +6 -1
  7. package/src/backend.service.js.map +1 -1
  8. package/src/base/base.component.js.map +1 -1
  9. package/src/boot.js.map +1 -1
  10. package/src/boot.ts +1 -0
  11. package/src/changeset-viewer/changeset-viewer-dialog.component.js.map +1 -1
  12. package/src/changeset-viewer/changeset-viewer.component.js.map +1 -1
  13. package/src/confirm-dialog/confirm-dialog.component.js.map +1 -1
  14. package/src/editor/code-view-dialog.component.js.map +1 -1
  15. package/src/editor/editor.component.js +44 -4
  16. package/src/editor/editor.component.js.map +1 -1
  17. package/src/editor/editor.component.min.js +1 -1
  18. package/src/editor/editor.component.ts +53 -1
  19. package/src/editor/link-dialog.component.css +236 -0
  20. package/src/editor/link-dialog.component.css.map +1 -0
  21. package/src/editor/link-dialog.component.html +77 -0
  22. package/src/editor/link-dialog.component.js +294 -0
  23. package/src/editor/link-dialog.component.js.map +1 -0
  24. package/src/editor/link-dialog.component.min.css +1 -0
  25. package/src/editor/link-dialog.component.min.html +1 -0
  26. package/src/editor/link-dialog.component.min.js +1 -0
  27. package/src/editor/link-dialog.component.scss +279 -0
  28. package/src/editor/link-dialog.component.ts +392 -0
  29. package/src/editor/media-dialog.component.js +1 -1
  30. package/src/editor/media-dialog.component.js.map +1 -1
  31. package/src/editor/media-dialog.component.min.js +1 -1
  32. package/src/editor/media-dialog.component.ts +1 -1
  33. package/src/froala/plugins/inputButton.js +1 -1
  34. package/src/froala/plugins/inputButton.js.map +1 -1
  35. package/src/froala/plugins/inputButton.min.js +1 -1
  36. package/src/froala/plugins/inputButton.ts +1 -2
  37. package/src/froala/plugins/linkManager.js +88 -0
  38. package/src/froala/plugins/linkManager.js.map +1 -0
  39. package/src/froala/plugins/linkManager.min.js +1 -0
  40. package/src/froala/plugins/linkManager.ts +110 -0
  41. package/src/material.js.map +1 -1
  42. package/src/media-selector/media-selector.component.js.map +1 -1
  43. package/src/selector/selector.component.js.map +1 -1
  44. package/src/test/test.directive.js.map +1 -1
  45. package/src/tree/tree-dialog.component.js.map +1 -1
  46. package/src/tree/tree-dialog.component.ts +5 -0
  47. package/src/tree/tree-node.component.js.map +1 -1
  48. package/src/tree/tree.component.js.map +1 -1
@@ -0,0 +1,294 @@
1
+ System.register(["@angular/core", "@angular/forms", "@angular/material/dialog", "@angular/material/snack-bar", "rxjs", "rxjs/operators", "lodash", "@stratusjs/runtime/stratus", "@stratusjs/core/environment", "@stratusjs/angular/backend.service", "@stratusjs/angularjs/services/model", "@stratusjs/angular/core/responsive.component", "@angular/material/icon", "@angular/platform-browser"], function (exports_1, context_1) {
2
+ "use strict";
3
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
4
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
5
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
6
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
7
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
8
+ };
9
+ var __metadata = (this && this.__metadata) || function (k, v) {
10
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
11
+ };
12
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
13
+ return function (target, key) { decorator(target, key, paramIndex); }
14
+ };
15
+ var core_1, forms_1, dialog_1, snack_bar_1, rxjs_1, operators_1, lodash_1, stratus_1, environment_1, backend_service_1, model_1, responsive_component_1, icon_1, platform_browser_1, systemDir, moduleName, parentModuleName, min, localDir, LinkDialogComponent;
16
+ var __moduleName = context_1 && context_1.id;
17
+ return {
18
+ setters: [
19
+ function (core_1_1) {
20
+ core_1 = core_1_1;
21
+ },
22
+ function (forms_1_1) {
23
+ forms_1 = forms_1_1;
24
+ },
25
+ function (dialog_1_1) {
26
+ dialog_1 = dialog_1_1;
27
+ },
28
+ function (snack_bar_1_1) {
29
+ snack_bar_1 = snack_bar_1_1;
30
+ },
31
+ function (rxjs_1_1) {
32
+ rxjs_1 = rxjs_1_1;
33
+ },
34
+ function (operators_1_1) {
35
+ operators_1 = operators_1_1;
36
+ },
37
+ function (lodash_1_1) {
38
+ lodash_1 = lodash_1_1;
39
+ },
40
+ function (stratus_1_1) {
41
+ stratus_1 = stratus_1_1;
42
+ },
43
+ function (environment_1_1) {
44
+ environment_1 = environment_1_1;
45
+ },
46
+ function (backend_service_1_1) {
47
+ backend_service_1 = backend_service_1_1;
48
+ },
49
+ function (model_1_1) {
50
+ model_1 = model_1_1;
51
+ },
52
+ function (responsive_component_1_1) {
53
+ responsive_component_1 = responsive_component_1_1;
54
+ },
55
+ function (icon_1_1) {
56
+ icon_1 = icon_1_1;
57
+ },
58
+ function (platform_browser_1_1) {
59
+ platform_browser_1 = platform_browser_1_1;
60
+ }
61
+ ],
62
+ execute: function () {
63
+ systemDir = '@stratusjs/angular';
64
+ moduleName = 'link-dialog';
65
+ parentModuleName = 'editor';
66
+ min = !environment_1.cookie('env') ? '.min' : '';
67
+ localDir = `${stratus_1.Stratus.BaseUrl}${boot.configuration.paths[`${systemDir}/*`].replace(/[^/]*$/, '')}`;
68
+ LinkDialogComponent = class LinkDialogComponent extends responsive_component_1.ResponsiveComponent {
69
+ constructor(dialogRef, data, fb, backend, snackBar, iconRegistry, sanitizer, ref) {
70
+ super();
71
+ this.dialogRef = dialogRef;
72
+ this.data = data;
73
+ this.fb = fb;
74
+ this.backend = backend;
75
+ this.snackBar = snackBar;
76
+ this.iconRegistry = iconRegistry;
77
+ this.sanitizer = sanitizer;
78
+ this.ref = ref;
79
+ this.title = moduleName + '_component';
80
+ this._ = lodash_1.default;
81
+ this.Stratus = stratus_1.Stratus;
82
+ this.apiBase = '/Api/Content';
83
+ this.contentEntities = [];
84
+ this.isContentLoading = true;
85
+ this.limit = 20;
86
+ this.eventInsert = true;
87
+ this.selected = [];
88
+ this.svgIcons = {};
89
+ this.styled = false;
90
+ }
91
+ ngOnInit() {
92
+ this.uid = lodash_1.default.uniqueId(`sa_${lodash_1.default.snakeCase(moduleName)}_component_`);
93
+ stratus_1.Stratus.Instances[this.uid] = this;
94
+ stratus_1.Stratus.Internals.CssLoader(`${localDir}${parentModuleName}/${moduleName}.component${min}.css`)
95
+ .then(() => {
96
+ this.styled = true;
97
+ this.refresh();
98
+ })
99
+ .catch((err) => {
100
+ console.warn('Issue detected in CSS Loader for Component:', this);
101
+ console.error(err);
102
+ this.styled = true;
103
+ this.refresh();
104
+ });
105
+ lodash_1.default.forEach({
106
+ selector_delete: `${stratus_1.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/delete.svg`,
107
+ selector_edit: `${stratus_1.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/edit.svg`
108
+ }, (value, key) => this.iconRegistry.addSvgIcon(key, this.sanitizer.bypassSecurityTrustResourceUrl(value)).getNamedSvgIcon(key));
109
+ this.model = this.data.model;
110
+ this.property = this.data.property;
111
+ this.editor = this.data.editor;
112
+ this.eventManager = this.data.eventManager;
113
+ if (lodash_1.default.isBoolean(this.data.eventInsert)) {
114
+ this.eventInsert = this.data.eventInsert;
115
+ }
116
+ this.dialogLinkForm = this.fb.group({
117
+ linkQueryInput: ''
118
+ });
119
+ this.dialogLinkForm
120
+ .get('linkQueryInput')
121
+ .valueChanges
122
+ .pipe(operators_1.debounceTime(300), operators_1.tap(() => {
123
+ }), operators_1.switchMap((value) => {
124
+ return this.getQuery(value);
125
+ }))
126
+ .subscribe((response) => this.processContent(response));
127
+ this.getQuery().subscribe((response) => this.processContent(response));
128
+ this.refresh();
129
+ }
130
+ onCancelClick() {
131
+ this.dialogRef.close();
132
+ this.refresh();
133
+ }
134
+ onPage(event) {
135
+ this.pageEvent = event;
136
+ this.getQuery(this.lastContentQuery).subscribe((response) => this.processContent(response));
137
+ }
138
+ getQueryUrl(query) {
139
+ let limit = this.limit;
140
+ let paging = 1;
141
+ if (this.pageEvent) {
142
+ limit = this.pageEvent.pageSize;
143
+ paging = this.pageEvent.pageIndex + 1;
144
+ }
145
+ query = (lodash_1.default.isString(query) && !lodash_1.default.isEmpty(query)) ? `"${query}"` : '';
146
+ return `${this.apiBase}?limit=${limit}&p=${paging}&q=${query}`;
147
+ }
148
+ getQuery(query) {
149
+ this.lastContentQuery = query;
150
+ this.isContentLoading = true;
151
+ return this.backend.get(this.getQueryUrl(query))
152
+ .pipe(operators_1.finalize(() => this.isContentLoading = false));
153
+ }
154
+ processContent(response) {
155
+ if (!response.ok || response.status !== 200 || lodash_1.default.isEmpty(response.body)) {
156
+ this.meta = {};
157
+ this.contentEntities = [];
158
+ this.refresh();
159
+ return this.contentEntities;
160
+ }
161
+ this.meta = lodash_1.default.get(response.body, 'meta') || {};
162
+ const payload = lodash_1.default.get(response.body, 'payload') || response.body;
163
+ if (lodash_1.default.isEmpty(payload) || !Array.isArray(payload)) {
164
+ this.contentEntities = [];
165
+ this.isContentLoading = false;
166
+ this.refresh();
167
+ return this.contentEntities;
168
+ }
169
+ this.contentEntities = payload;
170
+ this.isContentLoading = false;
171
+ this.refresh();
172
+ return this.contentEntities;
173
+ }
174
+ select(content) {
175
+ if (lodash_1.default.isUndefined(content)) {
176
+ return;
177
+ }
178
+ const linkElement = this.createLink(content);
179
+ if (!linkElement) {
180
+ console.warn(`${moduleName}: unable to build link for Content ID: ${content.id}`);
181
+ this.snackBar.open(`Unable to build link for Content ID: ${content.id}.`, 'dismiss', {
182
+ duration: 5000,
183
+ horizontalPosition: 'right',
184
+ verticalPosition: 'bottom'
185
+ });
186
+ return;
187
+ }
188
+ this.selected.push(content.id);
189
+ if (!this.eventInsert) {
190
+ if (!(this.model instanceof model_1.Model)) {
191
+ console.warn(`${moduleName}: event manager not available.`);
192
+ return;
193
+ }
194
+ if (!lodash_1.default.isString(this.property)) {
195
+ console.warn(`${moduleName}: event manager not available.`);
196
+ return;
197
+ }
198
+ console.warn(`${moduleName}: disabling eventInsert is not recommended.`);
199
+ this.model.set(this.property, this.model.get(this.property) + linkElement);
200
+ return;
201
+ }
202
+ if (!this.eventManager) {
203
+ console.warn(`${moduleName}: event manager is not set.`);
204
+ return;
205
+ }
206
+ this.eventManager.trigger('insert', linkElement, this.editor);
207
+ this.onCancelClick();
208
+ }
209
+ isSelected(content) {
210
+ if (lodash_1.default.isUndefined(content)) {
211
+ return;
212
+ }
213
+ return lodash_1.default.includes(this.selected, content.id);
214
+ }
215
+ createLink(content) {
216
+ if (!content) {
217
+ console.warn(`${moduleName}: unable to create link for empty content`);
218
+ return null;
219
+ }
220
+ if (!content.contentType || !content.contentType.name) {
221
+ console.warn(`${moduleName}: unable to find content type for content id: ${content.id}`);
222
+ return null;
223
+ }
224
+ if (!content.routing || !content.routing.length || !content.routing[0]) {
225
+ console.warn(`${moduleName}: unable to find routing for ${content.contentType.name} id: ${content.id}`);
226
+ return null;
227
+ }
228
+ if (!content.routing[0].url) {
229
+ console.warn(`${moduleName}: unable to find url for ${content.contentType.name} id: ${content.id}`);
230
+ return null;
231
+ }
232
+ if (!content.version) {
233
+ console.warn(`${moduleName}: unable to find content version for ${content.contentType.name} id: ${content.id}`);
234
+ return null;
235
+ }
236
+ if (!content.version.title || !content.version.title.length) {
237
+ console.warn(`${moduleName}: unable to find title for ${content.contentType.name} id: ${content.id}`);
238
+ return null;
239
+ }
240
+ return `<a href="/${content.routing[0].url}" aria-label="${content.version.title}">${content.version.title}</a>`;
241
+ }
242
+ getSvg(url, options) {
243
+ const uid = this.addSvgIcon(url, options);
244
+ return new rxjs_1.Observable((subscriber) => {
245
+ this.iconRegistry
246
+ .getNamedSvgIcon(uid)
247
+ .subscribe({
248
+ error(err) {
249
+ console.error(`getSvg(${url}): ${err}`);
250
+ },
251
+ complete() {
252
+ subscriber.next(uid);
253
+ }
254
+ });
255
+ });
256
+ }
257
+ addSvgIcon(url, options) {
258
+ if (url in this.svgIcons) {
259
+ return this.svgIcons[url];
260
+ }
261
+ if (!options) {
262
+ options = {};
263
+ }
264
+ const uid = this.svgIcons[url] = lodash_1.default.uniqueId('selector_svg');
265
+ this.iconRegistry.addSvgIcon(uid, this.sanitizer.bypassSecurityTrustResourceUrl(url), options);
266
+ return uid;
267
+ }
268
+ goToUrl(content) {
269
+ if (!content || !content.contentType) {
270
+ console.error('unable to execute goToUrl() because a valid model content was not provided.');
271
+ return;
272
+ }
273
+ window.open(content.contentType.editUrl + '?id=' + content.id, '_blank');
274
+ }
275
+ };
276
+ LinkDialogComponent = __decorate([
277
+ core_1.Component({
278
+ selector: `sa-${moduleName}`,
279
+ templateUrl: `${localDir}/${parentModuleName}/${moduleName}.component${min}.html`,
280
+ }),
281
+ __param(1, core_1.Inject(dialog_1.MAT_DIALOG_DATA)),
282
+ __metadata("design:paramtypes", [dialog_1.MatDialogRef, Object, forms_1.FormBuilder,
283
+ backend_service_1.BackendService,
284
+ snack_bar_1.MatSnackBar,
285
+ icon_1.MatIconRegistry,
286
+ platform_browser_1.DomSanitizer,
287
+ core_1.ChangeDetectorRef])
288
+ ], LinkDialogComponent);
289
+ exports_1("LinkDialogComponent", LinkDialogComponent);
290
+ }
291
+ };
292
+ });
293
+
294
+ //# sourceMappingURL=link-dialog.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["link-dialog.component.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YAiEM,SAAS,GAAG,oBAAoB,CAAA;YAChC,UAAU,GAAG,aAAa,CAAA;YAC1B,gBAAgB,GAAG,QAAQ,CAAA;YAG3B,GAAG,GAAG,CAAC,oBAAM,CAAC,KAAK,CAAC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AAG,MAAM,GAAG,OAAO,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAA;gBAC5E,CAAC;aACJ,CAAA;YA5SY,mBAAmB;gBAL/B,gBAAS,CAAC;oBACP,QAAQ,EAAE,MAAM,UAAU,EAAE;oBAC5B,WAAW,EAAE,GAAG,QAAQ,IAAI,gBAAgB,IAAI,UAAU,aAAa,GAAG,OAAO;iBAEpF,CAAC;gBA8CO,WAAA,aAAM,CAAC,wBAAe,CAAC,CAAA;iDADN,qBAAY,UAElB,mBAAW;oBACN,gCAAc;oBACb,uBAAW;oBACP,sBAAe;oBAClB,+BAAY;oBAChB,wBAAiB;eAnD3B,mBAAmB,CA4S/B;;QAWD,CAAC","file":"link-dialog.component.js"}
@@ -0,0 +1 @@
1
+ .link-dialog-content{margin:0 auto}.link-dialog-content .radio-group{display:flex;flex-direction:column;margin:15px 0}.link-dialog-content .radio-button{margin:5px}.link-dialog-content img.selected{opacity:.5}.link-dialog-content .link-card{max-width:400px}.link-dialog-content .link-header-image{background-size:cover}.link-dialog-content .autocomplete-option .content-type{margin-bottom:2px}.link-dialog-content .autocomplete-option .content-type mat-icon,.link-dialog-content .autocomplete-option .content-type md-icon{margin-right:4px;height:14px;width:14px;min-height:14px;min-width:14px}.link-dialog-content .autocomplete-option .content-type .content-type-name{font-weight:700;font-size:11px;text-transform:uppercase;letter-spacing:1px}.link-dialog-content .autocomplete-option .no-image-icon mat-icon,.link-dialog-content .autocomplete-option .no-image-icon md-icon{height:28px;width:28px;min-height:28px;min-width:28px}.link-dialog-content .autocomplete-option .no-image-icon mat-icon svg g,.link-dialog-content .autocomplete-option .no-image-icon md-icon svg g{fill:#fff}.link-dialog-content .autocomplete-option .shapeholder{width:100%;display:block}.link-dialog-content .content-selector-autocomplete .column-title h3{margin:0 0 5px;font-size:16px}.link-dialog-content .content-selector,.link-dialog-content md-autocomplete{margin-top:12px}.link-dialog-content .selector-filter md-checkbox{padding-right:10px}.link-dialog-content .md-autocomplete-suggestions li{height:80px}.link-dialog-content .content-selector-autocomplete .autocomplete-row{padding:4px 0;border-bottom:1px solid rgba(0,0,0,.1)}.link-dialog-content .content-selector-autocomplete .autocomplete-row *{line-height:1.4}.link-dialog-content .content-selector-autocomplete .autocomplete-row .column-image .image-container{margin-right:18px}.link-dialog-content .content-selector-autocomplete .autocomplete-row h3{font-size:14px}.link-dialog-content .content-selector-autocomplete .autocomplete-row .routing{font-size:13px}.link-dialog-content .content-selector-autocomplete .content .column-title,.link-dialog-content .content-selector-autocomplete .content .image{opacity:.3}.link-dialog-content .content-selector-autocomplete .content mat-icon.content-icon,.link-dialog-content .content-selector-autocomplete .content md-icon.content-icon{z-index:5;height:40px;width:40px;min-height:40px;min-width:40px}.link-dialog-content .content-selector-autocomplete .content mat-icon.content-icon svg,.link-dialog-content .content-selector-autocomplete .content md-icon.content-icon svg{filter:drop-shadow(0 0 1px rgba(0, 0, 0, .5));-webkit-filter:drop-shadow(0 0 1px rgba(0, 0, 0, .5))}.link-dialog-content .content-selector-autocomplete .content mat-icon.content-icon svg g,.link-dialog-content .content-selector-autocomplete .content md-icon.content-icon svg g{fill:#fff}.link-dialog-content .selector-wrapper{background:rgba(255,255,255,.4);margin-top:20px;padding:40px}.link-dialog-content .content-list{margin:0 auto;max-width:600px;min-height:60px;display:block;border-radius:4px;overflow:hidden}.link-dialog-content .content-box{padding:12px 16px;color:rgba(0,0,0,.87);display:flex;flex-direction:row;align-items:center;justify-content:space-between;box-sizing:border-box;background:#fff;font-size:14px}.link-dialog-content .content-box:last-child{border:none}.link-dialog-content .custom-ghost-placeholder{background:rgba(0,0,0,.4);min-height:60px;transition:transform 250ms cubic-bezier(0,0,.2,1)}.link-dialog-content .column-action,.link-dialog-content .column-image,.link-dialog-content .column-title{float:left}.link-dialog-content .column-image{width:15%;padding-right:10px}.link-dialog-content .column-image .image,.link-dialog-content .column-image .no-image-icon{margin-right:10px}.link-dialog-content .column-title{width:70%}.link-dialog-content .column-action{width:15%}.link-dialog-content .column-action>*{display:inline-block;vertical-align:middle;margin-bottom:2px}.link-dialog-content .column-action>:last-child{margin-bottom:0}.link-dialog-content .content-box.cdk-drag-preview .column-image{width:15%}.link-dialog-content .content-box.cdk-drag-preview .column-title{width:85%}.link-dialog-content .routing{color:#333;font-size:13px}.link-dialog-content .content-list .content-list-header{margin-bottom:20px;padding-bottom:20px}.link-dialog-content .content-list .content-list-header .note,.link-dialog-content .content-list .content-list-header h3{margin:0;display:inline-block;vertical-align:text-bottom;line-height:1.2}.link-dialog-content .content-list .content-list-header .note{padding-left:10px}.link-dialog-content .content-list .content-list-container{width:100%}.link-dialog-content .content-list .content-list-row{margin-bottom:10px;padding:12px 16px;background:rgba(0,0,0,.04);border-radius:2px;cursor:pointer}.link-dialog-content .content-list .content-list-row.inactive{background:#ddd}.link-dialog-content .content-list .content-list-row.unpublished{background:#ddd}.link-dialog-content .content-list .btn.btn-delete,.link-dialog-content .content-list .btn.btn-edit{float:right;width:35px;min-width:unset;height:35px;font-size:10px;margin-left:12px;padding:0;background:#fff;box-shadow:0 0 2px rgba(0,0,0,.3)}.link-dialog-content .content-list .btn.btn-delete:hover,.link-dialog-content .content-list .btn.btn-edit:hover{background:#fff;box-shadow:0 0 2px rgba(0,0,0,.8)}.link-dialog-content .content-list .btn.btn-delete svg,.link-dialog-content .content-list .btn.btn-edit svg{margin:0 auto;width:60%}.link-dialog-content .content-list .btn.btn-delete svg g,.link-dialog-content .content-list .btn.btn-edit svg g{fill:#222}.link-dialog-content .firefox .btn.btn-delete svg,.link-dialog-content .firefox .btn.btn-delete svg g,.link-dialog-content .firefox .btn.btn-edit svg,.link-dialog-content .firefox .btn.btn-edit svg g{max-width:28px;max-height:28px}
@@ -0,0 +1 @@
1
+ <h1 mat-dialog-title>Link Selector</h1><div mat-dialog-content class="link-dialog-content"><form class="dialog-form" [formGroup]="dialogLinkForm"><mat-form-field class="form-field"><input matInput placeholder="Search Content" aria-label="Search Content" formControlName="linkQueryInput"></mat-form-field></form><mat-progress-bar mode="indeterminate" *ngIf="isContentLoading || !styled"></mat-progress-bar><div class="content-list" *ngIf="styled"><div class="content-list-row content-box" [ngClass]="{'active': _.get(contentEntity, 'status') === 1, 'inactive' : _.get(contentEntity, 'status') !== 1, 'published': _.get(contentEntity, 'version.published') === 1, 'unpublished': _.get(contentEntity, 'version.published') !== 1, 'selected': isSelected(contentEntity)}" (click)="select(contentEntity)" *ngFor="let contentEntity of contentEntities"><div class="content-list-container"><div class="column-image position-anchor"><div class="image position-all" *ngIf="_.has(contentEntity, 'version.bestImage._thumbnailUrl')" [attr.data-stratus-src]="!_.get(contentEntity, 'version.bestImage.service') ? true : false" [ngStyle]="{'background': 'url(' + _.get(contentEntity, 'version.bestImage._thumbnailUrl') + ') no-repeat center center', 'background-size': 'cover'}"></div><div class="no-image-icon position-all" *ngIf="!_.has(contentEntity, 'version.bestImage._thumbnailUrl')" [ngClass]="_.get(contentEntity, 'contentType.class') + '-background-color'"><mat-icon class="content-type-icon position-center" [svgIcon]="getSvg(Stratus.BaseUrl + (_.get(contentEntity, 'contentType.iconResourcePath') || _.get(contentEntity, 'iconResourcePath'))) | async">Icon</mat-icon></div><img class="shapeholder" [src]="Stratus.BaseUrl + 'sitetheorycore/images/shapeholder-square.png'"></div><div class="column-title"><div class="content-type" *ngIf="_.has(contentEntity, 'contentType.iconResourcePath')"><mat-icon class="content-type-icon" [svgIcon]="getSvg(Stratus.BaseUrl + _.get(contentEntity, 'contentType.iconResourcePath')) | async">ContentType Icon</mat-icon><span class="comment content-type-name font-body" [ngClass]="((_.get(contentEntity, 'contentType.name') || _.get(contentEntity, 'name')) | lowercase) + '-color'" [textContent]="(_.get(contentEntity, 'contentType.name') || _.get(contentEntity, 'name')) + ((_.get(contentEntity, 'status') !== 1) ? ' (hidden)' : '') + ((_.get(contentEntity, 'version.published') !== 1) ? ' (unpublished)' : '')"></span></div><h3 [innerHTML]="_.get(contentEntity, 'version.bestIdentifier') || _.get(contentEntity, 'name') || (_.get(contentEntity, 'contentType.controller') === 'Content\\Module' ? _.get(contentEntity, 'version.internalIdentifier') : 'Untitled ' + _.get(contentEntity, 'contentType.name') + ' (' + _.get(contentEntity, 'id') + ')')"></h3><span class="routing" [textContent]="(_.has(contentEntity, 'routing') ? '/' + _.get(contentEntity, 'routing[0].url') : null) || _.get(contentEntity, 'description') || ''"></span></div><div class="column-action"><a mat-button *ngIf="_.has(contentEntity, 'contentType.editUrl')" [matTooltip]="'Edit ' + (_.get(contentEntity, 'contentType.name') || _.get(contentEntity, 'name'))" aria-label="Edit Item in New Window" class="btn btn-edit" (click)="goToUrl(contentEntity, '_blank');"><mat-icon svgIcon="selector_edit" aria-hidden="false" aria-label="Edit Item">Edit</mat-icon></a></div></div></div></div></div>
@@ -0,0 +1 @@
1
+ System.register(["@angular/core","@angular/forms","@angular/material/dialog","@angular/material/snack-bar","rxjs","rxjs/operators","lodash","@stratusjs/runtime/stratus","@stratusjs/core/environment","@stratusjs/angular/backend.service","@stratusjs/angularjs/services/model","@stratusjs/angular/core/responsive.component","@angular/material/icon","@angular/platform-browser"],function(t,e){"use strict";var n,i,s,o,r,a,l,c,d,u,h,g,f,p,m,v,y,b,k=this&&this.__decorate||function(t,e,n,i){var s,o=arguments.length,r=o<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,n,i);else for(var a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o<3?s(r):o>3?s(e,n,r):s(e,n))||r);return o>3&&r&&Object.defineProperty(e,n,r),r},$=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},I=this&&this.__param||function(t,e){return function(n,i){e(n,i,t)}};e&&e.id;return{setters:[function(t){n=t},function(t){i=t},function(t){s=t},function(t){o=t},function(t){r=t},function(t){a=t},function(t){l=t},function(t){c=t},function(t){d=t},function(t){u=t},function(t){h=t},function(t){g=t},function(t){f=t},function(t){p=t}],execute:function(){"@stratusjs/angular",m="link-dialog","editor",v=d.cookie("env")?"":".min",y=`${c.Stratus.BaseUrl}${boot.configuration.paths["@stratusjs/angular/*"].replace(/[^/]*$/,"")}`,b=class extends g.ResponsiveComponent{constructor(t,e,n,i,s,o,r,a){super(),this.dialogRef=t,this.data=e,this.fb=n,this.backend=i,this.snackBar=s,this.iconRegistry=o,this.sanitizer=r,this.ref=a,this.title="link-dialog_component",this._=l.default,this.Stratus=c.Stratus,this.apiBase="/Api/Content",this.contentEntities=[],this.isContentLoading=!0,this.limit=20,this.eventInsert=!0,this.selected=[],this.svgIcons={},this.styled=!1}ngOnInit(){this.uid=l.default.uniqueId(`sa_${l.default.snakeCase(m)}_component_`),c.Stratus.Instances[this.uid]=this,c.Stratus.Internals.CssLoader(`${y}editor/link-dialog.component${v}.css`).then(()=>{this.styled=!0,this.refresh()}).catch(t=>{console.warn("Issue detected in CSS Loader for Component:",this),console.error(t),this.styled=!0,this.refresh()}),l.default.forEach({selector_delete:`${c.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/delete.svg`,selector_edit:`${c.Stratus.BaseUrl}sitetheorycore/images/icons/actionButtons/edit.svg`},(t,e)=>this.iconRegistry.addSvgIcon(e,this.sanitizer.bypassSecurityTrustResourceUrl(t)).getNamedSvgIcon(e)),this.model=this.data.model,this.property=this.data.property,this.editor=this.data.editor,this.eventManager=this.data.eventManager,l.default.isBoolean(this.data.eventInsert)&&(this.eventInsert=this.data.eventInsert),this.dialogLinkForm=this.fb.group({linkQueryInput:""}),this.dialogLinkForm.get("linkQueryInput").valueChanges.pipe(a.debounceTime(300),a.tap(()=>{}),a.switchMap(t=>this.getQuery(t))).subscribe(t=>this.processContent(t)),this.getQuery().subscribe(t=>this.processContent(t)),this.refresh()}onCancelClick(){this.dialogRef.close(),this.refresh()}onPage(t){this.pageEvent=t,this.getQuery(this.lastContentQuery).subscribe(t=>this.processContent(t))}getQueryUrl(t){let e=this.limit,n=1;return this.pageEvent&&(e=this.pageEvent.pageSize,n=this.pageEvent.pageIndex+1),t=l.default.isString(t)&&!l.default.isEmpty(t)?`"${t}"`:"",`${this.apiBase}?limit=${e}&p=${n}&q=${t}`}getQuery(t){return this.lastContentQuery=t,this.isContentLoading=!0,this.backend.get(this.getQueryUrl(t)).pipe(a.finalize(()=>this.isContentLoading=!1))}processContent(t){if(!t.ok||200!==t.status||l.default.isEmpty(t.body))return this.meta={},this.contentEntities=[],this.refresh(),this.contentEntities;this.meta=l.default.get(t.body,"meta")||{};const e=l.default.get(t.body,"payload")||t.body;return l.default.isEmpty(e)||!Array.isArray(e)?(this.contentEntities=[],this.isContentLoading=!1,this.refresh(),this.contentEntities):(this.contentEntities=e,this.isContentLoading=!1,this.refresh(),this.contentEntities)}select(t){if(l.default.isUndefined(t))return;const e=this.createLink(t);return e?(this.selected.push(t.id),this.eventInsert?void(this.eventManager?(this.eventManager.trigger("insert",e,this.editor),this.onCancelClick()):console.warn("link-dialog: event manager is not set.")):this.model instanceof h.Model&&l.default.isString(this.property)?(console.warn("link-dialog: disabling eventInsert is not recommended."),void this.model.set(this.property,this.model.get(this.property)+e)):void console.warn("link-dialog: event manager not available.")):(console.warn(`link-dialog: unable to build link for Content ID: ${t.id}`),void this.snackBar.open(`Unable to build link for Content ID: ${t.id}.`,"dismiss",{duration:5e3,horizontalPosition:"right",verticalPosition:"bottom"}))}isSelected(t){if(!l.default.isUndefined(t))return l.default.includes(this.selected,t.id)}createLink(t){return t?t.contentType&&t.contentType.name?t.routing&&t.routing.length&&t.routing[0]?t.routing[0].url?t.version?t.version.title&&t.version.title.length?`<a href="/${t.routing[0].url}" aria-label="${t.version.title}">${t.version.title}</a>`:(console.warn(`link-dialog: unable to find title for ${t.contentType.name} id: ${t.id}`),null):(console.warn(`link-dialog: unable to find content version for ${t.contentType.name} id: ${t.id}`),null):(console.warn(`link-dialog: unable to find url for ${t.contentType.name} id: ${t.id}`),null):(console.warn(`link-dialog: unable to find routing for ${t.contentType.name} id: ${t.id}`),null):(console.warn(`link-dialog: unable to find content type for content id: ${t.id}`),null):(console.warn("link-dialog: unable to create link for empty content"),null)}getSvg(t,e){const n=this.addSvgIcon(t,e);return new r.Observable(e=>{this.iconRegistry.getNamedSvgIcon(n).subscribe({error(e){console.error(`getSvg(${t}): ${e}`)},complete(){e.next(n)}})})}addSvgIcon(t,e){if(t in this.svgIcons)return this.svgIcons[t];e||(e={});const n=this.svgIcons[t]=l.default.uniqueId("selector_svg");return this.iconRegistry.addSvgIcon(n,this.sanitizer.bypassSecurityTrustResourceUrl(t),e),n}goToUrl(t){t&&t.contentType?window.open(t.contentType.editUrl+"?id="+t.id,"_blank"):console.error("unable to execute goToUrl() because a valid model content was not provided.")}},b=k([n.Component({selector:"sa-link-dialog",templateUrl:`${y}/editor/link-dialog.component${v}.html`}),I(1,n.Inject(s.MAT_DIALOG_DATA)),$("design:paramtypes",[s.MatDialogRef,Object,i.FormBuilder,u.BackendService,o.MatSnackBar,f.MatIconRegistry,p.DomSanitizer,n.ChangeDetectorRef])],b),t("LinkDialogComponent",b)}}});
@@ -0,0 +1,279 @@
1
+ .link {
2
+ &-dialog {
3
+ &-content {
4
+ .radio {
5
+ &-group {
6
+ display: flex;
7
+ flex-direction: column;
8
+ margin: 15px 0;
9
+ }
10
+ &-button {
11
+ margin: 5px;
12
+ }
13
+ }
14
+ img.selected {
15
+ opacity: 0.5;
16
+ }
17
+ .link-card {
18
+ max-width: 400px;
19
+ }
20
+ .link-header-image {
21
+ //background-image: url('');
22
+ background-size: cover;
23
+ }
24
+
25
+ /* Styles for Both Selector and Content Areas */
26
+ .autocomplete-option {
27
+ .content-type {
28
+ margin-bottom: 2px;
29
+ md-icon,
30
+ mat-icon {
31
+ margin-right: 4px;
32
+ height: 14px;
33
+ width: 14px;
34
+ min-height: 14px;
35
+ min-width: 14px;
36
+ }
37
+ .content-type-name {
38
+ font-weight: bold;
39
+ font-size: 11px;
40
+ text-transform: uppercase;
41
+ letter-spacing: 1px;
42
+ }
43
+ }
44
+ .no-image-icon {
45
+ md-icon,
46
+ mat-icon {
47
+ height: 28px;
48
+ width: 28px;
49
+ min-height: 28px;
50
+ min-width: 28px;
51
+ svg g {
52
+ fill: #FFF;
53
+ }
54
+ }
55
+ }
56
+ .shapeholder {
57
+ width: 100%;
58
+ display: block;
59
+ }
60
+ }
61
+
62
+ .content-selector-autocomplete {
63
+ .column-title h3 {
64
+ margin: 0 0 5px;
65
+ font-size: 16px;
66
+ }
67
+ }
68
+
69
+
70
+
71
+ /* Selector Autocomplete Options */
72
+ md-autocomplete,
73
+ .content-selector {
74
+ margin-top: 12px;
75
+ }
76
+ .selector-filter md-checkbox {
77
+ padding-right: 10px;
78
+ }
79
+ .md-autocomplete-suggestions li {
80
+ height: 80px;
81
+ }
82
+ .content-selector-autocomplete {
83
+ .autocomplete-row {
84
+ padding: 4px 0;
85
+ border-bottom: 1px solid rgba(0,0,0,.1);
86
+ * {
87
+ line-height: 1.4;
88
+ }
89
+ .column-image {
90
+ .image-container {
91
+ margin-right: 18px;
92
+ }
93
+ }
94
+ h3 {
95
+ font-size: 14px;
96
+ }
97
+ .routing {
98
+ font-size: 13px;
99
+ }
100
+ }
101
+ .content {
102
+ .image,
103
+ .column-title {
104
+ opacity: .3;
105
+ }
106
+ md-icon.content-icon,
107
+ mat-icon.content-icon {
108
+ z-index: 5;
109
+ height: 40px;
110
+ width: 40px;
111
+ min-height: 40px;
112
+ min-width: 40px;
113
+ svg {
114
+ filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.5));
115
+ -webkit-filter: drop-shadow(0 0 1px rgba(0, 0, 0, 0.5));
116
+ g {
117
+ fill: #FFF;
118
+ }
119
+ }
120
+ }
121
+ }
122
+ }
123
+
124
+ /* Draggable Content List */
125
+
126
+ .selector-wrapper {
127
+ background: rgba(255,255,255,.4);
128
+ margin-top: 20px;
129
+ padding: 40px;
130
+ }
131
+
132
+ /* Based on Angular Material 8+ */
133
+
134
+ .content-list {
135
+ margin: 0 auto;
136
+ max-width: 600px;
137
+ min-height: 60px;
138
+ display: block;
139
+ border-radius: 4px;
140
+ overflow: hidden;
141
+ }
142
+ .content-box {
143
+ padding: 12px 16px;
144
+ color: rgba(0, 0, 0, 0.87);
145
+ display: flex;
146
+ flex-direction: row;
147
+ align-items: center;
148
+ justify-content: space-between;
149
+ box-sizing: border-box;
150
+ background: white;
151
+ font-size: 14px;
152
+ }
153
+ .content-box:last-child {
154
+ border: none;
155
+ }
156
+ .custom-ghost-placeholder {
157
+ background: rgba(0,0,0,.4);
158
+ min-height: 60px;
159
+ transition: transform 250ms cubic-bezier(0, 0, 0.2, 1);
160
+ }
161
+
162
+ /* Content List Custom */
163
+ .column-image,
164
+ .column-title,
165
+ .column-action {
166
+ float: left;
167
+ }
168
+
169
+ .column-image {
170
+ width: 15%;
171
+ padding-right: 10px;
172
+ .image,
173
+ .no-image-icon {
174
+ margin-right: 10px;
175
+ }
176
+ }
177
+ .column-title {
178
+ width: 70%;
179
+ }
180
+ .column-action {
181
+ width: 15%;
182
+ > * {
183
+ display: inline-block;
184
+ vertical-align: middle;
185
+ margin-bottom: 2px;
186
+ &:last-child {
187
+ margin-bottom: 0;
188
+ }
189
+ }
190
+ }
191
+ .content-box.cdk-drag-preview {
192
+ .column-image {
193
+ width: 15%;
194
+ }
195
+ .column-title {
196
+ width: 85%;
197
+ }
198
+ }
199
+
200
+ margin: 0 auto;
201
+ .routing {
202
+ color: #333;
203
+ font-size: 13px;
204
+ }
205
+ .content-list {
206
+ .content-list-header {
207
+ margin-bottom: 20px;
208
+ padding-bottom: 20px;
209
+ h3,
210
+ .note {
211
+ margin: 0;
212
+ display: inline-block;
213
+ vertical-align: text-bottom;
214
+ line-height: 1.2;
215
+ }
216
+ .note {
217
+ padding-left: 10px;
218
+ }
219
+ }
220
+ .content-message-box {
221
+ // extra information for the list messages (currently only used for an empty list)
222
+ }
223
+ .content-list-container {
224
+ width: 100%;
225
+ }
226
+ .content-list-row {
227
+ margin-bottom: 10px;
228
+ padding: 12px 16px;
229
+ background: rgba(0, 0, 0, 0.04);
230
+ border-radius: 2px;
231
+ cursor: pointer;
232
+ &.active {
233
+ // extra options for status >= 1
234
+ }
235
+ &.inactive {
236
+ // extra options for status < 1
237
+ background: #DDD;
238
+ }
239
+ &.published {
240
+ // extra options for status == 1
241
+ }
242
+ &.unpublished {
243
+ // extra options for published != 1
244
+ background: #DDD;
245
+ }
246
+ }
247
+ .btn.btn-delete, .btn.btn-edit {
248
+ float: right;
249
+ width: 35px;
250
+ min-width: unset;
251
+ height: 35px;
252
+ font-size: 10px;
253
+ margin-left: 12px;
254
+ padding: 0;
255
+ background: #fff;
256
+ box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
257
+ &:hover {
258
+ background: #fff;
259
+ box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
260
+ }
261
+ svg {
262
+ margin: 0 auto;
263
+ width: 60%;
264
+ g {
265
+ fill: #222;
266
+ }
267
+ }
268
+ }
269
+ }
270
+ .firefox .btn.btn-delete svg, .firefox .btn.btn-edit svg {
271
+ &,
272
+ g {
273
+ max-width: 28px;
274
+ max-height: 28px;
275
+ }
276
+ }
277
+ }
278
+ }
279
+ }