@vue-pdf-viewer/annotation 1.2.0 → 1.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +8 -2
- package/dist/index.js +9172 -364
- package/dist/index.umd.cjs +16 -2
- package/dist/tool-strikethrough.406b53bc.js +21 -0
- package/dist/tool-text-selection.12e94e20.js +21 -0
- package/dist/tool-underline.b3cc1b7e.js +21 -0
- package/dist/types.d.ts +3 -17
- package/dist/utils/pdfSerializer.d.ts +15 -0
- package/package.json +4 -3
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { openBlock as t, createElementBlock as o, createElementVNode as r } from "vue";
|
|
2
|
+
const n = {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
width: "1em",
|
|
5
|
+
height: "1em",
|
|
6
|
+
fill: "none",
|
|
7
|
+
viewBox: "0 0 20 20"
|
|
8
|
+
};
|
|
9
|
+
function l(c, e) {
|
|
10
|
+
return t(), o("svg", n, [...e[0] || (e[0] = [
|
|
11
|
+
r("path", {
|
|
12
|
+
fill: "currentColor",
|
|
13
|
+
d: "M17.5 10a.624.624 0 0 1-.625.625h-3.13c.718.556 1.255 1.344 1.255 2.5 0 1.042-.547 2.008-1.543 2.718-.931.666-2.16 1.032-3.457 1.032-1.298 0-2.526-.366-3.457-1.032C5.547 15.133 5 14.167 5 13.125a.625.625 0 1 1 1.25 0c0 1.355 1.719 2.5 3.75 2.5s3.75-1.145 3.75-2.5c0-1.16-.823-1.842-3.029-2.5H3.125a.625.625 0 1 1 0-1.25h13.75A.625.625 0 0 1 17.5 10M5.963 8.125a.625.625 0 0 0 .595-.82 1.4 1.4 0 0 1-.065-.43c0-1.425 1.508-2.5 3.507-2.5 1.472 0 2.669.58 3.203 1.55a.625.625 0 0 0 1.094-.6c-.756-1.378-2.362-2.2-4.297-2.2-2.712 0-4.757 1.612-4.757 3.75-.001.278.041.555.127.82a.625.625 0 0 0 .593.43"
|
|
14
|
+
}, null, -1)
|
|
15
|
+
])]);
|
|
16
|
+
}
|
|
17
|
+
const h = { render: l };
|
|
18
|
+
export {
|
|
19
|
+
h as default,
|
|
20
|
+
l as render
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { openBlock as l, createElementBlock as t, createElementVNode as o } from "vue";
|
|
2
|
+
const n = {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
width: "1em",
|
|
5
|
+
height: "1em",
|
|
6
|
+
fill: "none",
|
|
7
|
+
viewBox: "0 0 20 20"
|
|
8
|
+
};
|
|
9
|
+
function a(c, e) {
|
|
10
|
+
return l(), t("svg", n, [...e[0] || (e[0] = [
|
|
11
|
+
o("path", {
|
|
12
|
+
fill: "currentColor",
|
|
13
|
+
d: "M17.916 14.568c.345 0 .625.28.625.625V17.9c0 .345-.28.625-.625.625H2.083a.625.625 0 0 1-.625-.625v-2.708c0-.345.28-.625.625-.625zM2.708 17.276h14.583v-1.458H2.708zm8.333-15.428a.626.626 0 0 1 .88.887L8.39 6.242l3.525 3.524 3.584-3.558a.626.626 0 0 1 .88.887l-4.057 4.03a.63.63 0 0 1-.633.15v.001h.004l.002.002-.018-.004a1 1 0 0 0-.125-.02 2 2 0 0 0-.534.015c-.457.07-1.144.312-1.92 1.07a.625.625 0 0 1-.873 0l-.07-.069-1.173 1.09a.63.63 0 0 1-.426.166H3.75a.625.625 0 0 1-.444-1.065l2.487-2.5-.045-.044a.626.626 0 0 1 0-.894c.775-.757 1.018-1.425 1.09-1.862.035-.224.029-.4.016-.512a1 1 0 0 0-.02-.118l-.004-.012v.001l.002.002V6.52a.63.63 0 0 1 .15-.643zM5.254 12.276h1.058l.948-.88-.444-.435-.13-.127zm6.444-.998h-.003zM8.014 7.634c-.131.537-.412 1.162-.958 1.814l1.627 1.591c.648-.523 1.267-.8 1.802-.934z"
|
|
14
|
+
}, null, -1)
|
|
15
|
+
])]);
|
|
16
|
+
}
|
|
17
|
+
const h = { render: a };
|
|
18
|
+
export {
|
|
19
|
+
h as default,
|
|
20
|
+
a as render
|
|
21
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { openBlock as t, createElementBlock as o, createElementVNode as n } from "vue";
|
|
2
|
+
const r = {
|
|
3
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
4
|
+
width: "1em",
|
|
5
|
+
height: "1em",
|
|
6
|
+
fill: "none",
|
|
7
|
+
viewBox: "0 0 20 20"
|
|
8
|
+
};
|
|
9
|
+
function l(a, e) {
|
|
10
|
+
return t(), o("svg", r, [...e[0] || (e[0] = [
|
|
11
|
+
n("path", {
|
|
12
|
+
fill: "currentColor",
|
|
13
|
+
d: "M15.625 17.5a.624.624 0 0 1-.625.625H5a.625.625 0 1 1 0-1.25h10a.624.624 0 0 1 .625.625M10 15.625a5.005 5.005 0 0 0 5-5v-6.25a.625.625 0 1 0-1.25 0v6.25a3.75 3.75 0 0 1-7.5 0v-6.25a.625.625 0 0 0-1.25 0v6.25a5.005 5.005 0 0 0 5 5"
|
|
14
|
+
}, null, -1)
|
|
15
|
+
])]);
|
|
16
|
+
}
|
|
17
|
+
const d = { render: l };
|
|
18
|
+
export {
|
|
19
|
+
d as default,
|
|
20
|
+
l as render
|
|
21
|
+
};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import type { Component, VNode } from "vue";
|
|
3
|
-
export interface AnnotationOption {
|
|
4
|
-
icon?: Component | VNode | string;
|
|
5
|
-
component?: Component;
|
|
6
|
-
}
|
|
7
|
-
export interface FreeTextOption extends AnnotationOption {
|
|
8
|
-
fontColors?: AnnotationFreeTextFontColors;
|
|
9
|
-
fontSizes?: number[];
|
|
10
|
-
}
|
|
11
|
-
export interface HighlightOption extends AnnotationOption {
|
|
12
|
-
colors?: AnnotationHighlightColors;
|
|
13
|
-
}
|
|
14
|
-
export interface ImageOption extends AnnotationOption {
|
|
15
|
-
}
|
|
1
|
+
import { type AnnotationEventCallback, type TextSelectionOption, type FreeTextOption, type ImageOption } from "@vue-pdf-viewer/shared";
|
|
16
2
|
export interface VPdfAnnotationPluginOptions extends AnnotationEventCallback {
|
|
3
|
+
textSelection?: TextSelectionOption | boolean;
|
|
17
4
|
freeText?: FreeTextOption | boolean;
|
|
18
|
-
highlight?: HighlightOption | boolean;
|
|
19
5
|
image?: ImageOption | boolean;
|
|
20
6
|
}
|
|
21
7
|
export { AnnotationType, AnnotationFlag } from "@vue-pdf-viewer/shared";
|
|
22
|
-
export type { AnnotationHighlightColors, AnnotationFreeTextFontColors, LabelValuePair, Annotation, OutlineDestinations, OutlineName, OutlineRef, LinkAction, AnnotationBorderStyle, AnnotationStringObj, AnnotationAttachment, AnnotationCallback } from "@vue-pdf-viewer/shared";
|
|
8
|
+
export type { AnnotationToolOption, AnnotationHighlightColors, AnnotationTextSelectionColors, AnnotationFreeTextFontColors, HighlightToolOption, StrikethroughToolOption, UnderlineToolOption, LabelValuePair, Annotation, OutlineDestinations, OutlineName, OutlineRef, LinkAction, AnnotationBorderStyle, AnnotationStringObj, AnnotationAttachment, AnnotationCallback, } from "@vue-pdf-viewer/shared";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Annotation } from "../types";
|
|
2
|
+
export declare class AnnotationPdfSerializer {
|
|
3
|
+
/**
|
|
4
|
+
* Serialize annotations into a PDF document
|
|
5
|
+
*/
|
|
6
|
+
static serializeAnnotationsToPdf(originalBytes: Uint8Array, annotations: Annotation[]): Promise<Uint8Array>;
|
|
7
|
+
private static addUnderlineAnnotation;
|
|
8
|
+
/**
|
|
9
|
+
* Add a rectangle (square) annotation to the PDF
|
|
10
|
+
* Rectangle annotations are PDF annotation type 5 (Square)
|
|
11
|
+
*/
|
|
12
|
+
private static addRectangleAnnotation;
|
|
13
|
+
private static convertRectToPdfCoords;
|
|
14
|
+
private static convertQuadPointsToPdfCoords;
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-pdf-viewer/annotation",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.3.0-alpha.1",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.umd.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"vue": "^3.2.37"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@
|
|
33
|
+
"@pdf-viewer/pdf-lite": "link:@pdf-viewer/pdf-lite",
|
|
34
|
+
"@vue-pdf-viewer/shared": "1.2.0-rc.10",
|
|
34
35
|
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
35
36
|
"vue": "^3.2.37"
|
|
36
37
|
},
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"pdf-annotation",
|
|
61
62
|
"nuxt-pdf"
|
|
62
63
|
],
|
|
63
|
-
"author": "Vue PDF Viewer <
|
|
64
|
+
"author": "Vue PDF Viewer <support@vue-pdf-viewer.dev>",
|
|
64
65
|
"license": "See license section",
|
|
65
66
|
"homepage": "https://www.vue-pdf-viewer.dev",
|
|
66
67
|
"url": "https://github.com/vue-pdf-viewer/vue-pdf-viewer",
|