@embedpdf/plugin-annotation 1.0.13 → 1.0.14
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 +80 -43
- package/dist/index.js.map +1 -1
- package/dist/lib/helpers.d.ts +8 -2
- package/dist/lib/types.d.ts +44 -6
- package/dist/preact/adapter.d.ts +5 -0
- package/dist/preact/index.cjs +1 -1
- package/dist/preact/index.cjs.map +1 -1
- package/dist/preact/index.js +267 -7
- package/dist/preact/index.js.map +1 -1
- package/dist/react/adapter.d.ts +5 -0
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +267 -7
- package/dist/react/index.js.map +1 -1
- package/dist/shared-preact/components/annotation-container.d.ts +3 -2
- package/dist/shared-preact/components/annotations/free-text-paint.d.ts +10 -0
- package/dist/shared-preact/components/annotations/free-text.d.ts +13 -0
- package/dist/shared-react/components/annotation-container.d.ts +3 -2
- package/dist/shared-react/components/annotations/free-text-paint.d.ts +10 -0
- package/dist/shared-react/components/annotations/free-text.d.ts +13 -0
- package/package.json +9 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSX, HTMLAttributes, CSSProperties } from '../../preact/adapter.ts';
|
|
1
|
+
import { JSX, HTMLAttributes, CSSProperties, MouseEvent } from '../../preact/adapter.ts';
|
|
2
2
|
import { TrackedAnnotation } from '../../lib/index.ts';
|
|
3
3
|
import { PdfAnnotationObject, Position } from '@embedpdf/models';
|
|
4
4
|
import { SelectionMenuProps } from '../../shared/types';
|
|
@@ -16,9 +16,10 @@ type AnnotationContainerProps<T extends PdfAnnotationObject> = Omit<HTMLAttribut
|
|
|
16
16
|
isDraggable?: boolean;
|
|
17
17
|
isResizable?: boolean;
|
|
18
18
|
outlineOffset?: number;
|
|
19
|
+
onDoubleClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
19
20
|
selectionMenu?: (props: SelectionMenuProps) => JSX.Element;
|
|
20
21
|
computeVertices?: (annotation: T) => Position[];
|
|
21
22
|
computePatch?: ComputePatch<T>;
|
|
22
23
|
};
|
|
23
|
-
export declare function AnnotationContainer<T extends PdfAnnotationObject>({ scale, pageIndex, rotation, pageWidth, pageHeight, trackedAnnotation, children, style, outlineOffset, isSelected, isDraggable, isResizable, computeVertices, computePatch, selectionMenu, ...props }: AnnotationContainerProps<T>): JSX.Element;
|
|
24
|
+
export declare function AnnotationContainer<T extends PdfAnnotationObject>({ scale, pageIndex, rotation, pageWidth, pageHeight, trackedAnnotation, children, style, outlineOffset, isSelected, isDraggable, isResizable, computeVertices, computePatch, selectionMenu, onDoubleClick, ...props }: AnnotationContainerProps<T>): JSX.Element;
|
|
24
25
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface FreeTextPaintProps {
|
|
2
|
+
pageIndex: number;
|
|
3
|
+
scale: number;
|
|
4
|
+
pageWidth: number;
|
|
5
|
+
pageHeight: number;
|
|
6
|
+
/** Optional preview cursor */
|
|
7
|
+
cursor?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const FreeTextPaint: ({ pageIndex, scale, pageWidth, pageHeight, cursor, }: FreeTextPaintProps) => import("preact").JSX.Element | null;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MouseEvent } from '../../../preact/adapter.ts';
|
|
2
|
+
import { PdfFreeTextAnnoObject } from '@embedpdf/models';
|
|
3
|
+
import { TrackedAnnotation } from '../../../lib/index.ts';
|
|
4
|
+
interface FreeTextProps {
|
|
5
|
+
isSelected: boolean;
|
|
6
|
+
isEditing: boolean;
|
|
7
|
+
annotation: TrackedAnnotation<PdfFreeTextAnnoObject>;
|
|
8
|
+
pageIndex: number;
|
|
9
|
+
scale: number;
|
|
10
|
+
onClick?: (e: MouseEvent<HTMLDivElement>) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function FreeText({ isSelected, isEditing, annotation, pageIndex, scale, onClick, }: FreeTextProps): import("preact").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JSX, HTMLAttributes, CSSProperties } from '../../react/adapter.ts';
|
|
1
|
+
import { JSX, HTMLAttributes, CSSProperties, MouseEvent } from '../../react/adapter.ts';
|
|
2
2
|
import { TrackedAnnotation } from '../../lib/index.ts';
|
|
3
3
|
import { PdfAnnotationObject, Position } from '@embedpdf/models';
|
|
4
4
|
import { SelectionMenuProps } from '../../shared/types';
|
|
@@ -16,9 +16,10 @@ type AnnotationContainerProps<T extends PdfAnnotationObject> = Omit<HTMLAttribut
|
|
|
16
16
|
isDraggable?: boolean;
|
|
17
17
|
isResizable?: boolean;
|
|
18
18
|
outlineOffset?: number;
|
|
19
|
+
onDoubleClick?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
19
20
|
selectionMenu?: (props: SelectionMenuProps) => JSX.Element;
|
|
20
21
|
computeVertices?: (annotation: T) => Position[];
|
|
21
22
|
computePatch?: ComputePatch<T>;
|
|
22
23
|
};
|
|
23
|
-
export declare function AnnotationContainer<T extends PdfAnnotationObject>({ scale, pageIndex, rotation, pageWidth, pageHeight, trackedAnnotation, children, style, outlineOffset, isSelected, isDraggable, isResizable, computeVertices, computePatch, selectionMenu, ...props }: AnnotationContainerProps<T>): JSX.Element;
|
|
24
|
+
export declare function AnnotationContainer<T extends PdfAnnotationObject>({ scale, pageIndex, rotation, pageWidth, pageHeight, trackedAnnotation, children, style, outlineOffset, isSelected, isDraggable, isResizable, computeVertices, computePatch, selectionMenu, onDoubleClick, ...props }: AnnotationContainerProps<T>): JSX.Element;
|
|
24
25
|
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface FreeTextPaintProps {
|
|
2
|
+
pageIndex: number;
|
|
3
|
+
scale: number;
|
|
4
|
+
pageWidth: number;
|
|
5
|
+
pageHeight: number;
|
|
6
|
+
/** Optional preview cursor */
|
|
7
|
+
cursor?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const FreeTextPaint: ({ pageIndex, scale, pageWidth, pageHeight, cursor, }: FreeTextPaintProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MouseEvent } from '../../../react/adapter.ts';
|
|
2
|
+
import { PdfFreeTextAnnoObject } from '@embedpdf/models';
|
|
3
|
+
import { TrackedAnnotation } from '../../../lib/index.ts';
|
|
4
|
+
interface FreeTextProps {
|
|
5
|
+
isSelected: boolean;
|
|
6
|
+
isEditing: boolean;
|
|
7
|
+
annotation: TrackedAnnotation<PdfFreeTextAnnoObject>;
|
|
8
|
+
pageIndex: number;
|
|
9
|
+
scale: number;
|
|
10
|
+
onClick?: (e: MouseEvent<HTMLDivElement>) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function FreeText({ isSelected, isEditing, annotation, pageIndex, scale, onClick, }: FreeTextProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embedpdf/plugin-annotation",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.14",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -18,24 +18,24 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@embedpdf/models": "1.0.
|
|
21
|
+
"@embedpdf/models": "1.0.14"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@types/react": "^18.2.0",
|
|
25
25
|
"typescript": "^5.0.0",
|
|
26
|
-
"@embedpdf/plugin-selection": "1.0.
|
|
27
|
-
"@embedpdf/plugin-interaction-manager": "1.0.13",
|
|
26
|
+
"@embedpdf/plugin-selection": "1.0.14",
|
|
28
27
|
"@embedpdf/build": "1.0.0",
|
|
29
|
-
"@embedpdf/plugin-
|
|
28
|
+
"@embedpdf/plugin-interaction-manager": "1.0.14",
|
|
29
|
+
"@embedpdf/plugin-history": "1.0.14"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"react": ">=16.8.0",
|
|
33
33
|
"react-dom": ">=16.8.0",
|
|
34
34
|
"preact": "^10.26.4",
|
|
35
|
-
"@embedpdf/core": "1.0.
|
|
36
|
-
"@embedpdf/plugin-
|
|
37
|
-
"@embedpdf/plugin-
|
|
38
|
-
"@embedpdf/plugin-
|
|
35
|
+
"@embedpdf/core": "1.0.14",
|
|
36
|
+
"@embedpdf/plugin-interaction-manager": "1.0.14",
|
|
37
|
+
"@embedpdf/plugin-selection": "1.0.14",
|
|
38
|
+
"@embedpdf/plugin-history": "1.0.14"
|
|
39
39
|
},
|
|
40
40
|
"files": [
|
|
41
41
|
"dist",
|