@embedpdf/angular 3.0.0-next.13 → 3.0.0-next.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/README.md +309 -0
  2. package/dist/README.md +309 -0
  3. package/dist/actions/index.d.ts +34 -16
  4. package/dist/anchored/index.d.ts +67 -0
  5. package/dist/annotation/index.d.ts +599 -0
  6. package/dist/commands/index.d.ts +109 -0
  7. package/dist/fesm2022/embedpdf-angular-actions.mjs +117 -36
  8. package/dist/fesm2022/embedpdf-angular-actions.mjs.map +1 -1
  9. package/dist/fesm2022/embedpdf-angular-anchored.mjs +148 -0
  10. package/dist/fesm2022/embedpdf-angular-anchored.mjs.map +1 -0
  11. package/dist/fesm2022/embedpdf-angular-annotation.mjs +1960 -0
  12. package/dist/fesm2022/embedpdf-angular-annotation.mjs.map +1 -0
  13. package/dist/fesm2022/embedpdf-angular-commands.mjs +235 -0
  14. package/dist/fesm2022/embedpdf-angular-commands.mjs.map +1 -0
  15. package/dist/fesm2022/embedpdf-angular-form.mjs +1074 -0
  16. package/dist/fesm2022/embedpdf-angular-form.mjs.map +1 -0
  17. package/dist/fesm2022/embedpdf-angular-history.mjs +54 -0
  18. package/dist/fesm2022/embedpdf-angular-history.mjs.map +1 -0
  19. package/dist/fesm2022/embedpdf-angular-i18n.mjs +100 -0
  20. package/dist/fesm2022/embedpdf-angular-i18n.mjs.map +1 -0
  21. package/dist/fesm2022/embedpdf-angular-interaction.mjs +157 -0
  22. package/dist/fesm2022/embedpdf-angular-interaction.mjs.map +1 -0
  23. package/dist/fesm2022/embedpdf-angular-link.mjs +306 -0
  24. package/dist/fesm2022/embedpdf-angular-link.mjs.map +1 -0
  25. package/dist/fesm2022/embedpdf-angular-measurement.mjs +106 -0
  26. package/dist/fesm2022/embedpdf-angular-measurement.mjs.map +1 -0
  27. package/dist/fesm2022/embedpdf-angular-metadata.mjs +77 -0
  28. package/dist/fesm2022/embedpdf-angular-metadata.mjs.map +1 -0
  29. package/dist/fesm2022/embedpdf-angular-page-edit.mjs +65 -0
  30. package/dist/fesm2022/embedpdf-angular-page-edit.mjs.map +1 -0
  31. package/dist/fesm2022/embedpdf-angular-page-view.mjs +297 -0
  32. package/dist/fesm2022/embedpdf-angular-page-view.mjs.map +1 -0
  33. package/dist/fesm2022/embedpdf-angular-redaction.mjs +93 -0
  34. package/dist/fesm2022/embedpdf-angular-redaction.mjs.map +1 -0
  35. package/dist/fesm2022/embedpdf-angular-render.mjs +331 -69
  36. package/dist/fesm2022/embedpdf-angular-render.mjs.map +1 -1
  37. package/dist/fesm2022/embedpdf-angular-runtime.mjs +1147 -390
  38. package/dist/fesm2022/embedpdf-angular-runtime.mjs.map +1 -1
  39. package/dist/fesm2022/embedpdf-angular-search.mjs +251 -0
  40. package/dist/fesm2022/embedpdf-angular-search.mjs.map +1 -0
  41. package/dist/fesm2022/embedpdf-angular-selection.mjs +477 -0
  42. package/dist/fesm2022/embedpdf-angular-selection.mjs.map +1 -0
  43. package/dist/fesm2022/embedpdf-angular-shell.mjs +177 -0
  44. package/dist/fesm2022/embedpdf-angular-shell.mjs.map +1 -0
  45. package/dist/fesm2022/embedpdf-angular-signature.mjs +120 -0
  46. package/dist/fesm2022/embedpdf-angular-signature.mjs.map +1 -0
  47. package/dist/fesm2022/embedpdf-angular-stage.mjs +688 -288
  48. package/dist/fesm2022/embedpdf-angular-stage.mjs.map +1 -1
  49. package/dist/fesm2022/embedpdf-angular-stamp.mjs +169 -0
  50. package/dist/fesm2022/embedpdf-angular-stamp.mjs.map +1 -0
  51. package/dist/fesm2022/embedpdf-angular-testing.mjs +89 -0
  52. package/dist/fesm2022/embedpdf-angular-testing.mjs.map +1 -0
  53. package/dist/fesm2022/embedpdf-angular-toolbar.mjs +1123 -0
  54. package/dist/fesm2022/embedpdf-angular-toolbar.mjs.map +1 -0
  55. package/dist/fesm2022/embedpdf-angular-view-manager.mjs +69 -0
  56. package/dist/fesm2022/embedpdf-angular-view-manager.mjs.map +1 -0
  57. package/dist/fesm2022/embedpdf-angular.mjs +23 -3
  58. package/dist/fesm2022/embedpdf-angular.mjs.map +1 -1
  59. package/dist/form/index.d.ts +79 -0
  60. package/dist/history/index.d.ts +28 -0
  61. package/dist/i18n/index.d.ts +52 -0
  62. package/dist/index.d.ts +20 -0
  63. package/dist/interaction/index.d.ts +58 -0
  64. package/dist/link/index.d.ts +77 -0
  65. package/dist/measurement/index.d.ts +46 -0
  66. package/dist/metadata/index.d.ts +51 -0
  67. package/dist/page-edit/index.d.ts +22 -0
  68. package/dist/page-view/index.d.ts +94 -0
  69. package/dist/redaction/index.d.ts +38 -0
  70. package/dist/render/index.d.ts +45 -6
  71. package/dist/runtime/index.d.ts +579 -199
  72. package/dist/search/index.d.ts +71 -0
  73. package/dist/selection/index.d.ts +141 -0
  74. package/dist/shell/index.d.ts +88 -0
  75. package/dist/signature/index.d.ts +45 -0
  76. package/dist/stage/index.d.ts +242 -141
  77. package/dist/stamp/index.d.ts +58 -0
  78. package/dist/testing/index.d.ts +53 -0
  79. package/dist/toolbar/index.d.ts +257 -0
  80. package/dist/view-manager/index.d.ts +23 -0
  81. package/package.json +135 -14
@@ -1,180 +1,281 @@
1
1
  import * as _embedpdf_plugin_stage from '@embedpdf/plugin-stage';
2
- import { VisiblePage, PageFrame, StageCapability } from '@embedpdf/plugin-stage';
2
+ import { StagePluginOptions, StageCapability, StageSettings, VisiblePage } from '@embedpdf/plugin-stage';
3
3
  export * from '@embedpdf/plugin-stage';
4
+ import { EmbedPdfFeature, EpdfPageContext, EpdfKernelHost, CapabilityBinding, EpdfDocumentScopeRef } from '@embedpdf/angular/runtime';
4
5
  import * as _angular_core from '@angular/core';
5
6
  import { TemplateRef, Signal } from '@angular/core';
6
- import { EpdfPageContext, CapabilityToken } from '@embedpdf/angular/runtime';
7
- import * as _embedpdf_core_geometry from '@embedpdf/core-geometry';
8
- import * as _embedpdf_angular_stage from '@embedpdf/angular/stage';
9
7
  import * as _embedpdf_core from '@embedpdf/core';
8
+ import { CapabilityToken, PageRef, OpenSource } from '@embedpdf/core';
9
+ import * as rxjs from 'rxjs';
10
+ import * as _embedpdf_core_geometry from '@embedpdf/core-geometry';
11
+ import { PageFrame } from '@embedpdf/core-geometry';
10
12
  import * as _embedpdf_core_stage from '@embedpdf/core-stage';
13
+ import { StageHostCapability, ScrollMetrics } from '@embedpdf/plugin-stage/contract/host';
14
+ import { EpdfProjectorBinding } from '@embedpdf/angular/anchored';
15
+ import * as _embedpdf_web from '@embedpdf/web';
16
+
17
+ /**
18
+ * `withStage(options)`: the Stage plugin, as a feature of `provideEmbedPdf()`. Give it twice
19
+ * for a second view, with its own `id` and `token`:
20
+ *
21
+ * provideEmbedPdf({ engine }, withStage(), withStage({ id: 'stage-thumbs', token: ThumbsToken }))
22
+ *
23
+ * `inject(EpdfStageRef)` is the Stage's API: inside `<epdf-stage>` that Stage, anywhere else the
24
+ * main view of the document in scope.
25
+ */
26
+
27
+ declare function withStage(options?: StagePluginOptions): EmbedPdfFeature;
11
28
 
12
29
  /**
13
- * The render-prop translation: React's `children: (page) => ReactNode` becomes
14
- * marker directives on `<ng-template>`, typed so `let-page` infers
15
- * `EpdfPageContext` in the template.
30
+ * The templates a Stage draws each page with. React's page function becomes a marker directive
31
+ * on an `<ng-template>`, typed so `let-page` is the page context:
16
32
  *
17
33
  * <epdf-stage>
18
- * <ng-template epdfPage> page-space content (rotates)
19
- * <ng-template epdfPageChrome> box-space chrome (never rotates)
34
+ * <ng-template epdfPage> on the page: turns with it (layers)
35
+ * <ng-template epdfPageChrome> around the page: never turns (labels, buttons)
20
36
  *
21
- * The `$implicit` context is the SAME stable object the per-page injector
22
- * provides as `EPDF_PAGE` — `let-page` is sugar for inline chrome; components
23
- * inside the template just call `injectPage()`.
37
+ * `let-page` is the same context a component inside the template gets from `injectPage()`.
24
38
  */
25
39
 
26
40
  interface EpdfPageTemplateContext {
27
41
  $implicit: EpdfPageContext;
28
42
  }
29
- /** PAGE-SPACE content for each visible page (RenderLayer, annotations,
30
- * markers). Rendered inside the page's content frame, so it ROTATES with the
31
- * page's display rotation — coordinates are plain PDF points. */
43
+ /**
44
+ * What each visible page draws: the render layer, text selection, annotations, your markers.
45
+ * It sits in the page's content box and turns with the page, so positions in it are page
46
+ * coordinates.
47
+ */
32
48
  declare class EpdfPageTemplate {
33
49
  readonly template: TemplateRef<EpdfPageTemplateContext>;
34
- static ngTemplateContextGuard(_dir: EpdfPageTemplate, ctx: unknown): ctx is EpdfPageTemplateContext;
50
+ static ngTemplateContextGuard(_directive: EpdfPageTemplate, context: unknown): context is EpdfPageTemplateContext;
35
51
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EpdfPageTemplate, never>;
36
52
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<EpdfPageTemplate, "ng-template[epdfPage]", never, {}, {}, never, never, true, never>;
37
53
  }
38
- /** BOX-SPACE chrome for each visible page (page-number label, selection
39
- * border, per-page buttons). Rendered into the OUTER box (content + reserved
40
- * `pageFrame`), so it does NOT rotate and the reserved bands are plain
41
- * regions (`bottom: 0; height: page.frame().bottom`). */
54
+ /**
55
+ * What goes around each visible page: a page number, a border, a row of buttons. It fills the
56
+ * page's box with the bands `pageFrame` reserves, and never turns, so a label in the bottom
57
+ * band is `bottom: 0` with `[style.height.px]="page.frame().bottom"`.
58
+ */
42
59
  declare class EpdfPageChrome {
43
60
  readonly template: TemplateRef<EpdfPageTemplateContext>;
44
- static ngTemplateContextGuard(_dir: EpdfPageChrome, ctx: unknown): ctx is EpdfPageTemplateContext;
61
+ static ngTemplateContextGuard(_directive: EpdfPageChrome, context: unknown): context is EpdfPageTemplateContext;
45
62
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EpdfPageChrome, never>;
46
63
  static ɵdir: _angular_core.ɵɵDirectiveDeclaration<EpdfPageChrome, "ng-template[epdfPageChrome]", never, {}, {}, never, never, true, never>;
47
64
  }
48
65
 
49
- declare class EpdfPageSurface {
50
- readonly vp: _angular_core.InputSignal<VisiblePage>;
51
- readonly frame: _angular_core.InputSignal<PageFrame>;
52
- readonly documentId: _angular_core.InputSignal<string>;
53
- readonly pageTpl: _angular_core.InputSignal<TemplateRef<EpdfPageTemplateContext>>;
54
- readonly chromeTpl: _angular_core.InputSignal<TemplateRef<EpdfPageTemplateContext> | null>;
55
- protected readonly t: _angular_core.Signal<_embedpdf_core_geometry.PageTransform>;
56
- protected readonly left: _angular_core.Signal<number>;
57
- protected readonly top: _angular_core.Signal<number>;
58
- protected readonly outerWidth: _angular_core.Signal<number>;
59
- protected readonly outerHeight: _angular_core.Signal<number>;
60
- protected readonly contentLeft: _angular_core.Signal<number>;
61
- protected readonly contentTop: _angular_core.Signal<number>;
62
- protected readonly rotate: _angular_core.Signal<string | null>;
63
- private readonly contentEl;
64
- /** ONE stable context per surface — volatile parts are signals inside it. */
65
- readonly page: EpdfPageContext;
66
- /** ONE stable injector per surface (see the invariant above), parented to
67
- * this surface's node injector so layers also reach the kernel host. */
68
- protected readonly pageInjector: _angular_core.DestroyableInjector;
69
- protected readonly templateContext: EpdfPageTemplateContext;
70
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<EpdfPageSurface, never>;
71
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<EpdfPageSurface, "epdf-page-surface", never, { "vp": { "alias": "vp"; "required": true; "isSignal": true; }; "frame": { "alias": "frame"; "required": true; "isSignal": true; }; "documentId": { "alias": "documentId"; "required": true; "isSignal": true; }; "pageTpl": { "alias": "pageTpl"; "required": true; "isSignal": true; }; "chromeTpl": { "alias": "chromeTpl"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
66
+ /** The view a Stage drives: the main one (`StageToken`), or one registered with its own token. */
67
+ type StageTokenProp = CapabilityToken<StageCapability>;
68
+ declare class EpdfStageRef {
69
+ /** The viewer the view is in. */
70
+ protected readonly host: EpdfKernelHost;
71
+ /** The view, for the document in scope: inside `<epdf-stage>`, the Stage's own. */
72
+ protected readonly binding: CapabilityBinding<StageHostCapability>;
73
+ /** The view it drives: the main one. `<epdf-stage>` drives the one its `[token]` names. */
74
+ protected view(): StageTokenProp;
75
+ /** What an error says was used without a viewer. */
76
+ protected usedAs(): string;
77
+ private readonly state;
78
+ /** The zoom as a number: `1` is 100%. */
79
+ readonly zoomLevel: Signal<number>;
80
+ /** The fit mode, such as `'fit-width'`, or `'custom'` after a pinch or an exact level. */
81
+ readonly zoomMode: Signal<_embedpdf_core_stage.ZoomModeValue | "custom">;
82
+ /** The current page's place in the document, from 0. */
83
+ readonly currentPageIndex: Signal<number>;
84
+ /** The current page's ref, or null before the document has pages. */
85
+ readonly currentPage: Signal<PageRef | null>;
86
+ /** How many pages the document has. */
87
+ readonly pageCount: Signal<number>;
88
+ /** How the view is turned: `0`, `90`, `180` or `270`. */
89
+ readonly viewRotation: Signal<_embedpdf_core_geometry.PageRotation>;
90
+ /** The names of the responsive rules that apply now, in order. */
91
+ readonly activeRules: Signal<readonly string[]>;
92
+ /** The view's settings; the defaults without a document. Change them with `updateSettings()`. */
93
+ readonly settings: Signal<StageSettings>;
94
+ /** The scroll position as a scrolling element has it, in screen pixels; all zero without a document. */
95
+ readonly scrollMetrics: Signal<ScrollMetrics>;
96
+ /** Another page became the current one: `page`, `pageIndex`, `previousPageIndex`. */
97
+ readonly pageChanged$: rxjs.Observable<_embedpdf_plugin_stage.StagePageChangedEvent>;
98
+ /** The zoom level changed: `level`, `previousLevel`, `mode`. */
99
+ readonly zoomChanged$: rxjs.Observable<_embedpdf_plugin_stage.StageZoomChangedEvent>;
100
+ /** The view moved, on every frame of a scroll or zoom: `camera`. */
101
+ readonly cameraChanged$: rxjs.Observable<_embedpdf_plugin_stage.StageCameraChangedEvent>;
102
+ /** Scrolling, a fling or an animated move came to rest: `camera`. */
103
+ readonly motionEnded$: rxjs.Observable<_embedpdf_plugin_stage.StageMotionEndedEvent>;
104
+ /** The Stage itself changed size: `size`. */
105
+ readonly viewportChanged$: rxjs.Observable<_embedpdf_plugin_stage.StageViewportChangedEvent>;
106
+ /** A setting changed, by a call or a responsive rule: `settings`, `changed`. */
107
+ readonly settingsChanged$: rxjs.Observable<_embedpdf_plugin_stage.StageSettingsChangedEvent>;
108
+ readonly getCamera: () => _embedpdf_core_stage.Camera;
109
+ readonly setCamera: (camera: _embedpdf_core_stage.Camera) => void;
110
+ readonly getViewportSize: () => _embedpdf_core_geometry.Size;
111
+ readonly getZoomLevel: () => number;
112
+ readonly getZoomMode: () => _embedpdf_core_stage.ZoomModeValue | "custom";
113
+ readonly getViewRotation: () => _embedpdf_core_geometry.PageRotation;
114
+ readonly getCurrentPage: () => PageRef | null;
115
+ readonly getCurrentPageIndex: () => number;
116
+ readonly getPageCount: () => number;
117
+ readonly listCurrentItemPages: () => readonly _embedpdf_core.PageInfo[];
118
+ readonly listVisiblePages: () => readonly _embedpdf_plugin_stage.VisiblePage[];
119
+ readonly isPageVisible: (page: PageRef | number) => boolean;
120
+ readonly getViewpoint: () => _embedpdf_plugin_stage.Viewpoint;
121
+ readonly getViewState: () => _embedpdf_plugin_stage.StageViewState;
122
+ readonly applyViewState: (view: _embedpdf_plugin_stage.StageViewState) => void;
123
+ readonly isMoving: () => boolean;
124
+ readonly stopMotion: () => void;
125
+ readonly zoomTo: (zoom: number | _embedpdf_core_stage.ZoomSpec, options?: _embedpdf_plugin_stage.ZoomToOptions) => void;
126
+ readonly zoomBy: (factor: number, options?: _embedpdf_plugin_stage.ZoomToOptions) => void;
127
+ readonly zoomIn: () => void;
128
+ readonly zoomOut: () => void;
129
+ readonly fitWidth: () => void;
130
+ readonly fitPage: () => void;
131
+ readonly fitAll: () => void;
132
+ readonly fitAutomatic: () => void;
133
+ readonly goToPage: (page: PageRef | number, options?: _embedpdf_plugin_stage.GoToOptions) => void;
134
+ readonly goToDestination: (destination: _embedpdf_core.PageDestination, options?: _embedpdf_plugin_stage.GoToDestinationOptions) => void;
135
+ readonly goToFirstPage: (options?: _embedpdf_plugin_stage.GoToOptions) => void;
136
+ readonly goToLastPage: (options?: _embedpdf_plugin_stage.GoToOptions) => void;
137
+ readonly nextPage: (options?: _embedpdf_plugin_stage.GoToOptions) => void;
138
+ readonly previousPage: (options?: _embedpdf_plugin_stage.GoToOptions) => void;
139
+ readonly canGoNext: () => boolean;
140
+ readonly canGoPrevious: () => boolean;
141
+ readonly reveal: (page: PageRef | number, options?: _embedpdf_plugin_stage.RevealOptions) => void;
142
+ readonly scrollTo: (options: _embedpdf_plugin_stage.StageScrollToOptions) => void;
143
+ readonly scrollBy: (options: _embedpdf_plugin_stage.StageScrollToOptions) => void;
144
+ readonly panBy: (dxViewport: number, dyViewport: number) => void;
145
+ readonly resetView: () => void;
146
+ readonly setViewRotation: (rotation: _embedpdf_core_geometry.PageRotation) => void;
147
+ readonly rotateViewBy: (delta: 90 | -90) => void;
148
+ readonly getSettings: () => StageSettings;
149
+ readonly updateSettings: (changes: _embedpdf_plugin_stage.StageSettingsPatch) => void;
150
+ readonly resetSettings: () => void;
151
+ readonly setResponsiveRules: (rules: readonly _embedpdf_plugin_stage.ResponsiveRule[]) => void;
152
+ readonly listActiveRules: () => readonly string[];
153
+ readonly matchesRule: (name: string) => boolean;
154
+ readonly getPageAt: (point: _embedpdf_plugin_stage.ViewportPoint) => {
155
+ ref: PageRef;
156
+ point: _embedpdf_core_geometry.Point;
157
+ scale: number;
158
+ rotation: _embedpdf_core_geometry.PageRotation;
159
+ zoom: number;
160
+ } | null;
161
+ readonly viewportToPage: (page: PageRef | number, point: _embedpdf_plugin_stage.ViewportPoint) => _embedpdf_core_geometry.Point | null;
162
+ readonly pageToViewport: (page: PageRef | number, point: _embedpdf_core_geometry.Point) => _embedpdf_plugin_stage.ViewportPoint | null;
163
+ readonly pageRectToViewport: (page: PageRef | number, rect: _embedpdf_core_geometry.Rect) => _embedpdf_plugin_stage.ViewportRect | null;
164
+ readonly getPageFrame: (page: PageRef | number) => _embedpdf_plugin_stage.VisiblePage | null;
165
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<EpdfStageRef, never>;
166
+ static ɵprov: _angular_core.ɵɵInjectableDeclaration<EpdfStageRef>;
72
167
  }
73
168
 
74
- /** Which stage lens to bind to. Defaults to the main StageToken — pass a custom
75
- * token to drive an additional lens (e.g. a wrapped thumbnail sidebar). */
76
- type StageTokenProp = CapabilityToken<StageCapability>;
77
- declare class EpdfStage {
169
+ declare class EpdfStage extends EpdfStageRef {
170
+ /** The view to drive: a token registered with `withStage({ token })`; the main view without one. */
171
+ readonly token: _angular_core.InputSignal<StageTokenProp | undefined>;
172
+ /** A document to open for this Stage. A new value opens it and closes the one before. */
173
+ readonly document: _angular_core.InputSignal<OpenSource | null | undefined>;
174
+ /** The current page's index, from 0: `[(page)]`. Setting it goes to that page. */
175
+ readonly page: _angular_core.InputSignal<number | undefined>;
176
+ /** Another page became the current one: its index. The output half of `[(page)]`. */
177
+ readonly pageChange: _angular_core.OutputEmitterRef<number>;
178
+ /** The zoom level, `1` for 100%: `[(zoom)]`. Setting it zooms there. */
179
+ readonly zoom: _angular_core.InputSignal<number | undefined>;
180
+ /** The zoom level changed. The output half of `[(zoom)]`. */
181
+ readonly zoomChange: _angular_core.OutputEmitterRef<number>;
182
+ private readonly ownDocument;
183
+ /** The document this Stage shows, for what's inside it: its own `[document]`, else its scope's. */
184
+ readonly documentScope: EpdfDocumentScopeRef;
185
+ /** The view's capability, or null without a document. */
186
+ protected readonly hostCapability: Signal<StageHostCapability | null>;
187
+ protected view(): StageTokenProp;
188
+ protected usedAs(): string;
189
+ /** The pages on screen, each with its place and transform: a new list every camera frame. */
190
+ protected readonly pages: Signal<readonly VisiblePage[]>;
191
+ protected readonly frame: Signal<PageFrame>;
192
+ protected readonly documentId: Signal<string | null>;
193
+ /** The viewer's `page` settings: each page's background and shadow. */
194
+ protected readonly look: Signal<_embedpdf_core.ViewerPageSettings>;
195
+ private readonly pageTemplateDirective;
196
+ private readonly chromeTemplateDirective;
197
+ protected readonly pageTemplate: Signal<TemplateRef<EpdfPageTemplateContext> | null>;
198
+ protected readonly chromeTemplate: Signal<TemplateRef<EpdfPageTemplateContext> | null>;
199
+ private readonly interaction;
200
+ private readonly panFallback;
201
+ private readonly zoomGestures;
202
+ /** The interaction hub of this Stage's document: the active tool takes the pointer. */
203
+ private readonly hub;
204
+ private readonly usesHub;
205
+ private readonly hubCursor;
206
+ /** The hub's cursor (text, grab, a tool's own), while the hub takes this Stage's pointer. */
207
+ protected readonly cursor: Signal<string | null>;
78
208
  /**
79
- * Route this Stage's pointer events to the interaction hub (page-resolved via
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.
209
+ * How anchored UI (`<epdf-anchored>`) inside the Stage follows the camera: a projection
210
+ * through the view, and the visible pages as its revision, so the pages and the UI on them
211
+ * update in the same change detection pass and never a frame apart.
90
212
  */
91
- readonly interaction: _angular_core.InputSignal<boolean>;
213
+ readonly projection: EpdfProjectorBinding;
214
+ constructor();
215
+ /** `[document]`: open it for this Stage once the viewer runs; close it when the value changes. */
216
+ private followDocumentInput;
92
217
  /**
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.
218
+ * `[(page)]` and `[(zoom)]`. A value from the parent moves the view there; a move of the view
219
+ * (scroll, pinch, a button) goes out as `pageChange` and `zoomChange`. When the Stage changes
220
+ * documents (another tab), the new document keeps its own place and reports it.
96
221
  */
97
- readonly panFallback: _angular_core.InputSignal<boolean>;
222
+ private followPageAndZoom;
98
223
  /**
99
- * Ambient ZOOM gestures on this stage: ctrl/cmd+wheel and trackpad pinch
100
- * (Safari gesture events included). Default true. Turn OFF for follower
101
- * lenses with a fixed magnification (a thumbnail rail should scroll under
102
- * cmd+wheel, not zoom); pinches are still swallowed either way.
224
+ * The browser side: the viewport size and pixel ratio, wheel and touch gestures, and the
225
+ * pointer going to the interaction hub. All of it is `@embedpdf/web`'s, shared by every
226
+ * framework, so the Stage feels the same everywhere; this binds it again when the view, the
227
+ * hub or the input settings change.
103
228
  */
104
- readonly zoomGestures: _angular_core.InputSignal<boolean>;
105
- /** The stage lens to drive (default: the main StageToken). */
106
- readonly token: _angular_core.InputSignal<StageTokenProp>;
107
- private readonly host;
108
- private readonly stage;
109
- private readonly ix;
110
- private readonly useHub;
111
- private readonly hubCursor;
112
- protected readonly cursor: _angular_core.Signal<string | null>;
113
- protected readonly documentId: _angular_core.Signal<string | null>;
114
- protected readonly pages: _angular_core.Signal<VisiblePage[]>;
115
- protected readonly frame: _angular_core.Signal<PageFrame>;
116
- private readonly pageTemplateDir;
117
- private readonly chromeTemplateDir;
118
- protected readonly pageTemplate: _angular_core.Signal<_angular_core.TemplateRef<_embedpdf_angular_stage.EpdfPageTemplateContext> | null>;
119
- protected readonly chromeTemplate: _angular_core.Signal<_angular_core.TemplateRef<_embedpdf_angular_stage.EpdfPageTemplateContext> | null>;
120
- constructor();
229
+ private bindSurface;
121
230
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<EpdfStage, 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>;
231
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EpdfStage, "epdf-stage", ["epdfStage"], { "token": { "alias": "token"; "required": false; "isSignal": true; }; "document": { "alias": "document"; "required": false; "isSignal": true; }; "page": { "alias": "page"; "required": false; "isSignal": true; }; "zoom": { "alias": "zoom"; "required": false; "isSignal": true; }; }, { "pageChange": "pageChange"; "zoomChange": "zoomChange"; }, ["pageTemplateDirective", "chromeTemplateDirective"], ["*"], true, never>;
123
232
  }
124
233
 
125
- declare function injectStage(token?: StageTokenProp): Signal<StageCapability>;
126
- declare function injectZoom(token?: StageTokenProp): {
127
- zoom: Signal<number>;
128
- /** Active zoom intent: 'automatic' | 'fit-page' | 'fit-width' | 'fit-all' | 'custom'. */
129
- mode: Signal<_embedpdf_core_stage.ZoomModeValue | "custom">;
130
- zoomIn: () => void;
131
- zoomOut: () => void;
132
- fitWidth: () => void;
133
- fitPage: () => void;
134
- fitAll: () => void;
135
- automatic: () => void;
136
- zoomTo: (spec: _embedpdf_core_stage.ZoomSpec) => void;
137
- };
138
- declare function injectPages(token?: StageTokenProp): {
139
- currentPage: Signal<number>;
140
- pageCount: Signal<number>;
141
- goToPage: (pageIndex: number, opts?: _embedpdf_plugin_stage.GoToOptions) => void;
142
- next: (opts?: _embedpdf_plugin_stage.GoToOptions) => void;
143
- prev: (opts?: _embedpdf_plugin_stage.GoToOptions) => void;
144
- reveal: (pageIndex: number, opts?: _embedpdf_plugin_stage.RevealOptions) => void;
145
- };
146
- declare function injectLayout(token?: StageTokenProp): {
147
- flow: Signal<_embedpdf_plugin_stage.FlowMode>;
148
- layout: Signal<_embedpdf_plugin_stage.LayoutKind>;
149
- spread: Signal<_embedpdf_core_stage.SpreadMode>;
150
- sizing: Signal<_embedpdf_core_stage.SizingMode>;
151
- bounded: Signal<boolean>;
152
- setFlow: (flow: _embedpdf_plugin_stage.FlowMode) => void;
153
- setLayout: (layout: _embedpdf_plugin_stage.LayoutKind) => void;
154
- setSpread: (spread: _embedpdf_core_stage.SpreadMode) => void;
155
- setSizing: (sizing: _embedpdf_core_stage.SizingMode) => void;
156
- setBounded: (bounded: boolean) => void;
157
- };
158
- /** The document's page list (with PDF labels) + the current item's pages — the
159
- * data for page thumbnails / worksheet-style page tabs. */
160
- declare function injectPageList(token?: StageTokenProp): {
161
- pages: Signal<{
162
- index: number;
163
- pon: _embedpdf_core.PageObjectNumber;
164
- label: string | null;
165
- }[]>;
166
- currentItemPages: Signal<number[]>;
167
- };
168
- /**
169
- * All Stage settings + the batch `update`. The seam for "presets are a customer
170
- * concern": keep your own `Partial<StageSettings>` objects and apply them with
171
- * `update(preset)` (one anchor-preserving change).
172
- */
173
- declare function injectStageSettings(token?: StageTokenProp): {
174
- settings: Signal<_embedpdf_plugin_stage.StageSettings>;
175
- update: (patch: Partial<_embedpdf_plugin_stage.StageSettings>) => void;
176
- reset: () => void;
177
- };
234
+ type ScrollbarAxis = 'x' | 'y';
235
+ declare class EpdfScrollbar {
236
+ /** `'y'` for a vertical bar, `'x'` for a horizontal one. */
237
+ readonly axis: _angular_core.InputSignal<ScrollbarAxis>;
238
+ /**
239
+ * Hide this many milliseconds after the view stops moving (hover and dragging keep it shown;
240
+ * a hidden bar ignores the pointer, like macOS), or `false` to always show it.
241
+ */
242
+ readonly autoHide: _angular_core.InputSignalWithTransform<number | false, string | number | false>;
243
+ /** The shortest thumb, in pixels, so it never vanishes on a long document. */
244
+ readonly minThumbSize: _angular_core.InputSignal<number>;
245
+ /**
246
+ * Pressing the track: `'page'` steps 90% of a view toward the pointer and repeats while held;
247
+ * `'jump'` puts the thumb under the pointer and goes on as a drag.
248
+ */
249
+ readonly trackPress: _angular_core.InputSignal<"page" | "jump">;
250
+ /** The thumb's class. */
251
+ readonly thumbClass: _angular_core.InputSignal<string | null>;
252
+ private readonly stage;
253
+ private readonly element;
254
+ private readonly trackPx;
255
+ protected readonly dragging: _angular_core.WritableSignal<boolean>;
256
+ protected readonly hovered: _angular_core.WritableSignal<boolean>;
257
+ /** The view moved a moment ago. */
258
+ private readonly active;
259
+ protected readonly vertical: _angular_core.Signal<boolean>;
260
+ protected readonly scrollable: _angular_core.Signal<boolean>;
261
+ /** The thumb along the track: one formula for drawing, dragging and paging, in every framework. */
262
+ protected readonly layout: _angular_core.Signal<_embedpdf_web.ScrollbarLayout>;
263
+ protected readonly shown: _angular_core.Signal<boolean>;
264
+ protected readonly thumbColor: string;
265
+ protected readonly round: (x: number) => number;
266
+ /** Thumb drags, track paging and jumps: `@embedpdf/web`'s, shared by every framework. */
267
+ private readonly presses;
268
+ constructor();
269
+ /** The bar as it is now, for `@embedpdf/web`'s press handling. */
270
+ private track;
271
+ protected onThumbDown(event: PointerEvent): void;
272
+ protected onTrackDown(event: PointerEvent): void;
273
+ /** Pointer capture sends the moves here, for thumb drags, jump drags and paging alike. */
274
+ protected onMove(event: PointerEvent): void;
275
+ protected endDrag(): void;
276
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<EpdfScrollbar, never>;
277
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EpdfScrollbar, "epdf-scrollbar", never, { "axis": { "alias": "axis"; "required": true; "isSignal": true; }; "autoHide": { "alias": "autoHide"; "required": false; "isSignal": true; }; "minThumbSize": { "alias": "minThumbSize"; "required": false; "isSignal": true; }; "trackPress": { "alias": "trackPress"; "required": false; "isSignal": true; }; "thumbClass": { "alias": "thumbClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
278
+ }
178
279
 
179
- export { EpdfPageChrome, EpdfPageSurface, EpdfPageTemplate, EpdfStage, injectLayout, injectPageList, injectPages, injectStage, injectStageSettings, injectZoom };
180
- export type { EpdfPageTemplateContext, StageTokenProp };
280
+ export { EpdfPageChrome, EpdfPageTemplate, EpdfScrollbar, EpdfStage, EpdfStageRef, withStage };
281
+ export type { EpdfPageTemplateContext, ScrollbarAxis, StageTokenProp };
@@ -0,0 +1,58 @@
1
+ import * as _embedpdf_plugin_stamp from '@embedpdf/plugin-stamp';
2
+ import { StampAsset, StampLibrary, StampAssetFilter, persistStampLibraries as persistStampLibraries$1, StampLibraryStore, StampConfig } from '@embedpdf/plugin-stamp';
3
+ export * from '@embedpdf/plugin-stamp';
4
+ export { ByteStore, indexedDbByteStore } from '@embedpdf/web';
5
+ import * as _embedpdf_angular_runtime from '@embedpdf/angular/runtime';
6
+ import { EmbedPdfFeature } from '@embedpdf/angular/runtime';
7
+ import * as i0 from '@angular/core';
8
+ import { Signal } from '@angular/core';
9
+
10
+ declare const EpdfStamp_base: _embedpdf_angular_runtime.PluginServiceClass<_embedpdf_plugin_stamp.StampCapability, {
11
+ armedAsset: StampAsset | null;
12
+ }, "disarm" | "importLibrary" | "listLibraries" | "getLibrary" | "listAssets" | "getAsset" | "getAssetPreview" | "renderAssetPreview" | "readAssetBytes" | "createLibrary" | "updateLibrary" | "deleteLibrary" | "exportLibrary" | "createAsset" | "createAssetFromAnnotations" | "updateAsset" | "deleteAsset" | "moveAsset" | "duplicateAsset" | "armAsset" | "getArmedAsset" | "placeAsset" | "placeAssetOnPages" | "canPlace" | "canCreateFromAnnotations" | "canImport", "onLibraryCreated" | "onLibraryUpdated" | "onLibraryDeleted" | "onAssetCreated" | "onAssetUpdated" | "onAssetDeleted" | "onArmChanged" | "onLibraryChanged">;
13
+ /**
14
+ * Stamps: the libraries and their stamps, shared by every document, and arming and placing
15
+ * them on the document in scope (`[epdfDocumentScope]`), else the active one. The Stamps page's
16
+ * methods, `armedAsset()` as a signal, the events as streams (`libraryChanged$`, `armChanged$`,
17
+ * …), and the settings. The libraries work without a document; a placing call refuses with
18
+ * `not-ready` until one is open.
19
+ */
20
+ declare class EpdfStamp extends EpdfStamp_base {
21
+ /**
22
+ * Every library, in the order they were added. It changes when a library is added, renamed
23
+ * or removed; filter it for the kinds a picker shows (`library.kind`).
24
+ */
25
+ readonly libraries: Signal<readonly StampLibrary[]>;
26
+ /**
27
+ * The stamps in the order a picker shows them: one library's (`{ libraryId }`), one kind's or
28
+ * category's, or every stamp. Pass a function (`() => ({ libraryId: this.libraryId() })`) and
29
+ * it follows the signals it reads. It changes when a stamp is added, renamed or removed.
30
+ */
31
+ assetsOf(filter?: StampAssetFilter | (() => StampAssetFilter | undefined)): Signal<readonly StampAsset[]>;
32
+ /**
33
+ * An image URL for a stamp's picture (a picker's thumbnail), or null while it has none. Pass
34
+ * a function (`() => this.asset().id`) and it follows the stamp you show, and a picture that
35
+ * arrives after the stamp does.
36
+ *
37
+ * The URL is a browser resource that holds the picture's bytes, so it is released when the
38
+ * stamp changes and when the caller goes: call it in an injection context (a constructor or a
39
+ * field initializer).
40
+ */
41
+ previewUrlOf(assetId: string | null | (() => string | null)): Signal<string | null>;
42
+ static ɵfac: i0.ɵɵFactoryDeclaration<EpdfStamp, never>;
43
+ static ɵprov: i0.ɵɵInjectableDeclaration<EpdfStamp>;
44
+ }
45
+ /** Stamps, with their settings: `withStamp({ assetEngine: localEngine() })` on a cloud viewer. */
46
+ declare function withStamp(options?: StampConfig): EmbedPdfFeature;
47
+ /** What {@link persistStampLibraries} takes besides the stamps and the store. */
48
+ type PersistStampLibrariesOptions = NonNullable<Parameters<typeof persistStampLibraries$1>[2]>;
49
+ /**
50
+ * Keep every library in `store` from now on: a change writes the library's PDF (a burst of
51
+ * edits saves once), a removed library is deleted. `except` names the libraries never to store,
52
+ * such as the standard set you import on every visit. Returns the stop, for when the caller
53
+ * goes: `inject(DestroyRef).onDestroy(persistStampLibraries(stamp, store))`.
54
+ */
55
+ declare function persistStampLibraries(stamp: Pick<EpdfStamp, 'exportLibrary' | 'libraryChanged$'>, store: StampLibraryStore, options?: PersistStampLibrariesOptions): () => void;
56
+
57
+ export { EpdfStamp, persistStampLibraries, withStamp };
58
+ export type { PersistStampLibrariesOptions };
@@ -0,0 +1,53 @@
1
+ import { ComponentHarness, BaseHarnessFilters, HarnessPredicate, ContentContainerComponentHarness } from '@angular/cdk/testing';
2
+
3
+ /**
4
+ * Test harnesses for the viewer's components, built on `@angular/cdk/testing`: a test talks to
5
+ * the Stage and the search highlights the way a user does, through the page, instead of
6
+ * reaching into their internals.
7
+ *
8
+ * const loader = TestbedHarnessEnvironment.loader(fixture);
9
+ * const stage = await loader.getHarness(EpdfStageHarness);
10
+ * expect(await stage.getShownPageCount()).toBe(2);
11
+ * const [layer] = await stage.getAllHarnesses(EpdfSearchLayerHarness);
12
+ * await layer.clickHighlight(0); // (hitClick) emits the first match
13
+ *
14
+ * They read only what the components draw, so they keep working when the inside changes.
15
+ */
16
+
17
+ /**
18
+ * `<epdf-stage>`. It holds harnesses for what's drawn in it: `stage.getAllHarnesses(
19
+ * EpdfSearchLayerHarness)` gives the search layers of the pages on screen.
20
+ */
21
+ declare class EpdfStageHarness extends ContentContainerComponentHarness {
22
+ static hostSelector: string;
23
+ /** A Stage that matches `options`: `EpdfStageHarness.with({ selector: '.thumbnails' })`. */
24
+ static with(options?: BaseHarnessFilters): HarnessPredicate<EpdfStageHarness>;
25
+ private readonly pages;
26
+ /** How many pages are drawn now: the Stage draws only the ones on screen. */
27
+ getShownPageCount(): Promise<number>;
28
+ /** The cursor over the Stage: the one the active tool asks for, such as `text` over text. */
29
+ getCursor(): Promise<string>;
30
+ /** Turn the mouse wheel over the Stage: it scrolls, as a user's wheel does. */
31
+ scrollBy(deltaY: number, deltaX?: number): Promise<void>;
32
+ }
33
+ /**
34
+ * `<epdf-search-layer>`: the search's highlights on one page. A match over two lines is two
35
+ * highlights.
36
+ */
37
+ declare class EpdfSearchLayerHarness extends ComponentHarness {
38
+ static hostSelector: string;
39
+ /** A search layer that matches `options`. */
40
+ static with(options?: BaseHarnessFilters): HarnessPredicate<EpdfSearchLayerHarness>;
41
+ private readonly highlights;
42
+ private readonly activeHighlights;
43
+ /** How many highlights the page shows: one per line of each match on it. */
44
+ getHighlightCount(): Promise<number>;
45
+ /** How many of them belong to the active match: none when it's on another page. */
46
+ getActiveHighlightCount(): Promise<number>;
47
+ /** Whether the highlights take clicks: only while something listens to `(hitClick)`. */
48
+ isClickable(): Promise<boolean>;
49
+ /** Click the highlight at `index`, in the order the page draws them. */
50
+ clickHighlight(index: number): Promise<void>;
51
+ }
52
+
53
+ export { EpdfSearchLayerHarness, EpdfStageHarness };