@embedpdf/angular 3.0.0-next.1 → 3.0.0-next.11
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/dist/actions/index.d.ts +24 -0
- package/dist/fesm2022/embedpdf-angular-actions.mjs +56 -0
- package/dist/fesm2022/embedpdf-angular-actions.mjs.map +1 -0
- package/dist/fesm2022/embedpdf-angular-runtime.mjs +6 -6
- package/dist/fesm2022/embedpdf-angular-runtime.mjs.map +1 -1
- package/dist/fesm2022/embedpdf-angular-stage.mjs +39 -177
- package/dist/fesm2022/embedpdf-angular-stage.mjs.map +1 -1
- package/dist/fesm2022/embedpdf-angular.mjs +1 -0
- package/dist/fesm2022/embedpdf-angular.mjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/runtime/index.d.ts +6 -5
- package/dist/stage/index.d.ts +17 -4
- package/package.json +13 -7
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { ActionUiAdapter } from '@embedpdf/plugin-actions';
|
|
2
|
+
export * from '@embedpdf/plugin-actions';
|
|
3
|
+
|
|
4
|
+
/** Override any subset of the default adapter policy. */
|
|
5
|
+
type ActionsUiHandlers = Partial<ActionUiAdapter>;
|
|
6
|
+
/**
|
|
7
|
+
* Angular's spelling of React's `useActionsUiAdapter` (the `use*` →
|
|
8
|
+
* `inject*` law): installs the UI adapter for the active document's action
|
|
9
|
+
* dispatcher. The DEFAULT policy — the origin×phase visibility matrix,
|
|
10
|
+
* sanitizeExternalUri URI opens, browser print/alert fallbacks — is
|
|
11
|
+
* `@embedpdf/web`'s `createDefaultActionsUiAdapter`, written ONCE for every
|
|
12
|
+
* binding; this function is Angular glue only. The doc.print AUTHORITY gate
|
|
13
|
+
* is upstream (the actions plugin) and not overridable.
|
|
14
|
+
*
|
|
15
|
+
* Must run in an injection context (a constructor or field initializer —
|
|
16
|
+
* the runtime `inject*` constraint). Pass a FUNCTION for late-bound
|
|
17
|
+
* handlers; signal reads inside it are NOT tracked (the adapter consults it
|
|
18
|
+
* per effect, the same contract as React's handlers ref). Installing an
|
|
19
|
+
* adapter releases the document-open sequence latch, exactly as in React.
|
|
20
|
+
*/
|
|
21
|
+
declare function injectActionsUiAdapter(handlers?: ActionsUiHandlers | (() => ActionsUiHandlers | undefined)): void;
|
|
22
|
+
|
|
23
|
+
export { injectActionsUiAdapter };
|
|
24
|
+
export type { ActionsUiHandlers };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ActionsToken } from '@embedpdf/plugin-actions';
|
|
2
|
+
export * from '@embedpdf/plugin-actions';
|
|
3
|
+
import { effect } from '@angular/core';
|
|
4
|
+
import { StageToken } from '@embedpdf/plugin-stage/contract';
|
|
5
|
+
import { createDefaultActionsUiAdapter } from '@embedpdf/web';
|
|
6
|
+
import { injectOptionalCapability } from '@embedpdf/angular/runtime';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Angular's spelling of React's `useActionsUiAdapter` (the `use*` →
|
|
10
|
+
* `inject*` law): installs the UI adapter for the active document's action
|
|
11
|
+
* dispatcher. The DEFAULT policy — the origin×phase visibility matrix,
|
|
12
|
+
* sanitizeExternalUri URI opens, browser print/alert fallbacks — is
|
|
13
|
+
* `@embedpdf/web`'s `createDefaultActionsUiAdapter`, written ONCE for every
|
|
14
|
+
* binding; this function is Angular glue only. The doc.print AUTHORITY gate
|
|
15
|
+
* is upstream (the actions plugin) and not overridable.
|
|
16
|
+
*
|
|
17
|
+
* Must run in an injection context (a constructor or field initializer —
|
|
18
|
+
* the runtime `inject*` constraint). Pass a FUNCTION for late-bound
|
|
19
|
+
* handlers; signal reads inside it are NOT tracked (the adapter consults it
|
|
20
|
+
* per effect, the same contract as React's handlers ref). Installing an
|
|
21
|
+
* adapter releases the document-open sequence latch, exactly as in React.
|
|
22
|
+
*/
|
|
23
|
+
function injectActionsUiAdapter(handlers) {
|
|
24
|
+
const actions = injectOptionalCapability(ActionsToken);
|
|
25
|
+
const stage = injectOptionalCapability(StageToken);
|
|
26
|
+
const overrides = typeof handlers === 'function' ? handlers : () => handlers;
|
|
27
|
+
effect((onCleanup) => {
|
|
28
|
+
const capability = actions();
|
|
29
|
+
const stageCapability = stage();
|
|
30
|
+
if (!capability)
|
|
31
|
+
return; // no document yet — nothing to drive
|
|
32
|
+
const adapter = createDefaultActionsUiAdapter({
|
|
33
|
+
overrides,
|
|
34
|
+
goToPage: (page) => stageCapability?.goToPage(page),
|
|
35
|
+
});
|
|
36
|
+
// Identity-safe by construction (the plugin's disposer only clears the
|
|
37
|
+
// slot while THIS adapter is still current).
|
|
38
|
+
onCleanup(capability.setUiAdapter(adapter));
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @embedpdf/angular/actions — the action engine's UI port, Angular
|
|
44
|
+
* spelling. `injectActionsUiAdapter()` installs the SHARED default policy
|
|
45
|
+
* (`@embedpdf/web`'s `createDefaultActionsUiAdapter` — the same
|
|
46
|
+
* origin×phase matrix React ships, written once so the two bindings can
|
|
47
|
+
* never drift).
|
|
48
|
+
*/
|
|
49
|
+
// One-line-per-feature: registration travels with the UI.
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Generated bundle index. Do not edit.
|
|
53
|
+
*/
|
|
54
|
+
|
|
55
|
+
export { injectActionsUiAdapter };
|
|
56
|
+
//# sourceMappingURL=embedpdf-angular-actions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"embedpdf-angular-actions.mjs","sources":["../../actions/src/actions-adapter.ts","../../actions/src/public_api.ts","../../actions/src/embedpdf-angular-actions.ts"],"sourcesContent":["import { effect } from '@angular/core';\nimport { ActionsToken, type ActionUiAdapter } from '@embedpdf/plugin-actions';\nimport { StageToken } from '@embedpdf/plugin-stage/contract';\nimport { createDefaultActionsUiAdapter } from '@embedpdf/web';\n\nimport { injectOptionalCapability } from '@embedpdf/angular/runtime';\n\n/** Override any subset of the default adapter policy. */\nexport type ActionsUiHandlers = Partial<ActionUiAdapter>;\n\n/**\n * Angular's spelling of React's `useActionsUiAdapter` (the `use*` →\n * `inject*` law): installs the UI adapter for the active document's action\n * dispatcher. The DEFAULT policy — the origin×phase visibility matrix,\n * sanitizeExternalUri URI opens, browser print/alert fallbacks — is\n * `@embedpdf/web`'s `createDefaultActionsUiAdapter`, written ONCE for every\n * binding; this function is Angular glue only. The doc.print AUTHORITY gate\n * is upstream (the actions plugin) and not overridable.\n *\n * Must run in an injection context (a constructor or field initializer —\n * the runtime `inject*` constraint). Pass a FUNCTION for late-bound\n * handlers; signal reads inside it are NOT tracked (the adapter consults it\n * per effect, the same contract as React's handlers ref). Installing an\n * adapter releases the document-open sequence latch, exactly as in React.\n */\nexport function injectActionsUiAdapter(\n handlers?: ActionsUiHandlers | (() => ActionsUiHandlers | undefined),\n): void {\n const actions = injectOptionalCapability(ActionsToken);\n const stage = injectOptionalCapability(StageToken);\n const overrides = typeof handlers === 'function' ? handlers : (): typeof handlers => handlers;\n effect((onCleanup) => {\n const capability = actions();\n const stageCapability = stage();\n if (!capability) return; // no document yet — nothing to drive\n const adapter: ActionUiAdapter = createDefaultActionsUiAdapter({\n overrides,\n goToPage: (page) => stageCapability?.goToPage(page),\n });\n // Identity-safe by construction (the plugin's disposer only clears the\n // slot while THIS adapter is still current).\n onCleanup(capability.setUiAdapter(adapter));\n });\n}\n","/**\n * @embedpdf/angular/actions — the action engine's UI port, Angular\n * spelling. `injectActionsUiAdapter()` installs the SHARED default policy\n * (`@embedpdf/web`'s `createDefaultActionsUiAdapter` — the same\n * origin×phase matrix React ships, written once so the two bindings can\n * never drift).\n */\n\n// One-line-per-feature: registration travels with the UI.\nexport * from '@embedpdf/plugin-actions';\nexport * from './actions-adapter';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;AAUA;;;;;;;;;;;;;;AAcG;AACG,SAAU,sBAAsB,CACpC,QAAoE,EAAA;AAEpE,IAAA,MAAM,OAAO,GAAG,wBAAwB,CAAC,YAAY,CAAC;AACtD,IAAA,MAAM,KAAK,GAAG,wBAAwB,CAAC,UAAU,CAAC;AAClD,IAAA,MAAM,SAAS,GAAG,OAAO,QAAQ,KAAK,UAAU,GAAG,QAAQ,GAAG,MAAuB,QAAQ;AAC7F,IAAA,MAAM,CAAC,CAAC,SAAS,KAAI;AACnB,QAAA,MAAM,UAAU,GAAG,OAAO,EAAE;AAC5B,QAAA,MAAM,eAAe,GAAG,KAAK,EAAE;AAC/B,QAAA,IAAI,CAAC,UAAU;AAAE,YAAA,OAAO;QACxB,MAAM,OAAO,GAAoB,6BAA6B,CAAC;YAC7D,SAAS;YACT,QAAQ,EAAE,CAAC,IAAI,KAAK,eAAe,EAAE,QAAQ,CAAC,IAAI,CAAC;AACpD,SAAA,CAAC;;;QAGF,SAAS,CAAC,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;AAC7C,IAAA,CAAC,CAAC;AACJ;;AC3CA;;;;;;AAMG;AAEH;;ACRA;;AAEG;;;;"}
|
|
@@ -437,7 +437,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
|
|
|
437
437
|
* Never rebuild the context or the injector per frame.
|
|
438
438
|
*
|
|
439
439
|
* Coordinate math lives in `@embedpdf/core-geometry`'s `PageTransform` — verified
|
|
440
|
-
* once, not re-derived per framework adapter (`
|
|
440
|
+
* once, not re-derived per framework adapter (`toContentPoint` mirrors React's
|
|
441
441
|
* `makePageContext` exactly).
|
|
442
442
|
*/
|
|
443
443
|
const EPDF_PAGE = new InjectionToken('EPDF_PAGE');
|
|
@@ -462,22 +462,22 @@ function createPageContext(parts) {
|
|
|
462
462
|
pageIndex: parts.pageIndex,
|
|
463
463
|
frame: parts.frame,
|
|
464
464
|
transform,
|
|
465
|
-
|
|
465
|
+
toContentPoint: (clientX, clientY) => {
|
|
466
466
|
// Client → box-local view px, then invert rotation + scale via the
|
|
467
467
|
// transform (verified once in geometry, not re-derived per adapter).
|
|
468
468
|
const r = getRect();
|
|
469
|
-
return transform().
|
|
469
|
+
return transform().viewToContent({ x: clientX - r.left, y: clientY - r.top });
|
|
470
470
|
},
|
|
471
471
|
toClientPoint: (p) => {
|
|
472
|
-
// Exact inverse of `
|
|
472
|
+
// Exact inverse of `toContentPoint`, offset by the same live display-box
|
|
473
473
|
// origin — the two can never drift.
|
|
474
474
|
const r = getRect();
|
|
475
|
-
const v = transform().
|
|
475
|
+
const v = transform().contentToView(p);
|
|
476
476
|
return { x: r.left + v.x, y: r.top + v.y };
|
|
477
477
|
},
|
|
478
478
|
toClientRect: (rect) => {
|
|
479
479
|
const r = getRect();
|
|
480
|
-
const v = transform().
|
|
480
|
+
const v = transform().contentToViewRect(rect);
|
|
481
481
|
return { x: r.left + v.x, y: r.top + v.y, width: v.width, height: v.height };
|
|
482
482
|
},
|
|
483
483
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embedpdf-angular-runtime.mjs","sources":["../../runtime/src/kernel-host.ts","../../runtime/src/tokens.ts","../../runtime/src/inject.ts","../../runtime/src/scope.ts","../../runtime/src/viewer.ts","../../runtime/src/page-context.ts","../../runtime/src/public_api.ts","../../runtime/src/embedpdf-angular-runtime.ts"],"sourcesContent":["/**\n * The kernel host — one service owns the kernel; ONE tick signal bridges the\n * kernel's single change stream into Angular's signal graph. Everything else in\n * this adapter is `computed()` over it (`value()` is Angular's `useKernelValue`).\n *\n * Two hosting modes share this class:\n * component-hosted `<epdf-viewer [engine] [plugins]>` (framework parity)\n * provider-hosted `provideEmbedPdf({...})` at route/app level\n *\n * CONSTRUCTION RULE (library law): nothing may read `host.kernel` while a\n * component is being CONSTRUCTED. Component-hosted configs resolve their inputs\n * lazily, so the kernel materializes on first real read (a template binding, an\n * effect) — after inputs are set. Every inject* primitive returns signals or\n * lazy methods and therefore respects this for free; only the raw\n * `injectKernel()` escape hatch can violate it (its doc says so).\n *\n * SSR CONTRACT: the EmbedPDF subtree is browser-only. On the server the host\n * never boots and any `kernel` read throws — wrap the viewer region in `@defer`\n * (which renders its placeholder on the server) or a platform-guarded `@if`.\n */\nimport {\n computed,\n inject,\n Injectable,\n makeEnvironmentProviders,\n PLATFORM_ID,\n signal,\n type EnvironmentProviders,\n type OnDestroy,\n type Signal,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { createKernel } from '@embedpdf/core';\nimport type {\n AnyPlugin,\n Engine,\n EngineFactory,\n InitialDocument,\n Kernel,\n Unsubscribe,\n} from '@embedpdf/core';\n\n/** One boot document — the KERNEL's shared `InitialDocument` shape (same as\n * the React adapter's), aliased under the package's Epdf naming. */\nexport type EpdfInitialDocument = InitialDocument;\n\nexport interface EmbedPdfConfig {\n /**\n * The engine, as an instance or a thunk. Engines construct synchronously and\n * boot lazily (`localEngine()` allocates nothing until first use), so\n * ownership follows the SHAPE of what you pass:\n *\n * - An **instance** is BORROWED: used as-is, never destroyed here. The\n * common path — a module-scope `const engine = localEngine()` shared\n * across viewers and route changes. The host calls `engine.warmup?.()`\n * when the kernel materializes so the boot overlaps initialization.\n * - A **thunk** (`() => localEngine()`) is HOST-OWNED: the host calls it\n * when the kernel materializes and `destroy()`s the result on teardown.\n * Use it for per-host isolation.\n *\n * Init-only: the kernel is never rebuilt for a new engine — tear the host\n * down (destroy the viewer / injector) and create a new one.\n */\n engine: Engine | EngineFactory;\n /** Init-only, like `engine`. */\n plugins: AnyPlugin[];\n /** Documents to open on startup (with optional tab names). They open in the\n * BACKGROUND after start and stream into the registry — `injectDocuments()`\n * is reactive; per-document loading UI is the Stage's job. A source that\n * fails to open lands in `error` and does NOT block the ones after it. */\n initialDocuments?: EpdfInitialDocument[];\n}\n\n/** `starting` covers construction through `kernel.start()`; `ready` means the\n * workspace is live (documents may still be opening in the background). */\nexport type EpdfKernelStatus = 'starting' | 'ready' | 'error';\n\n@Injectable()\nexport class EpdfKernelHost implements OnDestroy {\n private readonly browser = isPlatformBrowser(inject(PLATFORM_ID));\n private config: (() => EmbedPdfConfig) | null = null;\n private _kernel: Kernel | null = null;\n /** The engine backing the kernel, and whether WE created it (a recipe) and\n * therefore must destroy it. A borrowed instance is left untouched. */\n private _engine: Engine | null = null;\n private ownsEngine = false;\n private unsubscribe: Unsubscribe | null = null;\n private initialDocuments: EpdfInitialDocument[] | undefined;\n private booted = false;\n private destroyed = false;\n\n /** Bumped on every kernel notification — THE bridge from kernel-world to signals. */\n private readonly tick = signal(0);\n\n /** Boot lifecycle. `ready`/`error` are derived sugar over it. */\n readonly status = signal<EpdfKernelStatus>('starting');\n /** The STARTUP failure, if any. Per-document open failures are tab state\n * (`DocInfo.status === 'error'`), not host state. */\n readonly error = signal<unknown>(null);\n /** True once `kernel.start()` resolved — which never touches the engine, so\n * the shell (and every workspace capability: i18n, view-manager, …) is alive\n * while WASM compiles or the transport connects. Workspace chrome may render\n * before this; gate on it (or on the document gate) where it matters. */\n readonly ready: Signal<boolean> = computed(() => this.status() === 'ready');\n\n /** Register the (deferred) config. Called exactly once, by `EpdfViewer`'s\n * constructor or `provideEmbedPdf`'s factory. */\n connect(config: () => EmbedPdfConfig): void {\n if (this.config || this._kernel) {\n throw new Error('[embedpdf] kernel already configured for this injector');\n }\n this.config = config;\n }\n\n /** The kernel — materialized on first read (see the construction rule above). */\n get kernel(): Kernel {\n if (!this._kernel) {\n if (!this.browser) {\n throw new Error(\n '[embedpdf] the viewer does not render on the server — wrap the EmbedPDF subtree in @defer (its placeholder renders during SSR) or a browser-only @if',\n );\n }\n if (!this.config) {\n throw new Error(\n '[embedpdf] no kernel: wrap this subtree in <epdf-viewer> or add provideEmbedPdf(...) to your providers',\n );\n }\n const { engine, plugins, initialDocuments } = this.config();\n // A thunk is host-owned: call it now, destroy on teardown. An instance is\n // borrowed and left untouched. Either way construction is synchronous and\n // inert (engines boot lazily on first use).\n this.ownsEngine = typeof engine === 'function';\n this._engine = this.ownsEngine ? (engine as EngineFactory)() : (engine as Engine);\n try {\n this._kernel = createKernel({ engine: this._engine, plugins });\n } catch (error) {\n // ngOnDestroy() only tears down via `_kernel`, which stays null on this\n // path — so an owned engine must be destroyed HERE or it leaks.\n if (this.ownsEngine) void this._engine.destroy();\n this._engine = null;\n this.ownsEngine = false;\n throw error;\n }\n // Warm up only once the kernel exists (a plugin-planning throw must not\n // start a boot we'd immediately have to unwind) — `warmup()` overlaps the\n // WASM/transport boot with the rest of initialization.\n this._engine.warmup?.();\n this.initialDocuments = initialDocuments;\n this.unsubscribe = this._kernel.subscribe(() => this.tick.update((n) => n + 1));\n }\n return this._kernel;\n }\n\n /** Start the kernel and open initial documents in the background. Idempotent;\n * a no-op on the server and after destroy. */\n boot(): void {\n if (this.booted || this.destroyed || !this.browser) return;\n this.booted = true;\n const kernel = this.kernel;\n void (async () => {\n try {\n await kernel.start();\n } catch (err) {\n if (!this.destroyed) {\n this.error.set(err);\n this.status.set('error');\n }\n return;\n }\n if (this.destroyed) return;\n this.status.set('ready');\n // Kernel-owned boot policy: all tabs appear immediately in array order;\n // the `active` entry (else the first) is selected; per-document\n // failures surface as that tab's `error`/`locked` status (this host's\n // `error` signal reports only startup failures).\n kernel.documents.openAll(this.initialDocuments ?? []);\n })();\n }\n\n /** Read a value derived from the kernel, cached by equality — Angular's\n * `useKernelValue`. The selector re-runs per kernel notification (cheap);\n * `equal` decides whether dependents ever see it. */\n value<R>(select: (kernel: Kernel) => R, equal: (a: R, b: R) => boolean = Object.is): Signal<R> {\n return computed(\n () => {\n this.tick();\n return select(this.kernel);\n },\n { equal },\n );\n }\n\n ngOnDestroy(): void {\n if (this.destroyed) return;\n this.destroyed = true;\n this.unsubscribe?.();\n // destroy() owns the full teardown now: it joins an in-flight start, closes\n // every document (engine handles included), and unwinds workspace plugins.\n // Async + idempotent, so fire-and-forget is safe in a sync ngOnDestroy.\n // Then destroy the engine IF we own it (a thunk) — kernel first so handles\n // close before the engine goes; `engine.destroy()` joins any in-flight\n // boot or no-ops if it never started.\n if (this._kernel) {\n const engine = this._engine;\n const owns = this.ownsEngine;\n void this._kernel.destroy().then(() => {\n if (owns && engine) void engine.destroy();\n });\n }\n }\n}\n\n/**\n * Host the kernel in an environment injector (route or application providers).\n * The kernel's lifetime is the injector's — a route-level workspace tears down\n * when the route does. Unlocks chrome OUTSIDE any viewer subtree: a toolbar in\n * the app header and the stage in the main outlet share this one kernel.\n */\nexport function provideEmbedPdf(config: EmbedPdfConfig): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: EpdfKernelHost,\n useFactory: () => {\n const host = new EpdfKernelHost();\n host.connect(() => config);\n host.boot();\n return host;\n },\n },\n ]);\n}\n","/**\n * DI tokens shared by the runtime's primitives and directives — split out so\n * `inject.ts` (consumers) and `scope.ts` (providers) never import each other.\n */\nimport { InjectionToken, type Signal } from '@angular/core';\n\n/** The document a subtree is bound to (provided by `[epdfDocumentScope]`).\n * Absent => the subtree follows the ACTIVE document. */\nexport interface EpdfDocumentScopeRef {\n readonly id: Signal<string>;\n}\n\nexport const EPDF_DOCUMENT_SCOPE = new InjectionToken<EpdfDocumentScopeRef>('EPDF_DOCUMENT_SCOPE');\n","/**\n * The inject* primitives — Angular's spelling of the React runtime hooks\n * (`use*` → `inject*`, plain values → signals, same names otherwise).\n *\n * All of them must run in an injection context (a constructor / field\n * initializer, like `inject()` itself). None of them read `host.kernel` during\n * construction — they return signals or lazy methods, so they are safe in\n * component-hosted mode where the kernel materializes after construction.\n */\nimport { computed, inject, type Signal } from '@angular/core';\nimport { docInfoListEquals } from '@embedpdf/core';\nimport type { CapabilityToken, DocInfo, Kernel } from '@embedpdf/core';\nimport { EpdfKernelHost } from './kernel-host';\nimport { EPDF_DOCUMENT_SCOPE } from './tokens';\n\nexport const shallowArray = <T>(a: readonly T[], b: readonly T[]): boolean =>\n a === b || (a.length === b.length && a.every((x, i) => x === b[i]));\n\nexport function injectKernelHost(): EpdfKernelHost {\n const host = inject(EpdfKernelHost, { optional: true });\n if (!host) {\n throw new Error(\n '[embedpdf] no kernel: wrap this subtree in <epdf-viewer> or add provideEmbedPdf(...) to your providers',\n );\n }\n return host;\n}\n\n/** The raw kernel — materializes it immediately. Do NOT call while a component\n * is being constructed in component-hosted mode (inputs are not set yet);\n * prefer the signal-returning primitives, which defer the first kernel read. */\nexport function injectKernel(): Kernel {\n return injectKernelHost().kernel;\n}\n\n/** Read a value derived from the kernel, cached by equality — `useKernelValue`. */\nexport function injectKernelValue<R>(\n select: (kernel: Kernel) => R,\n equal?: (a: R, b: R) => boolean,\n): Signal<R> {\n return injectKernelHost().value(select, equal);\n}\n\nexport function injectActiveDocumentId(): Signal<string | null> {\n return injectKernelValue((k) => k.documents.activeId());\n}\n\n/** The document id for this injector subtree: the nearest `[epdfDocumentScope]`,\n * else the active document. */\nexport function injectDocumentId(): Signal<string | null> {\n const scope = inject(EPDF_DOCUMENT_SCOPE, { optional: true });\n const active = injectActiveDocumentId();\n return computed(() => scope?.id() ?? active());\n}\n\n/**\n * Resolve a capability against a REACTIVE token — for components that take the\n * token as an input (`injectCapability` is the fixed-token sugar). Resolution\n * is a REACTIVE read (`tryCapability` through the kernel's one change\n * stream), not a computed over the document id — under the request-time\n * lifecycle a document can become resolvable while its id stays the same, so\n * any id-keyed cache goes stale; subscribing makes staleness structurally\n * impossible. Fail-fast like React's `useCapability`: while unresolvable,\n * this re-runs the strict resolver so the kernel's truthful reason (`no\n * capability` / `no document` / `document is loading|locked`) is what throws.\n */\nexport function injectCapabilityFor<T>(token: () => CapabilityToken<T>): Signal<T> {\n const host = injectKernelHost();\n const scope = inject(EPDF_DOCUMENT_SCOPE, { optional: true });\n const cap = host.value((k) => k.tryCapability(token(), scope?.id() ?? undefined));\n return computed(() => cap() ?? host.kernel.capability(token(), scope?.id() ?? undefined));\n}\n\nexport function injectCapability<T>(token: CapabilityToken<T>): Signal<T> {\n return injectCapabilityFor(() => token);\n}\n\n/** Like `injectCapabilityFor`, but null while the token can't resolve (no\n * plugin, no document, or a document that isn't ready yet). */\nexport function injectOptionalCapabilityFor<T>(token: () => CapabilityToken<T>): Signal<T | null> {\n const host = injectKernelHost();\n const scope = inject(EPDF_DOCUMENT_SCOPE, { optional: true });\n return host.value((k) => k.tryCapability(token(), scope?.id() ?? undefined));\n}\n\nexport function injectOptionalCapability<T>(token: CapabilityToken<T>): Signal<T | null> {\n return injectOptionalCapabilityFor(() => token);\n}\n\n/** Subscribe to a selector over a (document-resolved) capability. */\nexport function injectSelectorFor<C, R>(\n token: () => CapabilityToken<C>,\n select: (cap: C) => R,\n equal?: (a: R, b: R) => boolean,\n): Signal<R> {\n const host = injectKernelHost();\n const cap = injectCapabilityFor(token);\n return host.value(() => select(cap()), equal);\n}\n\nexport function injectSelector<C, R>(\n token: CapabilityToken<C>,\n select: (cap: C) => R,\n equal?: (a: R, b: R) => boolean,\n): Signal<R> {\n return injectSelectorFor(() => token, select, equal);\n}\n\n/**\n * Null-safe `injectSelector`: `fallback` whenever the token can't resolve — no\n * provider, or a document-scoped token with no document. For chrome that stays\n * mounted across the empty-workspace state (a zoom readout, a mode band).\n * `injectSelector` stays strict (fail-fast) for code that KNOWS a document\n * exists — e.g. anything behind the document gate.\n *\n * The `select` guard also swallows reads through a capability whose document\n * closed between the store notification and this read — that teardown race\n * resolves to `fallback` for one frame, then recomputes against the new state.\n */\nexport function injectOptionalSelectorFor<C, R>(\n token: () => CapabilityToken<C>,\n select: (cap: C) => R,\n fallback: R,\n equal?: (a: R, b: R) => boolean,\n): Signal<R> {\n const host = injectKernelHost();\n const cap = injectOptionalCapabilityFor(token);\n return host.value(() => {\n const c = cap();\n if (c === null) return fallback;\n try {\n return select(c);\n } catch {\n return fallback;\n }\n }, equal);\n}\n\nexport function injectOptionalSelector<C, R>(\n token: CapabilityToken<C>,\n select: (cap: C) => R,\n fallback: R,\n equal?: (a: R, b: R) => boolean,\n): Signal<R> {\n return injectOptionalSelectorFor(() => token, select, fallback, equal);\n}\n\n/** The document registry (open/close/active/list), reactive — `useDocuments`.\n * Methods late-bind the kernel, so this is construction-safe. */\nexport interface EpdfDocuments {\n docs: Signal<DocInfo[]>;\n activeId: Signal<string | null>;\n open: Kernel['documents']['open'];\n unlock: Kernel['documents']['unlock'];\n close: Kernel['documents']['close'];\n setActive: Kernel['documents']['setActive'];\n move: Kernel['documents']['move'];\n swap: Kernel['documents']['swap'];\n download: Kernel['documents']['download'];\n downloadLayer: Kernel['documents']['downloadLayer'];\n}\n\nexport function injectDocuments(): EpdfDocuments {\n const host = injectKernelHost();\n return {\n docs: host.value((k) => k.documents.list(), docInfoListEquals),\n activeId: host.value((k) => k.documents.activeId()),\n open: (input, options) => host.kernel.documents.open(input, options),\n unlock: (id, input) => host.kernel.documents.unlock(id, input),\n close: (id) => host.kernel.documents.close(id),\n setActive: (id) => host.kernel.documents.setActive(id),\n move: (id, toIndex) => host.kernel.documents.move(id, toIndex),\n swap: (a, b) => host.kernel.documents.swap(a, b),\n download: (id, opts) => host.kernel.documents.download(id, opts),\n downloadLayer: (id) => host.kernel.documents.downloadLayer(id),\n };\n}\n","/**\n * Document scoping — hierarchical DI is Angular's native React-context.\n *\n * `[epdfDocumentScope]` binds a subtree to a SPECIFIC document (panes,\n * comparison); `*epdfDocumentGate` renders a subtree only WHILE it has one.\n * The gate is a structural directive on purpose: a template genuinely defers\n * creation, which a conditional `<ng-content>` slot cannot (Angular\n * instantiates projected content eagerly). Document-scoped UI — the Stage,\n * zoom/page controls, panels — belongs behind it (or behind the app's own\n * `@if (documentId())`); workspace chrome lives outside it.\n */\nimport {\n computed,\n Directive,\n effect,\n forwardRef,\n inject,\n input,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { injectDocumentId } from './inject';\nimport { EPDF_DOCUMENT_SCOPE, type EpdfDocumentScopeRef } from './tokens';\n\n@Directive({\n selector: '[epdfDocumentScope]',\n standalone: true,\n providers: [{ provide: EPDF_DOCUMENT_SCOPE, useExisting: forwardRef(() => EpdfDocumentScope) }],\n})\nexport class EpdfDocumentScope implements EpdfDocumentScopeRef {\n readonly id = input.required<string>({ alias: 'epdfDocumentScope' });\n}\n\n/**\n * Render the host template only while this subtree has a document — the\n * structural way to say \"this UI is defined over a document\". Sibling of\n * `[epdfDocumentScope]`, which picks WHICH document; this one handles WHETHER.\n *\n * <section *epdfDocumentGate=\"; fallback: empty\">…document UI…</section>\n * <ng-template #empty>Drop a PDF to get started</ng-template>\n *\n * The subtree stays mounted across a CHANGE of document (active-tab switch) —\n * only the has-a-document boolean creates/destroys it.\n */\n@Directive({ selector: '[epdfDocumentGate]', standalone: true })\nexport class EpdfDocumentGate {\n /** Shown while this subtree has NO document (empty workspace, docs still opening). */\n readonly fallback = input<TemplateRef<unknown> | null>(null, {\n alias: 'epdfDocumentGateFallback',\n });\n\n constructor() {\n const docId = injectDocumentId();\n const hasDocument = computed(() => docId() !== null);\n const container = inject(ViewContainerRef);\n const content = inject<TemplateRef<unknown>>(TemplateRef);\n effect(() => {\n container.clear();\n if (hasDocument()) {\n container.createEmbeddedView(content);\n } else {\n // `fallback` is only tracked while gated — swapping fallback templates\n // never recreates live document UI.\n const fallbackTemplate = this.fallback();\n if (fallbackTemplate) container.createEmbeddedView(fallbackTemplate);\n }\n });\n }\n}\n","/**\n * `<epdf-viewer>` — component-hosted kernel (framework parity with React's\n * `<Viewer>`). Provides `EpdfKernelHost` at its element injector, boots it, and\n * projects content UNCONDITIONALLY: it is NOT a gate. Angular instantiates\n * projected content eagerly whether or not a slot renders it, so a conditional\n * `<ng-content>` cannot defer anything — real gating belongs to templates the\n * APP owns: `@if (ready())` for boot chrome, `*epdfDocumentGate` (or\n * `@if (documentId())`) for document UI.\n *\n * Prefer `provideEmbedPdf(...)` at route/app level when chrome lives outside\n * one subtree; this component is sugar over the same host.\n */\nimport { ChangeDetectionStrategy, Component, inject, input, type OnInit } from '@angular/core';\nimport type { AnyPlugin, Engine, EngineFactory } from '@embedpdf/core';\nimport { EpdfKernelHost, type EpdfInitialDocument } from './kernel-host';\n\n@Component({\n selector: 'epdf-viewer',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [EpdfKernelHost],\n // Layout-transparent, like React's element-less <Viewer>.\n host: { style: 'display: contents;' },\n template: `<ng-content />`,\n})\nexport class EpdfViewer implements OnInit {\n /** The engine, as an instance OR a thunk ({@link EngineFactory}). An\n * instance is borrowed (never destroyed here); a thunk is host-owned\n * (constructed then destroyed with the viewer). See EmbedPdfConfig.\n * Init-only: the kernel is built once from the first values; recreate the\n * viewer (e.g. with @if) to swap it. */\n readonly engine = input.required<Engine | EngineFactory>();\n readonly plugins = input.required<AnyPlugin[]>();\n readonly initialDocuments = input<EpdfInitialDocument[]>();\n\n /** The host this viewer provides — exposed so a template reference can read\n * `viewer.host.ready()` / `.status()` without extra imports. */\n readonly host = inject(EpdfKernelHost, { self: true });\n\n constructor() {\n // Deferred config: inputs are READ on first kernel access, which happens\n // after construction (a template binding or effect) — never here.\n this.host.connect(() => ({\n engine: this.engine(),\n plugins: this.plugins(),\n initialDocuments: this.initialDocuments(),\n }));\n }\n\n ngOnInit(): void {\n // Inputs are set by now; materializes the kernel and starts it (no-op on\n // the server — the SSR contract lives on the host).\n this.host.boot();\n }\n}\n","/**\n * PageContext — the seam. A layer depends ONLY on this, never on the Stage, so\n * the same layer works inside a virtualized `<epdf-stage>` page and a future\n * standalone `<epdf-page-view>`.\n *\n * THE STABILITY INVARIANT (the one performance rule of this adapter): a page's\n * context is ONE STABLE OBJECT per mounted surface — identity never changes;\n * the volatile parts (`transform`, `frame`, `pageIndex`) are signals INSIDE it.\n * The per-page injector providing `EPDF_PAGE` is likewise created once. Camera\n * frames then flow as signal writes — `NgTemplateOutlet` never recreates the\n * embedded views, in-flight renders survive, and updates stay per-binding.\n * Never rebuild the context or the injector per frame.\n *\n * Coordinate math lives in `@embedpdf/core-geometry`'s `PageTransform` — verified\n * once, not re-derived per framework adapter (`toPagePoint` mirrors React's\n * `makePageContext` exactly).\n */\nimport { InjectionToken, inject, type Signal } from '@angular/core';\nimport type { PageFrame, PageTransform, Point, Rect } from '@embedpdf/core-geometry';\n\nexport interface EpdfPageContext {\n readonly documentId: string;\n /** Durable page identity (PDF object number) — use for keys / render / annotations. */\n readonly pon: number;\n /** Display index (page N) — can shift under page reorders, hence a signal. */\n readonly pageIndex: Signal<number>;\n /** Reserved chrome bands around the page (screen px per side). */\n readonly frame: Signal<PageFrame>;\n /** The single bridge between PDF points, view px, and device px for this\n * page. Layers do ALL coordinate work through it — never re-derive\n * `x * scale` or `* dpr`. Updates per camera frame. */\n readonly transform: Signal<PageTransform>;\n /** Client (screen) point → PDF point — the one platform-bound hit-test. */\n toPagePoint(clientX: number, clientY: number): Point;\n /** PDF/content point → client (screen) px — the exact inverse of `toPagePoint`. */\n toClientPoint(p: Point): Point;\n /** PDF/content rect → client (screen) px AABB. */\n toClientRect(rect: Rect): Rect;\n}\n\nexport const EPDF_PAGE = new InjectionToken<EpdfPageContext>('EPDF_PAGE');\n\nexport function injectPage(): EpdfPageContext {\n const page = inject(EPDF_PAGE, { optional: true });\n if (!page) {\n throw new Error('[embedpdf] injectPage() must be used inside an <epdf-stage> page template');\n }\n return page;\n}\n\n/** Build a page context from its reactive parts. `documentId`/`pon` are thunks\n * because inputs aren't readable at construction — both are stable per surface. */\nexport function createPageContext(parts: {\n documentId: () => string;\n pon: () => number;\n pageIndex: Signal<number>;\n frame: Signal<PageFrame>;\n transform: Signal<PageTransform>;\n /** The rotated content wrapper's LIVE bounding box (the page's display box). */\n getRect: () => DOMRect;\n}): EpdfPageContext {\n const { transform, getRect } = parts;\n return {\n get documentId() {\n return parts.documentId();\n },\n get pon() {\n return parts.pon();\n },\n pageIndex: parts.pageIndex,\n frame: parts.frame,\n transform,\n toPagePoint: (clientX, clientY) => {\n // Client → box-local view px, then invert rotation + scale via the\n // transform (verified once in geometry, not re-derived per adapter).\n const r = getRect();\n return transform().viewToPage({ x: clientX - r.left, y: clientY - r.top });\n },\n toClientPoint: (p) => {\n // Exact inverse of `toPagePoint`, offset by the same live display-box\n // origin — the two can never drift.\n const r = getRect();\n const v = transform().pageToView(p);\n return { x: r.left + v.x, y: r.top + v.y };\n },\n toClientRect: (rect) => {\n const r = getRect();\n const v = transform().pageToViewRect(rect);\n return { x: r.left + v.x, y: r.top + v.y, width: v.width, height: v.height };\n },\n };\n}\n","/**\n * @embedpdf/angular/runtime — the trunk: the generic kernel binding.\n *\n * Binds the kernel's one change stream to Angular signals (one tick signal +\n * computed), resolves capabilities (document-scoped ones against the active or\n * `[epdfDocumentScope]`-given document), and provides the page context seam.\n * Every feature entry point and layer rides on this — there is no per-plugin\n * framework code.\n */\n\n// One-line-per-feature: registration travels with the UI.\nexport * from '@embedpdf/core';\nexport * from './kernel-host';\nexport * from './tokens';\nexport * from './inject';\nexport * from './scope';\nexport * from './viewer';\nexport * from './page-context';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;MA2DU,cAAc,CAAA;IACR,OAAO,GAAG,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACzD,MAAM,GAAkC,IAAI;IAC5C,OAAO,GAAkB,IAAI;AACrC;AACwE;IAChE,OAAO,GAAkB,IAAI;IAC7B,UAAU,GAAG,KAAK;IAClB,WAAW,GAAuB,IAAI;AACtC,IAAA,gBAAgB;IAChB,MAAM,GAAG,KAAK;IACd,SAAS,GAAG,KAAK;;AAGR,IAAA,IAAI,GAAG,MAAM,CAAC,CAAC,gDAAC;;AAGxB,IAAA,MAAM,GAAG,MAAM,CAAmB,UAAU,kDAAC;AACtD;AACsD;AAC7C,IAAA,KAAK,GAAG,MAAM,CAAU,IAAI,iDAAC;AACtC;;;AAG0E;AACjE,IAAA,KAAK,GAAoB,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,KAAK,OAAO,iDAAC;AAE3E;AACkD;AAClD,IAAA,OAAO,CAAC,MAA4B,EAAA;QAClC,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE;AAC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CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAC9E,CAAC;KACF;AACH;;AC3FA;;;;;;;;AAQG;AAEH;;ACVA;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"embedpdf-angular-runtime.mjs","sources":["../../runtime/src/kernel-host.ts","../../runtime/src/tokens.ts","../../runtime/src/inject.ts","../../runtime/src/scope.ts","../../runtime/src/viewer.ts","../../runtime/src/page-context.ts","../../runtime/src/public_api.ts","../../runtime/src/embedpdf-angular-runtime.ts"],"sourcesContent":["/**\n * The kernel host — one service owns the kernel; ONE tick signal bridges the\n * kernel's single change stream into Angular's signal graph. Everything else in\n * this adapter is `computed()` over it (`value()` is Angular's `useKernelValue`).\n *\n * Two hosting modes share this class:\n * component-hosted `<epdf-viewer [engine] [plugins]>` (framework parity)\n * provider-hosted `provideEmbedPdf({...})` at route/app level\n *\n * CONSTRUCTION RULE (library law): nothing may read `host.kernel` while a\n * component is being CONSTRUCTED. Component-hosted configs resolve their inputs\n * lazily, so the kernel materializes on first real read (a template binding, an\n * effect) — after inputs are set. Every inject* primitive returns signals or\n * lazy methods and therefore respects this for free; only the raw\n * `injectKernel()` escape hatch can violate it (its doc says so).\n *\n * SSR CONTRACT: the EmbedPDF subtree is browser-only. On the server the host\n * never boots and any `kernel` read throws — wrap the viewer region in `@defer`\n * (which renders its placeholder on the server) or a platform-guarded `@if`.\n */\nimport {\n computed,\n inject,\n Injectable,\n makeEnvironmentProviders,\n PLATFORM_ID,\n signal,\n type EnvironmentProviders,\n type OnDestroy,\n type Signal,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { createKernel } from '@embedpdf/core';\nimport type {\n AnyPlugin,\n Engine,\n EngineFactory,\n InitialDocument,\n Kernel,\n Unsubscribe,\n} from '@embedpdf/core';\n\n/** One boot document — the KERNEL's shared `InitialDocument` shape (same as\n * the React adapter's), aliased under the package's Epdf naming. */\nexport type EpdfInitialDocument = InitialDocument;\n\nexport interface EmbedPdfConfig {\n /**\n * The engine, as an instance or a thunk. Engines construct synchronously and\n * boot lazily (`localEngine()` allocates nothing until first use), so\n * ownership follows the SHAPE of what you pass:\n *\n * - An **instance** is BORROWED: used as-is, never destroyed here. The\n * common path — a module-scope `const engine = localEngine()` shared\n * across viewers and route changes. The host calls `engine.warmup?.()`\n * when the kernel materializes so the boot overlaps initialization.\n * - A **thunk** (`() => localEngine()`) is HOST-OWNED: the host calls it\n * when the kernel materializes and `destroy()`s the result on teardown.\n * Use it for per-host isolation.\n *\n * Init-only: the kernel is never rebuilt for a new engine — tear the host\n * down (destroy the viewer / injector) and create a new one.\n */\n engine: Engine | EngineFactory;\n /** Init-only, like `engine`. */\n plugins: AnyPlugin[];\n /** Documents to open on startup (with optional tab names). They open in the\n * BACKGROUND after start and stream into the registry — `injectDocuments()`\n * is reactive; per-document loading UI is the Stage's job. A source that\n * fails to open lands in `error` and does NOT block the ones after it. */\n initialDocuments?: EpdfInitialDocument[];\n}\n\n/** `starting` covers construction through `kernel.start()`; `ready` means the\n * workspace is live (documents may still be opening in the background). */\nexport type EpdfKernelStatus = 'starting' | 'ready' | 'error';\n\n@Injectable()\nexport class EpdfKernelHost implements OnDestroy {\n private readonly browser = isPlatformBrowser(inject(PLATFORM_ID));\n private config: (() => EmbedPdfConfig) | null = null;\n private _kernel: Kernel | null = null;\n /** The engine backing the kernel, and whether WE created it (a recipe) and\n * therefore must destroy it. A borrowed instance is left untouched. */\n private _engine: Engine | null = null;\n private ownsEngine = false;\n private unsubscribe: Unsubscribe | null = null;\n private initialDocuments: EpdfInitialDocument[] | undefined;\n private booted = false;\n private destroyed = false;\n\n /** Bumped on every kernel notification — THE bridge from kernel-world to signals. */\n private readonly tick = signal(0);\n\n /** Boot lifecycle. `ready`/`error` are derived sugar over it. */\n readonly status = signal<EpdfKernelStatus>('starting');\n /** The STARTUP failure, if any. Per-document open failures are tab state\n * (`DocInfo.status === 'error'`), not host state. */\n readonly error = signal<unknown>(null);\n /** True once `kernel.start()` resolved — which never touches the engine, so\n * the shell (and every workspace capability: i18n, view-manager, …) is alive\n * while WASM compiles or the transport connects. Workspace chrome may render\n * before this; gate on it (or on the document gate) where it matters. */\n readonly ready: Signal<boolean> = computed(() => this.status() === 'ready');\n\n /** Register the (deferred) config. Called exactly once, by `EpdfViewer`'s\n * constructor or `provideEmbedPdf`'s factory. */\n connect(config: () => EmbedPdfConfig): void {\n if (this.config || this._kernel) {\n throw new Error('[embedpdf] kernel already configured for this injector');\n }\n this.config = config;\n }\n\n /** The kernel — materialized on first read (see the construction rule above). */\n get kernel(): Kernel {\n if (!this._kernel) {\n if (!this.browser) {\n throw new Error(\n '[embedpdf] the viewer does not render on the server — wrap the EmbedPDF subtree in @defer (its placeholder renders during SSR) or a browser-only @if',\n );\n }\n if (!this.config) {\n throw new Error(\n '[embedpdf] no kernel: wrap this subtree in <epdf-viewer> or add provideEmbedPdf(...) to your providers',\n );\n }\n const { engine, plugins, initialDocuments } = this.config();\n // A thunk is host-owned: call it now, destroy on teardown. An instance is\n // borrowed and left untouched. Either way construction is synchronous and\n // inert (engines boot lazily on first use).\n this.ownsEngine = typeof engine === 'function';\n this._engine = this.ownsEngine ? (engine as EngineFactory)() : (engine as Engine);\n try {\n this._kernel = createKernel({ engine: this._engine, plugins });\n } catch (error) {\n // ngOnDestroy() only tears down via `_kernel`, which stays null on this\n // path — so an owned engine must be destroyed HERE or it leaks.\n if (this.ownsEngine) void this._engine.destroy();\n this._engine = null;\n this.ownsEngine = false;\n throw error;\n }\n // Warm up only once the kernel exists (a plugin-planning throw must not\n // start a boot we'd immediately have to unwind) — `warmup()` overlaps the\n // WASM/transport boot with the rest of initialization.\n this._engine.warmup?.();\n this.initialDocuments = initialDocuments;\n this.unsubscribe = this._kernel.subscribe(() => this.tick.update((n) => n + 1));\n }\n return this._kernel;\n }\n\n /** Start the kernel and open initial documents in the background. Idempotent;\n * a no-op on the server and after destroy. */\n boot(): void {\n if (this.booted || this.destroyed || !this.browser) return;\n this.booted = true;\n const kernel = this.kernel;\n void (async () => {\n try {\n await kernel.start();\n } catch (err) {\n if (!this.destroyed) {\n this.error.set(err);\n this.status.set('error');\n }\n return;\n }\n if (this.destroyed) return;\n this.status.set('ready');\n // Kernel-owned boot policy: all tabs appear immediately in array order;\n // the `active` entry (else the first) is selected; per-document\n // failures surface as that tab's `error`/`locked` status (this host's\n // `error` signal reports only startup failures).\n kernel.documents.openAll(this.initialDocuments ?? []);\n })();\n }\n\n /** Read a value derived from the kernel, cached by equality — Angular's\n * `useKernelValue`. The selector re-runs per kernel notification (cheap);\n * `equal` decides whether dependents ever see it. */\n value<R>(select: (kernel: Kernel) => R, equal: (a: R, b: R) => boolean = Object.is): Signal<R> {\n return computed(\n () => {\n this.tick();\n return select(this.kernel);\n },\n { equal },\n );\n }\n\n ngOnDestroy(): void {\n if (this.destroyed) return;\n this.destroyed = true;\n this.unsubscribe?.();\n // destroy() owns the full teardown now: it joins an in-flight start, closes\n // every document (engine handles included), and unwinds workspace plugins.\n // Async + idempotent, so fire-and-forget is safe in a sync ngOnDestroy.\n // Then destroy the engine IF we own it (a thunk) — kernel first so handles\n // close before the engine goes; `engine.destroy()` joins any in-flight\n // boot or no-ops if it never started.\n if (this._kernel) {\n const engine = this._engine;\n const owns = this.ownsEngine;\n void this._kernel.destroy().then(() => {\n if (owns && engine) void engine.destroy();\n });\n }\n }\n}\n\n/**\n * Host the kernel in an environment injector (route or application providers).\n * The kernel's lifetime is the injector's — a route-level workspace tears down\n * when the route does. Unlocks chrome OUTSIDE any viewer subtree: a toolbar in\n * the app header and the stage in the main outlet share this one kernel.\n */\nexport function provideEmbedPdf(config: EmbedPdfConfig): EnvironmentProviders {\n return makeEnvironmentProviders([\n {\n provide: EpdfKernelHost,\n useFactory: () => {\n const host = new EpdfKernelHost();\n host.connect(() => config);\n host.boot();\n return host;\n },\n },\n ]);\n}\n","/**\n * DI tokens shared by the runtime's primitives and directives — split out so\n * `inject.ts` (consumers) and `scope.ts` (providers) never import each other.\n */\nimport { InjectionToken, type Signal } from '@angular/core';\n\n/** The document a subtree is bound to (provided by `[epdfDocumentScope]`).\n * Absent => the subtree follows the ACTIVE document. */\nexport interface EpdfDocumentScopeRef {\n readonly id: Signal<string>;\n}\n\nexport const EPDF_DOCUMENT_SCOPE = new InjectionToken<EpdfDocumentScopeRef>('EPDF_DOCUMENT_SCOPE');\n","/**\n * The inject* primitives — Angular's spelling of the React runtime hooks\n * (`use*` → `inject*`, plain values → signals, same names otherwise).\n *\n * All of them must run in an injection context (a constructor / field\n * initializer, like `inject()` itself). None of them read `host.kernel` during\n * construction — they return signals or lazy methods, so they are safe in\n * component-hosted mode where the kernel materializes after construction.\n */\nimport { computed, inject, type Signal } from '@angular/core';\nimport { docInfoListEquals } from '@embedpdf/core';\nimport type { CapabilityToken, DocInfo, Kernel } from '@embedpdf/core';\nimport { EpdfKernelHost } from './kernel-host';\nimport { EPDF_DOCUMENT_SCOPE } from './tokens';\n\nexport const shallowArray = <T>(a: readonly T[], b: readonly T[]): boolean =>\n a === b || (a.length === b.length && a.every((x, i) => x === b[i]));\n\nexport function injectKernelHost(): EpdfKernelHost {\n const host = inject(EpdfKernelHost, { optional: true });\n if (!host) {\n throw new Error(\n '[embedpdf] no kernel: wrap this subtree in <epdf-viewer> or add provideEmbedPdf(...) to your providers',\n );\n }\n return host;\n}\n\n/** The raw kernel — materializes it immediately. Do NOT call while a component\n * is being constructed in component-hosted mode (inputs are not set yet);\n * prefer the signal-returning primitives, which defer the first kernel read. */\nexport function injectKernel(): Kernel {\n return injectKernelHost().kernel;\n}\n\n/** Read a value derived from the kernel, cached by equality — `useKernelValue`. */\nexport function injectKernelValue<R>(\n select: (kernel: Kernel) => R,\n equal?: (a: R, b: R) => boolean,\n): Signal<R> {\n return injectKernelHost().value(select, equal);\n}\n\nexport function injectActiveDocumentId(): Signal<string | null> {\n return injectKernelValue((k) => k.documents.activeId());\n}\n\n/** The document id for this injector subtree: the nearest `[epdfDocumentScope]`,\n * else the active document. */\nexport function injectDocumentId(): Signal<string | null> {\n const scope = inject(EPDF_DOCUMENT_SCOPE, { optional: true });\n const active = injectActiveDocumentId();\n return computed(() => scope?.id() ?? active());\n}\n\n/**\n * Resolve a capability against a REACTIVE token — for components that take the\n * token as an input (`injectCapability` is the fixed-token sugar). Resolution\n * is a REACTIVE read (`tryCapability` through the kernel's one change\n * stream), not a computed over the document id — under the request-time\n * lifecycle a document can become resolvable while its id stays the same, so\n * any id-keyed cache goes stale; subscribing makes staleness structurally\n * impossible. Fail-fast like React's `useCapability`: while unresolvable,\n * this re-runs the strict resolver so the kernel's truthful reason (`no\n * capability` / `no document` / `document is loading|locked`) is what throws.\n */\nexport function injectCapabilityFor<T>(token: () => CapabilityToken<T>): Signal<T> {\n const host = injectKernelHost();\n const scope = inject(EPDF_DOCUMENT_SCOPE, { optional: true });\n const cap = host.value((k) => k.tryCapability(token(), scope?.id() ?? undefined));\n return computed(() => cap() ?? host.kernel.capability(token(), scope?.id() ?? undefined));\n}\n\nexport function injectCapability<T>(token: CapabilityToken<T>): Signal<T> {\n return injectCapabilityFor(() => token);\n}\n\n/** Like `injectCapabilityFor`, but null while the token can't resolve (no\n * plugin, no document, or a document that isn't ready yet). */\nexport function injectOptionalCapabilityFor<T>(token: () => CapabilityToken<T>): Signal<T | null> {\n const host = injectKernelHost();\n const scope = inject(EPDF_DOCUMENT_SCOPE, { optional: true });\n return host.value((k) => k.tryCapability(token(), scope?.id() ?? undefined));\n}\n\nexport function injectOptionalCapability<T>(token: CapabilityToken<T>): Signal<T | null> {\n return injectOptionalCapabilityFor(() => token);\n}\n\n/** Subscribe to a selector over a (document-resolved) capability. */\nexport function injectSelectorFor<C, R>(\n token: () => CapabilityToken<C>,\n select: (cap: C) => R,\n equal?: (a: R, b: R) => boolean,\n): Signal<R> {\n const host = injectKernelHost();\n const cap = injectCapabilityFor(token);\n return host.value(() => select(cap()), equal);\n}\n\nexport function injectSelector<C, R>(\n token: CapabilityToken<C>,\n select: (cap: C) => R,\n equal?: (a: R, b: R) => boolean,\n): Signal<R> {\n return injectSelectorFor(() => token, select, equal);\n}\n\n/**\n * Null-safe `injectSelector`: `fallback` whenever the token can't resolve — no\n * provider, or a document-scoped token with no document. For chrome that stays\n * mounted across the empty-workspace state (a zoom readout, a mode band).\n * `injectSelector` stays strict (fail-fast) for code that KNOWS a document\n * exists — e.g. anything behind the document gate.\n *\n * The `select` guard also swallows reads through a capability whose document\n * closed between the store notification and this read — that teardown race\n * resolves to `fallback` for one frame, then recomputes against the new state.\n */\nexport function injectOptionalSelectorFor<C, R>(\n token: () => CapabilityToken<C>,\n select: (cap: C) => R,\n fallback: R,\n equal?: (a: R, b: R) => boolean,\n): Signal<R> {\n const host = injectKernelHost();\n const cap = injectOptionalCapabilityFor(token);\n return host.value(() => {\n const c = cap();\n if (c === null) return fallback;\n try {\n return select(c);\n } catch {\n return fallback;\n }\n }, equal);\n}\n\nexport function injectOptionalSelector<C, R>(\n token: CapabilityToken<C>,\n select: (cap: C) => R,\n fallback: R,\n equal?: (a: R, b: R) => boolean,\n): Signal<R> {\n return injectOptionalSelectorFor(() => token, select, fallback, equal);\n}\n\n/** The document registry (open/close/active/list), reactive — `useDocuments`.\n * Methods late-bind the kernel, so this is construction-safe. */\nexport interface EpdfDocuments {\n docs: Signal<DocInfo[]>;\n activeId: Signal<string | null>;\n open: Kernel['documents']['open'];\n unlock: Kernel['documents']['unlock'];\n close: Kernel['documents']['close'];\n setActive: Kernel['documents']['setActive'];\n move: Kernel['documents']['move'];\n swap: Kernel['documents']['swap'];\n download: Kernel['documents']['download'];\n downloadLayer: Kernel['documents']['downloadLayer'];\n}\n\nexport function injectDocuments(): EpdfDocuments {\n const host = injectKernelHost();\n return {\n docs: host.value((k) => k.documents.list(), docInfoListEquals),\n activeId: host.value((k) => k.documents.activeId()),\n open: (input, options) => host.kernel.documents.open(input, options),\n unlock: (id, input) => host.kernel.documents.unlock(id, input),\n close: (id) => host.kernel.documents.close(id),\n setActive: (id) => host.kernel.documents.setActive(id),\n move: (id, toIndex) => host.kernel.documents.move(id, toIndex),\n swap: (a, b) => host.kernel.documents.swap(a, b),\n download: (id, opts) => host.kernel.documents.download(id, opts),\n downloadLayer: (id) => host.kernel.documents.downloadLayer(id),\n };\n}\n","/**\n * Document scoping — hierarchical DI is Angular's native React-context.\n *\n * `[epdfDocumentScope]` binds a subtree to a SPECIFIC document (panes,\n * comparison); `*epdfDocumentGate` renders a subtree only WHILE it has one.\n * The gate is a structural directive on purpose: a template genuinely defers\n * creation, which a conditional `<ng-content>` slot cannot (Angular\n * instantiates projected content eagerly). Document-scoped UI — the Stage,\n * zoom/page controls, panels — belongs behind it (or behind the app's own\n * `@if (documentId())`); workspace chrome lives outside it.\n */\nimport {\n computed,\n Directive,\n effect,\n forwardRef,\n inject,\n input,\n TemplateRef,\n ViewContainerRef,\n} from '@angular/core';\nimport { injectDocumentId } from './inject';\nimport { EPDF_DOCUMENT_SCOPE, type EpdfDocumentScopeRef } from './tokens';\n\n@Directive({\n selector: '[epdfDocumentScope]',\n standalone: true,\n providers: [{ provide: EPDF_DOCUMENT_SCOPE, useExisting: forwardRef(() => EpdfDocumentScope) }],\n})\nexport class EpdfDocumentScope implements EpdfDocumentScopeRef {\n readonly id = input.required<string>({ alias: 'epdfDocumentScope' });\n}\n\n/**\n * Render the host template only while this subtree has a document — the\n * structural way to say \"this UI is defined over a document\". Sibling of\n * `[epdfDocumentScope]`, which picks WHICH document; this one handles WHETHER.\n *\n * <section *epdfDocumentGate=\"; fallback: empty\">…document UI…</section>\n * <ng-template #empty>Drop a PDF to get started</ng-template>\n *\n * The subtree stays mounted across a CHANGE of document (active-tab switch) —\n * only the has-a-document boolean creates/destroys it.\n */\n@Directive({ selector: '[epdfDocumentGate]', standalone: true })\nexport class EpdfDocumentGate {\n /** Shown while this subtree has NO document (empty workspace, docs still opening). */\n readonly fallback = input<TemplateRef<unknown> | null>(null, {\n alias: 'epdfDocumentGateFallback',\n });\n\n constructor() {\n const docId = injectDocumentId();\n const hasDocument = computed(() => docId() !== null);\n const container = inject(ViewContainerRef);\n const content = inject<TemplateRef<unknown>>(TemplateRef);\n effect(() => {\n container.clear();\n if (hasDocument()) {\n container.createEmbeddedView(content);\n } else {\n // `fallback` is only tracked while gated — swapping fallback templates\n // never recreates live document UI.\n const fallbackTemplate = this.fallback();\n if (fallbackTemplate) container.createEmbeddedView(fallbackTemplate);\n }\n });\n }\n}\n","/**\n * `<epdf-viewer>` — component-hosted kernel (framework parity with React's\n * `<Viewer>`). Provides `EpdfKernelHost` at its element injector, boots it, and\n * projects content UNCONDITIONALLY: it is NOT a gate. Angular instantiates\n * projected content eagerly whether or not a slot renders it, so a conditional\n * `<ng-content>` cannot defer anything — real gating belongs to templates the\n * APP owns: `@if (ready())` for boot chrome, `*epdfDocumentGate` (or\n * `@if (documentId())`) for document UI.\n *\n * Prefer `provideEmbedPdf(...)` at route/app level when chrome lives outside\n * one subtree; this component is sugar over the same host.\n */\nimport { ChangeDetectionStrategy, Component, inject, input, type OnInit } from '@angular/core';\nimport type { AnyPlugin, Engine, EngineFactory } from '@embedpdf/core';\nimport { EpdfKernelHost, type EpdfInitialDocument } from './kernel-host';\n\n@Component({\n selector: 'epdf-viewer',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [EpdfKernelHost],\n // Layout-transparent, like React's element-less <Viewer>.\n host: { style: 'display: contents;' },\n template: `<ng-content />`,\n})\nexport class EpdfViewer implements OnInit {\n /** The engine, as an instance OR a thunk ({@link EngineFactory}). An\n * instance is borrowed (never destroyed here); a thunk is host-owned\n * (constructed then destroyed with the viewer). See EmbedPdfConfig.\n * Init-only: the kernel is built once from the first values; recreate the\n * viewer (e.g. with @if) to swap it. */\n readonly engine = input.required<Engine | EngineFactory>();\n readonly plugins = input.required<AnyPlugin[]>();\n readonly initialDocuments = input<EpdfInitialDocument[]>();\n\n /** The host this viewer provides — exposed so a template reference can read\n * `viewer.host.ready()` / `.status()` without extra imports. */\n readonly host = inject(EpdfKernelHost, { self: true });\n\n constructor() {\n // Deferred config: inputs are READ on first kernel access, which happens\n // after construction (a template binding or effect) — never here.\n this.host.connect(() => ({\n engine: this.engine(),\n plugins: this.plugins(),\n initialDocuments: this.initialDocuments(),\n }));\n }\n\n ngOnInit(): void {\n // Inputs are set by now; materializes the kernel and starts it (no-op on\n // the server — the SSR contract lives on the host).\n this.host.boot();\n }\n}\n","/**\n * PageContext — the seam. A layer depends ONLY on this, never on the Stage, so\n * the same layer works inside a virtualized `<epdf-stage>` page and a future\n * standalone `<epdf-page-view>`.\n *\n * THE STABILITY INVARIANT (the one performance rule of this adapter): a page's\n * context is ONE STABLE OBJECT per mounted surface — identity never changes;\n * the volatile parts (`transform`, `frame`, `pageIndex`) are signals INSIDE it.\n * The per-page injector providing `EPDF_PAGE` is likewise created once. Camera\n * frames then flow as signal writes — `NgTemplateOutlet` never recreates the\n * embedded views, in-flight renders survive, and updates stay per-binding.\n * Never rebuild the context or the injector per frame.\n *\n * Coordinate math lives in `@embedpdf/core-geometry`'s `PageTransform` — verified\n * once, not re-derived per framework adapter (`toContentPoint` mirrors React's\n * `makePageContext` exactly).\n */\nimport { InjectionToken, inject, type Signal } from '@angular/core';\nimport type { PageFrame, PageTransform, Point, Rect } from '@embedpdf/core-geometry';\n\nexport interface EpdfPageContext {\n readonly documentId: string;\n /** Durable page identity (PDF object number) — use for keys / render / annotations. */\n readonly pon: number;\n /** Display index (page N) — can shift under page reorders, hence a signal. */\n readonly pageIndex: Signal<number>;\n /** Reserved chrome bands around the page (screen px per side). */\n readonly frame: Signal<PageFrame>;\n /** The single bridge between PDF points, view px, and device px for this\n * page. Layers do ALL coordinate work through it — never re-derive\n * `x * scale` or `* dpr`. Updates per camera frame. */\n readonly transform: Signal<PageTransform>;\n /** Client (screen) point → the viewer's coordinates (content point) — the\n * one platform-bound hit-test. */\n toContentPoint(clientX: number, clientY: number): Point;\n /** Content point → client (screen) px — the exact inverse of `toContentPoint`. */\n toClientPoint(p: Point): Point;\n /** Content rect → client (screen) px AABB. */\n toClientRect(rect: Rect): Rect;\n}\n\nexport const EPDF_PAGE = new InjectionToken<EpdfPageContext>('EPDF_PAGE');\n\nexport function injectPage(): EpdfPageContext {\n const page = inject(EPDF_PAGE, { optional: true });\n if (!page) {\n throw new Error('[embedpdf] injectPage() must be used inside an <epdf-stage> page template');\n }\n return page;\n}\n\n/** Build a page context from its reactive parts. `documentId`/`pon` are thunks\n * because inputs aren't readable at construction — both are stable per surface. */\nexport function createPageContext(parts: {\n documentId: () => string;\n pon: () => number;\n pageIndex: Signal<number>;\n frame: Signal<PageFrame>;\n transform: Signal<PageTransform>;\n /** The rotated content wrapper's LIVE bounding box (the page's display box). */\n getRect: () => DOMRect;\n}): EpdfPageContext {\n const { transform, getRect } = parts;\n return {\n get documentId() {\n return parts.documentId();\n },\n get pon() {\n return parts.pon();\n },\n pageIndex: parts.pageIndex,\n frame: parts.frame,\n transform,\n toContentPoint: (clientX, clientY) => {\n // Client → box-local view px, then invert rotation + scale via the\n // transform (verified once in geometry, not re-derived per adapter).\n const r = getRect();\n return transform().viewToContent({ x: clientX - r.left, y: clientY - r.top });\n },\n toClientPoint: (p) => {\n // Exact inverse of `toContentPoint`, offset by the same live display-box\n // origin — the two can never drift.\n const r = getRect();\n const v = transform().contentToView(p);\n return { x: r.left + v.x, y: r.top + v.y };\n },\n toClientRect: (rect) => {\n const r = getRect();\n const v = transform().contentToViewRect(rect);\n return { x: r.left + v.x, y: r.top + v.y, width: v.width, height: v.height };\n },\n };\n}\n","/**\n * @embedpdf/angular/runtime — the trunk: the generic kernel binding.\n *\n * Binds the kernel's one change stream to Angular signals (one tick signal +\n * computed), resolves capabilities (document-scoped ones against the active or\n * `[epdfDocumentScope]`-given document), and provides the page context seam.\n * Every feature entry point and layer rides on this — there is no per-plugin\n * framework code.\n */\n\n// One-line-per-feature: registration travels with the UI.\nexport * from '@embedpdf/core';\nexport * from './kernel-host';\nexport * from './tokens';\nexport * from './inject';\nexport * from './scope';\nexport * from './viewer';\nexport * from './page-context';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;AAAA;;;;;;;;;;;;;;;;;;;AAmBG;MA2DU,cAAc,CAAA;IACR,OAAO,GAAG,iBAAiB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACzD,MAAM,GAAkC,IAAI;IAC5C,OAAO,GAAkB,IAAI;AACrC;AACwE;IAChE,OAAO,GAAkB,IAAI;IAC7B,UAAU,GAAG,KAAK;IAClB,WAAW,GAAuB,IAAI;AACtC,IAAA,gBAAgB;IAChB,MAAM,GAAG,KAAK;IACd,SAAS,GAAG,KAAK;;AAGR,IAAA,IAAI,GAAG,MAAM,CAAC,CAAC,gDAAC;;AAGxB,IAAA,MAAM,GAAG,MAAM,CAAmB,UAAU,kDAAC;AACtD;AACsD;AAC7C,IAAA,KAAK,GAAG,MAAM,CAAU,IAAI,iDAAC;AACtC;;;AAG0E;AACjE,IAAA,KAAK,GAAoB,QAAQ,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,KAAK,OAAO,iDAAC;AAE3E;AACkD;AAClD,IAAA,OAAO,CAAC,MAA4B,EAAA;QAClC,IAAI,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,OAAO,EAAE;AAC/B,YAAA,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC;QAC3E;AACA,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;IACtB;;AAGA,IAAA,IAAI,MAAM,GAAA;AACR,QAAA,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;AACjB,YAAA,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE;AACjB,gBAAA,MAAM,IAAI,KAAK,CACb,sJAAsJ,CACvJ;YACH;AACA,YAAA,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;AAChB,gBAAA,MAAM,IAAI,KAAK,CACb,wGAAwG,CACzG;YACH;AACA,YAA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T,QAAA,cAAc,EAAE,CAAC,OAAO,EAAE,OAAO,KAAI;;;AAGnC,YAAA,MAAM,CAAC,GAAG,OAAO,EAAE;YACnB,OAAO,SAAS,EAAE,CAAC,aAAa,CAAC,EAAE,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;QAC/E,CAAC;AACD,QAAA,aAAa,EAAE,CAAC,CAAC,KAAI;;;AAGnB,YAAA,MAAM,CAAC,GAAG,OAAO,EAAE;YACnB,MAAM,CAAC,GAAG,SAAS,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;YACtC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE;QAC5C,CAAC;AACD,QAAA,YAAY,EAAE,CAAC,IAAI,KAAI;AACrB,YAAA,MAAM,CAAC,GAAG,OAAO,EAAE;YACnB,MAAM,CAAC,GAAG,SAAS,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC;AAC7C,YAAA,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;QAC9E,CAAC;KACF;AACH;;AC5FA;;;;;;;;AAQG;AAEH;;ACVA;;AAEG;;;;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { StageToken,
|
|
1
|
+
import { StageToken, createScrollHandler, settingsEqual } from '@embedpdf/plugin-stage';
|
|
2
2
|
export * from '@embedpdf/plugin-stage';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { inject, TemplateRef, Directive, input, computed, viewChild, Injector, ChangeDetectionStrategy, Component, contentChild, PLATFORM_ID, ElementRef, NgZone, effect } from '@angular/core';
|
|
5
5
|
import { NgTemplateOutlet, isPlatformBrowser } from '@angular/common';
|
|
6
6
|
import { createPageContext, EPDF_PAGE, injectKernelHost, injectOptionalCapabilityFor, injectOptionalCapability, injectDocumentId, injectOptionalSelectorFor, injectCapability, injectSelector, shallowArray } from '@embedpdf/angular/runtime';
|
|
7
|
-
import { InteractionToken } from '@embedpdf/plugin-interaction';
|
|
7
|
+
import { InteractionToken } from '@embedpdf/plugin-interaction/contract';
|
|
8
|
+
import { createStageSurface } from '@embedpdf/web';
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* The render-prop translation: React's `children: (page) => ReactNode` becomes
|
|
@@ -111,7 +112,7 @@ class EpdfPageSurface {
|
|
|
111
112
|
transparent fill so it can never peek out behind the bitmap, and it
|
|
112
113
|
stays put under rotation. -->
|
|
113
114
|
<div
|
|
114
|
-
style="position: absolute; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);"
|
|
115
|
+
style="position: absolute; box-shadow: var(--epdf-page-shadow, 0 6px 18px rgba(0, 0, 0, 0.18));"
|
|
115
116
|
[style.left.px]="frame().left"
|
|
116
117
|
[style.top.px]="frame().top"
|
|
117
118
|
[style.width.px]="t().viewWidth"
|
|
@@ -165,7 +166,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
|
|
|
165
166
|
transparent fill so it can never peek out behind the bitmap, and it
|
|
166
167
|
stays put under rotation. -->
|
|
167
168
|
<div
|
|
168
|
-
style="position: absolute; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);"
|
|
169
|
+
style="position: absolute; box-shadow: var(--epdf-page-shadow, 0 6px 18px rgba(0, 0, 0, 0.18));"
|
|
169
170
|
[style.left.px]="frame().left"
|
|
170
171
|
[style.top.px]="frame().top"
|
|
171
172
|
[style.width.px]="t().viewWidth"
|
|
@@ -202,29 +203,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.4", ngImpor
|
|
|
202
203
|
}]
|
|
203
204
|
}] });
|
|
204
205
|
|
|
205
|
-
/**
|
|
206
|
-
* Robust multi-click counter. `pointerdown.detail` is 0/1 in several browsers,
|
|
207
|
-
* so we count clicks ourselves from timing + proximity — the standard
|
|
208
|
-
* double/triple detection. Input normalization belongs in the adapter; the
|
|
209
|
-
* hub/handlers stay pure.
|
|
210
|
-
*
|
|
211
|
-
* INTERNAL for now — moves to the `/interaction` entry point (its React home)
|
|
212
|
-
* when that vertical lands.
|
|
213
|
-
*/
|
|
214
|
-
function createClickCounter(maxGapMs = 400, maxDistPx = 6) {
|
|
215
|
-
let last = 0;
|
|
216
|
-
let lastX = 0;
|
|
217
|
-
let lastY = 0;
|
|
218
|
-
let count = 0;
|
|
219
|
-
return (now, x, y) => {
|
|
220
|
-
count = now - last <= maxGapMs && Math.hypot(x - lastX, y - lastY) <= maxDistPx ? count + 1 : 1;
|
|
221
|
-
last = now;
|
|
222
|
-
lastX = x;
|
|
223
|
-
lastY = y;
|
|
224
|
-
return count;
|
|
225
|
-
};
|
|
226
|
-
}
|
|
227
|
-
|
|
228
206
|
/**
|
|
229
207
|
* `<epdf-stage>` — virtualizes and positions page surfaces by the camera, and
|
|
230
208
|
* stamps each one with YOUR `<ng-template epdfPage>` — you bring the layers.
|
|
@@ -246,11 +224,24 @@ const frameEqual = (a, b) => a.top === b.top && a.right === b.right && a.bottom
|
|
|
246
224
|
class EpdfStage {
|
|
247
225
|
/**
|
|
248
226
|
* Route this Stage's pointer events to the interaction hub (page-resolved via
|
|
249
|
-
* `pageAt`)
|
|
250
|
-
*
|
|
251
|
-
*
|
|
227
|
+
* `pageAt`) — AND register this lens's tool-gated pan-scroll handler with it
|
|
228
|
+
* (lens-scoped, so multiple stages on one document never pan each other).
|
|
229
|
+
* Pan is then the `pan` tool's job and dragging in `pointer` mode selects
|
|
230
|
+
* text (incl. across pages).
|
|
231
|
+
*
|
|
232
|
+
* Default TRUE: registering `interactionPlugin()` is the one opt-in — tools
|
|
233
|
+
* just work; without the hub this is inert and the stage falls back to
|
|
234
|
+
* built-in drag-to-pan, so a hub-less setup costs nothing. Set `false` on
|
|
235
|
+
* SECONDARY lenses (a thumbnail rail) that should stay click-to-navigate
|
|
236
|
+
* instead of feeding the document's tools.
|
|
237
|
+
*/
|
|
238
|
+
interaction = input(true, ...(ngDevMode ? [{ debugName: "interaction" }] : []));
|
|
239
|
+
/**
|
|
240
|
+
* With `interaction`: let drags over page GAPS pan regardless of the active
|
|
241
|
+
* tool (and show a grab cursor there) — the gutter always pans; there is
|
|
242
|
+
* nothing to draw/select outside a page. Default true.
|
|
252
243
|
*/
|
|
253
|
-
|
|
244
|
+
panFallback = input(true, ...(ngDevMode ? [{ debugName: "panFallback" }] : []));
|
|
254
245
|
/**
|
|
255
246
|
* Ambient ZOOM gestures on this stage: ctrl/cmd+wheel and trackpad pinch
|
|
256
247
|
* (Safari gesture events included). Default true. Turn OFF for follower
|
|
@@ -292,164 +283,35 @@ class EpdfStage {
|
|
|
292
283
|
const stage = this.stage();
|
|
293
284
|
const ix = this.ix();
|
|
294
285
|
const useHub = this.interaction() && !!ix;
|
|
286
|
+
const panFallback = this.panFallback();
|
|
295
287
|
const zoomGestures = this.zoomGestures();
|
|
296
288
|
if (!stage)
|
|
297
289
|
return; // no document yet — nothing to drive
|
|
298
290
|
const cleanups = [];
|
|
299
291
|
zone.runOutsideAngular(() => {
|
|
300
|
-
//
|
|
301
|
-
//
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
//
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
stage.setDevicePixelRatio(window.devicePixelRatio || 1);
|
|
313
|
-
mq?.removeEventListener('change', reportDpr);
|
|
314
|
-
mq = window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);
|
|
315
|
-
mq.addEventListener('change', reportDpr);
|
|
316
|
-
};
|
|
317
|
-
reportDpr();
|
|
318
|
-
cleanups.push(() => mq?.removeEventListener('change', reportDpr));
|
|
319
|
-
// Wheel is ambient navigation in BOTH modes: ctrl/meta zooms (classified
|
|
320
|
-
// per input by wheelZoomFactor), else scrolls. With zoom gestures off, a
|
|
321
|
-
// zoom-wheel falls through to ordinary pan.
|
|
322
|
-
const onWheel = (e) => {
|
|
323
|
-
e.preventDefault();
|
|
324
|
-
const r = el.getBoundingClientRect();
|
|
325
|
-
if (zoomGestures && (e.ctrlKey || e.metaKey)) {
|
|
326
|
-
stage.zoomAround({ x: e.clientX - r.left, y: e.clientY - r.top }, wheelZoomFactor(e));
|
|
327
|
-
}
|
|
328
|
-
else {
|
|
329
|
-
const dx = e.shiftKey ? e.deltaY : e.deltaX;
|
|
330
|
-
const dy = e.shiftKey ? e.deltaX : e.deltaY;
|
|
331
|
-
stage.panBy(-dx, -dy);
|
|
332
|
-
}
|
|
333
|
-
};
|
|
334
|
-
el.addEventListener('wheel', onWheel, { passive: false });
|
|
335
|
-
cleanups.push(() => el.removeEventListener('wheel', onWheel));
|
|
336
|
-
// Safari never synthesizes ctrl+wheel for trackpad pinch — it fires
|
|
337
|
-
// proprietary gesture events carrying an ABSOLUTE scale; convert to the
|
|
338
|
-
// per-event ratio the camera physics wants. Feature-detected, so Chrome
|
|
339
|
-
// and Firefox pay nothing. preventDefault runs even with zoom gestures
|
|
340
|
-
// off — a pinch over the stage must never zoom the page itself.
|
|
341
|
-
let lastScale = 1;
|
|
342
|
-
const onGestureStart = (e) => {
|
|
343
|
-
e.preventDefault();
|
|
344
|
-
lastScale = e.scale ?? 1;
|
|
345
|
-
};
|
|
346
|
-
const onGestureChange = (e) => {
|
|
347
|
-
e.preventDefault();
|
|
348
|
-
const g = e;
|
|
349
|
-
const scale = g.scale ?? 1;
|
|
350
|
-
if (zoomGestures && scale > 0) {
|
|
351
|
-
const r = el.getBoundingClientRect();
|
|
352
|
-
stage.zoomAround({ x: g.clientX - r.left, y: g.clientY - r.top }, scale / lastScale);
|
|
353
|
-
}
|
|
354
|
-
lastScale = scale;
|
|
355
|
-
};
|
|
356
|
-
if ('GestureEvent' in window) {
|
|
357
|
-
el.addEventListener('gesturestart', onGestureStart);
|
|
358
|
-
el.addEventListener('gesturechange', onGestureChange);
|
|
359
|
-
el.addEventListener('gestureend', onGestureStart); // reset the base
|
|
360
|
-
cleanups.push(() => {
|
|
361
|
-
el.removeEventListener('gesturestart', onGestureStart);
|
|
362
|
-
el.removeEventListener('gesturechange', onGestureChange);
|
|
363
|
-
el.removeEventListener('gestureend', onGestureStart);
|
|
364
|
-
});
|
|
365
|
-
}
|
|
292
|
+
// The WHOLE browser binding — viewport/DPR reporting, sample
|
|
293
|
+
// normalization, gesture controller — is the shared @embedpdf/web
|
|
294
|
+
// surface, so every framework adapter has one feel. This component
|
|
295
|
+
// keeps only Angular glue.
|
|
296
|
+
cleanups.push(createStageSurface(el, stage, {
|
|
297
|
+
hub: useHub ? ix : null,
|
|
298
|
+
source: stage.lensId(),
|
|
299
|
+
zoomGestures,
|
|
300
|
+
}));
|
|
301
|
+
// Interaction opt-in lives WITH the sample source: the same knob that
|
|
302
|
+
// forwards this lens's samples also registers its pan-scroll handler,
|
|
303
|
+
// lens-scoped — two stages on one document can never pan each other.
|
|
366
304
|
if (useHub && ix) {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
const forward = (phase, e, clickCount = 1) => {
|
|
371
|
-
const r = el.getBoundingClientRect();
|
|
372
|
-
const viewport = { x: e.clientX - r.left, y: e.clientY - r.top };
|
|
373
|
-
ix.dispatch({
|
|
374
|
-
phase,
|
|
375
|
-
viewport,
|
|
376
|
-
page: stage.pageAt(viewport) ?? undefined,
|
|
377
|
-
// Page-anchored gestures (annotation move/resize) track the origin
|
|
378
|
-
// page's frame through this even when the cursor is off that page.
|
|
379
|
-
project: (pon) => stage.pointOnPage(pon, viewport),
|
|
380
|
-
modifiers: { shift: e.shiftKey, alt: e.altKey, ctrl: e.ctrlKey, meta: e.metaKey },
|
|
381
|
-
clickCount,
|
|
382
|
-
});
|
|
383
|
-
};
|
|
384
|
-
let dragging = false;
|
|
385
|
-
const down = (e) => {
|
|
386
|
-
if (e.button !== 0)
|
|
387
|
-
return;
|
|
388
|
-
dragging = true;
|
|
389
|
-
forward('down', e, clicks(Date.now(), e.clientX, e.clientY));
|
|
390
|
-
};
|
|
391
|
-
const hover = (e) => {
|
|
392
|
-
if (!dragging)
|
|
393
|
-
forward('move', e); // cursor feedback, no gesture
|
|
394
|
-
};
|
|
395
|
-
const windowMove = (e) => {
|
|
396
|
-
if (dragging)
|
|
397
|
-
forward('move', e);
|
|
398
|
-
};
|
|
399
|
-
const up = (e) => {
|
|
400
|
-
if (!dragging)
|
|
401
|
-
return;
|
|
402
|
-
dragging = false;
|
|
403
|
-
forward('up', e);
|
|
404
|
-
};
|
|
405
|
-
el.addEventListener('pointerdown', down);
|
|
406
|
-
el.addEventListener('pointermove', hover);
|
|
407
|
-
window.addEventListener('pointermove', windowMove);
|
|
408
|
-
window.addEventListener('pointerup', up);
|
|
409
|
-
cleanups.push(() => {
|
|
410
|
-
el.removeEventListener('pointerdown', down);
|
|
411
|
-
el.removeEventListener('pointermove', hover);
|
|
412
|
-
window.removeEventListener('pointermove', windowMove);
|
|
413
|
-
window.removeEventListener('pointerup', up);
|
|
414
|
-
});
|
|
415
|
-
}
|
|
416
|
-
else {
|
|
417
|
-
// Built-in drag-to-pan (no interaction hub).
|
|
418
|
-
let dragging = false;
|
|
419
|
-
let lastX = 0;
|
|
420
|
-
let lastY = 0;
|
|
421
|
-
const down = (e) => {
|
|
422
|
-
if (e.button !== 0)
|
|
423
|
-
return;
|
|
424
|
-
dragging = true;
|
|
425
|
-
lastX = e.clientX;
|
|
426
|
-
lastY = e.clientY;
|
|
427
|
-
};
|
|
428
|
-
const move = (e) => {
|
|
429
|
-
if (!dragging)
|
|
430
|
-
return;
|
|
431
|
-
stage.panBy(e.clientX - lastX, e.clientY - lastY);
|
|
432
|
-
lastX = e.clientX;
|
|
433
|
-
lastY = e.clientY;
|
|
434
|
-
};
|
|
435
|
-
const up = () => {
|
|
436
|
-
dragging = false;
|
|
437
|
-
};
|
|
438
|
-
el.addEventListener('pointerdown', down);
|
|
439
|
-
window.addEventListener('pointermove', move);
|
|
440
|
-
window.addEventListener('pointerup', up);
|
|
441
|
-
cleanups.push(() => {
|
|
442
|
-
el.removeEventListener('pointerdown', down);
|
|
443
|
-
window.removeEventListener('pointermove', move);
|
|
444
|
-
window.removeEventListener('pointerup', up);
|
|
445
|
-
});
|
|
305
|
+
cleanups.push(ix.registerHandler(createScrollHandler(stage, ix, { panFallback }), {
|
|
306
|
+
source: stage.lensId(),
|
|
307
|
+
}));
|
|
446
308
|
}
|
|
447
309
|
});
|
|
448
310
|
onCleanup(() => cleanups.forEach((fn) => fn()));
|
|
449
311
|
});
|
|
450
312
|
}
|
|
451
313
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.4", ngImport: i0, type: EpdfStage, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
452
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.4", type: EpdfStage, isStandalone: true, selector: "epdf-stage", inputs: { interaction: { classPropertyName: "interaction", publicName: "interaction", isSignal: true, isRequired: false, transformFunction: null }, zoomGestures: { classPropertyName: "zoomGestures", publicName: "zoomGestures", isSignal: true, isRequired: false, transformFunction: null }, token: { classPropertyName: "token", publicName: "token", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.cursor": "cursor()" }, styleAttribute: "position: relative; overflow: hidden; touch-action: none; display: block;" }, queries: [{ propertyName: "pageTemplateDir", first: true, predicate: EpdfPageTemplate, descendants: true, isSignal: true }, { propertyName: "chromeTemplateDir", first: true, predicate: EpdfPageChrome, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
314
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.4", type: EpdfStage, isStandalone: true, selector: "epdf-stage", inputs: { interaction: { classPropertyName: "interaction", publicName: "interaction", isSignal: true, isRequired: false, transformFunction: null }, panFallback: { classPropertyName: "panFallback", publicName: "panFallback", isSignal: true, isRequired: false, transformFunction: null }, zoomGestures: { classPropertyName: "zoomGestures", publicName: "zoomGestures", isSignal: true, isRequired: false, transformFunction: null }, token: { classPropertyName: "token", publicName: "token", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.cursor": "cursor()" }, styleAttribute: "position: relative; overflow: hidden; touch-action: none; display: block;" }, queries: [{ propertyName: "pageTemplateDir", first: true, predicate: EpdfPageTemplate, descendants: true, isSignal: true }, { propertyName: "chromeTemplateDir", first: true, predicate: EpdfPageChrome, descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
453
315
|
@if (pageTemplate(); as tpl) {
|
|
454
316
|
@for (p of pages(); track p.pon) {
|
|
455
317
|
<epdf-page-surface
|
|
@@ -1 +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 * 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;AAAC,YAAA,IAAA,EAAA,CAAA,EAAE,QAAQ,EAAE,6BAA6B,EAAE,UAAU,EAAE,IAAI,EAAE;;;ACtCxE;;;;;;;;;;;;;;;AAeG;MAqEU,eAAe,CAAA;AACjB,IA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;AC1GA;;;AAGG;AAEH;;ACLA;;AAEG;;;;"}
|
|
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,CAC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KAAA,GAAwB,UAAU,EAAA;AACpE,IAAA,MAAM,CAAC,GAAG,gBAAgB,CAAC,KAAK,CAAC;IACjC,OAAO;;;AAGL,QAAA,QAAQ,EAAE,cAAc,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,EAAE,aAAa,CAAC;AACnE,QAAA,MAAM,EAAE,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC;AACzB,QAAA,KAAK,EAAE,IAAI,CAAC,CAAC,EAAE,WAAW,CAAC;KAC5B;AACH;;AC1GA;;;AAGG;AAEH;;ACLA;;AAEG;;;;"}
|
|
@@ -1 +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":"
|
|
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';\nexport * from '@embedpdf/angular/actions';\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
CHANGED
package/dist/runtime/index.d.ts
CHANGED
|
@@ -224,7 +224,7 @@ declare class EpdfViewer implements OnInit {
|
|
|
224
224
|
* Never rebuild the context or the injector per frame.
|
|
225
225
|
*
|
|
226
226
|
* Coordinate math lives in `@embedpdf/core-geometry`'s `PageTransform` — verified
|
|
227
|
-
* once, not re-derived per framework adapter (`
|
|
227
|
+
* once, not re-derived per framework adapter (`toContentPoint` mirrors React's
|
|
228
228
|
* `makePageContext` exactly).
|
|
229
229
|
*/
|
|
230
230
|
|
|
@@ -240,11 +240,12 @@ interface EpdfPageContext {
|
|
|
240
240
|
* page. Layers do ALL coordinate work through it — never re-derive
|
|
241
241
|
* `x * scale` or `* dpr`. Updates per camera frame. */
|
|
242
242
|
readonly transform: Signal<PageTransform>;
|
|
243
|
-
/** Client (screen) point →
|
|
244
|
-
|
|
245
|
-
|
|
243
|
+
/** Client (screen) point → the viewer's coordinates (content point) — the
|
|
244
|
+
* one platform-bound hit-test. */
|
|
245
|
+
toContentPoint(clientX: number, clientY: number): Point;
|
|
246
|
+
/** Content point → client (screen) px — the exact inverse of `toContentPoint`. */
|
|
246
247
|
toClientPoint(p: Point): Point;
|
|
247
|
-
/**
|
|
248
|
+
/** Content rect → client (screen) px AABB. */
|
|
248
249
|
toClientRect(rect: Rect): Rect;
|
|
249
250
|
}
|
|
250
251
|
declare const EPDF_PAGE: InjectionToken<EpdfPageContext>;
|
package/dist/stage/index.d.ts
CHANGED
|
@@ -77,11 +77,24 @@ type StageTokenProp = CapabilityToken<StageCapability>;
|
|
|
77
77
|
declare class EpdfStage {
|
|
78
78
|
/**
|
|
79
79
|
* Route this Stage's pointer events to the interaction hub (page-resolved via
|
|
80
|
-
* `pageAt`)
|
|
81
|
-
*
|
|
82
|
-
*
|
|
80
|
+
* `pageAt`) — AND register this lens's tool-gated pan-scroll handler with it
|
|
81
|
+
* (lens-scoped, so multiple stages on one document never pan each other).
|
|
82
|
+
* Pan is then the `pan` tool's job and dragging in `pointer` mode selects
|
|
83
|
+
* text (incl. across pages).
|
|
84
|
+
*
|
|
85
|
+
* Default TRUE: registering `interactionPlugin()` is the one opt-in — tools
|
|
86
|
+
* just work; without the hub this is inert and the stage falls back to
|
|
87
|
+
* built-in drag-to-pan, so a hub-less setup costs nothing. Set `false` on
|
|
88
|
+
* SECONDARY lenses (a thumbnail rail) that should stay click-to-navigate
|
|
89
|
+
* instead of feeding the document's tools.
|
|
83
90
|
*/
|
|
84
91
|
readonly interaction: _angular_core.InputSignal<boolean>;
|
|
92
|
+
/**
|
|
93
|
+
* With `interaction`: let drags over page GAPS pan regardless of the active
|
|
94
|
+
* tool (and show a grab cursor there) — the gutter always pans; there is
|
|
95
|
+
* nothing to draw/select outside a page. Default true.
|
|
96
|
+
*/
|
|
97
|
+
readonly panFallback: _angular_core.InputSignal<boolean>;
|
|
85
98
|
/**
|
|
86
99
|
* Ambient ZOOM gestures on this stage: ctrl/cmd+wheel and trackpad pinch
|
|
87
100
|
* (Safari gesture events included). Default true. Turn OFF for follower
|
|
@@ -106,7 +119,7 @@ declare class EpdfStage {
|
|
|
106
119
|
protected readonly chromeTemplate: _angular_core.Signal<_angular_core.TemplateRef<_embedpdf_angular_stage.EpdfPageTemplateContext> | null>;
|
|
107
120
|
constructor();
|
|
108
121
|
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>;
|
|
122
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<EpdfStage, "epdf-stage", never, { "interaction": { "alias": "interaction"; "required": false; "isSignal": true; }; "panFallback": { "alias": "panFallback"; "required": false; "isSignal": true; }; "zoomGestures": { "alias": "zoomGestures"; "required": false; "isSignal": true; }; "token": { "alias": "token"; "required": false; "isSignal": true; }; }, {}, ["pageTemplateDir", "chromeTemplateDir"], ["*"], true, never>;
|
|
110
123
|
}
|
|
111
124
|
|
|
112
125
|
declare function injectStage(token?: StageTokenProp): Signal<StageCapability>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embedpdf/angular",
|
|
3
|
-
"version": "3.0.0-next.
|
|
3
|
+
"version": "3.0.0-next.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Angular adapter for EmbedPDF v3: one generic signal binding + structural components (EpdfViewer, EpdfStage) + headless layers & inject functions. The whole framework surface, one secondary entry point per feature.",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -22,6 +22,10 @@
|
|
|
22
22
|
"./render": {
|
|
23
23
|
"types": "./dist/render/index.d.ts",
|
|
24
24
|
"default": "./dist/fesm2022/embedpdf-angular-render.mjs"
|
|
25
|
+
},
|
|
26
|
+
"./actions": {
|
|
27
|
+
"types": "./dist/actions/index.d.ts",
|
|
28
|
+
"default": "./dist/fesm2022/embedpdf-angular-actions.mjs"
|
|
25
29
|
}
|
|
26
30
|
},
|
|
27
31
|
"files": [
|
|
@@ -29,12 +33,14 @@
|
|
|
29
33
|
],
|
|
30
34
|
"dependencies": {
|
|
31
35
|
"tslib": "^2.6.0",
|
|
32
|
-
"@embedpdf/core
|
|
33
|
-
"@embedpdf/core": "3.0.0-next.
|
|
34
|
-
"@embedpdf/core-stage": "3.0.0-next.
|
|
35
|
-
"@embedpdf/plugin-
|
|
36
|
-
"@embedpdf/plugin-
|
|
37
|
-
"@embedpdf/plugin-
|
|
36
|
+
"@embedpdf/core": "3.0.0-next.11",
|
|
37
|
+
"@embedpdf/core-geometry": "3.0.0-next.11",
|
|
38
|
+
"@embedpdf/core-stage": "3.0.0-next.11",
|
|
39
|
+
"@embedpdf/plugin-stage": "3.0.0-next.11",
|
|
40
|
+
"@embedpdf/plugin-interaction": "3.0.0-next.11",
|
|
41
|
+
"@embedpdf/plugin-actions": "3.0.0-next.11",
|
|
42
|
+
"@embedpdf/web": "3.0.0-next.11",
|
|
43
|
+
"@embedpdf/plugin-render": "3.0.0-next.11"
|
|
38
44
|
},
|
|
39
45
|
"peerDependencies": {
|
|
40
46
|
"@angular/common": ">=20.2.0 <23.0.0",
|