ngx-rendering-service-lib 0.0.37 → 0.0.39
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.
- package/esm2022/lib/dto/FrontendModuleConfig.mjs +12 -0
- package/esm2022/lib/dto/RenderData.mjs +2 -0
- package/esm2022/lib/module/RenderModule.mjs +1 -1
- package/esm2022/lib/module/eduhtml/eduHtml.component.mjs +1 -1
- package/esm2022/lib/module/image/image.component.mjs +1 -7
- package/esm2022/lib/module/pdf/pdf.component.mjs +1 -1
- package/esm2022/lib/module/spreadsheet/spreadsheet.component.mjs +1 -1
- package/esm2022/lib/module/url/url.component.mjs +12 -74
- package/esm2022/lib/module/video/video.component.mjs +1 -1
- package/esm2022/lib/render.component.mjs +13 -6
- package/esm2022/module-info.service.mjs +151 -1
- package/fesm2022/ngx-rendering-service-lib.mjs +183 -84
- package/fesm2022/ngx-rendering-service-lib.mjs.map +1 -1
- package/lib/dto/FrontendModuleConfig.d.ts +18 -0
- package/lib/dto/{AssetStateData.d.ts → RenderData.d.ts} +3 -1
- package/lib/module/RenderModule.d.ts +2 -2
- package/lib/module/eduhtml/eduHtml.component.d.ts +2 -2
- package/lib/module/image/image.component.d.ts +2 -2
- package/lib/module/pdf/pdf.component.d.ts +2 -2
- package/lib/module/spreadsheet/spreadsheet.component.d.ts +2 -2
- package/lib/module/url/url.component.d.ts +10 -13
- package/lib/module/video/video.component.d.ts +2 -2
- package/lib/render.component.d.ts +6 -4
- package/module-info.service.d.ts +4 -0
- package/package.json +1 -1
- package/esm2022/lib/dto/AssetStateData.mjs +0 -2
|
@@ -87,18 +87,12 @@ class ImageComponent {
|
|
|
87
87
|
this.loadOptimalSize();
|
|
88
88
|
}
|
|
89
89
|
loadOptimalSize() {
|
|
90
|
-
console.log("nativeElement:");
|
|
91
|
-
console.log(this.element.nativeElement);
|
|
92
90
|
const size = this.element.nativeElement.getBoundingClientRect();
|
|
93
|
-
console.log("Size: ");
|
|
94
|
-
console.log(size);
|
|
95
91
|
const allFinishedItems = this.data?.items?.filter(item => item.link !== "");
|
|
96
92
|
const matchingItem = allFinishedItems?.sort((a, b) => {
|
|
97
93
|
// sort by the image size closest to the viewport
|
|
98
94
|
return Math.abs(a.width - size.width) > Math.abs(b.width - size.width) ? 1 : -1;
|
|
99
95
|
})[0];
|
|
100
|
-
console.log("Item matching size: ");
|
|
101
|
-
console.log(matchingItem);
|
|
102
96
|
this.activeObject.set(matchingItem);
|
|
103
97
|
}
|
|
104
98
|
toggleFullscreen() {
|
|
@@ -267,98 +261,47 @@ var pdf_component = /*#__PURE__*/Object.freeze({
|
|
|
267
261
|
PdfComponent: PdfComponent
|
|
268
262
|
});
|
|
269
263
|
|
|
264
|
+
var UrlEmbeddings;
|
|
265
|
+
(function (UrlEmbeddings) {
|
|
266
|
+
UrlEmbeddings[UrlEmbeddings["YOUTUBE"] = 0] = "YOUTUBE";
|
|
267
|
+
UrlEmbeddings[UrlEmbeddings["VIMEO"] = 1] = "VIMEO";
|
|
268
|
+
UrlEmbeddings[UrlEmbeddings["VIDEO"] = 2] = "VIDEO";
|
|
269
|
+
UrlEmbeddings[UrlEmbeddings["AUDIO"] = 3] = "AUDIO";
|
|
270
|
+
UrlEmbeddings[UrlEmbeddings["IMAGE"] = 4] = "IMAGE";
|
|
271
|
+
UrlEmbeddings[UrlEmbeddings["LTI13TOOL"] = 5] = "LTI13TOOL";
|
|
272
|
+
UrlEmbeddings[UrlEmbeddings["H5P"] = 6] = "H5P";
|
|
273
|
+
UrlEmbeddings[UrlEmbeddings["PREZI"] = 7] = "PREZI";
|
|
274
|
+
})(UrlEmbeddings || (UrlEmbeddings = {}));
|
|
275
|
+
|
|
270
276
|
class UrlComponent {
|
|
271
277
|
constructor(sanitizer) {
|
|
272
278
|
this.sanitizer = sanitizer;
|
|
273
279
|
this.gdpr = undefined;
|
|
274
280
|
this.gdprOk = false;
|
|
275
|
-
this.
|
|
276
|
-
this.externalId = null;
|
|
281
|
+
this.sanitizedUrl = null;
|
|
277
282
|
this.url = "";
|
|
278
|
-
this.
|
|
283
|
+
this.UrlEmbeddings = UrlEmbeddings;
|
|
279
284
|
}
|
|
280
|
-
|
|
285
|
+
ngOnInit() {
|
|
286
|
+
this.embedding = this.data?.frontendModuleConfig?.urlModuleConfig?.embedding;
|
|
287
|
+
this.externalId = this.data?.frontendModuleConfig?.urlModuleConfig?.externalId;
|
|
281
288
|
this.url = this.node?.properties?.["ccm:wwwurl"]?.[0] || '';
|
|
282
|
-
this.
|
|
289
|
+
if (this.embedding === UrlEmbeddings.VIMEO) {
|
|
290
|
+
this.sanitizedUrl = this.getVimeoUri();
|
|
291
|
+
}
|
|
283
292
|
}
|
|
284
293
|
isProtected() {
|
|
285
294
|
return this.gdpr === undefined;
|
|
286
295
|
}
|
|
287
|
-
setEmbeddingType() {
|
|
288
|
-
if (this.detectYouTube()) {
|
|
289
|
-
this.embedding = "youtube";
|
|
290
|
-
this.getExternalId();
|
|
291
|
-
}
|
|
292
|
-
else if (this.url.includes("vimeo.com")) {
|
|
293
|
-
this.embedding = "vimeo";
|
|
294
|
-
this.getExternalId();
|
|
295
|
-
}
|
|
296
|
-
else if (this.node?.mediatype?.includes("audio")) {
|
|
297
|
-
this.embedding = "audio";
|
|
298
|
-
}
|
|
299
|
-
else if (this.detectImage()) {
|
|
300
|
-
this.embedding = "image";
|
|
301
|
-
}
|
|
302
|
-
else if (this.detectPixabay()) {
|
|
303
|
-
this.url = this.node?.preview?.url ?? "";
|
|
304
|
-
this.embedding = "image";
|
|
305
|
-
}
|
|
306
|
-
else if (this.detectVideo()) { }
|
|
307
|
-
}
|
|
308
296
|
consentToGdprWarning() {
|
|
309
297
|
this.gdprOk = true;
|
|
310
298
|
}
|
|
311
|
-
getExternalId() {
|
|
312
|
-
if (this.embedding === "youtube") {
|
|
313
|
-
if (this.isRemoteRepoResource) {
|
|
314
|
-
this.externalId = this.node?.remote?.id ?? "";
|
|
315
|
-
}
|
|
316
|
-
else if (this.url.includes("youtu.be")) {
|
|
317
|
-
const split = this.url.split("/");
|
|
318
|
-
this.externalId = split[split.length - 1];
|
|
319
|
-
}
|
|
320
|
-
else {
|
|
321
|
-
const url = new URL(this.url);
|
|
322
|
-
this.externalId = url.searchParams.get("v");
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
else if (this.embedding === "vimeo") {
|
|
326
|
-
const split = this.url.split("/");
|
|
327
|
-
this.externalId = split[split.length - 1];
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
299
|
getVimeoUri() {
|
|
331
300
|
let url = '//player.vimeo.com/video/' + this.externalId;
|
|
332
301
|
return this.sanitizer.bypassSecurityTrustResourceUrl(url);
|
|
333
302
|
}
|
|
334
|
-
detectImage() {
|
|
335
|
-
if (this.node?.properties?.["ccm:remoterepositorytype"]?.[0] === "DDB") {
|
|
336
|
-
return false;
|
|
337
|
-
}
|
|
338
|
-
if (this.node?.mediatype === 'file-image') {
|
|
339
|
-
return true;
|
|
340
|
-
}
|
|
341
|
-
const mimeTypeSplit = this.node?.mimetype?.split("/") ?? [];
|
|
342
|
-
return mimeTypeSplit.length === 2 && ['png', 'jpg', 'jpeg', 'gif'].includes(mimeTypeSplit[1]);
|
|
343
|
-
}
|
|
344
|
-
detectYouTube() {
|
|
345
|
-
if (this.url.includes(".youtube.com/watch?") || this.url.includes("youtu.be")) {
|
|
346
|
-
return true;
|
|
347
|
-
}
|
|
348
|
-
if (this.node?.remote?.repository?.repositoryType?.toLowerCase() === "youtube") {
|
|
349
|
-
this.isRemoteRepoResource = true;
|
|
350
|
-
return true;
|
|
351
|
-
}
|
|
352
|
-
return false;
|
|
353
|
-
}
|
|
354
|
-
detectPixabay() {
|
|
355
|
-
return this.node?.remote?.repository?.repositoryType?.toLowerCase() === "pixabay";
|
|
356
|
-
}
|
|
357
|
-
detectVideo() {
|
|
358
|
-
return (["mp4", "webm"].includes(this.url.split(".").pop() ?? ""));
|
|
359
|
-
}
|
|
360
303
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: UrlComponent, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
361
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: UrlComponent, isStandalone: true, selector: "rs-module-url", inputs: { data: "data", node: "node" },
|
|
304
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: UrlComponent, isStandalone: true, selector: "rs-module-url", inputs: { data: "data", node: "node" }, ngImport: i0, template: "<div class=\"url-wrapper\">\n <div *ngIf=\"gdprOk\">\n <ng-container *ngIf=\"embedding === UrlEmbeddings.YOUTUBE && externalId !== ''\">\n <youtube-player\n [videoId]=\"externalId ?? ''\"\n [disableCookies]=\"true\"\n ></youtube-player>\n </ng-container>\n <ng-container *ngIf=\"embedding === UrlEmbeddings.VIMEO && externalId !== ''\">\n <iframe [src]=\"sanitizedUrl\"></iframe>\n </ng-container>\n <ng-container *ngIf=\"embedding === UrlEmbeddings.AUDIO && url !== ''\" >\n <div class=\"audio-wrapper\">\n <video\n controls\n style=\"max-width: 100%\"\n [src]=\"url\"\n poster=\"assets/img/audio.svg\"\n >\n </video>\n </div>\n </ng-container>\n <ng-container *ngIf=\"embedding === UrlEmbeddings.IMAGE && url !== ''\">\n <div class=\"image-wrapper\">\n <img\n [ngSrc]=\"url\"\n [alt]=\"node?.title ?? 'Edu-Sharing image'\"\n [title]=\"node?.title ?? 'Edu-Sharing image'\"\n width=\"100%\"\n height=\"auto\"\n >\n </div>\n </ng-container>\n <ng-container *ngIf=\"embedding === UrlEmbeddings.VIDEO && url !== ''\">\n <div class=\"video-wrapper\">\n <video\n controls\n [src]=\"url\"\n >\n </video>\n </div>\n </ng-container>\n </div>\n <div *ngIf=\"!gdprOk\">\n Halt! Stop!\n <button mat-button (click)=\"consentToGdprWarning()\">Weiter!</button>\n </div>\n</div>\n", styles: [":host{position:relative;display:flex;align-items:center}.url-wrapper{width:100%}.url-wrapper .audio-wrapper video[poster]{object-fit:cover}\n"], dependencies: [{ kind: "ngmodule", type: RenderingModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: YouTubePlayer, selector: "youtube-player", inputs: ["videoId", "height", "width", "startSeconds", "endSeconds", "suggestedQuality", "playerVars", "disableCookies", "loadApi", "disablePlaceholder", "showBeforeIframeApiLoads", "placeholderButtonLabel", "placeholderImageQuality"], outputs: ["ready", "stateChange", "error", "apiChange", "playbackQualityChange", "playbackRateChange"] }, { kind: "directive", type: NgOptimizedImage, selector: "img[ngSrc]", inputs: ["ngSrc", "ngSrcset", "sizes", "width", "height", "loading", "priority", "loaderParams", "disableOptimizedSrcset", "fill", "placeholder", "placeholderConfig", "src", "srcset"] }] }); }
|
|
362
305
|
}
|
|
363
306
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: UrlComponent, decorators: [{
|
|
364
307
|
type: Component,
|
|
@@ -368,7 +311,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImpor
|
|
|
368
311
|
MatIconModule,
|
|
369
312
|
YouTubePlayer,
|
|
370
313
|
NgOptimizedImage,
|
|
371
|
-
], template: "<div class=\"url-wrapper\">\n <div *ngIf=\"gdprOk\">\n <ng-container *ngIf=\"embedding ===
|
|
314
|
+
], template: "<div class=\"url-wrapper\">\n <div *ngIf=\"gdprOk\">\n <ng-container *ngIf=\"embedding === UrlEmbeddings.YOUTUBE && externalId !== ''\">\n <youtube-player\n [videoId]=\"externalId ?? ''\"\n [disableCookies]=\"true\"\n ></youtube-player>\n </ng-container>\n <ng-container *ngIf=\"embedding === UrlEmbeddings.VIMEO && externalId !== ''\">\n <iframe [src]=\"sanitizedUrl\"></iframe>\n </ng-container>\n <ng-container *ngIf=\"embedding === UrlEmbeddings.AUDIO && url !== ''\" >\n <div class=\"audio-wrapper\">\n <video\n controls\n style=\"max-width: 100%\"\n [src]=\"url\"\n poster=\"assets/img/audio.svg\"\n >\n </video>\n </div>\n </ng-container>\n <ng-container *ngIf=\"embedding === UrlEmbeddings.IMAGE && url !== ''\">\n <div class=\"image-wrapper\">\n <img\n [ngSrc]=\"url\"\n [alt]=\"node?.title ?? 'Edu-Sharing image'\"\n [title]=\"node?.title ?? 'Edu-Sharing image'\"\n width=\"100%\"\n height=\"auto\"\n >\n </div>\n </ng-container>\n <ng-container *ngIf=\"embedding === UrlEmbeddings.VIDEO && url !== ''\">\n <div class=\"video-wrapper\">\n <video\n controls\n [src]=\"url\"\n >\n </video>\n </div>\n </ng-container>\n </div>\n <div *ngIf=\"!gdprOk\">\n Halt! Stop!\n <button mat-button (click)=\"consentToGdprWarning()\">Weiter!</button>\n </div>\n</div>\n", styles: [":host{position:relative;display:flex;align-items:center}.url-wrapper{width:100%}.url-wrapper .audio-wrapper video[poster]{object-fit:cover}\n"] }]
|
|
372
315
|
}], ctorParameters: () => [{ type: i1$2.DomSanitizer }], propDecorators: { data: [{
|
|
373
316
|
type: Input
|
|
374
317
|
}], node: [{
|
|
@@ -527,6 +470,155 @@ class ModuleInfoService {
|
|
|
527
470
|
+ this.availableReplicationSources.length
|
|
528
471
|
+ this.availableResourceTypes.length !== 0;
|
|
529
472
|
}
|
|
473
|
+
getFrontendModuleSetting(node) {
|
|
474
|
+
const urlModuleConfig = this.checkUrlModule(node);
|
|
475
|
+
if (urlModuleConfig !== null) {
|
|
476
|
+
return urlModuleConfig;
|
|
477
|
+
}
|
|
478
|
+
return {
|
|
479
|
+
module: "default",
|
|
480
|
+
urlModuleConfig: null
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
checkUrlModule(node) {
|
|
484
|
+
const url = node.properties?.["ccm:wwwurl"]?.[0] || '';
|
|
485
|
+
/**
|
|
486
|
+
* Function checkYouTube
|
|
487
|
+
*/
|
|
488
|
+
const checkYouTube = () => {
|
|
489
|
+
if (node.remote?.repository?.repositoryType?.toLowerCase() === "youtube") {
|
|
490
|
+
return {
|
|
491
|
+
embedding: UrlEmbeddings.YOUTUBE,
|
|
492
|
+
externalId: node.remote?.id ?? ""
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
if (url.includes("youtu.be")) {
|
|
496
|
+
const split = url.split("/");
|
|
497
|
+
return {
|
|
498
|
+
embedding: UrlEmbeddings.YOUTUBE,
|
|
499
|
+
externalId: split[split.length - 1]
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
if (url.includes(".youtube.com/watch?")) {
|
|
503
|
+
const urlObject = new URL(url);
|
|
504
|
+
return {
|
|
505
|
+
embedding: UrlEmbeddings.YOUTUBE,
|
|
506
|
+
externalId: urlObject.searchParams.get("v") ?? ""
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
return null;
|
|
510
|
+
};
|
|
511
|
+
/**
|
|
512
|
+
* Function checkVimeo
|
|
513
|
+
*/
|
|
514
|
+
const checkVimeo = () => {
|
|
515
|
+
if (url.includes("vimeo.com")) {
|
|
516
|
+
const split = url.split("/");
|
|
517
|
+
return {
|
|
518
|
+
embedding: UrlEmbeddings.VIMEO,
|
|
519
|
+
externalId: split[split.length - 1]
|
|
520
|
+
};
|
|
521
|
+
}
|
|
522
|
+
return null;
|
|
523
|
+
};
|
|
524
|
+
const checkGenericVideo = () => {
|
|
525
|
+
if (url.length > 0 && ["mp4", "webm"].includes(url.split(".").pop() ?? "")) {
|
|
526
|
+
return {
|
|
527
|
+
embedding: UrlEmbeddings.VIDEO,
|
|
528
|
+
externalId: ""
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
return null;
|
|
532
|
+
};
|
|
533
|
+
/**
|
|
534
|
+
* Function checkAudio
|
|
535
|
+
*/
|
|
536
|
+
const checkAudio = () => {
|
|
537
|
+
if (url.length > 0 && node.mimetype?.startsWith("audio")) {
|
|
538
|
+
return {
|
|
539
|
+
embedding: UrlEmbeddings.AUDIO,
|
|
540
|
+
externalId: ""
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
return null;
|
|
544
|
+
};
|
|
545
|
+
/**
|
|
546
|
+
* Function checkLti13ToolObject
|
|
547
|
+
*/
|
|
548
|
+
const checkLti13ToolObject = () => {
|
|
549
|
+
if (node.aspects?.includes('ccm:ltitool_node')) {
|
|
550
|
+
return {
|
|
551
|
+
embedding: UrlEmbeddings.LTI13TOOL,
|
|
552
|
+
externalId: ""
|
|
553
|
+
};
|
|
554
|
+
}
|
|
555
|
+
return null;
|
|
556
|
+
};
|
|
557
|
+
/**
|
|
558
|
+
* Function checkImage
|
|
559
|
+
*/
|
|
560
|
+
const checkImage = () => {
|
|
561
|
+
if (node.properties?.["ccm:remoterepositorytype"]?.[0] === "DDB") {
|
|
562
|
+
return null;
|
|
563
|
+
}
|
|
564
|
+
if (node.mediatype === "file-image") {
|
|
565
|
+
return {
|
|
566
|
+
embedding: UrlEmbeddings.IMAGE,
|
|
567
|
+
externalId: ""
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
const mimeTypeSplit = node.mimetype?.split("/") ?? [];
|
|
571
|
+
if (mimeTypeSplit.length === 2 && ['png', 'jpg', 'jpeg', 'gif'].includes(mimeTypeSplit[1])) {
|
|
572
|
+
return {
|
|
573
|
+
embedding: UrlEmbeddings.IMAGE,
|
|
574
|
+
externalId: ""
|
|
575
|
+
};
|
|
576
|
+
}
|
|
577
|
+
return null;
|
|
578
|
+
};
|
|
579
|
+
/**
|
|
580
|
+
* Function detectH5P
|
|
581
|
+
*/
|
|
582
|
+
const detectH5P = () => {
|
|
583
|
+
if (url.length > 0 && url.includes('h5p.org/h5p/embed')) {
|
|
584
|
+
return {
|
|
585
|
+
embedding: UrlEmbeddings.H5P,
|
|
586
|
+
externalId: ""
|
|
587
|
+
};
|
|
588
|
+
}
|
|
589
|
+
return null;
|
|
590
|
+
};
|
|
591
|
+
/**
|
|
592
|
+
* Function detectPrezi
|
|
593
|
+
*/
|
|
594
|
+
const detectPrezi = () => {
|
|
595
|
+
if (url.length > 0 && (url.includes('prezi.com/view/')) || url.includes('prezi.com/embed/')) {
|
|
596
|
+
return {
|
|
597
|
+
embedding: UrlEmbeddings.PREZI,
|
|
598
|
+
externalId: ""
|
|
599
|
+
};
|
|
600
|
+
}
|
|
601
|
+
return null;
|
|
602
|
+
};
|
|
603
|
+
/**
|
|
604
|
+
* embedding if applicable to node
|
|
605
|
+
*/
|
|
606
|
+
const embedding = checkYouTube()
|
|
607
|
+
?? checkVimeo()
|
|
608
|
+
?? checkGenericVideo()
|
|
609
|
+
?? checkAudio()
|
|
610
|
+
?? checkImage()
|
|
611
|
+
?? checkLti13ToolObject()
|
|
612
|
+
?? detectH5P()
|
|
613
|
+
?? detectPrezi();
|
|
614
|
+
if (embedding !== null) {
|
|
615
|
+
return {
|
|
616
|
+
module: "url",
|
|
617
|
+
urlModuleConfig: embedding
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
return null;
|
|
621
|
+
}
|
|
530
622
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: ModuleInfoService, deps: [{ token: i1$1.ModuleInfoControllerService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
531
623
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: ModuleInfoService, providedIn: "root" }); }
|
|
532
624
|
}
|
|
@@ -551,7 +643,8 @@ class RenderComponent {
|
|
|
551
643
|
this.loadData.pipe(filter(() => this.node !== undefined && this.serviceWorkerReady), debounceTime(10), switchMap(() => { return this.checkModule(); })).subscribe(async (frontendModule) => {
|
|
552
644
|
if (frontendModule !== null) {
|
|
553
645
|
const data = {
|
|
554
|
-
module: frontendModule
|
|
646
|
+
module: frontendModule.module,
|
|
647
|
+
frontendModuleConfig: frontendModule
|
|
555
648
|
};
|
|
556
649
|
this.renderData$.next(data);
|
|
557
650
|
this.finished.next();
|
|
@@ -673,22 +766,28 @@ class RenderComponent {
|
|
|
673
766
|
console.log('Service Worker controlling this page.');
|
|
674
767
|
});
|
|
675
768
|
}
|
|
676
|
-
async ngOnChanges(
|
|
769
|
+
async ngOnChanges(_) {
|
|
677
770
|
this.loadData.next();
|
|
678
771
|
}
|
|
679
772
|
async checkModule() {
|
|
680
773
|
console.log("Checking module");
|
|
681
774
|
if (!await this.moduleInfoService.isAvailableBackendObject(this.request)) {
|
|
682
775
|
console.log("using frontend only module");
|
|
683
|
-
|
|
776
|
+
if (this.node !== undefined) {
|
|
777
|
+
return this.moduleInfoService.getFrontendModuleSetting(this.node);
|
|
778
|
+
}
|
|
779
|
+
return { module: "default", urlModuleConfig: null };
|
|
684
780
|
}
|
|
685
781
|
else {
|
|
686
782
|
console.log("using backend module");
|
|
687
783
|
return null;
|
|
688
784
|
}
|
|
689
785
|
}
|
|
786
|
+
getFrontendModule() {
|
|
787
|
+
return "default";
|
|
788
|
+
}
|
|
690
789
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: RenderComponent, deps: [{ token: i0.Injector }, { token: i1$1.RenderControllerWrapperService }, { token: i1$1.JobInfoControllerService }, { token: ModuleInfoService }, { token: i3.PlatformLocation }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
691
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: RenderComponent, isStandalone: true, selector: "rs-root", inputs: { request: "request", node: "node" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"module module-{{(renderData$ | async)?.module}}\">\n <ng-container *ngIf=\"renderData$ | async as data\">\n @defer (when data?.module === 'IMAGE'){\n <rs-module-image [data]=\"data\" [node]=\"node\"></rs-module-image>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'VIDEO' || data?.module === 'AUDIO'){\n <rs-module-video [data]=\"data\" [node]=\"node\"></rs-module-video>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'PDF' || data?.module === 'DOCUMENT') {\n <rs-module-pdf [data]=\"data\" [node]=\"node\"></rs-module-pdf>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'EDUHTML' || data?.module === 'H5P' || data?.module === 'JUPYTER') {\n <rs-module-eduHtml [data]=\"data\" [node]=\"node\"></rs-module-eduHtml>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'SPREADSHEET') {\n <rs-module-spreadsheet [data]=\"data\" [node]=\"node\"></rs-module-spreadsheet>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n <ng-container *ngIf=\"data.module === 'default'\">\n @defer (when data.module === 'default') {\n <rs-module-default [node]=\"node\"></rs-module-default>\n }\n </ng-container>\n <ng-container *ngIf=\"data.module === 'url'\">\n @defer (when data.module === 'url') {\n <rs-module-url [node]=\"node\"></rs-module-url>\n }\n </ng-container>\n </ng-container>\n\n <div class=\"progress\" *ngIf=\"(renderData$ | async) === null;\">\n <ng-container *ngIf=\"progress$ | async as progress\">\n <ng-container [ngSwitch]=\"['VIDEO', 'AUDIO'].includes(progress.module) ? 'bar' : 'spinner'\">\n <ng-container *ngSwitchCase=\"'bar'\">\n <div *ngIf=\"(progress.progress ?? 0) < 0\">Queue position: {{-(progress.progress ?? 0)}}</div>\n <mat-progress-bar [value]=\"(progress.progress ?? 0)\" *ngIf=\"(progress.progress ?? 0) >= 0\"></mat-progress-bar>\n </ng-container>\n <ng-container *ngSwitchCase=\"'spinner'\">\n <div *ngIf=\"(progress.progress ?? 0) < 0\">Queue position: {{-(progress.progress ?? 0)}</div>\n <mat-spinner [diameter]=\"50\" *ngIf=\"(progress.progress ?? 0) >= 0\"></mat-spinner>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n</div>\n\n<ng-template #loading>\n <div class=\"progress\">\n <mat-spinner></mat-spinner>\n </div>\n</ng-template>\n", styles: [":host{display:flex;flex-direction:column;gap:20px;padding:10px 30px}.module{overflow:auto;display:flex;flex-grow:1;height:auto;border:1px solid #aaa;padding:20px}.module rs-module-image,.module rs-module-video{width:100%}.module .progress{display:flex;justify-content:center;flex-grow:1}\n"], dependencies: [{ kind: "ngmodule", type: RenderingApiModule }, { kind: "ngmodule", type: RenderingModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i5.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], deferBlockDependencies: [() => [Promise.resolve().then(function () { return image_component; }).then(m => m.ImageComponent)], () => [Promise.resolve().then(function () { return video_component; }).then(m => m.VideoComponent)], () => [Promise.resolve().then(function () { return pdf_component; }).then(m => m.PdfComponent)], () => [Promise.resolve().then(function () { return eduHtml_component; }).then(m => m.EduHtmlComponent)], () => [Promise.resolve().then(function () { return spreadsheet_component; }).then(m => m.SpreadsheetComponent)], () => [import('./ngx-rendering-service-lib-default.component-BiI-arRn.mjs').then(m => m.DefaultComponent)], () => [Promise.resolve().then(function () { return url_component; }).then(m => m.UrlComponent)]] }); }
|
|
790
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.6", type: RenderComponent, isStandalone: true, selector: "rs-root", inputs: { request: "request", node: "node" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"module module-{{(renderData$ | async)?.module}}\">\n <ng-container *ngIf=\"renderData$ | async as data\">\n @defer (when data?.module === 'IMAGE'){\n <rs-module-image [data]=\"data\" [node]=\"node\"></rs-module-image>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'VIDEO' || data?.module === 'AUDIO'){\n <rs-module-video [data]=\"data\" [node]=\"node\"></rs-module-video>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'PDF' || data?.module === 'DOCUMENT') {\n <rs-module-pdf [data]=\"data\" [node]=\"node\"></rs-module-pdf>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'EDUHTML' || data?.module === 'H5P' || data?.module === 'JUPYTER') {\n <rs-module-eduHtml [data]=\"data\" [node]=\"node\"></rs-module-eduHtml>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'SPREADSHEET') {\n <rs-module-spreadsheet [data]=\"data\" [node]=\"node\"></rs-module-spreadsheet>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n <ng-container *ngIf=\"data.module === 'default'\">\n @defer (when data.module === 'default') {\n <rs-module-default [node]=\"node\"></rs-module-default>\n }\n </ng-container>\n <ng-container *ngIf=\"data.module === 'url'\">\n @defer (when data.module === 'url') {\n <rs-module-url [node]=\"node\" [data]=\"data\"></rs-module-url>\n }\n </ng-container>\n </ng-container>\n\n <div class=\"progress\" *ngIf=\"(renderData$ | async) === null;\">\n <ng-container *ngIf=\"progress$ | async as progress\">\n <ng-container [ngSwitch]=\"['VIDEO', 'AUDIO'].includes(progress.module) ? 'bar' : 'spinner'\">\n <ng-container *ngSwitchCase=\"'bar'\">\n <div *ngIf=\"(progress.progress ?? 0) < 0\">Queue position: {{-(progress.progress ?? 0)}}</div>\n <mat-progress-bar [value]=\"(progress.progress ?? 0)\" *ngIf=\"(progress.progress ?? 0) >= 0\"></mat-progress-bar>\n </ng-container>\n <ng-container *ngSwitchCase=\"'spinner'\">\n <div *ngIf=\"(progress.progress ?? 0) < 0\">Queue position: {{-(progress.progress ?? 0)}</div>\n <mat-spinner [diameter]=\"50\" *ngIf=\"(progress.progress ?? 0) >= 0\"></mat-spinner>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n</div>\n\n<ng-template #loading>\n <div class=\"progress\">\n <mat-spinner></mat-spinner>\n </div>\n</ng-template>\n", styles: [":host{display:flex;flex-direction:column;gap:20px;padding:10px 30px}.module{overflow:auto;display:flex;flex-grow:1;height:auto;border:1px solid #aaa;padding:20px}.module rs-module-image,.module rs-module-video{width:100%}.module .progress{display:flex;justify-content:center;flex-grow:1}\n"], dependencies: [{ kind: "ngmodule", type: RenderingApiModule }, { kind: "ngmodule", type: RenderingModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i3.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i3.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i4$1.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "ngmodule", type: MatProgressBarModule }, { kind: "component", type: i5.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }], deferBlockDependencies: [() => [Promise.resolve().then(function () { return image_component; }).then(m => m.ImageComponent)], () => [Promise.resolve().then(function () { return video_component; }).then(m => m.VideoComponent)], () => [Promise.resolve().then(function () { return pdf_component; }).then(m => m.PdfComponent)], () => [Promise.resolve().then(function () { return eduHtml_component; }).then(m => m.EduHtmlComponent)], () => [Promise.resolve().then(function () { return spreadsheet_component; }).then(m => m.SpreadsheetComponent)], () => [import('./ngx-rendering-service-lib-default.component-BiI-arRn.mjs').then(m => m.DefaultComponent)], () => [Promise.resolve().then(function () { return url_component; }).then(m => m.UrlComponent)]] }); }
|
|
692
791
|
}
|
|
693
792
|
i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "18.2.6", ngImport: i0, type: RenderComponent, resolveDeferredDeps: () => [Promise.resolve().then(function () { return image_component; }).then(m => m.ImageComponent), Promise.resolve().then(function () { return video_component; }).then(m => m.VideoComponent), Promise.resolve().then(function () { return pdf_component; }).then(m => m.PdfComponent), Promise.resolve().then(function () { return eduHtml_component; }).then(m => m.EduHtmlComponent), Promise.resolve().then(function () { return spreadsheet_component; }).then(m => m.SpreadsheetComponent), import('./ngx-rendering-service-lib-default.component-BiI-arRn.mjs').then(m => m.DefaultComponent), Promise.resolve().then(function () { return url_component; }).then(m => m.UrlComponent)], resolveMetadata: (ImageComponent, VideoComponent, PdfComponent, EduHtmlComponent, SpreadsheetComponent, DefaultComponent, UrlComponent) => ({ decorators: [{
|
|
694
793
|
type: Component,
|
|
@@ -704,7 +803,7 @@ i0.ɵɵngDeclareClassMetadataAsync({ minVersion: "18.0.0", version: "18.2.6", ng
|
|
|
704
803
|
EduHtmlComponent,
|
|
705
804
|
SpreadsheetComponent,
|
|
706
805
|
DefaultComponent,
|
|
707
|
-
], template: "<div class=\"module module-{{(renderData$ | async)?.module}}\">\n <ng-container *ngIf=\"renderData$ | async as data\">\n @defer (when data?.module === 'IMAGE'){\n <rs-module-image [data]=\"data\" [node]=\"node\"></rs-module-image>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'VIDEO' || data?.module === 'AUDIO'){\n <rs-module-video [data]=\"data\" [node]=\"node\"></rs-module-video>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'PDF' || data?.module === 'DOCUMENT') {\n <rs-module-pdf [data]=\"data\" [node]=\"node\"></rs-module-pdf>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'EDUHTML' || data?.module === 'H5P' || data?.module === 'JUPYTER') {\n <rs-module-eduHtml [data]=\"data\" [node]=\"node\"></rs-module-eduHtml>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'SPREADSHEET') {\n <rs-module-spreadsheet [data]=\"data\" [node]=\"node\"></rs-module-spreadsheet>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n <ng-container *ngIf=\"data.module === 'default'\">\n @defer (when data.module === 'default') {\n <rs-module-default [node]=\"node\"></rs-module-default>\n }\n </ng-container>\n <ng-container *ngIf=\"data.module === 'url'\">\n @defer (when data.module === 'url') {\n <rs-module-url [node]=\"node\"></rs-module-url>\n }\n </ng-container>\n </ng-container>\n\n <div class=\"progress\" *ngIf=\"(renderData$ | async) === null;\">\n <ng-container *ngIf=\"progress$ | async as progress\">\n <ng-container [ngSwitch]=\"['VIDEO', 'AUDIO'].includes(progress.module) ? 'bar' : 'spinner'\">\n <ng-container *ngSwitchCase=\"'bar'\">\n <div *ngIf=\"(progress.progress ?? 0) < 0\">Queue position: {{-(progress.progress ?? 0)}}</div>\n <mat-progress-bar [value]=\"(progress.progress ?? 0)\" *ngIf=\"(progress.progress ?? 0) >= 0\"></mat-progress-bar>\n </ng-container>\n <ng-container *ngSwitchCase=\"'spinner'\">\n <div *ngIf=\"(progress.progress ?? 0) < 0\">Queue position: {{-(progress.progress ?? 0)}</div>\n <mat-spinner [diameter]=\"50\" *ngIf=\"(progress.progress ?? 0) >= 0\"></mat-spinner>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n</div>\n\n<ng-template #loading>\n <div class=\"progress\">\n <mat-spinner></mat-spinner>\n </div>\n</ng-template>\n", styles: [":host{display:flex;flex-direction:column;gap:20px;padding:10px 30px}.module{overflow:auto;display:flex;flex-grow:1;height:auto;border:1px solid #aaa;padding:20px}.module rs-module-image,.module rs-module-video{width:100%}.module .progress{display:flex;justify-content:center;flex-grow:1}\n"] }]
|
|
806
|
+
], template: "<div class=\"module module-{{(renderData$ | async)?.module}}\">\n <ng-container *ngIf=\"renderData$ | async as data\">\n @defer (when data?.module === 'IMAGE'){\n <rs-module-image [data]=\"data\" [node]=\"node\"></rs-module-image>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'VIDEO' || data?.module === 'AUDIO'){\n <rs-module-video [data]=\"data\" [node]=\"node\"></rs-module-video>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'PDF' || data?.module === 'DOCUMENT') {\n <rs-module-pdf [data]=\"data\" [node]=\"node\"></rs-module-pdf>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'EDUHTML' || data?.module === 'H5P' || data?.module === 'JUPYTER') {\n <rs-module-eduHtml [data]=\"data\" [node]=\"node\"></rs-module-eduHtml>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'SPREADSHEET') {\n <rs-module-spreadsheet [data]=\"data\" [node]=\"node\"></rs-module-spreadsheet>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n <ng-container *ngIf=\"data.module === 'default'\">\n @defer (when data.module === 'default') {\n <rs-module-default [node]=\"node\"></rs-module-default>\n }\n </ng-container>\n <ng-container *ngIf=\"data.module === 'url'\">\n @defer (when data.module === 'url') {\n <rs-module-url [node]=\"node\" [data]=\"data\"></rs-module-url>\n }\n </ng-container>\n </ng-container>\n\n <div class=\"progress\" *ngIf=\"(renderData$ | async) === null;\">\n <ng-container *ngIf=\"progress$ | async as progress\">\n <ng-container [ngSwitch]=\"['VIDEO', 'AUDIO'].includes(progress.module) ? 'bar' : 'spinner'\">\n <ng-container *ngSwitchCase=\"'bar'\">\n <div *ngIf=\"(progress.progress ?? 0) < 0\">Queue position: {{-(progress.progress ?? 0)}}</div>\n <mat-progress-bar [value]=\"(progress.progress ?? 0)\" *ngIf=\"(progress.progress ?? 0) >= 0\"></mat-progress-bar>\n </ng-container>\n <ng-container *ngSwitchCase=\"'spinner'\">\n <div *ngIf=\"(progress.progress ?? 0) < 0\">Queue position: {{-(progress.progress ?? 0)}</div>\n <mat-spinner [diameter]=\"50\" *ngIf=\"(progress.progress ?? 0) >= 0\"></mat-spinner>\n </ng-container>\n </ng-container>\n </ng-container>\n </div>\n</div>\n\n<ng-template #loading>\n <div class=\"progress\">\n <mat-spinner></mat-spinner>\n </div>\n</ng-template>\n", styles: [":host{display:flex;flex-direction:column;gap:20px;padding:10px 30px}.module{overflow:auto;display:flex;flex-grow:1;height:auto;border:1px solid #aaa;padding:20px}.module rs-module-image,.module rs-module-video{width:100%}.module .progress{display:flex;justify-content:center;flex-grow:1}\n"] }]
|
|
708
807
|
}], ctorParameters: () => [{ type: i0.Injector }, { type: i1$1.RenderControllerWrapperService }, { type: i1$1.JobInfoControllerService }, { type: ModuleInfoService }, { type: i3.PlatformLocation }], propDecorators: { request: [{
|
|
709
808
|
type: Input
|
|
710
809
|
}], node: [{
|