@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,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cloudy border path generator for PDF annotations.
|
|
3
|
-
*
|
|
4
|
-
* Framework-agnostic utility that generates SVG path `d` strings for cloudy
|
|
5
|
-
* (scalloped) borders on Rectangle, Ellipse, and Polygon shapes.
|
|
6
|
-
*
|
|
7
|
-
* Derived from Apache PDFBox's CloudyBorder.java:
|
|
8
|
-
* https://github.com/apache/pdfbox/blob/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/interactive/annotation/handlers/CloudyBorder.java
|
|
9
|
-
*
|
|
10
|
-
* Original code licensed under the Apache License, Version 2.0:
|
|
11
|
-
* https://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Substantially modified: ported from Java to TypeScript, adapted for SVG
|
|
14
|
-
* path output, and reworked curl distribution and merging logic.
|
|
15
|
-
*
|
|
16
|
-
* Copyright (c) 2026 CloudPDF / EmbedPDF
|
|
17
|
-
*
|
|
18
|
-
* @module
|
|
19
|
-
*/
|
|
20
|
-
interface BBox {
|
|
21
|
-
minX: number;
|
|
22
|
-
minY: number;
|
|
23
|
-
maxX: number;
|
|
24
|
-
maxY: number;
|
|
25
|
-
}
|
|
26
|
-
/** Rect differences (inset from annotation Rect to drawn shape). */
|
|
27
|
-
export interface RectDifferences {
|
|
28
|
-
left: number;
|
|
29
|
-
top: number;
|
|
30
|
-
right: number;
|
|
31
|
-
bottom: number;
|
|
32
|
-
}
|
|
33
|
-
export interface CloudyPathResult {
|
|
34
|
-
/** SVG path `d` attribute string */
|
|
35
|
-
path: string;
|
|
36
|
-
/** Bounding box of the generated cloudy border (in annotation-local coords) */
|
|
37
|
-
bbox: BBox;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Returns the per-side outward extent of a cloudy border (how far the
|
|
41
|
-
* scallop peaks + stroke extend beyond the inner shape boundary).
|
|
42
|
-
*
|
|
43
|
-
* Use this to compute `rectangleDifferences` for Square/Circle or the
|
|
44
|
-
* padding for Polygon Rect computation.
|
|
45
|
-
*/
|
|
46
|
-
export declare function getCloudyBorderExtent(intensity: number, lineWidth: number, isEllipse: boolean): number;
|
|
47
|
-
/**
|
|
48
|
-
* Generates a cloudy border SVG path for a rectangle (Square annotation).
|
|
49
|
-
*
|
|
50
|
-
* @param rect - The annotation rect `{ x, y, width, height }` (top-left origin)
|
|
51
|
-
* @param rd - Rectangle differences (inset), or undefined
|
|
52
|
-
* @param intensity - Cloudy border intensity (typically 1 or 2)
|
|
53
|
-
* @param lineWidth - Stroke width of the annotation border
|
|
54
|
-
*/
|
|
55
|
-
export declare function generateCloudyRectanglePath(rect: {
|
|
56
|
-
x: number;
|
|
57
|
-
y: number;
|
|
58
|
-
width: number;
|
|
59
|
-
height: number;
|
|
60
|
-
}, rd: RectDifferences | undefined, intensity: number, lineWidth: number): CloudyPathResult;
|
|
61
|
-
/**
|
|
62
|
-
* Generates a cloudy border SVG path for an ellipse (Circle annotation).
|
|
63
|
-
*
|
|
64
|
-
* @param rect - The annotation rect `{ x, y, width, height }` (top-left origin)
|
|
65
|
-
* @param rd - Rectangle differences (inset), or undefined
|
|
66
|
-
* @param intensity - Cloudy border intensity (typically 1 or 2)
|
|
67
|
-
* @param lineWidth - Stroke width of the annotation border
|
|
68
|
-
*/
|
|
69
|
-
export declare function generateCloudyEllipsePath(rect: {
|
|
70
|
-
x: number;
|
|
71
|
-
y: number;
|
|
72
|
-
width: number;
|
|
73
|
-
height: number;
|
|
74
|
-
}, rd: RectDifferences | undefined, intensity: number, lineWidth: number): CloudyPathResult;
|
|
75
|
-
/**
|
|
76
|
-
* Generates a cloudy border SVG path for a polygon.
|
|
77
|
-
*
|
|
78
|
-
* @param vertices - The polygon vertices in annotation-local coordinates
|
|
79
|
-
* @param rectOrigin - The annotation rect origin `{ x, y }` for coordinate translation
|
|
80
|
-
* @param intensity - Cloudy border intensity (typically 1 or 2)
|
|
81
|
-
* @param lineWidth - Stroke width of the annotation border
|
|
82
|
-
*/
|
|
83
|
-
export declare function generateCloudyPolygonPath(vertices: ReadonlyArray<{
|
|
84
|
-
x: number;
|
|
85
|
-
y: number;
|
|
86
|
-
}>, rectOrigin: {
|
|
87
|
-
x: number;
|
|
88
|
-
y: number;
|
|
89
|
-
}, intensity: number, lineWidth: number): CloudyPathResult;
|
|
90
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Rect } from '@embedpdf/models';
|
|
2
|
-
/**
|
|
3
|
-
* Re-export rotation geometry utilities from @embedpdf/models.
|
|
4
|
-
*
|
|
5
|
-
* These functions used to live here but have been promoted to the shared models
|
|
6
|
-
* package so that both @embedpdf/utils (DragResizeController) and
|
|
7
|
-
* @embedpdf/plugin-annotation (patches) can import from the same source.
|
|
8
|
-
*
|
|
9
|
-
* Existing imports from this module continue to work unchanged.
|
|
10
|
-
*/
|
|
11
|
-
export { rotatePointAround as rotatePointAroundCenter, rotateVertices, getRectCenter, calculateRotatedRectAABBAroundPoint, calculateRotatedRectAABB, inferRotationCenterFromRects, } from '@embedpdf/models';
|
|
12
|
-
/**
|
|
13
|
-
* Convert an AABB-space rect to unrotated space.
|
|
14
|
-
*
|
|
15
|
-
* During group resize the pipeline works in AABB space (axis-aligned bounding
|
|
16
|
-
* box), but `baseResizeScaling` expects the incoming rect in unrotated space.
|
|
17
|
-
*
|
|
18
|
-
* The AABB of a rect rotated by θ around its center is:
|
|
19
|
-
* AABB_w = w·|cosθ| + h·|sinθ|
|
|
20
|
-
* AABB_h = w·|sinθ| + h·|cosθ|
|
|
21
|
-
*
|
|
22
|
-
* This function inverts that system to recover (w, h) from the new AABB size.
|
|
23
|
-
* Near 45° the system is degenerate (the AABB is always square), so we fall
|
|
24
|
-
* back to uniform scaling based on the area ratio.
|
|
25
|
-
*
|
|
26
|
-
* @param newAABBRect - the proportionally scaled AABB rect from the group resize
|
|
27
|
-
* @param originalAABBRect - the original AABB rect captured at resize start
|
|
28
|
-
* @param originalUnrotatedRect - the original unrotated rect captured at resize start
|
|
29
|
-
* @param rotationDegrees - the annotation's rotation in degrees
|
|
30
|
-
* @returns the equivalent rect in unrotated space
|
|
31
|
-
*/
|
|
32
|
-
export declare function convertAABBRectToUnrotatedSpace(newAABBRect: Rect, originalAABBRect: Rect, originalUnrotatedRect: Rect, rotationDegrees: number): Rect;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { PdfAnnotationObject } from '@embedpdf/models';
|
|
2
|
-
import { AnnotationTool } from '../tools/types';
|
|
3
|
-
interface ClickDetectorOptions<T extends PdfAnnotationObject> {
|
|
4
|
-
threshold?: number;
|
|
5
|
-
getTool: () => AnnotationTool<T> | undefined;
|
|
6
|
-
onClickDetected: (pos: {
|
|
7
|
-
x: number;
|
|
8
|
-
y: number;
|
|
9
|
-
}, tool: AnnotationTool<T>) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare function useClickDetector<T extends PdfAnnotationObject>({ threshold, getTool, onClickDetected, }: ClickDetectorOptions<T>): {
|
|
12
|
-
onStart: (pos: {
|
|
13
|
-
x: number;
|
|
14
|
-
y: number;
|
|
15
|
-
}) => void;
|
|
16
|
-
onMove: (pos: {
|
|
17
|
-
x: number;
|
|
18
|
-
y: number;
|
|
19
|
-
}) => void;
|
|
20
|
-
onEnd: (pos: {
|
|
21
|
-
x: number;
|
|
22
|
-
y: number;
|
|
23
|
-
}) => void;
|
|
24
|
-
hasMoved: () => boolean;
|
|
25
|
-
reset: () => void;
|
|
26
|
-
};
|
|
27
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export * from './ink.handler';
|
|
2
|
-
export * from './text.handler';
|
|
3
|
-
export * from './free-text.handler';
|
|
4
|
-
export * from './callout-free-text.handler';
|
|
5
|
-
export * from './line.handler';
|
|
6
|
-
export * from './polyline.handler';
|
|
7
|
-
export * from './polygon.handler';
|
|
8
|
-
export * from './square.handler';
|
|
9
|
-
export * from './stamp.handler';
|
|
10
|
-
export * from './circle.handler';
|
|
11
|
-
export * from './link.handler';
|
|
12
|
-
export * from './text-markup.handler';
|
|
13
|
-
export * from './insert-text.handler';
|
|
14
|
-
export * from './replace-text.handler';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { PdfCaretAnnoObject } from '@embedpdf/models';
|
|
2
|
-
import { SelectionHandlerFactory } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Selection handler for the "Insert Text" tool.
|
|
5
|
-
* Creates a single Caret annotation at the end of the text selection
|
|
6
|
-
* with intent "Insert".
|
|
7
|
-
*/
|
|
8
|
-
export declare const insertTextSelectionHandler: SelectionHandlerFactory<PdfCaretAnnoObject>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { PdfStrikeOutAnnoObject } from '@embedpdf/models';
|
|
2
|
-
import { SelectionHandlerFactory } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Selection handler for the "Replace Text" tool.
|
|
5
|
-
* Creates a Caret annotation (group leader, intent "Replace") at the end
|
|
6
|
-
* of the selection, plus a StrikeOut annotation (intent "StrikeOutTextEdit")
|
|
7
|
-
* over the full selection, linked to the Caret via IRT/RT=Group.
|
|
8
|
-
*/
|
|
9
|
-
export declare const replaceTextSelectionHandler: SelectionHandlerFactory<PdfStrikeOutAnnoObject>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Rect } from '@embedpdf/models';
|
|
2
|
-
/**
|
|
3
|
-
* Compute a caret annotation rect at the end of a text selection.
|
|
4
|
-
* The caret is half the line height, bottom-aligned with the line,
|
|
5
|
-
* and horizontally centered on the line's end edge.
|
|
6
|
-
*/
|
|
7
|
-
export declare function computeCaretRect(lastSegRect: Rect): Rect;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SelectionHandlerFactory } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* Default selection handler for text-markup tools (highlight, underline,
|
|
4
|
-
* strikeout, squiggly). Used as a fallback when no tool-specific
|
|
5
|
-
* SelectionHandlerFactory is registered.
|
|
6
|
-
*/
|
|
7
|
-
export declare const textMarkupSelectionHandler: SelectionHandlerFactory;
|
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { PointerEventHandlersWithLifecycle } from '@embedpdf/plugin-interaction-manager';
|
|
2
|
-
import { PdfAnnotationObject, PdfAnnotationSubtype, Rect, Rotation, Size, AnnotationCreateContext, PdfAnnotationBorderStyle, Position, LineEndings, PdfInkListObject, PdfStandardFont, PdfTextAlignment, PdfVerticalAlignment, PdfBlendMode, PdfAnnotationLineEnding } from '@embedpdf/models';
|
|
3
|
-
import { FormattedSelection } from '@embedpdf/plugin-selection';
|
|
4
|
-
import { AnnotationTool } from '../tools/types';
|
|
5
|
-
export interface CirclePreviewData {
|
|
6
|
-
rect: Rect;
|
|
7
|
-
color: string;
|
|
8
|
-
opacity: number;
|
|
9
|
-
strokeWidth: number;
|
|
10
|
-
strokeColor: string;
|
|
11
|
-
strokeStyle: PdfAnnotationBorderStyle;
|
|
12
|
-
strokeDashArray: number[];
|
|
13
|
-
}
|
|
14
|
-
export interface SquarePreviewData extends CirclePreviewData {
|
|
15
|
-
}
|
|
16
|
-
export interface PolygonPreviewData {
|
|
17
|
-
rect: Rect;
|
|
18
|
-
vertices: Position[];
|
|
19
|
-
currentVertex: Position;
|
|
20
|
-
color?: string;
|
|
21
|
-
opacity?: number;
|
|
22
|
-
strokeWidth: number;
|
|
23
|
-
strokeColor?: string;
|
|
24
|
-
strokeStyle?: PdfAnnotationBorderStyle;
|
|
25
|
-
strokeDashArray?: number[];
|
|
26
|
-
}
|
|
27
|
-
export interface PolylinePreviewData {
|
|
28
|
-
rect: Rect;
|
|
29
|
-
vertices: Position[];
|
|
30
|
-
currentVertex: Position;
|
|
31
|
-
color: string;
|
|
32
|
-
strokeColor: string;
|
|
33
|
-
opacity: number;
|
|
34
|
-
strokeWidth: number;
|
|
35
|
-
lineEndings?: LineEndings;
|
|
36
|
-
}
|
|
37
|
-
export interface LinePreviewData {
|
|
38
|
-
rect: Rect;
|
|
39
|
-
linePoints: {
|
|
40
|
-
start: Position;
|
|
41
|
-
end: Position;
|
|
42
|
-
};
|
|
43
|
-
strokeWidth: number;
|
|
44
|
-
color: string;
|
|
45
|
-
strokeColor: string;
|
|
46
|
-
opacity: number;
|
|
47
|
-
lineEndings?: LineEndings;
|
|
48
|
-
strokeStyle: PdfAnnotationBorderStyle;
|
|
49
|
-
strokeDashArray: number[];
|
|
50
|
-
}
|
|
51
|
-
export interface InkPreviewData {
|
|
52
|
-
rect: Rect;
|
|
53
|
-
inkList: PdfInkListObject[];
|
|
54
|
-
strokeWidth: number;
|
|
55
|
-
strokeColor: string;
|
|
56
|
-
opacity: number;
|
|
57
|
-
blendMode?: PdfBlendMode;
|
|
58
|
-
}
|
|
59
|
-
export interface FreeTextPreviewData {
|
|
60
|
-
rect: Rect;
|
|
61
|
-
fontColor?: string;
|
|
62
|
-
opacity?: number;
|
|
63
|
-
fontSize?: number;
|
|
64
|
-
fontFamily?: PdfStandardFont;
|
|
65
|
-
backgroundColor?: string;
|
|
66
|
-
textAlign?: PdfTextAlignment;
|
|
67
|
-
verticalAlign?: PdfVerticalAlignment;
|
|
68
|
-
contents?: string;
|
|
69
|
-
calloutLine?: Position[];
|
|
70
|
-
textBox?: Rect;
|
|
71
|
-
strokeColor?: string;
|
|
72
|
-
strokeWidth?: number;
|
|
73
|
-
lineEnding?: PdfAnnotationLineEnding;
|
|
74
|
-
color?: string;
|
|
75
|
-
}
|
|
76
|
-
export interface LinkPreviewData {
|
|
77
|
-
rect: Rect;
|
|
78
|
-
strokeColor: string;
|
|
79
|
-
strokeWidth: number;
|
|
80
|
-
strokeStyle: PdfAnnotationBorderStyle;
|
|
81
|
-
strokeDashArray: number[];
|
|
82
|
-
}
|
|
83
|
-
export interface StampPreviewData {
|
|
84
|
-
rect: Rect;
|
|
85
|
-
ghostUrl: string;
|
|
86
|
-
pageRotation: Rotation;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Map types to their preview data
|
|
90
|
-
*/
|
|
91
|
-
export interface PreviewDataMap {
|
|
92
|
-
[PdfAnnotationSubtype.CIRCLE]: CirclePreviewData;
|
|
93
|
-
[PdfAnnotationSubtype.SQUARE]: SquarePreviewData;
|
|
94
|
-
[PdfAnnotationSubtype.POLYGON]: PolygonPreviewData;
|
|
95
|
-
[PdfAnnotationSubtype.POLYLINE]: PolylinePreviewData;
|
|
96
|
-
[PdfAnnotationSubtype.LINE]: LinePreviewData;
|
|
97
|
-
[PdfAnnotationSubtype.INK]: InkPreviewData;
|
|
98
|
-
[PdfAnnotationSubtype.FREETEXT]: FreeTextPreviewData;
|
|
99
|
-
[PdfAnnotationSubtype.LINK]: LinkPreviewData;
|
|
100
|
-
[PdfAnnotationSubtype.STAMP]: StampPreviewData;
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Typed preview state - constrain T to keys that exist in PreviewDataMap
|
|
104
|
-
*/
|
|
105
|
-
export type TypedPreviewState<T extends keyof PreviewDataMap> = {
|
|
106
|
-
type: T;
|
|
107
|
-
bounds: Rect;
|
|
108
|
-
data: PreviewDataMap[T];
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* Union of all preview states
|
|
112
|
-
*/
|
|
113
|
-
export type AnyPreviewState = {
|
|
114
|
-
[K in keyof PreviewDataMap]: TypedPreviewState<K>;
|
|
115
|
-
}[keyof PreviewDataMap];
|
|
116
|
-
/**
|
|
117
|
-
* Generic version for handlers - use conditional type for safety
|
|
118
|
-
*/
|
|
119
|
-
export interface PreviewState<T extends PdfAnnotationSubtype = PdfAnnotationSubtype> {
|
|
120
|
-
type: T;
|
|
121
|
-
bounds: Rect;
|
|
122
|
-
data: T extends keyof PreviewDataMap ? PreviewDataMap[T] : any;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Defines the DOM-based services that the UI layer must provide to the handlers.
|
|
126
|
-
* This is the bridge that keeps the core logic framework-agnostic.
|
|
127
|
-
*/
|
|
128
|
-
export interface HandlerServices {
|
|
129
|
-
requestFile(options: {
|
|
130
|
-
accept: string;
|
|
131
|
-
onFile: (file: File) => void;
|
|
132
|
-
}): void;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Extensible map from tool ID to per-activation context data.
|
|
136
|
-
* Plugins extend this via declaration merging to provide typed context
|
|
137
|
-
* for their custom tools (e.g. stamp appearance data, ghost image URL).
|
|
138
|
-
*/
|
|
139
|
-
export interface ToolContextMap {
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Resolves the tool context type for a given tool ID.
|
|
143
|
-
* Returns the mapped type if known, otherwise a generic record.
|
|
144
|
-
*/
|
|
145
|
-
export type ResolvedToolContext<TId extends string> = TId extends keyof ToolContextMap ? ToolContextMap[TId] : Record<string, unknown>;
|
|
146
|
-
/**
|
|
147
|
-
* The context object passed to a handler factory when creating a handler.
|
|
148
|
-
* It contains all the necessary information and callbacks.
|
|
149
|
-
*/
|
|
150
|
-
export interface HandlerFactory<A extends PdfAnnotationObject, TId extends string = string> {
|
|
151
|
-
annotationType: PdfAnnotationSubtype;
|
|
152
|
-
create(context: HandlerContext<A, TId>): PointerEventHandlersWithLifecycle;
|
|
153
|
-
}
|
|
154
|
-
export interface HandlerContext<A extends PdfAnnotationObject, TId extends string = string> {
|
|
155
|
-
getTool: () => AnnotationTool<A> | undefined;
|
|
156
|
-
getToolContext: () => ResolvedToolContext<TId> | undefined;
|
|
157
|
-
pageIndex: number;
|
|
158
|
-
pageSize: Size;
|
|
159
|
-
/** Effective page rotation (page intrinsic + document rotation), as a quarter-turn value (0-3). */
|
|
160
|
-
pageRotation: Rotation;
|
|
161
|
-
scale: number;
|
|
162
|
-
services: HandlerServices;
|
|
163
|
-
onPreview: (state: PreviewState<A['type']> | null) => void;
|
|
164
|
-
onCommit: (annotation: A, context?: AnnotationCreateContext<A>) => void;
|
|
165
|
-
}
|
|
166
|
-
export interface SelectionHandlerContext<A extends PdfAnnotationObject = PdfAnnotationObject> {
|
|
167
|
-
toolId: string;
|
|
168
|
-
documentId: string;
|
|
169
|
-
getTool: () => AnnotationTool<A> | null;
|
|
170
|
-
createAnnotation: (pageIndex: number, annotation: PdfAnnotationObject) => void;
|
|
171
|
-
selectAnnotation: (pageIndex: number, id: string) => void;
|
|
172
|
-
}
|
|
173
|
-
export interface SelectionHandlerFactory<A extends PdfAnnotationObject = PdfAnnotationObject> {
|
|
174
|
-
toolId: string;
|
|
175
|
-
handle(context: SelectionHandlerContext<A>, selections: FormattedSelection[], getText: () => Promise<string | undefined>): void;
|
|
176
|
-
}
|
package/dist/lib/helpers.d.ts
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { PdfAnnotationSubtype, PdfAnnotationObject, PdfAnnotationOf, Rect } from '@embedpdf/models';
|
|
2
|
-
import { LockMode, TrackedAnnotation } from './types';
|
|
3
|
-
import { AnnotationTool } from './tools/types';
|
|
4
|
-
/**
|
|
5
|
-
* Check if two rectangles intersect
|
|
6
|
-
*/
|
|
7
|
-
export declare function rectsIntersect(a: Rect, b: Rect): boolean;
|
|
8
|
-
export type AnnoOf<S extends PdfAnnotationSubtype> = PdfAnnotationOf<S>;
|
|
9
|
-
export type TextMarkupSubtype = PdfAnnotationSubtype.HIGHLIGHT | PdfAnnotationSubtype.UNDERLINE | PdfAnnotationSubtype.STRIKEOUT | PdfAnnotationSubtype.SQUIGGLY;
|
|
10
|
-
export type SidebarSubtype = TextMarkupSubtype | PdfAnnotationSubtype.TEXT | PdfAnnotationSubtype.INK | PdfAnnotationSubtype.SQUARE | PdfAnnotationSubtype.CIRCLE | PdfAnnotationSubtype.POLYGON | PdfAnnotationSubtype.LINE | PdfAnnotationSubtype.POLYLINE | PdfAnnotationSubtype.FREETEXT | PdfAnnotationSubtype.STAMP | PdfAnnotationSubtype.REDACT | PdfAnnotationSubtype.CARET;
|
|
11
|
-
/** True when `a.object.type === INK` – and narrows the generic. */
|
|
12
|
-
export declare function isInk(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.INK>>;
|
|
13
|
-
/** Example for Circle – create similar ones for Square, Line, etc. */
|
|
14
|
-
export declare function isCircle(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.CIRCLE>>;
|
|
15
|
-
export declare function isPolygon(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.POLYGON>>;
|
|
16
|
-
export declare function isSquare(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.SQUARE>>;
|
|
17
|
-
export declare function isLine(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.LINE>>;
|
|
18
|
-
export declare function isPolyline(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.POLYLINE>>;
|
|
19
|
-
export declare function isHighlight(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.HIGHLIGHT>>;
|
|
20
|
-
export declare function isUnderline(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.UNDERLINE>>;
|
|
21
|
-
export declare function isStrikeout(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.STRIKEOUT>>;
|
|
22
|
-
export declare function isSquiggly(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.SQUIGGLY>>;
|
|
23
|
-
export declare function isTextMarkup(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<TextMarkupSubtype>>;
|
|
24
|
-
export declare function isFreeText(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.FREETEXT>>;
|
|
25
|
-
export declare function isStamp(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.STAMP>>;
|
|
26
|
-
export declare function isText(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.TEXT>>;
|
|
27
|
-
export declare function isLink(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.LINK>>;
|
|
28
|
-
export declare function isRedact(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.REDACT>>;
|
|
29
|
-
export declare function isCaret(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.CARET>>;
|
|
30
|
-
export declare function isWidget(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<PdfAnnotationSubtype.WIDGET>>;
|
|
31
|
-
export declare function isSidebarAnnotation(a: TrackedAnnotation): a is TrackedAnnotation<AnnoOf<SidebarSubtype>>;
|
|
32
|
-
export declare function isSelectableAnnotation(a: TrackedAnnotation): boolean;
|
|
33
|
-
/** Extract the category tags from a tool (returns `[]` for uncategorized). */
|
|
34
|
-
export declare function getAnnotationCategories(tool: AnnotationTool | null): string[];
|
|
35
|
-
/** Check if the category-based LockMode locks annotations with these categories. */
|
|
36
|
-
export declare function isCategoryLocked(categories: string[], mode: LockMode): boolean;
|
|
37
|
-
/** Check if the annotation itself has the PDF 'locked' flag (bit 7). */
|
|
38
|
-
export declare function hasLockedFlag(annotation: PdfAnnotationObject): boolean;
|
|
39
|
-
/** Check if the annotation has the PDF 'noView' flag (bit 6). */
|
|
40
|
-
export declare function hasNoViewFlag(annotation: PdfAnnotationObject): boolean;
|
|
41
|
-
/** Check if the annotation has the PDF 'hidden' flag (bit 2): do not render, do not interact, do not print. */
|
|
42
|
-
export declare function hasHiddenFlag(annotation: PdfAnnotationObject): boolean;
|
|
43
|
-
/** Check if the annotation has the PDF 'readOnly' flag (bit 7): do not allow user interaction. Ignored for widgets per spec. */
|
|
44
|
-
export declare function hasReadOnlyFlag(annotation: PdfAnnotationObject): boolean;
|
|
45
|
-
/** Check if the annotation has the PDF 'lockedContents' flag (bit 10): content cannot be modified by the user. */
|
|
46
|
-
export declare function hasLockedContentsFlag(annotation: PdfAnnotationObject): boolean;
|
package/dist/lib/index.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { PluginPackage } from '@embedpdf/core';
|
|
2
|
-
import { AnnotationPluginConfig, AnnotationState } from './types';
|
|
3
|
-
import { AnnotationPlugin } from './annotation-plugin';
|
|
4
|
-
import { AnnotationAction } from './actions';
|
|
5
|
-
export declare const AnnotationPluginPackage: PluginPackage<AnnotationPlugin, AnnotationPluginConfig, AnnotationState, AnnotationAction>;
|
|
6
|
-
export * from './annotation-plugin';
|
|
7
|
-
export * from './types';
|
|
8
|
-
export * from './manifest';
|
|
9
|
-
export * from './selectors';
|
|
10
|
-
export * from './helpers';
|
|
11
|
-
export * from './handlers/types';
|
|
12
|
-
export * from './tools/types';
|
|
13
|
-
export type { DefaultAnnotationTool, DefaultAnnotationToolMap } from './tools/default-tools';
|
|
14
|
-
export * from './tools/tools-utils';
|
|
15
|
-
export * from './geometry';
|
|
16
|
-
export * as patching from './patching';
|
|
17
|
-
export type { PatchFunction, TransformContext } from './patching/patch-registry';
|
|
18
|
-
export * from './patching/insert-upright';
|
|
19
|
-
export { initialState, initialDocumentState } from './reducer';
|
|
20
|
-
export { useState } from './utils/use-state';
|
|
21
|
-
export { useClickDetector } from './handlers/click-detector';
|
package/dist/lib/manifest.d.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { Rect } from '@embedpdf/models';
|
|
2
|
-
import { TransformContext } from './patch-registry';
|
|
3
|
-
/**
|
|
4
|
-
* Minimal shape required by the shared patch helpers.
|
|
5
|
-
* All annotation objects satisfy this through PdfAnnotationObject.
|
|
6
|
-
*/
|
|
7
|
-
export interface RotatableAnnotation {
|
|
8
|
-
rect: Rect;
|
|
9
|
-
unrotatedRect?: Rect;
|
|
10
|
-
rotation?: number;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Shared rotate logic.
|
|
14
|
-
* Returns the full patch (rect, unrotatedRect, rotation) or `null` when the
|
|
15
|
-
* context doesn't carry a rotationAngle (in which case the caller should
|
|
16
|
-
* fall through to `ctx.changes`).
|
|
17
|
-
*/
|
|
18
|
-
export declare function baseRotateChanges(orig: RotatableAnnotation, ctx: TransformContext<any>): Partial<{
|
|
19
|
-
rect: Rect;
|
|
20
|
-
unrotatedRect: Rect;
|
|
21
|
-
rotation: number;
|
|
22
|
-
}> | null;
|
|
23
|
-
/**
|
|
24
|
-
* Shared property-update rotation logic.
|
|
25
|
-
* Recomputes rect and unrotatedRect for a new rotation angle, preserving
|
|
26
|
-
* the annotation's rotation center. Works for all annotation types since
|
|
27
|
-
* it only touches rect/unrotatedRect/rotation.
|
|
28
|
-
*/
|
|
29
|
-
export declare function basePropertyRotationChanges(orig: RotatableAnnotation, newRotation: number): {
|
|
30
|
-
rotation: number;
|
|
31
|
-
rect: Rect;
|
|
32
|
-
unrotatedRect: Rect;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* Shared move logic: computes dx/dy and translates rect + unrotatedRect.
|
|
36
|
-
* Callers use the returned `dx`/`dy` to translate their own type-specific
|
|
37
|
-
* data (vertices, linePoints, inkList, etc.).
|
|
38
|
-
*/
|
|
39
|
-
export declare function baseMoveChanges(orig: RotatableAnnotation, newRect: Rect): {
|
|
40
|
-
dx: number;
|
|
41
|
-
dy: number;
|
|
42
|
-
rects: {
|
|
43
|
-
rect: Rect;
|
|
44
|
-
unrotatedRect?: Rect;
|
|
45
|
-
};
|
|
46
|
-
};
|
|
47
|
-
export interface ResizeScalingResult {
|
|
48
|
-
/** Horizontal scale factor */
|
|
49
|
-
scaleX: number;
|
|
50
|
-
/** Vertical scale factor */
|
|
51
|
-
scaleY: number;
|
|
52
|
-
/** The old rect used as the scaling reference (unrotatedRect ?? rect) */
|
|
53
|
-
oldRect: Rect;
|
|
54
|
-
/** The adjusted new rect after min-size and aspect-ratio enforcement */
|
|
55
|
-
resolvedRect: Rect;
|
|
56
|
-
/** The final rect + unrotatedRect patches to spread into the result */
|
|
57
|
-
rects: {
|
|
58
|
-
rect: Rect;
|
|
59
|
-
unrotatedRect?: Rect;
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Shared resize scaling logic:
|
|
64
|
-
* 1. Determines scale factors from oldRect → newRect
|
|
65
|
-
* 2. Enforces a minimum size of 10
|
|
66
|
-
* 3. Optionally maintains aspect ratio
|
|
67
|
-
* 4. Resolves rect vs unrotatedRect for rotated annotations
|
|
68
|
-
*
|
|
69
|
-
* Callers use `scaleX`, `scaleY`, `oldRect`, and `resolvedRect` to scale
|
|
70
|
-
* their own type-specific data (vertices, linePoints, etc.), then spread
|
|
71
|
-
* `rects` into their result.
|
|
72
|
-
*/
|
|
73
|
-
export declare function baseResizeScaling(orig: RotatableAnnotation, newRect: Rect, metadata?: {
|
|
74
|
-
maintainAspectRatio?: boolean;
|
|
75
|
-
}): ResizeScalingResult;
|
|
76
|
-
/**
|
|
77
|
-
* Compute the orbit translation (dx/dy) from a rotation result.
|
|
78
|
-
* Point-based annotations (line, polyline, polygon, ink) use this to
|
|
79
|
-
* translate their vertices/points alongside the rect orbit during
|
|
80
|
-
* group rotation. For single-annotation rotation the delta is zero.
|
|
81
|
-
*/
|
|
82
|
-
export declare function rotateOrbitDelta(orig: RotatableAnnotation, rotateResult: {
|
|
83
|
-
unrotatedRect?: Rect;
|
|
84
|
-
}): {
|
|
85
|
-
dx: number;
|
|
86
|
-
dy: number;
|
|
87
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { PdfAnnotationObject, Rotation, Size } from '@embedpdf/models';
|
|
2
|
-
/**
|
|
3
|
-
* Applies a counter-rotation to make an annotation appear visually upright
|
|
4
|
-
* on a rotated page. Uses `basePropertyRotationChanges` to correctly compute
|
|
5
|
-
* rect, unrotatedRect, and rotation for the annotation.
|
|
6
|
-
*
|
|
7
|
-
* @param annotation - The annotation to transform
|
|
8
|
-
* @param pageRotation - Effective page rotation as quarter-turn value (0-3)
|
|
9
|
-
* @param rectWasDrawn - `true` if the rect was produced by a marquee drag
|
|
10
|
-
* (PagePointerProvider transposes dimensions on 90/270 pages),
|
|
11
|
-
* `false` if the rect was placed from config/content (click-to-place, stamp)
|
|
12
|
-
* @returns The annotation with rotation, unrotatedRect, and rect set
|
|
13
|
-
*/
|
|
14
|
-
export declare function applyInsertUpright<T extends PdfAnnotationObject>(annotation: T, pageRotation: Rotation, rectWasDrawn: boolean): T;
|
|
15
|
-
/**
|
|
16
|
-
* Clamps an annotation's rect to stay within page bounds.
|
|
17
|
-
* If the annotation has an unrotatedRect, it is shifted by the same delta
|
|
18
|
-
* to keep the geometry consistent.
|
|
19
|
-
*/
|
|
20
|
-
export declare function clampAnnotationToPage<T extends PdfAnnotationObject>(annotation: T, pageSize: Size): T;
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { PdfAnnotationLineEnding, Position } from '@embedpdf/models';
|
|
2
|
-
/**
|
|
3
|
-
* A handler that encapsulates all logic for a specific line ending type,
|
|
4
|
-
* including SVG path generation, geometric vertex calculation, and rotation logic.
|
|
5
|
-
* This is the single source of truth for each ending.
|
|
6
|
-
*/
|
|
7
|
-
export interface LineEndingHandler {
|
|
8
|
-
/** Returns the SVG `d` attribute string for rendering. */
|
|
9
|
-
getSvgPath: (strokeWidth: number) => string;
|
|
10
|
-
/** Returns the vertices used for calculating the geometric bounding box. */
|
|
11
|
-
getLocalPoints: (strokeWidth: number) => Position[];
|
|
12
|
-
/** Returns the final rotation angle in radians based on the line segment's angle. */
|
|
13
|
-
getRotation: (segmentAngle: number) => number;
|
|
14
|
-
/** True if the shape should be filled, false if only stroked. */
|
|
15
|
-
filled: boolean;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* A map containing the authoritative handler for each line ending type.
|
|
19
|
-
*/
|
|
20
|
-
export declare const LINE_ENDING_HANDLERS: Partial<Record<PdfAnnotationLineEnding, LineEndingHandler>>;
|