@embedpdf/angular 3.0.0-next.14 → 3.0.0-next.15
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/README.md +309 -0
- package/dist/README.md +309 -0
- package/dist/actions/index.d.ts +34 -16
- package/dist/anchored/index.d.ts +67 -0
- package/dist/annotation/index.d.ts +599 -0
- package/dist/commands/index.d.ts +109 -0
- package/dist/fesm2022/embedpdf-angular-actions.mjs +117 -36
- package/dist/fesm2022/embedpdf-angular-actions.mjs.map +1 -1
- package/dist/fesm2022/embedpdf-angular-anchored.mjs +148 -0
- package/dist/fesm2022/embedpdf-angular-anchored.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-annotation.mjs +1960 -0
- package/dist/fesm2022/embedpdf-angular-annotation.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-commands.mjs +235 -0
- package/dist/fesm2022/embedpdf-angular-commands.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-form.mjs +1074 -0
- package/dist/fesm2022/embedpdf-angular-form.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-history.mjs +54 -0
- package/dist/fesm2022/embedpdf-angular-history.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-i18n.mjs +100 -0
- package/dist/fesm2022/embedpdf-angular-i18n.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-interaction.mjs +157 -0
- package/dist/fesm2022/embedpdf-angular-interaction.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-link.mjs +306 -0
- package/dist/fesm2022/embedpdf-angular-link.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-measurement.mjs +106 -0
- package/dist/fesm2022/embedpdf-angular-measurement.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-metadata.mjs +77 -0
- package/dist/fesm2022/embedpdf-angular-metadata.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-page-edit.mjs +65 -0
- package/dist/fesm2022/embedpdf-angular-page-edit.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-page-view.mjs +297 -0
- package/dist/fesm2022/embedpdf-angular-page-view.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-redaction.mjs +93 -0
- package/dist/fesm2022/embedpdf-angular-redaction.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-render.mjs +331 -69
- package/dist/fesm2022/embedpdf-angular-render.mjs.map +1 -1
- package/dist/fesm2022/embedpdf-angular-runtime.mjs +1147 -390
- package/dist/fesm2022/embedpdf-angular-runtime.mjs.map +1 -1
- package/dist/fesm2022/embedpdf-angular-search.mjs +251 -0
- package/dist/fesm2022/embedpdf-angular-search.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-selection.mjs +477 -0
- package/dist/fesm2022/embedpdf-angular-selection.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-shell.mjs +177 -0
- package/dist/fesm2022/embedpdf-angular-shell.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-signature.mjs +120 -0
- package/dist/fesm2022/embedpdf-angular-signature.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-stage.mjs +688 -288
- package/dist/fesm2022/embedpdf-angular-stage.mjs.map +1 -1
- package/dist/fesm2022/embedpdf-angular-stamp.mjs +169 -0
- package/dist/fesm2022/embedpdf-angular-stamp.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-testing.mjs +89 -0
- package/dist/fesm2022/embedpdf-angular-testing.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-toolbar.mjs +1123 -0
- package/dist/fesm2022/embedpdf-angular-toolbar.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-view-manager.mjs +69 -0
- package/dist/fesm2022/embedpdf-angular-view-manager.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular.mjs +23 -3
- package/dist/fesm2022/embedpdf-angular.mjs.map +1 -1
- package/dist/form/index.d.ts +79 -0
- package/dist/history/index.d.ts +28 -0
- package/dist/i18n/index.d.ts +52 -0
- package/dist/index.d.ts +20 -0
- package/dist/interaction/index.d.ts +58 -0
- package/dist/link/index.d.ts +77 -0
- package/dist/measurement/index.d.ts +46 -0
- package/dist/metadata/index.d.ts +51 -0
- package/dist/page-edit/index.d.ts +22 -0
- package/dist/page-view/index.d.ts +94 -0
- package/dist/redaction/index.d.ts +38 -0
- package/dist/render/index.d.ts +45 -6
- package/dist/runtime/index.d.ts +579 -199
- package/dist/search/index.d.ts +71 -0
- package/dist/selection/index.d.ts +141 -0
- package/dist/shell/index.d.ts +88 -0
- package/dist/signature/index.d.ts +45 -0
- package/dist/stage/index.d.ts +242 -141
- package/dist/stamp/index.d.ts +58 -0
- package/dist/testing/index.d.ts +53 -0
- package/dist/toolbar/index.d.ts +257 -0
- package/dist/view-manager/index.d.ts +23 -0
- package/package.json +135 -14
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embedpdf-angular-annotation.mjs","sources":["../../annotation/src/comments.ts","../../annotation/src/annotation.ts","../../annotation/src/file-picker.ts","../../annotation/src/page-reads.ts","../../annotation/src/settings.ts","../../annotation/src/chrome.ts","../../annotation/src/drawing.ts","../../annotation/src/templates.ts","../../annotation/src/text-box.ts","../../annotation/src/annotation-layer.ts","../../annotation/src/annotation-menu.ts","../../annotation/src/public_api.ts","../../annotation/src/embedpdf-angular-annotation.ts"],"sourcesContent":["/**\n * Comments and replies, as their own service: `inject(EpdfComments)`. A comments sidebar needs\n * the threads and the verbs on them, not the rest of the annotation API, so they get a service\n * of their own (React's `useComments()` and `useCommentThreads()`). `withAnnotation()` provides\n * it.\n *\n * The threads come with where their page is shown (`pageIndex`, `pageLabel`): the join of the\n * plugin's threads and the document's page list is `@embedpdf/web`'s, the same for every\n * framework.\n */\nimport { computed, Injectable, type Signal } from '@angular/core';\nimport { annotationKey, type PageInfo } from '@embedpdf/core';\nimport { EpdfPluginService, injectDocumentScope } from '@embedpdf/angular/runtime';\nimport {\n AnnotationToken,\n type AnnotationCapability,\n type AnnotationRef,\n type CommentThread,\n type CommentThreadChangedEvent,\n type CommentsApi,\n} from '@embedpdf/plugin-annotation';\nimport { enrichCommentThreads } from '@embedpdf/web';\nimport type { Observable } from 'rxjs';\n\n/**\n * A comment thread with where its page is shown now. Its identity stays `page`, like every\n * annotation's; these two fields are for showing it, and follow page moves and deletes.\n */\nexport interface CommentThreadView extends CommentThread {\n /** The page's place in the document, from 0; `-1` for the moment after its page is deleted. */\n pageIndex: number;\n /**\n * The page's label when the PDF has one (`'iv'`, `'A-2'`), else its number from 1, as a\n * string: print it as it is.\n */\n pageLabel: string;\n}\n\nconst NO_THREADS: readonly CommentThread[] = Object.freeze([]);\nconst NO_PAGES: readonly PageInfo[] = Object.freeze([]);\n\n/**\n * The comments of the document in scope (`[epdfDocumentScope]`), else the active one: every\n * thread as `threads()`, one as `threadOf(ref)`, the verbs (`reply()`, `setText()`,\n * `setStatus()`, `setMarked()`, `delete()`, `deleteThread()`), the checks (`canReply(ref)`, …),\n * which follow the document and its permissions in a template, and `threadChanged$`. Without a\n * document the threads are empty and the verbs refuse with `not-ready`.\n */\n@Injectable({ providedIn: 'root' })\nexport class EpdfComments extends EpdfPluginService<AnnotationCapability> {\n constructor() {\n super({ name: 'EpdfComments', feature: 'withAnnotation()', token: AnnotationToken });\n }\n\n /** Every thread, in reading order, read once. In a template, use `threads()`. */\n readonly listThreads: CommentsApi['listThreads'] = this.binding.namespaceMethod(\n 'comments',\n 'listThreads',\n );\n /** The thread a comment is in (its first comment, a reply or a review state), read once, or null. */\n readonly getThread: CommentsApi['getThread'] = this.binding.namespaceMethod(\n 'comments',\n 'getThread',\n );\n /** Reply to the thread's first comment, whichever comment you pass. Resolves `{ annotation }`. */\n readonly reply: CommentsApi['reply'] = this.binding.namespaceMethod('comments', 'reply');\n /** Change a comment's text. */\n readonly setText: CommentsApi['setText'] = this.binding.namespaceMethod('comments', 'setText');\n /** Set the user's review state on a thread, such as `'accepted'`. */\n readonly setStatus: CommentsApi['setStatus'] = this.binding.namespaceMethod(\n 'comments',\n 'setStatus',\n );\n /** Check a thread off for the user, or clear the check mark. */\n readonly setMarked: CommentsApi['setMarked'] = this.binding.namespaceMethod(\n 'comments',\n 'setMarked',\n );\n /** Delete a comment with its replies; the first comment of a thread deletes the thread. */\n readonly delete: CommentsApi['delete'] = this.binding.namespaceMethod('comments', 'delete');\n /** Delete a whole thread, all of it or none. Resolves `{ deleted, failed }`. */\n readonly deleteThread: CommentsApi['deleteThread'] = this.binding.namespaceMethod(\n 'comments',\n 'deleteThread',\n );\n /** Whether the user may reply to this thread. */\n readonly canReply: CommentsApi['canReply'] = this.binding.namespaceMethod('comments', 'canReply');\n /** Whether the user may change this comment's text. */\n readonly canSetText: CommentsApi['canSetText'] = this.binding.namespaceMethod(\n 'comments',\n 'canSetText',\n );\n /** Whether the user may set a review state on this thread. */\n readonly canSetStatus: CommentsApi['canSetStatus'] = this.binding.namespaceMethod(\n 'comments',\n 'canSetStatus',\n );\n /** Whether the user may check this thread off. */\n readonly canSetMarked: CommentsApi['canSetMarked'] = this.binding.namespaceMethod(\n 'comments',\n 'canSetMarked',\n );\n /** Whether the user may delete this comment. */\n readonly canDelete: CommentsApi['canDelete'] = this.binding.namespaceMethod(\n 'comments',\n 'canDelete',\n );\n /** Whether the user may delete every comment in this thread. */\n readonly canDeleteThread: CommentsApi['canDeleteThread'] = this.binding.namespaceMethod(\n 'comments',\n 'canDeleteThread',\n );\n\n /** A thread changed through this viewer: a reply, a text, a review state, a check mark or a delete. */\n readonly threadChanged$: Observable<CommentThreadChangedEvent> = this.binding.stream(\n (annotation) => annotation.comments.onThreadChanged,\n );\n\n private readonly scope = injectDocumentScope();\n private readonly rawThreads = this.binding.select(\n (annotation) => annotation.comments.listThreads(),\n NO_THREADS,\n );\n /** The pages of this service's document: a page moved or deleted moves its threads' labels. */\n private readonly pages = this.binding.host.read(\n (kernel) => {\n const id = this.scope() ?? kernel.documents.getActiveId();\n return id ? kernel.documents.listPages(id) : NO_PAGES;\n },\n () => NO_PAGES,\n );\n\n /**\n * Every thread in the document, in reading order (by page, then from the top), each with its\n * page's `pageIndex` and `pageLabel`. Own, remote and reloaded changes all show. The same\n * array until a thread or a page changes; empty without a document.\n */\n readonly threads: Signal<readonly CommentThreadView[]> = computed(() =>\n enrichCommentThreads(this.rawThreads(), this.pages()),\n );\n\n /**\n * The thread a comment is in, whether you pass its first comment, a reply or a review state,\n * with its page's label; null for null, or a comment in no thread. Pass the ref, or a function\n * that reads it (`() => this.note().ref`).\n */\n threadOf(\n ref: AnnotationRef | null | (() => AnnotationRef | null | undefined),\n ): Signal<CommentThreadView | null> {\n const refOf = typeof ref === 'function' ? ref : () => ref;\n const thread = this.binding.select(\n (annotation) => {\n const member = refOf();\n return member ? annotation.comments.getThread(member) : null;\n },\n null,\n Object.is,\n );\n return computed(() => {\n const found = thread();\n if (!found) return null;\n const root = annotationKey(found.root.ref);\n return this.threads().find((view) => annotationKey(view.root.ref) === root) ?? null;\n });\n }\n}\n","/**\n * The annotation plugin's service and feature:\n *\n * withAnnotation(options) the plugin, for provideEmbedPdf() (it needs withInteraction())\n * inject(EpdfAnnotation) create, change and delete annotations; the State table as\n * signals (`status()`, `selected()`, `hovered()`, `editing()`);\n * the parts (`selection`, `draft`, `text`, `tools`, `stamps`,\n * `links`); the events as streams (`created$`, …); the settings;\n * and the reads a template follows (`watch(filter)`,\n * `anchorOf(ref)`, `tools.defaultsOf(id)`)\n *\n * The service is both the plugin's API and its state, so the React hooks around it become\n * members: `useAnnotationList(filter)` is `annotation.watch(filter)`, `useAnnotationAnchor(ref)`\n * is `annotation.anchorOf(ref)`, `useAnnotationDefaults(id)` is `annotation.tools.defaultsOf(id)`\n * and `useAnnotationProperties()` is `annotation.selection.properties()`. Each of them takes a\n * value or a function that reads signals (`() => this.stamp().ref`), and follows it.\n */\nimport { Injectable, type Signal } from '@angular/core';\nimport {\n CapabilityBinding,\n injectDocumentScope,\n pluginService,\n type EmbedPdfFeature,\n} from '@embedpdf/angular/runtime';\nimport {\n annotationPlugin,\n annotationState,\n AnnotationToken,\n type Annotation,\n type AnnotationAnchor,\n type AnnotationConfig,\n type AnnotationDraftApi,\n type AnnotationFilter,\n type AnnotationLinksApi,\n type AnnotationProperties,\n type AnnotationRef,\n type AnnotationSelectionApi,\n type AnnotationStampsApi,\n type AnnotationTextApi,\n type AnnotationToolsApi,\n type ToolDefaults,\n type ToolDefaultsChangedEvent,\n} from '@embedpdf/plugin-annotation';\nimport {\n AnnotationToken as AnnotationHostToken,\n type AnnotationHostCapability,\n} from '@embedpdf/plugin-annotation/contract/host';\nimport { sameAnnotationAnchor } from '@embedpdf/web';\nimport type { Observable } from 'rxjs';\nimport { EpdfComments } from './comments';\n\nconst NO_ANNOTATIONS: readonly Annotation[] = Object.freeze([]);\nconst NO_DEFAULTS: ToolDefaults = Object.freeze({});\nconst NO_PROPERTIES: AnnotationProperties = Object.freeze({\n properties: [],\n values: {},\n mixed: [],\n});\n\n/** `annotation.selection`: what is selected, the verbs that change it as one, and its style panel. */\nexport interface EpdfAnnotationSelection extends AnnotationSelectionApi {\n /**\n * What a style panel shows for the selection: `{ properties, values, mixed }`, the same as\n * `getProperties()` but as a signal, so the panel follows the selection and its changes.\n * Empty with nothing selected, and without a document.\n */\n readonly properties: Signal<AnnotationProperties>;\n}\n\n/** `annotation.tools`: the tools and their defaults, with the reads a picker follows. */\nexport interface EpdfAnnotationTools extends Omit<AnnotationToolsApi, 'onDefaultsChanged'> {\n /**\n * A tool's defaults, the fields its next annotation starts with, as a signal: a color picker\n * bound to it always shows the current color. Pass the id, or a function that reads it.\n * Empty without a document.\n */\n defaultsOf(id: string | (() => string)): Signal<ToolDefaults>;\n /**\n * What a style panel for a tool shows (`{ properties, values, mixed }`), as a signal. Pass the\n * id, or a function that reads it. Empty without a document.\n */\n propertiesOf(id: string | (() => string)): Signal<AnnotationProperties>;\n /** A tool's defaults changed, from your UI or your code: `toolId`, `defaults`. */\n readonly defaultsChanged$: Observable<ToolDefaultsChangedEvent>;\n}\n\n/**\n * Annotations: `create()`, `update()`, `delete()` and the rest of the Methods tables, the\n * selecting page's State table as signals (`annotation.selected()`), the parts the capability\n * has (`annotation.selection.set(refs)`, `annotation.tools.updateDefaults(id, changes)`), its\n * events as streams (`annotation.created$`), and its settings (`annotation.settings()`,\n * `annotation.updateSettings({ chrome })`). Comments have their own service, `EpdfComments`.\n *\n * Without a document the signals read empty and the methods refuse with `not-ready`. The checks\n * (`canCreate()`, `canDelete(ref)`, `selection.canGroup()`, `stamps.isArmed()`) are state:\n * read in a template, they follow the document, its permissions and the selection.\n */\n@Injectable({ providedIn: 'root' })\nexport class EpdfAnnotation extends pluginService({\n name: 'EpdfAnnotation',\n feature: 'withAnnotation()',\n token: AnnotationToken,\n state: annotationState,\n methods: [\n 'get',\n 'list',\n 'getAt',\n 'isPending',\n 'getStatus',\n 'getHovered',\n 'refresh',\n 'create',\n 'createFromSelection',\n 'update',\n 'delete',\n 'reorder',\n 'export',\n 'import',\n 'downloadResource',\n 'setFilePickerProvider',\n 'canRead',\n 'canCreate',\n 'canUpdate',\n 'canDelete',\n 'cancel',\n ],\n events: [\n 'onCreated',\n 'onUpdated',\n 'onDeleted',\n 'onReordered',\n 'onResynced',\n 'onWriteFailed',\n 'onSelectionChanged',\n 'onDraftChanged',\n 'onEditingChanged',\n 'onHoverChanged',\n ],\n}) {\n /** The same capability, typed with the reads only framework code has (an annotation's anchor). */\n private readonly host = new CapabilityBinding<AnnotationHostCapability>(\n this.binding.host,\n () => AnnotationHostToken,\n injectDocumentScope(),\n );\n\n /** The selection: `set(refs)`, `update(changes)`, `delete()`, … and `properties()`. */\n readonly selection: EpdfAnnotationSelection = {\n set: this.binding.namespaceMethod('selection', 'set'),\n add: this.binding.namespaceMethod('selection', 'add'),\n selectAll: this.binding.namespaceMethod('selection', 'selectAll'),\n selectInRect: this.binding.namespaceMethod('selection', 'selectInRect'),\n clear: this.binding.namespaceMethod('selection', 'clear'),\n list: this.binding.namespaceMethod('selection', 'list'),\n update: this.binding.namespaceMethod('selection', 'update'),\n updateLink: this.binding.namespaceMethod('selection', 'updateLink'),\n getProperties: this.binding.namespaceMethod('selection', 'getProperties'),\n delete: this.binding.namespaceMethod('selection', 'delete'),\n rotateBy: this.binding.namespaceMethod('selection', 'rotateBy'),\n resetRotation: this.binding.namespaceMethod('selection', 'resetRotation'),\n group: this.binding.namespaceMethod('selection', 'group'),\n ungroup: this.binding.namespaceMethod('selection', 'ungroup'),\n canGroup: this.binding.namespaceMethod('selection', 'canGroup'),\n canUngroup: this.binding.namespaceMethod('selection', 'canUngroup'),\n getAnchor: this.binding.namespaceMethod('selection', 'getAnchor'),\n getRotationAnchor: this.binding.namespaceMethod('selection', 'getRotationAnchor'),\n // The plugin hands out the same object while nothing changes.\n properties: this.binding.select(\n (annotation) => annotation.selection.getProperties(),\n NO_PROPERTIES,\n Object.is,\n ),\n };\n\n /** A polygon or polyline being drawn: `get()`, `finish()`, `cancel()`. */\n readonly draft: AnnotationDraftApi = {\n get: this.binding.namespaceMethod('draft', 'get'),\n finish: this.binding.namespaceMethod('draft', 'finish'),\n cancel: this.binding.namespaceMethod('draft', 'cancel'),\n };\n\n /** Typing in a text box: `begin(ref)`, `end()`, `getEditing()`, `toggleFormat(format)`. */\n readonly text: AnnotationTextApi = {\n begin: this.binding.namespaceMethod('text', 'begin'),\n end: this.binding.namespaceMethod('text', 'end'),\n getEditing: this.binding.namespaceMethod('text', 'getEditing'),\n toggleFormat: this.binding.namespaceMethod('text', 'toggleFormat'),\n };\n\n /** The tools: `list()`, `register(tool)`, `updateDefaults(id, changes)`, `defaultsOf(id)`, … */\n readonly tools: EpdfAnnotationTools = {\n list: this.binding.namespaceMethod('tools', 'list'),\n get: this.binding.namespaceMethod('tools', 'get'),\n register: this.binding.namespaceMethod('tools', 'register'),\n getDefaults: this.binding.namespaceMethod('tools', 'getDefaults'),\n updateDefaults: this.binding.namespaceMethod('tools', 'updateDefaults'),\n getProperties: this.binding.namespaceMethod('tools', 'getProperties'),\n // The plugin hands out the same object until the tool's defaults change.\n defaultsOf: (id) => {\n const idOf = typeof id === 'function' ? id : () => id;\n return this.binding.select(\n (annotation) => annotation.tools.getDefaults(idOf()),\n NO_DEFAULTS,\n Object.is,\n );\n },\n propertiesOf: (id) => {\n const idOf = typeof id === 'function' ? id : () => id;\n return this.binding.select(\n (annotation) => annotation.tools.getProperties(idOf()),\n NO_PROPERTIES,\n );\n },\n defaultsChanged$: this.binding.stream((annotation) => annotation.tools.onDefaultsChanged),\n };\n\n /** Stamps from bytes: `arm(stamp)`, `disarm()`, `isArmed()`, `place(stamp, placement)`. */\n readonly stamps: AnnotationStampsApi = {\n arm: this.binding.namespaceMethod('stamps', 'arm'),\n disarm: this.binding.namespaceMethod('stamps', 'disarm'),\n isArmed: this.binding.namespaceMethod('stamps', 'isArmed'),\n place: this.binding.namespaceMethod('stamps', 'place'),\n };\n\n /** An annotation's link: `get(ref)`, `set(ref, target)`, `clear(ref)`. */\n readonly links: AnnotationLinksApi = {\n get: this.binding.namespaceMethod('links', 'get'),\n set: this.binding.namespaceMethod('links', 'set'),\n clear: this.binding.namespaceMethod('links', 'clear'),\n };\n\n /**\n * The annotations matching `filter` (some pages, one kind), in drawing order, as the user sees\n * them: a signal that keeps the same array while they stay the same. Pass the filter, or a\n * function that reads it (`() => ({ pages: [this.page()] })`). Empty without a document.\n * Call it once, in a field or the constructor, and read the signal in your template.\n */\n watch(\n filter?: AnnotationFilter | null | (() => AnnotationFilter | null | undefined),\n ): Signal<readonly Annotation[]> {\n const filterOf = typeof filter === 'function' ? filter : () => filter;\n return this.binding.select(\n (annotation) => annotation.list(filterOf() ?? undefined),\n NO_ANNOTATIONS,\n );\n }\n\n /**\n * An anchor for `<epdf-anchored>` that keeps a card or a badge on one annotation: its page and\n * the box around what it shows, following a move as it happens. Pass the ref, or a function\n * that reads it (`() => this.hovered()?.ref ?? null`). Null for null, or an annotation that\n * isn't here. It changes when the annotation moves, not while people scroll or zoom.\n */\n anchorOf(\n ref: AnnotationRef | null | (() => AnnotationRef | null | undefined),\n ): Signal<AnnotationAnchor | null> {\n const refOf = typeof ref === 'function' ? ref : () => ref;\n return this.host.select(\n (annotation) => {\n const target = refOf();\n return target ? annotation.getAnnotationAnchor(target) : null;\n },\n null,\n sameAnnotationAnchor,\n );\n }\n}\n\n/**\n * The annotation plugin: drawing, selecting, changing and saving annotations, and comments. It\n * works with the interaction plugin, so give `withInteraction()` too, and an\n * `<epdf-annotation-layer>` in each page:\n * `provideEmbedPdf({ engine }, withStage(), withRender(), withInteraction(), withAnnotation())`.\n */\nexport function withAnnotation(options?: AnnotationConfig): EmbedPdfFeature {\n return { plugins: [annotationPlugin(options)], services: [EpdfAnnotation, EpdfComments] };\n}\n","/**\n * `withFilePicker(provider?)`: where the `stamp` and `attachment` tools get their file after a\n * click. The plugin has no DOM, so it asks a provider, and this feature gives it one: the\n * browser's file dialog by default, or your own function (a stamp library, a cloud drive).\n *\n * provideEmbedPdf({ engine }, withStage(), withInteraction(), withAnnotation(), withFilePicker())\n *\n * React installs it with a hook in an always-mounted component; in Angular it is app-wide setup,\n * so it is a feature of `provideEmbedPdf()`.\n */\nimport { DestroyRef, inject } from '@angular/core';\nimport { devWarn, injectKernelHost, type EmbedPdfFeature } from '@embedpdf/angular/runtime';\nimport {\n AnnotationToken,\n type AnnotationCapability,\n type FilePickerProvider,\n} from '@embedpdf/plugin-annotation';\nimport { pickRequestedFile } from '@embedpdf/web';\n\n/**\n * The browser's file dialog, filtered by the tool's `accept`: what `withFilePicker()` installs\n * when you give it nothing. A picked `File` carries its own name and type.\n */\nexport const filePickerProvider: FilePickerProvider = pickRequestedFile;\n\n/**\n * The file dialog behind every click-then-pick tool, for every document the viewer opens.\n * Without an argument it is the browser's dialog ({@link filePickerProvider}); pass your own\n * function to pick from your library (it gets the tool, the page and the point, and returns the\n * file or `null` to cancel), or `null` to make those tools do nothing.\n */\nexport function withFilePicker(\n provider: FilePickerProvider | null = filePickerProvider,\n): EmbedPdfFeature {\n return { plugins: [], setup: () => installFilePicker(provider) };\n}\n\n/** Give every open document's annotation plugin the provider, for as long as the viewer lives. */\nfunction installFilePicker(provider: FilePickerProvider | null): void {\n const host = injectKernelHost('withFilePicker()');\n if (!host.provides(AnnotationToken)) {\n devWarn(\n 'file-picker-without-annotation',\n 'withFilePicker() has no annotation plugin to give its file dialog to. Add withAnnotation() to provideEmbedPdf().',\n );\n return;\n }\n // One install per document's plugin, removed when the document closes.\n const installed = new Map<AnnotationCapability, () => void>();\n // On every change of the kernel, not in an effect: a document is given the provider in the\n // same change that makes it ready, before anyone can click with a stamp tool.\n const follow = () => {\n const kernel = host.kernel();\n if (!kernel) return;\n const open = new Set<AnnotationCapability>();\n for (const document of kernel.documents.list()) {\n const annotation = kernel.tryCapability(AnnotationToken, document.id);\n if (!annotation) continue;\n open.add(annotation);\n if (!installed.has(annotation)) {\n installed.set(annotation, annotation.setFilePickerProvider(provider));\n }\n }\n for (const [annotation, remove] of installed) {\n if (open.has(annotation)) continue;\n remove();\n installed.delete(annotation);\n }\n };\n const stop = host.subscribe(follow);\n follow();\n inject(DestroyRef).onDestroy(() => {\n stop();\n for (const remove of installed.values()) remove();\n installed.clear();\n });\n}\n","/**\n * What the annotation layer's parts read about their page: the plugin's host side for the page's\n * own document, and the page's view as signals that change only when what they hold does. A\n * Stage hands every page a new transform on every frame, also during a plain scroll, which moves\n * the page but changes nothing inside it; these keep a scroll from redrawing the annotations.\n */\nimport { computed, type Signal } from '@angular/core';\nimport { samePagePlacement, type PageTransform } from '@embedpdf/core-geometry';\nimport type { ViewEnv } from '@embedpdf/core-annotation';\nimport { CapabilityBinding, injectKernelHost, type EpdfPageContext } from '@embedpdf/angular/runtime';\nimport {\n AnnotationToken as AnnotationHostToken,\n type AnnotationHostCapability,\n} from '@embedpdf/plugin-annotation/contract/host';\n\n/**\n * The annotation plugin's host side (the reads only framework code has: items, chrome, text\n * boxes), for the document the page belongs to. Call it in an injection context.\n */\nexport function annotationHostOf(\n page: EpdfPageContext,\n what: string,\n): CapabilityBinding<AnnotationHostCapability> {\n return new CapabilityBinding<AnnotationHostCapability>(\n injectKernelHost(what),\n () => AnnotationHostToken,\n () => page.documentId,\n );\n}\n\n/**\n * The page's zoom and turn, for the plugin's reads: it projects what keeps its size or stays\n * upright on screen (`noZoom`, `noRotate`). `zoom`, not `viewScale`: 1 is the page's 100%.\n */\nexport function pageViewOf(page: EpdfPageContext): Signal<ViewEnv> {\n return computed(\n () => {\n const transform = page.transform();\n return { zoom: transform.zoom, rotation: transform.rotation };\n },\n { equal: (left, right) => left.zoom === right.zoom && left.rotation === right.rotation },\n );\n}\n\n/** The page's transform for placing things in its pixels: the same while only a scroll moves it. */\nexport function pagePixelsOf(page: EpdfPageContext): Signal<PageTransform> {\n return computed(() => page.transform(), { equal: samePagePlacement });\n}\n","/**\n * The selection chrome's settings, for the parts that paint it: the plugin's `chrome` settings\n * and the viewer's accent, which a chrome color left `null` follows. Settings belong to the\n * plugin, not to a document, so they read before any document opens.\n */\nimport { computed, type Signal } from '@angular/core';\nimport { injectKernelHost } from '@embedpdf/angular/runtime';\nimport {\n ANNOTATION_DEFAULTS,\n AnnotationToken,\n type AnnotationSettings,\n type ChromeSettings,\n} from '@embedpdf/plugin-annotation';\n\nexport interface ChromeSettingsSignals {\n /** The `chrome` settings: the same object until one of them changes. */\n readonly chrome: Signal<ChromeSettings>;\n /** The viewer's accent. */\n readonly accent: Signal<string>;\n}\n\n/** The chrome settings and the accent, as signals. Call it in an injection context. */\nexport function injectChromeSettings(): ChromeSettingsSignals {\n const host = injectKernelHost('<epdf-annotation-layer>');\n // Without the plugin there is nothing to paint; the defaults keep the reads simple.\n const settings: Signal<AnnotationSettings> = host.provides(AnnotationToken)\n ? host.settingsOf<AnnotationSettings>(AnnotationToken).current\n : computed(() => ANNOTATION_DEFAULTS);\n return {\n chrome: computed(() => settings().chrome),\n accent: computed(() => host.viewerSettings().accent),\n };\n}\n","/**\n * The selection's chrome on one page: its outline, handles and rotation handle, the guides of a\n * snapped move or a turn, and the box dragged to select. The plugin lists the chrome in page\n * points, already sized for the page's zoom; `@embedpdf/web` puts it in the layer's pixels and\n * paints it from the `chrome` settings, each color, width and dash behind its\n * `--epdf-annotation-*` variable. This component only draws: the viewer decides where a handle\n * can be grabbed, so handles drawn by the app's templates can't break dragging.\n *\n * Paint goes in `style`: an SVG attribute doesn't read `var()`.\n */\nimport { NgTemplateOutlet } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input, type TemplateRef } from '@angular/core';\nimport { injectPage } from '@embedpdf/angular/runtime';\nimport type { ChromeNode } from '@embedpdf/core-annotation';\nimport type { ChromeSettings } from '@embedpdf/plugin-annotation';\nimport { annotationChromePaint, chromeInPixels, type ChromeInPixels } from '@embedpdf/web';\nimport type {\n EpdfHandleTemplateContext,\n EpdfRotationHandleTemplateContext,\n HandleProps,\n RotationHandleProps,\n} from './templates';\nimport { annotationHostOf, pagePixelsOf } from './page-reads';\nimport { injectChromeSettings } from './settings';\n\nconst NO_NODES: readonly ChromeNode[] = Object.freeze([]);\n\n/** A chrome node, with what a template of the app's draws for it when it's a handle. */\ntype ChromeView = ChromeInPixels & {\n /** The props for the app's handle template, when it has one for this node. */\n readonly custom?: HandleProps | RotationHandleProps;\n};\n\n@Component({\n selector: 'epdf-annotation-chrome',\n imports: [NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { style: 'display: contents' },\n template: `\n <svg style=\"position: absolute; inset: 0; overflow: visible; pointer-events: none\">\n @for (node of nodes(); track $index) {\n @switch (node.kind) {\n @case ('handle') {\n @if (node.kind === 'handle' && !node.custom) {\n @if (chrome().handles.shape === 'circle') {\n <svg:circle\n [attr.cx]=\"node.at.x\"\n [attr.cy]=\"node.at.y\"\n [attr.r]=\"chrome().handles.size / 2\"\n stroke-width=\"1.5\"\n [style.fill]=\"paint().handle.fill\"\n [style.stroke]=\"paint().handle.stroke\"\n ></svg:circle>\n } @else {\n <!-- The square rides a turned box: it spins about itself. -->\n <svg:rect\n [attr.x]=\"node.at.x - chrome().handles.size / 2\"\n [attr.y]=\"node.at.y - chrome().handles.size / 2\"\n [attr.width]=\"chrome().handles.size\"\n [attr.height]=\"chrome().handles.size\"\n [attr.transform]=\"\n node.rotation ? 'rotate(' + node.rotation + ' ' + node.at.x + ' ' + node.at.y + ')' : null\n \"\n stroke-width=\"1.5\"\n [style.fill]=\"paint().handle.fill\"\n [style.stroke]=\"paint().handle.stroke\"\n ></svg:rect>\n }\n }\n }\n @case ('guide') {\n @if (node.kind === 'guide') {\n <svg:line\n [attr.x1]=\"node.from.x\"\n [attr.y1]=\"node.from.y\"\n [attr.x2]=\"node.to.x\"\n [attr.y2]=\"node.to.y\"\n shape-rendering=\"crispEdges\"\n [style.stroke]=\"paint().guide.stroke\"\n [style.stroke-width]=\"paint().guide.strokeWidth\"\n [style.stroke-dasharray]=\"paint().guide.strokeDasharray\"\n ></svg:line>\n }\n }\n @case ('turned-outline') {\n @if (node.kind === 'turned-outline') {\n <svg:polygon\n [attr.points]=\"node.points\"\n fill=\"none\"\n [style.stroke]=\"paint().outline.stroke\"\n [style.stroke-width]=\"paint().outline.strokeWidth\"\n [style.stroke-dasharray]=\"paint().outline.strokeDasharray\"\n ></svg:polygon>\n }\n }\n @case ('rotation-guides') {\n @if (node.kind === 'rotation-guides') {\n <svg:g>\n @for (line of node.lines; track $index) {\n <svg:line\n [attr.x1]=\"line.from.x\"\n [attr.y1]=\"line.from.y\"\n [attr.x2]=\"line.to.x\"\n [attr.y2]=\"line.to.y\"\n [attr.opacity]=\"line.opacity\"\n [style.stroke]=\"paint().rotationGuide.stroke\"\n [style.stroke-width]=\"paint().rotationGuide.strokeWidth\"\n [style.stroke-dasharray]=\"paint().rotationGuide.strokeDasharray\"\n ></svg:line>\n }\n </svg:g>\n }\n }\n @case ('rotation-handle') {\n @if (node.kind === 'rotation-handle' && !node.custom) {\n <svg:g>\n @if (chrome().rotationHandle.stalk) {\n <svg:line\n [attr.x1]=\"node.from.x\"\n [attr.y1]=\"node.from.y\"\n [attr.x2]=\"node.at.x\"\n [attr.y2]=\"node.at.y\"\n stroke-width=\"1\"\n [style.stroke]=\"paint().rotationHandle.stroke\"\n ></svg:line>\n }\n <svg:circle\n [attr.cx]=\"node.at.x\"\n [attr.cy]=\"node.at.y\"\n [attr.r]=\"chrome().rotationHandle.size / 2\"\n stroke-width=\"1.5\"\n [style.fill]=\"paint().rotationHandle.fill\"\n [style.stroke]=\"paint().rotationHandle.stroke\"\n ></svg:circle>\n </svg:g>\n }\n }\n <!-- The box dragged to select keeps its own look (a see-through accent fill, always\n dashed); the selection outline follows the settings. -->\n @case ('marquee') {\n @if (node.kind === 'marquee') {\n <svg:rect\n [attr.x]=\"node.box.left\"\n [attr.y]=\"node.box.top\"\n [attr.width]=\"node.box.width\"\n [attr.height]=\"node.box.height\"\n stroke-width=\"1\"\n stroke-dasharray=\"4 3\"\n [style.fill]=\"paint().marquee.fill\"\n [style.stroke]=\"paint().marquee.stroke\"\n ></svg:rect>\n }\n }\n @case ('outline') {\n @if (node.kind === 'outline') {\n <svg:rect\n [attr.x]=\"node.box.left\"\n [attr.y]=\"node.box.top\"\n [attr.width]=\"node.box.width\"\n [attr.height]=\"node.box.height\"\n fill=\"none\"\n [style.stroke]=\"paint().outline.stroke\"\n [style.stroke-width]=\"paint().outline.strokeWidth\"\n [style.stroke-dasharray]=\"paint().outline.strokeDasharray\"\n ></svg:rect>\n }\n }\n }\n }\n </svg>\n <!-- The app's own handles draw as HTML over the page; the layer's as SVG. -->\n @if (hasCustom()) {\n <div style=\"position: absolute; inset: 0; pointer-events: none\">\n @for (node of nodes(); track $index) {\n @if (node.custom; as props) {\n @if (node.kind === 'handle') {\n <ng-container\n [ngTemplateOutlet]=\"handle()\"\n [ngTemplateOutletContext]=\"{ $implicit: props }\"\n />\n } @else {\n <ng-container\n [ngTemplateOutlet]=\"rotationHandle()\"\n [ngTemplateOutletContext]=\"{ $implicit: props }\"\n />\n }\n }\n }\n </div>\n }\n `,\n})\nexport class EpdfAnnotationChrome {\n /** The app's handle template, drawn in place of the layer's handles. */\n readonly handle = input<TemplateRef<EpdfHandleTemplateContext> | null>(null);\n /** The app's rotation handle template, drawn in place of the layer's. */\n readonly rotationHandle = input<TemplateRef<EpdfRotationHandleTemplateContext> | null>(null);\n\n private readonly page = injectPage('<epdf-annotation-layer>');\n private readonly annotation = annotationHostOf(this.page, '<epdf-annotation-layer>');\n private readonly pixels = pagePixelsOf(this.page);\n private readonly settings = injectChromeSettings();\n\n protected readonly chrome = computed((): ChromeSettings => this.settings.chrome());\n protected readonly paint = computed(() =>\n annotationChromePaint(this.settings.chrome(), this.settings.accent()),\n );\n\n // The page's view scale turns the screen-pixel chrome settings into page units inside the\n // plugin (the rotation handle's offset, the grab zones): the same size on screen at every\n // zoom. What it lists comes back in page points; `chromeInPixels` places it.\n private readonly listed = this.annotation.select((annotation) => {\n const transform = this.pixels();\n return annotation.listChromeNodes(\n this.page.ref,\n transform.viewScale,\n transform.rotation,\n transform.zoom,\n );\n }, NO_NODES);\n\n protected readonly nodes = computed((): readonly ChromeView[] => {\n const handle = this.handle();\n const rotationHandle = this.rotationHandle();\n const chrome = this.settings.chrome();\n return chromeInPixels(this.listed(), this.pixels()).map((node): ChromeView => {\n if (node.kind === 'handle' && handle) {\n const custom: HandleProps = {\n at: node.at,\n size: chrome.handles.size,\n rotation: node.rotation,\n kind: node.role,\n active: node.active,\n };\n return { ...node, custom };\n }\n if (node.kind === 'rotation-handle' && rotationHandle) {\n // A drawn rotation handle doesn't turn, and isn't told when it's dragged.\n const custom: RotationHandleProps = {\n at: node.at,\n from: node.from,\n size: chrome.rotationHandle.size,\n rotation: 0,\n active: false,\n };\n return { ...node, custom };\n }\n return node;\n });\n });\n\n protected readonly hasCustom = computed(() => this.nodes().some((node) => node.custom));\n}\n","/**\n * How the layer draws one annotation, the parts its template is built from:\n *\n * [epdfAnnotationFrame] the box an annotation draws into, placed and turned like it\n * <epdf-annotation-native> its own drawing in that box: the engine's picture or its scene\n *\n * No bounds math and no per-kind logic: the core computes each item's frame, box and scene,\n * and `@embedpdf/web` turns them into pixels and SVG elements, the same for every framework.\n */\nimport { ChangeDetectionStrategy, Component, computed, Directive, input } from '@angular/core';\nimport { EpdfSvgShapes } from '@embedpdf/angular/runtime';\nimport { MITER_LIMIT, scene, type RenderItem } from '@embedpdf/core-annotation';\nimport {\n ghostOpacity,\n rasterInFrame,\n sceneViewBox,\n svgShapesOf,\n type FramePixels,\n type PictureOrPainting,\n} from '@embedpdf/web';\n\n/**\n * The box an annotation draws into, in the page layer: placed, sized and turned like the\n * annotation (`item.frame`), inside the page layer that the page itself turns. Its blend is on\n * the box: a turned box groups what is in it, so blending an element inside would stop\n * blending with the page. It takes the pointer only for a look that does (`interactive`), and\n * `inert` keeps the pointer and the focus out of a look that only draws.\n */\n@Directive({\n selector: '[epdfAnnotationFrame]',\n host: {\n style: 'position: absolute; transform-origin: center',\n '[style.left.px]': 'frame().left',\n '[style.top.px]': 'frame().top',\n '[style.width.px]': 'frame().width',\n '[style.height.px]': 'frame().height',\n '[style.transform]': 'frame().transform ?? null',\n '[style.mix-blend-mode]': 'blend() ?? null',\n // An interactive look takes the pointer: the layer's own `none` ends here.\n '[style.pointer-events]': \"interactive() ? 'auto' : 'none'\",\n '[attr.inert]': \"inert() ? '' : null\",\n },\n})\nexport class EpdfAnnotationFrame {\n readonly frame = input.required<FramePixels>({ alias: 'epdfAnnotationFrame' });\n readonly blend = input<string | undefined>(undefined, { alias: 'frameBlend' });\n readonly interactive = input(false, { alias: 'frameInteractive' });\n readonly inert = input(false, { alias: 'frameInert' });\n}\n\n/**\n * The scene, filling the item's frame: drawn upright in it, the frame turns it. Nothing until\n * the item has area (the 0×0 drawing at a press). The SVG and its viewBox stay proportional:\n * never clamp either one.\n */\n@Component({\n selector: 'epdf-annotation-scene',\n imports: [EpdfSvgShapes],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { style: 'display: contents' },\n template: `\n @if (viewBox(); as viewBox) {\n <svg\n style=\"position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none\"\n [attr.viewBox]=\"viewBox\"\n [style.opacity]=\"opacity()\"\n >\n <svg:g [epdfSvgShapes]=\"shapes()\"></svg:g>\n </svg>\n }\n `,\n})\nexport class EpdfAnnotationScene {\n readonly item = input.required<RenderItem>();\n\n protected readonly viewBox = computed(() => sceneViewBox(this.item().box));\n protected readonly shapes = computed(() =>\n svgShapesOf(scene(this.item()), { miterLimit: MITER_LIMIT }),\n );\n /** A ghost is see-through as a whole, so its fill and stroke don't stack. */\n protected readonly opacity = computed(() => {\n const item = this.item();\n return item.source === 'ghost' ? ghostOpacity(item.ghostOpacity ?? 0.5) : null;\n });\n}\n\n/**\n * An annotation's own drawing, filling its frame: the engine's picture where the core places it\n * (following a move as it happens), or its scene, as the layer's one rule picks (`shows`,\n * `pictureOrPainting`).\n */\n@Component({\n selector: 'epdf-annotation-native',\n imports: [EpdfAnnotationScene],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { style: 'display: contents' },\n template: `\n @if (shows()?.kind === 'painting') {\n <epdf-annotation-scene [item]=\"item()\" />\n } @else if (picture() && raster(); as box) {\n <!-- An explicit size, never clamped by a global img reset (a landscape stamp on a\n turned page is wider than its containing block); the turn the engine took out\n of the picture goes back on about its middle. -->\n <img\n alt=\"\"\n draggable=\"false\"\n style=\"position: absolute; max-width: none; max-height: none; pointer-events: none; transform-origin: center\"\n [attr.src]=\"picture()\"\n [style.left]=\"box.left\"\n [style.top]=\"box.top\"\n [style.width]=\"box.width\"\n [style.height]=\"box.height\"\n [style.transform]=\"box.transform ?? null\"\n />\n }\n `,\n})\nexport class EpdfAnnotationNative {\n readonly item = input.required<RenderItem>();\n /** What it shows: the engine's picture, its scene, or nothing yet. */\n readonly shows = input<PictureOrPainting<RenderItem>>(null);\n\n protected readonly picture = computed(() => {\n const shows = this.shows();\n return shows?.kind === 'picture' ? shows.picture.url : null;\n });\n protected readonly raster = computed(() => {\n const item = this.item();\n return item.raster ? rasterInFrame(item.raster, item.frame) : null;\n });\n}\n","/**\n * The templates `<epdf-annotation-layer>` draws with, in place of React's `renderers` and\n * `components` props:\n *\n * <epdf-annotation-layer>\n * <ng-template [epdfAnnotation]=\"isNote\" let-annotation let-frame=\"frame\">… your look\n * <ng-template epdfHandle let-handle>… your handles\n * <ng-template epdfRotationHandle let-handle>… your rotation handle\n * </epdf-annotation-layer>\n *\n * A look (`epdfAnnotation`) is a renderer: which annotations it draws (a function of the\n * annotation, or a subtype such as `'stamp'`), whether it takes the pointer\n * (`epdfAnnotationInteractive`) and whether the layer scales it with the page\n * (`epdfAnnotationScale`). The first look that matches an annotation draws it.\n *\n * Which drawing each annotation gets, and the behaviors an interactive look registers, are\n * `@embedpdf/web`'s, keyed by the identity of each renderer entry. The page template, and with it\n * every template inside it, is made once per page on screen, so the entries here are interned:\n * the same rule (the same function or subtype, the same options) is the same entry on every\n * page, registered once.\n */\nimport {\n booleanAttribute,\n computed,\n Directive,\n inject,\n input,\n TemplateRef,\n type Signal,\n} from '@angular/core';\nimport type { EpdfPageContext } from '@embedpdf/angular/runtime';\nimport type { Point, RenderItem } from '@embedpdf/core-annotation';\nimport type {\n Annotation,\n AnnotationRotationAnchor,\n AnnotationSubtype,\n HandleRole,\n} from '@embedpdf/plugin-annotation';\n\n// ── what the templates get ───────────────────────────────────────────────────\n\n/** The box a look draws into: the size to draw at, how it's turned, and how it's scaled. */\nexport interface AnnotationFrame {\n /** Its width in pixels at the annotation's 100% size, before its turn: draw at this. */\n readonly width: number;\n /** Its height in pixels at the annotation's 100% size, before its turn: draw at this. */\n readonly height: number;\n /**\n * How it's turned on screen, degrees clockwise: the page's turn and the annotation's own. 0 is\n * upright; turn your content by `-rotation` to keep it upright.\n */\n readonly rotation: number;\n /**\n * How much the layer scales what you draw, with the page: the zoom, or for an annotation that\n * keeps its size on screen, the zoom up to 1.\n */\n readonly scale: number;\n}\n\n/** What an `epdfAnnotationInteractive` function is asked: the annotation, and the active tool. */\nexport interface AnnotationInteractiveContext {\n readonly annotation: Annotation;\n readonly toolId: string;\n}\n\n/**\n * What a look's template gets. `let-annotation` is the annotation; the rest are named:\n * `let-frame=\"frame\"`, `let-hovered=\"hovered\"`, `let-native=\"native\"`.\n */\nexport interface EpdfAnnotationTemplateContext {\n /** The annotation, as `get()` returns it. */\n $implicit: Annotation;\n /** The same annotation, by name. */\n annotation: Annotation;\n /**\n * The box you draw into. The layer places, turns and scales it like the annotation's own\n * drawing, also during a drag, a resize or a turn. Fill it (`width: 100%; height: 100%`) and\n * draw at the annotation's 100% size: your text and borders scale with the page.\n */\n frame: AnnotationFrame;\n /**\n * The layer's own drawing of it, filling the frame: `<ng-container [ngTemplateOutlet]=\"native\" />`\n * keeps the original look, to add to it.\n */\n native: TemplateRef<unknown>;\n /** The engine's picture of the annotation as an image (`url`), or `null`. `native` draws it in place. */\n appearance: { url: string } | null;\n /** True while the pointer is over it. */\n hovered: boolean;\n /** True while it's selected. */\n selected: boolean;\n /** True when what you draw takes the pointer (see `epdfAnnotationInteractive`). */\n interactive: boolean;\n}\n\n/**\n * What a sibling plugin's template gets for the annotations its behavior owns (a form plugin's\n * fill controls). It places its own controls: `item` is the layer's projection of the annotation\n * in page coordinates, and `page.transform().toPixels()` turns those into the layer's pixels.\n */\nexport interface EpdfAnnotationBehaviorTemplateContext {\n $implicit: Annotation;\n annotation: Annotation;\n item: RenderItem;\n page: EpdfPageContext;\n /** The layer's own drawing of it, in its frame where the layer draws it. */\n native: TemplateRef<unknown>;\n hovered: boolean;\n selected: boolean;\n interactive: boolean;\n}\n\n/** One handle to draw yourself (`let-handle` in `<ng-template epdfHandle>`). */\nexport interface HandleProps {\n /** The handle's center, in pixels on the page. */\n readonly at: Point;\n /** The `size` from the settings, px. */\n readonly size: number;\n /** The selection's rotation (degrees clockwise), so a square handle can turn with it. */\n readonly rotation: number;\n /** A box's `'corner'` or `'side'`, or one `'point'` of a line or a polygon. */\n readonly kind: HandleRole;\n /** True while it's being dragged. */\n readonly active: boolean;\n}\n\n/** The rotation handle to draw yourself: a handle's props, and where its stalk starts on the box. */\nexport interface RotationHandleProps extends Omit<HandleProps, 'kind'> {\n /** Where the stalk starts on the box, in pixels on the page. */\n readonly from: Point;\n}\n\nexport interface EpdfHandleTemplateContext {\n $implicit: HandleProps;\n}\n\nexport interface EpdfRotationHandleTemplateContext {\n $implicit: RotationHandleProps;\n}\n\nexport interface EpdfRotationBadgeTemplateContext {\n /** The turn in progress: its `page`, the pointer's point `at`, and the `angle` so far. */\n $implicit: AnnotationRotationAnchor;\n}\n\n// ── the renderer entries ─────────────────────────────────────────────────────\n\n/** Which annotations a look draws: a function of the annotation, or every one of a subtype. */\nexport type AnnotationMatch = ((annotation: Annotation) => boolean) | AnnotationSubtype;\n\n/** Whether a look takes the pointer: always, never, or when the function says so. */\nexport type AnnotationInteractive = boolean | ((context: AnnotationInteractiveContext) => boolean);\n\n/** A look as `@embedpdf/web` sees it: a renderer entry, the same object for the same rule. */\nexport interface AnnotationLookRenderer {\n readonly for: (annotation: Annotation) => boolean;\n readonly interactive: AnnotationInteractive;\n readonly scale: boolean;\n}\n\n/** A sibling plugin's renderer entry: it draws what the behavior `behavior` owns. */\nexport interface AnnotationBehaviorRenderer {\n readonly behavior: string;\n}\n\nexport type AnnotationRendererEntry = AnnotationLookRenderer | AnnotationBehaviorRenderer;\n\nconst subtypeMatchers = new Map<string, (annotation: Annotation) => boolean>();\nconst ALWAYS = {};\nconst NEVER = {};\nconst SCALED = {};\nconst UNSCALED = {};\nconst looks = new WeakMap<object, WeakMap<object, WeakMap<object, AnnotationLookRenderer>>>();\nconst behaviors = new Map<string, AnnotationBehaviorRenderer>();\n\n/** A table under `key` in `table`, made on first use. */\nfunction tableIn<Value extends object>(\n table: WeakMap<object, Value>,\n key: object,\n make: () => Value,\n): Value {\n let found = table.get(key);\n if (!found) table.set(key, (found = make()));\n return found;\n}\n\n/** The one entry for a look's rule: the same match, interactivity and scaling give the same object. */\nfunction lookRendererOf(\n match: AnnotationMatch,\n interactive: AnnotationInteractive,\n scale: boolean,\n): AnnotationLookRenderer {\n let matcher: (annotation: Annotation) => boolean;\n if (typeof match === 'function') {\n matcher = match;\n } else {\n matcher = subtypeMatchers.get(match) ?? ((annotation) => annotation.subtype === match);\n subtypeMatchers.set(match, matcher);\n }\n const interactiveKey = typeof interactive === 'function' ? interactive : interactive ? ALWAYS : NEVER;\n const byInteractive = tableIn(looks, matcher, () => new WeakMap());\n const byScale = tableIn(byInteractive, interactiveKey, () => new WeakMap());\n return tableIn(byScale, scale ? SCALED : UNSCALED, () =>\n Object.freeze({ for: matcher, interactive, scale }),\n );\n}\n\n/** `epdfAnnotationInteractive` with no value (`<ng-template … epdfAnnotationInteractive>`) is `true`. */\nfunction interactiveAttribute(\n value: AnnotationInteractive | '' | 'true' | 'false' | null | undefined,\n): AnnotationInteractive {\n if (typeof value === 'function') return value;\n return value === '' || value === true || value === 'true';\n}\n\n// ── the marker directives ────────────────────────────────────────────────────\n\n/**\n * Your own look for some annotations: `<ng-template [epdfAnnotation]=\"isNote\" let-annotation>`.\n * Give it a function that picks annotations by any field, or a subtype\n * (`epdfAnnotation=\"stamp\"`). Without `epdfAnnotationInteractive` it only draws: the layer keeps\n * handling the pointer (select, move, resize). With it (or a function the layer asks whenever it\n * matters) your template takes the pointer, and the annotation can't be selected or moved while\n * it does. `[epdfAnnotationScale]=\"false\"` draws at the size on screen instead of the\n * annotation's 100% size.\n */\n@Directive({ selector: 'ng-template[epdfAnnotation]' })\nexport class EpdfAnnotationTemplate {\n /**\n * Which annotations it draws: a function of the annotation, or a subtype. (Not a required\n * input: a template inside `@if` is in the layer's query a moment before its inputs are set.)\n */\n readonly match = input<AnnotationMatch | undefined>(undefined, { alias: 'epdfAnnotation' });\n /** Whether it takes the pointer: present (or `true`), or a function of `{ annotation, toolId }`. */\n readonly interactive = input<\n AnnotationInteractive,\n AnnotationInteractive | '' | 'true' | 'false' | null | undefined\n >(false, { alias: 'epdfAnnotationInteractive', transform: interactiveAttribute });\n /** Scale what you draw with the page (the default), or draw at the size on screen (`false`). */\n readonly scale = input(true, { alias: 'epdfAnnotationScale', transform: booleanAttribute });\n\n readonly template = inject<TemplateRef<EpdfAnnotationTemplateContext>>(TemplateRef);\n /** Its renderer entry, the same object on every page for the same rule; null until it has one. */\n readonly renderer: Signal<AnnotationLookRenderer | null> = computed(() => {\n const match = this.match();\n return match ? lookRendererOf(match, this.interactive(), this.scale()) : null;\n });\n\n static ngTemplateContextGuard(\n _directive: EpdfAnnotationTemplate,\n context: unknown,\n ): context is EpdfAnnotationTemplateContext {\n return true;\n }\n}\n\n/**\n * What a sibling plugin's behavior owns, drawn by your template while the behavior is engaged:\n * `<ng-template epdfAnnotationBehavior=\"form-fill\" let-annotation let-item=\"item\">`. The\n * template places its own controls and takes the input.\n */\n@Directive({ selector: 'ng-template[epdfAnnotationBehavior]' })\nexport class EpdfAnnotationBehaviorTemplate {\n /** The behavior's id, as its plugin registers it. */\n readonly behavior = input<string | undefined>(undefined, { alias: 'epdfAnnotationBehavior' });\n\n readonly template = inject<TemplateRef<EpdfAnnotationBehaviorTemplateContext>>(TemplateRef);\n /** Its renderer entry, the same object for the same behavior; null until it has one. */\n readonly renderer: Signal<AnnotationBehaviorRenderer | null> = computed(() => {\n const behavior = this.behavior();\n if (!behavior) return null;\n let entry = behaviors.get(behavior);\n if (!entry) behaviors.set(behavior, (entry = Object.freeze({ behavior })));\n return entry;\n });\n\n static ngTemplateContextGuard(\n _directive: EpdfAnnotationBehaviorTemplate,\n context: unknown,\n ): context is EpdfAnnotationBehaviorTemplateContext {\n return true;\n }\n}\n\n/**\n * Each handle, drawn your way in place of the layer's: `<ng-template epdfHandle let-handle>`.\n * The viewer still decides where a handle can be grabbed, so what you draw can't break dragging.\n */\n@Directive({ selector: 'ng-template[epdfHandle]' })\nexport class EpdfHandleTemplate {\n readonly template = inject<TemplateRef<EpdfHandleTemplateContext>>(TemplateRef);\n\n static ngTemplateContextGuard(\n _directive: EpdfHandleTemplate,\n context: unknown,\n ): context is EpdfHandleTemplateContext {\n return true;\n }\n}\n\n/** The rotation handle, drawn your way: `<ng-template epdfRotationHandle let-handle>`. */\n@Directive({ selector: 'ng-template[epdfRotationHandle]' })\nexport class EpdfRotationHandleTemplate {\n readonly template = inject<TemplateRef<EpdfRotationHandleTemplateContext>>(TemplateRef);\n\n static ngTemplateContextGuard(\n _directive: EpdfRotationHandleTemplate,\n context: unknown,\n ): context is EpdfRotationHandleTemplateContext {\n return true;\n }\n}\n\n/**\n * The rotation badge's content, drawn your way: inside `<epdf-annotation-rotation-badge>`,\n * `<ng-template epdfRotationBadge let-rotation>{{ rotation.angle }}°</ng-template>`.\n */\n@Directive({ selector: 'ng-template[epdfRotationBadge]' })\nexport class EpdfRotationBadgeTemplate {\n readonly template = inject<TemplateRef<EpdfRotationBadgeTemplateContext>>(TemplateRef);\n\n static ngTemplateContextGuard(\n _directive: EpdfRotationBadgeTemplate,\n context: unknown,\n ): context is EpdfRotationBadgeTemplateContext {\n return true;\n }\n}\n","/**\n * Free text boxes: the element someone types in. `@embedpdf/web`'s text box editor makes an\n * element the editor of a text box (rich text, focus and `contentEditable` following the\n * plugin's `editing`, presses kept inside), and its follower attaches again for another document\n * and takes the box and the scale; this file binds the follower to signals.\n *\n * [epdfFreeTextBox] the layer's own text box, one per free text on the page (internal)\n * [epdfRichTextEditor] your own element in a look you draw: it becomes the box's editor\n *\n * The editor owns the element's children: Angular puts none in it, and the element is never\n * made again while someone types (the caret would jump).\n */\nimport {\n computed,\n DestroyRef,\n Directive,\n effect,\n ElementRef,\n inject,\n InjectionToken,\n input,\n untracked,\n type Signal,\n} from '@angular/core';\nimport { annotationKey } from '@embedpdf/core';\nimport { injectPage } from '@embedpdf/angular/runtime';\nimport type { Annotation, AnnotationRef, TextItem } from '@embedpdf/plugin-annotation';\nimport type { AnnotationHostCapability } from '@embedpdf/plugin-annotation/contract/host';\nimport {\n createTextBoxEditorFollower,\n textBoxEditorScaleOf,\n textBoxStyleOf,\n textPlateInPixels,\n type TextBoxStyle,\n} from '@embedpdf/web';\nimport { annotationHostOf, pagePixelsOf, pageViewOf } from './page-reads';\n\n/**\n * How much the layer scales the look around an element: 1 outside a look, or in one drawn at its\n * size on screen. The layer provides it to each scaled look, so a rich text editor inside draws\n * its text at the annotation's 100% size and lets the look's scale do the rest.\n */\nexport const EPDF_LOOK_SCALE = new InjectionToken<Signal<number>>('EPDF_LOOK_SCALE');\n\n/**\n * Make `element` the editor of the text box `item()` reads, at `scale()` pixels per point: the\n * binding attaches when the plugin is there (again for another document), and redraws only\n * when the text differs. Call it in an injection context; it lets go when the caller goes.\n */\nexport function bindTextBoxEditor(\n element: HTMLElement,\n annotation: Signal<AnnotationHostCapability | null>,\n item: Signal<TextItem | null>,\n scale: Signal<number>,\n): void {\n const follower = createTextBoxEditorFollower<AnnotationRef>();\n effect(() => {\n const host = annotation();\n const next = item();\n const at = scale();\n untracked(() => follower.follow(element, host, next, at));\n });\n inject(DestroyRef).onDestroy(() => follower.detach());\n}\n\n/**\n * The layer's own text box for one free text: the engine's text plate (the box inset by its\n * padding), styled like the box's body, with no padding of its own so its edge is the plate's.\n * The box's fill and border are the vector scene's, under it. It takes the pointer only while\n * someone types in it; otherwise clicks fall through to the shapes (select, move, resize).\n */\n@Directive({\n selector: '[epdfFreeTextBox]',\n host: {\n style:\n 'position: absolute; box-sizing: border-box; background: transparent; ' +\n 'white-space: pre-wrap; overflow-wrap: break-word; overflow-x: hidden; transform-origin: center',\n '[style.left.px]': 'plate().left',\n '[style.top.px]': 'plate().top',\n '[style.width.px]': 'plate().width',\n // Fixed to the plate: the box never grows with its text; it scrolls while typing and clips\n // otherwise, where the baked appearance clips.\n '[style.height.px]': 'plate().height',\n '[style.font-family]': 'look().fontFamily',\n '[style.font-size]': 'look().fontSize',\n '[style.color]': 'look().color',\n '[style.font-weight]': 'look().fontWeight',\n '[style.font-style]': 'look().fontStyle',\n '[style.text-decoration]': 'look().textDecoration',\n '[style.text-align]': 'look().textAlign',\n '[style.overflow-y]': \"item().editing ? 'auto' : 'hidden'\",\n '[style.outline]': \"item().editing ? '1px solid ' + outline() : 'none'\",\n '[style.cursor]': \"item().editing ? 'text' : 'default'\",\n // A plain text box turns about its centre, as the baked appearance does.\n '[style.transform]': \"item().rot ? 'rotate(' + item().rot + 'deg)' : null\",\n '[style.pointer-events]': \"item().editing ? 'auto' : 'none'\",\n },\n})\nexport class EpdfFreeTextBox {\n /** The text box, as the plugin lists it for the page. */\n readonly item = input.required<TextItem>({ alias: 'epdfFreeTextBox' });\n /** The outline color while someone types: the chrome's `textOutline`, painted. */\n readonly outline = input.required<string>();\n\n private readonly page = injectPage('[epdfFreeTextBox]');\n private readonly pixels = pagePixelsOf(this.page);\n protected readonly plate = computed(() => textPlateInPixels(this.item(), this.pixels()));\n protected readonly look = computed(() => textBoxStyleOf(this.item().css, this.plate().scale));\n\n constructor() {\n const annotation = annotationHostOf(this.page, '[epdfFreeTextBox]').capability;\n bindTextBoxEditor(\n inject<ElementRef<HTMLElement>>(ElementRef).nativeElement,\n annotation,\n this.item,\n computed(() => this.plate().scale),\n );\n }\n}\n\n/**\n * Your own element as the editor of a text box you draw yourself, in a look\n * (`<ng-template [epdfAnnotation]=\"isTextBox\" let-annotation>`):\n *\n * <div [epdfRichTextEditor]=\"annotation\" #editor=\"epdfRichTextEditor\"\n * class=\"text-box\" [class.editing]=\"editor.editing()\"></div>\n *\n * It draws the runs, turns typing back into runs, keeps the caret when the style changes, and\n * handles pasting, input methods and the format shortcuts; `text.toggleFormat()` and\n * `selection.update()` work on it as on the layer's own box. It gives the element the box's\n * body style (font, size, color and alignment), and while someone types it takes the pointer.\n * Leave the element empty: the editor fills it.\n */\n@Directive({\n selector: '[epdfRichTextEditor]',\n exportAs: 'epdfRichTextEditor',\n host: {\n '[style.font-family]': 'look()?.fontFamily ?? null',\n '[style.font-size]': 'look()?.fontSize ?? null',\n '[style.color]': 'look()?.color ?? null',\n '[style.font-weight]': 'look()?.fontWeight ?? null',\n '[style.font-style]': 'look()?.fontStyle ?? null',\n '[style.text-decoration]': 'look()?.textDecoration ?? null',\n '[style.text-align]': 'look()?.textAlign ?? null',\n // While typing, the element takes the pointer (the caret, a drag over words).\n '[style.pointer-events]': \"editing() ? 'auto' : null\",\n },\n})\nexport class EpdfRichTextEditor {\n /** The free text annotation this element edits: the template's `let-annotation`. */\n readonly annotation = input.required<Annotation>({ alias: 'epdfRichTextEditor' });\n\n private readonly page = injectPage('[epdfRichTextEditor]');\n private readonly host = annotationHostOf(this.page, '[epdfRichTextEditor]');\n private readonly lookScale = inject(EPDF_LOOK_SCALE, { optional: true });\n private readonly view = pageViewOf(this.page);\n private readonly pixels = pagePixelsOf(this.page);\n\n /** The annotation's text box on the page, or null while there is none. */\n private readonly item = this.host.select(\n (annotation) => {\n const key = annotationKey(this.annotation().ref);\n return (\n annotation\n .listTextItems(this.page.ref, this.view())\n .find((text) => text.ref !== null && annotationKey(text.ref) === key) ?? null\n );\n },\n null,\n );\n\n /** Pixels per point where the element is: in a scaled look, at the annotation's 100% size. */\n private readonly scale = computed(() =>\n textBoxEditorScaleOf(this.item(), this.pixels(), this.lookScale?.() ?? 1),\n );\n\n /** The box's body style: font, size, color and alignment, or null while there is no box. */\n protected readonly look: Signal<TextBoxStyle | null> = computed(() => {\n const item = this.item();\n return item ? textBoxStyleOf(item.css, this.scale()) : null;\n });\n\n /** True while someone types in the box. */\n readonly editing: Signal<boolean> = computed(() => this.item()?.editing ?? false);\n\n constructor() {\n bindTextBoxEditor(\n inject<ElementRef<HTMLElement>>(ElementRef).nativeElement,\n this.host.capability,\n this.item,\n this.scale,\n );\n }\n}\n","/**\n * `<epdf-annotation-layer>`: a page's annotations, the selection's outline and handles, the\n * tool's preview, and the text boxes being typed in. Put it in each page, above the rendered\n * page; while it's there, the render layer leaves the annotations out of the page's picture:\n *\n * <ng-template epdfPage>\n * <epdf-render-layer />\n * <epdf-annotation-layer />\n * </ng-template>\n *\n * Pure paint: it reads the plugin's items and chrome for the page and draws them. The pointer\n * reaches the plugin through the interaction hub (the Stage forwards it), and so does the\n * cursor. Each annotation is one drawing: its vector scene, the engine's baked picture, or a\n * look of yours from an `<ng-template [epdfAnnotation]>` inside the layer, which may keep the\n * layer's own drawing (`native`) and add to it. `<ng-template epdfHandle>` and\n * `<ng-template epdfRotationHandle>` draw the handles your way.\n *\n * What isn't Angular is `@embedpdf/web`'s, the same for every framework: which drawing each\n * annotation gets and the behaviors interactive looks register, the frames and chrome in\n * pixels, the scene as SVG elements, the text box editor, and the object URLs of baked pictures\n * and the stamp ghost.\n */\nimport { isPlatformBrowser, NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n contentChildren,\n DestroyRef,\n effect,\n inject,\n Injector,\n PLATFORM_ID,\n signal,\n untracked,\n} from '@angular/core';\nimport { annotationKey } from '@embedpdf/core';\nimport { hasLiveDrawing, type RenderItem } from '@embedpdf/core-annotation';\nimport {\n CapabilityBinding,\n injectKernelHost,\n injectPage,\n paintsPagePart,\n} from '@embedpdf/angular/runtime';\nimport type { Annotation, TextItem } from '@embedpdf/plugin-annotation';\nimport { previewBucket } from '@embedpdf/plugin-annotation/contract/host';\nimport { InteractionToken } from '@embedpdf/plugin-interaction/contract';\nimport { RenderToken } from '@embedpdf/plugin-render/contract/host';\nimport {\n annotationChromePaint,\n annotationDrawingOf,\n bakedAppearanceOf,\n createShownUrls,\n editingTextKeyOf,\n frameInPixels,\n ghostOpacity,\n layerTextBoxesOf,\n loadAppearanceUrls,\n loadObjectUrl,\n lookFrameOf,\n pictureOrPainting,\n rectInPixels,\n registerRendererBehaviors,\n shownAppearance,\n type AppearanceUrl,\n type FramePixels,\n type PictureOrPainting,\n} from '@embedpdf/web';\nimport { EpdfAnnotationChrome } from './chrome';\nimport { EpdfAnnotationFrame, EpdfAnnotationNative } from './drawing';\nimport { annotationHostOf, pagePixelsOf, pageViewOf } from './page-reads';\nimport { injectChromeSettings } from './settings';\nimport {\n EpdfAnnotationBehaviorTemplate,\n EpdfAnnotationTemplate,\n EpdfHandleTemplate,\n EpdfRotationHandleTemplate,\n type AnnotationFrame,\n type AnnotationRendererEntry,\n} from './templates';\nimport { EPDF_LOOK_SCALE, EpdfFreeTextBox } from './text-box';\n\nconst NO_ITEMS: readonly RenderItem[] = Object.freeze([]);\nconst NO_TEXTS: readonly TextItem[] = Object.freeze([]);\n\n/** Your look of one annotation, with what its template gets. */\ninterface DrawnLook {\n readonly template: EpdfAnnotationTemplate;\n readonly annotation: Annotation;\n readonly frame: AnnotationFrame;\n /** Drawn at the annotation's 100% size, and scaled by the layer. */\n readonly scaled: boolean;\n /** Tells a rich text editor in the look how much the look is scaled. */\n readonly injector: Injector;\n}\n\n/** One annotation as the template draws it. */\ninterface Drawn {\n readonly item: RenderItem;\n /** Its frame in the layer's pixels. */\n readonly frame: FramePixels;\n /** What its own drawing shows: the engine's picture of it, or its scene (`pictureOrPainting`). */\n readonly shows: PictureOrPainting<RenderItem>;\n /** The same picture as a look gets it: its `appearance`. */\n readonly appearance: { url: string } | null;\n /** Your look that draws it, when one does. */\n readonly look: DrawnLook | null;\n /** A sibling plugin's template that owns it while its behavior is engaged. */\n readonly owner: {\n readonly template: EpdfAnnotationBehaviorTemplate;\n readonly annotation: Annotation;\n } | null;\n /** The look takes the pointer. */\n readonly interactive: boolean;\n /** Keep the pointer and the focus out: a look that only draws, or a plugin's own input. */\n readonly inert: boolean;\n}\n\n@Component({\n selector: 'epdf-annotation-layer',\n imports: [\n NgTemplateOutlet,\n EpdfAnnotationFrame,\n EpdfAnnotationNative,\n EpdfAnnotationChrome,\n EpdfFreeTextBox,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: { style: 'position: absolute; inset: 0; display: block; pointer-events: none' },\n template: `\n @for (drawn of drawings(); track drawn.item.id) {\n <!-- The layer's own drawing of it, which a look may keep: its \\`native\\`. -->\n <ng-template #native>\n <epdf-annotation-native [item]=\"drawn.item\" [shows]=\"drawn.shows\" />\n </ng-template>\n @if (drawn.owner; as owner) {\n <!-- A sibling plugin's controls place themselves in the layer and take the input;\n the annotation's own drawing keeps its frame. -->\n <ng-template #framedNative>\n <div [epdfAnnotationFrame]=\"drawn.frame\" [frameBlend]=\"drawn.item.blend\">\n <ng-container [ngTemplateOutlet]=\"native\" />\n </div>\n </ng-template>\n <ng-container\n [ngTemplateOutlet]=\"owner.template.template\"\n [ngTemplateOutletContext]=\"{\n $implicit: owner.annotation,\n annotation: owner.annotation,\n item: drawn.item,\n page: page,\n native: framedNative,\n hovered: drawn.item.hovered ?? false,\n selected: drawn.item.selected,\n interactive: true\n }\"\n />\n } @else {\n @if (drawn.look; as look) {\n <div\n [epdfAnnotationFrame]=\"drawn.frame\"\n [frameBlend]=\"drawn.item.blend\"\n [frameInteractive]=\"drawn.interactive\"\n [frameInert]=\"drawn.inert\"\n >\n <ng-template #lookTemplate>\n <ng-container\n [ngTemplateOutlet]=\"look.template.template\"\n [ngTemplateOutletInjector]=\"look.injector\"\n [ngTemplateOutletContext]=\"{\n $implicit: look.annotation,\n annotation: look.annotation,\n frame: look.frame,\n native: native,\n appearance: drawn.appearance,\n hovered: drawn.item.hovered ?? false,\n selected: drawn.item.selected,\n interactive: drawn.interactive\n }\"\n />\n </ng-template>\n @if (look.scaled) {\n <!-- Drawn at the annotation's 100% size, scaled with the page as a whole. -->\n <div\n style=\"position: absolute; left: 0; top: 0; transform-origin: 0 0\"\n [style.width.px]=\"drawn.frame.design.width\"\n [style.height.px]=\"drawn.frame.design.height\"\n [style.transform]=\"'scale(' + drawn.frame.scale + ')'\"\n >\n <ng-container [ngTemplateOutlet]=\"lookTemplate\" />\n </div>\n } @else {\n <ng-container [ngTemplateOutlet]=\"lookTemplate\" />\n }\n </div>\n } @else {\n <!-- Inert when an engaged behavior has no template of yours: its plugin owns the\n input (a link's anchor takes the click), and the annotation keeps its own look. -->\n <div\n [epdfAnnotationFrame]=\"drawn.frame\"\n [frameBlend]=\"drawn.item.blend\"\n [frameInert]=\"drawn.inert\"\n >\n <ng-container [ngTemplateOutlet]=\"native\" />\n </div>\n }\n }\n }\n @for (text of texts(); track text.id) {\n <div [epdfFreeTextBox]=\"text\" [outline]=\"textOutline()\"></div>\n }\n @if (ghost(); as ghost) {\n <!-- The armed stamp, see-through, in the box a click would place it in. -->\n <img\n alt=\"\"\n draggable=\"false\"\n style=\"position: absolute; max-width: none; max-height: none; pointer-events: none; transform-origin: center\"\n [attr.src]=\"ghost.url\"\n [style.left.px]=\"ghost.box.left\"\n [style.top.px]=\"ghost.box.top\"\n [style.width.px]=\"ghost.box.width\"\n [style.height.px]=\"ghost.box.height\"\n [style.opacity]=\"ghost.opacity\"\n [style.transform]=\"ghost.rotation ? 'rotate(' + ghost.rotation + 'deg)' : null\"\n />\n }\n <epdf-annotation-chrome\n [handle]=\"handleTemplate()?.template ?? null\"\n [rotationHandle]=\"rotationHandleTemplate()?.template ?? null\"\n />\n `,\n})\nexport class EpdfAnnotationLayer {\n protected readonly page = injectPage('<epdf-annotation-layer>');\n private readonly injector = inject(Injector);\n private readonly annotation = annotationHostOf(this.page, '<epdf-annotation-layer>');\n private readonly interaction = new CapabilityBinding(\n injectKernelHost('<epdf-annotation-layer>'),\n () => InteractionToken,\n () => this.page.documentId,\n );\n private readonly render = new CapabilityBinding(\n injectKernelHost('<epdf-annotation-layer>'),\n () => RenderToken,\n () => this.page.documentId,\n );\n private readonly chrome = injectChromeSettings();\n\n // ── your templates ───────────────────────────────────────────────────────────\n\n private readonly looks = contentChildren(EpdfAnnotationTemplate, { descendants: true });\n private readonly behaviors = contentChildren(EpdfAnnotationBehaviorTemplate, {\n descendants: true,\n });\n protected readonly handleTemplate = contentChild(EpdfHandleTemplate, { descendants: true });\n protected readonly rotationHandleTemplate = contentChild(EpdfRotationHandleTemplate, {\n descendants: true,\n });\n\n /**\n * The renderer entries, in the order the templates are written: the first look that matches\n * wins. The same array while every entry stays the same.\n */\n private readonly renderers = computed(\n (): readonly AnnotationRendererEntry[] =>\n [\n ...this.behaviors().map((template) => template.renderer()),\n ...this.looks().map((template) => template.renderer()),\n ].filter((entry) => entry !== null),\n {\n equal: (left, right) =>\n left.length === right.length && left.every((entry, index) => entry === right[index]),\n },\n );\n /** Goes up when the behaviors register again, so each drawing is decided again. */\n private readonly registrations = signal(0);\n\n // ── what the page shows ──────────────────────────────────────────────────────\n\n private readonly view = pageViewOf(this.page);\n private readonly pixels = pagePixelsOf(this.page);\n\n private readonly items = this.annotation.select(\n (annotation) => annotation.listPageItems(this.page.ref, this.view()),\n NO_ITEMS,\n );\n private readonly allTexts = this.annotation.select(\n (annotation) => annotation.listTextItems(this.page.ref, this.view()),\n NO_TEXTS,\n );\n /** The active tool: an interactive look's function is asked about it, so a tool change redraws. */\n private readonly activeToolId = this.interaction.select(\n (interaction) => interaction.getActiveToolId() ?? '',\n '',\n );\n\n /** The pictures' URLs, by annotation and state; `null` until the page's first ones arrive. */\n private readonly urls = signal<Readonly<Record<string, AppearanceUrl>> | null>(null);\n /** The pictures shown stay valid until the next ones are shown. */\n private readonly shown = createShownUrls();\n // A move or a turn leaves the epoch as it is (the same pixels, placed elsewhere), and live\n // gestures don't touch it: nothing loads mid-drag.\n private readonly appearanceEpoch = this.annotation.select(\n (annotation) => annotation.getAppearanceEpoch(this.page.ref),\n '',\n );\n // Zoom steps inside one rung of the document's appearance lattice bake nothing again.\n // Without the render plugin, only this session's pictures load.\n private readonly appearanceScale = this.render.select(\n (render) => render.getAppearanceScale(this.page.transform().renderScale),\n 0,\n );\n private readonly bakeScale = computed(() =>\n this.render.capability() ? this.appearanceScale() : this.page.transform().renderScale,\n );\n\n /** The text box being typed in, by key: while it is, a look's editor takes the keys. */\n private readonly editingKey = computed(() => editingTextKeyOf(this.allTexts(), annotationKey));\n\n /** One injector per look, by item: kept while the item is drawn, so the look is never made again. */\n private readonly lookInjectors = new Map<string, Injector>();\n\n protected readonly drawings = computed((): readonly Drawn[] => {\n this.activeToolId();\n this.registrations();\n const annotation = this.annotation.capability();\n const renderers = this.renderers();\n const looks = this.looks();\n const behaviors = this.behaviors();\n const pixels = this.pixels();\n const urls = this.urls();\n const editingKey = this.editingKey();\n const drawings = this.items().map((item): Drawn => {\n const frame = frameInPixels(item.frame, pixels);\n const state = item.annotation?.appearanceState ?? null;\n const drawn: Drawn = {\n item,\n frame,\n shows: pictureOrPainting({\n pending: item.source !== 'baked',\n picture: urls && shownAppearance(urls, item.id, state),\n version: item.pictureVersion ?? 0,\n loaded: urls !== null,\n paint: () => (hasLiveDrawing(item) ? item : null),\n }),\n appearance: urls && bakedAppearanceOf(urls, item.id, state),\n look: null,\n owner: null,\n interactive: false,\n inert: false,\n };\n const record = item.annotation;\n if (!record || !annotation) return drawn;\n // Ownership beats looks: an engaged behavior's template is authoritative (a form\n // plugin's controls own their DOM); looks apply only to what the layer owns, and draw\n // without the pointer. While its text box is typed in, a look's editor takes the keys.\n const typing = editingKey !== null && annotationKey(record.ref) === editingKey;\n const drawing = annotationDrawingOf(record, annotation, renderers, typing);\n switch (drawing.kind) {\n case 'native':\n return { ...drawn, inert: drawing.inert };\n case 'owned': {\n const template = behaviors.find((behavior) => behavior.renderer() === drawing.entry);\n return template ? { ...drawn, owner: { template, annotation: record } } : drawn;\n }\n case 'look': {\n const template = looks.find((look) => look.renderer() === drawing.entry);\n if (!template) return drawn;\n const scaled = drawing.entry.scale !== false;\n return {\n ...drawn,\n look: {\n template,\n annotation: record,\n frame: lookFrameOf(frame, scaled),\n scaled,\n injector: this.lookInjectorOf(item.id),\n },\n interactive: drawing.interactive,\n inert: drawing.inert,\n };\n }\n }\n });\n // Forget the injectors of looks no longer drawn: a look drawn again starts afresh.\n const drawnLooks = new Set(drawings.flatMap((drawn) => (drawn.look ? [drawn.item.id] : [])));\n for (const id of this.lookInjectors.keys()) {\n if (!drawnLooks.has(id)) this.lookInjectors.delete(id);\n }\n return drawings;\n });\n\n /** How much the layer scales each look, by item: 1 for a look drawn at its size on screen. */\n private readonly lookScales = computed(() => {\n const scales = new Map<string, number>();\n for (const drawn of this.drawings()) {\n if (drawn.look) scales.set(drawn.item.id, drawn.look.scaled ? drawn.frame.scale : 1);\n }\n return scales;\n });\n\n /** The text boxes the layer draws: not the ones a look of yours draws, which edits them there. */\n protected readonly texts = computed((): readonly TextItem[] =>\n layerTextBoxesOf(this.allTexts(), this.items(), this.renderers(), annotationKey),\n );\n\n protected readonly textOutline = computed(\n () => annotationChromePaint(this.chrome.chrome(), this.chrome.accent()).textOutline,\n );\n\n // ── the armed stamp's ghost ──────────────────────────────────────────────────\n\n private readonly imageGhost = this.annotation.select(\n (annotation) => annotation.getImageGhost(this.page.ref),\n null,\n );\n private readonly armedStamp = this.annotation.select(\n (annotation) => annotation.getArmedStamp(),\n null,\n Object.is,\n );\n /**\n * The ghost is a picture of vector artwork, sharp at one size: the size class that covers the\n * box's device width. The plugin keeps one picture per class, so a zoom never renders per frame.\n */\n private readonly ghostBucket = computed(() => {\n const ghost = this.imageGhost();\n return ghost ? previewBucket(ghost.box.width * this.page.transform().renderScale) : 0;\n });\n private readonly ghostUrl = signal<string | null>(null);\n protected readonly ghost = computed(() => {\n const ghost = this.imageGhost();\n const url = this.ghostUrl();\n if (!ghost || !url) return null;\n return {\n url,\n box: rectInPixels(ghost.box, this.pixels()),\n opacity: ghostOpacity(ghost.opacity),\n rotation: ghost.rot,\n };\n });\n\n constructor() {\n // While it's here, the page's picture leaves the annotations to it.\n paintsPagePart(() => this.page.ref, 'annotations');\n this.registerBehaviors();\n if (!isPlatformBrowser(inject(PLATFORM_ID))) return;\n inject(DestroyRef).onDestroy(() => this.shown.release());\n this.loadAppearances();\n this.loadGhost();\n }\n\n /** The injector a look's template gets for one item: the look's scale, followed live. */\n private lookInjectorOf(id: string): Injector {\n let injector = this.lookInjectors.get(id);\n if (!injector) {\n const scale = computed(() => this.lookScales().get(id) ?? 1);\n injector = Injector.create({\n providers: [{ provide: EPDF_LOOK_SCALE, useValue: scale }],\n parent: this.injector,\n });\n this.lookInjectors.set(id, injector);\n }\n return injector;\n }\n\n /**\n * An interactive look takes the pointer through a behavior the plugin knows, registered once\n * per document and look however many pages show the layer (`@embedpdf/web` counts them). The\n * looks are the same entries on every page, so keep the functions you give `epdfAnnotation`\n * and `epdfAnnotationInteractive` in fields: a function made anew registers again.\n */\n private registerBehaviors(): void {\n effect((onCleanup) => {\n const annotation = this.annotation.capability();\n const renderers = this.renderers();\n if (annotation && renderers.length > 0) {\n onCleanup(\n untracked(() =>\n registerRendererBehaviors(annotation, renderers, () => untracked(this.activeToolId)),\n ),\n );\n }\n this.registrations.update((count) => count + 1);\n });\n }\n\n /**\n * The baked pictures, loaded again when the page's appearance epoch or the bake scale changes;\n * the ones shown stay valid until the next are shown.\n */\n private loadAppearances(): void {\n effect((onCleanup) => {\n const annotation = this.annotation.capability();\n const scale = this.bakeScale();\n this.appearanceEpoch();\n if (!annotation || !scale) return;\n const page = this.page.ref;\n onCleanup(\n untracked(() =>\n loadAppearanceUrls(\n this.shown,\n (abort) => annotation.renderAppearances(page, scale, abort),\n annotationKey,\n (urls) => this.urls.set(urls),\n ),\n ),\n );\n });\n }\n\n /**\n * The armed stamp's ghost picture, for its size class. The previous class's picture stays up\n * until this one is there, so a zoom across a class boundary never flickers; a disarm drops it.\n */\n private loadGhost(): void {\n effect((onCleanup) => {\n const annotation = this.annotation.capability();\n const bucket = this.ghostBucket();\n this.armedStamp();\n if (!annotation || !bucket) {\n this.ghostUrl.set(null);\n return;\n }\n onCleanup(\n untracked(() =>\n loadObjectUrl(\n () => annotation.renderArmedStampPreview(bucket),\n (url) => this.ghostUrl.set(url),\n ),\n ),\n );\n });\n }\n}\n","/**\n * Your UI next to annotations, inside `<epdf-stage>`, each on `<epdf-anchored>`, so it moves\n * with the pages in the same frame and a click in it never reaches the page:\n *\n * <epdf-annotation-menu> your menu next to the selection\n * <epdf-annotation-draft-menu #menu> buttons over a polygon being drawn (`menu.draft()`)\n * <epdf-annotation-rotation-badge> the angle next to the pointer while turning\n *\n * They only place things: what's in them is yours, built from `inject(EpdfAnnotation)`.\n */\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n inject,\n input,\n type Signal,\n} from '@angular/core';\nimport {\n CapabilityBinding,\n injectDocumentScope,\n injectKernelHost,\n outsideStageError,\n} from '@embedpdf/angular/runtime';\nimport {\n EPDF_PROJECTOR,\n EpdfAnchored,\n type AnchoredPlacement,\n type EpdfAnchor,\n} from '@embedpdf/angular/anchored';\nimport type { AnnotationRotationAnchor, CreationDraft } from '@embedpdf/plugin-annotation';\nimport {\n AnnotationToken as AnnotationHostToken,\n type AnnotationHostCapability,\n} from '@embedpdf/plugin-annotation/contract/host';\nimport {\n paint,\n paintDefault,\n sameCreationDraftAnchor,\n sameRotationAnchor,\n sameSelectionAnchor,\n} from '@embedpdf/web';\nimport { injectChromeSettings } from './settings';\nimport { EpdfRotationBadgeTemplate } from './templates';\n\n/** The annotation plugin of the document this part of the template talks to. */\nfunction annotationInScope(what: string): CapabilityBinding<AnnotationHostCapability> {\n return new CapabilityBinding<AnnotationHostCapability>(\n injectKernelHost(what),\n () => AnnotationHostToken,\n injectDocumentScope(),\n );\n}\n\n/**\n * Your menu next to the selection: one menu, also for a selection over several pages, clear of\n * the rotation handle. It hides while the selection is dragged, resized or turned. Put it inside\n * `<epdf-stage>`, next to the page template, with what the menu holds between its tags:\n *\n * <epdf-annotation-menu placement=\"bottom\">\n * <button (click)=\"annotation.selection.delete()\">Delete</button>\n * </epdf-annotation-menu>\n */\n@Component({\n selector: 'epdf-annotation-menu',\n imports: [EpdfAnchored],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <epdf-anchored [anchor]=\"anchor()\" [placement]=\"placement()\" [gap]=\"gap()\">\n <ng-content />\n </epdf-anchored>\n `,\n})\nexport class EpdfAnnotationMenu {\n /** Which side of the selection: `'top'` (the default), `'bottom'`, `'left'` or `'right'`, or a corner. */\n readonly placement = input<AnchoredPlacement>('top');\n /** Screen pixels between the selection and the menu. */\n readonly gap = input(15);\n\n private readonly annotation = annotationInScope('<epdf-annotation-menu>');\n private readonly projection = inject(EPDF_PROJECTOR, { optional: true });\n\n /**\n * The selection's anchor as its page is shown: the rotation handle sits a fixed number of\n * pixels off the box, so where it is on the page depends on the zoom. Read again with the\n * projection, in the same pass as the pages.\n */\n private readonly selection = this.annotation.select(\n (annotation) => {\n const anchor = annotation.selection.getAnchor();\n if (!anchor) return null;\n this.projection?.revision();\n const view = this.projection?.projector()?.viewEnv(anchor.page);\n return view ? annotation.getSelectionAnchorIn(view) : anchor;\n },\n null,\n sameSelectionAnchor,\n );\n\n protected readonly anchor = computed((): EpdfAnchor | null => {\n const anchor = this.selection();\n if (!anchor) return null;\n return {\n page: anchor.page,\n bounds: anchor.bounds,\n ...(anchor.rotationHandle ? { avoid: [anchor.rotationHandle] } : {}),\n };\n });\n\n constructor() {\n if (!this.projection) throw outsideStageError('<epdf-annotation-menu>');\n }\n}\n\n/**\n * Buttons over a polygon or polyline being drawn, which helps on touch screens. `draft()` is the\n * shape being drawn (`pointCount`, `minPoints`, `canFinish`, …), or null; the verbs are the\n * annotation service's `draft.finish()` and `draft.cancel()`:\n *\n * <epdf-annotation-draft-menu #menu=\"epdfAnnotationDraftMenu\">\n * <button [disabled]=\"!menu.draft()?.canFinish\" (click)=\"annotation.draft.finish()\">Done</button>\n * </epdf-annotation-draft-menu>\n */\n@Component({\n selector: 'epdf-annotation-draft-menu',\n exportAs: 'epdfAnnotationDraftMenu',\n imports: [EpdfAnchored],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <epdf-anchored [anchor]=\"draft()\" [placement]=\"placement()\" [gap]=\"gap()\">\n <ng-content />\n </epdf-anchored>\n `,\n})\nexport class EpdfAnnotationDraftMenu {\n /** Which side of the shape being drawn. */\n readonly placement = input<AnchoredPlacement>('top');\n /** Screen pixels between the shape and the menu. */\n readonly gap = input(8);\n\n private readonly annotation = annotationInScope('<epdf-annotation-draft-menu>');\n\n /** The shape being drawn: where it is, its points so far and whether it can end; or null. */\n readonly draft: Signal<CreationDraft | null> = this.annotation.select(\n (annotation) => annotation.draft.get(),\n null,\n sameCreationDraftAnchor,\n );\n\n constructor() {\n if (!inject(EPDF_PROJECTOR, { optional: true })) {\n throw outsideStageError('<epdf-annotation-draft-menu>');\n }\n }\n}\n\n/**\n * The angle next to the pointer while a selection is turned, upright however the page is shown.\n * It shows the angle in the `chrome.readout` colors when `chrome.readout.enabled`; give it an\n * `<ng-template epdfRotationBadge let-rotation>` to draw it your way. `rotation()` is the turn\n * in progress (`page`, `at`, `angle`), or null.\n */\n@Component({\n selector: 'epdf-annotation-rotation-badge',\n exportAs: 'epdfAnnotationRotationBadge',\n imports: [EpdfAnchored, NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n @if (shown(); as rotation) {\n <epdf-anchored [anchor]=\"anchor()\" [placement]=\"placement()\" [gap]=\"gap()\">\n @if (custom(); as custom) {\n <ng-container\n [ngTemplateOutlet]=\"custom.template\"\n [ngTemplateOutletContext]=\"{ $implicit: rotation }\"\n />\n } @else {\n <div\n style=\"pointer-events: none; white-space: nowrap; border-radius: 4px; padding: 2px 6px; font-size: 12px\"\n [style.font-family]=\"fontFamily\"\n [style.background]=\"background()\"\n [style.color]=\"color()\"\n >\n {{ rotation.angle }}°\n </div>\n }\n </epdf-anchored>\n }\n `,\n})\nexport class EpdfAnnotationRotationBadge {\n /** Which side of the pointer. */\n readonly placement = input<AnchoredPlacement>('right');\n /** Screen pixels between the pointer and the badge. */\n readonly gap = input(16);\n\n private readonly annotation = annotationInScope('<epdf-annotation-rotation-badge>');\n private readonly settings = injectChromeSettings();\n protected readonly custom = contentChild(EpdfRotationBadgeTemplate);\n\n /** The turn in progress: its page, the pointer's point and the angle so far; or null. */\n readonly rotation: Signal<AnnotationRotationAnchor | null> = this.annotation.select(\n (annotation) => annotation.selection.getRotationAnchor(),\n null,\n sameRotationAnchor,\n );\n\n /** Shown while turning, with a template of yours or with the readout on. */\n protected readonly shown = computed(() => {\n const rotation = this.rotation();\n return rotation && (this.custom() || this.settings.chrome().readout.enabled) ? rotation : null;\n });\n /** A box of no size at the pointer. */\n protected readonly anchor = computed((): EpdfAnchor | null => {\n const rotation = this.rotation();\n return rotation\n ? { page: rotation.page, bounds: { ...rotation.at, width: 0, height: 0 } }\n : null;\n });\n protected readonly fontFamily = paintDefault('font-mono');\n protected readonly background = computed(() =>\n paint('readout-background', this.settings.chrome().readout.background),\n );\n protected readonly color = computed(() =>\n paint('readout-color', this.settings.chrome().readout.color),\n );\n\n constructor() {\n if (!inject(EPDF_PROJECTOR, { optional: true })) {\n throw outsideStageError('<epdf-annotation-rotation-badge>');\n }\n }\n}\n","/**\n * @embedpdf/angular/annotation: drawing, selecting, changing and saving annotations.\n *\n * withAnnotation(options) the plugin, for provideEmbedPdf() (with withInteraction())\n * withFilePicker(provider?) the file dialog behind the stamp and attachment tools\n * inject(EpdfAnnotation) the API, the State table as signals, the events as\n * streams, and `watch()`, `anchorOf()`, `tools.defaultsOf()`\n * inject(EpdfComments) threads and replies: `threads()`, `threadOf(ref)`, `reply()`, …\n * <epdf-annotation-layer> the annotations, the selection and the text boxes, in each page\n * <ng-template [epdfAnnotation]> your own look for some annotations\n * <ng-template epdfHandle>, epdfRotationHandle your own handles\n * [epdfRichTextEditor] your element as a text box's editor, in a look\n * <epdf-annotation-menu> your menu next to the selection, inside <epdf-stage>\n * <epdf-annotation-draft-menu> buttons over a polygon being drawn\n * <epdf-annotation-rotation-badge> the angle while a selection is turned\n */\n\n// The plugin's types and helpers, so app code has one import for the feature.\nexport * from '@embedpdf/plugin-annotation';\nexport type {\n CreationDraftAnchor,\n RenderItem,\n LineEnding,\n LineEndings,\n Style,\n AnnotationFlags,\n FieldValues,\n TextAlign,\n TextStyle,\n} from '@embedpdf/core-annotation';\nexport { EpdfAnnotation, withAnnotation } from './annotation';\nexport type { EpdfAnnotationSelection, EpdfAnnotationTools } from './annotation';\nexport { EpdfComments } from './comments';\nexport type { CommentThreadView } from './comments';\nexport { filePickerProvider, withFilePicker } from './file-picker';\nexport { EpdfAnnotationLayer } from './annotation-layer';\nexport {\n EpdfAnnotationBehaviorTemplate,\n EpdfAnnotationTemplate,\n EpdfHandleTemplate,\n EpdfRotationBadgeTemplate,\n EpdfRotationHandleTemplate,\n} from './templates';\nexport type {\n AnnotationBehaviorRenderer,\n AnnotationFrame,\n AnnotationInteractive,\n AnnotationInteractiveContext,\n AnnotationLookRenderer,\n AnnotationMatch,\n AnnotationRendererEntry,\n EpdfAnnotationBehaviorTemplateContext,\n EpdfAnnotationTemplateContext,\n EpdfHandleTemplateContext,\n EpdfRotationBadgeTemplateContext,\n EpdfRotationHandleTemplateContext,\n HandleProps,\n RotationHandleProps,\n} from './templates';\nexport { EpdfRichTextEditor } from './text-box';\nexport {\n EpdfAnnotationDraftMenu,\n EpdfAnnotationMenu,\n EpdfAnnotationRotationBadge,\n} from './annotation-menu';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["AnnotationHostToken"],"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;AASG;AA6BH,MAAM,UAAU,GAA6B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;AAC9D,MAAM,QAAQ,GAAwB,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;AAEvD;;;;;;AAMG;AAEG,MAAO,YAAa,SAAQ,iBAAuC,CAAA;AACvE,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAE,kBAAkB,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;IACtF;;IAGS,WAAW,GAA+B,IAAI,CAAC,OAAO,CAAC,eAAe,CAC7E,UAAU,EACV,aAAa,CACd;;IAEQ,SAAS,GAA6B,IAAI,CAAC,OAAO,CAAC,eAAe,CACzE,UAAU,EACV,WAAW,CACZ;;IAEQ,KAAK,GAAyB,IAAI,CAAC,O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;GAoBT,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAtBS,YAAY,4GAAE,gBAAgB,EAAA,QAAA,EAAA,oBAAA,EAAA,MAAA,EAAA,CAAA,yBAAA,EAAA,kBAAA,EAAA,0BAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAwB7B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBA3BvC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,gCAAgC;AAC1C,oBAAA,QAAQ,EAAE,6BAA6B;AACvC,oBAAA,OAAO,EAAE,CAAC,YAAY,EAAE,gBAAgB,CAAC;oBACzC,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;AAoBT,EAAA,CAAA;AACF,iBAAA;;;AC9LD;;;;;;;;;;;;;;;AAeG;AAEH;;ACjBA;;AAEG;;;;"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { CommandsToken, resolvedCommandsEqual, unknownCommandWarning, boundCommandOf, unregisteredCommand, commandsPlugin } from '@embedpdf/plugin-commands';
|
|
2
|
+
export * from '@embedpdf/plugin-commands';
|
|
3
|
+
import { isPlatformBrowser } from '@angular/common';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { computed, Injectable, inject, effect, output, ElementRef, PLATFORM_ID, Directive, input, untracked } from '@angular/core';
|
|
6
|
+
import { pluginService, devWarn, CapabilityBinding, EpdfKernelHost, injectKernelHost } from '@embedpdf/angular/runtime';
|
|
7
|
+
import { formatShortcut as formatShortcut$1 } from '@embedpdf/core-ui';
|
|
8
|
+
import { CommandsToken as CommandsToken$1 } from '@embedpdf/plugin-commands/contract/host';
|
|
9
|
+
import { createStandardCommands } from '@embedpdf/plugin-commands/standard';
|
|
10
|
+
import { standardCommandsBrowser, isMacPlatform, bindCommandShortcuts } from '@embedpdf/web';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The commands plugin's service, features and directives: every action of the viewer, with its
|
|
14
|
+
* label, icon, state and shortcut, run from buttons, menus and keys.
|
|
15
|
+
*
|
|
16
|
+
* withCommands({ commands }) the plugin, for provideEmbedPdf()
|
|
17
|
+
* withCommandShortcuts() every command's shortcut as a working key
|
|
18
|
+
* inject(EpdfCommands) `execute()`, `searchCommands()`, `executed$`, the settings
|
|
19
|
+
* <button [epdfCommand]="'zoom:in'"> a button of yours that runs and shows a command
|
|
20
|
+
* <div epdfCommandShortcuts> the keys, only while focus is inside that element
|
|
21
|
+
*
|
|
22
|
+
* A command's state is read from live state, so what shows a command follows the viewer's one
|
|
23
|
+
* change stream and changes only when what the command shows did.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* The commands every viewer has: zoom, pages, view rotation, `tool:<id>` for every tool, copy,
|
|
27
|
+
* delete, download and print, with shortcuts and labels in EmbedPDF's eight languages. Spread
|
|
28
|
+
* them into `withCommands({ commands })`.
|
|
29
|
+
*/
|
|
30
|
+
const standardCommands = /* @__PURE__ */ createStandardCommands(standardCommandsBrowser);
|
|
31
|
+
/** A shortcut as a tooltip shows it, for this platform: `'⌘K'` on a Mac, `'Ctrl+K'` elsewhere. */
|
|
32
|
+
function formatShortcut(shortcut, options = {}) {
|
|
33
|
+
return formatShortcut$1(shortcut, { isMac: options.isMac ?? isMacPlatform() });
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The commands: `execute()`, `canExecute()`, `resolveCommand()`, `searchCommands()`,
|
|
37
|
+
* `listShortcuts()`, `registerCommand()`, the categories, `executed$` and
|
|
38
|
+
* `executionFailed$`, and the settings. A call that leaves out the document is for this part
|
|
39
|
+
* of the template's document: the one `[epdfDocumentScope]` names, else the active one.
|
|
40
|
+
*/
|
|
41
|
+
class EpdfCommands extends pluginService({
|
|
42
|
+
name: 'EpdfCommands',
|
|
43
|
+
feature: 'withCommands()',
|
|
44
|
+
token: CommandsToken,
|
|
45
|
+
methods: [
|
|
46
|
+
'execute',
|
|
47
|
+
'canExecute',
|
|
48
|
+
'resolveCommand',
|
|
49
|
+
'listCommands',
|
|
50
|
+
'searchCommands',
|
|
51
|
+
'listShortcuts',
|
|
52
|
+
'registerCommand',
|
|
53
|
+
'registerCommands',
|
|
54
|
+
'getCommand',
|
|
55
|
+
'hasCommand',
|
|
56
|
+
'listCommandIds',
|
|
57
|
+
'getDisabledCategories',
|
|
58
|
+
'isCategoryDisabled',
|
|
59
|
+
'disableCategory',
|
|
60
|
+
'enableCategory',
|
|
61
|
+
'setDisabledCategories',
|
|
62
|
+
],
|
|
63
|
+
events: ['onExecuted', 'onExecutionFailed'],
|
|
64
|
+
}) {
|
|
65
|
+
/**
|
|
66
|
+
* One command as a signal, for what shows a command and isn't a button (a row of a shortcut
|
|
67
|
+
* sheet): its label, icon and state, `run()` and `shortcut`. Changes only when what the
|
|
68
|
+
* command shows does. Pass a function for an id that changes. A button uses the `epdfCommand`
|
|
69
|
+
* directive instead. Always a command: an id no plugin registered (or one asked for before
|
|
70
|
+
* the commands plugin is there) is labelled with its id, neither visible nor enabled, and an
|
|
71
|
+
* unknown one warns once in development.
|
|
72
|
+
*/
|
|
73
|
+
commandOf(id) {
|
|
74
|
+
const idOf = typeof id === 'function' ? id : () => id;
|
|
75
|
+
const resolved = this.binding.select((commands) => commands.resolveCommand(idOf()), null, resolvedCommandsEqual);
|
|
76
|
+
const execute = this.binding.method('execute');
|
|
77
|
+
return computed(() => {
|
|
78
|
+
const command = resolved();
|
|
79
|
+
const requested = idOf();
|
|
80
|
+
const commands = this.binding.capability();
|
|
81
|
+
if (command === null && commands !== null) {
|
|
82
|
+
devWarn(`commandOf:${requested}`, `commandOf(): ${unknownCommandWarning(requested, commands.listCommandIds())}`);
|
|
83
|
+
}
|
|
84
|
+
return boundCommandOf(command ?? unregisteredCommand(requested), execute, {
|
|
85
|
+
isMac: isMacPlatform(),
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: EpdfCommands, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
|
|
90
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: EpdfCommands, providedIn: 'root' });
|
|
91
|
+
}
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: EpdfCommands, decorators: [{
|
|
93
|
+
type: Injectable,
|
|
94
|
+
args: [{ providedIn: 'root' }]
|
|
95
|
+
}] });
|
|
96
|
+
/** The commands plugin, with its settings: `withCommands({ commands: standardCommands })`. */
|
|
97
|
+
function withCommands(options) {
|
|
98
|
+
return { plugins: [commandsPlugin(options)], services: [EpdfCommands] };
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* The commands for keyboard shortcuts: the host lens of the same plugin, which matches a
|
|
102
|
+
* keystroke to a command. For the workspace, so the keys run for the active document.
|
|
103
|
+
*/
|
|
104
|
+
function shortcutCommands(host) {
|
|
105
|
+
return new CapabilityBinding(host, () => CommandsToken$1, () => null).capability;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Every command's shortcut as a working key, anywhere on the page, for the active document.
|
|
109
|
+
* Keys typed into text fields are left alone, and so is a key whose command can't run right
|
|
110
|
+
* now. A command that's turned off or not allowed still takes its key, and `onRefused` says
|
|
111
|
+
* why. Add it next to `withCommands()`; for a page with more than one viewer, put
|
|
112
|
+
* `epdfCommandShortcuts` on the element around each one instead.
|
|
113
|
+
*/
|
|
114
|
+
function withCommandShortcuts(options) {
|
|
115
|
+
return {
|
|
116
|
+
plugins: [],
|
|
117
|
+
setup: () => {
|
|
118
|
+
const commands = shortcutCommands(inject(EpdfKernelHost));
|
|
119
|
+
// The commands exist once the viewer's engine is there; the keys go with the viewer.
|
|
120
|
+
effect((onCleanup) => {
|
|
121
|
+
const current = commands();
|
|
122
|
+
if (current) {
|
|
123
|
+
onCleanup(bindCommandShortcuts(current, {
|
|
124
|
+
isMac: options?.isMac,
|
|
125
|
+
onRefused: options?.onRefused,
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Every command's shortcut as a working key, while focus is inside this element: for a page
|
|
134
|
+
* with more than one viewer, or keys that should leave the rest of the page alone. Give the
|
|
135
|
+
* element a `tabindex` so a click on it gives it focus. A key whose command is turned off or
|
|
136
|
+
* not allowed fires `(refused)`.
|
|
137
|
+
*
|
|
138
|
+
* <div class="viewer" tabindex="0" epdfCommandShortcuts (refused)="say($event.refusal.message)">
|
|
139
|
+
*/
|
|
140
|
+
class EpdfCommandShortcuts {
|
|
141
|
+
/** A key whose command is turned off or not allowed: say why. */
|
|
142
|
+
refused = output();
|
|
143
|
+
constructor() {
|
|
144
|
+
const element = inject(ElementRef).nativeElement;
|
|
145
|
+
const commands = shortcutCommands(injectKernelHost('epdfCommandShortcuts'));
|
|
146
|
+
if (!isPlatformBrowser(inject(PLATFORM_ID)))
|
|
147
|
+
return;
|
|
148
|
+
effect((onCleanup) => {
|
|
149
|
+
const current = commands();
|
|
150
|
+
if (!current)
|
|
151
|
+
return;
|
|
152
|
+
onCleanup(bindCommandShortcuts(current, {
|
|
153
|
+
target: element,
|
|
154
|
+
onRefused: (commandId, refusal) => this.refused.emit({ commandId, refusal }),
|
|
155
|
+
}));
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: EpdfCommandShortcuts, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
159
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.4", type: EpdfCommandShortcuts, isStandalone: true, selector: "[epdfCommandShortcuts]", outputs: { refused: "refused" }, ngImport: i0 });
|
|
160
|
+
}
|
|
161
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: EpdfCommandShortcuts, decorators: [{
|
|
162
|
+
type: Directive,
|
|
163
|
+
args: [{ selector: '[epdfCommandShortcuts]' }]
|
|
164
|
+
}], ctorParameters: () => [] });
|
|
165
|
+
/**
|
|
166
|
+
* A button of yours that runs a command and shows its state: a click runs it, and the button's
|
|
167
|
+
* `disabled`, `aria-pressed`, `title` and `hidden` follow the command. The template reference
|
|
168
|
+
* gives the rest as signals:
|
|
169
|
+
*
|
|
170
|
+
* <button [epdfCommand]="'zoom:in'" #zoomIn="epdfCommand">
|
|
171
|
+
* {{ zoomIn.label() }} <kbd>{{ zoomIn.shortcut() }}</kbd>
|
|
172
|
+
* </button>
|
|
173
|
+
*
|
|
174
|
+
* It runs and reads the command for this part of the template's document. An unknown id
|
|
175
|
+
* hides the button.
|
|
176
|
+
*/
|
|
177
|
+
class EpdfCommand {
|
|
178
|
+
/** The command's id: `'zoom:in'`. */
|
|
179
|
+
id = input.required(...(ngDevMode ? [{ debugName: "id", alias: 'epdfCommand' }] : [{ alias: 'epdfCommand' }]));
|
|
180
|
+
/** The command; an unknown id is neither visible nor enabled, so its button is hidden. */
|
|
181
|
+
command = inject(EpdfCommands).commandOf(() => this.id());
|
|
182
|
+
/** What the user sees. */
|
|
183
|
+
label = computed(() => this.command().label, ...(ngDevMode ? [{ debugName: "label" }] : []));
|
|
184
|
+
/** Your icon's name for it, when the command has one. */
|
|
185
|
+
icon = computed(() => this.command().icon, ...(ngDevMode ? [{ debugName: "icon" }] : []));
|
|
186
|
+
/** Its first shortcut, formatted for the platform (`'⌘K'`), or `null`. */
|
|
187
|
+
shortcut = computed(() => this.command().shortcut, ...(ngDevMode ? [{ debugName: "shortcut" }] : []));
|
|
188
|
+
/** Whether it can run now. */
|
|
189
|
+
enabled = computed(() => this.command().enabled, ...(ngDevMode ? [{ debugName: "enabled" }] : []));
|
|
190
|
+
/** Whether it shows as pressed, such as the current tool. */
|
|
191
|
+
active = computed(() => this.command().active, ...(ngDevMode ? [{ debugName: "active" }] : []));
|
|
192
|
+
/** Whether it shows at all. */
|
|
193
|
+
visible = computed(() => this.command().visible, ...(ngDevMode ? [{ debugName: "visible" }] : []));
|
|
194
|
+
/** Run the command for this part of the template's document. Resolves `{ status }`, like `execute()`. */
|
|
195
|
+
run() {
|
|
196
|
+
return untracked(this.command).run();
|
|
197
|
+
}
|
|
198
|
+
onClick() {
|
|
199
|
+
// A command whose `run` throws reports it through `executionFailed$`.
|
|
200
|
+
this.run().catch(() => { });
|
|
201
|
+
}
|
|
202
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: EpdfCommand, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
203
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "20.2.4", type: EpdfCommand, isStandalone: true, selector: "[epdfCommand]", inputs: { id: { classPropertyName: "id", publicName: "epdfCommand", isSignal: true, isRequired: true, transformFunction: null } }, host: { listeners: { "click": "onClick()" }, properties: { "attr.disabled": "enabled() ? null : \"\"", "attr.aria-pressed": "active() ? \"true\" : null", "attr.title": "label() || null", "hidden": "!visible()" } }, exportAs: ["epdfCommand"], ngImport: i0 });
|
|
204
|
+
}
|
|
205
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: EpdfCommand, decorators: [{
|
|
206
|
+
type: Directive,
|
|
207
|
+
args: [{
|
|
208
|
+
selector: '[epdfCommand]',
|
|
209
|
+
exportAs: 'epdfCommand',
|
|
210
|
+
host: {
|
|
211
|
+
'(click)': 'onClick()',
|
|
212
|
+
'[attr.disabled]': 'enabled() ? null : ""',
|
|
213
|
+
'[attr.aria-pressed]': 'active() ? "true" : null',
|
|
214
|
+
'[attr.title]': 'label() || null',
|
|
215
|
+
'[hidden]': '!visible()',
|
|
216
|
+
},
|
|
217
|
+
}]
|
|
218
|
+
}] });
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* @embedpdf/angular/commands: every action of the viewer, run from buttons, menus and keys.
|
|
222
|
+
*
|
|
223
|
+
* withCommands({ commands }), withCommandShortcuts() for provideEmbedPdf()
|
|
224
|
+
* standardCommands the commands every viewer has
|
|
225
|
+
* inject(EpdfCommands) run, find and register commands
|
|
226
|
+
* [epdfCommand], [epdfCommandShortcuts] a command button; the keys in one element
|
|
227
|
+
*/
|
|
228
|
+
// The plugin's types and helpers, so app code has one import for the feature.
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Generated bundle index. Do not edit.
|
|
232
|
+
*/
|
|
233
|
+
|
|
234
|
+
export { EpdfCommand, EpdfCommandShortcuts, EpdfCommands, formatShortcut, standardCommands, withCommandShortcuts, withCommands };
|
|
235
|
+
//# sourceMappingURL=embedpdf-angular-commands.mjs.map
|