@embedpdf/plugin-annotation 2.15.0 → 3.0.0-next.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/LICENSE +192 -21
- package/dist/capability-fghl0JmE.js +2680 -0
- package/dist/capability-fghl0JmE.js.map +1 -0
- package/dist/capability-hb2AU0f6.cjs +2739 -0
- package/dist/capability-hb2AU0f6.cjs.map +1 -0
- package/dist/index.cjs +593 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +65 -0
- package/dist/index.d.ts +65 -1
- package/dist/index.js +562 -6998
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +5 -0
- package/dist/internal.d.cts +13 -0
- package/dist/internal.d.ts +13 -0
- package/dist/internal.js +2 -0
- package/dist/types-BhWgqgbX.d.cts +879 -0
- package/dist/types-Da6JRmhw.d.ts +879 -0
- package/package.json +26 -66
- package/dist/lib/actions.d.ts +0 -192
- package/dist/lib/annotation-plugin.d.ts +0 -310
- package/dist/lib/geometry/cloudy-border.d.ts +0 -90
- package/dist/lib/geometry/index.d.ts +0 -2
- package/dist/lib/geometry/rotation.d.ts +0 -32
- package/dist/lib/handlers/callout-free-text.handler.d.ts +0 -3
- package/dist/lib/handlers/circle.handler.d.ts +0 -3
- package/dist/lib/handlers/click-detector.d.ts +0 -27
- package/dist/lib/handlers/free-text.handler.d.ts +0 -3
- package/dist/lib/handlers/index.d.ts +0 -14
- package/dist/lib/handlers/ink.handler.d.ts +0 -3
- package/dist/lib/handlers/insert-text.handler.d.ts +0 -8
- package/dist/lib/handlers/line.handler.d.ts +0 -3
- package/dist/lib/handlers/link.handler.d.ts +0 -3
- package/dist/lib/handlers/polygon.handler.d.ts +0 -3
- package/dist/lib/handlers/polyline.handler.d.ts +0 -3
- package/dist/lib/handlers/replace-text.handler.d.ts +0 -9
- package/dist/lib/handlers/selection-utils.d.ts +0 -7
- package/dist/lib/handlers/square.handler.d.ts +0 -3
- package/dist/lib/handlers/stamp.handler.d.ts +0 -3
- package/dist/lib/handlers/text-markup.handler.d.ts +0 -7
- package/dist/lib/handlers/text.handler.d.ts +0 -3
- package/dist/lib/handlers/types.d.ts +0 -176
- package/dist/lib/helpers.d.ts +0 -46
- package/dist/lib/index.d.ts +0 -21
- package/dist/lib/manifest.d.ts +0 -4
- package/dist/lib/patching/base-patch.d.ts +0 -87
- package/dist/lib/patching/index.d.ts +0 -6
- package/dist/lib/patching/insert-upright.d.ts +0 -20
- package/dist/lib/patching/line-ending-handlers.d.ts +0 -20
- package/dist/lib/patching/line-endings.d.ts +0 -13
- package/dist/lib/patching/patch-registry.d.ts +0 -40
- package/dist/lib/patching/patch-utils.d.ts +0 -97
- package/dist/lib/patching/patches/callout-freetext.patch.d.ts +0 -3
- package/dist/lib/patching/patches/circle.patch.d.ts +0 -3
- package/dist/lib/patching/patches/freetext.patch.d.ts +0 -3
- package/dist/lib/patching/patches/index.d.ts +0 -9
- package/dist/lib/patching/patches/ink.patch.d.ts +0 -3
- package/dist/lib/patching/patches/line.patch.d.ts +0 -3
- package/dist/lib/patching/patches/polygon.patch.d.ts +0 -3
- package/dist/lib/patching/patches/polyline.patch.d.ts +0 -3
- package/dist/lib/patching/patches/square.patch.d.ts +0 -3
- package/dist/lib/patching/patches/stamp.patch.d.ts +0 -3
- package/dist/lib/reducer.d.ts +0 -6
- package/dist/lib/selectors.d.ts +0 -139
- package/dist/lib/tools/default-tools.d.ts +0 -521
- package/dist/lib/tools/tools-utils.d.ts +0 -453
- package/dist/lib/tools/types.d.ts +0 -209
- package/dist/lib/types.d.ts +0 -671
- package/dist/lib/utils/index.d.ts +0 -1
- package/dist/lib/utils/use-state.d.ts +0 -12
- package/dist/preact/adapter.d.ts +0 -14
- package/dist/preact/core.d.ts +0 -1
- package/dist/preact/index.cjs +0 -2
- package/dist/preact/index.cjs.map +0 -1
- package/dist/preact/index.d.ts +0 -1
- package/dist/preact/index.js +0 -4013
- package/dist/preact/index.js.map +0 -1
- package/dist/preact/interaction-manager.d.ts +0 -1
- package/dist/preact/selection.d.ts +0 -1
- package/dist/preact/utils.d.ts +0 -1
- package/dist/react/adapter.d.ts +0 -6
- package/dist/react/core.d.ts +0 -1
- package/dist/react/index.cjs +0 -2
- package/dist/react/index.cjs.map +0 -1
- package/dist/react/index.d.ts +0 -1
- package/dist/react/index.js +0 -4014
- package/dist/react/index.js.map +0 -1
- package/dist/react/interaction-manager.d.ts +0 -1
- package/dist/react/selection.d.ts +0 -1
- package/dist/react/utils.d.ts +0 -1
- package/dist/shared/annotation-bounds.d.ts +0 -14
- package/dist/shared/components/annotation-container.d.ts +0 -71
- package/dist/shared/components/annotation-layer.d.ts +0 -33
- package/dist/shared/components/annotation-navigation-handler.d.ts +0 -1
- package/dist/shared/components/annotation-paint-layer.d.ts +0 -7
- package/dist/shared/components/annotations/callout-free-text-preview.d.ts +0 -15
- package/dist/shared/components/annotations/callout-free-text.d.ts +0 -15
- package/dist/shared/components/annotations/caret.d.ts +0 -24
- package/dist/shared/components/annotations/circle.d.ts +0 -35
- package/dist/shared/components/annotations/free-text.d.ts +0 -17
- package/dist/shared/components/annotations/ink.d.ts +0 -27
- package/dist/shared/components/annotations/line.d.ts +0 -35
- package/dist/shared/components/annotations/link-locked.d.ts +0 -3
- package/dist/shared/components/annotations/link.d.ts +0 -28
- package/dist/shared/components/annotations/polygon.d.ts +0 -23
- package/dist/shared/components/annotations/polyline.d.ts +0 -23
- package/dist/shared/components/annotations/square.d.ts +0 -35
- package/dist/shared/components/annotations/stamp.d.ts +0 -13
- package/dist/shared/components/annotations/text.d.ts +0 -14
- package/dist/shared/components/annotations.d.ts +0 -22
- package/dist/shared/components/appearance-image.d.ts +0 -12
- package/dist/shared/components/built-in-renderers.d.ts +0 -2
- package/dist/shared/components/group-selection-box.d.ts +0 -40
- package/dist/shared/components/index.d.ts +0 -2
- package/dist/shared/components/preview-renderer.d.ts +0 -8
- package/dist/shared/components/render-annotation.d.ts +0 -13
- package/dist/shared/components/text-markup/highlight.d.ts +0 -16
- package/dist/shared/components/text-markup/squiggly.d.ts +0 -16
- package/dist/shared/components/text-markup/strikeout.d.ts +0 -16
- package/dist/shared/components/text-markup/underline.d.ts +0 -16
- package/dist/shared/components/text-markup.d.ts +0 -7
- package/dist/shared/components/types.d.ts +0 -253
- package/dist/shared/context/index.d.ts +0 -1
- package/dist/shared/context/renderer-registry.d.ts +0 -21
- package/dist/shared/hooks/index.d.ts +0 -2
- package/dist/shared/hooks/use-annotation.d.ts +0 -19
- package/dist/shared/hooks/use-ios-zoom-prevention.d.ts +0 -16
- package/dist/shared/index.d.ts +0 -6
- package/dist/shared/types.d.ts +0 -10
- package/dist/shared-preact/annotation-bounds.d.ts +0 -14
- package/dist/shared-preact/components/annotation-container.d.ts +0 -71
- package/dist/shared-preact/components/annotation-layer.d.ts +0 -33
- package/dist/shared-preact/components/annotation-navigation-handler.d.ts +0 -1
- package/dist/shared-preact/components/annotation-paint-layer.d.ts +0 -7
- package/dist/shared-preact/components/annotations/callout-free-text-preview.d.ts +0 -15
- package/dist/shared-preact/components/annotations/callout-free-text.d.ts +0 -15
- package/dist/shared-preact/components/annotations/caret.d.ts +0 -24
- package/dist/shared-preact/components/annotations/circle.d.ts +0 -35
- package/dist/shared-preact/components/annotations/free-text.d.ts +0 -17
- package/dist/shared-preact/components/annotations/ink.d.ts +0 -27
- package/dist/shared-preact/components/annotations/line.d.ts +0 -35
- package/dist/shared-preact/components/annotations/link-locked.d.ts +0 -3
- package/dist/shared-preact/components/annotations/link.d.ts +0 -28
- package/dist/shared-preact/components/annotations/polygon.d.ts +0 -23
- package/dist/shared-preact/components/annotations/polyline.d.ts +0 -23
- package/dist/shared-preact/components/annotations/square.d.ts +0 -35
- package/dist/shared-preact/components/annotations/stamp.d.ts +0 -13
- package/dist/shared-preact/components/annotations/text.d.ts +0 -14
- package/dist/shared-preact/components/annotations.d.ts +0 -22
- package/dist/shared-preact/components/appearance-image.d.ts +0 -12
- package/dist/shared-preact/components/built-in-renderers.d.ts +0 -2
- package/dist/shared-preact/components/group-selection-box.d.ts +0 -40
- package/dist/shared-preact/components/index.d.ts +0 -2
- package/dist/shared-preact/components/preview-renderer.d.ts +0 -8
- package/dist/shared-preact/components/render-annotation.d.ts +0 -13
- package/dist/shared-preact/components/text-markup/highlight.d.ts +0 -16
- package/dist/shared-preact/components/text-markup/squiggly.d.ts +0 -16
- package/dist/shared-preact/components/text-markup/strikeout.d.ts +0 -16
- package/dist/shared-preact/components/text-markup/underline.d.ts +0 -16
- package/dist/shared-preact/components/text-markup.d.ts +0 -7
- package/dist/shared-preact/components/types.d.ts +0 -253
- package/dist/shared-preact/context/index.d.ts +0 -1
- package/dist/shared-preact/context/renderer-registry.d.ts +0 -21
- package/dist/shared-preact/hooks/index.d.ts +0 -2
- package/dist/shared-preact/hooks/use-annotation.d.ts +0 -19
- package/dist/shared-preact/hooks/use-ios-zoom-prevention.d.ts +0 -15
- package/dist/shared-preact/index.d.ts +0 -6
- package/dist/shared-preact/types.d.ts +0 -10
- package/dist/shared-react/annotation-bounds.d.ts +0 -14
- package/dist/shared-react/components/annotation-container.d.ts +0 -71
- package/dist/shared-react/components/annotation-layer.d.ts +0 -33
- package/dist/shared-react/components/annotation-navigation-handler.d.ts +0 -1
- package/dist/shared-react/components/annotation-paint-layer.d.ts +0 -7
- package/dist/shared-react/components/annotations/callout-free-text-preview.d.ts +0 -15
- package/dist/shared-react/components/annotations/callout-free-text.d.ts +0 -15
- package/dist/shared-react/components/annotations/caret.d.ts +0 -24
- package/dist/shared-react/components/annotations/circle.d.ts +0 -35
- package/dist/shared-react/components/annotations/free-text.d.ts +0 -17
- package/dist/shared-react/components/annotations/ink.d.ts +0 -27
- package/dist/shared-react/components/annotations/line.d.ts +0 -35
- package/dist/shared-react/components/annotations/link-locked.d.ts +0 -3
- package/dist/shared-react/components/annotations/link.d.ts +0 -28
- package/dist/shared-react/components/annotations/polygon.d.ts +0 -23
- package/dist/shared-react/components/annotations/polyline.d.ts +0 -23
- package/dist/shared-react/components/annotations/square.d.ts +0 -35
- package/dist/shared-react/components/annotations/stamp.d.ts +0 -13
- package/dist/shared-react/components/annotations/text.d.ts +0 -14
- package/dist/shared-react/components/annotations.d.ts +0 -22
- package/dist/shared-react/components/appearance-image.d.ts +0 -12
- package/dist/shared-react/components/built-in-renderers.d.ts +0 -2
- package/dist/shared-react/components/group-selection-box.d.ts +0 -40
- package/dist/shared-react/components/index.d.ts +0 -2
- package/dist/shared-react/components/preview-renderer.d.ts +0 -8
- package/dist/shared-react/components/render-annotation.d.ts +0 -13
- package/dist/shared-react/components/text-markup/highlight.d.ts +0 -16
- package/dist/shared-react/components/text-markup/squiggly.d.ts +0 -16
- package/dist/shared-react/components/text-markup/strikeout.d.ts +0 -16
- package/dist/shared-react/components/text-markup/underline.d.ts +0 -16
- package/dist/shared-react/components/text-markup.d.ts +0 -7
- package/dist/shared-react/components/types.d.ts +0 -253
- package/dist/shared-react/context/index.d.ts +0 -1
- package/dist/shared-react/context/renderer-registry.d.ts +0 -21
- package/dist/shared-react/hooks/index.d.ts +0 -2
- package/dist/shared-react/hooks/use-annotation.d.ts +0 -19
- package/dist/shared-react/hooks/use-ios-zoom-prevention.d.ts +0 -16
- package/dist/shared-react/index.d.ts +0 -6
- package/dist/shared-react/types.d.ts +0 -10
- package/dist/shared-vue/annotation-bounds.d.ts +0 -14
- package/dist/svelte/components/AnnotationContainer.svelte.d.ts +0 -26
- package/dist/svelte/components/AnnotationLayer.svelte.d.ts +0 -40
- package/dist/svelte/components/AnnotationNavigationHandler.svelte.d.ts +0 -3
- package/dist/svelte/components/AnnotationPaintLayer.svelte.d.ts +0 -8
- package/dist/svelte/components/Annotations.svelte.d.ts +0 -28
- package/dist/svelte/components/AppearanceImage.svelte.d.ts +0 -8
- package/dist/svelte/components/GroupSelectionBox.svelte.d.ts +0 -40
- package/dist/svelte/components/PreviewRenderer.svelte.d.ts +0 -9
- package/dist/svelte/components/RenderAnnotation.svelte.d.ts +0 -14
- package/dist/svelte/components/RendererRegistryProvider.svelte.d.ts +0 -7
- package/dist/svelte/components/TextMarkup.svelte.d.ts +0 -8
- package/dist/svelte/components/annotations/CalloutFreeText.svelte.d.ts +0 -15
- package/dist/svelte/components/annotations/CalloutFreeTextPreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Caret.svelte.d.ts +0 -13
- package/dist/svelte/components/annotations/Circle.svelte.d.ts +0 -19
- package/dist/svelte/components/annotations/CirclePreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/FreeText.svelte.d.ts +0 -16
- package/dist/svelte/components/annotations/FreeTextPreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Ink.svelte.d.ts +0 -15
- package/dist/svelte/components/annotations/InkPreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Line.svelte.d.ts +0 -19
- package/dist/svelte/components/annotations/LinePreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Link.svelte.d.ts +0 -24
- package/dist/svelte/components/annotations/LinkLockedMode.svelte.d.ts +0 -5
- package/dist/svelte/components/annotations/LinkPreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Polygon.svelte.d.ts +0 -21
- package/dist/svelte/components/annotations/PolygonPreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Polyline.svelte.d.ts +0 -19
- package/dist/svelte/components/annotations/PolylinePreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Square.svelte.d.ts +0 -19
- package/dist/svelte/components/annotations/SquarePreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Stamp.svelte.d.ts +0 -13
- package/dist/svelte/components/annotations/StampPreview.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/Text.svelte.d.ts +0 -10
- package/dist/svelte/components/annotations/index.d.ts +0 -10
- package/dist/svelte/components/built-in-renderers.d.ts +0 -2
- package/dist/svelte/components/index.d.ts +0 -11
- package/dist/svelte/components/renderers/CalloutFreeTextRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/CaretRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/CircleRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/FreeTextRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/HighlightRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/InkRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/LineRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/LinkRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/PolygonRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/PolylineRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/SquareRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/SquigglyRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/StampRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/StrikeoutRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/TextRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/renderers/UnderlineRenderer.svelte.d.ts +0 -5
- package/dist/svelte/components/text-markup/Highlight.svelte.d.ts +0 -16
- package/dist/svelte/components/text-markup/Squiggly.svelte.d.ts +0 -16
- package/dist/svelte/components/text-markup/Strikeout.svelte.d.ts +0 -16
- package/dist/svelte/components/text-markup/Underline.svelte.d.ts +0 -16
- package/dist/svelte/components/text-markup/index.d.ts +0 -4
- package/dist/svelte/components/types.d.ts +0 -66
- package/dist/svelte/context/index.d.ts +0 -2
- package/dist/svelte/context/renderer-registry.svelte.d.ts +0 -20
- package/dist/svelte/context/types.d.ts +0 -129
- package/dist/svelte/hooks/index.d.ts +0 -2
- package/dist/svelte/hooks/use-annotation.svelte.d.ts +0 -21
- package/dist/svelte/hooks/use-ios-zoom-prevention.svelte.d.ts +0 -6
- package/dist/svelte/index.cjs +0 -2
- package/dist/svelte/index.cjs.map +0 -1
- package/dist/svelte/index.d.ts +0 -6
- package/dist/svelte/index.js +0 -5257
- package/dist/svelte/index.js.map +0 -1
- package/dist/svelte/types.d.ts +0 -126
- package/dist/vue/components/annotation-container.vue.d.ts +0 -134
- package/dist/vue/components/annotation-layer.vue.d.ts +0 -99
- package/dist/vue/components/annotation-navigation-handler.vue.d.ts +0 -3
- package/dist/vue/components/annotation-paint-layer.vue.d.ts +0 -8
- package/dist/vue/components/annotations/callout-free-text-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/callout-free-text.vue.d.ts +0 -25
- package/dist/vue/components/annotations/caret.vue.d.ts +0 -24
- package/dist/vue/components/annotations/circle-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/circle.vue.d.ts +0 -37
- package/dist/vue/components/annotations/free-text-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/free-text.vue.d.ts +0 -25
- package/dist/vue/components/annotations/index.d.ts +0 -10
- package/dist/vue/components/annotations/ink-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/ink.vue.d.ts +0 -27
- package/dist/vue/components/annotations/line-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/line.vue.d.ts +0 -38
- package/dist/vue/components/annotations/link-locked.vue.d.ts +0 -5
- package/dist/vue/components/annotations/link-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/link.vue.d.ts +0 -47
- package/dist/vue/components/annotations/polygon-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/polygon.vue.d.ts +0 -43
- package/dist/vue/components/annotations/polyline-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/polyline.vue.d.ts +0 -38
- package/dist/vue/components/annotations/square-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/square.vue.d.ts +0 -37
- package/dist/vue/components/annotations/stamp-preview.vue.d.ts +0 -10
- package/dist/vue/components/annotations/stamp.vue.d.ts +0 -19
- package/dist/vue/components/annotations/text.vue.d.ts +0 -14
- package/dist/vue/components/annotations.vue.d.ts +0 -111
- package/dist/vue/components/appearance-image.vue.d.ts +0 -9
- package/dist/vue/components/built-in-renderers.d.ts +0 -2
- package/dist/vue/components/group-selection-box.vue.d.ts +0 -98
- package/dist/vue/components/index.d.ts +0 -11
- package/dist/vue/components/preview-renderer.vue.d.ts +0 -9
- package/dist/vue/components/render-annotation.vue.d.ts +0 -16
- package/dist/vue/components/renderer-registry-provider.vue.d.ts +0 -13
- package/dist/vue/components/renderers/callout-free-text-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/caret-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/circle-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/free-text-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/highlight-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/ink-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/line-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/link-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/polygon-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/polyline-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/square-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/squiggly-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/stamp-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/strikeout-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/text-renderer.vue.d.ts +0 -6
- package/dist/vue/components/renderers/underline-renderer.vue.d.ts +0 -6
- package/dist/vue/components/text-markup/highlight.vue.d.ts +0 -27
- package/dist/vue/components/text-markup/index.d.ts +0 -4
- package/dist/vue/components/text-markup/squiggly.vue.d.ts +0 -27
- package/dist/vue/components/text-markup/strikeout.vue.d.ts +0 -27
- package/dist/vue/components/text-markup/underline.vue.d.ts +0 -27
- package/dist/vue/components/text-markup.vue.d.ts +0 -8
- package/dist/vue/context/index.d.ts +0 -2
- package/dist/vue/context/renderer-registry.d.ts +0 -26
- package/dist/vue/context/types.d.ts +0 -129
- package/dist/vue/hooks/index.d.ts +0 -2
- package/dist/vue/hooks/use-annotation.d.ts +0 -50
- package/dist/vue/hooks/use-ios-zoom-prevention.d.ts +0 -7
- package/dist/vue/index.cjs +0 -2
- package/dist/vue/index.cjs.map +0 -1
- package/dist/vue/index.d.ts +0 -6
- package/dist/vue/index.js +0 -4984
- package/dist/vue/index.js.map +0 -1
- package/dist/vue/types.d.ts +0 -94
package/dist/lib/types.d.ts
DELETED
|
@@ -1,671 +0,0 @@
|
|
|
1
|
-
import { BasePluginConfig, EventHook } from '@embedpdf/core';
|
|
2
|
-
import { AnnotationContextMap, AnnotationCreateContext, AnnotationAppearanceMap, PdfAnnotationObject, PdfDestinationObject, PdfErrorReason, PdfLinkTarget, PdfRenderPageAnnotationOptions, PdfTextAnnoObject, Position, Rect, Size, Task } from '@embedpdf/models';
|
|
3
|
-
import { AnnotationTool, AnnotationToolMap, ToolById, ToolId } from './tools/types';
|
|
4
|
-
/**
|
|
5
|
-
* Metadata attached to annotation history commands for filtering/purging.
|
|
6
|
-
* Used by the history plugin's purgeByMetadata method to identify commands
|
|
7
|
-
* that should be removed (e.g., after a permanent redaction commit).
|
|
8
|
-
*/
|
|
9
|
-
export interface AnnotationCommandMetadata {
|
|
10
|
-
/** The annotation IDs affected by this command */
|
|
11
|
-
annotationIds: string[];
|
|
12
|
-
}
|
|
13
|
-
export type AnnotationEvent = {
|
|
14
|
-
type: 'create';
|
|
15
|
-
documentId: string;
|
|
16
|
-
annotation: PdfAnnotationObject;
|
|
17
|
-
pageIndex: number;
|
|
18
|
-
ctx?: AnnotationCreateContext<any>;
|
|
19
|
-
committed: boolean;
|
|
20
|
-
editAfterCreate?: boolean;
|
|
21
|
-
} | {
|
|
22
|
-
type: 'update';
|
|
23
|
-
documentId: string;
|
|
24
|
-
annotation: PdfAnnotationObject;
|
|
25
|
-
pageIndex: number;
|
|
26
|
-
patch: Partial<PdfAnnotationObject>;
|
|
27
|
-
committed: boolean;
|
|
28
|
-
} | {
|
|
29
|
-
type: 'delete';
|
|
30
|
-
documentId: string;
|
|
31
|
-
annotation: PdfAnnotationObject;
|
|
32
|
-
pageIndex: number;
|
|
33
|
-
committed: boolean;
|
|
34
|
-
} | {
|
|
35
|
-
type: 'loaded';
|
|
36
|
-
documentId: string;
|
|
37
|
-
total: number;
|
|
38
|
-
};
|
|
39
|
-
export type AnnotationToolsChangeEvent = {
|
|
40
|
-
tools: AnnotationTool[];
|
|
41
|
-
};
|
|
42
|
-
export type CommitState = 'new' | 'dirty' | 'moved' | 'deleted' | 'synced' | 'ignored';
|
|
43
|
-
export interface TrackedAnnotation<T extends PdfAnnotationObject = PdfAnnotationObject> {
|
|
44
|
-
commitState: CommitState;
|
|
45
|
-
object: T;
|
|
46
|
-
/** When true, render using dict-based SVG/CSS instead of appearance stream image */
|
|
47
|
-
dictMode?: boolean;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Represents a batch of pending annotation changes to be committed.
|
|
51
|
-
* Separates the collection of changes from their execution.
|
|
52
|
-
*/
|
|
53
|
-
export interface CommitBatch {
|
|
54
|
-
/** Annotations that need to be created in the PDF */
|
|
55
|
-
creations: Array<{
|
|
56
|
-
uid: string;
|
|
57
|
-
ta: TrackedAnnotation;
|
|
58
|
-
ctx?: AnnotationCreateContext<PdfAnnotationObject>;
|
|
59
|
-
}>;
|
|
60
|
-
/** Annotations that need to be updated in the PDF */
|
|
61
|
-
updates: Array<{
|
|
62
|
-
uid: string;
|
|
63
|
-
ta: TrackedAnnotation;
|
|
64
|
-
/** When true, only positional data changed -- skip appearance regeneration */
|
|
65
|
-
moved?: boolean;
|
|
66
|
-
}>;
|
|
67
|
-
/** Annotations that need to be deleted from the PDF */
|
|
68
|
-
deletions: Array<{
|
|
69
|
-
uid: string;
|
|
70
|
-
ta: TrackedAnnotation;
|
|
71
|
-
}>;
|
|
72
|
-
/** All UIDs that are part of this commit batch */
|
|
73
|
-
committedUids: string[];
|
|
74
|
-
/** Whether this batch has any changes */
|
|
75
|
-
isEmpty: boolean;
|
|
76
|
-
}
|
|
77
|
-
export interface RenderAnnotationOptions {
|
|
78
|
-
pageIndex: number;
|
|
79
|
-
annotation: PdfAnnotationObject;
|
|
80
|
-
options?: PdfRenderPageAnnotationOptions;
|
|
81
|
-
}
|
|
82
|
-
export declare enum LockModeType {
|
|
83
|
-
None = "none",
|
|
84
|
-
All = "all",
|
|
85
|
-
Include = "include",
|
|
86
|
-
Exclude = "exclude"
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Controls which annotation categories are locked from UI interaction (selection, drag, resize).
|
|
90
|
-
* Locked annotations let clicks pass through to layers below (e.g. form-filling).
|
|
91
|
-
*
|
|
92
|
-
* - `{ type: LockModeType.None }` -- nothing locked (default, full interaction)
|
|
93
|
-
* - `{ type: LockModeType.All }` -- everything locked
|
|
94
|
-
* - `{ type: LockModeType.Include, categories: [...] }` -- only listed categories are locked
|
|
95
|
-
* - `{ type: LockModeType.Exclude, categories: [...] }` -- everything locked except listed categories
|
|
96
|
-
*/
|
|
97
|
-
export type LockMode = {
|
|
98
|
-
type: LockModeType.None;
|
|
99
|
-
} | {
|
|
100
|
-
type: LockModeType.All;
|
|
101
|
-
} | {
|
|
102
|
-
type: LockModeType.Include;
|
|
103
|
-
categories: string[];
|
|
104
|
-
} | {
|
|
105
|
-
type: LockModeType.Exclude;
|
|
106
|
-
categories: string[];
|
|
107
|
-
};
|
|
108
|
-
export interface AnnotationDocumentState {
|
|
109
|
-
pages: Record<number, string[]>;
|
|
110
|
-
byUid: Record<string, TrackedAnnotation>;
|
|
111
|
-
/** Array of selected annotation UIDs (supports multi-selection) */
|
|
112
|
-
selectedUids: string[];
|
|
113
|
-
/**
|
|
114
|
-
* @deprecated Use `selectedUids` array or `getSelectedAnnotation()` instead.
|
|
115
|
-
* Returns the UID only when exactly one annotation is selected, otherwise null.
|
|
116
|
-
* Will be removed in next major version.
|
|
117
|
-
*/
|
|
118
|
-
selectedUid: string | null;
|
|
119
|
-
activeToolId: string | null;
|
|
120
|
-
activeToolContext?: Record<string, unknown>;
|
|
121
|
-
hasPendingChanges: boolean;
|
|
122
|
-
locked: LockMode;
|
|
123
|
-
}
|
|
124
|
-
export interface AnnotationState {
|
|
125
|
-
documents: Record<string, AnnotationDocumentState>;
|
|
126
|
-
activeDocumentId: string | null;
|
|
127
|
-
/** The complete list of available tools, including any user modifications. */
|
|
128
|
-
tools: AnnotationTool[];
|
|
129
|
-
colorPresets: string[];
|
|
130
|
-
}
|
|
131
|
-
/**
|
|
132
|
-
* Partial tool definition for overriding default tools by ID.
|
|
133
|
-
* When a tool with the same `id` as a default tool is provided, its properties
|
|
134
|
-
* are deep-merged with the default (user values take precedence).
|
|
135
|
-
*/
|
|
136
|
-
export type AnnotationToolOverride = {
|
|
137
|
-
id: string;
|
|
138
|
-
} & Partial<Omit<AnnotationTool, 'id'>>;
|
|
139
|
-
export interface AnnotationPluginConfig extends BasePluginConfig {
|
|
140
|
-
/**
|
|
141
|
-
* A list of tools to add or override. If a tool's `id` matches a default tool,
|
|
142
|
-
* it is deep-merged with the default (partial overrides are supported).
|
|
143
|
-
* New tools (unmatched `id`) are added as-is.
|
|
144
|
-
*/
|
|
145
|
-
tools?: (AnnotationTool | AnnotationToolOverride)[];
|
|
146
|
-
colorPresets?: string[];
|
|
147
|
-
/** When true (default), automatically commit the annotation changes into the PDF document. */
|
|
148
|
-
autoCommit?: boolean;
|
|
149
|
-
/** The author of the annotation. */
|
|
150
|
-
annotationAuthor?: string;
|
|
151
|
-
/** When true (default false), deactivate the active tool after creating an annotation. */
|
|
152
|
-
deactivateToolAfterCreate?: boolean;
|
|
153
|
-
/** When true (default false), select the annotation immediately after creation. */
|
|
154
|
-
selectAfterCreate?: boolean;
|
|
155
|
-
/** Initial lock mode for new documents. Defaults to `{ type: LockModeType.None }` (nothing locked). */
|
|
156
|
-
locked?: LockMode;
|
|
157
|
-
/** When true (default false), automatically enter edit mode after creating an annotation. */
|
|
158
|
-
editAfterCreate?: boolean;
|
|
159
|
-
/** When true (default), the LinkLockedMode component auto-opens URI links via window.open. Set to false to handle URI navigation yourself via onNavigate. */
|
|
160
|
-
autoOpenLinks?: boolean;
|
|
161
|
-
}
|
|
162
|
-
/**
|
|
163
|
-
* Options for transforming an annotation
|
|
164
|
-
*/
|
|
165
|
-
export interface TransformOptions<T extends PdfAnnotationObject = PdfAnnotationObject> {
|
|
166
|
-
/** The type of transformation */
|
|
167
|
-
type: 'move' | 'resize' | 'vertex-edit' | 'rotate' | 'property-update';
|
|
168
|
-
/** The changes to apply */
|
|
169
|
-
changes: Partial<T>;
|
|
170
|
-
/** Optional metadata */
|
|
171
|
-
metadata?: {
|
|
172
|
-
maintainAspectRatio?: boolean;
|
|
173
|
-
/** Rotation angle in degrees (for 'rotate' transform type) */
|
|
174
|
-
rotationAngle?: number;
|
|
175
|
-
/** Delta from the initial rotation angle in degrees */
|
|
176
|
-
rotationDelta?: number;
|
|
177
|
-
/** Center point for rotation (defaults to rect center) */
|
|
178
|
-
rotationCenter?: {
|
|
179
|
-
x: number;
|
|
180
|
-
y: number;
|
|
181
|
-
};
|
|
182
|
-
/** Whether the rotation is currently snapped to a guide */
|
|
183
|
-
isSnapped?: boolean;
|
|
184
|
-
/** Snap target angle when isSnapped is true */
|
|
185
|
-
snappedAngle?: number;
|
|
186
|
-
[key: string]: any;
|
|
187
|
-
};
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* @deprecated Use `AnnotationTransferItem` instead. This type has a generic
|
|
191
|
-
* that resolves `ctx` to `undefined` for the base `PdfAnnotationObject` union,
|
|
192
|
-
* making it impossible to pass stamp context at the base type level.
|
|
193
|
-
*/
|
|
194
|
-
export type ImportAnnotationItem<T extends PdfAnnotationObject = PdfAnnotationObject> = {
|
|
195
|
-
annotation: T;
|
|
196
|
-
ctx?: AnnotationCreateContext<T>;
|
|
197
|
-
};
|
|
198
|
-
/**
|
|
199
|
-
* A portable annotation item used for both import and export.
|
|
200
|
-
* `exportAnnotations()` produces this type, `importAnnotations()` consumes it.
|
|
201
|
-
*
|
|
202
|
-
* For stamps, `ctx` carries the binary data needed for round-tripping:
|
|
203
|
-
* - `{ data: ArrayBuffer, mimeType?: ImageMimeType }` — the preferred shape.
|
|
204
|
-
* Export always includes `mimeType` (typically `'application/pdf'`).
|
|
205
|
-
* On import, `mimeType` is optional; the engine detects format from magic bytes.
|
|
206
|
-
* Supported formats: PNG, JPEG, PDF appearance.
|
|
207
|
-
* - `{ imageData: ImageData }` — raw bitmap for programmatic stamp creation.
|
|
208
|
-
*
|
|
209
|
-
* Legacy shape `{ appearance }` is still accepted on
|
|
210
|
-
* import but is deprecated; prefer `{ data }` instead.
|
|
211
|
-
*
|
|
212
|
-
* Non-stamp annotations need no `ctx`.
|
|
213
|
-
*/
|
|
214
|
-
export interface AnnotationTransferItem {
|
|
215
|
-
annotation: PdfAnnotationObject;
|
|
216
|
-
ctx?: AnnotationContextMap[keyof AnnotationContextMap];
|
|
217
|
-
}
|
|
218
|
-
/** @deprecated Use `AnnotationTransferItem` instead. */
|
|
219
|
-
export type ExportedAnnotation = AnnotationTransferItem;
|
|
220
|
-
export interface ExportAnnotationsOptions {
|
|
221
|
-
/** Export only annotations on a specific page. Omit to export all pages. */
|
|
222
|
-
pageIndex?: number;
|
|
223
|
-
}
|
|
224
|
-
export interface AnnotationStateChangeEvent {
|
|
225
|
-
documentId: string;
|
|
226
|
-
state: AnnotationDocumentState;
|
|
227
|
-
}
|
|
228
|
-
export interface AnnotationActiveToolChangeEvent {
|
|
229
|
-
documentId: string;
|
|
230
|
-
tool: AnnotationTool | null;
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Represents what grouping action is available for the current selection.
|
|
234
|
-
* - 'group': Selection can be grouped (2+ annotations, not all in same group)
|
|
235
|
-
* - 'ungroup': Selection is exactly one complete group that can be ungrouped
|
|
236
|
-
* - 'disabled': No valid grouping action (0-1 annotations selected)
|
|
237
|
-
*/
|
|
238
|
-
export type GroupingAction = 'group' | 'ungroup' | 'disabled';
|
|
239
|
-
type ToolUnion<TTools extends AnnotationToolMap> = TTools[ToolId<TTools>] & AnnotationTool;
|
|
240
|
-
type ToolEntry<TTools extends AnnotationToolMap, TId extends ToolId<TTools>> = ToolById<TTools, TId> & AnnotationTool;
|
|
241
|
-
export type NavigateTargetResult = {
|
|
242
|
-
outcome: 'navigated';
|
|
243
|
-
} | {
|
|
244
|
-
outcome: 'uri';
|
|
245
|
-
uri: string;
|
|
246
|
-
} | {
|
|
247
|
-
outcome: 'destination';
|
|
248
|
-
destination: PdfDestinationObject;
|
|
249
|
-
} | {
|
|
250
|
-
outcome: 'unsupported';
|
|
251
|
-
};
|
|
252
|
-
export interface NavigateEvent {
|
|
253
|
-
documentId: string;
|
|
254
|
-
result: NavigateTargetResult;
|
|
255
|
-
target: PdfLinkTarget;
|
|
256
|
-
}
|
|
257
|
-
export interface AnnotationScope<TTools extends AnnotationToolMap = AnnotationToolMap> {
|
|
258
|
-
getState(): AnnotationDocumentState;
|
|
259
|
-
getPageAnnotations(options: GetPageAnnotationsOptions): Task<PdfAnnotationObject[], PdfErrorReason>;
|
|
260
|
-
/** @deprecated Use getSelectedAnnotations() for multi-select support. Returns first selected or null. */
|
|
261
|
-
getSelectedAnnotation(): TrackedAnnotation | null;
|
|
262
|
-
/** Get all selected annotations */
|
|
263
|
-
getSelectedAnnotations(): TrackedAnnotation[];
|
|
264
|
-
/** Get the IDs of all selected annotations */
|
|
265
|
-
getSelectedAnnotationIds(): string[];
|
|
266
|
-
getAnnotationById(id: string): TrackedAnnotation | null;
|
|
267
|
-
/** Get all tracked annotations, optionally filtered by page */
|
|
268
|
-
getAnnotations(options?: GetAnnotationsOptions): TrackedAnnotation[];
|
|
269
|
-
/** Select a single annotation (clears previous selection) */
|
|
270
|
-
selectAnnotation(pageIndex: number, annotationId: string): void;
|
|
271
|
-
/** Toggle an annotation in/out of the current selection */
|
|
272
|
-
toggleSelection(pageIndex: number, annotationId: string): void;
|
|
273
|
-
/** Add an annotation to the current selection */
|
|
274
|
-
addToSelection(pageIndex: number, annotationId: string): void;
|
|
275
|
-
/** Remove an annotation from the current selection */
|
|
276
|
-
removeFromSelection(annotationId: string): void;
|
|
277
|
-
/** Set the selection to a specific set of annotation IDs (for marquee) */
|
|
278
|
-
setSelection(ids: string[]): void;
|
|
279
|
-
/** Clear all selection */
|
|
280
|
-
deselectAnnotation(): void;
|
|
281
|
-
getActiveTool(): ToolUnion<TTools> | null;
|
|
282
|
-
setActiveTool<TId extends ToolId<TTools>>(toolId: TId | null, context?: Record<string, unknown>): void;
|
|
283
|
-
setActiveTool(toolId: string | null, context?: Record<string, unknown>): void;
|
|
284
|
-
findToolForAnnotation(annotation: PdfAnnotationObject): ToolUnion<TTools> | null;
|
|
285
|
-
importAnnotations(items: AnnotationTransferItem[]): void;
|
|
286
|
-
exportAnnotations(options?: ExportAnnotationsOptions): Task<AnnotationTransferItem[], PdfErrorReason>;
|
|
287
|
-
createAnnotation<A extends PdfAnnotationObject>(pageIndex: number, annotation: A, context?: AnnotationCreateContext<A>): void;
|
|
288
|
-
updateAnnotation(pageIndex: number, annotationId: string, patch: Partial<PdfAnnotationObject>): void;
|
|
289
|
-
/** Batch update multiple annotations at once */
|
|
290
|
-
updateAnnotations(patches: Array<{
|
|
291
|
-
pageIndex: number;
|
|
292
|
-
id: string;
|
|
293
|
-
patch: Partial<PdfAnnotationObject>;
|
|
294
|
-
}>): void;
|
|
295
|
-
/** Move an annotation by delta or to an absolute position (preserves appearance stream) */
|
|
296
|
-
moveAnnotation(pageIndex: number, annotationId: string, position: Position, mode?: 'delta' | 'absolute'): void;
|
|
297
|
-
deleteAnnotation(pageIndex: number, annotationId: string): void;
|
|
298
|
-
/** Delete multiple annotations in batch */
|
|
299
|
-
deleteAnnotations(annotations: Array<{
|
|
300
|
-
pageIndex: number;
|
|
301
|
-
id: string;
|
|
302
|
-
}>): void;
|
|
303
|
-
/** Delete all annotations from the document */
|
|
304
|
-
deleteAllAnnotations(): void;
|
|
305
|
-
/** Remove an annotation from state without calling the engine (no PDF modification) */
|
|
306
|
-
purgeAnnotation(pageIndex: number, annotationId: string): void;
|
|
307
|
-
renderAnnotation(options: RenderAnnotationOptions): Task<Blob, PdfErrorReason>;
|
|
308
|
-
/** Batch-fetch rendered appearance stream images for all annotations on a page */
|
|
309
|
-
getPageAppearances(pageIndex: number, options?: PdfRenderPageAnnotationOptions): Task<AnnotationAppearanceMap<Blob>, PdfErrorReason>;
|
|
310
|
-
/** Clear cached appearance images for a page (e.g. on zoom change) */
|
|
311
|
-
invalidatePageAppearances(pageIndex: number): void;
|
|
312
|
-
commit(): Task<boolean, PdfErrorReason>;
|
|
313
|
-
/** Get link annotations attached to an annotation via IRT relationship */
|
|
314
|
-
getAttachedLinks(annotationId: string): TrackedAnnotation[];
|
|
315
|
-
/** Check if an annotation has attached link children */
|
|
316
|
-
hasAttachedLinks(annotationId: string): boolean;
|
|
317
|
-
/** Delete all link annotations attached to an annotation */
|
|
318
|
-
deleteAttachedLinks(annotationId: string): void;
|
|
319
|
-
/** Group the currently selected annotations (first selected becomes leader) */
|
|
320
|
-
groupAnnotations(): void;
|
|
321
|
-
/** Ungroup all annotations in the group containing the specified annotation */
|
|
322
|
-
ungroupAnnotations(annotationId: string): void;
|
|
323
|
-
/** Get all annotations in the same group as the specified annotation */
|
|
324
|
-
getGroupMembers(annotationId: string): TrackedAnnotation<PdfAnnotationObject>[];
|
|
325
|
-
/** Check if an annotation is part of a group */
|
|
326
|
-
isInGroup(annotationId: string): boolean;
|
|
327
|
-
/** Get the available grouping action for the current selection */
|
|
328
|
-
getGroupingAction(): GroupingAction;
|
|
329
|
-
/** Set which annotation categories are locked from UI interaction */
|
|
330
|
-
setLocked(mode: LockMode): void;
|
|
331
|
-
/** Get the current lock mode for this document */
|
|
332
|
-
getLocked(): LockMode;
|
|
333
|
-
/** Check if a specific annotation is locked (category-based or per-annotation flag).
|
|
334
|
-
* Legacy predicate kept for backward compatibility. Use `isAnnotationInteractive`,
|
|
335
|
-
* `isAnnotationStructurallyLocked`, or `isAnnotationContentLocked` for spec-aligned checks. */
|
|
336
|
-
isAnnotationLocked(annotation: PdfAnnotationObject): boolean;
|
|
337
|
-
/** Whether the annotation can be interacted with at all. False for `noView`, `hidden`,
|
|
338
|
-
* `readOnly`, or category-locked annotations. */
|
|
339
|
-
isAnnotationInteractive(annotation: PdfAnnotationObject): boolean;
|
|
340
|
-
/** Whether the annotation's structure (move/resize/rotate/vertex) is locked. True if
|
|
341
|
-
* non-interactive or the PDF `locked` flag is set. */
|
|
342
|
-
isAnnotationStructurallyLocked(annotation: PdfAnnotationObject): boolean;
|
|
343
|
-
/** Whether the annotation's content (e.g. FreeText text) is locked. True if
|
|
344
|
-
* non-interactive or the PDF `lockedContents` flag is set. */
|
|
345
|
-
isAnnotationContentLocked(annotation: PdfAnnotationObject): boolean;
|
|
346
|
-
/** Check if a single category is locked under the current mode */
|
|
347
|
-
isCategoryLocked(category: string): boolean;
|
|
348
|
-
/** Check if a tool (by ID) is locked under the current mode (resolves tool categories) */
|
|
349
|
-
isToolLocked(toolId: string): boolean;
|
|
350
|
-
/** Update annotation object state without marking dirty or triggering commits. Used by the form plugin to sync PDFium state to the UI. */
|
|
351
|
-
syncAnnotationObject(id: string, patch: Partial<PdfAnnotationObject>): void;
|
|
352
|
-
/** Navigate to a link target. Returns a result indicating whether the plugin handled it or the caller should open a URI. */
|
|
353
|
-
navigateTarget(target: PdfLinkTarget): Task<NavigateTargetResult, PdfErrorReason>;
|
|
354
|
-
onStateChange: EventHook<AnnotationDocumentState>;
|
|
355
|
-
onAnnotationEvent: EventHook<AnnotationEvent>;
|
|
356
|
-
onActiveToolChange: EventHook<ToolUnion<TTools> | null>;
|
|
357
|
-
onNavigate: EventHook<NavigateEvent>;
|
|
358
|
-
}
|
|
359
|
-
export interface AnnotationCapability<TTools extends AnnotationToolMap = AnnotationToolMap> {
|
|
360
|
-
getState: () => AnnotationDocumentState;
|
|
361
|
-
getPageAnnotations: (options: GetPageAnnotationsOptions) => Task<PdfAnnotationObject[], PdfErrorReason>;
|
|
362
|
-
/** @deprecated Use getSelectedAnnotations() for multi-select support. Returns first selected or null. */
|
|
363
|
-
getSelectedAnnotation: () => TrackedAnnotation | null;
|
|
364
|
-
/** Get all selected annotations */
|
|
365
|
-
getSelectedAnnotations: () => TrackedAnnotation[];
|
|
366
|
-
/** Get the IDs of all selected annotations */
|
|
367
|
-
getSelectedAnnotationIds: () => string[];
|
|
368
|
-
getAnnotationById(id: string): TrackedAnnotation | null;
|
|
369
|
-
/** Get all tracked annotations, optionally filtered by page */
|
|
370
|
-
getAnnotations: (options?: GetAnnotationsOptions) => TrackedAnnotation[];
|
|
371
|
-
/** Select a single annotation (clears previous selection) */
|
|
372
|
-
selectAnnotation: (pageIndex: number, annotationId: string) => void;
|
|
373
|
-
/** Toggle an annotation in/out of the current selection */
|
|
374
|
-
toggleSelection: (pageIndex: number, annotationId: string) => void;
|
|
375
|
-
/** Add an annotation to the current selection */
|
|
376
|
-
addToSelection: (pageIndex: number, annotationId: string) => void;
|
|
377
|
-
/** Remove an annotation from the current selection */
|
|
378
|
-
removeFromSelection: (annotationId: string) => void;
|
|
379
|
-
/** Set the selection to a specific set of annotation IDs (for marquee) */
|
|
380
|
-
setSelection: (ids: string[]) => void;
|
|
381
|
-
/** Clear all selection */
|
|
382
|
-
deselectAnnotation: () => void;
|
|
383
|
-
importAnnotations: (items: AnnotationTransferItem[]) => void;
|
|
384
|
-
exportAnnotations: (options?: ExportAnnotationsOptions, documentId?: string) => Task<AnnotationTransferItem[], PdfErrorReason>;
|
|
385
|
-
createAnnotation: <A extends PdfAnnotationObject>(pageIndex: number, annotation: A, context?: AnnotationCreateContext<A>) => void;
|
|
386
|
-
updateAnnotation: (pageIndex: number, annotationId: string, patch: Partial<PdfAnnotationObject>) => void;
|
|
387
|
-
/** Batch update multiple annotations at once */
|
|
388
|
-
updateAnnotations: (patches: Array<{
|
|
389
|
-
pageIndex: number;
|
|
390
|
-
id: string;
|
|
391
|
-
patch: Partial<PdfAnnotationObject>;
|
|
392
|
-
}>) => void;
|
|
393
|
-
/** Move an annotation by delta or to an absolute position (preserves appearance stream) */
|
|
394
|
-
moveAnnotation: (pageIndex: number, annotationId: string, position: Position, mode?: 'delta' | 'absolute', documentId?: string) => void;
|
|
395
|
-
deleteAnnotation: (pageIndex: number, annotationId: string) => void;
|
|
396
|
-
/** Delete multiple annotations in batch */
|
|
397
|
-
deleteAnnotations: (annotations: Array<{
|
|
398
|
-
pageIndex: number;
|
|
399
|
-
id: string;
|
|
400
|
-
}>, documentId?: string) => void;
|
|
401
|
-
/** Delete all annotations from the document */
|
|
402
|
-
deleteAllAnnotations: (documentId?: string) => void;
|
|
403
|
-
/** Remove an annotation from state without calling the engine (no PDF modification) */
|
|
404
|
-
purgeAnnotation: (pageIndex: number, annotationId: string, documentId?: string) => void;
|
|
405
|
-
renderAnnotation: (options: RenderAnnotationOptions) => Task<Blob, PdfErrorReason>;
|
|
406
|
-
/** Batch-fetch rendered appearance stream images for all annotations on a page */
|
|
407
|
-
getPageAppearances: (pageIndex: number, options?: PdfRenderPageAnnotationOptions, documentId?: string) => Task<AnnotationAppearanceMap<Blob>, PdfErrorReason>;
|
|
408
|
-
/** Clear cached appearance images for a page (e.g. on zoom change) */
|
|
409
|
-
invalidatePageAppearances: (pageIndex: number, documentId?: string) => void;
|
|
410
|
-
commit: () => Task<boolean, PdfErrorReason>;
|
|
411
|
-
/** Get link annotations attached to an annotation via IRT relationship */
|
|
412
|
-
getAttachedLinks: (annotationId: string, documentId?: string) => TrackedAnnotation[];
|
|
413
|
-
/** Check if an annotation has attached link children */
|
|
414
|
-
hasAttachedLinks: (annotationId: string, documentId?: string) => boolean;
|
|
415
|
-
/** Delete all link annotations attached to an annotation */
|
|
416
|
-
deleteAttachedLinks: (annotationId: string, documentId?: string) => void;
|
|
417
|
-
/** Group the currently selected annotations (first selected becomes leader) */
|
|
418
|
-
groupAnnotations: (documentId?: string) => void;
|
|
419
|
-
/** Ungroup all annotations in the group containing the specified annotation */
|
|
420
|
-
ungroupAnnotations: (annotationId: string, documentId?: string) => void;
|
|
421
|
-
/** Get all annotations in the same group as the specified annotation */
|
|
422
|
-
getGroupMembers: (annotationId: string, documentId?: string) => TrackedAnnotation<PdfAnnotationObject>[];
|
|
423
|
-
/** Check if an annotation is part of a group */
|
|
424
|
-
isInGroup: (annotationId: string, documentId?: string) => boolean;
|
|
425
|
-
/** Set which annotation categories are locked from UI interaction */
|
|
426
|
-
setLocked: (mode: LockMode, documentId?: string) => void;
|
|
427
|
-
/** Get the current lock mode */
|
|
428
|
-
getLocked: (documentId?: string) => LockMode;
|
|
429
|
-
/** Check if a specific annotation is locked (category-based or per-annotation flag).
|
|
430
|
-
* Legacy predicate kept for backward compatibility. */
|
|
431
|
-
isAnnotationLocked: (annotation: PdfAnnotationObject, documentId?: string) => boolean;
|
|
432
|
-
/** Whether the annotation can be interacted with at all. False for `noView`, `hidden`,
|
|
433
|
-
* `readOnly`, or category-locked annotations. */
|
|
434
|
-
isAnnotationInteractive: (annotation: PdfAnnotationObject, documentId?: string) => boolean;
|
|
435
|
-
/** Whether the annotation's structure (move/resize/rotate/vertex) is locked. */
|
|
436
|
-
isAnnotationStructurallyLocked: (annotation: PdfAnnotationObject, documentId?: string) => boolean;
|
|
437
|
-
/** Whether the annotation's content (e.g. FreeText text) is locked. */
|
|
438
|
-
isAnnotationContentLocked: (annotation: PdfAnnotationObject, documentId?: string) => boolean;
|
|
439
|
-
/** Check if a single category is locked under the current mode */
|
|
440
|
-
isCategoryLocked: (category: string, documentId?: string) => boolean;
|
|
441
|
-
/** Check if a tool (by ID) is locked under the current mode (resolves tool categories) */
|
|
442
|
-
isToolLocked: (toolId: string, documentId?: string) => boolean;
|
|
443
|
-
/** Update annotation object state without marking dirty or triggering commits. Used by the form plugin to sync PDFium state to the UI. */
|
|
444
|
-
syncAnnotationObject: (id: string, patch: Partial<PdfAnnotationObject>, documentId?: string) => void;
|
|
445
|
-
/** Navigate to a link target. Returns a result indicating whether the plugin handled it or the caller should open a URI. */
|
|
446
|
-
navigateTarget: (target: PdfLinkTarget, documentId?: string) => Task<NavigateTargetResult, PdfErrorReason>;
|
|
447
|
-
forDocument: (documentId: string) => AnnotationScope<TTools>;
|
|
448
|
-
getActiveTool: () => ToolUnion<TTools> | null;
|
|
449
|
-
setActiveTool: {
|
|
450
|
-
<TId extends ToolId<TTools>>(toolId: TId | null, context?: Record<string, unknown>): void;
|
|
451
|
-
(toolId: string | null, context?: Record<string, unknown>): void;
|
|
452
|
-
};
|
|
453
|
-
getTools: () => Array<ToolUnion<TTools>>;
|
|
454
|
-
getTool: {
|
|
455
|
-
<TId extends ToolId<TTools>>(toolId: TId): ToolEntry<TTools, TId> | undefined;
|
|
456
|
-
(toolId: string): AnnotationTool | undefined;
|
|
457
|
-
};
|
|
458
|
-
addTool: <T extends AnnotationTool<any> = AnnotationTool<any>>(tool: T) => void;
|
|
459
|
-
findToolForAnnotation: (annotation: PdfAnnotationObject) => ToolUnion<TTools> | null;
|
|
460
|
-
setToolDefaults: {
|
|
461
|
-
<TId extends ToolId<TTools>>(toolId: TId, patch: Partial<ToolById<TTools, TId>['defaults']>): void;
|
|
462
|
-
(toolId: string, patch: Partial<PdfAnnotationObject> & Record<string, unknown>): void;
|
|
463
|
-
};
|
|
464
|
-
getColorPresets: () => string[];
|
|
465
|
-
addColorPreset: (color: string) => void;
|
|
466
|
-
/**
|
|
467
|
-
* Transform an annotation based on interaction (move, resize, etc.)
|
|
468
|
-
* This applies annotation-specific logic to ensure consistency.
|
|
469
|
-
*/
|
|
470
|
-
transformAnnotation: <T extends PdfAnnotationObject>(annotation: T, options: TransformOptions<T>) => Partial<T>;
|
|
471
|
-
onStateChange: EventHook<AnnotationStateChangeEvent>;
|
|
472
|
-
onActiveToolChange: EventHook<AnnotationActiveToolChangeEvent>;
|
|
473
|
-
onAnnotationEvent: EventHook<AnnotationEvent>;
|
|
474
|
-
onToolsChange: EventHook<AnnotationToolsChangeEvent>;
|
|
475
|
-
onNavigate: EventHook<NavigateEvent>;
|
|
476
|
-
}
|
|
477
|
-
export interface GetPageAnnotationsOptions {
|
|
478
|
-
pageIndex: number;
|
|
479
|
-
}
|
|
480
|
-
export interface GetAnnotationsOptions {
|
|
481
|
-
/** Filter annotations by page index. Omit to get all annotations. */
|
|
482
|
-
pageIndex?: number;
|
|
483
|
-
}
|
|
484
|
-
export interface SidebarAnnotationEntry {
|
|
485
|
-
page: number;
|
|
486
|
-
annotation: TrackedAnnotation;
|
|
487
|
-
replies: TrackedAnnotation<PdfTextAnnoObject>[];
|
|
488
|
-
groupMembers?: TrackedAnnotation[];
|
|
489
|
-
}
|
|
490
|
-
/**
|
|
491
|
-
* Information about an annotation needed for constraint calculation.
|
|
492
|
-
*/
|
|
493
|
-
export interface AnnotationConstraintInfo {
|
|
494
|
-
id: string;
|
|
495
|
-
rect: Rect;
|
|
496
|
-
pageIndex: number;
|
|
497
|
-
pageSize: Size;
|
|
498
|
-
}
|
|
499
|
-
/**
|
|
500
|
-
* Combined constraints representing the intersection of all selected annotations' movement limits.
|
|
501
|
-
* These are the maximum distances the group can move in each direction without any annotation
|
|
502
|
-
* leaving its page bounds.
|
|
503
|
-
*/
|
|
504
|
-
export interface CombinedConstraints {
|
|
505
|
-
/** Maximum distance we can move up (positive = can move up) */
|
|
506
|
-
maxUp: number;
|
|
507
|
-
/** Maximum distance we can move down */
|
|
508
|
-
maxDown: number;
|
|
509
|
-
/** Maximum distance we can move left */
|
|
510
|
-
maxLeft: number;
|
|
511
|
-
/** Maximum distance we can move right */
|
|
512
|
-
maxRight: number;
|
|
513
|
-
}
|
|
514
|
-
/**
|
|
515
|
-
* Options for starting a unified drag operation.
|
|
516
|
-
* The plugin will automatically expand to include attached links.
|
|
517
|
-
*/
|
|
518
|
-
export interface UnifiedDragOptions {
|
|
519
|
-
/** The explicitly selected/dragged annotation IDs */
|
|
520
|
-
annotationIds: string[];
|
|
521
|
-
/** Page size for constraint calculation */
|
|
522
|
-
pageSize: Size;
|
|
523
|
-
}
|
|
524
|
-
/**
|
|
525
|
-
* State of the unified drag operation.
|
|
526
|
-
* Managed entirely by the plugin - framework components just subscribe.
|
|
527
|
-
*/
|
|
528
|
-
export interface UnifiedDragState {
|
|
529
|
-
/** The document this drag belongs to */
|
|
530
|
-
documentId: string;
|
|
531
|
-
/** Whether a drag is currently in progress */
|
|
532
|
-
isDragging: boolean;
|
|
533
|
-
/** The explicitly selected annotation IDs (what the user selected) */
|
|
534
|
-
primaryIds: string[];
|
|
535
|
-
/** Auto-expanded attached link IDs */
|
|
536
|
-
attachedLinkIds: string[];
|
|
537
|
-
/** All participant IDs (primaryIds + attachedLinkIds) */
|
|
538
|
-
allParticipantIds: string[];
|
|
539
|
-
/** Original rects for all participants (for computing final patches) */
|
|
540
|
-
originalRects: Map<string, Rect>;
|
|
541
|
-
/** Current cumulative delta (already clamped to constraints) */
|
|
542
|
-
delta: Position;
|
|
543
|
-
/** Combined constraints computed at drag start */
|
|
544
|
-
combinedConstraints: CombinedConstraints;
|
|
545
|
-
}
|
|
546
|
-
/**
|
|
547
|
-
* Event emitted when unified drag state changes.
|
|
548
|
-
*/
|
|
549
|
-
export interface UnifiedDragEvent {
|
|
550
|
-
/** The document this event belongs to */
|
|
551
|
-
documentId: string;
|
|
552
|
-
/** The type of change */
|
|
553
|
-
type: 'start' | 'update' | 'end' | 'cancel';
|
|
554
|
-
/** Current state */
|
|
555
|
-
state: UnifiedDragState;
|
|
556
|
-
/** Pre-computed patches for ALL participants - components just apply directly! */
|
|
557
|
-
previewPatches: Record<string, Partial<PdfAnnotationObject>>;
|
|
558
|
-
}
|
|
559
|
-
/**
|
|
560
|
-
* Options for starting a unified resize operation.
|
|
561
|
-
* The plugin will automatically expand to include attached links.
|
|
562
|
-
*/
|
|
563
|
-
export interface UnifiedResizeOptions {
|
|
564
|
-
/** The explicitly selected annotation IDs */
|
|
565
|
-
annotationIds: string[];
|
|
566
|
-
/** Page size for constraint calculation */
|
|
567
|
-
pageSize: Size;
|
|
568
|
-
/** Which resize handle is being used */
|
|
569
|
-
resizeHandle: string;
|
|
570
|
-
}
|
|
571
|
-
/**
|
|
572
|
-
* Information about an annotation participating in unified resize.
|
|
573
|
-
*/
|
|
574
|
-
export interface UnifiedResizeAnnotationInfo {
|
|
575
|
-
id: string;
|
|
576
|
-
originalRect: Rect;
|
|
577
|
-
/** The original unrotated rect at resize start (only for rotated annotations) */
|
|
578
|
-
originalUnrotatedRect?: Rect;
|
|
579
|
-
pageIndex: number;
|
|
580
|
-
/** Whether this is an attached link (auto-expanded) */
|
|
581
|
-
isAttachedLink: boolean;
|
|
582
|
-
/** The parent annotation ID (if this is an attached link) */
|
|
583
|
-
parentId?: string;
|
|
584
|
-
/** Relative X position within group (0-1) */
|
|
585
|
-
relativeX: number;
|
|
586
|
-
/** Relative Y position within group (0-1) */
|
|
587
|
-
relativeY: number;
|
|
588
|
-
/** Relative width within group (0-1) */
|
|
589
|
-
relativeWidth: number;
|
|
590
|
-
/** Relative height within group (0-1) */
|
|
591
|
-
relativeHeight: number;
|
|
592
|
-
}
|
|
593
|
-
/**
|
|
594
|
-
* State of the unified resize operation.
|
|
595
|
-
* Managed entirely by the plugin - framework components just subscribe.
|
|
596
|
-
*/
|
|
597
|
-
export interface UnifiedResizeState {
|
|
598
|
-
/** The document this resize belongs to */
|
|
599
|
-
documentId: string;
|
|
600
|
-
/** Whether a resize is currently in progress */
|
|
601
|
-
isResizing: boolean;
|
|
602
|
-
/** Whether this is a group resize (multiple primary annotations) */
|
|
603
|
-
isGroupResize: boolean;
|
|
604
|
-
/** The explicitly selected annotation IDs (what the user selected) */
|
|
605
|
-
primaryIds: string[];
|
|
606
|
-
/** Auto-expanded attached link IDs */
|
|
607
|
-
attachedLinkIds: string[];
|
|
608
|
-
/** All participant IDs (primaryIds + attachedLinkIds) */
|
|
609
|
-
allParticipantIds: string[];
|
|
610
|
-
/** The original group bounding box at resize start */
|
|
611
|
-
originalGroupBox: Rect;
|
|
612
|
-
/** The current (resized) group bounding box */
|
|
613
|
-
currentGroupBox: Rect;
|
|
614
|
-
/** All annotations participating with their relative positions */
|
|
615
|
-
participatingAnnotations: UnifiedResizeAnnotationInfo[];
|
|
616
|
-
/** Which resize handle is being used */
|
|
617
|
-
resizeHandle: string;
|
|
618
|
-
/** Current computed rects for all participants */
|
|
619
|
-
computedRects: Map<string, Rect>;
|
|
620
|
-
}
|
|
621
|
-
/**
|
|
622
|
-
* Event emitted when unified resize state changes.
|
|
623
|
-
*/
|
|
624
|
-
export interface UnifiedResizeEvent {
|
|
625
|
-
/** The document this event belongs to */
|
|
626
|
-
documentId: string;
|
|
627
|
-
/** The type of change */
|
|
628
|
-
type: 'start' | 'update' | 'end' | 'cancel';
|
|
629
|
-
/** Current state */
|
|
630
|
-
state: UnifiedResizeState;
|
|
631
|
-
/** Per-annotation computed rects for convenience (id -> new rect) */
|
|
632
|
-
computedRects: Record<string, Rect>;
|
|
633
|
-
/** Pre-computed patches for ALL participants - components just apply directly! */
|
|
634
|
-
previewPatches: Record<string, Partial<PdfAnnotationObject>>;
|
|
635
|
-
}
|
|
636
|
-
export interface UnifiedRotateOptions {
|
|
637
|
-
/** The explicitly selected annotation IDs */
|
|
638
|
-
annotationIds: string[];
|
|
639
|
-
/** Angle reported by the interaction controller at gesture start */
|
|
640
|
-
cursorAngle: number;
|
|
641
|
-
/** Optional rotation center override (defaults to selection center) */
|
|
642
|
-
rotationCenter?: Position;
|
|
643
|
-
}
|
|
644
|
-
export interface UnifiedRotateParticipant {
|
|
645
|
-
id: string;
|
|
646
|
-
rect: Rect;
|
|
647
|
-
pageIndex: number;
|
|
648
|
-
rotation: number;
|
|
649
|
-
unrotatedRect?: Rect;
|
|
650
|
-
isAttachedLink: boolean;
|
|
651
|
-
parentId?: string;
|
|
652
|
-
}
|
|
653
|
-
export interface UnifiedRotateState {
|
|
654
|
-
documentId: string;
|
|
655
|
-
isRotating: boolean;
|
|
656
|
-
primaryIds: string[];
|
|
657
|
-
attachedLinkIds: string[];
|
|
658
|
-
allParticipantIds: string[];
|
|
659
|
-
rotationCenter: Position;
|
|
660
|
-
cursorStartAngle: number;
|
|
661
|
-
currentAngle: number;
|
|
662
|
-
delta: number;
|
|
663
|
-
participants: UnifiedRotateParticipant[];
|
|
664
|
-
}
|
|
665
|
-
export interface UnifiedRotateEvent {
|
|
666
|
-
documentId: string;
|
|
667
|
-
type: 'start' | 'update' | 'end' | 'cancel';
|
|
668
|
-
state: UnifiedRotateState;
|
|
669
|
-
previewPatches: Record<string, Partial<PdfAnnotationObject>>;
|
|
670
|
-
}
|
|
671
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './use-state';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A simple, framework-agnostic state management utility for use within handlers.
|
|
3
|
-
* It creates a closure to hold a value that persists across multiple calls
|
|
4
|
-
* to the handler's methods (e.g., onPointerDown, onPointerMove).
|
|
5
|
-
*
|
|
6
|
-
* @param initialValue The initial value to store.
|
|
7
|
-
* @returns A tuple containing:
|
|
8
|
-
* - The current value.
|
|
9
|
-
* - A function to set a new value.
|
|
10
|
-
* - A function to get the current value without causing re-renders (useful inside closures).
|
|
11
|
-
*/
|
|
12
|
-
export declare function useState<T>(initialValue: T): [() => T, (newValue: T) => void];
|