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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/README.md +309 -0
  2. package/dist/README.md +309 -0
  3. package/dist/actions/index.d.ts +34 -16
  4. package/dist/anchored/index.d.ts +67 -0
  5. package/dist/annotation/index.d.ts +602 -0
  6. package/dist/attachment/index.d.ts +29 -0
  7. package/dist/commands/index.d.ts +109 -0
  8. package/dist/fesm2022/embedpdf-angular-actions.mjs +117 -36
  9. package/dist/fesm2022/embedpdf-angular-actions.mjs.map +1 -1
  10. package/dist/fesm2022/embedpdf-angular-anchored.mjs +148 -0
  11. package/dist/fesm2022/embedpdf-angular-anchored.mjs.map +1 -0
  12. package/dist/fesm2022/embedpdf-angular-annotation.mjs +1933 -0
  13. package/dist/fesm2022/embedpdf-angular-annotation.mjs.map +1 -0
  14. package/dist/fesm2022/embedpdf-angular-attachment.mjs +67 -0
  15. package/dist/fesm2022/embedpdf-angular-attachment.mjs.map +1 -0
  16. package/dist/fesm2022/embedpdf-angular-commands.mjs +235 -0
  17. package/dist/fesm2022/embedpdf-angular-commands.mjs.map +1 -0
  18. package/dist/fesm2022/embedpdf-angular-form.mjs +1074 -0
  19. package/dist/fesm2022/embedpdf-angular-form.mjs.map +1 -0
  20. package/dist/fesm2022/embedpdf-angular-history.mjs +54 -0
  21. package/dist/fesm2022/embedpdf-angular-history.mjs.map +1 -0
  22. package/dist/fesm2022/embedpdf-angular-i18n.mjs +100 -0
  23. package/dist/fesm2022/embedpdf-angular-i18n.mjs.map +1 -0
  24. package/dist/fesm2022/embedpdf-angular-interaction.mjs +157 -0
  25. package/dist/fesm2022/embedpdf-angular-interaction.mjs.map +1 -0
  26. package/dist/fesm2022/embedpdf-angular-link.mjs +306 -0
  27. package/dist/fesm2022/embedpdf-angular-link.mjs.map +1 -0
  28. package/dist/fesm2022/embedpdf-angular-measurement.mjs +106 -0
  29. package/dist/fesm2022/embedpdf-angular-measurement.mjs.map +1 -0
  30. package/dist/fesm2022/embedpdf-angular-metadata.mjs +77 -0
  31. package/dist/fesm2022/embedpdf-angular-metadata.mjs.map +1 -0
  32. package/dist/fesm2022/embedpdf-angular-outline.mjs +76 -0
  33. package/dist/fesm2022/embedpdf-angular-outline.mjs.map +1 -0
  34. package/dist/fesm2022/embedpdf-angular-page-edit.mjs +68 -0
  35. package/dist/fesm2022/embedpdf-angular-page-edit.mjs.map +1 -0
  36. package/dist/fesm2022/embedpdf-angular-page-view.mjs +297 -0
  37. package/dist/fesm2022/embedpdf-angular-page-view.mjs.map +1 -0
  38. package/dist/fesm2022/embedpdf-angular-redaction.mjs +93 -0
  39. package/dist/fesm2022/embedpdf-angular-redaction.mjs.map +1 -0
  40. package/dist/fesm2022/embedpdf-angular-render.mjs +331 -69
  41. package/dist/fesm2022/embedpdf-angular-render.mjs.map +1 -1
  42. package/dist/fesm2022/embedpdf-angular-runtime.mjs +1151 -390
  43. package/dist/fesm2022/embedpdf-angular-runtime.mjs.map +1 -1
  44. package/dist/fesm2022/embedpdf-angular-search.mjs +251 -0
  45. package/dist/fesm2022/embedpdf-angular-search.mjs.map +1 -0
  46. package/dist/fesm2022/embedpdf-angular-selection.mjs +477 -0
  47. package/dist/fesm2022/embedpdf-angular-selection.mjs.map +1 -0
  48. package/dist/fesm2022/embedpdf-angular-shell.mjs +177 -0
  49. package/dist/fesm2022/embedpdf-angular-shell.mjs.map +1 -0
  50. package/dist/fesm2022/embedpdf-angular-signature.mjs +120 -0
  51. package/dist/fesm2022/embedpdf-angular-signature.mjs.map +1 -0
  52. package/dist/fesm2022/embedpdf-angular-stage.mjs +688 -288
  53. package/dist/fesm2022/embedpdf-angular-stage.mjs.map +1 -1
  54. package/dist/fesm2022/embedpdf-angular-stamp.mjs +169 -0
  55. package/dist/fesm2022/embedpdf-angular-stamp.mjs.map +1 -0
  56. package/dist/fesm2022/embedpdf-angular-testing.mjs +89 -0
  57. package/dist/fesm2022/embedpdf-angular-testing.mjs.map +1 -0
  58. package/dist/fesm2022/embedpdf-angular-toolbar.mjs +1123 -0
  59. package/dist/fesm2022/embedpdf-angular-toolbar.mjs.map +1 -0
  60. package/dist/fesm2022/embedpdf-angular-view-manager.mjs +69 -0
  61. package/dist/fesm2022/embedpdf-angular-view-manager.mjs.map +1 -0
  62. package/dist/fesm2022/embedpdf-angular.mjs +25 -3
  63. package/dist/fesm2022/embedpdf-angular.mjs.map +1 -1
  64. package/dist/form/index.d.ts +79 -0
  65. package/dist/history/index.d.ts +28 -0
  66. package/dist/i18n/index.d.ts +52 -0
  67. package/dist/index.d.ts +22 -0
  68. package/dist/interaction/index.d.ts +58 -0
  69. package/dist/link/index.d.ts +77 -0
  70. package/dist/measurement/index.d.ts +46 -0
  71. package/dist/metadata/index.d.ts +51 -0
  72. package/dist/outline/index.d.ts +32 -0
  73. package/dist/page-edit/index.d.ts +27 -0
  74. package/dist/page-view/index.d.ts +94 -0
  75. package/dist/redaction/index.d.ts +38 -0
  76. package/dist/render/index.d.ts +45 -6
  77. package/dist/runtime/index.d.ts +579 -199
  78. package/dist/search/index.d.ts +71 -0
  79. package/dist/selection/index.d.ts +141 -0
  80. package/dist/shell/index.d.ts +88 -0
  81. package/dist/signature/index.d.ts +45 -0
  82. package/dist/stage/index.d.ts +242 -141
  83. package/dist/stamp/index.d.ts +58 -0
  84. package/dist/testing/index.d.ts +53 -0
  85. package/dist/toolbar/index.d.ts +257 -0
  86. package/dist/view-manager/index.d.ts +23 -0
  87. package/package.json +145 -14
@@ -1,24 +1,42 @@
1
- import { ActionUiAdapter } from '@embedpdf/plugin-actions';
1
+ import { ActionUiAdapter, ActionsCapability, ActionsConfig } from '@embedpdf/plugin-actions';
2
2
  export * from '@embedpdf/plugin-actions';
3
+ import * as _embedpdf_angular_runtime from '@embedpdf/angular/runtime';
4
+ import { EmbedPdfFeature } from '@embedpdf/angular/runtime';
5
+ import * as i0 from '@angular/core';
3
6
 
4
- /** Override any subset of the default adapter policy. */
7
+ declare const EpdfActions_base: _embedpdf_angular_runtime.PluginServiceClass<ActionsCapability, Record<never, never>, "execute" | "canExecute" | "executeNamed" | "canExecuteNamed" | "getActionTree" | "isScriptingEnabled" | "dispatch" | "canDispatch" | "setUiAdapter" | "runDocumentVerb" | "prepareClose" | "setSubmitHandler" | "registerExecutor", "onExecuted" | "onDiagnosticReported" | "onScriptDiagnosticReported" | "onScriptFailed" | "onOpenSequenceCompleted">;
8
+ /**
9
+ * The actions of the document in scope (`[epdfDocumentScope]`), else the active one:
10
+ * `executeNamed()`, `execute()`, `dispatch()`, `getActionTree()`, the checks (`canExecuteNamed()`,
11
+ * `isScriptingEnabled()`, …), the settings (`settings()`, `updateSettings()`, …, which work with
12
+ * no document) and the streams (`executed$`, `diagnosticReported$`, `scriptFailed$`, …). With
13
+ * no document every other call refuses with `not-ready`.
14
+ */
15
+ declare class EpdfActions extends EpdfActions_base {
16
+ static ɵfac: i0.ɵɵFactoryDeclaration<EpdfActions, never>;
17
+ static ɵprov: i0.ɵɵInjectableDeclaration<EpdfActions>;
18
+ }
19
+ /** The actions plugin, for `provideEmbedPdf()`: `withActions({ javascript: { enabled: true } })`. */
20
+ declare function withActions(config?: ActionsConfig): EmbedPdfFeature;
21
+ /** Your own handlers for any of the adapter's effects: `openUri`, `print`, `alert`, `gotoPage`. */
5
22
  type ActionsUiHandlers = Partial<ActionUiAdapter>;
6
23
  /**
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.
24
+ * The UI adapter of the active document's actions: the browser's defaults, with `handlers` in
25
+ * place of any of them. `handlers` may be a function, which runs once in an injection context,
26
+ * so your handlers can use your services:
27
+ *
28
+ * withActionsUi(() => {
29
+ * const toasts = inject(Toasts);
30
+ * return { alert: (message) => toasts.show(message) };
31
+ * })
14
32
  *
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.
33
+ * It follows the active document, and the Stage showing it for page moves, and is installed in
34
+ * the same change that makes a document ready, before anything inside it can run an action.
35
+ * Installing it is also the first sign of a person that lets a document's opening actions run
36
+ * (`openSequence: 'auto'`), so a document opened in a background tab waits until it's shown.
37
+ * The `doc.print` permission is checked by the plugin, before any handler runs.
20
38
  */
21
- declare function injectActionsUiAdapter(handlers?: ActionsUiHandlers | (() => ActionsUiHandlers | undefined)): void;
39
+ declare function withActionsUi(handlers?: ActionsUiHandlers | (() => ActionsUiHandlers)): EmbedPdfFeature;
22
40
 
23
- export { injectActionsUiAdapter };
41
+ export { EpdfActions, withActions, withActionsUi };
24
42
  export type { ActionsUiHandlers };
@@ -0,0 +1,67 @@
1
+ import * as _embedpdf_web from '@embedpdf/web';
2
+ import { ViewProjector, AnchorTarget, AnchoredRect, AnchoredPlacement } from '@embedpdf/web';
3
+ export { AnchorTarget, AnchoredPlacement, AnchoredSide, PageViewEnv, ViewProjector } from '@embedpdf/web';
4
+ import * as _angular_core from '@angular/core';
5
+ import { InjectionToken, Signal } from '@angular/core';
6
+
7
+ /** What a page surface gives the anchored UI inside it. */
8
+ interface EpdfProjectorBinding {
9
+ /** How a box on a page lands in the surface; null while there is nothing to project onto. */
10
+ readonly projector: Signal<ViewProjector | null>;
11
+ /**
12
+ * Changes whenever the projection may have (the Stage's camera): anchored UI reads it, so it
13
+ * moves in the same pass as the pages.
14
+ */
15
+ readonly revision: Signal<unknown>;
16
+ /** The pages on screen, by object number; null when the surface shows a single page. */
17
+ readonly shownPages: Signal<ReadonlySet<number> | null>;
18
+ /**
19
+ * For a surface that moves with the browser rather than with state (a page view scrolled with
20
+ * the document): call `callback` after such a move. A Stage has none.
21
+ */
22
+ readonly subscribe?: (callback: () => void) => () => void;
23
+ }
24
+ /** Provided by page surfaces (`<epdf-stage>`, a standalone page view), not by app code. */
25
+ declare const EPDF_PROJECTOR: InjectionToken<EpdfProjectorBinding>;
26
+ /** Where anchored UI sits: next to a box on a page, and points it keeps clear of. */
27
+ type EpdfAnchor = Omit<AnchorTarget, 'bounds'> & {
28
+ bounds?: AnchoredRect | null;
29
+ };
30
+ /**
31
+ * Its content, placed next to a box on a page. Once the content's size is measured it flips to
32
+ * the other side when the chosen one has no room, and stays inside the view, unless `pinned`.
33
+ * A pointer press inside it doesn't reach the page under it, so a click in a menu is never a
34
+ * click outside the selection.
35
+ */
36
+ declare class EpdfAnchored {
37
+ /**
38
+ * The box on a page to sit next to, in page coordinates: `{ page, bounds }`, with `avoid`
39
+ * points to keep clear of. Null, or no `bounds` (a search match without a box), hides it.
40
+ */
41
+ readonly anchor: _angular_core.InputSignal<EpdfAnchor | null | undefined>;
42
+ /** A side of the box, centred, or lined up with that side's start or end (`'top-end'`). */
43
+ readonly placement: _angular_core.InputSignal<AnchoredPlacement>;
44
+ /** Screen pixels between the box and the content, and between the content and the view's edge. */
45
+ readonly gap: _angular_core.InputSignal<number>;
46
+ /**
47
+ * Stay where `placement` puts it: never flip, never move to stay in view, and scroll away with
48
+ * the box. For badges and status; menus leave it off.
49
+ */
50
+ readonly pinned: _angular_core.InputSignalWithTransform<boolean, unknown>;
51
+ private readonly binding;
52
+ /** The content's size and the view's, measured once it's shown and again when either resizes. */
53
+ private readonly fit;
54
+ /** Moves the browser made that no state announces (a page view scrolled with the document). */
55
+ private readonly moved;
56
+ private readonly box;
57
+ protected readonly space: Signal<"overlay" | "client">;
58
+ /** Whether its page is on screen: until it is, nothing below reads the camera. */
59
+ private readonly onShownPage;
60
+ protected readonly position: Signal<_embedpdf_web.AnchoredPosition | null>;
61
+ constructor();
62
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<EpdfAnchored, never>;
63
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<EpdfAnchored, "epdf-anchored", never, { "anchor": { "alias": "anchor"; "required": false; "isSignal": true; }; "placement": { "alias": "placement"; "required": false; "isSignal": true; }; "gap": { "alias": "gap"; "required": false; "isSignal": true; }; "pinned": { "alias": "pinned"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
64
+ }
65
+
66
+ export { EPDF_PROJECTOR, EpdfAnchored };
67
+ export type { EpdfAnchor, EpdfProjectorBinding };