@embedpdf/angular 3.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +192 -0
- package/dist/LICENSE +192 -0
- package/dist/fesm2022/embedpdf-angular-render.mjs +119 -0
- package/dist/fesm2022/embedpdf-angular-render.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-runtime.mjs +502 -0
- package/dist/fesm2022/embedpdf-angular-runtime.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-stage.mjs +580 -0
- package/dist/fesm2022/embedpdf-angular-stage.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular.mjs +14 -0
- package/dist/fesm2022/embedpdf-angular.mjs.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/render/index.d.ts +19 -0
- package/dist/runtime/index.d.ts +265 -0
- package/dist/stage/index.d.ts +167 -0
- package/package.json +64 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embedpdf-angular-stage.mjs","sources":["../../stage/src/templates.ts","../../stage/src/page-surface.ts","../../stage/src/click-counter.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: 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 * Robust multi-click counter. `pointerdown.detail` is 0/1 in several browsers,\n * so we count clicks ourselves from timing + proximity — the standard\n * double/triple detection. Input normalization belongs in the adapter; the\n * hub/handlers stay pure.\n *\n * INTERNAL for now — moves to the `/interaction` entry point (its React home)\n * when that vertical lands.\n */\nexport function createClickCounter(maxGapMs = 400, maxDistPx = 6) {\n let last = 0;\n let lastX = 0;\n let lastY = 0;\n let count = 0;\n return (now: number, x: number, y: number): number => {\n count = now - last <= maxGapMs && Math.hypot(x - lastX, y - lastY) <= maxDistPx ? count + 1 : 1;\n last = now;\n lastX = x;\n lastY = y;\n return count;\n };\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, wheelZoomFactor } from '@embedpdf/plugin-stage';\nimport type { StageCapability, VisiblePage } from '@embedpdf/plugin-stage';\nimport { InteractionToken } from '@embedpdf/plugin-interaction';\nimport type { PointerSample } from '@embedpdf/plugin-interaction';\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 { createClickCounter } from './click-counter';\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`) instead of the built-in drag-to-pan. Pan then becomes the `pan`\n * tool's job and dragging in `pointer` mode selects text (incl. across pages).\n * Pair with `stagePlugin({ interaction: true })`. Default false (built-in pan).\n */\n readonly interaction = input(false);\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 zoomGestures = this.zoomGestures();\n if (!stage) return; // no document yet — nothing to drive\n\n const cleanups: Array<() => void> = [];\n zone.runOutsideAngular(() => {\n // Only report the viewport size. Initial placement (home) is the Stage\n // plugin's job — the shell stays dumb.\n const setViewport = () =>\n stage.setViewport({ width: el.clientWidth, height: el.clientHeight });\n const resizeObserver = new ResizeObserver(setViewport);\n resizeObserver.observe(el);\n setViewport();\n cleanups.push(() => resizeObserver.disconnect());\n\n // Report the device pixel ratio so page transforms render crisp. dppx\n // changes (zoom, dragging between monitors) fire the media query;\n // re-subscribe each time since the query value itself moves.\n let mq: MediaQueryList | null = null;\n const reportDpr = () => {\n stage.setDevicePixelRatio(window.devicePixelRatio || 1);\n mq?.removeEventListener('change', reportDpr);\n mq = window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);\n mq.addEventListener('change', reportDpr);\n };\n reportDpr();\n cleanups.push(() => mq?.removeEventListener('change', reportDpr));\n\n // Wheel is ambient navigation in BOTH modes: ctrl/meta zooms (classified\n // per input by wheelZoomFactor), else scrolls. With zoom gestures off, a\n // zoom-wheel falls through to ordinary pan.\n const onWheel = (e: WheelEvent) => {\n e.preventDefault();\n const r = el.getBoundingClientRect();\n if (zoomGestures && (e.ctrlKey || e.metaKey)) {\n stage.zoomAround({ x: e.clientX - r.left, y: e.clientY - r.top }, wheelZoomFactor(e));\n } else {\n const dx = e.shiftKey ? e.deltaY : e.deltaX;\n const dy = e.shiftKey ? e.deltaX : e.deltaY;\n stage.panBy(-dx, -dy);\n }\n };\n el.addEventListener('wheel', onWheel, { passive: false });\n cleanups.push(() => el.removeEventListener('wheel', onWheel));\n\n // Safari never synthesizes ctrl+wheel for trackpad pinch — it fires\n // proprietary gesture events carrying an ABSOLUTE scale; convert to the\n // per-event ratio the camera physics wants. Feature-detected, so Chrome\n // and Firefox pay nothing. preventDefault runs even with zoom gestures\n // off — a pinch over the stage must never zoom the page itself.\n let lastScale = 1;\n const onGestureStart = (e: Event) => {\n e.preventDefault();\n lastScale = (e as unknown as { scale?: number }).scale ?? 1;\n };\n const onGestureChange = (e: Event) => {\n e.preventDefault();\n const g = e as unknown as { scale?: number; clientX: number; clientY: number };\n const scale = g.scale ?? 1;\n if (zoomGestures && scale > 0) {\n const r = el.getBoundingClientRect();\n stage.zoomAround({ x: g.clientX - r.left, y: g.clientY - r.top }, scale / lastScale);\n }\n lastScale = scale;\n };\n if ('GestureEvent' in window) {\n el.addEventListener('gesturestart', onGestureStart);\n el.addEventListener('gesturechange', onGestureChange);\n el.addEventListener('gestureend', onGestureStart); // reset the base\n cleanups.push(() => {\n el.removeEventListener('gesturestart', onGestureStart);\n el.removeEventListener('gesturechange', onGestureChange);\n el.removeEventListener('gestureend', onGestureStart);\n });\n }\n\n if (useHub && ix) {\n // Forward to the hub: pan/select/etc. become tool-gated handlers.\n // `pageAt` resolves the page per event, so a drag can cross pages.\n const clicks = createClickCounter();\n const forward = (phase: PointerSample['phase'], e: PointerEvent, clickCount = 1) => {\n const r = el.getBoundingClientRect();\n const viewport = { x: e.clientX - r.left, y: e.clientY - r.top };\n ix.dispatch({\n phase,\n viewport,\n page: stage.pageAt(viewport) ?? undefined,\n // Page-anchored gestures (annotation move/resize) track the origin\n // page's frame through this even when the cursor is off that page.\n project: (pon) => stage.pointOnPage(pon, viewport),\n modifiers: { shift: e.shiftKey, alt: e.altKey, ctrl: e.ctrlKey, meta: e.metaKey },\n clickCount,\n });\n };\n let dragging = false;\n const down = (e: PointerEvent) => {\n if (e.button !== 0) return;\n dragging = true;\n forward('down', e, clicks(Date.now(), e.clientX, e.clientY));\n };\n const hover = (e: PointerEvent) => {\n if (!dragging) forward('move', e); // cursor feedback, no gesture\n };\n const windowMove = (e: PointerEvent) => {\n if (dragging) forward('move', e);\n };\n const up = (e: PointerEvent) => {\n if (!dragging) return;\n dragging = false;\n forward('up', e);\n };\n el.addEventListener('pointerdown', down);\n el.addEventListener('pointermove', hover);\n window.addEventListener('pointermove', windowMove);\n window.addEventListener('pointerup', up);\n cleanups.push(() => {\n el.removeEventListener('pointerdown', down);\n el.removeEventListener('pointermove', hover);\n window.removeEventListener('pointermove', windowMove);\n window.removeEventListener('pointerup', up);\n });\n } else {\n // Built-in drag-to-pan (no interaction hub).\n let dragging = false;\n let lastX = 0;\n let lastY = 0;\n const down = (e: PointerEvent) => {\n if (e.button !== 0) return;\n dragging = true;\n lastX = e.clientX;\n lastY = e.clientY;\n };\n const move = (e: PointerEvent) => {\n if (!dragging) return;\n stage.panBy(e.clientX - lastX, e.clientY - lastY);\n lastX = e.clientX;\n lastY = e.clientY;\n };\n const up = () => {\n dragging = false;\n };\n el.addEventListener('pointerdown', down);\n window.addEventListener('pointermove', move);\n window.addEventListener('pointerup', up);\n cleanups.push(() => {\n el.removeEventListener('pointerdown', down);\n window.removeEventListener('pointermove', move);\n window.removeEventListener('pointerup', up);\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 *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;AAEG;;;;"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from '@embedpdf/angular/runtime';
|
|
2
|
+
export * from '@embedpdf/angular/stage';
|
|
3
|
+
export * from '@embedpdf/angular/render';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @embedpdf/angular — the opt-in "everything" barrel.
|
|
7
|
+
* Fine for prototyping; examples, docs, and quickstarts import the secondary
|
|
8
|
+
* entry points exclusively, which make the bundle guarantee legible.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Generated bundle index. Do not edit.
|
|
13
|
+
*/
|
|
14
|
+
//# sourceMappingURL=embedpdf-angular.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embedpdf-angular.mjs","sources":["../../src/public_api.ts","../../src/embedpdf-angular.ts"],"sourcesContent":["/**\n * @embedpdf/angular — the opt-in \"everything\" barrel.\n * Fine for prototyping; examples, docs, and quickstarts import the secondary\n * entry points exclusively, which make the bundle guarantee legible.\n */\nexport * from '@embedpdf/angular/runtime';\nexport * from '@embedpdf/angular/stage';\nexport * from '@embedpdf/angular/render';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;AAAA;;;;AAIG;;ACJH;;AAEG"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from '@embedpdf/plugin-render';
|
|
2
|
+
import * as _angular_core from '@angular/core';
|
|
3
|
+
|
|
4
|
+
declare class EpdfRenderLayer {
|
|
5
|
+
/**
|
|
6
|
+
* Bake annotations into the page bitmap (default true). Pass false when an
|
|
7
|
+
* annotation layer owns annotation rendering, so they aren't drawn twice.
|
|
8
|
+
*/
|
|
9
|
+
readonly annotations: _angular_core.InputSignal<boolean>;
|
|
10
|
+
private readonly page;
|
|
11
|
+
private readonly render;
|
|
12
|
+
private readonly sourceKey;
|
|
13
|
+
protected readonly src: _angular_core.WritableSignal<string | null>;
|
|
14
|
+
constructor();
|
|
15
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EpdfRenderLayer, never>;
|
|
16
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EpdfRenderLayer, "epdf-render-layer", never, { "annotations": { "alias": "annotations"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export { EpdfRenderLayer };
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import * as _embedpdf_core from '@embedpdf/core';
|
|
2
|
+
import { Engine, EngineFactory, AnyPlugin, InitialDocument, Kernel, DocInfo, CapabilityToken } from '@embedpdf/core';
|
|
3
|
+
export * from '@embedpdf/core';
|
|
4
|
+
import * as i0 from '@angular/core';
|
|
5
|
+
import { OnDestroy, Signal, EnvironmentProviders, InjectionToken, TemplateRef, OnInit } from '@angular/core';
|
|
6
|
+
import { PageFrame, PageTransform, Point, Rect } from '@embedpdf/core-geometry';
|
|
7
|
+
|
|
8
|
+
/** One boot document — the KERNEL's shared `InitialDocument` shape (same as
|
|
9
|
+
* the React adapter's), aliased under the package's Epdf naming. */
|
|
10
|
+
type EpdfInitialDocument = InitialDocument;
|
|
11
|
+
interface EmbedPdfConfig {
|
|
12
|
+
/**
|
|
13
|
+
* The engine, as an instance or a thunk. Engines construct synchronously and
|
|
14
|
+
* boot lazily (`localEngine()` allocates nothing until first use), so
|
|
15
|
+
* ownership follows the SHAPE of what you pass:
|
|
16
|
+
*
|
|
17
|
+
* - An **instance** is BORROWED: used as-is, never destroyed here. The
|
|
18
|
+
* common path — a module-scope `const engine = localEngine()` shared
|
|
19
|
+
* across viewers and route changes. The host calls `engine.warmup?.()`
|
|
20
|
+
* when the kernel materializes so the boot overlaps initialization.
|
|
21
|
+
* - A **thunk** (`() => localEngine()`) is HOST-OWNED: the host calls it
|
|
22
|
+
* when the kernel materializes and `destroy()`s the result on teardown.
|
|
23
|
+
* Use it for per-host isolation.
|
|
24
|
+
*
|
|
25
|
+
* Init-only: the kernel is never rebuilt for a new engine — tear the host
|
|
26
|
+
* down (destroy the viewer / injector) and create a new one.
|
|
27
|
+
*/
|
|
28
|
+
engine: Engine | EngineFactory;
|
|
29
|
+
/** Init-only, like `engine`. */
|
|
30
|
+
plugins: AnyPlugin[];
|
|
31
|
+
/** Documents to open on startup (with optional tab names). They open in the
|
|
32
|
+
* BACKGROUND after start and stream into the registry — `injectDocuments()`
|
|
33
|
+
* is reactive; per-document loading UI is the Stage's job. A source that
|
|
34
|
+
* fails to open lands in `error` and does NOT block the ones after it. */
|
|
35
|
+
initialDocuments?: EpdfInitialDocument[];
|
|
36
|
+
}
|
|
37
|
+
/** `starting` covers construction through `kernel.start()`; `ready` means the
|
|
38
|
+
* workspace is live (documents may still be opening in the background). */
|
|
39
|
+
type EpdfKernelStatus = 'starting' | 'ready' | 'error';
|
|
40
|
+
declare class EpdfKernelHost implements OnDestroy {
|
|
41
|
+
private readonly browser;
|
|
42
|
+
private config;
|
|
43
|
+
private _kernel;
|
|
44
|
+
/** The engine backing the kernel, and whether WE created it (a recipe) and
|
|
45
|
+
* therefore must destroy it. A borrowed instance is left untouched. */
|
|
46
|
+
private _engine;
|
|
47
|
+
private ownsEngine;
|
|
48
|
+
private unsubscribe;
|
|
49
|
+
private initialDocuments;
|
|
50
|
+
private booted;
|
|
51
|
+
private destroyed;
|
|
52
|
+
/** Bumped on every kernel notification — THE bridge from kernel-world to signals. */
|
|
53
|
+
private readonly tick;
|
|
54
|
+
/** Boot lifecycle. `ready`/`error` are derived sugar over it. */
|
|
55
|
+
readonly status: i0.WritableSignal<EpdfKernelStatus>;
|
|
56
|
+
/** The STARTUP failure, if any. Per-document open failures are tab state
|
|
57
|
+
* (`DocInfo.status === 'error'`), not host state. */
|
|
58
|
+
readonly error: i0.WritableSignal<unknown>;
|
|
59
|
+
/** True once `kernel.start()` resolved — which never touches the engine, so
|
|
60
|
+
* the shell (and every workspace capability: i18n, view-manager, …) is alive
|
|
61
|
+
* while WASM compiles or the transport connects. Workspace chrome may render
|
|
62
|
+
* before this; gate on it (or on the document gate) where it matters. */
|
|
63
|
+
readonly ready: Signal<boolean>;
|
|
64
|
+
/** Register the (deferred) config. Called exactly once, by `EpdfViewer`'s
|
|
65
|
+
* constructor or `provideEmbedPdf`'s factory. */
|
|
66
|
+
connect(config: () => EmbedPdfConfig): void;
|
|
67
|
+
/** The kernel — materialized on first read (see the construction rule above). */
|
|
68
|
+
get kernel(): Kernel;
|
|
69
|
+
/** Start the kernel and open initial documents in the background. Idempotent;
|
|
70
|
+
* a no-op on the server and after destroy. */
|
|
71
|
+
boot(): void;
|
|
72
|
+
/** Read a value derived from the kernel, cached by equality — Angular's
|
|
73
|
+
* `useKernelValue`. The selector re-runs per kernel notification (cheap);
|
|
74
|
+
* `equal` decides whether dependents ever see it. */
|
|
75
|
+
value<R>(select: (kernel: Kernel) => R, equal?: (a: R, b: R) => boolean): Signal<R>;
|
|
76
|
+
ngOnDestroy(): void;
|
|
77
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EpdfKernelHost, never>;
|
|
78
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<EpdfKernelHost>;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Host the kernel in an environment injector (route or application providers).
|
|
82
|
+
* The kernel's lifetime is the injector's — a route-level workspace tears down
|
|
83
|
+
* when the route does. Unlocks chrome OUTSIDE any viewer subtree: a toolbar in
|
|
84
|
+
* the app header and the stage in the main outlet share this one kernel.
|
|
85
|
+
*/
|
|
86
|
+
declare function provideEmbedPdf(config: EmbedPdfConfig): EnvironmentProviders;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* DI tokens shared by the runtime's primitives and directives — split out so
|
|
90
|
+
* `inject.ts` (consumers) and `scope.ts` (providers) never import each other.
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
/** The document a subtree is bound to (provided by `[epdfDocumentScope]`).
|
|
94
|
+
* Absent => the subtree follows the ACTIVE document. */
|
|
95
|
+
interface EpdfDocumentScopeRef {
|
|
96
|
+
readonly id: Signal<string>;
|
|
97
|
+
}
|
|
98
|
+
declare const EPDF_DOCUMENT_SCOPE: InjectionToken<EpdfDocumentScopeRef>;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The inject* primitives — Angular's spelling of the React runtime hooks
|
|
102
|
+
* (`use*` → `inject*`, plain values → signals, same names otherwise).
|
|
103
|
+
*
|
|
104
|
+
* All of them must run in an injection context (a constructor / field
|
|
105
|
+
* initializer, like `inject()` itself). None of them read `host.kernel` during
|
|
106
|
+
* construction — they return signals or lazy methods, so they are safe in
|
|
107
|
+
* component-hosted mode where the kernel materializes after construction.
|
|
108
|
+
*/
|
|
109
|
+
|
|
110
|
+
declare const shallowArray: <T>(a: readonly T[], b: readonly T[]) => boolean;
|
|
111
|
+
declare function injectKernelHost(): EpdfKernelHost;
|
|
112
|
+
/** The raw kernel — materializes it immediately. Do NOT call while a component
|
|
113
|
+
* is being constructed in component-hosted mode (inputs are not set yet);
|
|
114
|
+
* prefer the signal-returning primitives, which defer the first kernel read. */
|
|
115
|
+
declare function injectKernel(): Kernel;
|
|
116
|
+
/** Read a value derived from the kernel, cached by equality — `useKernelValue`. */
|
|
117
|
+
declare function injectKernelValue<R>(select: (kernel: Kernel) => R, equal?: (a: R, b: R) => boolean): Signal<R>;
|
|
118
|
+
declare function injectActiveDocumentId(): Signal<string | null>;
|
|
119
|
+
/** The document id for this injector subtree: the nearest `[epdfDocumentScope]`,
|
|
120
|
+
* else the active document. */
|
|
121
|
+
declare function injectDocumentId(): Signal<string | null>;
|
|
122
|
+
/**
|
|
123
|
+
* Resolve a capability against a REACTIVE token — for components that take the
|
|
124
|
+
* token as an input (`injectCapability` is the fixed-token sugar). Resolution
|
|
125
|
+
* is a REACTIVE read (`tryCapability` through the kernel's one change
|
|
126
|
+
* stream), not a computed over the document id — under the request-time
|
|
127
|
+
* lifecycle a document can become resolvable while its id stays the same, so
|
|
128
|
+
* any id-keyed cache goes stale; subscribing makes staleness structurally
|
|
129
|
+
* impossible. Fail-fast like React's `useCapability`: while unresolvable,
|
|
130
|
+
* this re-runs the strict resolver so the kernel's truthful reason (`no
|
|
131
|
+
* capability` / `no document` / `document is loading|locked`) is what throws.
|
|
132
|
+
*/
|
|
133
|
+
declare function injectCapabilityFor<T>(token: () => CapabilityToken<T>): Signal<T>;
|
|
134
|
+
declare function injectCapability<T>(token: CapabilityToken<T>): Signal<T>;
|
|
135
|
+
/** Like `injectCapabilityFor`, but null while the token can't resolve (no
|
|
136
|
+
* plugin, no document, or a document that isn't ready yet). */
|
|
137
|
+
declare function injectOptionalCapabilityFor<T>(token: () => CapabilityToken<T>): Signal<T | null>;
|
|
138
|
+
declare function injectOptionalCapability<T>(token: CapabilityToken<T>): Signal<T | null>;
|
|
139
|
+
/** Subscribe to a selector over a (document-resolved) capability. */
|
|
140
|
+
declare function injectSelectorFor<C, R>(token: () => CapabilityToken<C>, select: (cap: C) => R, equal?: (a: R, b: R) => boolean): Signal<R>;
|
|
141
|
+
declare function injectSelector<C, R>(token: CapabilityToken<C>, select: (cap: C) => R, equal?: (a: R, b: R) => boolean): Signal<R>;
|
|
142
|
+
/**
|
|
143
|
+
* Null-safe `injectSelector`: `fallback` whenever the token can't resolve — no
|
|
144
|
+
* provider, or a document-scoped token with no document. For chrome that stays
|
|
145
|
+
* mounted across the empty-workspace state (a zoom readout, a mode band).
|
|
146
|
+
* `injectSelector` stays strict (fail-fast) for code that KNOWS a document
|
|
147
|
+
* exists — e.g. anything behind the document gate.
|
|
148
|
+
*
|
|
149
|
+
* The `select` guard also swallows reads through a capability whose document
|
|
150
|
+
* closed between the store notification and this read — that teardown race
|
|
151
|
+
* resolves to `fallback` for one frame, then recomputes against the new state.
|
|
152
|
+
*/
|
|
153
|
+
declare function injectOptionalSelectorFor<C, R>(token: () => CapabilityToken<C>, select: (cap: C) => R, fallback: R, equal?: (a: R, b: R) => boolean): Signal<R>;
|
|
154
|
+
declare function injectOptionalSelector<C, R>(token: CapabilityToken<C>, select: (cap: C) => R, fallback: R, equal?: (a: R, b: R) => boolean): Signal<R>;
|
|
155
|
+
/** The document registry (open/close/active/list), reactive — `useDocuments`.
|
|
156
|
+
* Methods late-bind the kernel, so this is construction-safe. */
|
|
157
|
+
interface EpdfDocuments {
|
|
158
|
+
docs: Signal<DocInfo[]>;
|
|
159
|
+
activeId: Signal<string | null>;
|
|
160
|
+
open: Kernel['documents']['open'];
|
|
161
|
+
unlock: Kernel['documents']['unlock'];
|
|
162
|
+
close: Kernel['documents']['close'];
|
|
163
|
+
setActive: Kernel['documents']['setActive'];
|
|
164
|
+
move: Kernel['documents']['move'];
|
|
165
|
+
swap: Kernel['documents']['swap'];
|
|
166
|
+
download: Kernel['documents']['download'];
|
|
167
|
+
downloadLayer: Kernel['documents']['downloadLayer'];
|
|
168
|
+
}
|
|
169
|
+
declare function injectDocuments(): EpdfDocuments;
|
|
170
|
+
|
|
171
|
+
declare class EpdfDocumentScope implements EpdfDocumentScopeRef {
|
|
172
|
+
readonly id: i0.InputSignal<string>;
|
|
173
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EpdfDocumentScope, never>;
|
|
174
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<EpdfDocumentScope, "[epdfDocumentScope]", never, { "id": { "alias": "epdfDocumentScope"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Render the host template only while this subtree has a document — the
|
|
178
|
+
* structural way to say "this UI is defined over a document". Sibling of
|
|
179
|
+
* `[epdfDocumentScope]`, which picks WHICH document; this one handles WHETHER.
|
|
180
|
+
*
|
|
181
|
+
* <section *epdfDocumentGate="; fallback: empty">…document UI…</section>
|
|
182
|
+
* <ng-template #empty>Drop a PDF to get started</ng-template>
|
|
183
|
+
*
|
|
184
|
+
* The subtree stays mounted across a CHANGE of document (active-tab switch) —
|
|
185
|
+
* only the has-a-document boolean creates/destroys it.
|
|
186
|
+
*/
|
|
187
|
+
declare class EpdfDocumentGate {
|
|
188
|
+
/** Shown while this subtree has NO document (empty workspace, docs still opening). */
|
|
189
|
+
readonly fallback: i0.InputSignal<TemplateRef<unknown> | null>;
|
|
190
|
+
constructor();
|
|
191
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EpdfDocumentGate, never>;
|
|
192
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<EpdfDocumentGate, "[epdfDocumentGate]", never, { "fallback": { "alias": "epdfDocumentGateFallback"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
declare class EpdfViewer implements OnInit {
|
|
196
|
+
/** The engine, as an instance OR a thunk ({@link EngineFactory}). An
|
|
197
|
+
* instance is borrowed (never destroyed here); a thunk is host-owned
|
|
198
|
+
* (constructed then destroyed with the viewer). See EmbedPdfConfig.
|
|
199
|
+
* Init-only: the kernel is built once from the first values; recreate the
|
|
200
|
+
* viewer (e.g. with @if) to swap it. */
|
|
201
|
+
readonly engine: i0.InputSignal<Engine | EngineFactory>;
|
|
202
|
+
readonly plugins: i0.InputSignal<AnyPlugin[]>;
|
|
203
|
+
readonly initialDocuments: i0.InputSignal<_embedpdf_core.InitialDocument[] | undefined>;
|
|
204
|
+
/** The host this viewer provides — exposed so a template reference can read
|
|
205
|
+
* `viewer.host.ready()` / `.status()` without extra imports. */
|
|
206
|
+
readonly host: EpdfKernelHost;
|
|
207
|
+
constructor();
|
|
208
|
+
ngOnInit(): void;
|
|
209
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EpdfViewer, never>;
|
|
210
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EpdfViewer, "epdf-viewer", never, { "engine": { "alias": "engine"; "required": true; "isSignal": true; }; "plugins": { "alias": "plugins"; "required": true; "isSignal": true; }; "initialDocuments": { "alias": "initialDocuments"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* PageContext — the seam. A layer depends ONLY on this, never on the Stage, so
|
|
215
|
+
* the same layer works inside a virtualized `<epdf-stage>` page and a future
|
|
216
|
+
* standalone `<epdf-page-view>`.
|
|
217
|
+
*
|
|
218
|
+
* THE STABILITY INVARIANT (the one performance rule of this adapter): a page's
|
|
219
|
+
* context is ONE STABLE OBJECT per mounted surface — identity never changes;
|
|
220
|
+
* the volatile parts (`transform`, `frame`, `pageIndex`) are signals INSIDE it.
|
|
221
|
+
* The per-page injector providing `EPDF_PAGE` is likewise created once. Camera
|
|
222
|
+
* frames then flow as signal writes — `NgTemplateOutlet` never recreates the
|
|
223
|
+
* embedded views, in-flight renders survive, and updates stay per-binding.
|
|
224
|
+
* Never rebuild the context or the injector per frame.
|
|
225
|
+
*
|
|
226
|
+
* Coordinate math lives in `@embedpdf/core-geometry`'s `PageTransform` — verified
|
|
227
|
+
* once, not re-derived per framework adapter (`toPagePoint` mirrors React's
|
|
228
|
+
* `makePageContext` exactly).
|
|
229
|
+
*/
|
|
230
|
+
|
|
231
|
+
interface EpdfPageContext {
|
|
232
|
+
readonly documentId: string;
|
|
233
|
+
/** Durable page identity (PDF object number) — use for keys / render / annotations. */
|
|
234
|
+
readonly pon: number;
|
|
235
|
+
/** Display index (page N) — can shift under page reorders, hence a signal. */
|
|
236
|
+
readonly pageIndex: Signal<number>;
|
|
237
|
+
/** Reserved chrome bands around the page (screen px per side). */
|
|
238
|
+
readonly frame: Signal<PageFrame>;
|
|
239
|
+
/** The single bridge between PDF points, view px, and device px for this
|
|
240
|
+
* page. Layers do ALL coordinate work through it — never re-derive
|
|
241
|
+
* `x * scale` or `* dpr`. Updates per camera frame. */
|
|
242
|
+
readonly transform: Signal<PageTransform>;
|
|
243
|
+
/** Client (screen) point → PDF point — the one platform-bound hit-test. */
|
|
244
|
+
toPagePoint(clientX: number, clientY: number): Point;
|
|
245
|
+
/** PDF/content point → client (screen) px — the exact inverse of `toPagePoint`. */
|
|
246
|
+
toClientPoint(p: Point): Point;
|
|
247
|
+
/** PDF/content rect → client (screen) px AABB. */
|
|
248
|
+
toClientRect(rect: Rect): Rect;
|
|
249
|
+
}
|
|
250
|
+
declare const EPDF_PAGE: InjectionToken<EpdfPageContext>;
|
|
251
|
+
declare function injectPage(): EpdfPageContext;
|
|
252
|
+
/** Build a page context from its reactive parts. `documentId`/`pon` are thunks
|
|
253
|
+
* because inputs aren't readable at construction — both are stable per surface. */
|
|
254
|
+
declare function createPageContext(parts: {
|
|
255
|
+
documentId: () => string;
|
|
256
|
+
pon: () => number;
|
|
257
|
+
pageIndex: Signal<number>;
|
|
258
|
+
frame: Signal<PageFrame>;
|
|
259
|
+
transform: Signal<PageTransform>;
|
|
260
|
+
/** The rotated content wrapper's LIVE bounding box (the page's display box). */
|
|
261
|
+
getRect: () => DOMRect;
|
|
262
|
+
}): EpdfPageContext;
|
|
263
|
+
|
|
264
|
+
export { EPDF_DOCUMENT_SCOPE, EPDF_PAGE, EpdfDocumentGate, EpdfDocumentScope, EpdfKernelHost, EpdfViewer, createPageContext, injectActiveDocumentId, injectCapability, injectCapabilityFor, injectDocumentId, injectDocuments, injectKernel, injectKernelHost, injectKernelValue, injectOptionalCapability, injectOptionalCapabilityFor, injectOptionalSelector, injectOptionalSelectorFor, injectPage, injectSelector, injectSelectorFor, provideEmbedPdf, shallowArray };
|
|
265
|
+
export type { EmbedPdfConfig, EpdfDocumentScopeRef, EpdfDocuments, EpdfInitialDocument, EpdfKernelStatus, EpdfPageContext };
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import * as _embedpdf_plugin_stage from '@embedpdf/plugin-stage';
|
|
2
|
+
import { VisiblePage, PageFrame, StageCapability } from '@embedpdf/plugin-stage';
|
|
3
|
+
export * from '@embedpdf/plugin-stage';
|
|
4
|
+
import * as _angular_core from '@angular/core';
|
|
5
|
+
import { TemplateRef, Signal } from '@angular/core';
|
|
6
|
+
import { EpdfPageContext, CapabilityToken } from '@embedpdf/angular/runtime';
|
|
7
|
+
import * as _embedpdf_core_geometry from '@embedpdf/core-geometry';
|
|
8
|
+
import * as _embedpdf_angular_stage from '@embedpdf/angular/stage';
|
|
9
|
+
import * as _embedpdf_core from '@embedpdf/core';
|
|
10
|
+
import * as _embedpdf_core_stage from '@embedpdf/core-stage';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* The render-prop translation: React's `children: (page) => ReactNode` becomes
|
|
14
|
+
* marker directives on `<ng-template>`, typed so `let-page` infers
|
|
15
|
+
* `EpdfPageContext` in the template.
|
|
16
|
+
*
|
|
17
|
+
* <epdf-stage>
|
|
18
|
+
* <ng-template epdfPage> page-space content (rotates)
|
|
19
|
+
* <ng-template epdfPageChrome> box-space chrome (never rotates)
|
|
20
|
+
*
|
|
21
|
+
* The `$implicit` context is the SAME stable object the per-page injector
|
|
22
|
+
* provides as `EPDF_PAGE` — `let-page` is sugar for inline chrome; components
|
|
23
|
+
* inside the template just call `injectPage()`.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
interface EpdfPageTemplateContext {
|
|
27
|
+
$implicit: EpdfPageContext;
|
|
28
|
+
}
|
|
29
|
+
/** PAGE-SPACE content for each visible page (RenderLayer, annotations,
|
|
30
|
+
* markers). Rendered inside the page's content frame, so it ROTATES with the
|
|
31
|
+
* page's display rotation — coordinates are plain PDF points. */
|
|
32
|
+
declare class EpdfPageTemplate {
|
|
33
|
+
readonly template: TemplateRef<EpdfPageTemplateContext>;
|
|
34
|
+
static ngTemplateContextGuard(_dir: EpdfPageTemplate, ctx: unknown): ctx is EpdfPageTemplateContext;
|
|
35
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EpdfPageTemplate, never>;
|
|
36
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<EpdfPageTemplate, "ng-template[epdfPage]", never, {}, {}, never, never, true, never>;
|
|
37
|
+
}
|
|
38
|
+
/** BOX-SPACE chrome for each visible page (page-number label, selection
|
|
39
|
+
* border, per-page buttons). Rendered into the OUTER box (content + reserved
|
|
40
|
+
* `pageFrame`), so it does NOT rotate and the reserved bands are plain
|
|
41
|
+
* regions (`bottom: 0; height: page.frame().bottom`). */
|
|
42
|
+
declare class EpdfPageChrome {
|
|
43
|
+
readonly template: TemplateRef<EpdfPageTemplateContext>;
|
|
44
|
+
static ngTemplateContextGuard(_dir: EpdfPageChrome, ctx: unknown): ctx is EpdfPageTemplateContext;
|
|
45
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EpdfPageChrome, never>;
|
|
46
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<EpdfPageChrome, "ng-template[epdfPageChrome]", never, {}, {}, never, never, true, never>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
declare class EpdfPageSurface {
|
|
50
|
+
readonly vp: _angular_core.InputSignal<VisiblePage>;
|
|
51
|
+
readonly frame: _angular_core.InputSignal<PageFrame>;
|
|
52
|
+
readonly documentId: _angular_core.InputSignal<string>;
|
|
53
|
+
readonly pageTpl: _angular_core.InputSignal<TemplateRef<EpdfPageTemplateContext>>;
|
|
54
|
+
readonly chromeTpl: _angular_core.InputSignal<TemplateRef<EpdfPageTemplateContext> | null>;
|
|
55
|
+
protected readonly t: _angular_core.Signal<_embedpdf_core_geometry.PageTransform>;
|
|
56
|
+
protected readonly left: _angular_core.Signal<number>;
|
|
57
|
+
protected readonly top: _angular_core.Signal<number>;
|
|
58
|
+
protected readonly outerWidth: _angular_core.Signal<number>;
|
|
59
|
+
protected readonly outerHeight: _angular_core.Signal<number>;
|
|
60
|
+
protected readonly contentLeft: _angular_core.Signal<number>;
|
|
61
|
+
protected readonly contentTop: _angular_core.Signal<number>;
|
|
62
|
+
protected readonly rotate: _angular_core.Signal<string | null>;
|
|
63
|
+
private readonly contentEl;
|
|
64
|
+
/** ONE stable context per surface — volatile parts are signals inside it. */
|
|
65
|
+
readonly page: EpdfPageContext;
|
|
66
|
+
/** ONE stable injector per surface (see the invariant above), parented to
|
|
67
|
+
* this surface's node injector so layers also reach the kernel host. */
|
|
68
|
+
protected readonly pageInjector: _angular_core.DestroyableInjector;
|
|
69
|
+
protected readonly templateContext: EpdfPageTemplateContext;
|
|
70
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EpdfPageSurface, never>;
|
|
71
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EpdfPageSurface, "epdf-page-surface", never, { "vp": { "alias": "vp"; "required": true; "isSignal": true; }; "frame": { "alias": "frame"; "required": true; "isSignal": true; }; "documentId": { "alias": "documentId"; "required": true; "isSignal": true; }; "pageTpl": { "alias": "pageTpl"; "required": true; "isSignal": true; }; "chromeTpl": { "alias": "chromeTpl"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Which stage lens to bind to. Defaults to the main StageToken — pass a custom
|
|
75
|
+
* token to drive an additional lens (e.g. a wrapped thumbnail sidebar). */
|
|
76
|
+
type StageTokenProp = CapabilityToken<StageCapability>;
|
|
77
|
+
declare class EpdfStage {
|
|
78
|
+
/**
|
|
79
|
+
* Route this Stage's pointer events to the interaction hub (page-resolved via
|
|
80
|
+
* `pageAt`) instead of the built-in drag-to-pan. Pan then becomes the `pan`
|
|
81
|
+
* tool's job and dragging in `pointer` mode selects text (incl. across pages).
|
|
82
|
+
* Pair with `stagePlugin({ interaction: true })`. Default false (built-in pan).
|
|
83
|
+
*/
|
|
84
|
+
readonly interaction: _angular_core.InputSignal<boolean>;
|
|
85
|
+
/**
|
|
86
|
+
* Ambient ZOOM gestures on this stage: ctrl/cmd+wheel and trackpad pinch
|
|
87
|
+
* (Safari gesture events included). Default true. Turn OFF for follower
|
|
88
|
+
* lenses with a fixed magnification (a thumbnail rail should scroll under
|
|
89
|
+
* cmd+wheel, not zoom); pinches are still swallowed either way.
|
|
90
|
+
*/
|
|
91
|
+
readonly zoomGestures: _angular_core.InputSignal<boolean>;
|
|
92
|
+
/** The stage lens to drive (default: the main StageToken). */
|
|
93
|
+
readonly token: _angular_core.InputSignal<StageTokenProp>;
|
|
94
|
+
private readonly host;
|
|
95
|
+
private readonly stage;
|
|
96
|
+
private readonly ix;
|
|
97
|
+
private readonly useHub;
|
|
98
|
+
private readonly hubCursor;
|
|
99
|
+
protected readonly cursor: _angular_core.Signal<string | null>;
|
|
100
|
+
protected readonly documentId: _angular_core.Signal<string | null>;
|
|
101
|
+
protected readonly pages: _angular_core.Signal<VisiblePage[]>;
|
|
102
|
+
protected readonly frame: _angular_core.Signal<PageFrame>;
|
|
103
|
+
private readonly pageTemplateDir;
|
|
104
|
+
private readonly chromeTemplateDir;
|
|
105
|
+
protected readonly pageTemplate: _angular_core.Signal<_angular_core.TemplateRef<_embedpdf_angular_stage.EpdfPageTemplateContext> | null>;
|
|
106
|
+
protected readonly chromeTemplate: _angular_core.Signal<_angular_core.TemplateRef<_embedpdf_angular_stage.EpdfPageTemplateContext> | null>;
|
|
107
|
+
constructor();
|
|
108
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<EpdfStage, never>;
|
|
109
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EpdfStage, "epdf-stage", never, { "interaction": { "alias": "interaction"; "required": false; "isSignal": true; }; "zoomGestures": { "alias": "zoomGestures"; "required": false; "isSignal": true; }; "token": { "alias": "token"; "required": false; "isSignal": true; }; }, {}, ["pageTemplateDir", "chromeTemplateDir"], ["*"], true, never>;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
declare function injectStage(token?: StageTokenProp): Signal<StageCapability>;
|
|
113
|
+
declare function injectZoom(token?: StageTokenProp): {
|
|
114
|
+
zoom: Signal<number>;
|
|
115
|
+
/** Active zoom intent: 'automatic' | 'fit-page' | 'fit-width' | 'fit-all' | 'custom'. */
|
|
116
|
+
mode: Signal<_embedpdf_core_stage.ZoomModeValue | "custom">;
|
|
117
|
+
zoomIn: () => void;
|
|
118
|
+
zoomOut: () => void;
|
|
119
|
+
fitWidth: () => void;
|
|
120
|
+
fitPage: () => void;
|
|
121
|
+
fitAll: () => void;
|
|
122
|
+
automatic: () => void;
|
|
123
|
+
zoomTo: (spec: _embedpdf_core_stage.ZoomSpec) => void;
|
|
124
|
+
};
|
|
125
|
+
declare function injectPages(token?: StageTokenProp): {
|
|
126
|
+
currentPage: Signal<number>;
|
|
127
|
+
pageCount: Signal<number>;
|
|
128
|
+
goToPage: (pageIndex: number, opts?: _embedpdf_plugin_stage.GoToOptions) => void;
|
|
129
|
+
next: (opts?: _embedpdf_plugin_stage.GoToOptions) => void;
|
|
130
|
+
prev: (opts?: _embedpdf_plugin_stage.GoToOptions) => void;
|
|
131
|
+
reveal: (pageIndex: number, opts?: _embedpdf_plugin_stage.RevealOptions) => void;
|
|
132
|
+
};
|
|
133
|
+
declare function injectLayout(token?: StageTokenProp): {
|
|
134
|
+
flow: Signal<_embedpdf_plugin_stage.FlowMode>;
|
|
135
|
+
layout: Signal<_embedpdf_plugin_stage.LayoutKind>;
|
|
136
|
+
spread: Signal<_embedpdf_core_stage.SpreadMode>;
|
|
137
|
+
sizing: Signal<_embedpdf_core_stage.SizingMode>;
|
|
138
|
+
bounded: Signal<boolean>;
|
|
139
|
+
setFlow: (flow: _embedpdf_plugin_stage.FlowMode) => void;
|
|
140
|
+
setLayout: (layout: _embedpdf_plugin_stage.LayoutKind) => void;
|
|
141
|
+
setSpread: (spread: _embedpdf_core_stage.SpreadMode) => void;
|
|
142
|
+
setSizing: (sizing: _embedpdf_core_stage.SizingMode) => void;
|
|
143
|
+
setBounded: (bounded: boolean) => void;
|
|
144
|
+
};
|
|
145
|
+
/** The document's page list (with PDF labels) + the current item's pages — the
|
|
146
|
+
* data for page thumbnails / worksheet-style page tabs. */
|
|
147
|
+
declare function injectPageList(token?: StageTokenProp): {
|
|
148
|
+
pages: Signal<{
|
|
149
|
+
index: number;
|
|
150
|
+
pon: _embedpdf_core.PageObjectNumber;
|
|
151
|
+
label: string | null;
|
|
152
|
+
}[]>;
|
|
153
|
+
currentItemPages: Signal<number[]>;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* All Stage settings + the batch `update`. The seam for "presets are a customer
|
|
157
|
+
* concern": keep your own `Partial<StageSettings>` objects and apply them with
|
|
158
|
+
* `update(preset)` (one anchor-preserving change).
|
|
159
|
+
*/
|
|
160
|
+
declare function injectStageSettings(token?: StageTokenProp): {
|
|
161
|
+
settings: Signal<_embedpdf_plugin_stage.StageSettings>;
|
|
162
|
+
update: (patch: Partial<_embedpdf_plugin_stage.StageSettings>) => void;
|
|
163
|
+
reset: () => void;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export { EpdfPageChrome, EpdfPageSurface, EpdfPageTemplate, EpdfStage, injectLayout, injectPageList, injectPages, injectStage, injectStageSettings, injectZoom };
|
|
167
|
+
export type { EpdfPageTemplateContext, StageTokenProp };
|