@embedpdf/plugin-annotation 2.14.4 → 3.0.0-next.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.
- 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 -5237
- 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
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { MouseEvent } from '../../../preact/adapter.ts';
|
|
2
|
-
import { Rect, LinePoints, LineEndings, PdfAnnotationBorderStyle } from '@embedpdf/models';
|
|
3
|
-
interface LineProps {
|
|
4
|
-
/** interior colour */
|
|
5
|
-
color?: string;
|
|
6
|
-
/** 0 – 1 */
|
|
7
|
-
opacity?: number;
|
|
8
|
-
/** Stroke width in PDF units */
|
|
9
|
-
strokeWidth: number;
|
|
10
|
-
/** Stroke colour (falls back to PDFium default black) */
|
|
11
|
-
strokeColor?: string;
|
|
12
|
-
/** Stroke style */
|
|
13
|
-
strokeStyle?: PdfAnnotationBorderStyle;
|
|
14
|
-
/** Stroke dash array */
|
|
15
|
-
strokeDashArray?: number[];
|
|
16
|
-
/** Bounding box of the annotation */
|
|
17
|
-
rect: Rect;
|
|
18
|
-
/** Line start / end points (page units) */
|
|
19
|
-
linePoints: LinePoints;
|
|
20
|
-
/** Line endings (eg. OpenArrow / Butt) */
|
|
21
|
-
lineEndings?: LineEndings;
|
|
22
|
-
/** Current page zoom factor */
|
|
23
|
-
scale: number;
|
|
24
|
-
/** Click handler (used for selection) */
|
|
25
|
-
onClick?: (e: MouseEvent<SVGElement>) => void;
|
|
26
|
-
/** Whether the annotation is selected */
|
|
27
|
-
isSelected: boolean;
|
|
28
|
-
/** When true, AP canvas provides the visual; only render hit area */
|
|
29
|
-
appearanceActive?: boolean;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Renders a PDF Line annotation as SVG (with arrow/butt endings).
|
|
33
|
-
*/
|
|
34
|
-
export declare function Line({ color, opacity, strokeWidth, strokeColor, strokeStyle, strokeDashArray, rect, linePoints, lineEndings, scale, onClick, isSelected, appearanceActive, }: LineProps): JSX.Element;
|
|
35
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { MouseEvent } from '../../../preact/adapter.ts';
|
|
2
|
-
import { PdfAnnotationBorderStyle, Rect } from '@embedpdf/models';
|
|
3
|
-
interface LinkProps {
|
|
4
|
-
/** Whether the annotation is selected */
|
|
5
|
-
isSelected: boolean;
|
|
6
|
-
/** Stroke colour – defaults to blue when omitted */
|
|
7
|
-
strokeColor?: string;
|
|
8
|
-
/** Stroke width in PDF units */
|
|
9
|
-
strokeWidth?: number;
|
|
10
|
-
/** Stroke type – defaults to underline when omitted */
|
|
11
|
-
strokeStyle?: PdfAnnotationBorderStyle;
|
|
12
|
-
/** Stroke dash array – for dashed style */
|
|
13
|
-
strokeDashArray?: number[];
|
|
14
|
-
/** Bounding box of the annotation (PDF units) */
|
|
15
|
-
rect: Rect;
|
|
16
|
-
/** Current page zoom factor */
|
|
17
|
-
scale: number;
|
|
18
|
-
/** Click handler (used for selection) */
|
|
19
|
-
onClick?: (e: MouseEvent<SVGElement>) => void;
|
|
20
|
-
/** Whether this link has an IRT (In Reply To) reference - disables direct interaction */
|
|
21
|
-
hasIRT?: boolean;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Renders a PDF Link annotation as SVG.
|
|
25
|
-
* Supports underline (default), solid, and dashed border styles.
|
|
26
|
-
*/
|
|
27
|
-
export declare function Link({ isSelected, strokeColor, strokeWidth, strokeStyle, strokeDashArray, rect, scale, onClick, hasIRT, }: LinkProps): JSX.Element;
|
|
28
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { MouseEvent } from '../../../preact/adapter.ts';
|
|
2
|
-
import { Rect, Position, PdfAnnotationBorderStyle } from '@embedpdf/models';
|
|
3
|
-
interface PolygonProps {
|
|
4
|
-
rect: Rect;
|
|
5
|
-
vertices: Position[];
|
|
6
|
-
color?: string;
|
|
7
|
-
strokeColor?: string;
|
|
8
|
-
opacity?: number;
|
|
9
|
-
strokeWidth: number;
|
|
10
|
-
strokeStyle?: PdfAnnotationBorderStyle;
|
|
11
|
-
strokeDashArray?: number[];
|
|
12
|
-
scale: number;
|
|
13
|
-
isSelected: boolean;
|
|
14
|
-
onClick?: (e: MouseEvent<SVGElement>) => void;
|
|
15
|
-
currentVertex?: Position;
|
|
16
|
-
handleSize?: number;
|
|
17
|
-
/** When true, AP canvas provides the visual; only render hit area */
|
|
18
|
-
appearanceActive?: boolean;
|
|
19
|
-
/** Cloudy border intensity (0 = no cloud, typically 1 or 2) */
|
|
20
|
-
cloudyBorderIntensity?: number;
|
|
21
|
-
}
|
|
22
|
-
export declare function Polygon({ rect, vertices, color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, scale, isSelected, onClick, currentVertex, handleSize, appearanceActive, cloudyBorderIntensity, }: PolygonProps): JSX.Element;
|
|
23
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { MouseEvent } from '../../../preact/adapter.ts';
|
|
2
|
-
import { Rect, Position, LineEndings, PdfAnnotationBorderStyle } from '@embedpdf/models';
|
|
3
|
-
interface PolylineProps {
|
|
4
|
-
rect: Rect;
|
|
5
|
-
vertices: Position[];
|
|
6
|
-
color?: string;
|
|
7
|
-
strokeColor?: string;
|
|
8
|
-
opacity?: number;
|
|
9
|
-
strokeWidth: number;
|
|
10
|
-
/** Stroke style */
|
|
11
|
-
strokeStyle?: PdfAnnotationBorderStyle;
|
|
12
|
-
/** Stroke dash array */
|
|
13
|
-
strokeDashArray?: number[];
|
|
14
|
-
scale: number;
|
|
15
|
-
isSelected: boolean;
|
|
16
|
-
onClick?: (e: MouseEvent<SVGElement>) => void;
|
|
17
|
-
/** Optional start & end endings */
|
|
18
|
-
lineEndings?: LineEndings;
|
|
19
|
-
/** When true, AP canvas provides the visual; only render hit area */
|
|
20
|
-
appearanceActive?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export declare function Polyline({ rect, vertices, color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, scale, isSelected, onClick, lineEndings, appearanceActive, }: PolylineProps): JSX.Element;
|
|
23
|
-
export {};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { MouseEvent } from '../../../preact/adapter.ts';
|
|
2
|
-
import { PdfAnnotationBorderStyle, PdfRectDifferences, Rect } from '@embedpdf/models';
|
|
3
|
-
interface SquareProps {
|
|
4
|
-
/** Whether the annotation is selected */
|
|
5
|
-
isSelected: boolean;
|
|
6
|
-
/** Fill colour – defaults to PDFium's black if omitted */
|
|
7
|
-
color?: string;
|
|
8
|
-
/** Stroke colour – defaults to same as fill when omitted */
|
|
9
|
-
strokeColor?: string;
|
|
10
|
-
/** 0 – 1 */
|
|
11
|
-
opacity?: number;
|
|
12
|
-
/** Stroke width in PDF units */
|
|
13
|
-
strokeWidth: number;
|
|
14
|
-
/** Stroke type – defaults to solid when omitted */
|
|
15
|
-
strokeStyle?: PdfAnnotationBorderStyle;
|
|
16
|
-
/** Stroke dash array – defaults to undefined when omitted */
|
|
17
|
-
strokeDashArray?: number[];
|
|
18
|
-
/** Bounding box of the annotation (PDF units) */
|
|
19
|
-
rect: Rect;
|
|
20
|
-
/** Current page zoom factor */
|
|
21
|
-
scale: number;
|
|
22
|
-
/** Click handler (used for selection) */
|
|
23
|
-
onClick?: (e: MouseEvent<SVGElement>) => void;
|
|
24
|
-
/** When true, AP canvas provides the visual; only render hit area */
|
|
25
|
-
appearanceActive?: boolean;
|
|
26
|
-
/** Cloudy border intensity (0 = no cloud, typically 1 or 2) */
|
|
27
|
-
cloudyBorderIntensity?: number;
|
|
28
|
-
/** Rectangle differences – inset from Rect to drawn area */
|
|
29
|
-
rectangleDifferences?: PdfRectDifferences;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Renders a PDF Square annotation (rectangle) as SVG.
|
|
33
|
-
*/
|
|
34
|
-
export declare function Square({ isSelected, color, strokeColor, opacity, strokeWidth, strokeStyle, strokeDashArray, rect, scale, onClick, appearanceActive, cloudyBorderIntensity, rectangleDifferences, }: SquareProps): JSX.Element;
|
|
35
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { MouseEvent } from '../../../preact/adapter.ts';
|
|
2
|
-
import { PdfStampAnnoObject } from '@embedpdf/models';
|
|
3
|
-
import { TrackedAnnotation } from '../../../lib/index.ts';
|
|
4
|
-
interface StampProps {
|
|
5
|
-
isSelected: boolean;
|
|
6
|
-
annotation: TrackedAnnotation<PdfStampAnnoObject>;
|
|
7
|
-
documentId: string;
|
|
8
|
-
pageIndex: number;
|
|
9
|
-
scale: number;
|
|
10
|
-
onClick?: (e: MouseEvent<HTMLDivElement>) => void;
|
|
11
|
-
}
|
|
12
|
-
export declare function Stamp({ isSelected, annotation, documentId, pageIndex, scale, onClick, }: StampProps): import("preact").JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { MouseEvent } from '../../../preact/adapter.ts';
|
|
2
|
-
interface TextProps {
|
|
3
|
-
isSelected: boolean;
|
|
4
|
-
color?: string;
|
|
5
|
-
opacity?: number;
|
|
6
|
-
onClick?: (e: MouseEvent<HTMLDivElement>) => void;
|
|
7
|
-
appearanceActive?: boolean;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Renders a fallback sticky-note icon for PDF Text annotations when no
|
|
11
|
-
* appearance stream image is available.
|
|
12
|
-
*/
|
|
13
|
-
export declare function Text({ isSelected, color, opacity, onClick, appearanceActive, }: TextProps): JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { PdfAnnotationObject } from '@embedpdf/models';
|
|
2
|
-
import { CustomAnnotationRenderer, ResizeHandleUI, AnnotationSelectionMenuRenderFn, GroupSelectionMenuRenderFn, VertexHandleUI, RotationHandleUI, SelectionOutline, BoxedAnnotationRenderer } from './types';
|
|
3
|
-
interface AnnotationsProps {
|
|
4
|
-
documentId: string;
|
|
5
|
-
pageIndex: number;
|
|
6
|
-
scale: number;
|
|
7
|
-
rotation: number;
|
|
8
|
-
pageWidth: number;
|
|
9
|
-
pageHeight: number;
|
|
10
|
-
selectionMenu?: AnnotationSelectionMenuRenderFn;
|
|
11
|
-
groupSelectionMenu?: GroupSelectionMenuRenderFn;
|
|
12
|
-
resizeUI?: ResizeHandleUI;
|
|
13
|
-
vertexUI?: VertexHandleUI;
|
|
14
|
-
rotationUI?: RotationHandleUI;
|
|
15
|
-
selectionOutlineColor?: string;
|
|
16
|
-
selectionOutline?: SelectionOutline;
|
|
17
|
-
groupSelectionOutline?: SelectionOutline;
|
|
18
|
-
customAnnotationRenderer?: CustomAnnotationRenderer<PdfAnnotationObject>;
|
|
19
|
-
annotationRenderers?: BoxedAnnotationRenderer[];
|
|
20
|
-
}
|
|
21
|
-
export declare function Annotations(annotationsProps: AnnotationsProps): import("preact").JSX.Element;
|
|
22
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { AnnotationAppearanceImage } from '@embedpdf/models';
|
|
2
|
-
import { CSSProperties } from '../../preact/adapter.ts';
|
|
3
|
-
interface AppearanceImageProps {
|
|
4
|
-
appearance: AnnotationAppearanceImage<Blob>;
|
|
5
|
-
style?: CSSProperties;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Renders a pre-rendered annotation appearance stream image as an img URL.
|
|
9
|
-
* Purely visual -- pointer events are always disabled; hit-area SVG handles interaction.
|
|
10
|
-
*/
|
|
11
|
-
export declare function AppearanceImage({ appearance, style }: AppearanceImageProps): import("preact").JSX.Element | null;
|
|
12
|
-
export {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { TrackedAnnotation } from '../../lib/index.ts';
|
|
2
|
-
import { ResizeHandleUI, RotationHandleUI, GroupSelectionMenuRenderFn, SelectionOutline } from './types';
|
|
3
|
-
interface GroupSelectionBoxProps {
|
|
4
|
-
documentId: string;
|
|
5
|
-
pageIndex: number;
|
|
6
|
-
scale: number;
|
|
7
|
-
rotation: number;
|
|
8
|
-
pageWidth: number;
|
|
9
|
-
pageHeight: number;
|
|
10
|
-
/** All selected annotations on this page */
|
|
11
|
-
selectedAnnotations: TrackedAnnotation[];
|
|
12
|
-
/** Whether the group is draggable (all annotations must be group-draggable) */
|
|
13
|
-
isDraggable: boolean;
|
|
14
|
-
/** Whether the group is resizable (all annotations must be group-resizable) */
|
|
15
|
-
isResizable: boolean;
|
|
16
|
-
/** Whether the group can be rotated */
|
|
17
|
-
isRotatable?: boolean;
|
|
18
|
-
/** Whether to lock aspect ratio during group resize */
|
|
19
|
-
lockAspectRatio?: boolean;
|
|
20
|
-
/** Resize handle UI customization */
|
|
21
|
-
resizeUI?: ResizeHandleUI;
|
|
22
|
-
/** Rotation handle UI customization */
|
|
23
|
-
rotationUI?: RotationHandleUI;
|
|
24
|
-
/** @deprecated Use `selectionOutline.color` instead */
|
|
25
|
-
selectionOutlineColor?: string;
|
|
26
|
-
/** @deprecated Use `selectionOutline.offset` instead */
|
|
27
|
-
outlineOffset?: number;
|
|
28
|
-
/** Customize the selection outline (color, style, width, offset) */
|
|
29
|
-
selectionOutline?: SelectionOutline;
|
|
30
|
-
/** Z-index for the group box */
|
|
31
|
-
zIndex?: number;
|
|
32
|
-
/** Group selection menu render function */
|
|
33
|
-
groupSelectionMenu?: GroupSelectionMenuRenderFn;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* GroupSelectionBox renders a bounding box around all selected annotations
|
|
37
|
-
* with drag and resize handles for group manipulation.
|
|
38
|
-
*/
|
|
39
|
-
export declare function GroupSelectionBox({ documentId, pageIndex, scale, rotation, pageWidth, pageHeight, selectedAnnotations, isDraggable, isResizable, isRotatable, lockAspectRatio, resizeUI, rotationUI, selectionOutlineColor, outlineOffset, selectionOutline, zIndex, groupSelectionMenu, }: GroupSelectionBoxProps): JSX.Element | null;
|
|
40
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes, CSSProperties } from '../../preact/adapter.ts';
|
|
2
|
-
import { PdfAnnotationObject } from '@embedpdf/models';
|
|
3
|
-
type RenderAnnotationProps = Omit<HTMLAttributes<HTMLImageElement>, 'style'> & {
|
|
4
|
-
documentId: string;
|
|
5
|
-
pageIndex: number;
|
|
6
|
-
annotation: PdfAnnotationObject;
|
|
7
|
-
scaleFactor?: number;
|
|
8
|
-
dpr?: number;
|
|
9
|
-
style?: CSSProperties;
|
|
10
|
-
unrotated?: boolean;
|
|
11
|
-
};
|
|
12
|
-
export declare function RenderAnnotation({ documentId, pageIndex, annotation, scaleFactor, unrotated, style, ...props }: RenderAnnotationProps): import("preact").JSX.Element;
|
|
13
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, MouseEvent } from '../../../preact/adapter.ts';
|
|
2
|
-
import { Rect } from '@embedpdf/models';
|
|
3
|
-
type HighlightProps = {
|
|
4
|
-
/** Stroke/markup color */
|
|
5
|
-
strokeColor?: string;
|
|
6
|
-
opacity?: number;
|
|
7
|
-
segmentRects: Rect[];
|
|
8
|
-
rect?: Rect;
|
|
9
|
-
scale: number;
|
|
10
|
-
onClick?: (e: MouseEvent<HTMLDivElement>) => void;
|
|
11
|
-
style?: CSSProperties;
|
|
12
|
-
/** When true, AP image provides the visual; only render hit area */
|
|
13
|
-
appearanceActive?: boolean;
|
|
14
|
-
};
|
|
15
|
-
export declare function Highlight({ strokeColor, opacity, segmentRects, rect, scale, onClick, style, appearanceActive, }: HighlightProps): import("preact").JSX.Element;
|
|
16
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, MouseEvent } from '../../../preact/adapter.ts';
|
|
2
|
-
import { Rect } from '@embedpdf/models';
|
|
3
|
-
type SquigglyProps = {
|
|
4
|
-
/** Stroke/markup color */
|
|
5
|
-
strokeColor?: string;
|
|
6
|
-
opacity?: number;
|
|
7
|
-
segmentRects: Rect[];
|
|
8
|
-
rect?: Rect;
|
|
9
|
-
scale: number;
|
|
10
|
-
onClick?: (e: MouseEvent<HTMLDivElement>) => void;
|
|
11
|
-
style?: CSSProperties;
|
|
12
|
-
/** When true, AP image provides the visual; only render hit area */
|
|
13
|
-
appearanceActive?: boolean;
|
|
14
|
-
};
|
|
15
|
-
export declare function Squiggly({ strokeColor, opacity, segmentRects, rect, scale, onClick, style, appearanceActive, }: SquigglyProps): import("preact").JSX.Element;
|
|
16
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, MouseEvent } from '../../../preact/adapter.ts';
|
|
2
|
-
import { Rect } from '@embedpdf/models';
|
|
3
|
-
type StrikeoutProps = {
|
|
4
|
-
/** Stroke/markup color */
|
|
5
|
-
strokeColor?: string;
|
|
6
|
-
opacity?: number;
|
|
7
|
-
segmentRects: Rect[];
|
|
8
|
-
rect?: Rect;
|
|
9
|
-
scale: number;
|
|
10
|
-
onClick?: (e: MouseEvent<HTMLDivElement>) => void;
|
|
11
|
-
style?: CSSProperties;
|
|
12
|
-
/** When true, AP image provides the visual; only render hit area */
|
|
13
|
-
appearanceActive?: boolean;
|
|
14
|
-
};
|
|
15
|
-
export declare function Strikeout({ strokeColor, opacity, segmentRects, rect, scale, onClick, style, appearanceActive, }: StrikeoutProps): import("preact").JSX.Element;
|
|
16
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { CSSProperties, MouseEvent } from '../../../preact/adapter.ts';
|
|
2
|
-
import { Rect } from '@embedpdf/models';
|
|
3
|
-
type UnderlineProps = {
|
|
4
|
-
/** Stroke/markup color */
|
|
5
|
-
strokeColor?: string;
|
|
6
|
-
opacity?: number;
|
|
7
|
-
segmentRects: Rect[];
|
|
8
|
-
rect?: Rect;
|
|
9
|
-
scale: number;
|
|
10
|
-
onClick?: (e: MouseEvent<HTMLDivElement>) => void;
|
|
11
|
-
style?: CSSProperties;
|
|
12
|
-
/** When true, AP image provides the visual; only render hit area */
|
|
13
|
-
appearanceActive?: boolean;
|
|
14
|
-
};
|
|
15
|
-
export declare function Underline({ strokeColor, opacity, segmentRects, rect, scale, onClick, style, appearanceActive, }: UnderlineProps): import("preact").JSX.Element;
|
|
16
|
-
export {};
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import { PdfAnnotationObject, PdfBlendMode, Rect } from '@embedpdf/models';
|
|
2
|
-
import { TrackedAnnotation, PreviewState } from '../../lib/index.ts';
|
|
3
|
-
import { HandleElementProps, SelectionMenuPropsBase, SelectionMenuRenderFn } from '../../preact/utils.ts';
|
|
4
|
-
import { JSX, CSSProperties, MouseEvent } from '../../preact/adapter.ts';
|
|
5
|
-
import { VertexConfig } from '../types';
|
|
6
|
-
export type ResizeDirection = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'none';
|
|
7
|
-
export interface AnnotationSelectionContext {
|
|
8
|
-
type: 'annotation';
|
|
9
|
-
annotation: TrackedAnnotation;
|
|
10
|
-
pageIndex: number;
|
|
11
|
-
/**
|
|
12
|
-
* Derived: PDF `locked` flag is set OR the annotation is non-interactive.
|
|
13
|
-
* Consumers should disable move/resize/rotate/delete/property-change menu items
|
|
14
|
-
* when this is true.
|
|
15
|
-
*/
|
|
16
|
-
structurallyLocked: boolean;
|
|
17
|
-
/**
|
|
18
|
-
* Derived: PDF `lockedContents` flag is set OR the annotation is non-interactive.
|
|
19
|
-
* Consumers should disable content-editing menu items (e.g. FreeText text edit)
|
|
20
|
-
* when this is true.
|
|
21
|
-
*/
|
|
22
|
-
contentLocked: boolean;
|
|
23
|
-
}
|
|
24
|
-
export type AnnotationSelectionMenuProps = SelectionMenuPropsBase<AnnotationSelectionContext>;
|
|
25
|
-
export type AnnotationSelectionMenuRenderFn = SelectionMenuRenderFn<AnnotationSelectionContext>;
|
|
26
|
-
export interface GroupSelectionContext {
|
|
27
|
-
type: 'group';
|
|
28
|
-
annotations: TrackedAnnotation[];
|
|
29
|
-
pageIndex: number;
|
|
30
|
-
}
|
|
31
|
-
export type GroupSelectionMenuProps = SelectionMenuPropsBase<GroupSelectionContext>;
|
|
32
|
-
export type GroupSelectionMenuRenderFn = SelectionMenuRenderFn<GroupSelectionContext>;
|
|
33
|
-
export type HandleProps = HandleElementProps & {
|
|
34
|
-
backgroundColor?: string;
|
|
35
|
-
};
|
|
36
|
-
/** UI customization for resize handles */
|
|
37
|
-
export interface ResizeHandleUI {
|
|
38
|
-
/** Handle size in CSS px (default: 12) */
|
|
39
|
-
size?: number;
|
|
40
|
-
/** Default background color for the handle (used by default renderer) */
|
|
41
|
-
color?: string;
|
|
42
|
-
/** Custom renderer for each handle (overrides default) */
|
|
43
|
-
component?: (p: HandleProps) => JSX.Element;
|
|
44
|
-
}
|
|
45
|
-
/** UI customization for vertex handles */
|
|
46
|
-
export interface VertexHandleUI {
|
|
47
|
-
/** Handle size in CSS px (default: 12) */
|
|
48
|
-
size?: number;
|
|
49
|
-
/** Default background color for the handle (used by default renderer) */
|
|
50
|
-
color?: string;
|
|
51
|
-
/** Custom renderer for each vertex (overrides default) */
|
|
52
|
-
component?: (p: HandleProps) => JSX.Element;
|
|
53
|
-
}
|
|
54
|
-
/** Props for the rotation handle component */
|
|
55
|
-
export interface RotationHandleComponentProps extends HandleProps {
|
|
56
|
-
/** Props for the connector line element */
|
|
57
|
-
connectorStyle?: CSSProperties;
|
|
58
|
-
/** Whether to show the connector line */
|
|
59
|
-
showConnector?: boolean;
|
|
60
|
-
/** Color for the icon inside the handle (default: '#007ACC') */
|
|
61
|
-
iconColor?: string;
|
|
62
|
-
/** Resolved border configuration */
|
|
63
|
-
border?: RotationHandleBorder;
|
|
64
|
-
}
|
|
65
|
-
export type BorderStyle = 'solid' | 'dashed' | 'dotted';
|
|
66
|
-
export interface SelectionOutline {
|
|
67
|
-
/** Outline color (default: '#007ACC') */
|
|
68
|
-
color?: string;
|
|
69
|
-
/** Outline style (default: 'solid' for single, 'dashed' for group) */
|
|
70
|
-
style?: BorderStyle;
|
|
71
|
-
/** Outline width in px (default: 1 for single, 2 for group) */
|
|
72
|
-
width?: number;
|
|
73
|
-
/** Outline offset in px (default: 1 for single, 2 for group) */
|
|
74
|
-
offset?: number;
|
|
75
|
-
}
|
|
76
|
-
/** Border configuration for the rotation handle */
|
|
77
|
-
export interface RotationHandleBorder {
|
|
78
|
-
/** Border color (default: '#007ACC') */
|
|
79
|
-
color?: string;
|
|
80
|
-
/** Border style (default: 'solid') */
|
|
81
|
-
style?: BorderStyle;
|
|
82
|
-
/** Border width in px (default: 1) */
|
|
83
|
-
width?: number;
|
|
84
|
-
}
|
|
85
|
-
/** UI customization for rotation handle */
|
|
86
|
-
export interface RotationHandleUI {
|
|
87
|
-
/** Handle size in CSS px (default: 16) */
|
|
88
|
-
size?: number;
|
|
89
|
-
/** Gap in CSS px between the bounding box edge and the rotation handle center (default: 20) */
|
|
90
|
-
margin?: number;
|
|
91
|
-
/** Default background color for the handle (default: 'white') */
|
|
92
|
-
color?: string;
|
|
93
|
-
/** Color for the connector line (default: '#007ACC') */
|
|
94
|
-
connectorColor?: string;
|
|
95
|
-
/** Whether to show the connector line (default: true) */
|
|
96
|
-
showConnector?: boolean;
|
|
97
|
-
/** Color for the icon inside the handle (default: '#007ACC') */
|
|
98
|
-
iconColor?: string;
|
|
99
|
-
/** Border configuration for the handle */
|
|
100
|
-
border?: RotationHandleBorder;
|
|
101
|
-
/** Custom renderer for the rotation handle (overrides default) */
|
|
102
|
-
component?: (p: RotationHandleComponentProps) => JSX.Element;
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Props for the custom annotation renderer
|
|
106
|
-
*/
|
|
107
|
-
export interface CustomAnnotationRendererProps<T extends PdfAnnotationObject> {
|
|
108
|
-
annotation: T;
|
|
109
|
-
children: JSX.Element;
|
|
110
|
-
isSelected: boolean;
|
|
111
|
-
scale: number;
|
|
112
|
-
rotation: number;
|
|
113
|
-
pageWidth: number;
|
|
114
|
-
pageHeight: number;
|
|
115
|
-
pageIndex: number;
|
|
116
|
-
onSelect: (event: any) => void;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Custom renderer for an annotation
|
|
120
|
-
*/
|
|
121
|
-
export type CustomAnnotationRenderer<T extends PdfAnnotationObject> = (props: CustomAnnotationRendererProps<T>) => JSX.Element | null;
|
|
122
|
-
/**
|
|
123
|
-
* Properly typed event for annotation interactions (click, select, etc.)
|
|
124
|
-
*/
|
|
125
|
-
export type AnnotationInteractionEvent = MouseEvent<Element>;
|
|
126
|
-
/**
|
|
127
|
-
* Props for an annotation renderer entry
|
|
128
|
-
*/
|
|
129
|
-
export interface AnnotationRendererProps<T extends PdfAnnotationObject = PdfAnnotationObject> {
|
|
130
|
-
annotation: TrackedAnnotation<T>;
|
|
131
|
-
currentObject: T;
|
|
132
|
-
isSelected: boolean;
|
|
133
|
-
isEditing: boolean;
|
|
134
|
-
scale: number;
|
|
135
|
-
pageIndex: number;
|
|
136
|
-
documentId: string;
|
|
137
|
-
onClick?: (e: AnnotationInteractionEvent) => void;
|
|
138
|
-
/** When true, AP canvas provides the visual; component should only render hit area */
|
|
139
|
-
appearanceActive: boolean;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Helpers passed to selectOverride for custom selection behavior.
|
|
143
|
-
*/
|
|
144
|
-
export interface SelectOverrideHelpers {
|
|
145
|
-
defaultSelect: (e: AnnotationInteractionEvent, annotation: TrackedAnnotation) => void;
|
|
146
|
-
selectAnnotation: (pageIndex: number, id: string) => void;
|
|
147
|
-
clearSelection: () => void;
|
|
148
|
-
allAnnotations: TrackedAnnotation[];
|
|
149
|
-
pageIndex: number;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Entry for a custom annotation renderer that handles specific annotation types.
|
|
153
|
-
* This allows external plugins to provide their own rendering for annotation subtypes.
|
|
154
|
-
* Used at definition time for type safety.
|
|
155
|
-
*/
|
|
156
|
-
export interface AnnotationRendererEntry<T extends PdfAnnotationObject = PdfAnnotationObject, P = never> {
|
|
157
|
-
/** Unique identifier for this renderer (usually matches tool id) */
|
|
158
|
-
id: string;
|
|
159
|
-
/** Returns true if this renderer should handle the annotation. Optional for preview-only renderers. */
|
|
160
|
-
matches?: (annotation: PdfAnnotationObject) => annotation is T;
|
|
161
|
-
/** The component to render the annotation. Optional for preview-only renderers. */
|
|
162
|
-
render?: (props: AnnotationRendererProps<T>) => JSX.Element;
|
|
163
|
-
/** Returns true if this renderer should handle the given preview state */
|
|
164
|
-
matchesPreview?: (preview: PreviewState) => boolean;
|
|
165
|
-
/** Render a preview during drag-to-create. P is the preview data type. */
|
|
166
|
-
renderPreview?: (props: {
|
|
167
|
-
data: P;
|
|
168
|
-
bounds: Rect;
|
|
169
|
-
scale: number;
|
|
170
|
-
}) => JSX.Element;
|
|
171
|
-
/** Extra styles merged onto the preview container div (e.g. mixBlendMode for ink). */
|
|
172
|
-
previewContainerStyle?: (props: {
|
|
173
|
-
data: P;
|
|
174
|
-
bounds: Rect;
|
|
175
|
-
scale: number;
|
|
176
|
-
}) => CSSProperties;
|
|
177
|
-
/** Vertex configuration for annotations with draggable vertices (line, polyline, polygon) */
|
|
178
|
-
vertexConfig?: VertexConfig<T>;
|
|
179
|
-
/** z-index for the annotation container (default: 1, text markup uses 0) */
|
|
180
|
-
zIndex?: number;
|
|
181
|
-
/** Default blend mode for this annotation type (used when annotation.blendMode is not set) */
|
|
182
|
-
defaultBlendMode?: PdfBlendMode;
|
|
183
|
-
/** Style applied to the annotation container — overrides the default blend-mode style. */
|
|
184
|
-
containerStyle?: (annotation: T) => CSSProperties;
|
|
185
|
-
/** Type-specific interaction fallbacks used when the tool doesn't define a property */
|
|
186
|
-
interactionDefaults?: {
|
|
187
|
-
isDraggable?: boolean;
|
|
188
|
-
isResizable?: boolean;
|
|
189
|
-
isRotatable?: boolean;
|
|
190
|
-
lockAspectRatio?: boolean;
|
|
191
|
-
};
|
|
192
|
-
/** Whether this annotation type uses AP rendering before editing (default: true) */
|
|
193
|
-
useAppearanceStream?: boolean;
|
|
194
|
-
/** Override resolved isDraggable (e.g., FreeText disables drag while editing) */
|
|
195
|
-
isDraggable?: (toolDraggable: boolean, context: {
|
|
196
|
-
isEditing: boolean;
|
|
197
|
-
}) => boolean;
|
|
198
|
-
/** Handle double-click on the annotation container */
|
|
199
|
-
onDoubleClick?: (annotationId: string, setEditingId: (id: string) => void) => void;
|
|
200
|
-
/** Override default selection behavior (e.g., Link IRT parent resolution) */
|
|
201
|
-
selectOverride?: (e: AnnotationInteractionEvent, annotation: TrackedAnnotation<T>, helpers: SelectOverrideHelpers) => void;
|
|
202
|
-
/** Return true to hide the selection menu for this annotation */
|
|
203
|
-
hideSelectionMenu?: (annotation: T) => boolean;
|
|
204
|
-
/** When true, the annotation is completely hidden when locked (e.g., form widgets defer to the form-filling layer). */
|
|
205
|
-
hiddenWhenLocked?: boolean;
|
|
206
|
-
/** Optional locked-mode renderer. When the annotation is locked, this replaces `render` inside the container. */
|
|
207
|
-
renderLocked?: (props: AnnotationRendererProps<T>) => JSX.Element;
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* Boxed renderer that encapsulates type safety internally.
|
|
211
|
-
* The generic is erased -- this is what the registry actually stores.
|
|
212
|
-
*/
|
|
213
|
-
export interface BoxedAnnotationRenderer {
|
|
214
|
-
id: string;
|
|
215
|
-
matches: (annotation: PdfAnnotationObject) => boolean;
|
|
216
|
-
render: (props: AnnotationRendererProps) => JSX.Element;
|
|
217
|
-
matchesPreview?: (preview: PreviewState) => boolean;
|
|
218
|
-
renderPreview?: (props: {
|
|
219
|
-
data: unknown;
|
|
220
|
-
bounds: Rect;
|
|
221
|
-
scale: number;
|
|
222
|
-
}) => JSX.Element;
|
|
223
|
-
previewContainerStyle?: (props: {
|
|
224
|
-
data: unknown;
|
|
225
|
-
bounds: Rect;
|
|
226
|
-
scale: number;
|
|
227
|
-
}) => CSSProperties;
|
|
228
|
-
vertexConfig?: VertexConfig<PdfAnnotationObject>;
|
|
229
|
-
zIndex?: number;
|
|
230
|
-
defaultBlendMode?: PdfBlendMode;
|
|
231
|
-
/** Style applied to the annotation container — overrides the default blend-mode style. */
|
|
232
|
-
containerStyle?: (annotation: PdfAnnotationObject) => CSSProperties;
|
|
233
|
-
interactionDefaults?: {
|
|
234
|
-
isDraggable?: boolean;
|
|
235
|
-
isResizable?: boolean;
|
|
236
|
-
isRotatable?: boolean;
|
|
237
|
-
lockAspectRatio?: boolean;
|
|
238
|
-
};
|
|
239
|
-
useAppearanceStream?: boolean;
|
|
240
|
-
isDraggable?: (toolDraggable: boolean, context: {
|
|
241
|
-
isEditing: boolean;
|
|
242
|
-
}) => boolean;
|
|
243
|
-
onDoubleClick?: (annotationId: string, setEditingId: (id: string) => void) => void;
|
|
244
|
-
selectOverride?: (e: AnnotationInteractionEvent, annotation: TrackedAnnotation, helpers: SelectOverrideHelpers) => void;
|
|
245
|
-
hideSelectionMenu?: (annotation: PdfAnnotationObject) => boolean;
|
|
246
|
-
hiddenWhenLocked?: boolean;
|
|
247
|
-
renderLocked?: (props: AnnotationRendererProps) => JSX.Element;
|
|
248
|
-
}
|
|
249
|
-
/**
|
|
250
|
-
* Creates a boxed renderer from a typed entry.
|
|
251
|
-
* Type safety is enforced at definition time, then erased for storage.
|
|
252
|
-
*/
|
|
253
|
-
export declare function createRenderer<T extends PdfAnnotationObject, P = never>(entry: AnnotationRendererEntry<T, P>): BoxedAnnotationRenderer;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './renderer-registry';
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from '../../preact/adapter.ts';
|
|
2
|
-
import { BoxedAnnotationRenderer } from '../components/types';
|
|
3
|
-
type RegisterFn = (entries: BoxedAnnotationRenderer[]) => () => void;
|
|
4
|
-
export declare function AnnotationRendererProvider({ children }: {
|
|
5
|
-
children: ReactNode;
|
|
6
|
-
}): import("preact").JSX.Element;
|
|
7
|
-
/**
|
|
8
|
-
* Hook to register annotation renderers. Handles all registration lifecycle internally.
|
|
9
|
-
* Plugin authors just call this with their renderers array.
|
|
10
|
-
*/
|
|
11
|
-
export declare function useRegisterRenderers(renderers: BoxedAnnotationRenderer[]): void;
|
|
12
|
-
/**
|
|
13
|
-
* Hook to get all registered renderers (for rendering components).
|
|
14
|
-
*/
|
|
15
|
-
export declare function useRegisteredRenderers(): BoxedAnnotationRenderer[];
|
|
16
|
-
/**
|
|
17
|
-
* Low-level hook if someone needs direct access to register function.
|
|
18
|
-
* Most plugins should use useRegisterRenderers instead.
|
|
19
|
-
*/
|
|
20
|
-
export declare function useRendererRegistry(): RegisterFn | null;
|
|
21
|
-
export {};
|