import {
ChangeDetectionStrategy,
Component,
computed,
inject,
input,
signal,
ViewEncapsulation,
} from '@angular/core';
import { EpdfDocumentGate, provideEmbedPdf } from '@embedpdf/angular/runtime';
import type { OpenInput } from '@embedpdf/angular/runtime';
import { EpdfPageTemplate, EpdfStage, withStage } from '@embedpdf/angular/stage';
import { EpdfRenderLayer, withRender } from '@embedpdf/angular/render';
import { EpdfSelectionLayer, withSelection } from '@embedpdf/angular/selection';
import { withInteraction } from '@embedpdf/angular/interaction';
import {
annotationKey,
EpdfAnnotation,
EpdfAnnotationLayer,
EpdfComments,
withAnnotation,
type CommentThreadView,
} from '@embedpdf/angular/annotation';
import { cloudEngine } from '@cloudpdf/engine';
const proposal: OpenInput = { kind: 'grant', grant: 'shr_qnqHtCNRpzz-s7DPFBIbuOAF' };
// One thread: the first comment, its replies, a reply box, and a button that shows it.
@Component({
selector: 'article[demoThread]',
changeDetection: ChangeDetectionStrategy.OnPush,
host: { class: 'thread' },
template: `
{{ thread().root.author }} {{ thread().root.contents }}
@for (reply of thread().replies; track key(reply.ref)) {{{ reply.author }} {{ reply.contents }}
} @if (comments.canReply(thread().root.ref)) { } `, }) export class Thread { readonly thread = input.requiredLoading comments…
} @else if (comments.threads().length === 0) {No comments
} @for (thread of comments.threads(); track key(thread.root.ref)) { } `, }) export class Comments { readonly stage = input.requiredLoading…