| 28 | imports: [PreviewError], |
| 29 | }) |
| 30 | export class Preview { |
| 31 | private readonly domSanitizer = inject(DomSanitizer); |
| 32 | private readonly nodeRuntimeSandbox = inject(NodeRuntimeSandbox); |
| 33 | private readonly nodeRuntimeState = inject(NodeRuntimeState); |
| 34 | |
| 35 | loadingProgressValue = this.nodeRuntimeState.loadingStep; |
| 36 | protected loadingEnum = LoadingStep; |
| 37 | |
| 38 | readonly previewUrl = toSignal(this.nodeRuntimeSandbox.previewUrl$, {initialValue: null}); |
| 39 | protected readonly previewUrlForIFrame = computed(() => { |
| 40 | const url = this.previewUrl(); |
| 41 | return url !== null ? this.domSanitizer.bypassSecurityTrustResourceUrl(url) : null; |
| 42 | }); |
| 43 | |
| 44 | protected readonly bootPoseSrc = computed(() => { |
| 45 | const pose = BOOT_POSES[this.loadingProgressValue() as LoadingStep] ?? 'greeting'; |
| 46 | return `${ANGIE_DIR}/${pose}.svg`; |
| 47 | }); |
| 48 | } |
nothing calls this directly
no test coverage detected