@embedpdf/angular 3.0.0-next.14 → 3.0.0-next.16

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.
Files changed (87) hide show
  1. package/README.md +309 -0
  2. package/dist/README.md +309 -0
  3. package/dist/actions/index.d.ts +34 -16
  4. package/dist/anchored/index.d.ts +67 -0
  5. package/dist/annotation/index.d.ts +602 -0
  6. package/dist/attachment/index.d.ts +29 -0
  7. package/dist/commands/index.d.ts +109 -0
  8. package/dist/fesm2022/embedpdf-angular-actions.mjs +117 -36
  9. package/dist/fesm2022/embedpdf-angular-actions.mjs.map +1 -1
  10. package/dist/fesm2022/embedpdf-angular-anchored.mjs +148 -0
  11. package/dist/fesm2022/embedpdf-angular-anchored.mjs.map +1 -0
  12. package/dist/fesm2022/embedpdf-angular-annotation.mjs +1933 -0
  13. package/dist/fesm2022/embedpdf-angular-annotation.mjs.map +1 -0
  14. package/dist/fesm2022/embedpdf-angular-attachment.mjs +67 -0
  15. package/dist/fesm2022/embedpdf-angular-attachment.mjs.map +1 -0
  16. package/dist/fesm2022/embedpdf-angular-commands.mjs +235 -0
  17. package/dist/fesm2022/embedpdf-angular-commands.mjs.map +1 -0
  18. package/dist/fesm2022/embedpdf-angular-form.mjs +1074 -0
  19. package/dist/fesm2022/embedpdf-angular-form.mjs.map +1 -0
  20. package/dist/fesm2022/embedpdf-angular-history.mjs +54 -0
  21. package/dist/fesm2022/embedpdf-angular-history.mjs.map +1 -0
  22. package/dist/fesm2022/embedpdf-angular-i18n.mjs +100 -0
  23. package/dist/fesm2022/embedpdf-angular-i18n.mjs.map +1 -0
  24. package/dist/fesm2022/embedpdf-angular-interaction.mjs +157 -0
  25. package/dist/fesm2022/embedpdf-angular-interaction.mjs.map +1 -0
  26. package/dist/fesm2022/embedpdf-angular-link.mjs +306 -0
  27. package/dist/fesm2022/embedpdf-angular-link.mjs.map +1 -0
  28. package/dist/fesm2022/embedpdf-angular-measurement.mjs +106 -0
  29. package/dist/fesm2022/embedpdf-angular-measurement.mjs.map +1 -0
  30. package/dist/fesm2022/embedpdf-angular-metadata.mjs +77 -0
  31. package/dist/fesm2022/embedpdf-angular-metadata.mjs.map +1 -0
  32. package/dist/fesm2022/embedpdf-angular-outline.mjs +76 -0
  33. package/dist/fesm2022/embedpdf-angular-outline.mjs.map +1 -0
  34. package/dist/fesm2022/embedpdf-angular-page-edit.mjs +68 -0
  35. package/dist/fesm2022/embedpdf-angular-page-edit.mjs.map +1 -0
  36. package/dist/fesm2022/embedpdf-angular-page-view.mjs +297 -0
  37. package/dist/fesm2022/embedpdf-angular-page-view.mjs.map +1 -0
  38. package/dist/fesm2022/embedpdf-angular-redaction.mjs +93 -0
  39. package/dist/fesm2022/embedpdf-angular-redaction.mjs.map +1 -0
  40. package/dist/fesm2022/embedpdf-angular-render.mjs +331 -69
  41. package/dist/fesm2022/embedpdf-angular-render.mjs.map +1 -1
  42. package/dist/fesm2022/embedpdf-angular-runtime.mjs +1151 -390
  43. package/dist/fesm2022/embedpdf-angular-runtime.mjs.map +1 -1
  44. package/dist/fesm2022/embedpdf-angular-search.mjs +251 -0
  45. package/dist/fesm2022/embedpdf-angular-search.mjs.map +1 -0
  46. package/dist/fesm2022/embedpdf-angular-selection.mjs +477 -0
  47. package/dist/fesm2022/embedpdf-angular-selection.mjs.map +1 -0
  48. package/dist/fesm2022/embedpdf-angular-shell.mjs +177 -0
  49. package/dist/fesm2022/embedpdf-angular-shell.mjs.map +1 -0
  50. package/dist/fesm2022/embedpdf-angular-signature.mjs +120 -0
  51. package/dist/fesm2022/embedpdf-angular-signature.mjs.map +1 -0
  52. package/dist/fesm2022/embedpdf-angular-stage.mjs +688 -288
  53. package/dist/fesm2022/embedpdf-angular-stage.mjs.map +1 -1
  54. package/dist/fesm2022/embedpdf-angular-stamp.mjs +169 -0
  55. package/dist/fesm2022/embedpdf-angular-stamp.mjs.map +1 -0
  56. package/dist/fesm2022/embedpdf-angular-testing.mjs +89 -0
  57. package/dist/fesm2022/embedpdf-angular-testing.mjs.map +1 -0
  58. package/dist/fesm2022/embedpdf-angular-toolbar.mjs +1123 -0
  59. package/dist/fesm2022/embedpdf-angular-toolbar.mjs.map +1 -0
  60. package/dist/fesm2022/embedpdf-angular-view-manager.mjs +69 -0
  61. package/dist/fesm2022/embedpdf-angular-view-manager.mjs.map +1 -0
  62. package/dist/fesm2022/embedpdf-angular.mjs +25 -3
  63. package/dist/fesm2022/embedpdf-angular.mjs.map +1 -1
  64. package/dist/form/index.d.ts +79 -0
  65. package/dist/history/index.d.ts +28 -0
  66. package/dist/i18n/index.d.ts +52 -0
  67. package/dist/index.d.ts +22 -0
  68. package/dist/interaction/index.d.ts +58 -0
  69. package/dist/link/index.d.ts +77 -0
  70. package/dist/measurement/index.d.ts +46 -0
  71. package/dist/metadata/index.d.ts +51 -0
  72. package/dist/outline/index.d.ts +32 -0
  73. package/dist/page-edit/index.d.ts +27 -0
  74. package/dist/page-view/index.d.ts +94 -0
  75. package/dist/redaction/index.d.ts +38 -0
  76. package/dist/render/index.d.ts +45 -6
  77. package/dist/runtime/index.d.ts +579 -199
  78. package/dist/search/index.d.ts +71 -0
  79. package/dist/selection/index.d.ts +141 -0
  80. package/dist/shell/index.d.ts +88 -0
  81. package/dist/signature/index.d.ts +45 -0
  82. package/dist/stage/index.d.ts +242 -141
  83. package/dist/stamp/index.d.ts +58 -0
  84. package/dist/testing/index.d.ts +53 -0
  85. package/dist/toolbar/index.d.ts +257 -0
  86. package/dist/view-manager/index.d.ts +23 -0
  87. package/package.json +145 -14
@@ -1 +1 @@
1
- {"version":3,"file":"embedpdf-angular-stage.mjs","sources":["../../stage/src/templates.ts","../../stage/src/page-surface.ts","../../stage/src/stage.ts","../../stage/src/facades.ts","../../stage/src/public_api.ts","../../stage/src/embedpdf-angular-stage.ts"],"sourcesContent":["/**\n * The render-prop translation: React's `children: (page) => ReactNode` becomes\n * marker directives on `<ng-template>`, typed so `let-page` infers\n * `EpdfPageContext` in the template.\n *\n * <epdf-stage>\n * <ng-template epdfPage> page-space content (rotates)\n * <ng-template epdfPageChrome> box-space chrome (never rotates)\n *\n * The `$implicit` context is the SAME stable object the per-page injector\n * provides as `EPDF_PAGE` — `let-page` is sugar for inline chrome; components\n * inside the template just call `injectPage()`.\n */\nimport { Directive, inject, TemplateRef } from '@angular/core';\nimport type { EpdfPageContext } from '@embedpdf/angular/runtime';\n\nexport interface EpdfPageTemplateContext {\n $implicit: EpdfPageContext;\n}\n\n/** PAGE-SPACE content for each visible page (RenderLayer, annotations,\n * markers). Rendered inside the page's content frame, so it ROTATES with the\n * page's display rotation — coordinates are plain PDF points. */\n@Directive({ selector: 'ng-template[epdfPage]', standalone: true })\nexport class EpdfPageTemplate {\n readonly template = inject<TemplateRef<EpdfPageTemplateContext>>(TemplateRef);\n static ngTemplateContextGuard(\n _dir: EpdfPageTemplate,\n ctx: unknown,\n ): ctx is EpdfPageTemplateContext {\n return true;\n }\n}\n\n/** BOX-SPACE chrome for each visible page (page-number label, selection\n * border, per-page buttons). Rendered into the OUTER box (content + reserved\n * `pageFrame`), so it does NOT rotate and the reserved bands are plain\n * regions (`bottom: 0; height: page.frame().bottom`). */\n@Directive({ selector: 'ng-template[epdfPageChrome]', standalone: true })\nexport class EpdfPageChrome {\n readonly template = inject<TemplateRef<EpdfPageTemplateContext>>(TemplateRef);\n static ngTemplateContextGuard(\n _dir: EpdfPageChrome,\n ctx: unknown,\n ): ctx is EpdfPageTemplateContext {\n return true;\n }\n}\n","/**\n * INTERNAL page shell — one per visible page, tracked by `pon` so the instance\n * (and everything below) survives camera motion and page reorders.\n *\n * THE STABILITY INVARIANT (see page-context.ts): `page` (the context) and\n * `pageInjector` are created ONCE per surface. Camera frames arrive as new\n * `vp` input values; only the signals inside the context change. Changing the\n * injector or context object identity would make `NgTemplateOutlet` recreate\n * the embedded views — destroying layers at 120Hz. Don't.\n *\n * Geometry mirrors React's PageSurface: the outer box = content footprint +\n * reserved chrome bands; the shadow is axis-aligned and stays put under\n * rotation; the content wrapper is the ONLY thing rotation turns, and carries\n * no transform at rotation 0 so it pixel-snaps like the shadow behind it.\n * All numbers come from the transform — never re-derive `* zoom` / `* dpr`.\n */\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n Injector,\n input,\n viewChild,\n type TemplateRef,\n} from '@angular/core';\nimport type { PageFrame, VisiblePage } from '@embedpdf/plugin-stage';\nimport { createPageContext, EPDF_PAGE, type EpdfPageContext } from '@embedpdf/angular/runtime';\nimport type { EpdfPageTemplateContext } from './templates';\n\n@Component({\n selector: 'epdf-page-surface',\n standalone: true,\n imports: [NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n style: 'position: absolute; display: block;',\n '[style.left.px]': 'left()',\n '[style.top.px]': 'top()',\n '[style.width.px]': 'outerWidth()',\n '[style.height.px]': 'outerHeight()',\n },\n template: `\n <!-- drop shadow ONLY — axis-aligned at the content box (inset by the frame),\n transparent fill so it can never peek out behind the bitmap, and it\n stays put under rotation. -->\n <div\n style=\"position: absolute; box-shadow: var(--epdf-page-shadow, 0 6px 18px rgba(0, 0, 0, 0.18));\"\n [style.left.px]=\"frame().left\"\n [style.top.px]=\"frame().top\"\n [style.width.px]=\"t().viewWidth\"\n [style.height.px]=\"t().viewHeight\"\n ></div>\n <!-- the page: white backing + content as ONE box — the only thing rotation\n turns. We render our own selection highlights, so native selection is\n suppressed on the whole page subtree. -->\n <div\n #content\n style=\"position: absolute; background: #fff; user-select: none; -webkit-user-select: none;\"\n [style.left.px]=\"contentLeft()\"\n [style.top.px]=\"contentTop()\"\n [style.width.px]=\"t().contentWidth\"\n [style.height.px]=\"t().contentHeight\"\n [style.transform]=\"rotate()\"\n >\n <ng-container\n [ngTemplateOutlet]=\"pageTpl()\"\n [ngTemplateOutletContext]=\"templateContext\"\n [ngTemplateOutletInjector]=\"pageInjector\"\n />\n </div>\n <!-- box-space chrome — fills the outer box, NEVER rotates. Bands are plain\n regions: a label is bottom: 0; height: frame().bottom. -->\n @if (chromeTpl(); as chrome) {\n <ng-container\n [ngTemplateOutlet]=\"chrome\"\n [ngTemplateOutletContext]=\"templateContext\"\n [ngTemplateOutletInjector]=\"pageInjector\"\n />\n }\n `,\n})\nexport class EpdfPageSurface {\n readonly vp = input.required<VisiblePage>();\n readonly frame = input.required<PageFrame>();\n readonly documentId = input.required<string>();\n readonly pageTpl = input.required<TemplateRef<EpdfPageTemplateContext>>();\n readonly chromeTpl = input<TemplateRef<EpdfPageTemplateContext> | null>(null);\n\n protected readonly t = computed(() => this.vp().transform);\n\n // Outer box = display footprint + reserved chrome bands; screenX/screenY are\n // the device-snapped footprint top-left, so the box sits one frame further out.\n protected readonly left = computed(() => this.vp().screenX - this.frame().left);\n protected readonly top = computed(() => this.vp().screenY - this.frame().top);\n protected readonly outerWidth = computed(\n () => this.t().viewWidth + this.frame().left + this.frame().right,\n );\n protected readonly outerHeight = computed(\n () => this.t().viewHeight + this.frame().top + this.frame().bottom,\n );\n // Center the (possibly rotated) content box on the display box and rotate\n // about its center — NO translate(), so rotation 0 carries no transform.\n protected readonly contentLeft = computed(\n () => this.frame().left + (this.t().viewWidth - this.t().contentWidth) / 2,\n );\n protected readonly contentTop = computed(\n () => this.frame().top + (this.t().viewHeight - this.t().contentHeight) / 2,\n );\n protected readonly rotate = computed(() => {\n const rotation = this.vp().rotation;\n return rotation ? `rotate(${rotation}deg)` : null;\n });\n\n private readonly contentEl = viewChild.required<ElementRef<HTMLDivElement>>('content');\n\n /** ONE stable context per surface — volatile parts are signals inside it. */\n readonly page: EpdfPageContext = createPageContext({\n documentId: () => this.documentId(),\n pon: () => this.vp().pon,\n pageIndex: computed(() => this.vp().pageIndex),\n frame: this.frame,\n transform: this.t,\n getRect: () => this.contentEl().nativeElement.getBoundingClientRect(),\n });\n\n /** ONE stable injector per surface (see the invariant above), parented to\n * this surface's node injector so layers also reach the kernel host. */\n protected readonly pageInjector = Injector.create({\n providers: [{ provide: EPDF_PAGE, useValue: this.page }],\n parent: inject(Injector),\n });\n\n protected readonly templateContext: EpdfPageTemplateContext = { $implicit: this.page };\n}\n","/**\n * `<epdf-stage>` — virtualizes and positions page surfaces by the camera, and\n * stamps each one with YOUR `<ng-template epdfPage>` — you bring the layers.\n *\n * NULL-SAFE BY DESIGN (a deliberate deviation from React's strict Stage):\n * Angular instantiates projected content eagerly, so a stage constructed\n * before any document exists must not crash — it renders zero pages and its\n * listeners no-op until the document arrives. Teach the document gate anyway:\n * document CHROME (toolbars, panels) still belongs behind `*epdfDocumentGate`.\n *\n * ZONE RULE: every DOM listener here attaches OUTSIDE Angular's zone — a\n * 120Hz pointermove stream must never trigger app-wide change detection.\n * State flows kernel → tick signal → computeds → bindings, so the adapter is\n * zone-agnostic (zoneless recommended, zone.js tolerated).\n */\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n effect,\n ElementRef,\n inject,\n input,\n NgZone,\n PLATFORM_ID,\n} from '@angular/core';\nimport { StageToken, createScrollHandler } from '@embedpdf/plugin-stage';\nimport type { StageCapability, VisiblePage } from '@embedpdf/plugin-stage';\nimport { InteractionToken } from '@embedpdf/plugin-interaction/contract';\nimport {\n injectDocumentId,\n injectKernelHost,\n injectOptionalCapability,\n injectOptionalCapabilityFor,\n injectOptionalSelectorFor,\n type CapabilityToken,\n} from '@embedpdf/angular/runtime';\nimport type { PageFrame } from '@embedpdf/plugin-stage';\nimport { createStageSurface } from '@embedpdf/web';\nimport { EpdfPageChrome, EpdfPageTemplate } from './templates';\nimport { EpdfPageSurface } from './page-surface';\n\n/** Which stage lens to bind to. Defaults to the main StageToken — pass a custom\n * token to drive an additional lens (e.g. a wrapped thumbnail sidebar). */\nexport type StageTokenProp = CapabilityToken<StageCapability>;\n\nconst EMPTY_PAGES: VisiblePage[] = [];\nconst NO_FRAME: PageFrame = { top: 0, right: 0, bottom: 0, left: 0 };\nconst frameEqual = (a: PageFrame, b: PageFrame) =>\n a.top === b.top && a.right === b.right && a.bottom === b.bottom && a.left === b.left;\n\n@Component({\n selector: 'epdf-stage',\n standalone: true,\n imports: [EpdfPageSurface],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n style: 'position: relative; overflow: hidden; touch-action: none; display: block;',\n '[style.cursor]': 'cursor()',\n },\n template: `\n @if (pageTemplate(); as tpl) {\n @for (p of pages(); track p.pon) {\n <epdf-page-surface\n [vp]=\"p\"\n [frame]=\"frame()\"\n [documentId]=\"documentId() ?? ''\"\n [pageTpl]=\"tpl\"\n [chromeTpl]=\"chromeTemplate()\"\n />\n }\n }\n <!-- viewport-space overlay UI: anything projected into <epdf-stage>\n renders above the pages (menus, controls, scrollbars). -->\n <ng-content />\n `,\n})\nexport class EpdfStage {\n /**\n * Route this Stage's pointer events to the interaction hub (page-resolved via\n * `pageAt`) — AND register this lens's tool-gated pan-scroll handler with it\n * (lens-scoped, so multiple stages on one document never pan each other).\n * Pan is then the `pan` tool's job and dragging in `pointer` mode selects\n * text (incl. across pages).\n *\n * Default TRUE: registering `interactionPlugin()` is the one opt-in — tools\n * just work; without the hub this is inert and the stage falls back to\n * built-in drag-to-pan, so a hub-less setup costs nothing. Set `false` on\n * SECONDARY lenses (a thumbnail rail) that should stay click-to-navigate\n * instead of feeding the document's tools.\n */\n readonly interaction = input(true);\n /**\n * With `interaction`: let drags over page GAPS pan regardless of the active\n * tool (and show a grab cursor there) — the gutter always pans; there is\n * nothing to draw/select outside a page. Default true.\n */\n readonly panFallback = input(true);\n /**\n * Ambient ZOOM gestures on this stage: ctrl/cmd+wheel and trackpad pinch\n * (Safari gesture events included). Default true. Turn OFF for follower\n * lenses with a fixed magnification (a thumbnail rail should scroll under\n * cmd+wheel, not zoom); pinches are still swallowed either way.\n */\n readonly zoomGestures = input(true);\n /** The stage lens to drive (default: the main StageToken). */\n readonly token = input<StageTokenProp>(StageToken);\n\n private readonly host = injectKernelHost();\n private readonly stage = injectOptionalCapabilityFor(() => this.token());\n private readonly ix = injectOptionalCapability(InteractionToken);\n private readonly useHub = computed(() => this.interaction() && this.ix() !== null);\n // The hub's resolved cursor (text/grab/…), applied to the viewport when driving.\n private readonly hubCursor = this.host.value(() => this.ix()?.cursor() ?? 'default');\n protected readonly cursor = computed(() => (this.useHub() ? this.hubCursor() : null));\n\n protected readonly documentId = injectDocumentId();\n // visiblePages already folds in the camera (each page carries its\n // device-snapped screenX/screenY + transform), so panning re-emits the list —\n // no separate camera subscription needed for positioning. The capability\n // memoizes, so Object.is equality suffices.\n protected readonly pages = injectOptionalSelectorFor(\n () => this.token(),\n (c) => c.visiblePages(),\n EMPTY_PAGES,\n );\n // Reserved chrome bands (screen px), uniform across pages — the frame the\n // outer box reserves and the chrome template paints into.\n protected readonly frame = injectOptionalSelectorFor(\n () => this.token(),\n (c) => c.pageFrame(),\n NO_FRAME,\n frameEqual,\n );\n\n private readonly pageTemplateDir = contentChild(EpdfPageTemplate);\n private readonly chromeTemplateDir = contentChild(EpdfPageChrome);\n protected readonly pageTemplate = computed(() => this.pageTemplateDir()?.template ?? null);\n protected readonly chromeTemplate = computed(() => this.chromeTemplateDir()?.template ?? null);\n\n constructor() {\n if (!isPlatformBrowser(inject(PLATFORM_ID))) return;\n const el = inject(ElementRef).nativeElement as HTMLElement;\n const zone = inject(NgZone);\n\n // Rebinds when the stage capability (document open/close/switch, token\n // change), hub, or gesture flags change — the Angular spelling of the React\n // Stage effect and its dependency array.\n effect((onCleanup) => {\n const stage = this.stage();\n const ix = this.ix();\n const useHub = this.interaction() && !!ix;\n const panFallback = this.panFallback();\n const zoomGestures = this.zoomGestures();\n if (!stage) return; // no document yet — nothing to drive\n\n const cleanups: Array<() => void> = [];\n zone.runOutsideAngular(() => {\n // The WHOLE browser binding — viewport/DPR reporting, sample\n // normalization, gesture controller — is the shared @embedpdf/web\n // surface, so every framework adapter has one feel. This component\n // keeps only Angular glue.\n cleanups.push(\n createStageSurface(el, stage, {\n hub: useHub ? ix : null,\n source: stage.lensId(),\n zoomGestures,\n }),\n );\n // Interaction opt-in lives WITH the sample source: the same knob that\n // forwards this lens's samples also registers its pan-scroll handler,\n // lens-scoped — two stages on one document can never pan each other.\n if (useHub && ix) {\n cleanups.push(\n ix.registerHandler(createScrollHandler(stage, ix, { panFallback }), {\n source: stage.lensId(),\n }),\n );\n }\n });\n onCleanup(() => cleanups.forEach((fn) => fn()));\n });\n }\n}\n","/**\n * Facade inject functions — thin sugar over the capability + generic binding,\n * name-for-name with the React hooks (`useZoom` → `injectZoom`), values\n * replaced by signals.\n *\n * STRICT like their React counterparts: they resolve a document-scoped\n * capability, so call them in document UI (behind `*epdfDocumentGate` /\n * `@if (documentId())`). For always-mounted chrome, read through\n * `injectOptionalSelector` with a fallback instead.\n *\n * Methods LATE-BIND the current capability (`() => cap().zoomIn()`), so a\n * facade captured before a document switch drives the document that is active\n * at CALL time, never a stale one.\n */\nimport type { Signal } from '@angular/core';\nimport { StageToken, settingsEqual } from '@embedpdf/plugin-stage';\nimport type { StageCapability } from '@embedpdf/plugin-stage';\nimport { injectCapability, injectSelector, shallowArray } from '@embedpdf/angular/runtime';\nimport type { StageTokenProp } from './stage';\n\ntype AnyFn = (...args: never[]) => unknown;\n/** Late-binding method passthrough: exact capability signature, current doc. */\nconst lazy = <K extends keyof StageCapability>(\n cap: Signal<StageCapability>,\n key: K,\n): StageCapability[K] =>\n ((...args: unknown[]) =>\n (cap()[key] as unknown as (...a: unknown[]) => unknown)(...args)) as StageCapability[K] &\n AnyFn as StageCapability[K];\n\nexport function injectStage(token: StageTokenProp = StageToken): Signal<StageCapability> {\n return injectCapability(token);\n}\n\nexport function injectZoom(token: StageTokenProp = StageToken) {\n const s = injectCapability(token);\n return {\n zoom: injectSelector(token, (c) => c.zoomLevel()),\n /** Active zoom intent: 'automatic' | 'fit-page' | 'fit-width' | 'fit-all' | 'custom'. */\n mode: injectSelector(token, (c) => c.zoomMode()),\n zoomIn: lazy(s, 'zoomIn'),\n zoomOut: lazy(s, 'zoomOut'),\n fitWidth: lazy(s, 'fitWidth'),\n fitPage: lazy(s, 'fitPage'),\n fitAll: lazy(s, 'fitAll'),\n automatic: lazy(s, 'automatic'),\n zoomTo: lazy(s, 'zoomTo'),\n };\n}\n\nexport function injectPages(token: StageTokenProp = StageToken) {\n const s = injectCapability(token);\n return {\n currentPage: injectSelector(token, (c) => c.currentPage()),\n pageCount: injectSelector(token, (c) => c.pageCount()),\n goToPage: lazy(s, 'goToPage'),\n next: lazy(s, 'next'),\n prev: lazy(s, 'prev'),\n reveal: lazy(s, 'reveal'),\n };\n}\n\nexport function injectLayout(token: StageTokenProp = StageToken) {\n const s = injectCapability(token);\n return {\n flow: injectSelector(token, (c) => c.flow()),\n layout: injectSelector(token, (c) => c.layout()),\n spread: injectSelector(token, (c) => c.spread()),\n sizing: injectSelector(token, (c) => c.sizing()),\n bounded: injectSelector(token, (c) => c.bounded()),\n setFlow: lazy(s, 'setFlow'),\n setLayout: lazy(s, 'setLayout'),\n setSpread: lazy(s, 'setSpread'),\n setSizing: lazy(s, 'setSizing'),\n setBounded: lazy(s, 'setBounded'),\n };\n}\n\n/** The document's page list (with PDF labels) + the current item's pages — the\n * data for page thumbnails / worksheet-style page tabs. */\nexport function injectPageList(token: StageTokenProp = StageToken) {\n return {\n pages: injectSelector(\n token,\n (c) => c.pages(),\n (a, b) =>\n a.length === b.length && a.every((p, i) => p.pon === b[i].pon && p.label === b[i].label),\n ),\n currentItemPages: injectSelector(token, (c) => c.currentItemPages(), shallowArray),\n };\n}\n\n/**\n * All Stage settings + the batch `update`. The seam for \"presets are a customer\n * concern\": keep your own `Partial<StageSettings>` objects and apply them with\n * `update(preset)` (one anchor-preserving change).\n */\nexport function injectStageSettings(token: StageTokenProp = StageToken) {\n const s = injectCapability(token);\n return {\n // settingsEqual derives from the plugin's settings registry — a new setting\n // is covered automatically, without this package spelling out the shape.\n settings: injectSelector(token, (c) => c.settings(), settingsEqual),\n update: lazy(s, 'update'),\n reset: lazy(s, 'resetView'),\n };\n}\n","/**\n * @embedpdf/angular/stage — the viewport trunk: `<epdf-stage>` + page\n * templates + the stage facade inject functions.\n */\n\n// One-line-per-feature: registration travels with the UI.\nexport * from '@embedpdf/plugin-stage';\nexport * from './templates';\nexport * from './page-surface';\nexport * from './stage';\nexport * from './facades';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;;;;;;AAYG;AAQH;;AAEkE;MAErD,gBAAgB,CAAA;AAClB,IAAA,QAAQ,GAAG,MAAM,CAAuC,WAAW,CAAC;AAC7E,IAAA,OAAO,sBAAsB,CAC3B,IAAsB,EACtB,GAAY,EAAA;AAEZ,QAAA,OAAO,IAAI;IACb;uGAPW,gBAAgB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAhB,gBAAgB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,uBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAhB,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAD5B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA,EAAE,QAAQ,EAAE,uBAAuB,EAAE,UAAU,EAAE,IAAI,EAAE;;AAWlE;;;AAG0D;MAE7C,cAAc,CAAA;AAChB,IAAA,QAAQ,GAAG,MAAM,CAAuC,WAAW,CAAC;AAC7E,IAAA,OAAO,sBAAsB,CAC3B,IAAoB,EACpB,GAAY,EAAA;AAEZ,QAAA,OAAO,IAAI;IACb;uGAPW,cAAc,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAd,cAAc,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,6BAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAd,cAAc,EAAA,UAAA,EAAA,CAAA;kBAD1B,SAAS;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C,EAAE,WAAW,CAAC;KAC5B;AACH;;AC1GA;;;AAGG;AAEH;;ACLA;;AAEG;;;;"}
1
+ {"version":3,"file":"embedpdf-angular-stage.mjs","sources":["../../stage/src/stage-ref.ts","../../stage/src/feature.ts","../../stage/src/templates.ts","../../stage/src/page-surface.ts","../../stage/src/stage.ts","../../stage/src/scrollbar.ts","../../stage/src/public_api.ts","../../stage/src/embedpdf-angular-stage.ts"],"sourcesContent":["/**\n * `EpdfStageRef`: a Stage's API, for code that injects it. It has every method of the Stage\n * page's Methods table, every value of its State table as a signal (`zoomLevel()`,\n * `currentPageIndex()`, `pageCount()`), its settings as `settings()`, and its events as streams\n * (`pageChanged$`).\n *\n * Inside `<epdf-stage>`, `inject(EpdfStageRef)` is that Stage: the component extends this class\n * and provides itself under it, so its `[token]` view and its `[document]` are what you drive.\n * Anywhere else under a viewer it drives the main view (`StageToken`) of the document in scope\n * (`[epdfDocumentScope]`), else of the active document, as `inject(EpdfSearch)` does. Around a\n * Stage, its template reference (`#stage=\"epdfStage\"`) or `viewChild(EpdfStage)` reaches it.\n *\n * Without a document its signals read their empty values, and a method called then refuses\n * with `not-ready`. Each method looks the view up when it's called, so it acts on the document\n * shown at that moment.\n */\nimport { computed, Injectable, type Signal } from '@angular/core';\nimport type { CapabilityToken, PageRef } from '@embedpdf/core';\nimport { DEFAULT_SETTINGS, stageState, StageToken } from '@embedpdf/plugin-stage';\nimport type { StageCapability, StageSettings } from '@embedpdf/plugin-stage';\nimport type { ScrollMetrics, StageHostCapability } from '@embedpdf/plugin-stage/contract/host';\nimport {\n CapabilityBinding,\n injectDocumentScope,\n injectKernelHost,\n type EpdfKernelHost,\n} from '@embedpdf/angular/runtime';\n\n/** The view a Stage drives: the main one (`StageToken`), or one registered with its own token. */\nexport type StageTokenProp = CapabilityToken<StageCapability>;\n\nconst NO_SCROLL: ScrollMetrics = Object.freeze({\n scrollLeft: 0,\n scrollTop: 0,\n scrollWidth: 0,\n scrollHeight: 0,\n clientWidth: 0,\n clientHeight: 0,\n scrollableX: false,\n scrollableY: false,\n});\n\n/** The same runtime token, typed with the wider capability the Stage itself drives. */\nconst asHost = (token: StageTokenProp) => token as unknown as CapabilityToken<StageHostCapability>;\n\n@Injectable({ providedIn: 'root' })\nexport class EpdfStageRef {\n /** The viewer the view is in. */\n protected readonly host: EpdfKernelHost = injectKernelHost(this.usedAs());\n /** The view, for the document in scope: inside `<epdf-stage>`, the Stage's own. */\n protected readonly binding = new CapabilityBinding<StageHostCapability>(\n this.host,\n () => asHost(this.view()),\n injectDocumentScope(),\n );\n\n /** The view it drives: the main one. `<epdf-stage>` drives the one its `[token]` names. */\n protected view(): StageTokenProp {\n return StageToken;\n }\n\n /** What an error says was used without a viewer. */\n protected usedAs(): string {\n return 'inject(EpdfStageRef)';\n }\n\n // ── state: the Stage page's State table, one signal per value ─────────────────\n\n private readonly state = this.binding.select((stage) => stageState.read(stage), stageState.empty);\n /** The zoom as a number: `1` is 100%. */\n readonly zoomLevel: Signal<number> = computed(() => this.state().zoomLevel);\n /** The fit mode, such as `'fit-width'`, or `'custom'` after a pinch or an exact level. */\n readonly zoomMode = computed(() => this.state().zoomMode);\n /** The current page's place in the document, from 0. */\n readonly currentPageIndex: Signal<number> = computed(() => this.state().currentPageIndex);\n /** The current page's ref, or null before the document has pages. */\n readonly currentPage: Signal<PageRef | null> = computed(() => this.state().currentPage);\n /** How many pages the document has. */\n readonly pageCount: Signal<number> = computed(() => this.state().pageCount);\n /** How the view is turned: `0`, `90`, `180` or `270`. */\n readonly viewRotation = computed(() => this.state().viewRotation);\n /** The names of the responsive rules that apply now, in order. */\n readonly activeRules: Signal<readonly string[]> = computed(() => this.state().activeRules);\n /** The view's settings; the defaults without a document. Change them with `updateSettings()`. */\n readonly settings: Signal<StageSettings> = this.binding.select(\n (stage) => stage.getSettings(),\n DEFAULT_SETTINGS,\n );\n /** The scroll position as a scrolling element has it, in screen pixels; all zero without a document. */\n readonly scrollMetrics: Signal<ScrollMetrics> = this.binding.select(\n (stage) => stage.getScrollMetrics(),\n NO_SCROLL,\n Object.is,\n );\n\n // ── events, as streams ───────────────────────────────────────────────────────\n\n /** Another page became the current one: `page`, `pageIndex`, `previousPageIndex`. */\n readonly pageChanged$ = this.binding.stream((stage) => stage.onPageChanged);\n /** The zoom level changed: `level`, `previousLevel`, `mode`. */\n readonly zoomChanged$ = this.binding.stream((stage) => stage.onZoomChanged);\n /** The view moved, on every frame of a scroll or zoom: `camera`. */\n readonly cameraChanged$ = this.binding.stream((stage) => stage.onCameraChanged);\n /** Scrolling, a fling or an animated move came to rest: `camera`. */\n readonly motionEnded$ = this.binding.stream((stage) => stage.onMotionEnded);\n /** The Stage itself changed size: `size`. */\n readonly viewportChanged$ = this.binding.stream((stage) => stage.onViewportChanged);\n /** A setting changed, by a call or a responsive rule: `settings`, `changed`. */\n readonly settingsChanged$ = this.binding.stream((stage) => stage.onSettingsChanged);\n\n // ── methods: the Stage page's Methods table ──────────────────────────────────\n\n readonly getCamera = this.binding.method('getCamera');\n readonly setCamera = this.binding.method('setCamera');\n readonly getViewportSize = this.binding.method('getViewportSize');\n readonly getZoomLevel = this.binding.method('getZoomLevel');\n readonly getZoomMode = this.binding.method('getZoomMode');\n readonly getViewRotation = this.binding.method('getViewRotation');\n readonly getCurrentPage = this.binding.method('getCurrentPage');\n readonly getCurrentPageIndex = this.binding.method('getCurrentPageIndex');\n readonly getPageCount = this.binding.method('getPageCount');\n readonly listCurrentItemPages = this.binding.method('listCurrentItemPages');\n readonly listVisiblePages = this.binding.method('listVisiblePages');\n readonly isPageVisible = this.binding.method('isPageVisible');\n readonly getViewpoint = this.binding.method('getViewpoint');\n readonly getViewState = this.binding.method('getViewState');\n readonly applyViewState = this.binding.method('applyViewState');\n readonly isMoving = this.binding.method('isMoving');\n readonly stopMotion = this.binding.method('stopMotion');\n\n readonly zoomTo = this.binding.method('zoomTo');\n readonly zoomBy = this.binding.method('zoomBy');\n readonly zoomIn = this.binding.method('zoomIn');\n readonly zoomOut = this.binding.method('zoomOut');\n readonly fitWidth = this.binding.method('fitWidth');\n readonly fitPage = this.binding.method('fitPage');\n readonly fitAll = this.binding.method('fitAll');\n readonly fitAutomatic = this.binding.method('fitAutomatic');\n\n readonly goToPage = this.binding.method('goToPage');\n readonly goToDestination = this.binding.method('goToDestination');\n readonly goToFirstPage = this.binding.method('goToFirstPage');\n readonly goToLastPage = this.binding.method('goToLastPage');\n readonly nextPage = this.binding.method('nextPage');\n readonly previousPage = this.binding.method('previousPage');\n readonly canGoNext = this.binding.method('canGoNext');\n readonly canGoPrevious = this.binding.method('canGoPrevious');\n readonly reveal = this.binding.method('reveal');\n readonly scrollTo = this.binding.method('scrollTo');\n readonly scrollBy = this.binding.method('scrollBy');\n readonly panBy = this.binding.method('panBy');\n readonly resetView = this.binding.method('resetView');\n\n readonly setViewRotation = this.binding.method('setViewRotation');\n readonly rotateViewBy = this.binding.method('rotateViewBy');\n\n readonly getSettings = this.binding.method('getSettings');\n readonly updateSettings = this.binding.method('updateSettings');\n readonly resetSettings = this.binding.method('resetSettings');\n readonly setResponsiveRules = this.binding.method('setResponsiveRules');\n readonly listActiveRules = this.binding.method('listActiveRules');\n readonly matchesRule = this.binding.method('matchesRule');\n\n readonly getPageAt = this.binding.method('getPageAt');\n readonly viewportToPage = this.binding.method('viewportToPage');\n readonly pageToViewport = this.binding.method('pageToViewport');\n readonly pageRectToViewport = this.binding.method('pageRectToViewport');\n readonly getPageFrame = this.binding.method('getPageFrame');\n}\n","/**\n * `withStage(options)`: the Stage plugin, as a feature of `provideEmbedPdf()`. Give it twice\n * for a second view, with its own `id` and `token`:\n *\n * provideEmbedPdf({ engine }, withStage(), withStage({ id: 'stage-thumbs', token: ThumbsToken }))\n *\n * `inject(EpdfStageRef)` is the Stage's API: inside `<epdf-stage>` that Stage, anywhere else the\n * main view of the document in scope.\n */\nimport type { EmbedPdfFeature } from '@embedpdf/angular/runtime';\nimport { stagePlugin, type StagePluginOptions } from '@embedpdf/plugin-stage';\nimport { EpdfStageRef } from './stage-ref';\n\nexport function withStage(options?: StagePluginOptions): EmbedPdfFeature {\n return { plugins: [stagePlugin(options)], services: [EpdfStageRef] };\n}\n","/**\n * The templates a Stage draws each page with. React's page function becomes a marker directive\n * on an `<ng-template>`, typed so `let-page` is the page context:\n *\n * <epdf-stage>\n * <ng-template epdfPage> on the page: turns with it (layers)\n * <ng-template epdfPageChrome> around the page: never turns (labels, buttons)\n *\n * `let-page` is the same context a component inside the template gets from `injectPage()`.\n */\nimport { Directive, inject, TemplateRef } from '@angular/core';\nimport type { EpdfPageContext } from '@embedpdf/angular/runtime';\n\nexport interface EpdfPageTemplateContext {\n $implicit: EpdfPageContext;\n}\n\n/**\n * What each visible page draws: the render layer, text selection, annotations, your markers.\n * It sits in the page's content box and turns with the page, so positions in it are page\n * coordinates.\n */\n@Directive({ selector: 'ng-template[epdfPage]' })\nexport class EpdfPageTemplate {\n readonly template = inject<TemplateRef<EpdfPageTemplateContext>>(TemplateRef);\n\n static ngTemplateContextGuard(\n _directive: EpdfPageTemplate,\n context: unknown,\n ): context is EpdfPageTemplateContext {\n return true;\n }\n}\n\n/**\n * What goes around each visible page: a page number, a border, a row of buttons. It fills the\n * page's box with the bands `pageFrame` reserves, and never turns, so a label in the bottom\n * band is `bottom: 0` with `[style.height.px]=\"page.frame().bottom\"`.\n */\n@Directive({ selector: 'ng-template[epdfPageChrome]' })\nexport class EpdfPageChrome {\n readonly template = inject<TemplateRef<EpdfPageTemplateContext>>(TemplateRef);\n\n static ngTemplateContextGuard(\n _directive: EpdfPageChrome,\n context: unknown,\n ): context is EpdfPageTemplateContext {\n return true;\n }\n}\n","/**\n * One page on a Stage: its box, its shadow, its turned content, and the page and chrome\n * templates drawn into them. The Stage tracks surfaces by the page's object number, so a\n * surface (and every layer in it) lives while its page is on screen, through camera moves and\n * page reorders.\n *\n * The page context and the injector that provides it are made once per surface; camera frames\n * arrive as new `visiblePage` input values and change only the signals inside the context. A\n * new context or injector would make the template outlet recreate every layer on every frame.\n *\n * The geometry is every framework's (`pageSurfaceLayout` from `@embedpdf/web`): the outer box\n * is the page's footprint plus the reserved chrome bands; the shadow is axis-aligned and stays\n * put when the page turns; only the content box turns, and at rotation 0 it carries no\n * transform, so it snaps to pixels like the shadow behind it. Every number comes from the page\n * transform.\n */\nimport { NgTemplateOutlet } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n Injector,\n input,\n viewChild,\n type TemplateRef,\n} from '@angular/core';\nimport { toPageRef } from '@embedpdf/core';\nimport type { PageRef, ViewerPageSettings } from '@embedpdf/core';\nimport type { PageFrame } from '@embedpdf/core-geometry';\nimport type { VisiblePage } from '@embedpdf/plugin-stage';\nimport type { StageHostCapability } from '@embedpdf/plugin-stage/contract/host';\nimport { pageSurfaceLayout, paint, stagePageDemand } from '@embedpdf/web';\nimport { createPageContext, EPDF_PAGE, type EpdfPageContext } from '@embedpdf/angular/runtime';\nimport type { EpdfPageTemplateContext } from './templates';\n\n@Component({\n selector: 'epdf-page-surface',\n imports: [NgTemplateOutlet],\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n style: 'position: absolute; display: block;',\n '[style.left.px]': 'layout().outer.left',\n '[style.top.px]': 'layout().outer.top',\n '[style.width.px]': 'layout().outer.width',\n '[style.height.px]': 'layout().outer.height',\n },\n template: `\n <!-- The shadow only: axis-aligned at the content box, with no fill that could show behind\n the picture, and it stays put when the page turns. -->\n <div\n style=\"position: absolute\"\n [style.left.px]=\"layout().shadow.left\"\n [style.top.px]=\"layout().shadow.top\"\n [style.width.px]=\"layout().shadow.width\"\n [style.height.px]=\"layout().shadow.height\"\n [style.box-shadow]=\"shadow()\"\n ></div>\n <!-- The page: its background and content as one box, the only thing that turns. The layers\n draw their own selection, so the browser's is off for the whole page. -->\n <div\n #content\n style=\"position: absolute; user-select: none; -webkit-user-select: none\"\n [style.left.px]=\"layout().content.left\"\n [style.top.px]=\"layout().content.top\"\n [style.width.px]=\"layout().content.width\"\n [style.height.px]=\"layout().content.height\"\n [style.background]=\"background()\"\n [style.transform]=\"layout().turn\"\n >\n <ng-container\n [ngTemplateOutlet]=\"pageTemplate()\"\n [ngTemplateOutletContext]=\"templateContext\"\n [ngTemplateOutletInjector]=\"pageInjector\"\n />\n </div>\n <!-- Around the page: fills the outer box, never turns. -->\n @if (chromeTemplate(); as chrome) {\n <ng-container\n [ngTemplateOutlet]=\"chrome\"\n [ngTemplateOutletContext]=\"templateContext\"\n [ngTemplateOutletInjector]=\"pageInjector\"\n />\n }\n `,\n})\nexport class EpdfPageSurface {\n readonly visiblePage = input.required<VisiblePage>();\n /** The bands reserved around the page, in screen pixels. */\n readonly frame = input.required<PageFrame>();\n readonly documentId = input.required<string>();\n /** The Stage's view; the tile demand reads what's on screen from it when asked. */\n readonly stage = input.required<StageHostCapability>();\n /** The viewer's `page` settings: the background and the shadow. */\n readonly look = input.required<ViewerPageSettings>();\n readonly pageTemplate = input.required<TemplateRef<EpdfPageTemplateContext>>();\n readonly chromeTemplate = input<TemplateRef<EpdfPageTemplateContext> | null>(null);\n\n protected readonly transform = computed(() => this.visiblePage().transform);\n\n // The outer box, the shadow and the turned content box, from `@embedpdf/web`'s layout, shared\n // by every framework; screenX/screenY are the footprint's device-snapped corner.\n protected readonly layout = computed(() => {\n const visiblePage = this.visiblePage();\n return pageSurfaceLayout(this.transform(), this.frame(), {\n x: visiblePage.screenX,\n y: visiblePage.screenY,\n });\n });\n // The settings, unless CSS sets `--epdf-page-shadow` or `--epdf-page-background`.\n protected readonly shadow = computed(() => paint('page-shadow', this.look().shadow));\n protected readonly background = computed(() => paint('page-background', this.look().background));\n\n private readonly content = viewChild.required<ElementRef<HTMLDivElement>>('content');\n private pageRef: PageRef | null = null;\n\n /** The page context, one for the surface's lifetime. */\n readonly page: EpdfPageContext = createPageContext({\n documentId: () => this.documentId(),\n // The Stage builds a new ref each frame; the surface keeps the first, so layers can key\n // their work on it.\n ref: () => (this.pageRef ??= toPageRef(this.visiblePage().ref.objectNumber)),\n view: () => this.stage().getLensId(),\n pageIndex: computed(() => this.visiblePage().pageIndex),\n frame: this.frame,\n transform: this.transform,\n getRect: () => this.content().nativeElement.getBoundingClientRect(),\n // Read live from the Stage: off screen, the page wants nothing (an empty rect).\n getViewDemand: () =>\n stagePageDemand(\n this.stage(),\n this.visiblePage().ref.objectNumber,\n this.transform().deviceWidth,\n ),\n });\n\n /** One injector for the surface's lifetime, under this surface, so layers reach the viewer too. */\n protected readonly pageInjector = Injector.create({\n providers: [{ provide: EPDF_PAGE, useValue: this.page }],\n parent: inject(Injector),\n });\n\n protected readonly templateContext: EpdfPageTemplateContext = { $implicit: this.page };\n}\n","/**\n * `<epdf-stage>`: shows the document's pages. It lays them out, keeps only the visible ones\n * mounted, handles scrolling, zoom and page navigation by mouse, keyboard and touch, and draws\n * each page with your `<ng-template epdfPage>`.\n *\n * The component is the Stage's API, `EpdfStageRef`'s (`stage-ref.ts`): every method of the\n * Stage page's Methods table, every value of its State table as a signal, its settings as\n * `settings()`, and its events as streams (`pageChanged$`). From around it, a template reference\n * (`<epdf-stage #stage=\"epdfStage\">`, then `stage.zoomIn()` and `stage.zoomLevel()`) or\n * `viewChild(EpdfStage)` reaches it; from inside it, `inject(EpdfStageRef)`. `[(page)]` and\n * `[(zoom)]` bind the current page index and the zoom level.\n *\n * `[document]` opens a document for this Stage and follows the value: a new source opens, the\n * old document closes. `[token]` makes it a second view, registered with `withStage({ token })`.\n *\n * Without a document it shows no pages and its signals read their empty values; a method\n * called then refuses with `not-ready`.\n */\nimport { isPlatformBrowser } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n contentChild,\n effect,\n ElementRef,\n forwardRef,\n inject,\n Injectable,\n input,\n output,\n PLATFORM_ID,\n signal,\n untracked,\n type Signal,\n type TemplateRef,\n} from '@angular/core';\nimport { shallowEqual } from '@embedpdf/core';\nimport type { OpenSource } from '@embedpdf/core';\nimport type { PageFrame } from '@embedpdf/core-geometry';\nimport { createScrollHandler, StageToken } from '@embedpdf/plugin-stage';\nimport type { VisiblePage } from '@embedpdf/plugin-stage';\nimport type { StageHostCapability } from '@embedpdf/plugin-stage/contract/host';\nimport { InteractionToken } from '@embedpdf/plugin-interaction/contract/host';\nimport { createStageSurface, stageViewProjector } from '@embedpdf/web';\nimport {\n CapabilityBinding,\n EPDF_DOCUMENT_SCOPE,\n EPDF_SCOPED_SERVICES,\n type EpdfDocumentScopeRef,\n} from '@embedpdf/angular/runtime';\nimport { EPDF_PROJECTOR, type EpdfProjectorBinding } from '@embedpdf/angular/anchored';\nimport { EpdfPageSurface } from './page-surface';\nimport { EpdfStageRef, type StageTokenProp } from './stage-ref';\nimport { EpdfPageChrome, EpdfPageTemplate, type EpdfPageTemplateContext } from './templates';\n\nconst NO_PAGES: readonly VisiblePage[] = Object.freeze([]);\nconst NO_FRAME: PageFrame = Object.freeze({ top: 0, right: 0, bottom: 0, left: 0 });\nconst frameEqual = (left: PageFrame, right: PageFrame) =>\n left.top === right.top &&\n left.right === right.right &&\n left.bottom === right.bottom &&\n left.left === right.left;\n\n/**\n * The document a Stage shows: the one its `[document]` opened, else its scope's. The Stage and\n * what's inside it read it, so it's made before the Stage itself.\n */\n@Injectable()\nclass StageDocument implements EpdfDocumentScopeRef {\n private readonly parent = inject(EPDF_DOCUMENT_SCOPE, { optional: true, skipSelf: true });\n /** The document `[document]` opened, once it has its id. */\n readonly opened = signal<string | null>(null);\n readonly id = computed(() => this.opened() ?? this.parent?.id() ?? null);\n}\n\n@Component({\n selector: 'epdf-stage',\n exportAs: 'epdfStage',\n imports: [EpdfPageSurface],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [\n // The services inside act on this Stage's document. After them, so it wins over the\n // `EpdfStageRef` among them: what's inside injects this Stage as `EpdfStageRef`, talks to\n // its document, and projects anchored UI through its camera.\n EPDF_SCOPED_SERVICES,\n StageDocument,\n { provide: EPDF_DOCUMENT_SCOPE, useExisting: StageDocument },\n { provide: EpdfStageRef, useExisting: forwardRef(() => EpdfStage) },\n { provide: EPDF_PROJECTOR, useFactory: () => inject(EpdfStage).projection },\n ],\n host: {\n style: 'position: relative; display: block; overflow: hidden; touch-action: none;',\n '[style.cursor]': 'cursor()',\n },\n template: `\n @if (pageTemplate(); as template) {\n @for (visiblePage of pages(); track visiblePage.ref.objectNumber) {\n <epdf-page-surface\n [visiblePage]=\"visiblePage\"\n [frame]=\"frame()\"\n [documentId]=\"documentId() ?? ''\"\n [stage]=\"hostCapability()!\"\n [look]=\"look()\"\n [pageTemplate]=\"template\"\n [chromeTemplate]=\"chromeTemplate()\"\n />\n }\n }\n <!-- What you put inside <epdf-stage> sits over the pages, in the Stage's own box. -->\n <ng-content />\n `,\n})\nexport class EpdfStage extends EpdfStageRef {\n /** The view to drive: a token registered with `withStage({ token })`; the main view without one. */\n readonly token = input<StageTokenProp | undefined>(undefined);\n /** A document to open for this Stage. A new value opens it and closes the one before. */\n readonly document = input<OpenSource | null | undefined>(undefined);\n /** The current page's index, from 0: `[(page)]`. Setting it goes to that page. */\n readonly page = input<number | undefined>(undefined);\n /** Another page became the current one: its index. The output half of `[(page)]`. */\n readonly pageChange = output<number>();\n /** The zoom level, `1` for 100%: `[(zoom)]`. Setting it zooms there. */\n readonly zoom = input<number | undefined>(undefined);\n /** The zoom level changed. The output half of `[(zoom)]`. */\n readonly zoomChange = output<number>();\n\n private readonly ownDocument = inject(StageDocument);\n /** The document this Stage shows, for what's inside it: its own `[document]`, else its scope's. */\n readonly documentScope: EpdfDocumentScopeRef = this.ownDocument;\n /** The view's capability, or null without a document. */\n protected readonly hostCapability = this.binding.capability;\n\n protected override view(): StageTokenProp {\n return this.token() ?? StageToken;\n }\n\n protected override usedAs(): string {\n return '<epdf-stage>';\n }\n\n // ── what the template draws ──────────────────────────────────────────────────\n\n /** The pages on screen, each with its place and transform: a new list every camera frame. */\n protected readonly pages = this.binding.select(\n (stage) => stage.listVisiblePages(),\n NO_PAGES,\n Object.is,\n );\n protected readonly frame = this.binding.select(\n (stage) => stage.getSettings().pageFrame,\n NO_FRAME,\n frameEqual,\n );\n protected readonly documentId = this.host.read(\n (kernel) => this.documentScope.id() ?? kernel.documents.getActiveId(),\n () => null,\n );\n /** The viewer's `page` settings: each page's background and shadow. */\n protected readonly look = computed(() => this.host.viewerSettings().page, {\n equal: shallowEqual,\n });\n private readonly pageTemplateDirective = contentChild(EpdfPageTemplate);\n private readonly chromeTemplateDirective = contentChild(EpdfPageChrome);\n // Typed, so the built declarations name `EpdfPageTemplateContext` from this file instead of\n // importing this entry point by its own package name.\n protected readonly pageTemplate: Signal<TemplateRef<EpdfPageTemplateContext> | null> = computed(\n () => this.pageTemplateDirective()?.template ?? null,\n );\n protected readonly chromeTemplate: Signal<TemplateRef<EpdfPageTemplateContext> | null> = computed(\n () => this.chromeTemplateDirective()?.template ?? null,\n );\n\n // ── input ────────────────────────────────────────────────────────────────────\n // How this view takes pointer input is its own settings: a change binds the surface again.\n\n private readonly interaction = this.binding.select(\n (stage) => stage.getSettings().interaction,\n true,\n );\n private readonly panFallback = this.binding.select(\n (stage) => stage.getSettings().panFallback,\n true,\n );\n private readonly zoomGestures = this.binding.select(\n (stage) => stage.getSettings().zoomGestures,\n true,\n );\n /** The interaction hub of this Stage's document: the active tool takes the pointer. */\n private readonly hub = new CapabilityBinding(\n this.host,\n () => InteractionToken,\n this.documentScope.id,\n ).capability;\n private readonly usesHub = computed(() => this.interaction() && this.hub() !== null);\n private readonly hubCursor = this.host.read(\n () => this.hub()?.getCursor() ?? 'default',\n () => 'default',\n );\n /** The hub's cursor (text, grab, a tool's own), while the hub takes this Stage's pointer. */\n protected readonly cursor = computed(() => (this.usesHub() ? this.hubCursor() : null));\n\n // ── anchored UI ──────────────────────────────────────────────────────────────\n\n /**\n * How anchored UI (`<epdf-anchored>`) inside the Stage follows the camera: a projection\n * through the view, and the visible pages as its revision, so the pages and the UI on them\n * update in the same change detection pass and never a frame apart.\n */\n readonly projection: EpdfProjectorBinding = {\n // `@embedpdf/web`'s Stage projection, shared by every framework: page boxes to the Stage's\n // own coordinates.\n projector: computed(() => {\n const stage = this.hostCapability();\n return stage ? stageViewProjector(() => stage) : null;\n }),\n revision: this.pages,\n shownPages: computed(\n () => {\n const shown = this.pages().map((visible) => visible.ref.objectNumber);\n return new Set(shown);\n },\n // The same set until a page comes on screen or leaves it.\n {\n equal: (left, right) =>\n left.size === right.size && [...left].every((objectNumber) => right.has(objectNumber)),\n },\n ),\n };\n\n constructor() {\n super();\n this.followDocumentInput();\n this.followPageAndZoom();\n if (isPlatformBrowser(inject(PLATFORM_ID))) this.bindSurface();\n }\n\n /** `[document]`: open it for this Stage once the viewer runs; close it when the value changes. */\n private followDocumentInput(): void {\n effect((onCleanup) => {\n const source = this.document();\n const kernel = this.host.kernel();\n if (!source || !kernel || this.host.status() !== 'ready') return;\n untracked(() => {\n const cancel = new AbortController();\n const opening = kernel.documents.open(source, { signal: cancel.signal });\n // The new tab is the active one at once; its id is final when the open resolves.\n let id = kernel.documents.getActiveId();\n opening.then(\n ({ document }) => {\n id = document.id;\n if (!cancel.signal.aborted) this.ownDocument.opened.set(document.id);\n },\n () => {\n // Its tab shows why it couldn't be opened.\n },\n );\n onCleanup(() => {\n cancel.abort();\n this.ownDocument.opened.set(null);\n if (id && kernel.documents.has(id)) void kernel.documents.close(id).catch(() => {});\n });\n });\n });\n }\n\n /**\n * `[(page)]` and `[(zoom)]`. A value from the parent moves the view there; a move of the view\n * (scroll, pinch, a button) goes out as `pageChange` and `zoomChange`. When the Stage changes\n * documents (another tab), the new document keeps its own place and reports it.\n */\n private followPageAndZoom(): void {\n let previous: StageHostCapability | null = null;\n effect(() => {\n const stage = this.hostCapability();\n const page = this.page();\n const zoom = this.zoom();\n untracked(() => {\n const switched = previous !== null && stage !== null && stage !== previous;\n previous = stage;\n if (!stage) return;\n if (switched) {\n if (page !== undefined && page !== stage.getCurrentPageIndex()) {\n this.pageChange.emit(stage.getCurrentPageIndex());\n }\n if (zoom !== undefined && zoom !== stage.getZoomLevel()) {\n this.zoomChange.emit(stage.getZoomLevel());\n }\n return;\n }\n if (page !== undefined && page !== stage.getCurrentPageIndex()) stage.goToPage(page);\n if (zoom !== undefined && zoom !== stage.getZoomLevel()) stage.zoomTo(zoom);\n });\n });\n effect((onCleanup) => {\n const stage = this.hostCapability();\n if (!stage) return;\n const offPage = stage.onPageChanged(({ pageIndex }) => this.pageChange.emit(pageIndex));\n const offZoom = stage.onZoomChanged(({ level }) => this.zoomChange.emit(level));\n onCleanup(() => {\n offPage();\n offZoom();\n });\n });\n }\n\n /**\n * The browser side: the viewport size and pixel ratio, wheel and touch gestures, and the\n * pointer going to the interaction hub. All of it is `@embedpdf/web`'s, shared by every\n * framework, so the Stage feels the same everywhere; this binds it again when the view, the\n * hub or the input settings change.\n */\n private bindSurface(): void {\n const element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n effect((onCleanup) => {\n const stage = this.hostCapability();\n const hub = this.hub();\n const usesHub = this.usesHub();\n const panFallback = this.panFallback();\n const zoomGestures = this.zoomGestures();\n if (!stage) return;\n const detachSurface = createStageSurface(element, stage, {\n hub: usesHub ? hub : null,\n source: stage.getLensId(),\n zoomGestures,\n });\n // The pointer and this view's drag-to-scroll go to the hub together, for this view only,\n // so two Stages on one document never scroll each other.\n const offScroll =\n usesHub && hub\n ? hub.registerHandler(createScrollHandler(stage, hub, { panFallback }), {\n source: stage.getLensId(),\n })\n : null;\n onCleanup(() => {\n offScroll?.();\n detachSurface();\n });\n });\n }\n}\n","/**\n * `<epdf-scrollbar>`: a scrollbar for the Stage it's in, that you style yourself. Put it inside\n * `<epdf-stage>`; it reads the Stage's `scrollMetrics()` (the numbers a scrolling element has)\n * and scrolls through its calls.\n *\n * It behaves like a native bar: drag the thumb (the point you grabbed stays under the pointer),\n * press the track to page toward the pointer (repeating while held, stopping at the pointer),\n * a minimum thumb length on long documents, and macOS-style hiding when nothing moves. On an\n * unbounded Stage the metrics already cover the content and the view together, so the bar\n * shrinks as you pan away; the mapping is frozen while the thumb is dragged, so the thumb never\n * chases itself.\n *\n * The element is the track; style it with your own class and these attributes:\n * [data-embedpdf-scrollbar][data-axis=\"y\"][data-state=\"visible|hidden\"]\n * [data-embedpdf-scrollbar][data-dragging]\n * [data-embedpdf-scrollbar-thumb] (or `thumbClass`)\n * Until you style the thumb, its color is `--epdf-scrollbar-thumb`.\n */\nimport {\n ChangeDetectionStrategy,\n Component,\n computed,\n DestroyRef,\n effect,\n ElementRef,\n inject,\n input,\n signal,\n} from '@angular/core';\nimport {\n createScrollbarPresses,\n paintDefault,\n scrollbarLayout,\n type ScrollbarTrack,\n} from '@embedpdf/web';\nimport { outsideStageError } from '@embedpdf/angular/runtime';\nimport { EpdfStage } from './stage';\n\nexport type ScrollbarAxis = 'x' | 'y';\n\n@Component({\n selector: 'epdf-scrollbar',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n role: 'scrollbar',\n 'data-embedpdf-scrollbar': '',\n style: 'position: absolute; touch-action: none; user-select: none; transition: opacity 200ms',\n '[attr.aria-orientation]': \"vertical() ? 'vertical' : 'horizontal'\",\n '[attr.aria-valuemin]': '0',\n '[attr.aria-valuemax]': 'round(layout().maxOffset)',\n '[attr.aria-valuenow]': 'round(layout().offset)',\n '[attr.data-axis]': 'axis()',\n '[attr.data-state]': \"shown() ? 'visible' : 'hidden'\",\n '[attr.data-dragging]': \"dragging() ? '' : null\",\n // Pinned to the right (y) or bottom (x) edge of the Stage; nothing to scroll, no bar.\n '[style.display]': \"scrollable() ? 'block' : 'none'\",\n '[style.top.px]': 'vertical() ? 0 : null',\n '[style.left.px]': 'vertical() ? null : 0',\n '[style.right.px]': '0',\n '[style.bottom.px]': '0',\n '[style.width.px]': 'vertical() ? 12 : null',\n '[style.height.px]': 'vertical() ? null : 12',\n '[style.opacity]': 'shown() ? 1 : 0',\n // A hidden bar must not take the clicks meant for the pages under it.\n '[style.pointer-events]': \"shown() ? 'auto' : 'none'\",\n '(pointerdown)': 'onTrackDown($event)',\n '(pointermove)': 'onMove($event)',\n '(pointerup)': 'endDrag()',\n '(pointercancel)': 'endDrag()',\n '(pointerenter)': 'hovered.set(true)',\n '(pointerleave)': 'hovered.set(false)',\n },\n template: `\n <div\n data-embedpdf-scrollbar-thumb=\"\"\n [class]=\"thumbClass()\"\n style=\"position: absolute; border-radius: 6px\"\n [style.background]=\"thumbColor\"\n [style.left.px]=\"vertical() ? 2 : layout().thumbPosition\"\n [style.right.px]=\"vertical() ? 2 : null\"\n [style.top.px]=\"vertical() ? layout().thumbPosition : 2\"\n [style.bottom.px]=\"vertical() ? null : 2\"\n [style.width.px]=\"vertical() ? null : layout().thumbLength\"\n [style.height.px]=\"vertical() ? layout().thumbLength : null\"\n (pointerdown)=\"onThumbDown($event)\"\n ></div>\n `,\n})\nexport class EpdfScrollbar {\n /** `'y'` for a vertical bar, `'x'` for a horizontal one. */\n readonly axis = input.required<ScrollbarAxis>();\n /**\n * Hide this many milliseconds after the view stops moving (hover and dragging keep it shown;\n * a hidden bar ignores the pointer, like macOS), or `false` to always show it.\n */\n readonly autoHide = input<number | false, number | false | string>(1200, {\n transform: (value) => (value === false || value === 'false' ? false : Number(value)),\n });\n /** The shortest thumb, in pixels, so it never vanishes on a long document. */\n readonly minThumbSize = input(24);\n /**\n * Pressing the track: `'page'` steps 90% of a view toward the pointer and repeats while held;\n * `'jump'` puts the thumb under the pointer and goes on as a drag.\n */\n readonly trackPress = input<'page' | 'jump'>('page');\n /** The thumb's class. */\n readonly thumbClass = input<string | null>(null);\n\n private readonly stage: EpdfStage;\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly trackPx = signal(0);\n protected readonly dragging = signal(false);\n protected readonly hovered = signal(false);\n /** The view moved a moment ago. */\n private readonly active = signal(true);\n\n protected readonly vertical = computed(() => this.axis() === 'y');\n protected readonly scrollable = computed(() => {\n const metrics = this.stage.scrollMetrics();\n return this.vertical() ? metrics.scrollableY : metrics.scrollableX;\n });\n /** The thumb along the track: one formula for drawing, dragging and paging, in every framework. */\n protected readonly layout = computed(() =>\n scrollbarLayout(\n this.stage.scrollMetrics(),\n this.vertical(),\n this.trackPx(),\n this.minThumbSize(),\n ),\n );\n protected readonly shown = computed(\n () =>\n this.autoHide() === false ||\n this.autoHide() === 0 ||\n this.active() ||\n this.hovered() ||\n this.dragging(),\n );\n protected readonly thumbColor = paintDefault('scrollbar-thumb');\n protected readonly round = Math.round;\n\n /** Thumb drags, track paging and jumps: `@embedpdf/web`'s, shared by every framework. */\n private readonly presses = createScrollbarPresses((dragging) => this.dragging.set(dragging));\n\n constructor() {\n const stage = inject(EpdfStage, { optional: true });\n if (!stage) throw outsideStageError('<epdf-scrollbar>');\n this.stage = stage;\n\n // Any move of the view shows the bar again and starts the countdown to hiding it.\n effect((onCleanup) => {\n this.stage.scrollMetrics();\n const hideAfter = this.autoHide();\n if (hideAfter === false || hideAfter === 0) return;\n this.active.set(true);\n const timer = setTimeout(() => this.active.set(false), hideAfter);\n onCleanup(() => clearTimeout(timer));\n });\n\n // The track's length, which the thumb maps onto; again whenever the bar appears or resizes.\n effect((onCleanup) => {\n const vertical = this.vertical();\n if (!this.scrollable() || typeof ResizeObserver === 'undefined') return;\n const measure = () =>\n this.trackPx.set(vertical ? this.element.clientHeight : this.element.clientWidth);\n const observer = new ResizeObserver(measure);\n observer.observe(this.element);\n measure();\n onCleanup(() => observer.disconnect());\n });\n\n inject(DestroyRef).onDestroy(() => this.endDrag());\n }\n\n /** The bar as it is now, for `@embedpdf/web`'s press handling. */\n private track(): ScrollbarTrack {\n const vertical = this.vertical();\n return {\n stage: this.stage,\n vertical,\n element: this.element,\n layout: this.layout(),\n // Fresh geometry for paging steps, from the metrics as they are now.\n liveLayout: () =>\n scrollbarLayout(this.stage.scrollMetrics(), vertical, this.trackPx(), this.minThumbSize()),\n };\n }\n\n protected onThumbDown(event: PointerEvent): void {\n this.presses.pressThumb(event, this.track());\n }\n\n protected onTrackDown(event: PointerEvent): void {\n this.presses.pressTrack(event, this.track(), this.trackPress());\n }\n\n /** Pointer capture sends the moves here, for thumb drags, jump drags and paging alike. */\n protected onMove(event: PointerEvent): void {\n this.presses.move(event, this.track());\n }\n\n protected endDrag(): void {\n this.presses.release();\n }\n}\n","/**\n * @embedpdf/angular/stage: `<epdf-stage>` and what goes with it.\n *\n * withStage(options) the plugin, for provideEmbedPdf()\n * <epdf-stage #stage=\"epdfStage\"> the pages, and the Stage's API\n * inject(EpdfStageRef) the Stage's API, from inside a Stage or anywhere\n * <ng-template epdfPage>, epdfPageChrome what each page draws, and around it\n * <epdf-scrollbar> a scrollbar you style yourself\n */\n\n// The plugin's types and helpers, so app code has one import for the feature.\nexport * from '@embedpdf/plugin-stage';\nexport * from './feature';\nexport * from './templates';\nexport * from './stage-ref';\nexport * from './stage';\nexport * from './scrollbar';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AAgBH,MAAM,SAAS,GAAkB,MAAM,CAAC,MAAM,CAAC;AAC7C,IAAA,UAAU,EAAE,CAAC;AACb,IAAA,SAAS,EAAE,CAAC;AACZ,IAAA,WAAW,EAAE,CAAC;AACd,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,WAAW,EAAE,CAAC;AACd,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,WAAW,EAAE,KAAK;AAClB,IAAA,WAAW,EAAE,KAAK;AACnB,CAAA,CAAC;AAEF;AACA,MAAM,MAAM,GAAG,CAAC,KAAqB,KAAK,KAAwD;MAGrF,YAAY,CAAA;;IAEJ,IAAI,GAAmB,gBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC;;IAEtD,OAAO,GAAG,IAAI,iBAAiB,CAChD,IAAI,CAAC,IAAI,EACT,MAAM,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EACzB,mBAAmB,EAAE,CACtB;;IAGS,IAAI,GAAA;AACZ,QAAA,OAAO,UAAU;IACnB;;IAGU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B;AACrD,wBAAA,eAAe,EAAE,qBAAqB;AACtC,wBAAA,eAAe,EAAE,gBAAgB;AACjC,wBAAA,aAAa,EAAE,WAAW;AAC1B,wBAAA,iBAAiB,EAAE,WAAW;AAC9B,wBAAA,gBAAgB,EAAE,mBAAmB;AACrC,wBAAA,gBAAgB,EAAE,oBAAoB;AACvC,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;AAcT,EAAA,CAAA;AACF,iBAAA;;;ACvFD;;;;;;;;AAQG;AAEH;;ACVA;;AAEG;;;;"}
@@ -0,0 +1,169 @@
1
+ import { stampState, StampToken, stampPlugin, persistStampLibraries as persistStampLibraries$1 } from '@embedpdf/plugin-stamp';
2
+ export * from '@embedpdf/plugin-stamp';
3
+ import { objectUrlOf } from '@embedpdf/web';
4
+ export { indexedDbByteStore } from '@embedpdf/web';
5
+ import * as i0 from '@angular/core';
6
+ import { signal, effect, Injectable } from '@angular/core';
7
+ import { pluginService } from '@embedpdf/angular/runtime';
8
+
9
+ /**
10
+ * The stamp plugin's service and feature, and the helper that keeps libraries between visits:
11
+ *
12
+ * withStamp(options) the plugin, for provideEmbedPdf()
13
+ * inject(EpdfStamp) the libraries (`libraries()`), their stamps
14
+ * (`assetsOf(filter)`), a stamp's picture
15
+ * (`previewUrlOf(id)`), arming and placing, the armed
16
+ * stamp (`armedAsset()`), the events as streams
17
+ * persistStampLibraries(stamp, store) every change of a library written to `store`, from
18
+ * the service's `libraryChanged$` stream
19
+ *
20
+ * The plugin's `restoreStampLibraries(stamp, store)` takes the service as it is.
21
+ *
22
+ * Placing needs no component here: an armed stamp rides the annotation plugin, whose
23
+ * `<epdf-annotation-layer>` draws it under the pointer.
24
+ */
25
+ const NO_LIBRARIES = Object.freeze([]);
26
+ const NO_ASSETS = Object.freeze([]);
27
+ /**
28
+ * Stamps: the libraries and their stamps, shared by every document, and arming and placing
29
+ * them on the document in scope (`[epdfDocumentScope]`), else the active one. The Stamps page's
30
+ * methods, `armedAsset()` as a signal, the events as streams (`libraryChanged$`, `armChanged$`,
31
+ * …), and the settings. The libraries work without a document; a placing call refuses with
32
+ * `not-ready` until one is open.
33
+ */
34
+ class EpdfStamp extends pluginService({
35
+ name: 'EpdfStamp',
36
+ feature: 'withStamp()',
37
+ token: StampToken,
38
+ state: stampState,
39
+ methods: [
40
+ 'listLibraries',
41
+ 'getLibrary',
42
+ 'listAssets',
43
+ 'getAsset',
44
+ 'getAssetPreview',
45
+ 'renderAssetPreview',
46
+ 'readAssetBytes',
47
+ 'createLibrary',
48
+ 'updateLibrary',
49
+ 'deleteLibrary',
50
+ 'importLibrary',
51
+ 'exportLibrary',
52
+ 'createAsset',
53
+ 'createAssetFromAnnotations',
54
+ 'updateAsset',
55
+ 'deleteAsset',
56
+ 'moveAsset',
57
+ 'duplicateAsset',
58
+ 'armAsset',
59
+ 'disarm',
60
+ 'getArmedAsset',
61
+ 'placeAsset',
62
+ 'placeAssetOnPages',
63
+ 'canPlace',
64
+ 'canCreateFromAnnotations',
65
+ 'canImport',
66
+ ],
67
+ events: [
68
+ 'onLibraryChanged',
69
+ 'onLibraryCreated',
70
+ 'onLibraryUpdated',
71
+ 'onLibraryDeleted',
72
+ 'onAssetCreated',
73
+ 'onAssetUpdated',
74
+ 'onAssetDeleted',
75
+ 'onArmChanged',
76
+ ],
77
+ }) {
78
+ /**
79
+ * Every library, in the order they were added. It changes when a library is added, renamed
80
+ * or removed; filter it for the kinds a picker shows (`library.kind`).
81
+ */
82
+ libraries = this.binding.select((stamp) => stamp.listLibraries(), NO_LIBRARIES);
83
+ /**
84
+ * The stamps in the order a picker shows them: one library's (`{ libraryId }`), one kind's or
85
+ * category's, or every stamp. Pass a function (`() => ({ libraryId: this.libraryId() })`) and
86
+ * it follows the signals it reads. It changes when a stamp is added, renamed or removed.
87
+ */
88
+ assetsOf(filter) {
89
+ const filterOf = typeof filter === 'function' ? filter : () => filter;
90
+ return this.binding.select((stamp) => stamp.listAssets(filterOf()), NO_ASSETS);
91
+ }
92
+ /**
93
+ * An image URL for a stamp's picture (a picker's thumbnail), or null while it has none. Pass
94
+ * a function (`() => this.asset().id`) and it follows the stamp you show, and a picture that
95
+ * arrives after the stamp does.
96
+ *
97
+ * The URL is a browser resource that holds the picture's bytes, so it is released when the
98
+ * stamp changes and when the caller goes: call it in an injection context (a constructor or a
99
+ * field initializer).
100
+ */
101
+ previewUrlOf(assetId) {
102
+ const idOf = typeof assetId === 'function' ? assetId : () => assetId;
103
+ // The plugin keeps each picture until it changes, so this wakes only for a new one.
104
+ const preview = this.binding.select((stamp) => {
105
+ const id = idOf();
106
+ return id ? stamp.getAssetPreview(id) : null;
107
+ }, null, Object.is);
108
+ const url = signal(null, ...(ngDevMode ? [{ debugName: "url" }] : []));
109
+ effect((onCleanup) => {
110
+ const picture = preview();
111
+ if (!picture) {
112
+ url.set(null);
113
+ return;
114
+ }
115
+ const objectUrl = objectUrlOf(picture);
116
+ url.set(objectUrl.url);
117
+ onCleanup(() => objectUrl.revoke());
118
+ });
119
+ return url.asReadonly();
120
+ }
121
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: EpdfStamp, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
122
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: EpdfStamp, providedIn: 'root' });
123
+ }
124
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: EpdfStamp, decorators: [{
125
+ type: Injectable,
126
+ args: [{ providedIn: 'root' }]
127
+ }] });
128
+ /** Stamps, with their settings: `withStamp({ assetEngine: localEngine() })` on a cloud viewer. */
129
+ function withStamp(options) {
130
+ return { plugins: [stampPlugin(options)], services: [EpdfStamp] };
131
+ }
132
+ /** A stream as the plugin's kind of event: listen, and stop with the call it returns or a signal. */
133
+ function eventHookOf(events) {
134
+ return (listener, options) => {
135
+ const subscription = events.subscribe(listener);
136
+ options?.signal?.addEventListener('abort', () => subscription.unsubscribe(), { once: true });
137
+ return () => subscription.unsubscribe();
138
+ };
139
+ }
140
+ /**
141
+ * Keep every library in `store` from now on: a change writes the library's PDF (a burst of
142
+ * edits saves once), a removed library is deleted. `except` names the libraries never to store,
143
+ * such as the standard set you import on every visit. Returns the stop, for when the caller
144
+ * goes: `inject(DestroyRef).onDestroy(persistStampLibraries(stamp, store))`.
145
+ */
146
+ function persistStampLibraries(stamp, store, options) {
147
+ // The plugin's own helper, which reads only these two members: the changes, through the
148
+ // stream (so it follows the viewer from before it starts), and the bytes.
149
+ return persistStampLibraries$1({ exportLibrary: stamp.exportLibrary, onLibraryChanged: eventHookOf(stamp.libraryChanged$) }, store, options);
150
+ }
151
+
152
+ /**
153
+ * @embedpdf/angular/stamp: libraries of reusable stamps, placed by click or by code.
154
+ *
155
+ * withStamp(options) the plugin, for provideEmbedPdf()
156
+ * inject(EpdfStamp) libraries(), assetsOf(filter), previewUrlOf(id),
157
+ * armAsset(), placeAsset(), armedAsset(), the events
158
+ * persistStampLibraries(stamp, store) keep the libraries in a store from now on
159
+ * restoreStampLibraries(stamp, store) bring back what the store kept (the plugin's own)
160
+ * indexedDbByteStore(name) the browser's store for them
161
+ */
162
+ // The plugin's types and helpers, so app code has one import for the feature.
163
+
164
+ /**
165
+ * Generated bundle index. Do not edit.
166
+ */
167
+
168
+ export { EpdfStamp, persistStampLibraries, withStamp };
169
+ //# sourceMappingURL=embedpdf-angular-stamp.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embedpdf-angular-stamp.mjs","sources":["../../stamp/src/stamp.ts","../../stamp/src/public_api.ts","../../stamp/src/embedpdf-angular-stamp.ts"],"sourcesContent":["/**\n * The stamp plugin's service and feature, and the helper that keeps libraries between visits:\n *\n * withStamp(options) the plugin, for provideEmbedPdf()\n * inject(EpdfStamp) the libraries (`libraries()`), their stamps\n * (`assetsOf(filter)`), a stamp's picture\n * (`previewUrlOf(id)`), arming and placing, the armed\n * stamp (`armedAsset()`), the events as streams\n * persistStampLibraries(stamp, store) every change of a library written to `store`, from\n * the service's `libraryChanged$` stream\n *\n * The plugin's `restoreStampLibraries(stamp, store)` takes the service as it is.\n *\n * Placing needs no component here: an armed stamp rides the annotation plugin, whose\n * `<epdf-annotation-layer>` draws it under the pointer.\n */\nimport { effect, Injectable, signal, type Signal } from '@angular/core';\nimport type { EventHook } from '@embedpdf/core';\nimport { pluginService, type EmbedPdfFeature } from '@embedpdf/angular/runtime';\nimport {\n persistStampLibraries as persistLibraries,\n stampPlugin,\n stampState,\n StampToken,\n type StampAsset,\n type StampAssetFilter,\n type StampConfig,\n type StampLibrary,\n type StampLibraryStore,\n} from '@embedpdf/plugin-stamp';\nimport { objectUrlOf } from '@embedpdf/web';\nimport type { Observable } from 'rxjs';\n\nconst NO_LIBRARIES: readonly StampLibrary[] = Object.freeze([]);\nconst NO_ASSETS: readonly StampAsset[] = Object.freeze([]);\n\n/**\n * Stamps: the libraries and their stamps, shared by every document, and arming and placing\n * them on the document in scope (`[epdfDocumentScope]`), else the active one. The Stamps page's\n * methods, `armedAsset()` as a signal, the events as streams (`libraryChanged$`, `armChanged$`,\n * …), and the settings. The libraries work without a document; a placing call refuses with\n * `not-ready` until one is open.\n */\n@Injectable({ providedIn: 'root' })\nexport class EpdfStamp extends pluginService({\n name: 'EpdfStamp',\n feature: 'withStamp()',\n token: StampToken,\n state: stampState,\n methods: [\n 'listLibraries',\n 'getLibrary',\n 'listAssets',\n 'getAsset',\n 'getAssetPreview',\n 'renderAssetPreview',\n 'readAssetBytes',\n 'createLibrary',\n 'updateLibrary',\n 'deleteLibrary',\n 'importLibrary',\n 'exportLibrary',\n 'createAsset',\n 'createAssetFromAnnotations',\n 'updateAsset',\n 'deleteAsset',\n 'moveAsset',\n 'duplicateAsset',\n 'armAsset',\n 'disarm',\n 'getArmedAsset',\n 'placeAsset',\n 'placeAssetOnPages',\n 'canPlace',\n 'canCreateFromAnnotations',\n 'canImport',\n ],\n events: [\n 'onLibraryChanged',\n 'onLibraryCreated',\n 'onLibraryUpdated',\n 'onLibraryDeleted',\n 'onAssetCreated',\n 'onAssetUpdated',\n 'onAssetDeleted',\n 'onArmChanged',\n ],\n}) {\n /**\n * Every library, in the order they were added. It changes when a library is added, renamed\n * or removed; filter it for the kinds a picker shows (`library.kind`).\n */\n readonly libraries: Signal<readonly StampLibrary[]> = this.binding.select(\n (stamp) => stamp.listLibraries(),\n NO_LIBRARIES,\n );\n\n /**\n * The stamps in the order a picker shows them: one library's (`{ libraryId }`), one kind's or\n * category's, or every stamp. Pass a function (`() => ({ libraryId: this.libraryId() })`) and\n * it follows the signals it reads. It changes when a stamp is added, renamed or removed.\n */\n assetsOf(\n filter?: StampAssetFilter | (() => StampAssetFilter | undefined),\n ): Signal<readonly StampAsset[]> {\n const filterOf = typeof filter === 'function' ? filter : () => filter;\n return this.binding.select((stamp) => stamp.listAssets(filterOf()), NO_ASSETS);\n }\n\n /**\n * An image URL for a stamp's picture (a picker's thumbnail), or null while it has none. Pass\n * a function (`() => this.asset().id`) and it follows the stamp you show, and a picture that\n * arrives after the stamp does.\n *\n * The URL is a browser resource that holds the picture's bytes, so it is released when the\n * stamp changes and when the caller goes: call it in an injection context (a constructor or a\n * field initializer).\n */\n previewUrlOf(assetId: string | null | (() => string | null)): Signal<string | null> {\n const idOf = typeof assetId === 'function' ? assetId : () => assetId;\n // The plugin keeps each picture until it changes, so this wakes only for a new one.\n const preview = this.binding.select(\n (stamp) => {\n const id = idOf();\n return id ? stamp.getAssetPreview(id) : null;\n },\n null,\n Object.is,\n );\n const url = signal<string | null>(null);\n effect((onCleanup) => {\n const picture = preview();\n if (!picture) {\n url.set(null);\n return;\n }\n const objectUrl = objectUrlOf(picture);\n url.set(objectUrl.url);\n onCleanup(() => objectUrl.revoke());\n });\n return url.asReadonly();\n }\n}\n\n/** Stamps, with their settings: `withStamp({ assetEngine: localEngine() })` on a cloud viewer. */\nexport function withStamp(options?: StampConfig): EmbedPdfFeature {\n return { plugins: [stampPlugin(options)], services: [EpdfStamp] };\n}\n\n/** A stream as the plugin's kind of event: listen, and stop with the call it returns or a signal. */\nfunction eventHookOf<T>(events: Observable<T>): EventHook<T> {\n return (listener, options) => {\n const subscription = events.subscribe(listener);\n options?.signal?.addEventListener('abort', () => subscription.unsubscribe(), { once: true });\n return () => subscription.unsubscribe();\n };\n}\n\n/** What {@link persistStampLibraries} takes besides the stamps and the store. */\nexport type PersistStampLibrariesOptions = NonNullable<Parameters<typeof persistLibraries>[2]>;\n\n/**\n * Keep every library in `store` from now on: a change writes the library's PDF (a burst of\n * edits saves once), a removed library is deleted. `except` names the libraries never to store,\n * such as the standard set you import on every visit. Returns the stop, for when the caller\n * goes: `inject(DestroyRef).onDestroy(persistStampLibraries(stamp, store))`.\n */\nexport function persistStampLibraries(\n stamp: Pick<EpdfStamp, 'exportLibrary' | 'libraryChanged$'>,\n store: StampLibraryStore,\n options?: PersistStampLibrariesOptions,\n): () => void {\n // The plugin's own helper, which reads only these two members: the changes, through the\n // stream (so it follows the viewer from before it starts), and the bytes.\n return persistLibraries(\n { exportLibrary: stamp.exportLibrary, onLibraryChanged: eventHookOf(stamp.libraryChanged$) },\n store,\n options,\n );\n}\n","/**\n * @embedpdf/angular/stamp: libraries of reusable stamps, placed by click or by code.\n *\n * withStamp(options) the plugin, for provideEmbedPdf()\n * inject(EpdfStamp) libraries(), assetsOf(filter), previewUrlOf(id),\n * armAsset(), placeAsset(), armedAsset(), the events\n * persistStampLibraries(stamp, store) keep the libraries in a store from now on\n * restoreStampLibraries(stamp, store) bring back what the store kept (the plugin's own)\n * indexedDbByteStore(name) the browser's store for them\n */\n\n// The plugin's types and helpers, so app code has one import for the feature.\nexport * from '@embedpdf/plugin-stamp';\n// The browser store for `persistStampLibraries` / `restoreStampLibraries`, written once in\n// `@embedpdf/web` (structurally the plugin's `StampLibraryStore`).\nexport { indexedDbByteStore } from '@embedpdf/web';\nexport type { ByteStore } from '@embedpdf/web';\n// Named, so it wins over the plugin's helper of the same name, which listens with\n// `onLibraryChanged` where the service has the `libraryChanged$` stream.\nexport {\n EpdfStamp,\n persistStampLibraries,\n withStamp,\n type PersistStampLibrariesOptions,\n} from './stamp';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["persistLibraries"],"mappings":";;;;;;;;AAAA;;;;;;;;;;;;;;;AAeG;AAkBH,MAAM,YAAY,GAA4B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;AAC/D,MAAM,SAAS,GAA0B,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;AAE1D;;;;;;AAMG;AAEG,MAAO,SAAU,SAAQ,aAAa,CAAC;AAC3C,IAAA,IAAI,EAAE,WAAW;AACjB,IAAA,OAAO,EAAE,aAAa;AACtB,IAAA,KAAK,EAAE,UAAU;AACjB,IAAA,KAAK,EAAE,UAAU;AACjB,IAAA,OAAO,EAAE;QACP,eAAe;QACf,YAAY;QACZ,YAAY;QACZ,UAAU;QACV,iBAAiB;QACjB,oBAAoB;QACpB,gBAAgB;QAChB,eAAe;QACf,eAAe;QACf,eAAe;QACf,eAAe;QACf,eAAe;QACf,aAAa;QACb,4BAA4B;QAC5B,aAAa;QACb,aAAa;QACb,WAAW;QACX,gBAAgB;QAChB,UAAU;QACV,QAAQ;QACR,eAAe;QACf,YAAY;QACZ,mBAAmB;QACnB,UAAU;QACV,0BAA0B;QAC1B,WAAW;AACZ,KAAA;AACD,IAAA,MAAM,EAAE;QACN,kBAAkB;QAClB,kBAAkB;QAClB,kBAAkB;QAClB,kBAAkB;QAClB,gBAAgB;QAChB,gBAAgB;QAChB,gBAAgB;QAChB,cAAc;AACf,KAAA;CACF,CAAC,CAAA;AACA;;;AAGG;AACM,IAAA,SAAS,GAAoC,IAAI,CAAC,OAAO,CAAC,MAAM,CACvE,CAAC,KAAK,KAAK,KAAK,CAAC,aAAa,EAAE,EAChC,YAAY,CACb;AAED;;;;AAIG;AACH,IAAA,QAAQ,CACN,MAAgE,EAAA;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AA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,SAAS,cADI,MAAM,EAAA,CAAA;;2FACnB,SAAS,EAAA,UAAA,EAAA,CAAA;kBADrB,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;AAqGlC;AACM,SAAU,SAAS,CAAC,OAAqB,EAAA;AAC7C,IAAA,OAAO,EAAE,OAAO,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,EAAE;AACnE;AAEA;AACA,SAAS,WAAW,CAAI,MAAqB,EAAA;AAC3C,IAAA,OAAO,CAAC,QAAQ,EAAE,OAAO,KAAI;QAC3B,MAAM,YAAY,GAAG,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC;QAC/C,OAAO,EAAE,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,MAAM,YAAY,CAAC,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC5F,QAAA,OAAO,MAAM,YAAY,CAAC,WAAW,EAAE;AACzC,IAAA,CAAC;AACH;AAKA;;;;;AAKG;SACa,qBAAqB,CACnC,KAA2D,EAC3D,KAAwB,EACxB,OAAsC,EAAA;;;IAItC,OAAOA,uBAAgB,CACrB,EAAE,aAAa,EAAE,KAAK,CAAC,aAAa,EAAE,gBAAgB,EAAE,WAAW,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,EAC5F,KAAK,EACL,OAAO,CACR;AACH;;ACnLA;;;;;;;;;AASG;AAEH;;ACXA;;AAEG;;;;"}
@@ -0,0 +1,89 @@
1
+ import { ContentContainerComponentHarness, HarnessPredicate, ComponentHarness } from '@angular/cdk/testing';
2
+
3
+ /**
4
+ * Test harnesses for the viewer's components, built on `@angular/cdk/testing`: a test talks to
5
+ * the Stage and the search highlights the way a user does, through the page, instead of
6
+ * reaching into their internals.
7
+ *
8
+ * const loader = TestbedHarnessEnvironment.loader(fixture);
9
+ * const stage = await loader.getHarness(EpdfStageHarness);
10
+ * expect(await stage.getShownPageCount()).toBe(2);
11
+ * const [layer] = await stage.getAllHarnesses(EpdfSearchLayerHarness);
12
+ * await layer.clickHighlight(0); // (hitClick) emits the first match
13
+ *
14
+ * They read only what the components draw, so they keep working when the inside changes.
15
+ */
16
+ /**
17
+ * `<epdf-stage>`. It holds harnesses for what's drawn in it: `stage.getAllHarnesses(
18
+ * EpdfSearchLayerHarness)` gives the search layers of the pages on screen.
19
+ */
20
+ class EpdfStageHarness extends ContentContainerComponentHarness {
21
+ static hostSelector = 'epdf-stage';
22
+ /** A Stage that matches `options`: `EpdfStageHarness.with({ selector: '.thumbnails' })`. */
23
+ static with(options = {}) {
24
+ return new HarnessPredicate(EpdfStageHarness, options);
25
+ }
26
+ pages = this.locatorForAll('epdf-page-surface');
27
+ /** How many pages are drawn now: the Stage draws only the ones on screen. */
28
+ async getShownPageCount() {
29
+ return (await this.pages()).length;
30
+ }
31
+ /** The cursor over the Stage: the one the active tool asks for, such as `text` over text. */
32
+ async getCursor() {
33
+ return (await this.host()).getCssValue('cursor');
34
+ }
35
+ /** Turn the mouse wheel over the Stage: it scrolls, as a user's wheel does. */
36
+ async scrollBy(deltaY, deltaX = 0) {
37
+ await (await this.host()).dispatchEvent('wheel', { deltaX, deltaY });
38
+ }
39
+ }
40
+ /**
41
+ * `<epdf-search-layer>`: the search's highlights on one page. A match over two lines is two
42
+ * highlights.
43
+ */
44
+ class EpdfSearchLayerHarness extends ComponentHarness {
45
+ static hostSelector = 'epdf-search-layer';
46
+ /** A search layer that matches `options`. */
47
+ static with(options = {}) {
48
+ return new HarnessPredicate(EpdfSearchLayerHarness, options);
49
+ }
50
+ highlights = this.locatorForAll('[data-epdf-search-hit]');
51
+ activeHighlights = this.locatorForAll('[data-epdf-search-hit][data-active]');
52
+ /** How many highlights the page shows: one per line of each match on it. */
53
+ async getHighlightCount() {
54
+ return (await this.highlights()).length;
55
+ }
56
+ /** How many of them belong to the active match: none when it's on another page. */
57
+ async getActiveHighlightCount() {
58
+ return (await this.activeHighlights()).length;
59
+ }
60
+ /** Whether the highlights take clicks: only while something listens to `(hitClick)`. */
61
+ async isClickable() {
62
+ const [first] = await this.highlights();
63
+ return first ? (await first.getCssValue('pointer-events')) === 'auto' : false;
64
+ }
65
+ /** Click the highlight at `index`, in the order the page draws them. */
66
+ async clickHighlight(index) {
67
+ const highlights = await this.highlights();
68
+ const highlight = highlights[index];
69
+ if (!highlight) {
70
+ throw new Error(`EpdfSearchLayerHarness: no highlight ${index}; the page shows ${highlights.length}.`);
71
+ }
72
+ await highlight.click();
73
+ }
74
+ }
75
+
76
+ /**
77
+ * @embedpdf/angular/testing: test harnesses for the viewer's components, built on
78
+ * `@angular/cdk/testing`, so your tests need `@angular/cdk`.
79
+ *
80
+ * EpdfStageHarness <epdf-stage>: the pages on screen, the cursor, the wheel
81
+ * EpdfSearchLayerHarness <epdf-search-layer>: the highlights on a page, clicking one
82
+ */
83
+
84
+ /**
85
+ * Generated bundle index. Do not edit.
86
+ */
87
+
88
+ export { EpdfSearchLayerHarness, EpdfStageHarness };
89
+ //# sourceMappingURL=embedpdf-angular-testing.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embedpdf-angular-testing.mjs","sources":["../../testing/src/harnesses.ts","../../testing/src/public_api.ts","../../testing/src/embedpdf-angular-testing.ts"],"sourcesContent":["/**\n * Test harnesses for the viewer's components, built on `@angular/cdk/testing`: a test talks to\n * the Stage and the search highlights the way a user does, through the page, instead of\n * reaching into their internals.\n *\n * const loader = TestbedHarnessEnvironment.loader(fixture);\n * const stage = await loader.getHarness(EpdfStageHarness);\n * expect(await stage.getShownPageCount()).toBe(2);\n * const [layer] = await stage.getAllHarnesses(EpdfSearchLayerHarness);\n * await layer.clickHighlight(0); // (hitClick) emits the first match\n *\n * They read only what the components draw, so they keep working when the inside changes.\n */\nimport {\n ComponentHarness,\n ContentContainerComponentHarness,\n HarnessPredicate,\n type BaseHarnessFilters,\n} from '@angular/cdk/testing';\n\n/**\n * `<epdf-stage>`. It holds harnesses for what's drawn in it: `stage.getAllHarnesses(\n * EpdfSearchLayerHarness)` gives the search layers of the pages on screen.\n */\nexport class EpdfStageHarness extends ContentContainerComponentHarness {\n static hostSelector = 'epdf-stage';\n\n /** A Stage that matches `options`: `EpdfStageHarness.with({ selector: '.thumbnails' })`. */\n static with(options: BaseHarnessFilters = {}): HarnessPredicate<EpdfStageHarness> {\n return new HarnessPredicate(EpdfStageHarness, options);\n }\n\n private readonly pages = this.locatorForAll('epdf-page-surface');\n\n /** How many pages are drawn now: the Stage draws only the ones on screen. */\n async getShownPageCount(): Promise<number> {\n return (await this.pages()).length;\n }\n\n /** The cursor over the Stage: the one the active tool asks for, such as `text` over text. */\n async getCursor(): Promise<string> {\n return (await this.host()).getCssValue('cursor');\n }\n\n /** Turn the mouse wheel over the Stage: it scrolls, as a user's wheel does. */\n async scrollBy(deltaY: number, deltaX = 0): Promise<void> {\n await (await this.host()).dispatchEvent('wheel', { deltaX, deltaY });\n }\n}\n\n/**\n * `<epdf-search-layer>`: the search's highlights on one page. A match over two lines is two\n * highlights.\n */\nexport class EpdfSearchLayerHarness extends ComponentHarness {\n static hostSelector = 'epdf-search-layer';\n\n /** A search layer that matches `options`. */\n static with(options: BaseHarnessFilters = {}): HarnessPredicate<EpdfSearchLayerHarness> {\n return new HarnessPredicate(EpdfSearchLayerHarness, options);\n }\n\n private readonly highlights = this.locatorForAll('[data-epdf-search-hit]');\n private readonly activeHighlights = this.locatorForAll('[data-epdf-search-hit][data-active]');\n\n /** How many highlights the page shows: one per line of each match on it. */\n async getHighlightCount(): Promise<number> {\n return (await this.highlights()).length;\n }\n\n /** How many of them belong to the active match: none when it's on another page. */\n async getActiveHighlightCount(): Promise<number> {\n return (await this.activeHighlights()).length;\n }\n\n /** Whether the highlights take clicks: only while something listens to `(hitClick)`. */\n async isClickable(): Promise<boolean> {\n const [first] = await this.highlights();\n return first ? (await first.getCssValue('pointer-events')) === 'auto' : false;\n }\n\n /** Click the highlight at `index`, in the order the page draws them. */\n async clickHighlight(index: number): Promise<void> {\n const highlights = await this.highlights();\n const highlight = highlights[index];\n if (!highlight) {\n throw new Error(\n `EpdfSearchLayerHarness: no highlight ${index}; the page shows ${highlights.length}.`,\n );\n }\n await highlight.click();\n }\n}\n","/**\n * @embedpdf/angular/testing: test harnesses for the viewer's components, built on\n * `@angular/cdk/testing`, so your tests need `@angular/cdk`.\n *\n * EpdfStageHarness <epdf-stage>: the pages on screen, the cursor, the wheel\n * EpdfSearchLayerHarness <epdf-search-layer>: the highlights on a page, clicking one\n */\nexport * from './harnesses';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;AAAA;;;;;;;;;;;;AAYG;AAQH;;;AAGG;AACG,MAAO,gBAAiB,SAAQ,gCAAgC,CAAA;AACpE,IAAA,OAAO,YAAY,GAAG,YAAY;;AAGlC,IAAA,OAAO,IAAI,CAAC,OAAA,GAA8B,EAAE,EAAA;AAC1C,QAAA,OAAO,IAAI,gBAAgB,CAAC,gBAAgB,EAAE,OAAO,CAAC;IACxD;AAEiB,IAAA,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,mBAAmB,CAAC;;AAGhE,IAAA,MAAM,iBAAiB,GAAA;QACrB,OAAO,CAAC,MAAM,IAAI,CAAC,KAAK,EAAE,EAAE,MAAM;IACpC;;AAGA,IAAA,MAAM,SAAS,GAAA;AACb,QAAA,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,WAAW,CAAC,QAAQ,CAAC;IAClD;;AAGA,IAAA,MAAM,QAAQ,CAAC,MAAc,EAAE,MAAM,GAAG,CAAC,EAAA;AACvC,QAAA,MAAM,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,aAAa,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;IACtE;;AAGF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