@vue-pdf-viewer/annotation 0.0.0-experimental.1 → 0.0.0-experimental.3

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.js CHANGED
@@ -1,17 +1,17 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".vp-text-xl[data-v-c6e40782]{font-size:1.25rem;line-height:1.75rem}.vpv-toolbar-btn.vpv-toolbar-btn-active[data-v-52907777],.vpv-toolbar-btn[data-v-52907777]:hover{background-color:var(--vpv-primary-color);color:#fff}.vpv-highlight-color-picker-popover[data-v-fa7af820]{padding-left:4px;padding-right:4px;padding-bottom:4px;text-align:left}.vpv-highlight-color-picker-popover>p[data-v-fa7af820]{margin-bottom:.75rem}.vpv-annotation-tools-container[data-v-61a608d5]{padding-top:.5rem;padding-bottom:.5rem;border-top:1px solid #c6ccd2;max-width:min-content;margin:.5rem auto}.vpv-annotation-tools-container[data-v-61a608d5] .vpv-toolbar-btn{margin-bottom:.25rem}.slide-enter-active[data-v-61a608d5],.slide-leave-active[data-v-61a608d5]{transition:all .3s ease-out}.slide-enter-from[data-v-61a608d5],.slide-leave-to[data-v-61a608d5]{opacity:0}.slide-enter-from[data-v-61a608d5],.slide-leave-to[data-v-61a608d5]{transform:translateY(-20px)}")),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- import { defineComponent as m, inject as S, computed as g, openBlock as s, createBlock as u, resolveDynamicComponent as _, normalizeProps as A, mergeProps as $, createSlots as V, withCtx as l, renderSlot as v, renderList as ee, createElementBlock as I, defineAsyncComponent as te, unref as d, ref as w, createTextVNode as L, toDisplayString as E, createVNode as f, normalizeClass as F, createCommentVNode as P, mergeModels as oe, useModel as D, watchEffect as ne, createElementVNode as q, reactive as ae, Transition as le, h as ie } from "vue";
1
+ (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".vp-text-xl[data-v-c6e40782]{font-size:1.25rem;line-height:1.75rem}.vpv-toolbar-btn.vpv-toolbar-btn-active[data-v-52907777],.vpv-toolbar-btn[data-v-52907777]:hover{background-color:var(--vpv-primary-color);color:#fff}.vpv-annotation-tools-container[data-v-61a608d5]{padding-top:.5rem;padding-bottom:.5rem;border-top:1px solid #c6ccd2;max-width:min-content;margin:.5rem auto}.vpv-annotation-tools-container[data-v-61a608d5] .vpv-toolbar-btn{margin-bottom:.25rem}.slide-enter-active[data-v-61a608d5],.slide-leave-active[data-v-61a608d5]{transition:all .3s ease-out}.slide-enter-from[data-v-61a608d5],.slide-leave-to[data-v-61a608d5]{opacity:0}.slide-enter-from[data-v-61a608d5],.slide-leave-to[data-v-61a608d5]{transform:translateY(-20px)}")),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
+ import { defineComponent as m, inject as S, computed as g, openBlock as s, createBlock as u, resolveDynamicComponent as _, normalizeProps as A, mergeProps as $, createSlots as V, withCtx as l, renderSlot as v, renderList as ee, createElementBlock as I, defineAsyncComponent as te, unref as d, ref as w, createTextVNode as L, toDisplayString as E, createVNode as f, normalizeClass as F, createCommentVNode as P, mergeModels as ne, useModel as D, watchEffect as oe, createElementVNode as q, reactive as ae, Transition as le, h as ie } from "vue";
3
3
  var x;
4
- (function(o) {
5
- o.highlight = "vpv:annotation:highlight", o.freeText = "vpv:annotation:freeText", o.signature = "vpv:annotation:signature";
4
+ (function(n) {
5
+ n.highlight = "vpv:annotation:highlight", n.freeText = "vpv:annotation:freeText", n.signature = "vpv:annotation:signature";
6
6
  })(x || (x = {}));
7
7
  var j;
8
- (function(o) {
9
- o.Purple = "#7862FF", o.Cyan = "#3FE9E3", o.Red = "#F87777", o.Orange = "#FE9639", o.Yellow = "#FBDA15", o.Green = "#88F526";
8
+ (function(n) {
9
+ n.Purple = "#7862FF", n.Cyan = "#3FE9E3", n.Red = "#F87777", n.Orange = "#FE9639", n.Yellow = "#FBDA15", n.Green = "#88F526";
10
10
  })(j || (j = {}));
11
- const B = Symbol("VPV Shared UIs"), R = Symbol("VPV Current Localization"), se = (o, n) => `${o}-${n}`, H = /* @__PURE__ */ m({
11
+ const B = Symbol("VPV Shared UIs"), R = Symbol("VPV Current Localization"), se = (n, o) => `${n}-${o}`, H = /* @__PURE__ */ m({
12
12
  __name: "AppTooltip",
13
- setup(o) {
14
- const n = S(B), e = g(() => n?.AppTooltip);
13
+ setup(n) {
14
+ const o = S(B), e = g(() => o?.AppTooltip);
15
15
  return (t, a) => e.value ? (s(), u(_(e.value), A($({ key: 0 }, t.$attrs)), V({
16
16
  default: l(() => [
17
17
  v(t.$slots, "default")
@@ -30,8 +30,8 @@ const B = Symbol("VPV Shared UIs"), R = Symbol("VPV Current Localization"), se =
30
30
  }
31
31
  }), N = /* @__PURE__ */ m({
32
32
  __name: "AppButton",
33
- setup(o) {
34
- const n = S(B), e = g(() => n?.AppButton);
33
+ setup(n) {
34
+ const o = S(B), e = g(() => o?.AppButton);
35
35
  return (t, a) => e.value ? (s(), u(_(e.value), A($({ key: 0 }, t.$attrs)), {
36
36
  default: l(() => [
37
37
  v(t.$slots, "default")
@@ -41,45 +41,45 @@ const B = Symbol("VPV Shared UIs"), R = Symbol("VPV Current Localization"), se =
41
41
  v(t.$slots, "default")
42
42
  ], 16));
43
43
  }
44
- }), re = (o, n) => {
45
- const e = o[n];
44
+ }), re = (n, o) => {
45
+ const e = n[o];
46
46
  return e ? typeof e == "function" ? e() : Promise.resolve(e) : new Promise((t, a) => {
47
- (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(a.bind(null, new Error("Unknown variable dynamic import: " + n)));
47
+ (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(a.bind(null, new Error("Unknown variable dynamic import: " + o)));
48
48
  });
49
49
  }, ce = /* @__PURE__ */ m({
50
50
  __name: "Icon",
51
51
  props: {
52
52
  name: {}
53
53
  },
54
- setup(o) {
55
- const n = o, e = te({
56
- loader: () => re(/* @__PURE__ */ Object.assign({ "../assets/icons/annotations.svg": () => import("./annotations.1313e99f.js"), "../assets/icons/tool-comment.svg": () => import("./tool-comment.d0e017dc.js"), "../assets/icons/tool-free-text.svg": () => import("./tool-free-text.bcc03e9a.js"), "../assets/icons/tool-highlight.svg": () => import("./tool-highlight.d3ea6f0b.js"), "../assets/icons/tool-signature.svg": () => import("./tool-signature.85da0b98.js") }), `../assets/icons/${n.name}.svg`)
54
+ setup(n) {
55
+ const o = n, e = te({
56
+ loader: () => re(/* @__PURE__ */ Object.assign({ "../assets/icons/annotations.svg": () => import("./annotations.1313e99f.js"), "../assets/icons/tool-comment.svg": () => import("./tool-comment.d0e017dc.js"), "../assets/icons/tool-free-text.svg": () => import("./tool-free-text.bcc03e9a.js"), "../assets/icons/tool-highlight.svg": () => import("./tool-highlight.d3ea6f0b.js"), "../assets/icons/tool-signature.svg": () => import("./tool-signature.85da0b98.js") }), `../assets/icons/${o.name}.svg`)
57
57
  });
58
58
  return (t, a) => (s(), u(_(d(e)), { class: "vp-text-xl" }));
59
59
  }
60
60
  });
61
- const U = (o, n) => {
62
- const e = o.__vccOpts || o;
63
- for (const [t, a] of n)
61
+ const U = (n, o) => {
62
+ const e = n.__vccOpts || n;
63
+ for (const [t, a] of o)
64
64
  e[t] = a;
65
65
  return e;
66
66
  }, z = /* @__PURE__ */ U(ce, [["__scopeId", "data-v-c6e40782"]]), M = () => {
67
- const o = S(
67
+ const n = S(
68
68
  R,
69
69
  g(() => ({}))
70
70
  );
71
71
  return {
72
72
  t: g(() => (e) => {
73
73
  const t = e.split(".").pop() || e;
74
- return o.value && t in o.value ? o.value[t] : (console.warn(`useLocalization - Translation not found for key: ${e}`), e);
74
+ return n.value && t in n.value ? n.value[t] : (console.warn(`useLocalization - Translation not found for key: ${e}`), e);
75
75
  }).value,
76
- currentLocale: g(() => o.value)
76
+ currentLocale: g(() => n.value)
77
77
  };
78
78
  }, ue = /* @__PURE__ */ m({
79
79
  __name: "ToolAnnotation",
80
80
  emits: ["toggle"],
81
- setup(o, { emit: n }) {
82
- const { t: e } = M(), t = n, a = w(!1), r = () => {
81
+ setup(n, { emit: o }) {
82
+ const { t: e } = M(), t = o, a = w(!1), r = () => {
83
83
  a.value = !a.value, t("toggle", a.value);
84
84
  };
85
85
  return (p, c) => p.$slots.default ? v(p.$slots, "default", {
@@ -110,8 +110,8 @@ const U = (o, n) => {
110
110
  });
111
111
  const pe = /* @__PURE__ */ U(ue, [["__scopeId", "data-v-52907777"]]), ve = /* @__PURE__ */ m({
112
112
  __name: "AppPopover",
113
- setup(o) {
114
- const n = S(B), e = g(() => n?.AppPopover);
113
+ setup(n) {
114
+ const o = S(B), e = g(() => o?.AppPopover);
115
115
  return (t, a) => e.value ? (s(), u(_(e.value), A($({ key: 0 }, t.$attrs)), {
116
116
  trigger: l(() => [
117
117
  v(t.$slots, "trigger")
@@ -126,24 +126,24 @@ const pe = /* @__PURE__ */ U(ue, [["__scopeId", "data-v-52907777"]]), ve = /* @_
126
126
  }
127
127
  }), ge = /* @__PURE__ */ m({
128
128
  __name: "AppHighlightColorPicker",
129
- setup(o) {
130
- const n = S(B), e = g(() => n?.AppHighlightColorPicker);
129
+ setup(n) {
130
+ const o = S(B), e = g(() => o?.AppHighlightColorPicker);
131
131
  return (t, a) => e.value ? (s(), u(_(e.value), A($({ key: 0 }, t.$attrs)), null, 16)) : P("", !0);
132
132
  }
133
- }), de = { class: "vpv-highlight-color-picker-popover" }, fe = /* @__PURE__ */ m({
133
+ }), de = { class: "vpv-annotation-highlight__color-picker-wrapper" }, fe = /* @__PURE__ */ m({
134
134
  __name: "ToolAnnotationHighlight",
135
135
  props: {
136
136
  active: { type: Boolean, required: !0 },
137
137
  activeModifiers: {}
138
138
  },
139
- emits: /* @__PURE__ */ oe(["change"], ["update:active"]),
140
- setup(o, { emit: n }) {
141
- const e = D(o, "active"), t = w(!1), a = n, { t: r } = M(), p = w(j.Purple), c = () => {
139
+ emits: /* @__PURE__ */ ne(["change"], ["update:active"]),
140
+ setup(n, { emit: o }) {
141
+ const e = D(n, "active"), t = w(!1), a = o, { t: r } = M(), p = w(j.Purple), c = () => {
142
142
  !e.value && !t.value && (t.value = !0), e.value = !e.value;
143
143
  }, T = (y) => {
144
144
  t.value = !1;
145
145
  };
146
- return ne(() => {
146
+ return oe(() => {
147
147
  !e.value || a("change", p.value);
148
148
  }), (y, b) => y.$slots.default ? v(y.$slots, "default", {
149
149
  key: 0,
@@ -190,16 +190,16 @@ const pe = /* @__PURE__ */ U(ue, [["__scopeId", "data-v-52907777"]]), ve = /* @_
190
190
  }, 8, ["open"]));
191
191
  }
192
192
  });
193
- const he = /* @__PURE__ */ U(fe, [["__scopeId", "data-v-fa7af820"]]), _e = /* @__PURE__ */ m({
193
+ const he = /* @__PURE__ */ U(fe, [["__scopeId", "data-v-45efa0d1"]]), _e = /* @__PURE__ */ m({
194
194
  __name: "ToolAnnotationSignature",
195
195
  props: {
196
196
  active: { type: Boolean, required: !0 },
197
197
  activeModifiers: {}
198
198
  },
199
199
  emits: ["update:active"],
200
- setup(o) {
201
- const n = D(o, "active"), { t: e } = M(), t = () => {
202
- n.value = !n.value;
200
+ setup(n) {
201
+ const o = D(n, "active"), { t: e } = M(), t = () => {
202
+ o.value = !o.value;
203
203
  };
204
204
  return (a, r) => a.$slots.default ? v(a.$slots, "default", {
205
205
  key: 0,
@@ -211,7 +211,7 @@ const he = /* @__PURE__ */ U(fe, [["__scopeId", "data-v-fa7af820"]]), _e = /* @_
211
211
  default: l(() => [
212
212
  f(N, {
213
213
  "aria-label": d(e)("annotationSignatureLabel"),
214
- class: F(["vpv-toolbar-btn", { "vpv-toolbar-btn-active": n.value }]),
214
+ class: F(["vpv-toolbar-btn", { "vpv-toolbar-btn-active": o.value }]),
215
215
  onClick: t
216
216
  }, {
217
217
  default: l(() => [
@@ -232,9 +232,9 @@ const he = /* @__PURE__ */ U(fe, [["__scopeId", "data-v-fa7af820"]]), _e = /* @_
232
232
  activeModifiers: {}
233
233
  },
234
234
  emits: ["update:active"],
235
- setup(o) {
236
- const n = D(o, "active"), { t: e } = M(), t = () => {
237
- n.value = !n.value;
235
+ setup(n) {
236
+ const o = D(n, "active"), { t: e } = M(), t = () => {
237
+ o.value = !o.value;
238
238
  };
239
239
  return (a, r) => a.$slots.default ? v(a.$slots, "default", {
240
240
  key: 0,
@@ -246,7 +246,7 @@ const he = /* @__PURE__ */ U(fe, [["__scopeId", "data-v-fa7af820"]]), _e = /* @_
246
246
  default: l(() => [
247
247
  f(N, {
248
248
  "aria-label": d(e)("annotationFreeTextLabel"),
249
- class: F(["vpv-toolbar-btn", { "vpv-toolbar-btn-active": n.value }]),
249
+ class: F(["vpv-toolbar-btn", { "vpv-toolbar-btn-active": o.value }]),
250
250
  onClick: t
251
251
  }, {
252
252
  default: l(() => [
@@ -284,8 +284,8 @@ const he = /* @__PURE__ */ U(fe, [["__scopeId", "data-v-fa7af820"]]), _e = /* @_
284
284
  __name: "VPdfAnnotationTools",
285
285
  props: ke,
286
286
  emits: ["highlight", "freeText", "signature"],
287
- setup(o, { emit: n }) {
288
- const e = o, t = n, a = (i) => se(e.instanceId, i), r = {
287
+ setup(n, { emit: o }) {
288
+ const e = n, t = o, a = (i) => se(e.instanceId, i), r = {
289
289
  highlight: new CustomEvent(
290
290
  a(x.highlight),
291
291
  {
@@ -407,8 +407,8 @@ const he = /* @__PURE__ */ U(fe, [["__scopeId", "data-v-fa7af820"]]), _e = /* @_
407
407
  ]));
408
408
  }
409
409
  });
410
- const Ae = /* @__PURE__ */ U(be, [["__scopeId", "data-v-61a608d5"]]), Ce = (o = {}) => {
411
- const { highlight: n, freeText: e, signature: t } = o;
410
+ const Ae = /* @__PURE__ */ U(be, [["__scopeId", "data-v-61a608d5"]]), Ce = (n = {}) => {
411
+ const { highlight: o, freeText: e, signature: t } = n;
412
412
  return {
413
413
  name: "annotation",
414
414
  setup(a) {
@@ -417,9 +417,9 @@ const Ae = /* @__PURE__ */ U(be, [["__scopeId", "data-v-61a608d5"]]), Ce = (o =
417
417
  id: "annotations",
418
418
  toolbarDirection: "left",
419
419
  component: ie(Ae, {
420
- highlight: n,
421
- freeText: e,
422
- signature: t,
420
+ highlight: o,
421
+ freeText: !1,
422
+ signature: !1,
423
423
  instanceId: c
424
424
  })
425
425
  });
@@ -1,2 +1,2 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".vp-text-xl[data-v-c6e40782]{font-size:1.25rem;line-height:1.75rem}.vpv-toolbar-btn.vpv-toolbar-btn-active[data-v-52907777],.vpv-toolbar-btn[data-v-52907777]:hover{background-color:var(--vpv-primary-color);color:#fff}.vpv-highlight-color-picker-popover[data-v-fa7af820]{padding-left:4px;padding-right:4px;padding-bottom:4px;text-align:left}.vpv-highlight-color-picker-popover>p[data-v-fa7af820]{margin-bottom:.75rem}.vpv-annotation-tools-container[data-v-61a608d5]{padding-top:.5rem;padding-bottom:.5rem;border-top:1px solid #c6ccd2;max-width:min-content;margin:.5rem auto}.vpv-annotation-tools-container[data-v-61a608d5] .vpv-toolbar-btn{margin-bottom:.25rem}.slide-enter-active[data-v-61a608d5],.slide-leave-active[data-v-61a608d5]{transition:all .3s ease-out}.slide-enter-from[data-v-61a608d5],.slide-leave-to[data-v-61a608d5]{opacity:0}.slide-enter-from[data-v-61a608d5],.slide-leave-to[data-v-61a608d5]{transform:translateY(-20px)}")),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
- (function(f,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(f=typeof globalThis<"u"?globalThis:f||self,e(f["@vue-pdf-viewer/annotation"]={},f.Vue))})(this,function(f,e){"use strict";var u;(function(l){l.highlight="vpv:annotation:highlight",l.freeText="vpv:annotation:freeText",l.signature="vpv:annotation:signature"})(u||(u={}));var b;(function(l){l.Purple="#7862FF",l.Cyan="#3FE9E3",l.Red="#F87777",l.Orange="#FE9639",l.Yellow="#FBDA15",l.Green="#88F526"})(b||(b={}));const k=Symbol("VPV Shared UIs"),$=Symbol("VPV Current Localization"),z=(l,o)=>`${l}-${o}`,C=e.defineComponent({__name:"AppTooltip",setup(l){const o=e.inject(k),t=e.computed(()=>o?.AppTooltip);return(n,a)=>t.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.value),e.normalizeProps(e.mergeProps({key:0},n.$attrs)),e.createSlots({default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:2},[e.renderList(n.$slots,(i,c)=>({name:c,fn:e.withCtx(()=>[e.renderSlot(n.$slots,c)])}))]),1040)):(e.openBlock(),e.createElementBlock("div",e.normalizeProps(e.mergeProps({key:1},n.$attrs)),[e.renderSlot(n.$slots,"default")],16))}}),y=e.defineComponent({__name:"AppButton",setup(l){const o=e.inject(k),t=e.computed(()=>o?.AppButton);return(n,a)=>t.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.value),e.normalizeProps(e.mergeProps({key:0},n.$attrs)),{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16)):(e.openBlock(),e.createElementBlock("button",e.normalizeProps(e.mergeProps({key:1},n.$attrs)),[e.renderSlot(n.$slots,"default")],16))}}),M=(l,o)=>{const t=l[o];return t?typeof t=="function"?t():Promise.resolve(t):new Promise((n,a)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(a.bind(null,new Error("Unknown variable dynamic import: "+o)))})},j=e.defineComponent({__name:"Icon",props:{name:{}},setup(l){const o=l,t=e.defineAsyncComponent({loader:()=>M(Object.assign({"../assets/icons/annotations.svg":()=>Promise.resolve().then(()=>Q),"../assets/icons/tool-comment.svg":()=>Promise.resolve().then(()=>X),"../assets/icons/tool-free-text.svg":()=>Promise.resolve().then(()=>te),"../assets/icons/tool-highlight.svg":()=>Promise.resolve().then(()=>ne),"../assets/icons/tool-signature.svg":()=>Promise.resolve().then(()=>ae)}),`../assets/icons/${o.name}.svg`)});return(n,a)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(t)),{class:"vp-text-xl"}))}}),ge="",w=(l,o)=>{const t=l.__vccOpts||l;for(const[n,a]of o)t[n]=a;return t},T=w(j,[["__scopeId","data-v-c6e40782"]]),x=()=>{const l=e.inject($,e.computed(()=>({})));return{t:e.computed(()=>t=>{const n=t.split(".").pop()||t;return l.value&&n in l.value?l.value[n]:(console.warn(`useLocalization - Translation not found for key: ${t}`),t)}).value,currentLocale:e.computed(()=>l.value)}},O=e.defineComponent({__name:"ToolAnnotation",emits:["toggle"],setup(l,{emit:o}){const{t}=x(),n=o,a=e.ref(!1),i=()=>{a.value=!a.value,n("toggle",a.value)};return(c,s)=>c.$slots.default?e.renderSlot(c.$slots,"default",{key:0,onClick:i},void 0,!0):(e.openBlock(),e.createBlock(C,{key:1},{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.value?e.unref(t)("annotationToggleHideTooltip"):e.unref(t)("annotationToggleShowTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(y,{"aria-label":a.value?e.unref(t)("annotationToggleHideTooltip"):e.unref(t)("annotationToggleShowTooltip"),class:e.normalizeClass(["vpv-toolbar-btn",{"vpv-toolbar-btn-active":a.value}]),onClick:i},{default:e.withCtx(()=>[e.createVNode(T,{name:"annotations",class:"vp-text-xl"})]),_:1},8,["aria-label","class"])]),_:1}))}}),me="",I=w(O,[["__scopeId","data-v-52907777"]]),D=e.defineComponent({__name:"AppPopover",setup(l){const o=e.inject(k),t=e.computed(()=>o?.AppPopover);return(n,a)=>t.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.value),e.normalizeProps(e.mergeProps({key:0},n.$attrs)),{trigger:e.withCtx(()=>[e.renderSlot(n.$slots,"trigger")]),default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},16)):(e.openBlock(),e.createElementBlock("button",e.normalizeProps(e.mergeProps({key:1},n.$attrs)),[e.renderSlot(n.$slots,"default")],16))}}),H=e.defineComponent({__name:"AppHighlightColorPicker",setup(l){const o=e.inject(k),t=e.computed(()=>o?.AppHighlightColorPicker);return(n,a)=>t.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.value),e.normalizeProps(e.mergeProps({key:0},n.$attrs)),null,16)):e.createCommentVNode("",!0)}}),L={class:"vpv-highlight-color-picker-popover"},F=e.defineComponent({__name:"ToolAnnotationHighlight",props:{active:{type:Boolean,required:!0},activeModifiers:{}},emits:e.mergeModels(["change"],["update:active"]),setup(l,{emit:o}){const t=e.useModel(l,"active"),n=e.ref(!1),a=o,{t:i}=x(),c=e.ref(b.Purple),s=()=>{!t.value&&!n.value&&(n.value=!0),t.value=!t.value},p=h=>{n.value=!1};return e.watchEffect(()=>{!t.value||a("change",c.value)}),(h,m)=>h.$slots.default?e.renderSlot(h.$slots,"default",{key:0,onClick:s},void 0,!0):(e.openBlock(),e.createBlock(D,{key:1,open:n.value,side:"right",sideOffset:10,onInteractOutside:p},{trigger:e.withCtx(()=>[e.createVNode(C,null,{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("annotationHighlightTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(y,{"aria-label":e.unref(i)("annotationHighlightLabel"),class:e.normalizeClass(["vpv-toolbar-btn",{"vpv-toolbar-btn-active":t.value}]),onClick:s},{default:e.withCtx(()=>[e.renderSlot(h.$slots,"icon",{},()=>[e.createVNode(T,{name:"tool-highlight"})],!0)]),_:3},8,["aria-label","class"])]),_:3})]),default:e.withCtx(()=>[e.createElementVNode("div",L,[e.createElementVNode("p",null,e.toDisplayString(e.unref(i)("annotationHighlightColorPickerLabel")),1),e.createVNode(H,{color:c.value,"onUpdate:color":m[0]||(m[0]=_=>c.value=_)},null,8,["color"])])]),_:3},8,["open"]))}}),_e="",v=w(F,[["__scopeId","data-v-fa7af820"]]),U=e.defineComponent({__name:"ToolAnnotationSignature",props:{active:{type:Boolean,required:!0},activeModifiers:{}},emits:["update:active"],setup(l){const o=e.useModel(l,"active"),{t}=x(),n=()=>{o.value=!o.value};return(a,i)=>a.$slots.default?e.renderSlot(a.$slots,"default",{key:0,onClick:n}):(e.openBlock(),e.createBlock(C,{key:1},{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("annotationSignatureTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(y,{"aria-label":e.unref(t)("annotationSignatureLabel"),class:e.normalizeClass(["vpv-toolbar-btn",{"vpv-toolbar-btn-active":o.value}]),onClick:n},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"icon",{},()=>[e.createVNode(T,{name:"tool-signature"})])]),_:3},8,["aria-label","class"])]),_:3}))}}),q=e.defineComponent({__name:"ToolAnnotationFreeText",props:{active:{type:Boolean,required:!0},activeModifiers:{}},emits:["update:active"],setup(l){const o=e.useModel(l,"active"),{t}=x(),n=()=>{o.value=!o.value};return(a,i)=>a.$slots.default?e.renderSlot(a.$slots,"default",{key:0,onClick:n}):(e.openBlock(),e.createBlock(C,{key:1},{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("annotationFreeTextTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(y,{"aria-label":e.unref(t)("annotationFreeTextLabel"),class:e.normalizeClass(["vpv-toolbar-btn",{"vpv-toolbar-btn-active":o.value}]),onClick:n},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"icon",{},()=>[e.createVNode(T,{name:"tool-free-text"})])]),_:3},8,["aria-label","class"])]),_:3}))}}),R={class:"vpv-annotation-tools-container"},Y={key:0,class:"vpv-annotation-tools"},G={highlight:{type:[Object,Boolean],default:()=>!0},freeText:{type:[Object,Boolean],default:()=>!0},signature:{type:[Object,Boolean],default:()=>!0},instanceId:{type:Number,required:!0}},K=e.defineComponent({__name:"VPdfAnnotationTools",props:G,emits:["highlight","freeText","signature"],setup(l,{emit:o}){const t=l,n=o,a=r=>z(t.instanceId,r),i={highlight:new CustomEvent(a(u.highlight),{detail:{active:!1,color:null}}),freeText:new CustomEvent(a(u.freeText),{detail:{active:!1}}),signature:new CustomEvent(a(u.signature),{detail:{active:!1}})},c=e.ref(!1),s=e.reactive({highlight:!1,freeText:!1,signature:!1}),p=e.ref(null),h=e.computed({get:()=>s.highlight,set:r=>{s.highlight=r,r?(s.freeText=!1,s.signature=!1):(p.value=null,B())}}),m=e.computed({get:()=>s.freeText,set:r=>{r&&(s.highlight=!1,s.signature=!1),s.freeText=r,B()}}),_=e.computed({get:()=>s.signature,set:r=>{r&&(s.highlight=!1,s.freeText=!1),s.signature=r,B()}}),re=e.computed(()=>t.highlight),ie=e.computed(()=>t.freeText),se=e.computed(()=>t.signature),ce=r=>{c.value=r,r||(h.value=!1,m.value=!1,_.value=!1,p.value=null)},de=r=>{p.value=r,B()},pe=(r,g)=>{n("highlight",r),i.highlight.detail.active=r,i.highlight.detail.color=g,window.dispatchEvent(i.highlight)},he=r=>{n("freeText",r),i.freeText.detail.active=r,window.dispatchEvent(i.freeText)},fe=r=>{n("signature",r),i.signature.detail.active=r,window.dispatchEvent(i.signature)};function B(){pe(h.value,p.value),he(m.value),fe(_.value)}return(r,g)=>(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(I,{onToggle:ce}),e.createVNode(e.Transition,{name:"slide"},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("div",Y,[re.value?(e.openBlock(),e.createBlock(v,{key:0,active:h.value,"onUpdate:active":g[0]||(g[0]=d=>h.value=d),onChange:de},e.createSlots({_:2},[t.highlight?.props?.icon?{name:"icon",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.highlight.props.icon)))]),key:"0"}:typeof t.highlight=="object"?{name:"default",fn:e.withCtx(({onClick:d})=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.highlight),{onClick:d},null,8,["onClick"]))]),key:"1"}:void 0]),1032,["active"])):e.createCommentVNode("",!0),ie.value?(e.openBlock(),e.createBlock(q,{key:1,active:m.value,"onUpdate:active":g[1]||(g[1]=d=>m.value=d)},e.createSlots({_:2},[t.freeText?.props?.icon?{name:"icon",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.freeText.props.icon)))]),key:"0"}:typeof t.freeText=="object"?{name:"default",fn:e.withCtx(({onClick:d})=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.freeText),{onClick:d},null,8,["onClick"]))]),key:"1"}:void 0]),1032,["active"])):e.createCommentVNode("",!0),se.value?(e.openBlock(),e.createBlock(U,{key:2,active:_.value,"onUpdate:active":g[2]||(g[2]=d=>_.value=d)},e.createSlots({_:2},[t.signature?.props?.icon?{name:"icon",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.signature.props.icon)))]),key:"0"}:typeof t.signature=="object"?{name:"default",fn:e.withCtx(({onClick:d})=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.signature),{onClick:d},null,8,["onClick"]))]),key:"1"}:void 0]),1032,["active"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})]))}}),ue="",P=w(K,[["__scopeId","data-v-61a608d5"]]),Z=(l={})=>{const{highlight:o,freeText:t,signature:n}=l;return{name:"annotation",setup(a){const{componentInstance:i,shared:c}=a,s=i?.uid??0;a.toolbar.addItem({id:"annotations",toolbarDirection:"left",component:e.h(P,{highlight:o,freeText:t,signature:n,instanceId:s})});const p=i?.appContext.app;c.ui?(p.provide(k,c.ui),console.log("VPdfAnnotationPlugin - Provided UI context at plugin level")):console.warn("VPdfAnnotationPlugin - No UI context found in plugin context"),c.localization?.value?p.provide($,c.localization):console.warn("VPdfAnnotationPlugin - No localization found in plugin context")}}},J={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function S(l,o){return e.openBlock(),e.createElementBlock("svg",J,o[0]||(o[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 Q=Object.freeze(Object.defineProperty({__proto__:null,render:S,default:{render:S}},Symbol.toStringTag,{value:"Module"})),W={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function V(l,o){return e.openBlock(),e.createElementBlock("svg",W,o[0]||(o[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 X=Object.freeze(Object.defineProperty({__proto__:null,render:V,default:{render:V}},Symbol.toStringTag,{value:"Module"})),ee={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function A(l,o){return e.openBlock(),e.createElementBlock("svg",ee,o[0]||(o[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 te=Object.freeze(Object.defineProperty({__proto__:null,render:A,default:{render:A}},Symbol.toStringTag,{value:"Module"})),oe={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function N(l,o){return e.openBlock(),e.createElementBlock("svg",oe,o[0]||(o[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 ne=Object.freeze(Object.defineProperty({__proto__:null,render:N,default:{render:N}},Symbol.toStringTag,{value:"Module"})),le={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function E(l,o){return e.openBlock(),e.createElementBlock("svg",le,o[0]||(o[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 ae=Object.freeze(Object.defineProperty({__proto__:null,render:E,default:{render:E}},Symbol.toStringTag,{value:"Module"}));f.VPdfAnnotationTools=P,f.default=Z,Object.defineProperties(f,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(){"use strict";try{if(typeof document<"u"){var t=document.createElement("style");t.appendChild(document.createTextNode(".vp-text-xl[data-v-c6e40782]{font-size:1.25rem;line-height:1.75rem}.vpv-toolbar-btn.vpv-toolbar-btn-active[data-v-52907777],.vpv-toolbar-btn[data-v-52907777]:hover{background-color:var(--vpv-primary-color);color:#fff}.vpv-annotation-tools-container[data-v-61a608d5]{padding-top:.5rem;padding-bottom:.5rem;border-top:1px solid #c6ccd2;max-width:min-content;margin:.5rem auto}.vpv-annotation-tools-container[data-v-61a608d5] .vpv-toolbar-btn{margin-bottom:.25rem}.slide-enter-active[data-v-61a608d5],.slide-leave-active[data-v-61a608d5]{transition:all .3s ease-out}.slide-enter-from[data-v-61a608d5],.slide-leave-to[data-v-61a608d5]{opacity:0}.slide-enter-from[data-v-61a608d5],.slide-leave-to[data-v-61a608d5]{transform:translateY(-20px)}")),document.head.appendChild(t)}}catch(a){console.error("vite-plugin-css-injected-by-js",a)}})();
2
+ (function(h,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(h=typeof globalThis<"u"?globalThis:h||self,e(h["@vue-pdf-viewer/annotation"]={},h.Vue))})(this,function(h,e){"use strict";var u;(function(n){n.highlight="vpv:annotation:highlight",n.freeText="vpv:annotation:freeText",n.signature="vpv:annotation:signature"})(u||(u={}));var b;(function(n){n.Purple="#7862FF",n.Cyan="#3FE9E3",n.Red="#F87777",n.Orange="#FE9639",n.Yellow="#FBDA15",n.Green="#88F526"})(b||(b={}));const k=Symbol("VPV Shared UIs"),$=Symbol("VPV Current Localization"),z=(n,o)=>`${n}-${o}`,C=e.defineComponent({__name:"AppTooltip",setup(n){const o=e.inject(k),t=e.computed(()=>o?.AppTooltip);return(l,a)=>t.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.value),e.normalizeProps(e.mergeProps({key:0},l.$attrs)),e.createSlots({default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:2},[e.renderList(l.$slots,(i,c)=>({name:c,fn:e.withCtx(()=>[e.renderSlot(l.$slots,c)])}))]),1040)):(e.openBlock(),e.createElementBlock("div",e.normalizeProps(e.mergeProps({key:1},l.$attrs)),[e.renderSlot(l.$slots,"default")],16))}}),y=e.defineComponent({__name:"AppButton",setup(n){const o=e.inject(k),t=e.computed(()=>o?.AppButton);return(l,a)=>t.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.value),e.normalizeProps(e.mergeProps({key:0},l.$attrs)),{default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16)):(e.openBlock(),e.createElementBlock("button",e.normalizeProps(e.mergeProps({key:1},l.$attrs)),[e.renderSlot(l.$slots,"default")],16))}}),M=(n,o)=>{const t=n[o];return t?typeof t=="function"?t():Promise.resolve(t):new Promise((l,a)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(a.bind(null,new Error("Unknown variable dynamic import: "+o)))})},j=e.defineComponent({__name:"Icon",props:{name:{}},setup(n){const o=n,t=e.defineAsyncComponent({loader:()=>M(Object.assign({"../assets/icons/annotations.svg":()=>Promise.resolve().then(()=>Q),"../assets/icons/tool-comment.svg":()=>Promise.resolve().then(()=>X),"../assets/icons/tool-free-text.svg":()=>Promise.resolve().then(()=>te),"../assets/icons/tool-highlight.svg":()=>Promise.resolve().then(()=>ne),"../assets/icons/tool-signature.svg":()=>Promise.resolve().then(()=>ae)}),`../assets/icons/${o.name}.svg`)});return(l,a)=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(e.unref(t)),{class:"vp-text-xl"}))}}),ge="",w=(n,o)=>{const t=n.__vccOpts||n;for(const[l,a]of o)t[l]=a;return t},T=w(j,[["__scopeId","data-v-c6e40782"]]),x=()=>{const n=e.inject($,e.computed(()=>({})));return{t:e.computed(()=>t=>{const l=t.split(".").pop()||t;return n.value&&l in n.value?n.value[l]:(console.warn(`useLocalization - Translation not found for key: ${t}`),t)}).value,currentLocale:e.computed(()=>n.value)}},O=e.defineComponent({__name:"ToolAnnotation",emits:["toggle"],setup(n,{emit:o}){const{t}=x(),l=o,a=e.ref(!1),i=()=>{a.value=!a.value,l("toggle",a.value)};return(c,s)=>c.$slots.default?e.renderSlot(c.$slots,"default",{key:0,onClick:i},void 0,!0):(e.openBlock(),e.createBlock(C,{key:1},{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(a.value?e.unref(t)("annotationToggleHideTooltip"):e.unref(t)("annotationToggleShowTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(y,{"aria-label":a.value?e.unref(t)("annotationToggleHideTooltip"):e.unref(t)("annotationToggleShowTooltip"),class:e.normalizeClass(["vpv-toolbar-btn",{"vpv-toolbar-btn-active":a.value}]),onClick:i},{default:e.withCtx(()=>[e.createVNode(T,{name:"annotations",class:"vp-text-xl"})]),_:1},8,["aria-label","class"])]),_:1}))}}),me="",I=w(O,[["__scopeId","data-v-52907777"]]),D=e.defineComponent({__name:"AppPopover",setup(n){const o=e.inject(k),t=e.computed(()=>o?.AppPopover);return(l,a)=>t.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.value),e.normalizeProps(e.mergeProps({key:0},l.$attrs)),{trigger:e.withCtx(()=>[e.renderSlot(l.$slots,"trigger")]),default:e.withCtx(()=>[e.renderSlot(l.$slots,"default")]),_:3},16)):(e.openBlock(),e.createElementBlock("button",e.normalizeProps(e.mergeProps({key:1},l.$attrs)),[e.renderSlot(l.$slots,"default")],16))}}),H=e.defineComponent({__name:"AppHighlightColorPicker",setup(n){const o=e.inject(k),t=e.computed(()=>o?.AppHighlightColorPicker);return(l,a)=>t.value?(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.value),e.normalizeProps(e.mergeProps({key:0},l.$attrs)),null,16)):e.createCommentVNode("",!0)}}),L={class:"vpv-annotation-highlight__color-picker-wrapper"},F=e.defineComponent({__name:"ToolAnnotationHighlight",props:{active:{type:Boolean,required:!0},activeModifiers:{}},emits:e.mergeModels(["change"],["update:active"]),setup(n,{emit:o}){const t=e.useModel(n,"active"),l=e.ref(!1),a=o,{t:i}=x(),c=e.ref(b.Purple),s=()=>{!t.value&&!l.value&&(l.value=!0),t.value=!t.value},p=f=>{l.value=!1};return e.watchEffect(()=>{!t.value||a("change",c.value)}),(f,m)=>f.$slots.default?e.renderSlot(f.$slots,"default",{key:0,onClick:s},void 0,!0):(e.openBlock(),e.createBlock(D,{key:1,open:l.value,side:"right",sideOffset:10,onInteractOutside:p},{trigger:e.withCtx(()=>[e.createVNode(C,null,{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(i)("annotationHighlightTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(y,{"aria-label":e.unref(i)("annotationHighlightLabel"),class:e.normalizeClass(["vpv-toolbar-btn",{"vpv-toolbar-btn-active":t.value}]),onClick:s},{default:e.withCtx(()=>[e.renderSlot(f.$slots,"icon",{},()=>[e.createVNode(T,{name:"tool-highlight"})],!0)]),_:3},8,["aria-label","class"])]),_:3})]),default:e.withCtx(()=>[e.createElementVNode("div",L,[e.createElementVNode("p",null,e.toDisplayString(e.unref(i)("annotationHighlightColorPickerLabel")),1),e.createVNode(H,{color:c.value,"onUpdate:color":m[0]||(m[0]=_=>c.value=_)},null,8,["color"])])]),_:3},8,["open"]))}}),_e="",v=w(F,[["__scopeId","data-v-45efa0d1"]]),U=e.defineComponent({__name:"ToolAnnotationSignature",props:{active:{type:Boolean,required:!0},activeModifiers:{}},emits:["update:active"],setup(n){const o=e.useModel(n,"active"),{t}=x(),l=()=>{o.value=!o.value};return(a,i)=>a.$slots.default?e.renderSlot(a.$slots,"default",{key:0,onClick:l}):(e.openBlock(),e.createBlock(C,{key:1},{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("annotationSignatureTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(y,{"aria-label":e.unref(t)("annotationSignatureLabel"),class:e.normalizeClass(["vpv-toolbar-btn",{"vpv-toolbar-btn-active":o.value}]),onClick:l},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"icon",{},()=>[e.createVNode(T,{name:"tool-signature"})])]),_:3},8,["aria-label","class"])]),_:3}))}}),q=e.defineComponent({__name:"ToolAnnotationFreeText",props:{active:{type:Boolean,required:!0},activeModifiers:{}},emits:["update:active"],setup(n){const o=e.useModel(n,"active"),{t}=x(),l=()=>{o.value=!o.value};return(a,i)=>a.$slots.default?e.renderSlot(a.$slots,"default",{key:0,onClick:l}):(e.openBlock(),e.createBlock(C,{key:1},{content:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(t)("annotationFreeTextTooltip")),1)]),default:e.withCtx(()=>[e.createVNode(y,{"aria-label":e.unref(t)("annotationFreeTextLabel"),class:e.normalizeClass(["vpv-toolbar-btn",{"vpv-toolbar-btn-active":o.value}]),onClick:l},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"icon",{},()=>[e.createVNode(T,{name:"tool-free-text"})])]),_:3},8,["aria-label","class"])]),_:3}))}}),R={class:"vpv-annotation-tools-container"},Y={key:0,class:"vpv-annotation-tools"},G={highlight:{type:[Object,Boolean],default:()=>!0},freeText:{type:[Object,Boolean],default:()=>!0},signature:{type:[Object,Boolean],default:()=>!0},instanceId:{type:Number,required:!0}},K=e.defineComponent({__name:"VPdfAnnotationTools",props:G,emits:["highlight","freeText","signature"],setup(n,{emit:o}){const t=n,l=o,a=r=>z(t.instanceId,r),i={highlight:new CustomEvent(a(u.highlight),{detail:{active:!1,color:null}}),freeText:new CustomEvent(a(u.freeText),{detail:{active:!1}}),signature:new CustomEvent(a(u.signature),{detail:{active:!1}})},c=e.ref(!1),s=e.reactive({highlight:!1,freeText:!1,signature:!1}),p=e.ref(null),f=e.computed({get:()=>s.highlight,set:r=>{s.highlight=r,r?(s.freeText=!1,s.signature=!1):(p.value=null,B())}}),m=e.computed({get:()=>s.freeText,set:r=>{r&&(s.highlight=!1,s.signature=!1),s.freeText=r,B()}}),_=e.computed({get:()=>s.signature,set:r=>{r&&(s.highlight=!1,s.freeText=!1),s.signature=r,B()}}),re=e.computed(()=>t.highlight),ie=e.computed(()=>t.freeText),se=e.computed(()=>t.signature),ce=r=>{c.value=r,r||(f.value=!1,m.value=!1,_.value=!1,p.value=null)},de=r=>{p.value=r,B()},pe=(r,g)=>{l("highlight",r),i.highlight.detail.active=r,i.highlight.detail.color=g,window.dispatchEvent(i.highlight)},fe=r=>{l("freeText",r),i.freeText.detail.active=r,window.dispatchEvent(i.freeText)},he=r=>{l("signature",r),i.signature.detail.active=r,window.dispatchEvent(i.signature)};function B(){pe(f.value,p.value),fe(m.value),he(_.value)}return(r,g)=>(e.openBlock(),e.createElementBlock("div",R,[e.createVNode(I,{onToggle:ce}),e.createVNode(e.Transition,{name:"slide"},{default:e.withCtx(()=>[c.value?(e.openBlock(),e.createElementBlock("div",Y,[re.value?(e.openBlock(),e.createBlock(v,{key:0,active:f.value,"onUpdate:active":g[0]||(g[0]=d=>f.value=d),onChange:de},e.createSlots({_:2},[t.highlight?.props?.icon?{name:"icon",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.highlight.props.icon)))]),key:"0"}:typeof t.highlight=="object"?{name:"default",fn:e.withCtx(({onClick:d})=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.highlight),{onClick:d},null,8,["onClick"]))]),key:"1"}:void 0]),1032,["active"])):e.createCommentVNode("",!0),ie.value?(e.openBlock(),e.createBlock(q,{key:1,active:m.value,"onUpdate:active":g[1]||(g[1]=d=>m.value=d)},e.createSlots({_:2},[t.freeText?.props?.icon?{name:"icon",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.freeText.props.icon)))]),key:"0"}:typeof t.freeText=="object"?{name:"default",fn:e.withCtx(({onClick:d})=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.freeText),{onClick:d},null,8,["onClick"]))]),key:"1"}:void 0]),1032,["active"])):e.createCommentVNode("",!0),se.value?(e.openBlock(),e.createBlock(U,{key:2,active:_.value,"onUpdate:active":g[2]||(g[2]=d=>_.value=d)},e.createSlots({_:2},[t.signature?.props?.icon?{name:"icon",fn:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.signature.props.icon)))]),key:"0"}:typeof t.signature=="object"?{name:"default",fn:e.withCtx(({onClick:d})=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(t.signature),{onClick:d},null,8,["onClick"]))]),key:"1"}:void 0]),1032,["active"])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)]),_:1})]))}}),ue="",P=w(K,[["__scopeId","data-v-61a608d5"]]),Z=(n={})=>{const{highlight:o,freeText:t,signature:l}=n;return{name:"annotation",setup(a){const{componentInstance:i,shared:c}=a,s=i?.uid??0;a.toolbar.addItem({id:"annotations",toolbarDirection:"left",component:e.h(P,{highlight:o,freeText:!1,signature:!1,instanceId:s})});const p=i?.appContext.app;c.ui?(p.provide(k,c.ui),console.log("VPdfAnnotationPlugin - Provided UI context at plugin level")):console.warn("VPdfAnnotationPlugin - No UI context found in plugin context"),c.localization?.value?p.provide($,c.localization):console.warn("VPdfAnnotationPlugin - No localization found in plugin context")}}},J={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function S(n,o){return e.openBlock(),e.createElementBlock("svg",J,o[0]||(o[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 Q=Object.freeze(Object.defineProperty({__proto__:null,render:S,default:{render:S}},Symbol.toStringTag,{value:"Module"})),W={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function V(n,o){return e.openBlock(),e.createElementBlock("svg",W,o[0]||(o[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 X=Object.freeze(Object.defineProperty({__proto__:null,render:V,default:{render:V}},Symbol.toStringTag,{value:"Module"})),ee={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function A(n,o){return e.openBlock(),e.createElementBlock("svg",ee,o[0]||(o[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 te=Object.freeze(Object.defineProperty({__proto__:null,render:A,default:{render:A}},Symbol.toStringTag,{value:"Module"})),oe={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function N(n,o){return e.openBlock(),e.createElementBlock("svg",oe,o[0]||(o[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 ne=Object.freeze(Object.defineProperty({__proto__:null,render:N,default:{render:N}},Symbol.toStringTag,{value:"Module"})),le={xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",fill:"none",viewBox:"0 0 20 20"};function E(n,o){return e.openBlock(),e.createElementBlock("svg",le,o[0]||(o[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 ae=Object.freeze(Object.defineProperty({__proto__:null,render:E,default:{render:E}},Symbol.toStringTag,{value:"Module"}));h.VPdfAnnotationTools=P,h.default=Z,Object.defineProperties(h,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vue-pdf-viewer/annotation",
3
3
  "private": false,
4
- "version": "0.0.0-experimental.1",
4
+ "version": "0.0.0-experimental.3",
5
5
  "type": "module",
6
6
  "main": "./dist/index.umd.cjs",
7
7
  "module": "./dist/index.js",