@embedpdf/plugin-annotation 2.6.2 → 2.7.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/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +203 -8
- package/dist/index.js.map +1 -1
- package/dist/lib/actions.d.ts +12 -1
- package/dist/lib/annotation-plugin.d.ts +17 -0
- package/dist/lib/tools/default-tools.d.ts +2 -0
- package/dist/lib/tools/types.d.ts +2 -0
- package/dist/lib/types.d.ts +18 -2
- package/dist/preact/index.cjs +1 -1
- package/dist/preact/index.cjs.map +1 -1
- package/dist/preact/index.js +1008 -1058
- package/dist/preact/index.js.map +1 -1
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +1008 -1058
- package/dist/react/index.js.map +1 -1
- package/dist/shared/components/annotation-container.d.ts +11 -5
- package/dist/shared/components/annotations/circle.d.ts +4 -2
- package/dist/shared/components/annotations/free-text.d.ts +4 -1
- package/dist/shared/components/annotations/ink.d.ts +3 -1
- package/dist/shared/components/annotations/line.d.ts +3 -1
- package/dist/shared/components/annotations/polygon.d.ts +3 -2
- package/dist/shared/components/annotations/polyline.d.ts +3 -1
- package/dist/shared/components/annotations/square.d.ts +4 -2
- package/dist/shared/components/annotations.d.ts +0 -1
- package/dist/shared/components/appearance-image.d.ts +12 -0
- package/dist/shared/components/built-in-renderers.d.ts +2 -0
- package/dist/shared/components/text-markup/highlight.d.ts +3 -1
- package/dist/shared/components/text-markup/squiggly.d.ts +3 -1
- package/dist/shared/components/text-markup/strikeout.d.ts +3 -1
- package/dist/shared/components/text-markup/underline.d.ts +3 -1
- package/dist/shared/components/types.d.ts +66 -10
- package/dist/shared-preact/components/annotation-container.d.ts +11 -5
- package/dist/shared-preact/components/annotations/circle.d.ts +4 -2
- package/dist/shared-preact/components/annotations/free-text.d.ts +4 -1
- package/dist/shared-preact/components/annotations/ink.d.ts +3 -1
- package/dist/shared-preact/components/annotations/line.d.ts +3 -1
- package/dist/shared-preact/components/annotations/polygon.d.ts +3 -2
- package/dist/shared-preact/components/annotations/polyline.d.ts +3 -1
- package/dist/shared-preact/components/annotations/square.d.ts +4 -2
- package/dist/shared-preact/components/annotations.d.ts +0 -1
- package/dist/shared-preact/components/appearance-image.d.ts +12 -0
- package/dist/shared-preact/components/built-in-renderers.d.ts +2 -0
- package/dist/shared-preact/components/text-markup/highlight.d.ts +3 -1
- package/dist/shared-preact/components/text-markup/squiggly.d.ts +3 -1
- package/dist/shared-preact/components/text-markup/strikeout.d.ts +3 -1
- package/dist/shared-preact/components/text-markup/underline.d.ts +3 -1
- package/dist/shared-preact/components/types.d.ts +66 -10
- package/dist/shared-react/components/annotation-container.d.ts +11 -5
- package/dist/shared-react/components/annotations/circle.d.ts +4 -2
- package/dist/shared-react/components/annotations/free-text.d.ts +4 -1
- package/dist/shared-react/components/annotations/ink.d.ts +3 -1
- package/dist/shared-react/components/annotations/line.d.ts +3 -1
- package/dist/shared-react/components/annotations/polygon.d.ts +3 -2
- package/dist/shared-react/components/annotations/polyline.d.ts +3 -1
- package/dist/shared-react/components/annotations/square.d.ts +4 -2
- package/dist/shared-react/components/annotations.d.ts +0 -1
- package/dist/shared-react/components/appearance-image.d.ts +12 -0
- package/dist/shared-react/components/built-in-renderers.d.ts +2 -0
- package/dist/shared-react/components/text-markup/highlight.d.ts +3 -1
- package/dist/shared-react/components/text-markup/squiggly.d.ts +3 -1
- package/dist/shared-react/components/text-markup/strikeout.d.ts +3 -1
- package/dist/shared-react/components/text-markup/underline.d.ts +3 -1
- package/dist/shared-react/components/types.d.ts +66 -10
- package/dist/svelte/components/Annotations.svelte.d.ts +0 -7
- package/dist/svelte/components/AppearanceImage.svelte.d.ts +8 -0
- package/dist/svelte/components/annotations/Circle.svelte.d.ts +1 -10
- package/dist/svelte/components/annotations/FreeText.svelte.d.ts +1 -0
- package/dist/svelte/components/annotations/Ink.svelte.d.ts +1 -1
- package/dist/svelte/components/annotations/Line.svelte.d.ts +1 -0
- package/dist/svelte/components/annotations/Polygon.svelte.d.ts +1 -0
- package/dist/svelte/components/annotations/Polyline.svelte.d.ts +1 -1
- package/dist/svelte/components/annotations/Square.svelte.d.ts +1 -0
- package/dist/svelte/components/built-in-renderers.d.ts +2 -0
- package/dist/svelte/components/renderers/CircleRenderer.svelte.d.ts +5 -0
- package/dist/svelte/components/renderers/FreeTextRenderer.svelte.d.ts +5 -0
- package/dist/svelte/components/renderers/HighlightRenderer.svelte.d.ts +5 -0
- package/dist/svelte/components/renderers/InkRenderer.svelte.d.ts +5 -0
- package/dist/svelte/components/renderers/LineRenderer.svelte.d.ts +5 -0
- package/dist/svelte/components/renderers/LinkRenderer.svelte.d.ts +5 -0
- package/dist/svelte/components/renderers/PolygonRenderer.svelte.d.ts +5 -0
- package/dist/svelte/components/renderers/PolylineRenderer.svelte.d.ts +5 -0
- package/dist/svelte/components/renderers/SquareRenderer.svelte.d.ts +5 -0
- package/dist/svelte/components/renderers/SquigglyRenderer.svelte.d.ts +5 -0
- package/dist/svelte/components/renderers/StampRenderer.svelte.d.ts +5 -0
- package/dist/svelte/components/renderers/StrikeoutRenderer.svelte.d.ts +5 -0
- package/dist/svelte/components/renderers/UnderlineRenderer.svelte.d.ts +5 -0
- package/dist/svelte/components/text-markup/Highlight.svelte.d.ts +2 -0
- package/dist/svelte/components/text-markup/Squiggly.svelte.d.ts +2 -0
- package/dist/svelte/components/text-markup/Strikeout.svelte.d.ts +2 -0
- package/dist/svelte/components/text-markup/Underline.svelte.d.ts +2 -0
- package/dist/svelte/components/types.d.ts +8 -2
- package/dist/svelte/context/renderer-registry.svelte.d.ts +2 -2
- package/dist/svelte/context/types.d.ts +63 -2
- package/dist/svelte/index.cjs +1 -1
- package/dist/svelte/index.cjs.map +1 -1
- package/dist/svelte/index.js +2509 -2864
- package/dist/svelte/index.js.map +1 -1
- package/dist/vue/components/annotation-container.vue.d.ts +8 -3
- package/dist/vue/components/annotation-layer.vue.d.ts +1 -20
- package/dist/vue/components/annotations/circle.vue.d.ts +18 -5
- package/dist/vue/components/annotations/free-text.vue.d.ts +17 -5
- package/dist/vue/components/annotations/ink.vue.d.ts +16 -6
- package/dist/vue/components/annotations/line.vue.d.ts +20 -5
- package/dist/vue/components/annotations/link.vue.d.ts +24 -6
- package/dist/vue/components/annotations/polygon.vue.d.ts +21 -5
- package/dist/vue/components/annotations/polyline.vue.d.ts +18 -5
- package/dist/vue/components/annotations/square.vue.d.ts +18 -5
- package/dist/vue/components/annotations/stamp.vue.d.ts +11 -5
- package/dist/vue/components/annotations.vue.d.ts +8 -575
- package/dist/vue/components/appearance-image.vue.d.ts +9 -0
- package/dist/vue/components/built-in-renderers.d.ts +2 -0
- package/dist/vue/components/group-selection-box.vue.d.ts +2 -2
- package/dist/vue/components/renderers/circle-renderer.vue.d.ts +6 -0
- package/dist/vue/components/renderers/free-text-renderer.vue.d.ts +6 -0
- package/dist/vue/components/renderers/highlight-renderer.vue.d.ts +6 -0
- package/dist/vue/components/renderers/ink-renderer.vue.d.ts +6 -0
- package/dist/vue/components/renderers/line-renderer.vue.d.ts +6 -0
- package/dist/vue/components/renderers/link-renderer.vue.d.ts +6 -0
- package/dist/vue/components/renderers/polygon-renderer.vue.d.ts +6 -0
- package/dist/vue/components/renderers/polyline-renderer.vue.d.ts +6 -0
- package/dist/vue/components/renderers/square-renderer.vue.d.ts +6 -0
- package/dist/vue/components/renderers/squiggly-renderer.vue.d.ts +6 -0
- package/dist/vue/components/renderers/stamp-renderer.vue.d.ts +6 -0
- package/dist/vue/components/renderers/strikeout-renderer.vue.d.ts +6 -0
- package/dist/vue/components/renderers/underline-renderer.vue.d.ts +6 -0
- package/dist/vue/components/text-markup/highlight.vue.d.ts +17 -5
- package/dist/vue/components/text-markup/squiggly.vue.d.ts +17 -5
- package/dist/vue/components/text-markup/strikeout.vue.d.ts +17 -5
- package/dist/vue/components/text-markup/underline.vue.d.ts +17 -5
- package/dist/vue/context/renderer-registry.d.ts +2 -2
- package/dist/vue/context/types.d.ts +63 -2
- package/dist/vue/index.cjs +1 -1
- package/dist/vue/index.cjs.map +1 -1
- package/dist/vue/index.js +1651 -1278
- package/dist/vue/index.js.map +1 -1
- package/package.json +10 -10
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PdfLinkAnnoObject } from '@embedpdf/models';
|
|
2
|
+
import { AnnotationRendererProps } from '../../context/types';
|
|
3
|
+
type __VLS_Props = AnnotationRendererProps<PdfLinkAnnoObject>;
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PdfPolygonAnnoObject } from '@embedpdf/models';
|
|
2
|
+
import { AnnotationRendererProps } from '../../context/types';
|
|
3
|
+
type __VLS_Props = AnnotationRendererProps<PdfPolygonAnnoObject>;
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PdfPolylineAnnoObject } from '@embedpdf/models';
|
|
2
|
+
import { AnnotationRendererProps } from '../../context/types';
|
|
3
|
+
type __VLS_Props = AnnotationRendererProps<PdfPolylineAnnoObject>;
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PdfSquareAnnoObject } from '@embedpdf/models';
|
|
2
|
+
import { AnnotationRendererProps } from '../../context/types';
|
|
3
|
+
type __VLS_Props = AnnotationRendererProps<PdfSquareAnnoObject>;
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PdfSquigglyAnnoObject } from '@embedpdf/models';
|
|
2
|
+
import { AnnotationRendererProps } from '../../context/types';
|
|
3
|
+
type __VLS_Props = AnnotationRendererProps<PdfSquigglyAnnoObject>;
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PdfStampAnnoObject } from '@embedpdf/models';
|
|
2
|
+
import { AnnotationRendererProps } from '../../context/types';
|
|
3
|
+
type __VLS_Props = AnnotationRendererProps<PdfStampAnnoObject>;
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PdfStrikeOutAnnoObject } from '@embedpdf/models';
|
|
2
|
+
import { AnnotationRendererProps } from '../../context/types';
|
|
3
|
+
type __VLS_Props = AnnotationRendererProps<PdfStrikeOutAnnoObject>;
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PdfUnderlineAnnoObject } from '@embedpdf/models';
|
|
2
|
+
import { AnnotationRendererProps } from '../../context/types';
|
|
3
|
+
type __VLS_Props = AnnotationRendererProps<PdfUnderlineAnnoObject>;
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Rect } from '@embedpdf/models';
|
|
2
|
-
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<{
|
|
3
5
|
/** Stroke/markup color */
|
|
4
6
|
strokeColor?: string;
|
|
5
7
|
opacity?: number;
|
|
@@ -7,9 +9,19 @@ type __VLS_Props = {
|
|
|
7
9
|
rect?: Rect;
|
|
8
10
|
scale: number;
|
|
9
11
|
onClick?: (e: PointerEvent | TouchEvent) => void;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
/** When true, AP image provides the visual; only render hit area */
|
|
13
|
+
appearanceActive?: boolean;
|
|
14
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
15
|
+
/** Stroke/markup color */
|
|
16
|
+
strokeColor?: string;
|
|
17
|
+
opacity?: number;
|
|
18
|
+
segmentRects: Rect[];
|
|
19
|
+
rect?: Rect;
|
|
20
|
+
scale: number;
|
|
21
|
+
onClick?: (e: PointerEvent | TouchEvent) => void;
|
|
22
|
+
/** When true, AP image provides the visual; only render hit area */
|
|
23
|
+
appearanceActive?: boolean;
|
|
24
|
+
}> & Readonly<{}>, {
|
|
12
25
|
opacity: number;
|
|
26
|
+
appearanceActive: boolean;
|
|
13
27
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
-
declare const _default: typeof __VLS_export;
|
|
15
|
-
export default _default;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Rect } from '@embedpdf/models';
|
|
2
|
-
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<{
|
|
3
5
|
/** Stroke/markup color */
|
|
4
6
|
strokeColor?: string;
|
|
5
7
|
opacity?: number;
|
|
@@ -7,9 +9,19 @@ type __VLS_Props = {
|
|
|
7
9
|
rect?: Rect;
|
|
8
10
|
scale: number;
|
|
9
11
|
onClick?: (e: PointerEvent | TouchEvent) => void;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
/** When true, AP image provides the visual; only render hit area */
|
|
13
|
+
appearanceActive?: boolean;
|
|
14
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
15
|
+
/** Stroke/markup color */
|
|
16
|
+
strokeColor?: string;
|
|
17
|
+
opacity?: number;
|
|
18
|
+
segmentRects: Rect[];
|
|
19
|
+
rect?: Rect;
|
|
20
|
+
scale: number;
|
|
21
|
+
onClick?: (e: PointerEvent | TouchEvent) => void;
|
|
22
|
+
/** When true, AP image provides the visual; only render hit area */
|
|
23
|
+
appearanceActive?: boolean;
|
|
24
|
+
}> & Readonly<{}>, {
|
|
12
25
|
opacity: number;
|
|
26
|
+
appearanceActive: boolean;
|
|
13
27
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
-
declare const _default: typeof __VLS_export;
|
|
15
|
-
export default _default;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Rect } from '@embedpdf/models';
|
|
2
|
-
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<{
|
|
3
5
|
/** Stroke/markup color */
|
|
4
6
|
strokeColor?: string;
|
|
5
7
|
opacity?: number;
|
|
@@ -7,9 +9,19 @@ type __VLS_Props = {
|
|
|
7
9
|
rect?: Rect;
|
|
8
10
|
scale: number;
|
|
9
11
|
onClick?: (e: PointerEvent | TouchEvent) => void;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
/** When true, AP image provides the visual; only render hit area */
|
|
13
|
+
appearanceActive?: boolean;
|
|
14
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
15
|
+
/** Stroke/markup color */
|
|
16
|
+
strokeColor?: string;
|
|
17
|
+
opacity?: number;
|
|
18
|
+
segmentRects: Rect[];
|
|
19
|
+
rect?: Rect;
|
|
20
|
+
scale: number;
|
|
21
|
+
onClick?: (e: PointerEvent | TouchEvent) => void;
|
|
22
|
+
/** When true, AP image provides the visual; only render hit area */
|
|
23
|
+
appearanceActive?: boolean;
|
|
24
|
+
}> & Readonly<{}>, {
|
|
12
25
|
opacity: number;
|
|
26
|
+
appearanceActive: boolean;
|
|
13
27
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
-
declare const _default: typeof __VLS_export;
|
|
15
|
-
export default _default;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { Rect } from '@embedpdf/models';
|
|
2
|
-
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
4
|
+
declare const __VLS_export: import('vue').DefineComponent<{
|
|
3
5
|
/** Stroke/markup color */
|
|
4
6
|
strokeColor?: string;
|
|
5
7
|
opacity?: number;
|
|
@@ -7,9 +9,19 @@ type __VLS_Props = {
|
|
|
7
9
|
rect?: Rect;
|
|
8
10
|
scale: number;
|
|
9
11
|
onClick?: (e: PointerEvent | TouchEvent) => void;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
/** When true, AP image provides the visual; only render hit area */
|
|
13
|
+
appearanceActive?: boolean;
|
|
14
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
|
15
|
+
/** Stroke/markup color */
|
|
16
|
+
strokeColor?: string;
|
|
17
|
+
opacity?: number;
|
|
18
|
+
segmentRects: Rect[];
|
|
19
|
+
rect?: Rect;
|
|
20
|
+
scale: number;
|
|
21
|
+
onClick?: (e: PointerEvent | TouchEvent) => void;
|
|
22
|
+
/** When true, AP image provides the visual; only render hit area */
|
|
23
|
+
appearanceActive?: boolean;
|
|
24
|
+
}> & Readonly<{}>, {
|
|
12
25
|
opacity: number;
|
|
26
|
+
appearanceActive: boolean;
|
|
13
27
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
14
|
-
declare const _default: typeof __VLS_export;
|
|
15
|
-
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BoxedAnnotationRenderer, AnnotationRendererEntry, AnnotationRendererProps } from './types';
|
|
1
|
+
import { BoxedAnnotationRenderer, AnnotationRendererEntry, AnnotationRendererProps, AnnotationInteractionEvent, SelectOverrideHelpers } from './types';
|
|
2
2
|
import { PdfAnnotationObject } from '@embedpdf/models';
|
|
3
3
|
/**
|
|
4
4
|
* Annotation Renderer Registry
|
|
@@ -23,4 +23,4 @@ export declare function useRegisterRenderers(entries: BoxedAnnotationRenderer[])
|
|
|
23
23
|
* Wraps component in markRaw to prevent reactivity overhead.
|
|
24
24
|
*/
|
|
25
25
|
export declare function createRenderer<T extends PdfAnnotationObject>(entry: AnnotationRendererEntry<T>): BoxedAnnotationRenderer;
|
|
26
|
-
export type { AnnotationRendererProps, AnnotationRendererEntry, BoxedAnnotationRenderer };
|
|
26
|
+
export type { AnnotationRendererProps, AnnotationRendererEntry, BoxedAnnotationRenderer, AnnotationInteractionEvent, SelectOverrideHelpers, };
|
|
@@ -1,15 +1,35 @@
|
|
|
1
|
-
import { Component } from 'vue';
|
|
1
|
+
import { Component, CSSProperties } from 'vue';
|
|
2
2
|
import { PdfAnnotationObject } from '@embedpdf/models';
|
|
3
3
|
import { TrackedAnnotation } from '../../lib';
|
|
4
|
+
import { VertexConfig } from '../../shared-vue/types';
|
|
5
|
+
/**
|
|
6
|
+
* Properly typed event for annotation interactions (click, select, etc.)
|
|
7
|
+
*/
|
|
8
|
+
export type AnnotationInteractionEvent = PointerEvent | MouseEvent | TouchEvent;
|
|
4
9
|
/**
|
|
5
10
|
* Props passed to custom annotation renderer components
|
|
6
11
|
*/
|
|
7
12
|
export interface AnnotationRendererProps<T extends PdfAnnotationObject = PdfAnnotationObject> {
|
|
8
13
|
annotation: TrackedAnnotation<T>;
|
|
14
|
+
currentObject: T;
|
|
9
15
|
isSelected: boolean;
|
|
16
|
+
isEditing: boolean;
|
|
10
17
|
scale: number;
|
|
11
18
|
pageIndex: number;
|
|
12
|
-
|
|
19
|
+
documentId: string;
|
|
20
|
+
onClick: (e: AnnotationInteractionEvent) => void;
|
|
21
|
+
/** When true, AP canvas provides the visual; component should only render hit area */
|
|
22
|
+
appearanceActive: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Helpers passed to selectOverride for custom selection behavior.
|
|
26
|
+
*/
|
|
27
|
+
export interface SelectOverrideHelpers {
|
|
28
|
+
defaultSelect: (e: AnnotationInteractionEvent, annotation: TrackedAnnotation) => void;
|
|
29
|
+
selectAnnotation: (pageIndex: number, id: string) => void;
|
|
30
|
+
clearSelection: () => void;
|
|
31
|
+
allAnnotations: TrackedAnnotation[];
|
|
32
|
+
pageIndex: number;
|
|
13
33
|
}
|
|
14
34
|
/**
|
|
15
35
|
* Entry for defining a custom annotation renderer.
|
|
@@ -22,6 +42,31 @@ export interface AnnotationRendererEntry<T extends PdfAnnotationObject = PdfAnno
|
|
|
22
42
|
matches: (annotation: PdfAnnotationObject) => annotation is T;
|
|
23
43
|
/** Vue component to render the annotation */
|
|
24
44
|
component: Component<AnnotationRendererProps<T>>;
|
|
45
|
+
/** Vertex configuration for annotations with draggable vertices (line, polyline, polygon) */
|
|
46
|
+
vertexConfig?: VertexConfig<T>;
|
|
47
|
+
/** z-index for the annotation container (default: 1, text markup uses 0) */
|
|
48
|
+
zIndex?: number;
|
|
49
|
+
/** Style applied to the annotation container (overrides default blendMode style) */
|
|
50
|
+
containerStyle?: (annotation: T) => CSSProperties;
|
|
51
|
+
/** Type-specific interaction fallbacks used when the tool doesn't define a property */
|
|
52
|
+
interactionDefaults?: {
|
|
53
|
+
isDraggable?: boolean;
|
|
54
|
+
isResizable?: boolean;
|
|
55
|
+
isRotatable?: boolean;
|
|
56
|
+
lockAspectRatio?: boolean;
|
|
57
|
+
};
|
|
58
|
+
/** Whether this annotation type uses AP rendering before editing (default: true) */
|
|
59
|
+
useAppearanceStream?: boolean;
|
|
60
|
+
/** Override resolved isDraggable (e.g., FreeText disables drag while editing) */
|
|
61
|
+
isDraggable?: (toolDraggable: boolean, context: {
|
|
62
|
+
isEditing: boolean;
|
|
63
|
+
}) => boolean;
|
|
64
|
+
/** Handle double-click on the annotation container */
|
|
65
|
+
onDoubleClick?: (annotationId: string, setEditingId: (id: string) => void) => void;
|
|
66
|
+
/** Override default selection behavior (e.g., Link IRT parent resolution) */
|
|
67
|
+
selectOverride?: (e: AnnotationInteractionEvent, annotation: TrackedAnnotation<T>, helpers: SelectOverrideHelpers) => void;
|
|
68
|
+
/** Return true to hide the selection menu for this annotation */
|
|
69
|
+
hideSelectionMenu?: (annotation: T) => boolean;
|
|
25
70
|
}
|
|
26
71
|
/**
|
|
27
72
|
* Boxed renderer stored in registry (generic erased for storage)
|
|
@@ -30,4 +75,20 @@ export interface BoxedAnnotationRenderer {
|
|
|
30
75
|
id: string;
|
|
31
76
|
matches: (annotation: PdfAnnotationObject) => boolean;
|
|
32
77
|
component: Component<AnnotationRendererProps>;
|
|
78
|
+
vertexConfig?: VertexConfig<PdfAnnotationObject>;
|
|
79
|
+
zIndex?: number;
|
|
80
|
+
containerStyle?: (annotation: PdfAnnotationObject) => CSSProperties;
|
|
81
|
+
interactionDefaults?: {
|
|
82
|
+
isDraggable?: boolean;
|
|
83
|
+
isResizable?: boolean;
|
|
84
|
+
isRotatable?: boolean;
|
|
85
|
+
lockAspectRatio?: boolean;
|
|
86
|
+
};
|
|
87
|
+
useAppearanceStream?: boolean;
|
|
88
|
+
isDraggable?: (toolDraggable: boolean, context: {
|
|
89
|
+
isEditing: boolean;
|
|
90
|
+
}) => boolean;
|
|
91
|
+
onDoubleClick?: (annotationId: string, setEditingId: (id: string) => void) => void;
|
|
92
|
+
selectOverride?: (e: AnnotationInteractionEvent, annotation: TrackedAnnotation, helpers: SelectOverrideHelpers) => void;
|
|
93
|
+
hideSelectionMenu?: (annotation: PdfAnnotationObject) => boolean;
|
|
33
94
|
}
|