@embedpdf/plugin-annotation 2.12.0 → 2.12.1
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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/annotation-plugin.d.ts +1 -0
- package/dist/lib/types.d.ts +8 -0
- package/package.json +12 -12
package/dist/index.js
CHANGED
|
@@ -4358,6 +4358,7 @@ const _AnnotationPlugin = class _AnnotationPlugin extends BasePlugin {
|
|
|
4358
4358
|
getSelectedAnnotations: () => this.getSelectedAnnotationsMethod(),
|
|
4359
4359
|
getSelectedAnnotationIds: () => this.getSelectedAnnotationIdsMethod(),
|
|
4360
4360
|
getAnnotationById: (id) => this.getAnnotationById(id),
|
|
4361
|
+
getAnnotations: (options) => this.getAnnotationsMethod(options),
|
|
4361
4362
|
selectAnnotation: (pageIndex, id) => this.selectAnnotation(pageIndex, id),
|
|
4362
4363
|
toggleSelection: (pageIndex, id) => this.toggleSelectionMethod(pageIndex, id),
|
|
4363
4364
|
addToSelection: (pageIndex, id) => this.addToSelectionMethod(pageIndex, id),
|
|
@@ -4430,6 +4431,7 @@ const _AnnotationPlugin = class _AnnotationPlugin extends BasePlugin {
|
|
|
4430
4431
|
getSelectedAnnotations: () => this.getSelectedAnnotationsMethod(documentId),
|
|
4431
4432
|
getSelectedAnnotationIds: () => this.getSelectedAnnotationIdsMethod(documentId),
|
|
4432
4433
|
getAnnotationById: (id) => this.getAnnotationById(id, documentId),
|
|
4434
|
+
getAnnotations: (options) => this.getAnnotationsMethod(options, documentId),
|
|
4433
4435
|
selectAnnotation: (pageIndex, id) => this.selectAnnotation(pageIndex, id, documentId),
|
|
4434
4436
|
toggleSelection: (pageIndex, id) => this.toggleSelectionMethod(pageIndex, id, documentId),
|
|
4435
4437
|
addToSelection: (pageIndex, id) => this.addToSelectionMethod(pageIndex, id, documentId),
|
|
@@ -4607,6 +4609,15 @@ const _AnnotationPlugin = class _AnnotationPlugin extends BasePlugin {
|
|
|
4607
4609
|
const docState = this.getDocumentState(documentId);
|
|
4608
4610
|
return getAnnotationByUid(docState, id);
|
|
4609
4611
|
}
|
|
4612
|
+
getAnnotationsMethod(options, documentId) {
|
|
4613
|
+
const docState = this.getDocumentState(documentId);
|
|
4614
|
+
if ((options == null ? void 0 : options.pageIndex) !== void 0) {
|
|
4615
|
+
return getAnnotationsByPageIndex(docState, options.pageIndex).filter(
|
|
4616
|
+
(ta) => ta !== void 0
|
|
4617
|
+
);
|
|
4618
|
+
}
|
|
4619
|
+
return Object.values(docState.byUid);
|
|
4620
|
+
}
|
|
4610
4621
|
renderAnnotation({ pageIndex, annotation, options }, documentId) {
|
|
4611
4622
|
const id = documentId ?? this.getActiveDocumentId();
|
|
4612
4623
|
const docState = this.getCoreDocument(id);
|