@embedpdf/plugin-annotation 2.12.0 → 2.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,6 +48,7 @@ export declare class AnnotationPlugin extends BasePlugin<AnnotationPluginConfig,
48
48
  private getPageAnnotations;
49
49
  private getSelectedAnnotation;
50
50
  private getAnnotationById;
51
+ private getAnnotationsMethod;
51
52
  private renderAnnotation;
52
53
  /**
53
54
  * Batch-fetch rendered appearance stream images for all annotations on a page.
@@ -3,3 +3,4 @@ export * from './line-ending-handlers';
3
3
  export * from './line-endings';
4
4
  export * from './patch-registry';
5
5
  export * from './insert-upright';
6
+ export * from './patches';
@@ -264,6 +264,8 @@ export interface AnnotationScope<TTools extends AnnotationToolMap = AnnotationTo
264
264
  /** Get the IDs of all selected annotations */
265
265
  getSelectedAnnotationIds(): string[];
266
266
  getAnnotationById(id: string): TrackedAnnotation | null;
267
+ /** Get all tracked annotations, optionally filtered by page */
268
+ getAnnotations(options?: GetAnnotationsOptions): TrackedAnnotation[];
267
269
  /** Select a single annotation (clears previous selection) */
268
270
  selectAnnotation(pageIndex: number, annotationId: string): void;
269
271
  /** Toggle an annotation in/out of the current selection */
@@ -353,6 +355,8 @@ export interface AnnotationCapability<TTools extends AnnotationToolMap = Annotat
353
355
  /** Get the IDs of all selected annotations */
354
356
  getSelectedAnnotationIds: () => string[];
355
357
  getAnnotationById(id: string): TrackedAnnotation | null;
358
+ /** Get all tracked annotations, optionally filtered by page */
359
+ getAnnotations: (options?: GetAnnotationsOptions) => TrackedAnnotation[];
356
360
  /** Select a single annotation (clears previous selection) */
357
361
  selectAnnotation: (pageIndex: number, annotationId: string) => void;
358
362
  /** Toggle an annotation in/out of the current selection */
@@ -454,6 +458,10 @@ export interface AnnotationCapability<TTools extends AnnotationToolMap = Annotat
454
458
  export interface GetPageAnnotationsOptions {
455
459
  pageIndex: number;
456
460
  }
461
+ export interface GetAnnotationsOptions {
462
+ /** Filter annotations by page index. Omit to get all annotations. */
463
+ pageIndex?: number;
464
+ }
457
465
  export interface SidebarAnnotationEntry {
458
466
  page: number;
459
467
  annotation: TrackedAnnotation;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@embedpdf/plugin-annotation",
3
- "version": "2.12.0",
3
+ "version": "2.13.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.cjs",
@@ -35,18 +35,18 @@
35
35
  }
36
36
  },
37
37
  "dependencies": {
38
- "@embedpdf/models": "2.12.0",
39
- "@embedpdf/utils": "2.12.0"
38
+ "@embedpdf/models": "2.13.0",
39
+ "@embedpdf/utils": "2.13.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/react": "^18.2.0",
43
43
  "@types/react-dom": "^18.2.0",
44
44
  "typescript": "^5.0.0",
45
45
  "@embedpdf/build": "1.1.0",
46
- "@embedpdf/plugin-selection": "2.12.0",
47
- "@embedpdf/plugin-history": "2.12.0",
48
- "@embedpdf/plugin-scroll": "2.12.0",
49
- "@embedpdf/plugin-interaction-manager": "2.12.0"
46
+ "@embedpdf/plugin-interaction-manager": "2.13.0",
47
+ "@embedpdf/plugin-selection": "2.13.0",
48
+ "@embedpdf/plugin-scroll": "2.13.0",
49
+ "@embedpdf/plugin-history": "2.13.0"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "react": ">=16.8.0",
@@ -54,11 +54,11 @@
54
54
  "preact": "^10.26.4",
55
55
  "vue": ">=3.2.0",
56
56
  "svelte": ">=5 <6",
57
- "@embedpdf/core": "2.12.0",
58
- "@embedpdf/plugin-interaction-manager": "2.12.0",
59
- "@embedpdf/plugin-selection": "2.12.0",
60
- "@embedpdf/plugin-history": "2.12.0",
61
- "@embedpdf/plugin-scroll": "2.12.0"
57
+ "@embedpdf/core": "2.13.0",
58
+ "@embedpdf/plugin-selection": "2.13.0",
59
+ "@embedpdf/plugin-scroll": "2.13.0",
60
+ "@embedpdf/plugin-interaction-manager": "2.13.0",
61
+ "@embedpdf/plugin-history": "2.13.0"
62
62
  },
63
63
  "files": [
64
64
  "dist",