@vue-pdf-viewer/annotation 1.2.0-beta.1 → 1.2.0-beta.2
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/composables/useLocalization.d.ts +1 -1
- package/dist/index.js +4 -4
- package/dist/index.umd.cjs +2 -2
- package/dist/types.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ComputedRef } from "vue";
|
|
2
|
-
import type
|
|
2
|
+
import { type Localization } from "@vue-pdf-viewer/shared";
|
|
3
3
|
export declare const useLocalization: () => {
|
|
4
4
|
t: (key: keyof Localization) => string;
|
|
5
5
|
currentLocale: ComputedRef<Localization>;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.vp-text-xl[data-v-fbd5714e]{font-size:1.25rem;line-height:1.75rem}.vpv-toolbar-btn.vpv-toolbar-btn-active[data-v-da575fac],.vpv-toolbar-btn[data-v-da575fac]:hover{background-color:var(--vpv-primary-color);color:#fff}.vpv-annotation-editor-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.vpv-annotation-editor-layer *{pointer-events:auto}.vpv-annotation-editor-layer .vpv-annotation-editor{z-index:calc(var(--vpv-base-z-index) * 4)}.vpv-annotation-editor-layer.highlight-mode{cursor:text}.vpv-annotation-editor-layer.highlight-mode .vpv-annotation-editor{pointer-events:none}.vpv-annotation-editor-layer.highlight-mode .vpv-annotation-editor .vpv-annotation-editor__clip-path{cursor:pointer;position:absolute;inset:0;pointer-events:auto}.vpv-annotation-editor-layer:not(.highlight-mode) .vpv-annotation-editor.vpv-annotation-editor__highlight{pointer-events:none}.vpv-annotation-editor-layer:not(.highlight-mode) .vpv-annotation-editor.vpv-annotation-editor__highlight .vpv-annotation-editor__clip-path{pointer-events:none}.vpv-annotation-editor-layer.freetext-mode>:not(.vpv-annotation-editor__free-text){user-select:none;pointer-events:none}.vpv-annotation-editor-layer:not(.freetext-mode) .vpv-annotation-editor__free-text{pointer-events:none}.vpv-annotation-editor-layer .vpv-annotation-editor__free-text{position:absolute;user-select:none;padding:calc(var(--vpv-annotation-free-text__padding, 2px) * var(--scale-factor));cursor:auto}.vpv-annotation-editor-layer .vpv-annotation-editor__free-text.draggable{cursor:move}.vpv-annotation-editor-layer .vpv-annotation-editor__free-text--selected,.vpv-annotation-editor-layer .vpv-annotation-editor__free-text:hover{outline:1px solid #0082ff}.vpv-annotation-editor-layer .vpv-annotation-editor__free-text [role=textbox]{outline:none!important;text-align:start;font:10px sans-serif;line-height:var(--vpv-annotation-free-text__line-height);width:auto;height:auto;white-space:pre-wrap;word-wrap:break-word}.vpv-annotation-editor-layer .vpv-annotation-editor__free-text--temp{min-width:100px;min-height:calc(20px * var(--scale-factor));border:1px dashed #007bff;background-color:#ffffffe6;color:#000;cursor:text}.vpv-annotation-editor-layer .vpv-annotation-editor__free-text--temp>[role=textbox]{outline:none;font-size:calc(16px * var(--scale-factor));font-family:sans-serif;min-height:calc(16px * var(--scale-factor));white-space:nowrap}.vpv-annotation-highlight__color-picker-wrapper{padding-left:4px;padding-right:4px;padding-bottom:4px;text-align:left}.vpv-annotation-highlight__color-picker-wrapper>p{margin-bottom:.75rem}.vpv-canvas-layer>.vpv-highlight:is(svg){position:absolute;mix-blend-mode:multiply}.vpv-canvas-layer>.vpv-highlight:is(svg):not(.free){fill-rule:evenodd}.vpv-canvas-layer>.vpv-highlight-outline:is(svg){position:absolute;mix-blend-mode:normal;fill-rule:evenodd;fill:none}.vpv-canvas-layer>.vpv-highlight-outline:is(svg).hovered,.vpv-canvas-layer>.vpv-highlight-outline:is(svg).selected{stroke-width:var(--vpv-annotation-highlight__outline-width)}.vpv-canvas-layer>.vpv-highlight-outline:is(svg).hovered{stroke:var(--vpv-annotation-highlight__outline-hover-color)}.vpv-canvas-layer>.vpv-highlight-outline:is(svg).selected{stroke:var(--vpv-annotation-highlight__outline-selected-color)}.vpv-resizers{position:absolute;inset:0;pointer-events:none}.vpv-resizers .vpv-resizer{position:absolute;width:var(--vpv-annotation-outline-resizer-size);height:var(--vpv-annotation-outline-resizer-size);background:white;border:1px solid var(--vpv-annotation-outline-resizer-border-color);border-radius:50%;pointer-events:auto;cursor:pointer;z-index:calc(var(--vpv-base-z-index) * 9999);transition:opacity .2s ease,visibility .2s ease}.vpv-resizers .vpv-resizer:hover,.vpv-resizers .vpv-resizer:focus{transform:scale(1.5)}.vpv-resizers .vpv-resizer--top-left{top:calc(var(--vpv-annotation-outline-resizer-size) * -1.25);left:calc(var(--vpv-annotation-outline-resizer-size) * -1.25);cursor:nwse-resize}.vpv-resizers .vpv-resizer--top-right{top:calc(var(--vpv-annotation-outline-resizer-size) * -1.25);right:calc(var(--vpv-annotation-outline-resizer-size) * -1.25);cursor:nesw-resize}.vpv-resizers .vpv-resizer--bottom-left{bottom:calc(var(--vpv-annotation-outline-resizer-size) * -1.25);left:calc(var(--vpv-annotation-outline-resizer-size) * -1.25);cursor:nesw-resize}.vpv-resizers .vpv-resizer--bottom-right{bottom:calc(var(--vpv-annotation-outline-resizer-size) * -1.25);right:calc(var(--vpv-annotation-outline-resizer-size) * -1.25);cursor:nwse-resize}.vpv-page[data-main-rotation="90"] .vpv-resizer--top-left,.vpv-page[data-main-rotation="270"] .vpv-resizer--top-left{cursor:nesw-resize}.vpv-page[data-main-rotation="90"] .vpv-resizer--top-right,.vpv-page[data-main-rotation="270"] .vpv-resizer--top-right,.vpv-page[data-main-rotation="90"] .vpv-resizer--bottom-left,.vpv-page[data-main-rotation="270"] .vpv-resizer--bottom-left{cursor:nwse-resize}.vpv-page[data-main-rotation="90"] .vpv-resizer--bottom-right,.vpv-page[data-main-rotation="270"] .vpv-resizer--bottom-right{cursor:nesw-resize}.vpv-resizer--dark{background:#80ebff;border-color:#2b2a33}.vpv-resizer--dark:focus{outline-color:#80ebff}.vpv-annotation-editor__image{position:absolute;cursor:pointer;touch-action:none;user-select:none;will-change:transform}.vpv-annotation-editor__image.hovered,.vpv-annotation-editor__image:hover{outline-width:var(--vpv-annotation-outline-width);outline-style:solid;outline-color:var(--vpv-annotation-outline-hovered-color)}.vpv-annotation-editor__image.selected{outline-width:var(--vpv-annotation-outline-width);outline-style:solid;outline-offset:var(--vpv-annotation-outline-selected-offset);outline-color:var(--vpv-annotation-outline-selected-color);cursor:move}.vpv-annotation-editor__image canvas{position:absolute;width:100%;height:100%;margin:0;top:0;left:0}.vpv-annotation-editor__image.dragging canvas{user-drag:none;-webkit-user-drag:none;pointer-events:none;touch-action:none}.vpv-page:not([data-main-rotation="0"]) .vpv-annotation-editor__image:hover{outline:none}.vpv-annotation-tools-container[data-v-9db07deb]{padding-top:.5rem;padding-bottom:.5rem;border-top:1px solid #c6ccd2;max-width:min-content;margin:.5rem auto}.vpv-annotation-tools-container[data-v-9db07deb] .vpv-toolbar-btn{margin-bottom:.25rem}.slide-enter-active[data-v-9db07deb],.slide-leave-active[data-v-9db07deb]{transition:all .3s ease-out}.slide-enter-from[data-v-9db07deb],.slide-leave-to[data-v-9db07deb]{opacity:0}.slide-enter-from[data-v-9db07deb],.slide-leave-to[data-v-9db07deb]{transform:translateY(-20px)}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
2
|
import { defineComponent as C, inject as x, computed as p, openBlock as f, createBlock as d, resolveDynamicComponent as k, normalizeProps as $, mergeProps as b, createSlots as P, withCtx as r, renderSlot as m, renderList as pe, createElementBlock as j, defineAsyncComponent as me, unref as w, ref as K, createTextVNode as R, toDisplayString as B, createVNode as y, normalizeClass as he, useModel as F, useAttrs as Z, createCommentVNode as h, reactive as be, onMounted as _e, watch as Y, onUnmounted as ke, Transition as ye, h as we } from "vue";
|
|
3
3
|
var N;
|
|
4
4
|
(function(e) {
|
|
@@ -243,7 +243,7 @@ const J = (e, i) => {
|
|
|
243
243
|
for (const [a, s] of i)
|
|
244
244
|
t[a] = s;
|
|
245
245
|
return t;
|
|
246
|
-
}, z = /* @__PURE__ */ J(Le, [["__scopeId", "data-v-
|
|
246
|
+
}, z = /* @__PURE__ */ J(Le, [["__scopeId", "data-v-fbd5714e"]]), M = () => {
|
|
247
247
|
const e = x(
|
|
248
248
|
oe,
|
|
249
249
|
p(() => ({}))
|
|
@@ -288,7 +288,7 @@ const J = (e, i) => {
|
|
|
288
288
|
}));
|
|
289
289
|
}
|
|
290
290
|
});
|
|
291
|
-
const Se = /* @__PURE__ */ J(Ne, [["__scopeId", "data-v-
|
|
291
|
+
const Se = /* @__PURE__ */ J(Ne, [["__scopeId", "data-v-da575fac"]]), De = /* @__PURE__ */ C({
|
|
292
292
|
__name: "ToolAnnotationHighlight",
|
|
293
293
|
props: {
|
|
294
294
|
active: { type: Boolean, required: !0 },
|
|
@@ -749,7 +749,7 @@ const Ge = { class: "vpv-annotation-tools-container" }, Ve = {
|
|
|
749
749
|
]));
|
|
750
750
|
}
|
|
751
751
|
});
|
|
752
|
-
const ze = /* @__PURE__ */ J(qe, [["__scopeId", "data-v-
|
|
752
|
+
const ze = /* @__PURE__ */ J(qe, [["__scopeId", "data-v-9db07deb"]]), Ue = (e = {}) => {
|
|
753
753
|
const { highlight: i, freeText: t, image: a, ...s } = e;
|
|
754
754
|
return {
|
|
755
755
|
name: "annotation",
|
package/dist/index.umd.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var
|
|
2
|
-
(function(u,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(u=typeof globalThis<"u"?globalThis:u||self,e(u["@vue-pdf-viewer/annotation"]={},u.Vue))})(this,function(u,e){"use strict";var _;(function(t){t.highlight="vpv:annotation:highlight",t.freeText="vpv:annotation:freeText",t.signature="vpv:annotation:signature",t.image="vpv:annotation:image",t.underline="vpv:annotation:underline",t.strikeout="vpv:annotation:strikeout"})(_||(_={}));var T;(function(t){t.AnnotationCreated="vpv:annotation:created",t.AnnotationUpdated="vpv:annotation:updated",t.AnnotationDeleted="vpv:annotation:deleted",t.AnnotationMounted="vpv:annotation:mounted",t.Rotate="vpv:rotate"})(T||(T={}));var b;(function(t){t.Purple="#CAAAFF",t.Cyan="#65EDE9",t.Red="#FFACAC",t.Orange="#FFBD82",t.Yellow="#FCE244",t.Green="#A0F751"})(b||(b={}));var p;(function(t){t.Black="#000000",t.DarkGray="#444444",t.Gray="#696969",t.LightGray="#9C9C9C",t.LightestGray="#CDCDCD",t.White="#FFFFFF",t.Purple="#7862FF",t.Blue="#1777FF",t.Red="#F66365",t.Orange="#F67E63",t.Yellow="#F5C463",t.Green="#48BB77"})(p||(p={}));var D;(function(t){t[t.Text=1]="Text",t[t.Link=2]="Link",t[t.FreeText=3]="FreeText",t[t.Line=4]="Line",t[t.Square=5]="Square",t[t.Circle=6]="Circle",t[t.Polygon=7]="Polygon",t[t.Polyline=8]="Polyline",t[t.Highlight=9]="Highlight",t[t.Underline=10]="Underline",t[t.Squiggly=11]="Squiggly",t[t.StrikeOut=12]="StrikeOut",t[t.Stamp=13]="Stamp",t[t.Caret=14]="Caret",t[t.Ink=15]="Ink",t[t.Popup=16]="Popup",t[t.FileAttachment=17]="FileAttachment",t[t.Sound=18]="Sound",t[t.Movie=19]="Movie",t[t.Widget=20]="Widget",t[t.Screen=21]="Screen",t[t.PrinterMark=22]="PrinterMark",t[t.TrapNet=23]="TrapNet",t[t.Watermark=24]="Watermark",t[t.ThreeD=25]="ThreeD",t[t.Redact=26]="Redact"})(D||(D={}));var L;(function(t){t[t.INVISIBLE=1]="INVISIBLE",t[t.HIDDEN=2]="HIDDEN",t[t.PRINT=4]="PRINT",t[t.NOZOOM=8]="NOZOOM",t[t.NOROTATE=16]="NOROTATE",t[t.NOVIEW=32]="NOVIEW",t[t.READONLY=64]="READONLY",t[t.LOCKED=128]="LOCKED",t[t.TOGGLENOVIEW=256]="TOGGLENOVIEW",t[t.LOCKEDCONTENTS=512]="LOCKEDCONTENTS"})(L||(L={}));const K={ANNOTATIONS:"annotations"},C=Symbol("VPV Shared UIs"),j=Symbol("VPV Current Localization"),y=T,F={[b.Purple]:"Purple",[b.Cyan]:"Cyan",[b.Red]:"Red",[b.Orange]:"Orange",[b.Yellow]:"Yellow",[b.Green]:"Green"},Z={[p.Black]:"Black",[p.DarkGray]:"Dark Gray",[p.Gray]:"Gray",[p.LightGray]:"Light Gray",[p.LightestGray]:"Lightest Gray",[p.White]:"White",[p.Purple]:"Purple",[p.Blue]:"Blue",[p.Red]:"Red",[p.Orange]:"Orange",[p.Yellow]:"Yellow",[p.Green]:"Green"},X="pdfjs_internal_editor_",w=(t,n)=>`${t}-${n}`,J={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},M=t=>t.startsWith("#")||t.startsWith("0x")?t:J[t]||t,B=e.defineComponent({__name:"AppTooltip",setup(t){const n=e.inject(C),o=e.computed(()=>n?.AppTooltip);return(a,s)=>o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),e.normalizeProps(e.mergeProps({key:0},a.$attrs)),e.createSlots({default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:2},[e.renderList(a.$slots,(f,l)=>({name:l,fn:e.withCtx(()=>[e.renderSlot(a.$slots,l)])}))]),1040)):(e.openBlock(),e.createElementBlock("div",e.normalizeProps(e.mergeProps({key:1},a.$attrs)),[e.renderSlot(a.$slots,"default")],16))}}),N=e.defineComponent({__name:"AppButton",setup(t){const n=e.inject(C),o=e.computed(()=>n?.AppButton);return(a,s)=>o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),e.normalizeProps(e.mergeProps({key:0},a.$attrs)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16)):(e.openBlock(),e.createElementBlock("button",e.normalizeProps(e.mergeProps({key:1},a.$attrs)),[e.renderSlot(a.$slots,"default")],16))}}),Q=(t,n)=>{const o=t[n];return o?typeof o=="function"?o():Promise.resolve(o):new Promise((a,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+n)))})},ee=e.defineComponent({__name:"Icon",props:{name:{}},setup(t){const n=t,o=e.defineAsyncComponent({loader:()=>Q(Object.assign({"../assets/icons/annotations.svg":()=>Promise.resolve().then(()=>ge),"../assets/icons/tool-comment.svg":()=>Promise.resolve().then(()=>ue),"../assets/icons/tool-free-text.svg":()=>Promise.resolve().then(()=>ke),"../assets/icons/tool-highlight.svg":()=>Promise.resolve().then(()=>we),"../assets/icons/tool-image.svg":()=>Promise.resolve().then(()=>ye),"../assets/icons/tool-signature.svg":()=>Promise.resolve().then(()=>Ne)}),`../assets/icons/${n.name}.svg`)});return(a,s)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(o)),{class:"vp-text-xl"}))}}),De="",$=(t,n)=>{const o=t.__vccOpts||t;for(const[a,s]of n)o[a]=s;return o},x=$(ee,[["__scopeId","data-v-c6e40782"]]),S=()=>{const t=e.inject(j,e.computed(()=>({})));return{t:e.computed(()=>o=>{const a=o.split(".").pop()||o;return t.value&&a in t.value?t.value[a]:(console.warn(`useLocalization - Translation not found for key: ${o}`),o)}).value,currentLocale:e.computed(()=>t.value)}},te=e.defineComponent({__name:"ToolAnnotation",emits:["toggle"],setup(t,{emit:n}){const{t:o}=S(),a=n,s=e.ref(!1),f=()=>{s.value=!s.value,a("toggle",s.value)};return(l,d)=>l.$slots.default?e.renderSlot(l.$slots,"default",{key:0,onClick:f},void 0,!0):(e.openBlock(),e.createBlock(B,{key:1},{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value?e.unref(o)("annotationToggleHideTooltip"):e.unref(o)("annotationToggleShowTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(N,{"aria-label":s.value?e.unref(o)("annotationToggleHideTooltip"):e.unref(o)("annotationToggleShowTooltip"),class:e.normalizeClass(["vpv-toolbar-btn",{"vpv-toolbar-btn-active":s.value}]),onClick:f},{default:e.withCtx(()=>[e.createVNode(x,{name:"annotations",class:"vp-text-xl"})]),_:1},8,["aria-label","class"])]),_:1}))}}),Le="",oe=$(te,[["__scopeId","data-v-7ffb5374"]]),ne=e.defineComponent({__name:"ToolAnnotationHighlight",props:{active:{type:Boolean,required:!0},activeModifiers:{}},emits:["update:active"],setup(t){const n=e.useModel(t,"active"),{t:o}=S(),a=e.useAttrs(),s=e.computed(()=>a["aria-disabled"]===!0),f=()=>{s.value||(n.value=!n.value)};return(l,d)=>l.$slots.default?e.renderSlot(l.$slots,"default",e.mergeProps({key:0},l.$attrs,{onClick:f})):(e.openBlock(),e.createBlock(B,{key:1},{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("annotationHighlightTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(N,e.mergeProps({"aria-label":e.unref(o)("annotationHighlightLabel"),class:["vpv-toolbar-btn",{"vpv-toolbar-btn-active":n.value}]},l.$attrs,{onClick:f}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"icon",{},()=>[e.createVNode(x,{name:"tool-highlight"})])]),_:3},16,["aria-label","class"])]),_:3}))}}),ae=e.defineComponent({__name:"AppPopover",setup(t){const n=e.inject(C),o=e.computed(()=>n?.AppPopover);return(a,s)=>o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),e.normalizeProps(e.mergeProps({key:0},a.$attrs)),{trigger:e.withCtx(()=>[e.renderSlot(a.$slots,"trigger")]),default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16)):(e.openBlock(),e.createElementBlock("button",e.normalizeProps(e.mergeProps({key:1},a.$attrs)),[e.renderSlot(a.$slots,"default")],16))}}),re=e.defineComponent({__name:"AppSignatures",setup(t){const n=e.inject(C),o=e.computed(()=>n?.AppSignatures);return(a,s)=>o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),e.normalizeProps(e.mergeProps({key:0},a.$attrs)),null,16)):e.createCommentVNode("",!0)}}),le=e.defineComponent({__name:"ToolAnnotationSignature",props:{active:{type:Boolean,required:!0},activeModifiers:{}},emits:["update:active"],setup(t){const n=e.useModel(t,"active"),{t:o}=S(),a=e.useAttrs(),s=e.ref(!1),f=e.computed(()=>a["aria-disabled"]===!0),l=()=>{f.value||(!n.value&&!s.value&&(s.value=!0),n.value=!n.value)},d=c=>{s.value=!1};return(c,h)=>c.$slots.default?e.renderSlot(c.$slots,"default",e.mergeProps({key:0},c.$attrs,{onClick:l})):(e.openBlock(),e.createBlock(ae,{key:1,open:s.value,side:"right",sideOffset:10,class:"vpv-annotation-signatures__popover",onInteractOutside:d},{trigger:e.withCtx(()=>[e.createVNode(B,null,{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("annotationSignatureTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(N,e.mergeProps({"aria-label":e.unref(o)("annotationSignatureLabel"),class:["vpv-toolbar-btn",{"vpv-toolbar-btn-active":n.value}]},c.$attrs,{onClick:l}),{default:e.withCtx(()=>[e.renderSlot(c.$slots,"icon",{},()=>[e.createVNode(x,{name:"tool-signature"})])]),_:3},16,["aria-label","class"])]),_:3})]),default:e.withCtx(()=>[e.createVNode(re)]),_:3},8,["open"]))}}),ie=e.defineComponent({__name:"ToolAnnotationFreeText",props:{active:{type:Boolean,required:!0},activeModifiers:{}},emits:["update:active"],setup(t){const n=e.useModel(t,"active"),{t:o}=S(),a=e.useAttrs(),s=e.computed(()=>a["aria-disabled"]===!0),f=()=>{s.value||(n.value=!n.value)};return(l,d)=>l.$slots.default?e.renderSlot(l.$slots,"default",e.mergeProps({key:0},l.$attrs,{onClick:f})):(e.openBlock(),e.createBlock(B,{key:1},{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("annotationFreeTextTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(N,e.mergeProps({"aria-label":e.unref(o)("annotationFreeTextLabel"),class:["vpv-toolbar-btn",{"vpv-toolbar-btn-active":n.value}]},l.$attrs,{onClick:f}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"icon",{},()=>[e.createVNode(x,{name:"tool-free-text"})])]),_:3},16,["aria-label","class"])]),_:3}))}}),se=e.defineComponent({__name:"ToolAnnotationImage",emits:["change"],setup(t,{emit:n}){const{t:o}=S(),a=n,s=e.useAttrs(),f=e.computed(()=>s["aria-disabled"]===!0),l=()=>{if(f.value)return;const d=document.createElement("input");d.type="file",d.accept="image/*",d.onchange=c=>{const h=c.target.files?.[0];a("change",h)},d.click()};return(d,c)=>d.$slots.default?e.renderSlot(d.$slots,"default",e.mergeProps({key:0},d.$attrs,{onClick:l})):(e.openBlock(),e.createBlock(B,{key:1},{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("annotationImageTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(N,e.mergeProps({"aria-label":e.unref(o)("annotationImageLabel"),class:"vpv-toolbar-btn"},d.$attrs,{onClick:l}),{default:e.withCtx(()=>[e.renderSlot(d.$slots,"icon",{},()=>[e.createVNode(x,{name:"tool-image"})])]),_:3},16,["aria-label"])]),_:3}))}}),je="",ce={class:"vpv-annotation-tools-container"},de={key:0,class:"vpv-annotation-tools"},fe=e.defineComponent({__name:"VPdfAnnotationTools",props:{highlight:{type:[Object,Boolean],default:()=>!0},freeText:{type:[Object,Boolean],default:()=>!0},signature:{type:[Object,Boolean],default:()=>!1},image:{type:[Object,Boolean],default:()=>!0},instanceId:{type:Number,required:!0},onAnnotationCreated:{type:Function,default:void 0},onAnnotationUpdated:{type:Function,default:void 0},onAnnotationDeleted:{type:Function,default:void 0}},emits:["highlight","freeText","signature","image"],setup(t,{emit:n}){const o=t,a=n,s=e.ref(!1),f=r=>w(o.instanceId,r),l={highlight:new CustomEvent(f(_.highlight),{detail:{active:!1,colors:null}}),freeText:new CustomEvent(f(_.freeText),{detail:{active:!1,fontColors:null,fontSizes:null}}),signature:new CustomEvent(f(_.signature),{detail:{active:!1}}),image:new CustomEvent(f(_.image),{detail:{file:void 0}})},d=e.ref(!1),c=e.reactive({highlight:!1,freeText:!1,signature:!1}),h=e.computed({get:()=>c.highlight,set:r=>{c.highlight=r,r&&(c.freeText=!1,c.signature=!1),P()}}),O=e.computed({get:()=>c.freeText,set:r=>{r&&(c.highlight=!1,c.signature=!1),c.freeText=r,P()}}),V=e.computed({get:()=>c.signature,set:r=>{r&&(c.highlight=!1,c.freeText=!1),c.signature=r,P()}}),xe=e.computed(()=>o.highlight),Se=e.computed(()=>o.freeText),Ee=e.computed(()=>o.signature),Oe=e.computed(()=>o.image),Ve=r=>{d.value=r,r||(h.value=!1,O.value=!1,V.value=!1)},Pe=r=>{a("highlight",r),l.highlight.detail.active=r;let m=Object.entries(F).map(([i,g])=>({value:i,label:g}));typeof o.highlight=="object"&&o.highlight?.colors&&(m=o.highlight.colors.map(i=>typeof i=="string"?{value:M(i),label:i}:i)),l.highlight.detail.colors=m,window.dispatchEvent(l.highlight)},Te=r=>{a("freeText",r),l.freeText.detail.active=r;let m=Object.entries(Z).map(([i,g])=>({value:i,label:g}));typeof o.freeText=="object"&&o.freeText?.fontColors&&(m=o.freeText.fontColors.map(i=>typeof i=="string"?{value:M(i),label:i}:i)),l.freeText.detail.fontColors=m,typeof o.freeText=="object"&&o.freeText?.fontSizes?.length&&(l.freeText.detail.fontSizes=o.freeText.fontSizes),window.dispatchEvent(l.freeText)},$e=r=>{a("signature",r),l.signature.detail.active=r,window.dispatchEvent(l.signature)},Ie=r=>{c.highlight=!1,c.freeText=!1,c.signature=!1,a("image",r),l.image.detail.file=r,window.dispatchEvent(l.image)};function P(){Pe(h.value),Te(O.value),$e(V.value)}const W=w(o.instanceId,y.Rotate);e.onMounted(()=>{window.dispatchEvent(new CustomEvent(w(o.instanceId,y.AnnotationMounted))),window.addEventListener(W,Y)});function Y(r){const{firstPageRotation:m,rotation:i}=r.detail;s.value=i!==0}e.watch(s,r=>{r&&(c.highlight=!1,c.freeText=!1,c.signature=!1,P())});const I=r=>{const{id:m,...i}=r;return{...i,id:m?.startsWith(X)?null:m}};return e.watch(()=>o.onAnnotationCreated,(r,m,i)=>{if(!r)return;const g=E=>{r(I(E.detail))},k=w(o.instanceId,y.AnnotationCreated);window.addEventListener(k,g),i(()=>{window.removeEventListener(k,g)})},{immediate:!0}),e.watch(()=>o.onAnnotationUpdated,(r,m,i)=>{if(!r)return;const g=E=>{r(I(E.detail))},k=w(o.instanceId,y.AnnotationUpdated);window.addEventListener(k,g),i(()=>{window.removeEventListener(k,g)})},{immediate:!0}),e.watch(()=>o.onAnnotationDeleted,(r,m,i)=>{if(!r)return;const g=E=>{r(I(E.detail))},k=w(o.instanceId,y.AnnotationDeleted);window.addEventListener(k,g),i(()=>{window.removeEventListener(k,g)})},{immediate:!0}),e.onUnmounted(()=>{window.removeEventListener(W,Y)}),(r,m)=>(e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(oe,{onToggle:Ve}),e.createVNode(e.Transition,{name:"slide"},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createElementBlock("div",de,[xe.value?(e.openBlock(),e.createBlock(ne,{key:0,active:h.value,"onUpdate:active":m[0]||(m[0]=i=>h.value=i),"aria-disabled":s.value},e.createSlots({_:2},[typeof o.highlight=="object"&&o.highlight.icon?{name:"icon",fn:e.withCtx(()=>[typeof o.highlight=="object"&&o.highlight.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.highlight.icon),{key:0})):e.createCommentVNode("",!0)]),key:"0"}:typeof o.highlight=="object"&&o.highlight.component?{name:"default",fn:e.withCtx(({onClick:i})=>[typeof o.highlight=="object"&&o.highlight.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.highlight.component),{key:0,onClick:i},null,8,["onClick"])):e.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["active","aria-disabled"])):e.createCommentVNode("",!0),Se.value?(e.openBlock(),e.createBlock(ie,{key:1,active:O.value,"onUpdate:active":m[1]||(m[1]=i=>O.value=i),"aria-disabled":s.value},e.createSlots({_:2},[typeof o.freeText=="object"&&o.freeText.icon?{name:"icon",fn:e.withCtx(()=>[typeof o.freeText=="object"&&o.freeText.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.freeText.icon),{key:0})):e.createCommentVNode("",!0),typeof o.freeText=="object"&&o.freeText.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.freeText.icon),{key:1})):e.createCommentVNode("",!0)]),key:"0"}:typeof o.freeText=="object"&&o.freeText.component?{name:"default",fn:e.withCtx(({onClick:i})=>[typeof o.freeText=="object"&&o.freeText.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.freeText.component),{key:0,onClick:i},null,8,["onClick"])):e.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["active","aria-disabled"])):e.createCommentVNode("",!0),Oe.value?(e.openBlock(),e.createBlock(se,{key:2,onChange:Ie,"aria-disabled":s.value},e.createSlots({_:2},[typeof o.image=="object"&&o.image?{name:"icon",fn:e.withCtx(()=>[typeof o.image=="object"&&o.image.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.image.icon),{key:0})):e.createCommentVNode("",!0)]),key:"0"}:typeof o.image=="object"&&o.image.component?{name:"default",fn:e.withCtx(({onClick:i})=>[typeof o.image=="object"&&o.image.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.image.component),{key:0,onClick:i},null,8,["onClick"])):e.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["aria-disabled"])):e.createCommentVNode("",!0),Ee.value?(e.openBlock(),e.createBlock(le,{key:3,active:V.value,"onUpdate:active":m[2]||(m[2]=i=>V.value=i),"aria-disabled":s.value},e.createSlots({_:2},[typeof o.signature=="object"&&o.signature.icon?{name:"icon",fn:e.withCtx(()=>[typeof o.signature=="object"&&o.signature.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.signature.icon),{key:0})):e.createCommentVNode("",!0)]),key:"0"}:typeof o.signature=="object"&&o.signature.component?{name:"default",fn:e.withCtx(({onClick:i})=>[typeof o.signature=="object"&&o.signature.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.signature.component),{key:0,onClick:i},null,8,["onClick"])):e.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["active","aria-disabled"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})]))}}),Me="",z=$(fe,[["__scopeId","data-v-f0bb4566"]]),me=(t={})=>{const{highlight:n,freeText:o,image:a,...s}=t;return{name:"annotation",setup(f){const{componentInstance:l,shared:d}=f,c=l?.uid??0;f.toolbar.addItem({id:K.ANNOTATIONS,toolbarDirection:"left",component:e.h(z,{highlight:n,freeText:o,image:a,instanceId:c,...s})});const h=l?.appContext.app;d.ui?h.provide(C,d.ui):console.warn("VPdfAnnotationPlugin - No UI context found in plugin context"),d.localization?.value?h.provide(j,d.localization):console.warn("VPdfAnnotationPlugin - No localization found in plugin context")}}},pe={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function v(t,n){return e.openBlock(),e.createElementBlock("svg",pe,[...n[0]||(n[0]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.25",d:"M10 18.334a8.333 8.333 0 1 0 0-16.667 8.333 8.333 0 0 0 0 16.667"},null,-1),e.createElementVNode("path",{stroke:"currentColor","stroke-linejoin":"round","stroke-width":"1.25",d:"m5.417 17.084 1.171-4.394c.238-.892.357-1.338.694-1.597s.798-.259 1.722-.259h1.992c.923 0 1.385 0 1.722.259.337.258.456.705.693 1.597l1.172 4.394"},null,-1),e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.25",d:"M7.917 10.834 9.23 7.8c.327-.756.491-1.134.769-1.134s.441.378.77 1.134l1.313 3.033"},null,-1)])])}const ge=Object.freeze(Object.defineProperty({__proto__:null,render:v,default:{render:v}},Symbol.toStringTag,{value:"Module"})),he={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function R(t,n){return e.openBlock(),e.createElementBlock("svg",he,[...n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M18.125 9.688a7.82 7.82 0 0 1-7.812 7.812H3.75a1.25 1.25 0 0 1-1.25-1.25V9.688a7.812 7.812 0 0 1 15.625 0m-1.25 0a6.563 6.563 0 0 0-13.125 0v6.562h6.563a6.57 6.57 0 0 0 6.562-6.562"},null,-1),e.createElementVNode("path",{fill:"currentColor",d:"M12.5 10a.624.624 0 0 1-.625.625h-1.25v1.25a.624.624 0 1 1-1.25 0v-1.25h-1.25a.625.625 0 1 1 0-1.25h1.25v-1.25a.625.625 0 0 1 1.25 0v1.25h1.25A.625.625 0 0 1 12.5 10"},null,-1)])])}const ue=Object.freeze(Object.defineProperty({__proto__:null,render:R,default:{render:R}},Symbol.toStringTag,{value:"Module"})),be={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function G(t,n){return e.openBlock(),e.createElementBlock("svg",be,[...n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M11.458 13.75a.624.624 0 1 0 0-1.25h-.625v-5h2.5v.625a.625.625 0 0 0 1.25 0v-1.25a.625.625 0 0 0-.625-.625h-7.5a.625.625 0 0 0-.625.625v1.25a.625.625 0 0 0 1.25 0V7.5h2.5v5h-.625a.625.625 0 1 0 0 1.25z"},null,-1),e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M3.125 3.75c0-.115.093-.208.208-.208h13.334c.115 0 .208.093.208.208v2.917a.625.625 0 1 0 1.25 0V3.75c0-.805-.653-1.458-1.458-1.458H3.333c-.805 0-1.458.653-1.458 1.458v3.334a.625.625 0 1 0 1.25 0zm0 12.5c0 .115.093.209.208.209h13.334a.21.21 0 0 0 .208-.209v-2.916a.625.625 0 1 1 1.25 0v2.916c0 .806-.653 1.459-1.458 1.459H3.333a1.46 1.46 0 0 1-1.458-1.459v-3.333a.625.625 0 1 1 1.25 0zM2.5 8.542c.345 0 .625.28.625.625v1.667a.625.625 0 0 1-1.25 0V9.167c0-.345.28-.625.625-.625m15.625.625a.625.625 0 1 0-1.25 0v1.667a.625.625 0 0 0 1.25 0z","clip-rule":"evenodd"},null,-1)])])}const ke=Object.freeze(Object.defineProperty({__proto__:null,render:G,default:{render:G}},Symbol.toStringTag,{value:"Module"})),_e={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function H(t,n){return e.openBlock(),e.createElementBlock("svg",_e,[...n[0]||(n[0]=[e.createElementVNode("g",{"clip-path":"url(#a)"},[e.createElementVNode("path",{fill:"currentColor",d:"M19.818 8.308a.625.625 0 0 0-.885 0L15 12.242 8.384 5.625l3.934-3.932a.626.626 0 0 0-.885-.885L7.5 4.742a1.25 1.25 0 0 0-.22 1.47L5.625 7.866a1.25 1.25 0 0 0 0 1.767l.367.366-4.559 4.558a.625.625 0 0 0 .245 1.035l5.625 1.875a.62.62 0 0 0 .437-.015.6.6 0 0 0 .203-.136l2.682-2.683.367.366a1.25 1.25 0 0 0 1.767 0l1.656-1.654a1.25 1.25 0 0 0 1.469-.22l3.934-3.933a.626.626 0 0 0 0-.885M7.332 16.16l-4.297-1.433 3.84-3.843 2.867 2.866zm4.543-2.043L6.51 8.75l1.616-1.616 5.367 5.366z"})],-1),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:"a"},[e.createElementVNode("path",{fill:"currentColor",d:"M0 0h20v20H0z"})])],-1)])])}const we=Object.freeze(Object.defineProperty({__proto__:null,render:H,default:{render:H}},Symbol.toStringTag,{value:"Module"})),Ce={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function q(t,n){return e.openBlock(),e.createElementBlock("svg",Ce,[...n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M16.875 3.125H3.125a1.25 1.25 0 0 0-1.25 1.25v11.25a1.25 1.25 0 0 0 1.25 1.25h13.75a1.25 1.25 0 0 0 1.25-1.25V4.375a1.25 1.25 0 0 0-1.25-1.25m0 1.25v8.027l-2.037-2.036a1.25 1.25 0 0 0-1.768 0l-1.562 1.563L8.07 8.49a1.25 1.25 0 0 0-1.767 0L3.125 11.67V4.376zm-13.75 9.063 4.063-4.063 6.25 6.25H3.124zm13.75 2.187h-1.67l-2.812-2.812 1.563-1.563 2.919 2.92zM11.25 7.813a.938.938 0 1 1 1.875 0 .938.938 0 0 1-1.875 0"},null,-1)])])}const ye=Object.freeze(Object.defineProperty({__proto__:null,render:q,default:{render:q}},Symbol.toStringTag,{value:"Module"})),Be={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function U(t,n){return e.openBlock(),e.createElementBlock("svg",Be,[...n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M18.125 13.125H4.99q.313-.615.625-1.259c1.172.13 2.546-.685 4.114-2.432.391 1.051 1.13 2.416 2.39 2.441.707.014 1.414-.406 2.142-1.279.53.634 1.623 1.279 3.865 1.279a.625.625 0 1 0 0-1.25c-2.377 0-3.08-.816-3.125-1.259a.6.6 0 0 0-.426-.605.636.636 0 0 0-.723.273c-.943 1.448-1.514 1.596-1.713 1.591-.645-.012-1.301-1.525-1.526-2.61a.625.625 0 0 0-1.1-.264c-1.579 1.98-2.637 2.646-3.295 2.818.663-1.474 1.158-2.768 1.475-3.858.533-1.831.572-3.112.118-3.914-.234-.42-.73-.922-1.723-.922-1.255 0-2.245 1.186-2.716 3.254-.28 1.227-.327 2.594-.127 3.75.2 1.155.615 1.996 1.218 2.495a72 72 0 0 1-.877 1.751h-1.71a.625.625 0 1 0 0 1.25h1.048c-.884 1.64-1.572 2.784-1.583 2.803a.625.625 0 1 0 1.071.644c.012-.02.88-1.468 1.93-3.447h13.784a.625.625 0 1 0 0-1.25M4.59 5.407c.311-1.365.914-2.282 1.498-2.282.416 0 .555.145.635.287.235.416.51 1.89-1.692 6.749-.645-.881-.865-2.895-.44-4.754"},null,-1)])])}const Ne=Object.freeze(Object.defineProperty({__proto__:null,render:U,default:{render:U}},Symbol.toStringTag,{value:"Module"}));u.VPdfAnnotationTools=z,u.default=me,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode('.vp-text-xl[data-v-fbd5714e]{font-size:1.25rem;line-height:1.75rem}.vpv-toolbar-btn.vpv-toolbar-btn-active[data-v-da575fac],.vpv-toolbar-btn[data-v-da575fac]:hover{background-color:var(--vpv-primary-color);color:#fff}.vpv-annotation-editor-layer{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none}.vpv-annotation-editor-layer *{pointer-events:auto}.vpv-annotation-editor-layer .vpv-annotation-editor{z-index:calc(var(--vpv-base-z-index) * 4)}.vpv-annotation-editor-layer.highlight-mode{cursor:text}.vpv-annotation-editor-layer.highlight-mode .vpv-annotation-editor{pointer-events:none}.vpv-annotation-editor-layer.highlight-mode .vpv-annotation-editor .vpv-annotation-editor__clip-path{cursor:pointer;position:absolute;inset:0;pointer-events:auto}.vpv-annotation-editor-layer:not(.highlight-mode) .vpv-annotation-editor.vpv-annotation-editor__highlight{pointer-events:none}.vpv-annotation-editor-layer:not(.highlight-mode) .vpv-annotation-editor.vpv-annotation-editor__highlight .vpv-annotation-editor__clip-path{pointer-events:none}.vpv-annotation-editor-layer.freetext-mode>:not(.vpv-annotation-editor__free-text){user-select:none;pointer-events:none}.vpv-annotation-editor-layer:not(.freetext-mode) .vpv-annotation-editor__free-text{pointer-events:none}.vpv-annotation-editor-layer .vpv-annotation-editor__free-text{position:absolute;user-select:none;padding:calc(var(--vpv-annotation-free-text__padding, 2px) * var(--scale-factor));cursor:auto}.vpv-annotation-editor-layer .vpv-annotation-editor__free-text.draggable{cursor:move}.vpv-annotation-editor-layer .vpv-annotation-editor__free-text--selected,.vpv-annotation-editor-layer .vpv-annotation-editor__free-text:hover{outline:1px solid #0082ff}.vpv-annotation-editor-layer .vpv-annotation-editor__free-text [role=textbox]{outline:none!important;text-align:start;font:10px sans-serif;line-height:var(--vpv-annotation-free-text__line-height);width:auto;height:auto;white-space:pre-wrap;word-wrap:break-word}.vpv-annotation-editor-layer .vpv-annotation-editor__free-text--temp{min-width:100px;min-height:calc(20px * var(--scale-factor));border:1px dashed #007bff;background-color:#ffffffe6;color:#000;cursor:text}.vpv-annotation-editor-layer .vpv-annotation-editor__free-text--temp>[role=textbox]{outline:none;font-size:calc(16px * var(--scale-factor));font-family:sans-serif;min-height:calc(16px * var(--scale-factor));white-space:nowrap}.vpv-annotation-highlight__color-picker-wrapper{padding-left:4px;padding-right:4px;padding-bottom:4px;text-align:left}.vpv-annotation-highlight__color-picker-wrapper>p{margin-bottom:.75rem}.vpv-canvas-layer>.vpv-highlight:is(svg){position:absolute;mix-blend-mode:multiply}.vpv-canvas-layer>.vpv-highlight:is(svg):not(.free){fill-rule:evenodd}.vpv-canvas-layer>.vpv-highlight-outline:is(svg){position:absolute;mix-blend-mode:normal;fill-rule:evenodd;fill:none}.vpv-canvas-layer>.vpv-highlight-outline:is(svg).hovered,.vpv-canvas-layer>.vpv-highlight-outline:is(svg).selected{stroke-width:var(--vpv-annotation-highlight__outline-width)}.vpv-canvas-layer>.vpv-highlight-outline:is(svg).hovered{stroke:var(--vpv-annotation-highlight__outline-hover-color)}.vpv-canvas-layer>.vpv-highlight-outline:is(svg).selected{stroke:var(--vpv-annotation-highlight__outline-selected-color)}.vpv-resizers{position:absolute;inset:0;pointer-events:none}.vpv-resizers .vpv-resizer{position:absolute;width:var(--vpv-annotation-outline-resizer-size);height:var(--vpv-annotation-outline-resizer-size);background:white;border:1px solid var(--vpv-annotation-outline-resizer-border-color);border-radius:50%;pointer-events:auto;cursor:pointer;z-index:calc(var(--vpv-base-z-index) * 9999);transition:opacity .2s ease,visibility .2s ease}.vpv-resizers .vpv-resizer:hover,.vpv-resizers .vpv-resizer:focus{transform:scale(1.5)}.vpv-resizers .vpv-resizer--top-left{top:calc(var(--vpv-annotation-outline-resizer-size) * -1.25);left:calc(var(--vpv-annotation-outline-resizer-size) * -1.25);cursor:nwse-resize}.vpv-resizers .vpv-resizer--top-right{top:calc(var(--vpv-annotation-outline-resizer-size) * -1.25);right:calc(var(--vpv-annotation-outline-resizer-size) * -1.25);cursor:nesw-resize}.vpv-resizers .vpv-resizer--bottom-left{bottom:calc(var(--vpv-annotation-outline-resizer-size) * -1.25);left:calc(var(--vpv-annotation-outline-resizer-size) * -1.25);cursor:nesw-resize}.vpv-resizers .vpv-resizer--bottom-right{bottom:calc(var(--vpv-annotation-outline-resizer-size) * -1.25);right:calc(var(--vpv-annotation-outline-resizer-size) * -1.25);cursor:nwse-resize}.vpv-page[data-main-rotation="90"] .vpv-resizer--top-left,.vpv-page[data-main-rotation="270"] .vpv-resizer--top-left{cursor:nesw-resize}.vpv-page[data-main-rotation="90"] .vpv-resizer--top-right,.vpv-page[data-main-rotation="270"] .vpv-resizer--top-right,.vpv-page[data-main-rotation="90"] .vpv-resizer--bottom-left,.vpv-page[data-main-rotation="270"] .vpv-resizer--bottom-left{cursor:nwse-resize}.vpv-page[data-main-rotation="90"] .vpv-resizer--bottom-right,.vpv-page[data-main-rotation="270"] .vpv-resizer--bottom-right{cursor:nesw-resize}.vpv-resizer--dark{background:#80ebff;border-color:#2b2a33}.vpv-resizer--dark:focus{outline-color:#80ebff}.vpv-annotation-editor__image{position:absolute;cursor:pointer;touch-action:none;user-select:none;will-change:transform}.vpv-annotation-editor__image.hovered,.vpv-annotation-editor__image:hover{outline-width:var(--vpv-annotation-outline-width);outline-style:solid;outline-color:var(--vpv-annotation-outline-hovered-color)}.vpv-annotation-editor__image.selected{outline-width:var(--vpv-annotation-outline-width);outline-style:solid;outline-offset:var(--vpv-annotation-outline-selected-offset);outline-color:var(--vpv-annotation-outline-selected-color);cursor:move}.vpv-annotation-editor__image canvas{position:absolute;width:100%;height:100%;margin:0;top:0;left:0}.vpv-annotation-editor__image.dragging canvas{user-drag:none;-webkit-user-drag:none;pointer-events:none;touch-action:none}.vpv-page:not([data-main-rotation="0"]) .vpv-annotation-editor__image:hover{outline:none}.vpv-annotation-tools-container[data-v-9db07deb]{padding-top:.5rem;padding-bottom:.5rem;border-top:1px solid #c6ccd2;max-width:min-content;margin:.5rem auto}.vpv-annotation-tools-container[data-v-9db07deb] .vpv-toolbar-btn{margin-bottom:.25rem}.slide-enter-active[data-v-9db07deb],.slide-leave-active[data-v-9db07deb]{transition:all .3s ease-out}.slide-enter-from[data-v-9db07deb],.slide-leave-to[data-v-9db07deb]{opacity:0}.slide-enter-from[data-v-9db07deb],.slide-leave-to[data-v-9db07deb]{transform:translateY(-20px)}')),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
(function(u,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(u=typeof globalThis<"u"?globalThis:u||self,e(u["@vue-pdf-viewer/annotation"]={},u.Vue))})(this,function(u,e){"use strict";var _;(function(t){t.highlight="vpv:annotation:highlight",t.freeText="vpv:annotation:freeText",t.signature="vpv:annotation:signature",t.image="vpv:annotation:image",t.underline="vpv:annotation:underline",t.strikeout="vpv:annotation:strikeout"})(_||(_={}));var T;(function(t){t.AnnotationCreated="vpv:annotation:created",t.AnnotationUpdated="vpv:annotation:updated",t.AnnotationDeleted="vpv:annotation:deleted",t.AnnotationMounted="vpv:annotation:mounted",t.Rotate="vpv:rotate"})(T||(T={}));var b;(function(t){t.Purple="#CAAAFF",t.Cyan="#65EDE9",t.Red="#FFACAC",t.Orange="#FFBD82",t.Yellow="#FCE244",t.Green="#A0F751"})(b||(b={}));var p;(function(t){t.Black="#000000",t.DarkGray="#444444",t.Gray="#696969",t.LightGray="#9C9C9C",t.LightestGray="#CDCDCD",t.White="#FFFFFF",t.Purple="#7862FF",t.Blue="#1777FF",t.Red="#F66365",t.Orange="#F67E63",t.Yellow="#F5C463",t.Green="#48BB77"})(p||(p={}));var D;(function(t){t[t.Text=1]="Text",t[t.Link=2]="Link",t[t.FreeText=3]="FreeText",t[t.Line=4]="Line",t[t.Square=5]="Square",t[t.Circle=6]="Circle",t[t.Polygon=7]="Polygon",t[t.Polyline=8]="Polyline",t[t.Highlight=9]="Highlight",t[t.Underline=10]="Underline",t[t.Squiggly=11]="Squiggly",t[t.StrikeOut=12]="StrikeOut",t[t.Stamp=13]="Stamp",t[t.Caret=14]="Caret",t[t.Ink=15]="Ink",t[t.Popup=16]="Popup",t[t.FileAttachment=17]="FileAttachment",t[t.Sound=18]="Sound",t[t.Movie=19]="Movie",t[t.Widget=20]="Widget",t[t.Screen=21]="Screen",t[t.PrinterMark=22]="PrinterMark",t[t.TrapNet=23]="TrapNet",t[t.Watermark=24]="Watermark",t[t.ThreeD=25]="ThreeD",t[t.Redact=26]="Redact"})(D||(D={}));var L;(function(t){t[t.INVISIBLE=1]="INVISIBLE",t[t.HIDDEN=2]="HIDDEN",t[t.PRINT=4]="PRINT",t[t.NOZOOM=8]="NOZOOM",t[t.NOROTATE=16]="NOROTATE",t[t.NOVIEW=32]="NOVIEW",t[t.READONLY=64]="READONLY",t[t.LOCKED=128]="LOCKED",t[t.TOGGLENOVIEW=256]="TOGGLENOVIEW",t[t.LOCKEDCONTENTS=512]="LOCKEDCONTENTS"})(L||(L={}));const K={ANNOTATIONS:"annotations"},C=Symbol("VPV Shared UIs"),j=Symbol("VPV Current Localization"),y=T,F={[b.Purple]:"Purple",[b.Cyan]:"Cyan",[b.Red]:"Red",[b.Orange]:"Orange",[b.Yellow]:"Yellow",[b.Green]:"Green"},Z={[p.Black]:"Black",[p.DarkGray]:"Dark Gray",[p.Gray]:"Gray",[p.LightGray]:"Light Gray",[p.LightestGray]:"Lightest Gray",[p.White]:"White",[p.Purple]:"Purple",[p.Blue]:"Blue",[p.Red]:"Red",[p.Orange]:"Orange",[p.Yellow]:"Yellow",[p.Green]:"Green"},X="pdfjs_internal_editor_",w=(t,n)=>`${t}-${n}`,J={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},M=t=>t.startsWith("#")||t.startsWith("0x")?t:J[t]||t,B=e.defineComponent({__name:"AppTooltip",setup(t){const n=e.inject(C),o=e.computed(()=>n?.AppTooltip);return(a,s)=>o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),e.normalizeProps(e.mergeProps({key:0},a.$attrs)),e.createSlots({default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:2},[e.renderList(a.$slots,(f,l)=>({name:l,fn:e.withCtx(()=>[e.renderSlot(a.$slots,l)])}))]),1040)):(e.openBlock(),e.createElementBlock("div",e.normalizeProps(e.mergeProps({key:1},a.$attrs)),[e.renderSlot(a.$slots,"default")],16))}}),N=e.defineComponent({__name:"AppButton",setup(t){const n=e.inject(C),o=e.computed(()=>n?.AppButton);return(a,s)=>o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),e.normalizeProps(e.mergeProps({key:0},a.$attrs)),{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16)):(e.openBlock(),e.createElementBlock("button",e.normalizeProps(e.mergeProps({key:1},a.$attrs)),[e.renderSlot(a.$slots,"default")],16))}}),Q=(t,n)=>{const o=t[n];return o?typeof o=="function"?o():Promise.resolve(o):new Promise((a,s)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(s.bind(null,new Error("Unknown variable dynamic import: "+n)))})},ee=e.defineComponent({__name:"Icon",props:{name:{}},setup(t){const n=t,o=e.defineAsyncComponent({loader:()=>Q(Object.assign({"../assets/icons/annotations.svg":()=>Promise.resolve().then(()=>ge),"../assets/icons/tool-comment.svg":()=>Promise.resolve().then(()=>ue),"../assets/icons/tool-free-text.svg":()=>Promise.resolve().then(()=>ke),"../assets/icons/tool-highlight.svg":()=>Promise.resolve().then(()=>we),"../assets/icons/tool-image.svg":()=>Promise.resolve().then(()=>ye),"../assets/icons/tool-signature.svg":()=>Promise.resolve().then(()=>Ne)}),`../assets/icons/${n.name}.svg`)});return(a,s)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(o)),{class:"vp-text-xl"}))}}),De="",$=(t,n)=>{const o=t.__vccOpts||t;for(const[a,s]of n)o[a]=s;return o},x=$(ee,[["__scopeId","data-v-fbd5714e"]]),S=()=>{const t=e.inject(j,e.computed(()=>({})));return{t:e.computed(()=>o=>{const a=o.split(".").pop()||o;return t.value&&a in t.value?t.value[a]:(console.warn(`useLocalization - Translation not found for key: ${o}`),o)}).value,currentLocale:e.computed(()=>t.value)}},te=e.defineComponent({__name:"ToolAnnotation",emits:["toggle"],setup(t,{emit:n}){const{t:o}=S(),a=n,s=e.ref(!1),f=()=>{s.value=!s.value,a("toggle",s.value)};return(l,d)=>l.$slots.default?e.renderSlot(l.$slots,"default",{key:0,onClick:f},void 0,!0):(e.openBlock(),e.createBlock(B,{key:1},{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(s.value?e.unref(o)("annotationToggleHideTooltip"):e.unref(o)("annotationToggleShowTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(N,{"aria-label":s.value?e.unref(o)("annotationToggleHideTooltip"):e.unref(o)("annotationToggleShowTooltip"),class:e.normalizeClass(["vpv-toolbar-btn",{"vpv-toolbar-btn-active":s.value}]),onClick:f},{default:e.withCtx(()=>[e.createVNode(x,{name:"annotations",class:"vp-text-xl"})]),_:1},8,["aria-label","class"])]),_:1}))}}),Le="",oe=$(te,[["__scopeId","data-v-da575fac"]]),ne=e.defineComponent({__name:"ToolAnnotationHighlight",props:{active:{type:Boolean,required:!0},activeModifiers:{}},emits:["update:active"],setup(t){const n=e.useModel(t,"active"),{t:o}=S(),a=e.useAttrs(),s=e.computed(()=>a["aria-disabled"]===!0),f=()=>{s.value||(n.value=!n.value)};return(l,d)=>l.$slots.default?e.renderSlot(l.$slots,"default",e.mergeProps({key:0},l.$attrs,{onClick:f})):(e.openBlock(),e.createBlock(B,{key:1},{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("annotationHighlightTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(N,e.mergeProps({"aria-label":e.unref(o)("annotationHighlightLabel"),class:["vpv-toolbar-btn",{"vpv-toolbar-btn-active":n.value}]},l.$attrs,{onClick:f}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"icon",{},()=>[e.createVNode(x,{name:"tool-highlight"})])]),_:3},16,["aria-label","class"])]),_:3}))}}),ae=e.defineComponent({__name:"AppPopover",setup(t){const n=e.inject(C),o=e.computed(()=>n?.AppPopover);return(a,s)=>o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),e.normalizeProps(e.mergeProps({key:0},a.$attrs)),{trigger:e.withCtx(()=>[e.renderSlot(a.$slots,"trigger")]),default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},16)):(e.openBlock(),e.createElementBlock("button",e.normalizeProps(e.mergeProps({key:1},a.$attrs)),[e.renderSlot(a.$slots,"default")],16))}}),re=e.defineComponent({__name:"AppSignatures",setup(t){const n=e.inject(C),o=e.computed(()=>n?.AppSignatures);return(a,s)=>o.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.value),e.normalizeProps(e.mergeProps({key:0},a.$attrs)),null,16)):e.createCommentVNode("",!0)}}),le=e.defineComponent({__name:"ToolAnnotationSignature",props:{active:{type:Boolean,required:!0},activeModifiers:{}},emits:["update:active"],setup(t){const n=e.useModel(t,"active"),{t:o}=S(),a=e.useAttrs(),s=e.ref(!1),f=e.computed(()=>a["aria-disabled"]===!0),l=()=>{f.value||(!n.value&&!s.value&&(s.value=!0),n.value=!n.value)},d=c=>{s.value=!1};return(c,h)=>c.$slots.default?e.renderSlot(c.$slots,"default",e.mergeProps({key:0},c.$attrs,{onClick:l})):(e.openBlock(),e.createBlock(ae,{key:1,open:s.value,side:"right",sideOffset:10,class:"vpv-annotation-signatures__popover",onInteractOutside:d},{trigger:e.withCtx(()=>[e.createVNode(B,null,{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("annotationSignatureTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(N,e.mergeProps({"aria-label":e.unref(o)("annotationSignatureLabel"),class:["vpv-toolbar-btn",{"vpv-toolbar-btn-active":n.value}]},c.$attrs,{onClick:l}),{default:e.withCtx(()=>[e.renderSlot(c.$slots,"icon",{},()=>[e.createVNode(x,{name:"tool-signature"})])]),_:3},16,["aria-label","class"])]),_:3})]),default:e.withCtx(()=>[e.createVNode(re)]),_:3},8,["open"]))}}),ie=e.defineComponent({__name:"ToolAnnotationFreeText",props:{active:{type:Boolean,required:!0},activeModifiers:{}},emits:["update:active"],setup(t){const n=e.useModel(t,"active"),{t:o}=S(),a=e.useAttrs(),s=e.computed(()=>a["aria-disabled"]===!0),f=()=>{s.value||(n.value=!n.value)};return(l,d)=>l.$slots.default?e.renderSlot(l.$slots,"default",e.mergeProps({key:0},l.$attrs,{onClick:f})):(e.openBlock(),e.createBlock(B,{key:1},{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("annotationFreeTextTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(N,e.mergeProps({"aria-label":e.unref(o)("annotationFreeTextLabel"),class:["vpv-toolbar-btn",{"vpv-toolbar-btn-active":n.value}]},l.$attrs,{onClick:f}),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"icon",{},()=>[e.createVNode(x,{name:"tool-free-text"})])]),_:3},16,["aria-label","class"])]),_:3}))}}),se=e.defineComponent({__name:"ToolAnnotationImage",emits:["change"],setup(t,{emit:n}){const{t:o}=S(),a=n,s=e.useAttrs(),f=e.computed(()=>s["aria-disabled"]===!0),l=()=>{if(f.value)return;const d=document.createElement("input");d.type="file",d.accept="image/*",d.onchange=c=>{const h=c.target.files?.[0];a("change",h)},d.click()};return(d,c)=>d.$slots.default?e.renderSlot(d.$slots,"default",e.mergeProps({key:0},d.$attrs,{onClick:l})):(e.openBlock(),e.createBlock(B,{key:1},{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(o)("annotationImageTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(N,e.mergeProps({"aria-label":e.unref(o)("annotationImageLabel"),class:"vpv-toolbar-btn"},d.$attrs,{onClick:l}),{default:e.withCtx(()=>[e.renderSlot(d.$slots,"icon",{},()=>[e.createVNode(x,{name:"tool-image"})])]),_:3},16,["aria-label"])]),_:3}))}}),je="",ce={class:"vpv-annotation-tools-container"},de={key:0,class:"vpv-annotation-tools"},fe=e.defineComponent({__name:"VPdfAnnotationTools",props:{highlight:{type:[Object,Boolean],default:()=>!0},freeText:{type:[Object,Boolean],default:()=>!0},signature:{type:[Object,Boolean],default:()=>!1},image:{type:[Object,Boolean],default:()=>!0},instanceId:{type:Number,required:!0},onAnnotationCreated:{type:Function,default:void 0},onAnnotationUpdated:{type:Function,default:void 0},onAnnotationDeleted:{type:Function,default:void 0}},emits:["highlight","freeText","signature","image"],setup(t,{emit:n}){const o=t,a=n,s=e.ref(!1),f=r=>w(o.instanceId,r),l={highlight:new CustomEvent(f(_.highlight),{detail:{active:!1,colors:null}}),freeText:new CustomEvent(f(_.freeText),{detail:{active:!1,fontColors:null,fontSizes:null}}),signature:new CustomEvent(f(_.signature),{detail:{active:!1}}),image:new CustomEvent(f(_.image),{detail:{file:void 0}})},d=e.ref(!1),c=e.reactive({highlight:!1,freeText:!1,signature:!1}),h=e.computed({get:()=>c.highlight,set:r=>{c.highlight=r,r&&(c.freeText=!1,c.signature=!1),P()}}),O=e.computed({get:()=>c.freeText,set:r=>{r&&(c.highlight=!1,c.signature=!1),c.freeText=r,P()}}),V=e.computed({get:()=>c.signature,set:r=>{r&&(c.highlight=!1,c.freeText=!1),c.signature=r,P()}}),xe=e.computed(()=>o.highlight),Se=e.computed(()=>o.freeText),Ee=e.computed(()=>o.signature),Oe=e.computed(()=>o.image),Ve=r=>{d.value=r,r||(h.value=!1,O.value=!1,V.value=!1)},Pe=r=>{a("highlight",r),l.highlight.detail.active=r;let m=Object.entries(F).map(([i,g])=>({value:i,label:g}));typeof o.highlight=="object"&&o.highlight?.colors&&(m=o.highlight.colors.map(i=>typeof i=="string"?{value:M(i),label:i}:i)),l.highlight.detail.colors=m,window.dispatchEvent(l.highlight)},Te=r=>{a("freeText",r),l.freeText.detail.active=r;let m=Object.entries(Z).map(([i,g])=>({value:i,label:g}));typeof o.freeText=="object"&&o.freeText?.fontColors&&(m=o.freeText.fontColors.map(i=>typeof i=="string"?{value:M(i),label:i}:i)),l.freeText.detail.fontColors=m,typeof o.freeText=="object"&&o.freeText?.fontSizes?.length&&(l.freeText.detail.fontSizes=o.freeText.fontSizes),window.dispatchEvent(l.freeText)},$e=r=>{a("signature",r),l.signature.detail.active=r,window.dispatchEvent(l.signature)},Ie=r=>{c.highlight=!1,c.freeText=!1,c.signature=!1,a("image",r),l.image.detail.file=r,window.dispatchEvent(l.image)};function P(){Pe(h.value),Te(O.value),$e(V.value)}const W=w(o.instanceId,y.Rotate);e.onMounted(()=>{window.dispatchEvent(new CustomEvent(w(o.instanceId,y.AnnotationMounted))),window.addEventListener(W,Y)});function Y(r){const{firstPageRotation:m,rotation:i}=r.detail;s.value=i!==0}e.watch(s,r=>{r&&(c.highlight=!1,c.freeText=!1,c.signature=!1,P())});const I=r=>{const{id:m,...i}=r;return{...i,id:m?.startsWith(X)?null:m}};return e.watch(()=>o.onAnnotationCreated,(r,m,i)=>{if(!r)return;const g=E=>{r(I(E.detail))},k=w(o.instanceId,y.AnnotationCreated);window.addEventListener(k,g),i(()=>{window.removeEventListener(k,g)})},{immediate:!0}),e.watch(()=>o.onAnnotationUpdated,(r,m,i)=>{if(!r)return;const g=E=>{r(I(E.detail))},k=w(o.instanceId,y.AnnotationUpdated);window.addEventListener(k,g),i(()=>{window.removeEventListener(k,g)})},{immediate:!0}),e.watch(()=>o.onAnnotationDeleted,(r,m,i)=>{if(!r)return;const g=E=>{r(I(E.detail))},k=w(o.instanceId,y.AnnotationDeleted);window.addEventListener(k,g),i(()=>{window.removeEventListener(k,g)})},{immediate:!0}),e.onUnmounted(()=>{window.removeEventListener(W,Y)}),(r,m)=>(e.openBlock(),e.createElementBlock("div",ce,[e.createVNode(oe,{onToggle:Ve}),e.createVNode(e.Transition,{name:"slide"},{default:e.withCtx(()=>[d.value?(e.openBlock(),e.createElementBlock("div",de,[xe.value?(e.openBlock(),e.createBlock(ne,{key:0,active:h.value,"onUpdate:active":m[0]||(m[0]=i=>h.value=i),"aria-disabled":s.value},e.createSlots({_:2},[typeof o.highlight=="object"&&o.highlight.icon?{name:"icon",fn:e.withCtx(()=>[typeof o.highlight=="object"&&o.highlight.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.highlight.icon),{key:0})):e.createCommentVNode("",!0)]),key:"0"}:typeof o.highlight=="object"&&o.highlight.component?{name:"default",fn:e.withCtx(({onClick:i})=>[typeof o.highlight=="object"&&o.highlight.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.highlight.component),{key:0,onClick:i},null,8,["onClick"])):e.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["active","aria-disabled"])):e.createCommentVNode("",!0),Se.value?(e.openBlock(),e.createBlock(ie,{key:1,active:O.value,"onUpdate:active":m[1]||(m[1]=i=>O.value=i),"aria-disabled":s.value},e.createSlots({_:2},[typeof o.freeText=="object"&&o.freeText.icon?{name:"icon",fn:e.withCtx(()=>[typeof o.freeText=="object"&&o.freeText.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.freeText.icon),{key:0})):e.createCommentVNode("",!0),typeof o.freeText=="object"&&o.freeText.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.freeText.icon),{key:1})):e.createCommentVNode("",!0)]),key:"0"}:typeof o.freeText=="object"&&o.freeText.component?{name:"default",fn:e.withCtx(({onClick:i})=>[typeof o.freeText=="object"&&o.freeText.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.freeText.component),{key:0,onClick:i},null,8,["onClick"])):e.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["active","aria-disabled"])):e.createCommentVNode("",!0),Oe.value?(e.openBlock(),e.createBlock(se,{key:2,onChange:Ie,"aria-disabled":s.value},e.createSlots({_:2},[typeof o.image=="object"&&o.image?{name:"icon",fn:e.withCtx(()=>[typeof o.image=="object"&&o.image.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.image.icon),{key:0})):e.createCommentVNode("",!0)]),key:"0"}:typeof o.image=="object"&&o.image.component?{name:"default",fn:e.withCtx(({onClick:i})=>[typeof o.image=="object"&&o.image.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.image.component),{key:0,onClick:i},null,8,["onClick"])):e.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["aria-disabled"])):e.createCommentVNode("",!0),Ee.value?(e.openBlock(),e.createBlock(le,{key:3,active:V.value,"onUpdate:active":m[2]||(m[2]=i=>V.value=i),"aria-disabled":s.value},e.createSlots({_:2},[typeof o.signature=="object"&&o.signature.icon?{name:"icon",fn:e.withCtx(()=>[typeof o.signature=="object"&&o.signature.icon?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.signature.icon),{key:0})):e.createCommentVNode("",!0)]),key:"0"}:typeof o.signature=="object"&&o.signature.component?{name:"default",fn:e.withCtx(({onClick:i})=>[typeof o.signature=="object"&&o.signature.component?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.signature.component),{key:0,onClick:i},null,8,["onClick"])):e.createCommentVNode("",!0)]),key:"1"}:void 0]),1032,["active","aria-disabled"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})]))}}),Me="",z=$(fe,[["__scopeId","data-v-9db07deb"]]),me=(t={})=>{const{highlight:n,freeText:o,image:a,...s}=t;return{name:"annotation",setup(f){const{componentInstance:l,shared:d}=f,c=l?.uid??0;f.toolbar.addItem({id:K.ANNOTATIONS,toolbarDirection:"left",component:e.h(z,{highlight:n,freeText:o,image:a,instanceId:c,...s})});const h=l?.appContext.app;d.ui?h.provide(C,d.ui):console.warn("VPdfAnnotationPlugin - No UI context found in plugin context"),d.localization?.value?h.provide(j,d.localization):console.warn("VPdfAnnotationPlugin - No localization found in plugin context")}}},pe={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function v(t,n){return e.openBlock(),e.createElementBlock("svg",pe,[...n[0]||(n[0]=[e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.25",d:"M10 18.334a8.333 8.333 0 1 0 0-16.667 8.333 8.333 0 0 0 0 16.667"},null,-1),e.createElementVNode("path",{stroke:"currentColor","stroke-linejoin":"round","stroke-width":"1.25",d:"m5.417 17.084 1.171-4.394c.238-.892.357-1.338.694-1.597s.798-.259 1.722-.259h1.992c.923 0 1.385 0 1.722.259.337.258.456.705.693 1.597l1.172 4.394"},null,-1),e.createElementVNode("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.25",d:"M7.917 10.834 9.23 7.8c.327-.756.491-1.134.769-1.134s.441.378.77 1.134l1.313 3.033"},null,-1)])])}const ge=Object.freeze(Object.defineProperty({__proto__:null,render:v,default:{render:v}},Symbol.toStringTag,{value:"Module"})),he={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function R(t,n){return e.openBlock(),e.createElementBlock("svg",he,[...n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M18.125 9.688a7.82 7.82 0 0 1-7.812 7.812H3.75a1.25 1.25 0 0 1-1.25-1.25V9.688a7.812 7.812 0 0 1 15.625 0m-1.25 0a6.563 6.563 0 0 0-13.125 0v6.562h6.563a6.57 6.57 0 0 0 6.562-6.562"},null,-1),e.createElementVNode("path",{fill:"currentColor",d:"M12.5 10a.624.624 0 0 1-.625.625h-1.25v1.25a.624.624 0 1 1-1.25 0v-1.25h-1.25a.625.625 0 1 1 0-1.25h1.25v-1.25a.625.625 0 0 1 1.25 0v1.25h1.25A.625.625 0 0 1 12.5 10"},null,-1)])])}const ue=Object.freeze(Object.defineProperty({__proto__:null,render:R,default:{render:R}},Symbol.toStringTag,{value:"Module"})),be={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function G(t,n){return e.openBlock(),e.createElementBlock("svg",be,[...n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M11.458 13.75a.624.624 0 1 0 0-1.25h-.625v-5h2.5v.625a.625.625 0 0 0 1.25 0v-1.25a.625.625 0 0 0-.625-.625h-7.5a.625.625 0 0 0-.625.625v1.25a.625.625 0 0 0 1.25 0V7.5h2.5v5h-.625a.625.625 0 1 0 0 1.25z"},null,-1),e.createElementVNode("path",{fill:"currentColor","fill-rule":"evenodd",d:"M3.125 3.75c0-.115.093-.208.208-.208h13.334c.115 0 .208.093.208.208v2.917a.625.625 0 1 0 1.25 0V3.75c0-.805-.653-1.458-1.458-1.458H3.333c-.805 0-1.458.653-1.458 1.458v3.334a.625.625 0 1 0 1.25 0zm0 12.5c0 .115.093.209.208.209h13.334a.21.21 0 0 0 .208-.209v-2.916a.625.625 0 1 1 1.25 0v2.916c0 .806-.653 1.459-1.458 1.459H3.333a1.46 1.46 0 0 1-1.458-1.459v-3.333a.625.625 0 1 1 1.25 0zM2.5 8.542c.345 0 .625.28.625.625v1.667a.625.625 0 0 1-1.25 0V9.167c0-.345.28-.625.625-.625m15.625.625a.625.625 0 1 0-1.25 0v1.667a.625.625 0 0 0 1.25 0z","clip-rule":"evenodd"},null,-1)])])}const ke=Object.freeze(Object.defineProperty({__proto__:null,render:G,default:{render:G}},Symbol.toStringTag,{value:"Module"})),_e={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function H(t,n){return e.openBlock(),e.createElementBlock("svg",_e,[...n[0]||(n[0]=[e.createElementVNode("g",{"clip-path":"url(#a)"},[e.createElementVNode("path",{fill:"currentColor",d:"M19.818 8.308a.625.625 0 0 0-.885 0L15 12.242 8.384 5.625l3.934-3.932a.626.626 0 0 0-.885-.885L7.5 4.742a1.25 1.25 0 0 0-.22 1.47L5.625 7.866a1.25 1.25 0 0 0 0 1.767l.367.366-4.559 4.558a.625.625 0 0 0 .245 1.035l5.625 1.875a.62.62 0 0 0 .437-.015.6.6 0 0 0 .203-.136l2.682-2.683.367.366a1.25 1.25 0 0 0 1.767 0l1.656-1.654a1.25 1.25 0 0 0 1.469-.22l3.934-3.933a.626.626 0 0 0 0-.885M7.332 16.16l-4.297-1.433 3.84-3.843 2.867 2.866zm4.543-2.043L6.51 8.75l1.616-1.616 5.367 5.366z"})],-1),e.createElementVNode("defs",null,[e.createElementVNode("clipPath",{id:"a"},[e.createElementVNode("path",{fill:"currentColor",d:"M0 0h20v20H0z"})])],-1)])])}const we=Object.freeze(Object.defineProperty({__proto__:null,render:H,default:{render:H}},Symbol.toStringTag,{value:"Module"})),Ce={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function q(t,n){return e.openBlock(),e.createElementBlock("svg",Ce,[...n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M16.875 3.125H3.125a1.25 1.25 0 0 0-1.25 1.25v11.25a1.25 1.25 0 0 0 1.25 1.25h13.75a1.25 1.25 0 0 0 1.25-1.25V4.375a1.25 1.25 0 0 0-1.25-1.25m0 1.25v8.027l-2.037-2.036a1.25 1.25 0 0 0-1.768 0l-1.562 1.563L8.07 8.49a1.25 1.25 0 0 0-1.767 0L3.125 11.67V4.376zm-13.75 9.063 4.063-4.063 6.25 6.25H3.124zm13.75 2.187h-1.67l-2.812-2.812 1.563-1.563 2.919 2.92zM11.25 7.813a.938.938 0 1 1 1.875 0 .938.938 0 0 1-1.875 0"},null,-1)])])}const ye=Object.freeze(Object.defineProperty({__proto__:null,render:q,default:{render:q}},Symbol.toStringTag,{value:"Module"})),Be={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function U(t,n){return e.openBlock(),e.createElementBlock("svg",Be,[...n[0]||(n[0]=[e.createElementVNode("path",{fill:"currentColor",d:"M18.125 13.125H4.99q.313-.615.625-1.259c1.172.13 2.546-.685 4.114-2.432.391 1.051 1.13 2.416 2.39 2.441.707.014 1.414-.406 2.142-1.279.53.634 1.623 1.279 3.865 1.279a.625.625 0 1 0 0-1.25c-2.377 0-3.08-.816-3.125-1.259a.6.6 0 0 0-.426-.605.636.636 0 0 0-.723.273c-.943 1.448-1.514 1.596-1.713 1.591-.645-.012-1.301-1.525-1.526-2.61a.625.625 0 0 0-1.1-.264c-1.579 1.98-2.637 2.646-3.295 2.818.663-1.474 1.158-2.768 1.475-3.858.533-1.831.572-3.112.118-3.914-.234-.42-.73-.922-1.723-.922-1.255 0-2.245 1.186-2.716 3.254-.28 1.227-.327 2.594-.127 3.75.2 1.155.615 1.996 1.218 2.495a72 72 0 0 1-.877 1.751h-1.71a.625.625 0 1 0 0 1.25h1.048c-.884 1.64-1.572 2.784-1.583 2.803a.625.625 0 1 0 1.071.644c.012-.02.88-1.468 1.93-3.447h13.784a.625.625 0 1 0 0-1.25M4.59 5.407c.311-1.365.914-2.282 1.498-2.282.416 0 .555.145.635.287.235.416.51 1.89-1.692 6.749-.645-.881-.865-2.895-.44-4.754"},null,-1)])])}const Ne=Object.freeze(Object.defineProperty({__proto__:null,render:U,default:{render:U}},Symbol.toStringTag,{value:"Module"}));u.VPdfAnnotationTools=z,u.default=me,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/types.d.ts
CHANGED
|
@@ -23,4 +23,4 @@ export interface VPdfAnnotationPluginOptions extends AnnotationCallbacks {
|
|
|
23
23
|
highlight?: HighlightOption | boolean;
|
|
24
24
|
image?: ImageOption | boolean;
|
|
25
25
|
}
|
|
26
|
-
export type { AnnotationHighlightColors, AnnotationFreeTextFontColors, LabelValuePair, Annotation, } from "@vue-pdf-viewer/shared";
|
|
26
|
+
export type { AnnotationHighlightColors, AnnotationFreeTextFontColors, LabelValuePair, Annotation, OutlineDestinations, OutlineName, OutlineRef, LinkAction, AnnotationType, AnnotationFlag, AnnotationBorderStyle, AnnotationStringObj, AnnotationAttachment, } from "@vue-pdf-viewer/shared";
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue-pdf-viewer/annotation",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.2.0-beta.
|
|
4
|
+
"version": "1.2.0-beta.2",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.umd.cjs",
|
|
7
7
|
"module": "./dist/index.js",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"vue": "^3.2.37"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@vue-pdf-viewer/shared": "^1.1.0-
|
|
33
|
+
"@vue-pdf-viewer/shared": "^1.1.0-rc.0",
|
|
34
34
|
"vite-plugin-css-injected-by-js": "^3.5.2",
|
|
35
35
|
"vue": "^3.2.37"
|
|
36
36
|
},
|