ngx-rendering-service-lib 0.0.64 → 0.0.65
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 +33 -11
- package/fesm2022/ngx-rendering-service-lib-binder.component-BYiR1mkY.mjs +53 -0
- package/fesm2022/ngx-rendering-service-lib-binder.component-BYiR1mkY.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,50 @@
|
|
|
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
|
-
const
|
|
12
|
-
|
|
15
|
+
ngOnChanges(changes) {
|
|
16
|
+
const binderJobData = this.data?.items?.find(item => item.additionalData === undefined);
|
|
17
|
+
if (binderJobData !== undefined) {
|
|
18
|
+
this.binderItem.set(binderJobData);
|
|
19
|
+
}
|
|
20
|
+
const previewJobData = this.data?.items?.find(item => item.additionalData !== undefined);
|
|
21
|
+
if (previewJobData !== undefined) {
|
|
22
|
+
this.hasPreview.set(true);
|
|
23
|
+
if (previewJobData.link !== undefined && previewJobData.link !== "") {
|
|
24
|
+
this.previewUrl.set(this.getSafeUri(previewJobData.link));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
13
27
|
}
|
|
14
|
-
|
|
15
|
-
|
|
28
|
+
getSafeUri(assetLink) {
|
|
29
|
+
const uri = new URL(assetLink);
|
|
30
|
+
if (uri.hostname.includes("nip.io")) {
|
|
31
|
+
uri.hostname = "localhost";
|
|
32
|
+
}
|
|
33
|
+
return this.sanitizer.bypassSecurityTrustResourceUrl(uri.toString());
|
|
34
|
+
}
|
|
35
|
+
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 }); }
|
|
36
|
+
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
37
|
}
|
|
17
38
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: BinderComponent, decorators: [{
|
|
18
39
|
type: Component,
|
|
19
40
|
args: [{ selector: 'rs-module-binder', standalone: true, imports: [
|
|
20
41
|
RenderingModule,
|
|
21
42
|
FormsModule,
|
|
22
|
-
|
|
23
|
-
|
|
43
|
+
MatProgressSpinner,
|
|
44
|
+
], 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"] }]
|
|
45
|
+
}], ctorParameters: () => [{ type: i1.DomSanitizer }], propDecorators: { data: [{
|
|
24
46
|
type: Input
|
|
25
47
|
}], node: [{
|
|
26
48
|
type: Input
|
|
27
49
|
}] } });
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
50
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmluZGVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy9saWIvbW9kdWxlL2JpbmRlci9iaW5kZXIuY29tcG9uZW50LnRzIiwiLi4v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ld1VybCgpXCIgKm5nSWY9XCJoYXNQcmV2aWV3KCkgJiYgKHByZXZpZXdVcmwoKSAhPT0gdW5kZWZpbmVkKVwiID48L2lmcmFtZT5cbjwvZGl2PlxuIl19
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
const binderJobData = this.data?.items?.find(item => item.additionalData === undefined);
|
|
18
|
+
if (binderJobData !== undefined) {
|
|
19
|
+
this.binderItem.set(binderJobData);
|
|
20
|
+
}
|
|
21
|
+
const previewJobData = this.data?.items?.find(item => item.additionalData !== undefined);
|
|
22
|
+
if (previewJobData !== undefined) {
|
|
23
|
+
this.hasPreview.set(true);
|
|
24
|
+
if (previewJobData.link !== undefined && previewJobData.link !== "") {
|
|
25
|
+
this.previewUrl.set(this.getSafeUri(previewJobData.link));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
getSafeUri(assetLink) {
|
|
30
|
+
const uri = new URL(assetLink);
|
|
31
|
+
if (uri.hostname.includes("nip.io")) {
|
|
32
|
+
uri.hostname = "localhost";
|
|
33
|
+
}
|
|
34
|
+
return this.sanitizer.bypassSecurityTrustResourceUrl(uri.toString());
|
|
35
|
+
}
|
|
36
|
+
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 }); }
|
|
37
|
+
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"] }] }); }
|
|
38
|
+
}
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.6", ngImport: i0, type: BinderComponent, decorators: [{
|
|
40
|
+
type: Component,
|
|
41
|
+
args: [{ selector: 'rs-module-binder', standalone: true, imports: [
|
|
42
|
+
RenderingModule,
|
|
43
|
+
FormsModule,
|
|
44
|
+
MatProgressSpinner,
|
|
45
|
+
], 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"] }]
|
|
46
|
+
}], ctorParameters: () => [{ type: i1.DomSanitizer }], propDecorators: { data: [{
|
|
47
|
+
type: Input
|
|
48
|
+
}], node: [{
|
|
49
|
+
type: Input
|
|
50
|
+
}] } });
|
|
51
|
+
|
|
52
|
+
export { BinderComponent };
|
|
53
|
+
//# sourceMappingURL=ngx-rendering-service-lib-binder.component-BYiR1mkY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-rendering-service-lib-binder.component-BYiR1mkY.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 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>\n</div>\n"],"names":["i2"],"mappings":";;;;;;;;MAoBa,eAAe,CAAA;AAO1B,IAAA,WAAA,CAAoB,SAAuB,EAAA;QAAvB,IAAS,CAAA,SAAA,GAAT,SAAS,CAAc;AAJ3C,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA6B,SAAS,CAAC,CAAC;AAC3D,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAA8B,SAAS,CAAC,CAAA;AAC3D,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAU,KAAK,CAAC,CAAA;KAEY;AAE/C,IAAA,WAAW,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,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,eAAe,yICpB5B,8eAMA,EAAA,MAAA,EAAA,CAAA,4JAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EDOI,eAAe,EACf,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAAA,EAAA,CAAA,IAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,WAAW,+BACX,kBAAkB,EAAA,QAAA,EAAA,mCAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,MAAA,EAAA,OAAA,EAAA,UAAA,EAAA,aAAA,CAAA,EAAA,QAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAKT,eAAe,EAAA,UAAA,EAAA,CAAA;kBAX3B,SAAS;+BACE,kBAAkB,EAAA,UAAA,EAChB,IAAI,EACP,OAAA,EAAA;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-BYiR1mkY.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-BYiR1mkY.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,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