ngx-rendering-service-lib 0.0.64 → 0.0.66
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/module/binder/binder.component.mjs +35 -11
- package/fesm2022/ngx-rendering-service-lib-binder.component-B-JfKIYl.mjs +55 -0
- package/fesm2022/ngx-rendering-service-lib-binder.component-B-JfKIYl.mjs.map +1 -0
- package/fesm2022/ngx-rendering-service-lib.mjs +2 -2
- package/lib/module/binder/binder.component.d.ts +10 -4
- package/package.json +1 -1
- package/fesm2022/ngx-rendering-service-lib-binder.component-g_HrjUjG.mjs +0 -31
- package/fesm2022/ngx-rendering-service-lib-binder.component-g_HrjUjG.mjs.map +0 -1
|
@@ -1,28 +1,52 @@
|
|
|
1
1
|
import { Component, Input, signal } from '@angular/core';
|
|
2
2
|
import { RenderingModule } from "../../rendering.module";
|
|
3
3
|
import { FormsModule } from "@angular/forms";
|
|
4
|
+
import { MatProgressSpinner } from "@angular/material/progress-spinner";
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
|
-
import * as i1 from "@angular/
|
|
6
|
+
import * as i1 from "@angular/platform-browser";
|
|
7
|
+
import * as i2 from "@angular/common";
|
|
6
8
|
export class BinderComponent {
|
|
7
|
-
constructor() {
|
|
8
|
-
this.
|
|
9
|
+
constructor(sanitizer) {
|
|
10
|
+
this.sanitizer = sanitizer;
|
|
11
|
+
this.binderItem = signal(undefined);
|
|
12
|
+
this.previewUrl = signal(undefined);
|
|
13
|
+
this.hasPreview = signal(false);
|
|
9
14
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
this.
|
|
15
|
+
ngOnChanges(changes) {
|
|
16
|
+
console.log("ONCHANGES");
|
|
17
|
+
console.log(this.data);
|
|
18
|
+
const binderJobData = this.data?.items?.find(item => item.additionalData === undefined);
|
|
19
|
+
if (binderJobData !== undefined) {
|
|
20
|
+
this.binderItem.set(binderJobData);
|
|
21
|
+
}
|
|
22
|
+
const previewJobData = this.data?.items?.find(item => item.additionalData !== undefined);
|
|
23
|
+
if (previewJobData !== undefined) {
|
|
24
|
+
this.hasPreview.set(true);
|
|
25
|
+
if (previewJobData.link !== undefined && previewJobData.link !== "") {
|
|
26
|
+
this.previewUrl.set(this.getSafeUri(previewJobData.link));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
13
29
|
}
|
|
14
|
-
|
|
15
|
-
|
|
30
|
+
getSafeUri(assetLink) {
|
|
31
|
+
const uri = new URL(assetLink);
|
|
32
|
+
if (uri.hostname.includes("nip.io")) {
|
|
33
|
+
uri.hostname = "localhost";
|
|
34
|
+
}
|
|
35
|
+
return this.sanitizer.bypassSecurityTrustResourceUrl(uri.toString());
|
|
36
|
+
}
|
|
37
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: BinderComponent, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
38
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: BinderComponent, isStandalone: true, selector: "rs-module-binder", inputs: { data: "data", node: "node" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"binder-wrapper\" *ngIf=\"binderItem()\">\n <mat-spinner [diameter]=\"50\" *ngIf=\"binderItem()?.link === undefined\" ></mat-spinner>\n <a [href]=\"binderItem()?.link\" target=\"_blank\" *ngIf=\"binderItem()?.link !== undefined\">Link to object</a>\n <mat-spinner [diameter]=\"50\" *ngIf=\"hasPreview() && (previewUrl() === undefined)\"></mat-spinner>\n <iframe class=\"frame\" [src]=\"previewUrl()\" *ngIf=\"hasPreview() && (previewUrl() !== undefined)\" ></iframe>\n</div>\n", styles: [":host{position:relative;display:flex;align-items:center;width:100%}.ddb-wrapper{width:100%;position:relative}.ddb-wrapper .frame{width:100%;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: RenderingModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }] }); }
|
|
16
39
|
}
|
|
17
40
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: BinderComponent, decorators: [{
|
|
18
41
|
type: Component,
|
|
19
42
|
args: [{ selector: 'rs-module-binder', standalone: true, imports: [
|
|
20
43
|
RenderingModule,
|
|
21
44
|
FormsModule,
|
|
22
|
-
|
|
23
|
-
|
|
45
|
+
MatProgressSpinner,
|
|
46
|
+
], template: "<div class=\"binder-wrapper\" *ngIf=\"binderItem()\">\n <mat-spinner [diameter]=\"50\" *ngIf=\"binderItem()?.link === undefined\" ></mat-spinner>\n <a [href]=\"binderItem()?.link\" target=\"_blank\" *ngIf=\"binderItem()?.link !== undefined\">Link to object</a>\n <mat-spinner [diameter]=\"50\" *ngIf=\"hasPreview() && (previewUrl() === undefined)\"></mat-spinner>\n <iframe class=\"frame\" [src]=\"previewUrl()\" *ngIf=\"hasPreview() && (previewUrl() !== undefined)\" ></iframe>\n</div>\n", styles: [":host{position:relative;display:flex;align-items:center;width:100%}.ddb-wrapper{width:100%;position:relative}.ddb-wrapper .frame{width:100%;height:100%}\n"] }]
|
|
47
|
+
}], ctorParameters: () => [{ type: i1.DomSanitizer }], propDecorators: { data: [{
|
|
24
48
|
type: Input
|
|
25
49
|
}], node: [{
|
|
26
50
|
type: Input
|
|
27
51
|
}] } });
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
52
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmluZGVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9saWIvbW9kdW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ZW0oKT8ubGluayAhPT0gdW5kZWZpbmVkXCI+TGluayB0byBvYmplY3Q8L2E+XG4gIDxtYXQtc3Bpbm5lciBbZGlhbWV0ZXJdPVwiNTBcIiAqbmdJZj1cImhhc1ByZXZpZXcoKSAmJiAocHJldmlld1VybCgpID09PSB1bmRlZmluZWQpXCI+PC9tYXQtc3Bpbm5lcj5cbiAgPGlmcmFtZSBjbGFzcz1cImZyYW1lXCIgW3NyY109XCJwcmV2aWV3VXJsKClcIiAqbmdJZj1cImhhc1ByZXZpZXcoKSAmJiAocHJldmlld1VybCgpICE9PSB1bmRlZmluZWQpXCIgPjwvaWZyYW1lPlxuPC9kaXY+XG4iXX0=
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { signal, Component, Input } from '@angular/core';
|
|
3
|
+
import { RenderingModule } from './ngx-rendering-service-lib.mjs';
|
|
4
|
+
import { FormsModule } from '@angular/forms';
|
|
5
|
+
import { MatProgressSpinner } from '@angular/material/progress-spinner';
|
|
6
|
+
import * as i1 from '@angular/platform-browser';
|
|
7
|
+
import * as i3 from '@angular/common';
|
|
8
|
+
|
|
9
|
+
class BinderComponent {
|
|
10
|
+
constructor(sanitizer) {
|
|
11
|
+
this.sanitizer = sanitizer;
|
|
12
|
+
this.binderItem = signal(undefined);
|
|
13
|
+
this.previewUrl = signal(undefined);
|
|
14
|
+
this.hasPreview = signal(false);
|
|
15
|
+
}
|
|
16
|
+
ngOnChanges(changes) {
|
|
17
|
+
console.log("ONCHANGES");
|
|
18
|
+
console.log(this.data);
|
|
19
|
+
const binderJobData = this.data?.items?.find(item => item.additionalData === undefined);
|
|
20
|
+
if (binderJobData !== undefined) {
|
|
21
|
+
this.binderItem.set(binderJobData);
|
|
22
|
+
}
|
|
23
|
+
const previewJobData = this.data?.items?.find(item => item.additionalData !== undefined);
|
|
24
|
+
if (previewJobData !== undefined) {
|
|
25
|
+
this.hasPreview.set(true);
|
|
26
|
+
if (previewJobData.link !== undefined && previewJobData.link !== "") {
|
|
27
|
+
this.previewUrl.set(this.getSafeUri(previewJobData.link));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
getSafeUri(assetLink) {
|
|
32
|
+
const uri = new URL(assetLink);
|
|
33
|
+
if (uri.hostname.includes("nip.io")) {
|
|
34
|
+
uri.hostname = "localhost";
|
|
35
|
+
}
|
|
36
|
+
return this.sanitizer.bypassSecurityTrustResourceUrl(uri.toString());
|
|
37
|
+
}
|
|
38
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: BinderComponent, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
39
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: BinderComponent, isStandalone: true, selector: "rs-module-binder", inputs: { data: "data", node: "node" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"binder-wrapper\" *ngIf=\"binderItem()\">\n <mat-spinner [diameter]=\"50\" *ngIf=\"binderItem()?.link === undefined\" ></mat-spinner>\n <a [href]=\"binderItem()?.link\" target=\"_blank\" *ngIf=\"binderItem()?.link !== undefined\">Link to object</a>\n <mat-spinner [diameter]=\"50\" *ngIf=\"hasPreview() && (previewUrl() === undefined)\"></mat-spinner>\n <iframe class=\"frame\" [src]=\"previewUrl()\" *ngIf=\"hasPreview() && (previewUrl() !== undefined)\" ></iframe>\n</div>\n", styles: [":host{position:relative;display:flex;align-items:center;width:100%}.ddb-wrapper{width:100%;position:relative}.ddb-wrapper .frame{width:100%;height:100%}\n"], dependencies: [{ kind: "ngmodule", type: RenderingModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }, { kind: "component", type: MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }] }); }
|
|
40
|
+
}
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: BinderComponent, decorators: [{
|
|
42
|
+
type: Component,
|
|
43
|
+
args: [{ selector: 'rs-module-binder', standalone: true, imports: [
|
|
44
|
+
RenderingModule,
|
|
45
|
+
FormsModule,
|
|
46
|
+
MatProgressSpinner,
|
|
47
|
+
], template: "<div class=\"binder-wrapper\" *ngIf=\"binderItem()\">\n <mat-spinner [diameter]=\"50\" *ngIf=\"binderItem()?.link === undefined\" ></mat-spinner>\n <a [href]=\"binderItem()?.link\" target=\"_blank\" *ngIf=\"binderItem()?.link !== undefined\">Link to object</a>\n <mat-spinner [diameter]=\"50\" *ngIf=\"hasPreview() && (previewUrl() === undefined)\"></mat-spinner>\n <iframe class=\"frame\" [src]=\"previewUrl()\" *ngIf=\"hasPreview() && (previewUrl() !== undefined)\" ></iframe>\n</div>\n", styles: [":host{position:relative;display:flex;align-items:center;width:100%}.ddb-wrapper{width:100%;position:relative}.ddb-wrapper .frame{width:100%;height:100%}\n"] }]
|
|
48
|
+
}], ctorParameters: () => [{ type: i1.DomSanitizer }], propDecorators: { data: [{
|
|
49
|
+
type: Input
|
|
50
|
+
}], node: [{
|
|
51
|
+
type: Input
|
|
52
|
+
}] } });
|
|
53
|
+
|
|
54
|
+
export { BinderComponent };
|
|
55
|
+
//# sourceMappingURL=ngx-rendering-service-lib-binder.component-B-JfKIYl.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-rendering-service-lib-binder.component-B-JfKIYl.mjs","sources":["../../src/lib/module/binder/binder.component.ts","../../src/lib/module/binder/binder.component.html"],"sourcesContent":["import { Component, Input, OnChanges, signal, SimpleChanges} from '@angular/core';\nimport {RenderingModule} from \"../../rendering.module\";\nimport {RenderModule} from \"../RenderModule\";\nimport {Node} from \"ngx-edu-sharing-api\";\nimport {FormsModule} from \"@angular/forms\";\nimport {RenderData, AssetStateItem} from \"../../dto/RenderData\";\nimport {MatProgressSpinner, MatProgressSpinnerModule} from \"@angular/material/progress-spinner\";\nimport {DomSanitizer, SafeResourceUrl} from \"@angular/platform-browser\";\n\n@Component({\n selector: 'rs-module-binder',\n standalone: true,\n imports: [\n RenderingModule,\n FormsModule,\n MatProgressSpinner,\n ],\n templateUrl: './binder.component.html',\n styleUrl: './binder.component.scss'\n})\nexport class BinderComponent implements RenderModule, OnChanges {\n @Input() data: RenderData | undefined;\n @Input() node: Node | undefined;\n binderItem = signal<AssetStateItem | undefined>(undefined);\n previewUrl = signal<SafeResourceUrl | undefined>(undefined)\n hasPreview = signal<boolean>(false)\n\n constructor(private sanitizer: DomSanitizer) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n console.log(\"ONCHANGES\")\n console.log(this.data)\n const binderJobData = this.data?.items?.find(item => item.additionalData === undefined)\n if ( binderJobData !== undefined ) {\n this.binderItem.set(binderJobData)\n }\n const previewJobData = this.data?.items?.find(item => item.additionalData !== undefined)\n if (previewJobData !== undefined) {\n this.hasPreview.set(true)\n if (previewJobData.link !== undefined && previewJobData.link !== \"\") {\n this.previewUrl.set(this.getSafeUri(previewJobData.link))\n }\n }\n }\n\n getSafeUri(assetLink: string) {\n const uri = new URL(assetLink)\n if (uri.hostname.includes(\"nip.io\")) {\n uri.hostname = \"localhost\"\n }\n return this.sanitizer.bypassSecurityTrustResourceUrl(uri.toString())\n }\n}\n","<div class=\"binder-wrapper\" *ngIf=\"binderItem()\">\n <mat-spinner [diameter]=\"50\" *ngIf=\"binderItem()?.link === undefined\" ></mat-spinner>\n <a [href]=\"binderItem()?.link\" target=\"_blank\" *ngIf=\"binderItem()?.link !== undefined\">Link to object</a>\n <mat-spinner [diameter]=\"50\" *ngIf=\"hasPreview() && (previewUrl() === undefined)\"></mat-spinner>\n <iframe class=\"frame\" [src]=\"previewUrl()\" *ngIf=\"hasPreview() && (previewUrl() !== undefined)\" ></iframe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AAA;wBACP,eAAe;wBACf,WAAW;wBACX,kBAAkB;AACnB,qBAAA,EAAA,QAAA,EAAA,8eAAA,EAAA,MAAA,EAAA,CAAA,4JAAA,CAAA,EAAA,CAAA;iFAKQ,IAAI,EAAA,CAAA;sBAAZ,KAAK;gBACG,IAAI,EAAA,CAAA;sBAAZ,KAAK;;;;;"}
|
|
@@ -789,9 +789,9 @@ class RenderComponent {
|
|
|
789
789
|
}
|
|
790
790
|
}
|
|
791
791
|
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 }); }
|
|
792
|
-
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", serviceWorkerUrl: "serviceWorkerUrl" }, 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'){\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' || data.module === 'SPREADSHEET') {\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 === 'AUDIO'){\n <rs-module-audio [data]=\"data\" [node]=\"node\"></rs-module-audio>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'BINDER'){\n <rs-module-binder [data]=\"data\" [node]=\"node\"></rs-module-binder>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'DDB'){\n <rs-module-ddb [data]=\"data\" [node]=\"node\"></rs-module-ddb>\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)], () => [import('./ngx-rendering-service-lib-audio.component-Cpp5Zzp1.mjs').then(m => m.AudioComponent)], () => [import('./ngx-rendering-service-lib-binder.component-
|
|
792
|
+
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", serviceWorkerUrl: "serviceWorkerUrl" }, 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'){\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' || data.module === 'SPREADSHEET') {\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 === 'AUDIO'){\n <rs-module-audio [data]=\"data\" [node]=\"node\"></rs-module-audio>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'BINDER'){\n <rs-module-binder [data]=\"data\" [node]=\"node\"></rs-module-binder>\n } @loading {\n <ng-container *ngTemplateOutlet=\"loading\"></ng-container>\n }\n @defer (when data?.module === 'DDB'){\n <rs-module-ddb [data]=\"data\" [node]=\"node\"></rs-module-ddb>\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)], () => [import('./ngx-rendering-service-lib-audio.component-Cpp5Zzp1.mjs').then(m => m.AudioComponent)], () => [import('./ngx-rendering-service-lib-binder.component-B-JfKIYl.mjs').then(m => m.BinderComponent)], () => [import('./ngx-rendering-service-lib-ddb.component-BdYROITK.mjs').then(m => m.DdbComponent)], () => [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)]] }); }
|
|
793
793
|
}
|
|
794
|
-
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), import('./ngx-rendering-service-lib-audio.component-Cpp5Zzp1.mjs').then(m => m.AudioComponent), import('./ngx-rendering-service-lib-binder.component-
|
|
794
|
+
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), import('./ngx-rendering-service-lib-audio.component-Cpp5Zzp1.mjs').then(m => m.AudioComponent), import('./ngx-rendering-service-lib-binder.component-B-JfKIYl.mjs').then(m => m.BinderComponent), import('./ngx-rendering-service-lib-ddb.component-BdYROITK.mjs').then(m => m.DdbComponent), 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, AudioComponent, BinderComponent, DdbComponent, DefaultComponent, UrlComponent) => ({ decorators: [{
|
|
795
795
|
type: Component,
|
|
796
796
|
args: [{ selector: 'rs-root', standalone: true, imports: [
|
|
797
797
|
RenderingApiModule,
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnChanges, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { RenderModule } from "../RenderModule";
|
|
3
3
|
import { Node } from "ngx-edu-sharing-api";
|
|
4
4
|
import { RenderData, AssetStateItem } from "../../dto/RenderData";
|
|
5
|
+
import { DomSanitizer, SafeResourceUrl } from "@angular/platform-browser";
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class BinderComponent implements RenderModule,
|
|
7
|
+
export declare class BinderComponent implements RenderModule, OnChanges {
|
|
8
|
+
private sanitizer;
|
|
7
9
|
data: RenderData | undefined;
|
|
8
10
|
node: Node | undefined;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
binderItem: import("@angular/core").WritableSignal<AssetStateItem | undefined>;
|
|
12
|
+
previewUrl: import("@angular/core").WritableSignal<SafeResourceUrl | undefined>;
|
|
13
|
+
hasPreview: import("@angular/core").WritableSignal<boolean>;
|
|
14
|
+
constructor(sanitizer: DomSanitizer);
|
|
15
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
16
|
+
getSafeUri(assetLink: string): SafeResourceUrl;
|
|
11
17
|
static ɵfac: i0.ɵɵFactoryDeclaration<BinderComponent, never>;
|
|
12
18
|
static ɵcmp: i0.ɵɵComponentDeclaration<BinderComponent, "rs-module-binder", never, { "data": { "alias": "data"; "required": false; }; "node": { "alias": "node"; "required": false; }; }, {}, never, never, true, never>;
|
|
13
19
|
}
|
package/package.json
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, Component, Input } from '@angular/core';
|
|
3
|
-
import { RenderingModule } from './ngx-rendering-service-lib.mjs';
|
|
4
|
-
import { FormsModule } from '@angular/forms';
|
|
5
|
-
import * as i3 from '@angular/common';
|
|
6
|
-
|
|
7
|
-
class BinderComponent {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.activeObject = signal(undefined);
|
|
10
|
-
}
|
|
11
|
-
ngAfterViewInit() {
|
|
12
|
-
const allFinishedItems = this.data?.items?.filter(item => item.link !== "");
|
|
13
|
-
this.activeObject.set(allFinishedItems?.[0]);
|
|
14
|
-
}
|
|
15
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: BinderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
16
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.6", type: BinderComponent, isStandalone: true, selector: "rs-module-binder", inputs: { data: "data", node: "node" }, ngImport: i0, template: "<div class=\"binder-wrapper\" *ngIf=\"activeObject()\">\n <a [href]=\"activeObject()?.link\" target=\"_blank\">Link to object</a>\n</div>\n", styles: [".ddb-wrapper{width:100%;position:relative}\n"], dependencies: [{ kind: "ngmodule", type: RenderingModule }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: FormsModule }] }); }
|
|
17
|
-
}
|
|
18
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: BinderComponent, decorators: [{
|
|
19
|
-
type: Component,
|
|
20
|
-
args: [{ selector: 'rs-module-binder', standalone: true, imports: [
|
|
21
|
-
RenderingModule,
|
|
22
|
-
FormsModule,
|
|
23
|
-
], template: "<div class=\"binder-wrapper\" *ngIf=\"activeObject()\">\n <a [href]=\"activeObject()?.link\" target=\"_blank\">Link to object</a>\n</div>\n", styles: [".ddb-wrapper{width:100%;position:relative}\n"] }]
|
|
24
|
-
}], propDecorators: { data: [{
|
|
25
|
-
type: Input
|
|
26
|
-
}], node: [{
|
|
27
|
-
type: Input
|
|
28
|
-
}] } });
|
|
29
|
-
|
|
30
|
-
export { BinderComponent };
|
|
31
|
-
//# sourceMappingURL=ngx-rendering-service-lib-binder.component-g_HrjUjG.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-rendering-service-lib-binder.component-g_HrjUjG.mjs","sources":["../../src/lib/module/binder/binder.component.ts","../../src/lib/module/binder/binder.component.html"],"sourcesContent":["import {AfterViewInit, Component, ElementRef, Input, signal, ViewChild} from '@angular/core';\nimport {RenderingModule} from \"../../rendering.module\";\nimport {RenderModule} from \"../RenderModule\";\nimport {Node} from \"ngx-edu-sharing-api\";\nimport {MatIcon} from \"@angular/material/icon\";\nimport {MatIconButton} from \"@angular/material/button\";\nimport {MatOption, MatSelect} from \"@angular/material/select\";\nimport {FormsModule} from \"@angular/forms\";\nimport {RenderData, AssetStateItem} from \"../../dto/RenderData\";\nimport {MatMenu, MatMenuItem, MatMenuTrigger} from \"@angular/material/menu\";\n\n@Component({\n selector: 'rs-module-binder',\n standalone: true,\n imports: [\n RenderingModule,\n FormsModule,\n ],\n templateUrl: './binder.component.html',\n styleUrl: './binder.component.scss'\n})\nexport class BinderComponent implements RenderModule, AfterViewInit{\n @Input() data: RenderData | undefined;\n @Input() node: Node | undefined;\n activeObject = signal<AssetStateItem | undefined>(undefined);\n\n ngAfterViewInit(): void {\n const allFinishedItems = this.data?.items?.filter(item => item.link !== \"\")\n this.activeObject.set(allFinishedItems?.[0]);\n }\n}\n","<div class=\"binder-wrapper\" *ngIf=\"activeObject()\">\n <a [href]=\"activeObject()?.link\" target=\"_blank\">Link to object</a>\n</div>\n"],"names":[],"mappings":";;;;;;MAqBa,eAAe,CAAA;AAV5B,IAAA,WAAA,GAAA;AAaE,QAAA,IAAA,CAAA,YAAY,GAAG,MAAM,CAA6B,SAAS,CAAC,CAAC;AAM9D,KAAA;IAJC,eAAe,GAAA;QACb,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC,CAAA;QAC3E,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC;KAC9C;8GARU,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA,EAAA;AAAf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAe,ECrB5B,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,8IAGA,EDYI,MAAA,EAAA,CAAA,8CAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,eAAe,kIACf,WAAW,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAKF,eAAe,EAAA,UAAA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