@lingshugroup/web-plus 1.0.32 → 1.0.34
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/README.md +1 -1
- package/lib/index/index.cjs +1 -1
- package/lib/index/index.js +48 -44
- package/lib/index/index.js.br +0 -0
- package/lib/index/index.js.gz +0 -0
- package/lib/index.css +1 -1
- package/lib/index.css.br +0 -0
- package/lib/index.css.gz +0 -0
- package/lib/packages/ls-components/components/index/index.cjs +1 -1
- package/lib/packages/ls-components/components/index/index.js +54 -50
- package/lib/packages/ls-components/components/index/index.js.br +0 -0
- package/lib/packages/ls-components/components/index/index.js.gz +0 -0
- package/lib/packages/ls-components/components/list/List.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/list/List.vue/index.js +2 -2
- package/lib/packages/ls-components/components/list/List.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/list/List.vue/index2.js +103 -103
- package/lib/packages/ls-components/components/list/List.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/list/List.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/list/types/index.cjs +1 -1
- package/lib/packages/ls-components/components/list/types/index.js +11 -0
- package/lib/packages/ls-components/components/list/types/index.js.br +0 -0
- package/lib/packages/ls-components/components/list/types/index.js.gz +0 -0
- package/lib/packages/ls-components/components/preview/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/preview/Index.vue/index.js +3 -3
- package/lib/packages/ls-components/components/preview_docx/Docx.vue/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_docx/Docx.vue/index.js +7 -0
- package/lib/packages/ls-components/components/preview_docx/Docx.vue/index2.cjs +1 -0
- package/lib/packages/ls-components/components/preview_docx/Docx.vue/index2.js +96 -0
- package/lib/packages/ls-components/components/preview_docx/Docx.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview_docx/Docx.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_docx/Index.vue/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_docx/Index.vue/index.js +7 -0
- package/lib/packages/ls-components/components/preview_docx/Index.vue/index2.cjs +1 -0
- package/lib/packages/ls-components/components/preview_docx/Index.vue/index2.js +82 -0
- package/lib/packages/ls-components/components/preview_docx/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview_docx/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_docx/types/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_docx/types/index.js +33 -0
- package/lib/packages/ls-components/components/preview_image/Image.vue/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_image/Image.vue/index.js +7 -0
- package/lib/packages/ls-components/components/preview_image/Image.vue/index2.cjs +1 -0
- package/lib/packages/ls-components/components/preview_image/Image.vue/index2.js +335 -0
- package/lib/packages/ls-components/components/preview_image/Image.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview_image/Image.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_image/Index.vue/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_image/Index.vue/index.js +7 -0
- package/lib/packages/ls-components/components/preview_image/Index.vue/index2.cjs +1 -0
- package/lib/packages/ls-components/components/preview_image/Index.vue/index2.js +82 -0
- package/lib/packages/ls-components/components/preview_image/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview_image/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_image/types/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_image/types/index.js +60 -0
- package/lib/packages/ls-components/components/preview_image/types/index.js.br +0 -0
- package/lib/packages/ls-components/components/preview_image/types/index.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/Index.vue/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_pdf/Index.vue/index.js +7 -0
- package/lib/packages/ls-components/components/preview_pdf/Index.vue/index2.cjs +1 -0
- package/lib/packages/ls-components/components/preview_pdf/Index.vue/index2.js +82 -0
- package/lib/packages/ls-components/components/preview_pdf/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index.js +7 -0
- package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index2.cjs +1 -0
- package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index2.js +201 -0
- package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/Pdf.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/composable/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_pdf/composable/index.js +108 -0
- package/lib/packages/ls-components/components/preview_pdf/composable/index.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/composable/index.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Annotation.vue/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Annotation.vue/index.js +113 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Annotation.vue/index.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Annotation.vue/index.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Annotation.vue/index3.cjs +1 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Annotation.vue/index3.js +5 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/PdfItem.vue/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/PdfItem.vue/index.js +221 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/PdfItem.vue/index.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/PdfItem.vue/index.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/PdfItem.vue/index2.cjs +1 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/PdfItem.vue/index2.js +4 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Text.vue/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Text.vue/index.js +89 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Text.vue/index.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Text.vue/index.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Text.vue/index2.cjs +1 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/Text.vue/index2.js +4 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/XFA.vue/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/XFA.vue/index.js +47 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/XFA.vue/index.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/XFA.vue/index.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/XFA.vue/index3.cjs +1 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/XFA.vue/index3.js +5 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/annotations/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/annotations/index.js +158 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/annotations/index.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/annotations/index.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/destination/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/destination/index.js +27 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/destination/index.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/destination/index.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/highlight/index.cjs +2 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/highlight/index.js +125 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/highlight/index.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/highlight/index.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/linkService/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/linkService/index.js +101 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/linkService/index.js.br +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/linkService/index.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/miscellaneous/index.cjs +16 -0
- package/lib/packages/ls-components/components/preview_pdf/pdfs/miscellaneous/index.js +35 -0
- package/lib/packages/ls-components/components/preview_pdf/types/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_pdf/types/index.js +23 -0
- package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index.js +7 -0
- package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index2.cjs +1 -0
- package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index2.js +82 -0
- package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview_xlsx/Index.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index.js +7 -0
- package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index2.cjs +1 -0
- package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index2.js +185 -0
- package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/preview_xlsx/Xlsx.vue/index2.js.gz +0 -0
- package/lib/packages/ls-components/components/preview_xlsx/types/index.cjs +1 -0
- package/lib/packages/ls-components/components/preview_xlsx/types/index.js +33 -0
- package/lib/packages/ls-components/components/upload/Index.vue/index.cjs +1 -1
- package/lib/packages/ls-components/components/upload/Index.vue/index.js +1 -1
- package/lib/packages/ls-components/components/upload/Index.vue/index2.cjs +1 -1
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js +230 -256
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js.br +0 -0
- package/lib/packages/ls-components/components/upload/Index.vue/index2.js.gz +0 -0
- package/lib/preview_docx/index.cjs +1 -0
- package/lib/preview_docx/index.js +12 -0
- package/lib/preview_image/index.cjs +1 -0
- package/lib/preview_image/index.js +12 -0
- package/lib/preview_pdf/index.cjs +1 -0
- package/lib/preview_pdf/index.js +12 -0
- package/lib/preview_xlsx/index.cjs +1 -0
- package/lib/preview_xlsx/index.js +12 -0
- package/package.json +17 -9
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var D=Object.defineProperty;var r=(s,f)=>D(s,"name",{value:f,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const n=require("vue"),j=require("pdfjs-dist"),z=;/* empty css */;/* empty css */const H=,/* empty css */J=;/* empty css */;/* empty css */const X=;/* empty css */function I(s){const f=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(s){for(const p in s)if(p!=="default"){const o=Object.getOwnPropertyDescriptor(s,p);Object.defineProperty(f,p,o.get?o:{enumerable:!0,get:r(()=>s[p],"get")})}}return f.default=s,Object.freeze(f)}r(I,"_interopNamespaceDefault");const C=I(j),G=n.createElementVNode("canvas",{dir:"ltr",style:{display:"block"},role:"main"},null,-1),K=n.defineComponent({name:"LSPdf"}),Q=n.defineComponent({...K,props:{pdf:{},page:{default:1},scale:{default:1},rotation:{},fitParent:{type:Boolean},width:{},height:{},textLayer:{type:Boolean},imageResourcesPath:{},hideForms:{type:Boolean},intent:{default:"display"},annotationLayer:{type:Boolean},annotationsFilter:{},annotationsMap:{},watermarkText:{},watermarkOptions:{},highlightText:{},highlightOptions:{}},emits:["annotation","highlight","loaded","textLoaded","annotationLoaded","xfaLoaded","loadComplete","loadError","update:source"],setup(s,{expose:f,emit:p}){const o=s,u=p;n.watch(()=>o.pdf,()=>{W()},{immediate:!0,deep:!0});const v=n.ref(),y=n.ref(),k=n.ref(!1);let x;const c=n.computed(()=>({viewport:void 0,document:void 0,page:void 0})),A=n.computed(()=>({annotationsMap:o.annotationsMap,annotationsFilter:o.annotationsFilter,imageResourcesPath:o.imageResourcesPath,hideForms:o.hideForms,intent:o.intent})),O=n.computed(()=>({highlightText:o.highlightText,highlightOptions:o.highlightOptions}));function T(){return X.default({},{columns:4,rows:4,rotation:45,fontSize:18,color:"rgba(211, 210, 211, 0.4)"},o.watermarkOptions)}r(T,"getWatermarkOptionsWithDefaults");function b(a){if(!(typeof a=="number"&&a%90===0))return 0;const e=a/90;return e>4?b(a-360):e<0?b(a+360):a}r(b,"getRotation");function B(a){let e=o.scale;if(o.fitParent){const t=v.value.parentNode.clientWidth,i=a.getViewport({scale:1}).width;e=t/i}else if(o.width){const t=a.getViewport({scale:1}).width;e=o.width/t}else if(o.height){const t=a.getViewport({scale:1}).height;e=o.height/t}return e}r(B,"getScale");function F(a=1){if(!o.watermarkText)return;const e=M();if(!e)return;const t=e.getContext("2d");if(!t)return;const i=T(),h=o.watermarkText,l=i.columns,g=i.rows,d=l*g,w=i.rotation,_=i.fontSize*a;t.font=`${_}px Trebuchet MS`,t.fillStyle=i.color;for(let m=0;m<d;m++){const P=m%l*(e.width/l)+e.width/(l*2),q=Math.floor(m/l)*(e.height/g)+e.height/(g*2),$=t.measureText(h).width;t.save(),t.translate(P,q),t.rotate(-w*(Math.PI/180)),t.fillText(h,-$/2,_/2),t.restore()}}r(F,"paintWatermark");function M(){var e;let a=null;return(e=v.value)==null||e.childNodes.forEach(t=>{t.tagName==="CANVAS"&&(a=t)}),a}r(M,"getCurrentCanvas");function N(a){var h;let e;const t=M();t&&(t==null?void 0:t.getAttribute("role"))==="main"?e=t:(e=document.createElement("canvas"),e.style.display="block",e.setAttribute("dir","ltr"));const i=window.devicePixelRatio||1;return e.width=Math.floor(a.width*i),e.height=Math.floor(a.height*i),e.style.width=`${Math.floor(a.width)}px`,e.style.height=`${Math.floor(a.height)}px`,e.setAttribute("class","pdf-canvas"),(h=v.value)==null||h.style.setProperty("--scale-factor",`${a.scale}`),y.value.style.width=`${Math.floor(a.width)}px`,y.value.style.height=`${Math.floor(a.height)}px`,y.value.style.top="0",y.value.style.left="0",k.value=!0,e}r(N,"setupCanvas");function S(){x&&x.cancel()}r(S,"cancelRender");function L(a){var e;(e=n.toRaw(c.value.document))==null||e.getPage(a).then(t=>{var P;S();const i=t.getViewport(),h={scale:B(t),rotation:b((o.rotation||0)+i.rotation)},l=t.getViewport(h),g=M(),d=N(l),w=window.devicePixelRatio||1,_=w!==1?[w,0,0,w,0,0]:void 0,m={canvasContext:d.getContext("2d"),viewport:l,annotationMode:o.hideForms?C.AnnotationMode.ENABLE:C.AnnotationMode.ENABLE_FORMS,transform:_,intent:o.intent};(d==null?void 0:d.getAttribute("role"))!=="main"?g&&((P=v.value)==null||P.replaceChild(d,g)):d.removeAttribute("role"),c.value.page=t,c.value.viewport=l,x=t.render(m),x.promise.then(()=>{k.value=!1,F(l.scale),u("loaded",c.value.viewport),u("loadComplete")}).catch(()=>{u("loadError")})})}r(L,"renderPage");function V(a){a.promise&&a.promise.then(async e=>{c.value.document=e,L(o.page)})}r(V,"initDoc"),n.watch(()=>[o.page,o.scale,o.width,o.height,o.rotation,o.hideForms,o.intent],()=>{L(o.page)});function E(){L(o.page)}r(E,"reload");function R(){S()}r(R,"cancel");async function W(){if(o.pdf)try{V(o.pdf)}finally{}}return r(W,"initPdf"),f({reload:E,cancel:R}),(a,e)=>(n.openBlock(),n.createElementBlock("div",{ref_key:"container",ref:v,style:{position:"relative",display:"block"}},[G,a.annotationLayer?(n.openBlock(),n.createBlock(z.default,n.mergeProps({key:0},{...n.unref(c),...n.unref(A)},{onAnnotation:e[0]||(e[0]=t=>u("annotation",t)),onAnnotationLoaded:e[1]||(e[1]=t=>u("annotationLoaded",t))}),null,16)):n.createCommentVNode("",!0),a.textLayer?(n.openBlock(),n.createBlock(H.default,n.mergeProps({key:1},{...n.unref(c),...n.unref(O)},{onHighlight:e[2]||(e[2]=t=>u("highlight",t)),onTextLoaded:e[3]||(e[3]=t=>u("textLoaded",t))}),null,16)):n.createCommentVNode("",!0),n.createVNode(J.default,n.mergeProps({...n.unref(c)},{onXfaLoaded:e[4]||(e[4]=t=>u("xfaLoaded"))}),null,16),n.withDirectives(n.createElementVNode("div",{ref_key:"loadingLayer",ref:y,style:{position:"absolute"}},[n.renderSlot(a.$slots,"default")],512),[[n.vShow,n.unref(k)]])],512))}});exports.default=Q;
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
var Q = Object.defineProperty;
|
|
2
|
+
var a = (x, k) => Q(x, "name", { value: k, configurable: !0 });
|
|
3
|
+
import { defineComponent as N, watch as E, ref as A, computed as S, openBlock as b, createElementBlock as U, createBlock as F, mergeProps as T, unref as f, createCommentVNode as V, createVNode as Y, withDirectives as Z, createElementVNode as R, renderSlot as tt, vShow as et, toRaw as ot } from "vue";
|
|
4
|
+
import * as B from "pdfjs-dist";
|
|
5
|
+
import nt from "../Annotation.vue/index.js";
|
|
6
|
+
/* empty css */
|
|
7
|
+
import at from "../Text.vue/index.js";
|
|
8
|
+
import it from "../XFA.vue/index.js";
|
|
9
|
+
/* empty css */
|
|
10
|
+
import rt from "../../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.js";
|
|
11
|
+
const lt = /* @__PURE__ */ R("canvas", {
|
|
12
|
+
dir: "ltr",
|
|
13
|
+
style: { display: "block" },
|
|
14
|
+
role: "main"
|
|
15
|
+
}, null, -1), st = N({
|
|
16
|
+
name: "LSPdf"
|
|
17
|
+
}), yt = /* @__PURE__ */ N({
|
|
18
|
+
...st,
|
|
19
|
+
props: {
|
|
20
|
+
pdf: {},
|
|
21
|
+
page: { default: 1 },
|
|
22
|
+
scale: { default: 1 },
|
|
23
|
+
rotation: {},
|
|
24
|
+
fitParent: { type: Boolean },
|
|
25
|
+
width: {},
|
|
26
|
+
height: {},
|
|
27
|
+
textLayer: { type: Boolean },
|
|
28
|
+
imageResourcesPath: {},
|
|
29
|
+
hideForms: { type: Boolean },
|
|
30
|
+
intent: { default: "display" },
|
|
31
|
+
annotationLayer: { type: Boolean },
|
|
32
|
+
annotationsFilter: {},
|
|
33
|
+
annotationsMap: {},
|
|
34
|
+
watermarkText: {},
|
|
35
|
+
watermarkOptions: {},
|
|
36
|
+
highlightText: {},
|
|
37
|
+
highlightOptions: {}
|
|
38
|
+
},
|
|
39
|
+
emits: ["annotation", "highlight", "loaded", "textLoaded", "annotationLoaded", "xfaLoaded", "loadComplete", "loadError", "update:source"],
|
|
40
|
+
setup(x, { expose: k, emit: W }) {
|
|
41
|
+
const o = x, l = W;
|
|
42
|
+
E(
|
|
43
|
+
() => o.pdf,
|
|
44
|
+
() => {
|
|
45
|
+
q();
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
immediate: !0,
|
|
49
|
+
deep: !0
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
const p = A(), m = A(), P = A(!1);
|
|
53
|
+
let y;
|
|
54
|
+
const s = S(() => ({
|
|
55
|
+
viewport: void 0,
|
|
56
|
+
document: void 0,
|
|
57
|
+
page: void 0
|
|
58
|
+
})), O = S(() => ({
|
|
59
|
+
annotationsMap: o.annotationsMap,
|
|
60
|
+
annotationsFilter: o.annotationsFilter,
|
|
61
|
+
imageResourcesPath: o.imageResourcesPath,
|
|
62
|
+
hideForms: o.hideForms,
|
|
63
|
+
intent: o.intent
|
|
64
|
+
})), _ = S(() => ({
|
|
65
|
+
highlightText: o.highlightText,
|
|
66
|
+
highlightOptions: o.highlightOptions
|
|
67
|
+
}));
|
|
68
|
+
function D() {
|
|
69
|
+
return rt(
|
|
70
|
+
{},
|
|
71
|
+
{
|
|
72
|
+
columns: 4,
|
|
73
|
+
rows: 4,
|
|
74
|
+
rotation: 45,
|
|
75
|
+
fontSize: 18,
|
|
76
|
+
color: "rgba(211, 210, 211, 0.4)"
|
|
77
|
+
},
|
|
78
|
+
o.watermarkOptions
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
a(D, "getWatermarkOptionsWithDefaults");
|
|
82
|
+
function L(n) {
|
|
83
|
+
if (!(typeof n == "number" && n % 90 === 0)) return 0;
|
|
84
|
+
const t = n / 90;
|
|
85
|
+
return t > 4 ? L(n - 360) : t < 0 ? L(n + 360) : n;
|
|
86
|
+
}
|
|
87
|
+
a(L, "getRotation");
|
|
88
|
+
function z(n) {
|
|
89
|
+
let t = o.scale;
|
|
90
|
+
if (o.fitParent) {
|
|
91
|
+
const e = p.value.parentNode.clientWidth, i = n.getViewport({ scale: 1 }).width;
|
|
92
|
+
t = e / i;
|
|
93
|
+
} else if (o.width) {
|
|
94
|
+
const e = n.getViewport({ scale: 1 }).width;
|
|
95
|
+
t = o.width / e;
|
|
96
|
+
} else if (o.height) {
|
|
97
|
+
const e = n.getViewport({ scale: 1 }).height;
|
|
98
|
+
t = o.height / e;
|
|
99
|
+
}
|
|
100
|
+
return t;
|
|
101
|
+
}
|
|
102
|
+
a(z, "getScale");
|
|
103
|
+
function H(n = 1) {
|
|
104
|
+
if (!o.watermarkText) return;
|
|
105
|
+
const t = M();
|
|
106
|
+
if (!t) return;
|
|
107
|
+
const e = t.getContext("2d");
|
|
108
|
+
if (!e) return;
|
|
109
|
+
const i = D(), c = o.watermarkText, r = i.columns, h = i.rows, d = r * h, g = i.rotation, v = i.fontSize * n;
|
|
110
|
+
e.font = `${v}px Trebuchet MS`, e.fillStyle = i.color;
|
|
111
|
+
for (let u = 0; u < d; u++) {
|
|
112
|
+
const w = u % r * (t.width / r) + t.width / (r * 2), G = Math.floor(u / r) * (t.height / h) + t.height / (h * 2), K = e.measureText(c).width;
|
|
113
|
+
e.save(), e.translate(w, G), e.rotate(-g * (Math.PI / 180)), e.fillText(c, -K / 2, v / 2), e.restore();
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
a(H, "paintWatermark");
|
|
117
|
+
function M() {
|
|
118
|
+
var t;
|
|
119
|
+
let n = null;
|
|
120
|
+
return (t = p.value) == null || t.childNodes.forEach((e) => {
|
|
121
|
+
e.tagName === "CANVAS" && (n = e);
|
|
122
|
+
}), n;
|
|
123
|
+
}
|
|
124
|
+
a(M, "getCurrentCanvas");
|
|
125
|
+
function I(n) {
|
|
126
|
+
var c;
|
|
127
|
+
let t;
|
|
128
|
+
const e = M();
|
|
129
|
+
e && (e == null ? void 0 : e.getAttribute("role")) === "main" ? t = e : (t = document.createElement("canvas"), t.style.display = "block", t.setAttribute("dir", "ltr"));
|
|
130
|
+
const i = window.devicePixelRatio || 1;
|
|
131
|
+
return t.width = Math.floor(n.width * i), t.height = Math.floor(n.height * i), t.style.width = `${Math.floor(n.width)}px`, t.style.height = `${Math.floor(n.height)}px`, t.setAttribute("class", "pdf-canvas"), (c = p.value) == null || c.style.setProperty("--scale-factor", `${n.scale}`), m.value.style.width = `${Math.floor(n.width)}px`, m.value.style.height = `${Math.floor(n.height)}px`, m.value.style.top = "0", m.value.style.left = "0", P.value = !0, t;
|
|
132
|
+
}
|
|
133
|
+
a(I, "setupCanvas");
|
|
134
|
+
function $() {
|
|
135
|
+
y && y.cancel();
|
|
136
|
+
}
|
|
137
|
+
a($, "cancelRender");
|
|
138
|
+
function C(n) {
|
|
139
|
+
var t;
|
|
140
|
+
(t = ot(s.value.document)) == null || t.getPage(n).then((e) => {
|
|
141
|
+
var w;
|
|
142
|
+
$();
|
|
143
|
+
const i = e.getViewport(), c = {
|
|
144
|
+
scale: z(e),
|
|
145
|
+
rotation: L((o.rotation || 0) + i.rotation)
|
|
146
|
+
}, r = e.getViewport(c), h = M(), d = I(r), g = window.devicePixelRatio || 1, v = g !== 1 ? [g, 0, 0, g, 0, 0] : void 0, u = {
|
|
147
|
+
canvasContext: d.getContext("2d"),
|
|
148
|
+
viewport: r,
|
|
149
|
+
annotationMode: o.hideForms ? B.AnnotationMode.ENABLE : B.AnnotationMode.ENABLE_FORMS,
|
|
150
|
+
transform: v,
|
|
151
|
+
intent: o.intent
|
|
152
|
+
};
|
|
153
|
+
(d == null ? void 0 : d.getAttribute("role")) !== "main" ? h && ((w = p.value) == null || w.replaceChild(d, h)) : d.removeAttribute("role"), s.value.page = e, s.value.viewport = r, y = e.render(u), y.promise.then(() => {
|
|
154
|
+
P.value = !1, H(r.scale), l("loaded", s.value.viewport), l("loadComplete");
|
|
155
|
+
}).catch(() => {
|
|
156
|
+
l("loadError");
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
a(C, "renderPage");
|
|
161
|
+
function J(n) {
|
|
162
|
+
n.promise && n.promise.then(async (t) => {
|
|
163
|
+
s.value.document = t, C(o.page);
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
a(J, "initDoc"), E(
|
|
167
|
+
() => [o.page, o.scale, o.width, o.height, o.rotation, o.hideForms, o.intent],
|
|
168
|
+
() => {
|
|
169
|
+
C(o.page);
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
function X() {
|
|
173
|
+
C(o.page);
|
|
174
|
+
}
|
|
175
|
+
a(X, "reload");
|
|
176
|
+
function j() {
|
|
177
|
+
$();
|
|
178
|
+
}
|
|
179
|
+
a(j, "cancel");
|
|
180
|
+
async function q() {
|
|
181
|
+
if (o.pdf)
|
|
182
|
+
try {
|
|
183
|
+
J(o.pdf);
|
|
184
|
+
} finally {
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return a(q, "initPdf"), k({
|
|
188
|
+
reload: X,
|
|
189
|
+
cancel: j
|
|
190
|
+
}), (n, t) => (b(), U("div", {
|
|
191
|
+
ref_key: "container",
|
|
192
|
+
ref: p,
|
|
193
|
+
style: { position: "relative", display: "block" }
|
|
194
|
+
}, [
|
|
195
|
+
lt,
|
|
196
|
+
n.annotationLayer ? (b(), F(nt, T({ key: 0 }, { ...f(s), ...f(O) }, {
|
|
197
|
+
onAnnotation: t[0] || (t[0] = (e) => l("annotation", e)),
|
|
198
|
+
onAnnotationLoaded: t[1] || (t[1] = (e) => l("annotationLoaded", e))
|
|
199
|
+
}), null, 16)) : V("", !0),
|
|
200
|
+
n.textLayer ? (b(), F(at, T({ key: 1 }, { ...f(s), ...f(_) }, {
|
|
201
|
+
onHighlight: t[2] || (t[2] = (e) => l("highlight", e)),
|
|
202
|
+
onTextLoaded: t[3] || (t[3] = (e) => l("textLoaded", e))
|
|
203
|
+
}), null, 16)) : V("", !0),
|
|
204
|
+
Y(it, T({ ...f(s) }, {
|
|
205
|
+
onXfaLoaded: t[4] || (t[4] = (e) => l("xfaLoaded"))
|
|
206
|
+
}), null, 16),
|
|
207
|
+
Z(R("div", {
|
|
208
|
+
ref_key: "loadingLayer",
|
|
209
|
+
ref: m,
|
|
210
|
+
style: { position: "absolute" }
|
|
211
|
+
}, [
|
|
212
|
+
tt(n.$slots, "default")
|
|
213
|
+
], 512), [
|
|
214
|
+
[et, f(P)]
|
|
215
|
+
])
|
|
216
|
+
], 512));
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
export {
|
|
220
|
+
yt as default
|
|
221
|
+
};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index.cjs");exports.default=e.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var _=Object.defineProperty;var o=(t,s)=>_(t,"name",{value:s,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue"),b=require("pdfjs-dist"),p=require("../highlight/index.cjs"),M=require("../../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.cjs");function D(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const l=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(s,e,l.get?l:{enumerable:!0,get:o(()=>t[e],"get")})}}return s.default=t,Object.freeze(s)}o(D,"_interopNamespaceDefault");const S=D(b),L=r.defineComponent({__name:"Text",props:{page:{},viewport:{},highlightText:{},highlightOptions:{}},emits:["highlight","textLoaded"],setup(t,{emit:s}){const e=t,l=s,c=r.ref(),u=r.ref();let h=[];function w(){return M.default({},{ignoreCase:!0,completeWords:!1},e.highlightOptions)}o(w,"getHighlightOptionsWithDefaults");async function v(n=!1){const i=e.page,a=await(i==null?void 0:i.getTextContent());if(a&&(n&&p.resetDivs(a,h),e.highlightText)){const d=typeof e.highlightText=="string"?[e.highlightText]:e.highlightText,g=p.findMatches(d,a,w());p.highlightMatches(g,a,h),l("highlight",{matches:g,textContent:a,textDivs:h,page:(i==null?void 0:i.pageNumber)||1})}}o(v,"findAndHighlight");function m(){var g,x;(x=(g=c.value).replaceChildren)==null||x.call(g);const n=e.page,i=e.viewport,a=n==null?void 0:n.streamTextContent({includeMarkedContent:!0,disableNormalization:!0}),d=new S.TextLayer({container:c.value,textContentSource:a,viewport:i});d.render().then(async()=>{var y;h=d.textDivs;const O=await(n==null?void 0:n.getTextContent());l("textLoaded",{textDivs:h,textContent:O});const f=document.createElement("div");f.className="endOfContent",(y=c.value)==null||y.appendChild(f),u.value=f,v()})}o(m,"render");function C(){u.value&&u.value.classList.add("active")}o(C,"onMouseDown");function T(){u.value&&u.value.classList.remove("active")}return o(T,"onMouseUp"),r.watch(()=>e.viewport,()=>{e.page&&e.viewport&&c.value&&m()}),r.watch(()=>[e.highlightText,e.highlightOptions],()=>{v(!0)},{deep:!0}),r.onMounted(()=>{e.page&&e.viewport&&c.value&&m()}),(n,i)=>(r.openBlock(),r.createElementBlock("div",{ref_key:"layer",ref:c,class:"textLayer",style:{display:"block"},onMousedown:C,onMouseup:T},null,544))}});exports.default=L;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
var L = Object.defineProperty;
|
|
2
|
+
var r = (c, u) => L(c, "name", { value: u, configurable: !0 });
|
|
3
|
+
import { defineComponent as _, ref as x, watch as C, onMounted as D, openBlock as O, createElementBlock as k } from "vue";
|
|
4
|
+
import * as b from "pdfjs-dist";
|
|
5
|
+
import { resetDivs as N, findMatches as S, highlightMatches as B } from "../highlight/index.js";
|
|
6
|
+
import E from "../../../../../../node_modules/.pnpm/lodash-es@4.17.21/node_modules/lodash-es/merge/index.js";
|
|
7
|
+
const A = /* @__PURE__ */ _({
|
|
8
|
+
__name: "Text",
|
|
9
|
+
props: {
|
|
10
|
+
page: {},
|
|
11
|
+
viewport: {},
|
|
12
|
+
highlightText: {},
|
|
13
|
+
highlightOptions: {}
|
|
14
|
+
},
|
|
15
|
+
emits: ["highlight", "textLoaded"],
|
|
16
|
+
setup(c, { emit: u }) {
|
|
17
|
+
const t = c, p = u, o = x(), s = x();
|
|
18
|
+
let a = [];
|
|
19
|
+
function w() {
|
|
20
|
+
return E(
|
|
21
|
+
{},
|
|
22
|
+
{
|
|
23
|
+
ignoreCase: !0,
|
|
24
|
+
completeWords: !1
|
|
25
|
+
},
|
|
26
|
+
t.highlightOptions
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
r(w, "getHighlightOptionsWithDefaults");
|
|
30
|
+
async function d(e = !1) {
|
|
31
|
+
const n = t.page, i = await (n == null ? void 0 : n.getTextContent());
|
|
32
|
+
if (i && (e && N(i, a), t.highlightText)) {
|
|
33
|
+
const h = typeof t.highlightText == "string" ? [t.highlightText] : t.highlightText, l = S(h, i, w());
|
|
34
|
+
B(l, i, a), p("highlight", {
|
|
35
|
+
matches: l,
|
|
36
|
+
textContent: i,
|
|
37
|
+
textDivs: a,
|
|
38
|
+
page: (n == null ? void 0 : n.pageNumber) || 1
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
r(d, "findAndHighlight");
|
|
43
|
+
function f() {
|
|
44
|
+
var l, m;
|
|
45
|
+
(m = (l = o.value).replaceChildren) == null || m.call(l);
|
|
46
|
+
const e = t.page, n = t.viewport, i = e == null ? void 0 : e.streamTextContent({ includeMarkedContent: !0, disableNormalization: !0 }), h = new b.TextLayer({ container: o.value, textContentSource: i, viewport: n });
|
|
47
|
+
h.render().then(async () => {
|
|
48
|
+
var v;
|
|
49
|
+
a = h.textDivs;
|
|
50
|
+
const M = await (e == null ? void 0 : e.getTextContent());
|
|
51
|
+
p("textLoaded", { textDivs: a, textContent: M });
|
|
52
|
+
const g = document.createElement("div");
|
|
53
|
+
g.className = "endOfContent", (v = o.value) == null || v.appendChild(g), s.value = g, d();
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
r(f, "render");
|
|
57
|
+
function y() {
|
|
58
|
+
s.value && s.value.classList.add("active");
|
|
59
|
+
}
|
|
60
|
+
r(y, "onMouseDown");
|
|
61
|
+
function T() {
|
|
62
|
+
s.value && s.value.classList.remove("active");
|
|
63
|
+
}
|
|
64
|
+
return r(T, "onMouseUp"), C(
|
|
65
|
+
() => t.viewport,
|
|
66
|
+
() => {
|
|
67
|
+
t.page && t.viewport && o.value && f();
|
|
68
|
+
}
|
|
69
|
+
), C(
|
|
70
|
+
() => [t.highlightText, t.highlightOptions],
|
|
71
|
+
() => {
|
|
72
|
+
d(!0);
|
|
73
|
+
},
|
|
74
|
+
{ deep: !0 }
|
|
75
|
+
), D(() => {
|
|
76
|
+
t.page && t.viewport && o.value && f();
|
|
77
|
+
}), (e, n) => (O(), k("div", {
|
|
78
|
+
ref_key: "layer",
|
|
79
|
+
ref: o,
|
|
80
|
+
class: "textLayer",
|
|
81
|
+
style: { display: "block" },
|
|
82
|
+
onMousedown: y,
|
|
83
|
+
onMouseup: T
|
|
84
|
+
}, null, 544));
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
export {
|
|
88
|
+
A as default
|
|
89
|
+
};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index.cjs");exports.default=e.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var m=Object.defineProperty;var c=(t,n)=>m(t,"name",{value:n,configurable:!0});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),g=require("pdfjs-dist"),w=require("../linkService/index.cjs");function S(t){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(n,e,i.get?i:{enumerable:!0,get:c(()=>t[e],"get")})}}return n.default=t,Object.freeze(n)}c(S,"_interopNamespaceDefault");const _=S(g),y=o.defineComponent({__name:"XFA",props:{page:{},document:{},viewport:{}},emits:["xfaLoaded"],setup(t,{emit:n}){const e=t,i=n,r=o.ref();async function l(){var s,p;(p=(s=r.value).replaceChildren)==null||p.call(s);const a=o.toRaw(e.document),u=e.page,f=e.viewport;if(a.isPureXfa){const d=await u.getXfa(),v={div:r.value,viewport:f.clone({dontFlip:!0}),linkService:new w.SimpleLinkService,annotationStorage:a==null?void 0:a.annotationStorage,xfaHtml:d};_.XfaLayer.render(v),i("xfaLoaded")}}return c(l,"render"),o.watch(()=>e.viewport,()=>{e.page&&e.viewport&&r.value&&l()}),o.onMounted(()=>{e.page&&e.viewport&&r.value&&l()}),(a,u)=>(o.openBlock(),o.createElementBlock("div",{ref_key:"layer",ref:r,style:{display:"block"}},null,512))}});exports.default=y;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
var u = Object.defineProperty;
|
|
2
|
+
var l = (a, r) => u(a, "name", { value: r, configurable: !0 });
|
|
3
|
+
import { defineComponent as v, ref as w, watch as g, onMounted as y, openBlock as _, createElementBlock as k, toRaw as x } from "vue";
|
|
4
|
+
import * as S from "pdfjs-dist";
|
|
5
|
+
import { SimpleLinkService as L } from "../linkService/index.js";
|
|
6
|
+
const B = /* @__PURE__ */ v({
|
|
7
|
+
__name: "XFA",
|
|
8
|
+
props: {
|
|
9
|
+
page: {},
|
|
10
|
+
document: {},
|
|
11
|
+
viewport: {}
|
|
12
|
+
},
|
|
13
|
+
emits: ["xfaLoaded"],
|
|
14
|
+
setup(a, { emit: r }) {
|
|
15
|
+
const e = a, s = r, t = w();
|
|
16
|
+
async function n() {
|
|
17
|
+
var p, c;
|
|
18
|
+
(c = (p = t.value).replaceChildren) == null || c.call(p);
|
|
19
|
+
const o = x(e.document), i = e.page, f = e.viewport;
|
|
20
|
+
if (o.isPureXfa) {
|
|
21
|
+
const m = await i.getXfa(), d = {
|
|
22
|
+
div: t.value,
|
|
23
|
+
viewport: f.clone({ dontFlip: !0 }),
|
|
24
|
+
linkService: new L(),
|
|
25
|
+
annotationStorage: o == null ? void 0 : o.annotationStorage,
|
|
26
|
+
xfaHtml: m
|
|
27
|
+
};
|
|
28
|
+
S.XfaLayer.render(d), s("xfaLoaded");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return l(n, "render"), g(
|
|
32
|
+
() => e.viewport,
|
|
33
|
+
() => {
|
|
34
|
+
e.page && e.viewport && t.value && n();
|
|
35
|
+
}
|
|
36
|
+
), y(() => {
|
|
37
|
+
e.page && e.viewport && t.value && n();
|
|
38
|
+
}), (o, i) => (_(), k("div", {
|
|
39
|
+
ref_key: "layer",
|
|
40
|
+
ref: t,
|
|
41
|
+
style: { display: "block" }
|
|
42
|
+
}, null, 512));
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
export {
|
|
46
|
+
B as default
|
|
47
|
+
};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=;/* empty css */;/* empty css */exports.default=e.default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var g=Object.defineProperty;var c=(e,o)=>g(e,"name",{value:o,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f="internal-link",p="link",b="file-attachment",y="form-text",A="form-select",T="form-checkbox",h="form-radio",k="form-button",E=["click","dblclick","mouseover","input","change"];function u(e,o,n){const t=[];if(n)for(const s of n)s[e]===o&&t.push(s);return t}c(u,"getAnnotationsByKey");function i(e,o){return{type:e,data:o}}c(i,"buildAnnotationData");function r(e,o){switch(e.type){case"textarea":case"text":return i(y,{fieldName:e.name,value:e.value});case"select-one":case"select-multiple":const n=[];for(const s of e.options)n.push({value:s.value,label:s.label});const t=[];for(const s of e.selectedOptions)t.push({value:s.value,label:s.label});return i(A,{fieldName:e.name,value:t,options:n});case"checkbox":return i(T,{fieldName:e.name,checked:e.checked});case"radio":return i(h,{fieldName:e.name,...o});case"button":return i(k,{fieldName:e.name,...o})}}c(r,"inputAnnotation");function O(e){return i(b,e.file)}c(O,"fileAnnotation");async function x(e,o){if(e.dest){let n;if(typeof e.dest=="string"?n=await o.getDestination(e.dest):n=e.dest,!Array.isArray(n))return console.warn(`Destination "${n}" is not a valid destination (dest="${e.dest}")`),i(f,{referencedPage:null,offset:null});let t=null;n.length===5&&(t={left:e.dest[2],bottom:e.dest[3]});const[s]=n;if(Number.isInteger(s))return i(f,{referencedPage:Number(s)+1,offset:t});if(typeof s=="object"){const a=await o.getPageIndex(s);return i(f,{referencedPage:a+1,offset:t})}else return console.warn(`Destination "${s}" is not a valid destination (dest="${e.dest}")`),i(f,{referencedPage:null,offset:null})}else if(e.url)return i(p,{url:e.url,unsafeUrl:e.unsafeUrl})}c(x,"linkAnnotation");function N(e){const o=e.getElementsByTagName("span");for(const n of o){let t=n.textContent;const s=JSON.parse(n.dataset.l10nArgs??"{}");if(t)for(const a in s)t=t.replace(`{{${a}}}`,s[a]);n.textContent=t}}c(N,"mergePopupArgs");function B(e,o,n){var s;let t=e.target.parentNode;if(t.tagName==="DIV"&&(t=t.firstChild),t.className==="linkAnnotation"&&e.type==="click"){const a=(s=t.dataset)==null?void 0:s.annotationId;if(a)return x(u("id",a,n)[0],o)}else if(t.className.includes("popupAnnotation")||t.className.includes("textAnnotation"))N(t);else if(t.className.includes("fileAttachmentAnnotation")){N(t);const a=t.dataset.annotationId;if(a&&e.type==="dblclick")return O(u("id",a,n)[0])}else if(t.className.includes("textWidgetAnnotation")&&e.type==="input"){let a=t.getElementsByTagName("input")[0];return a||(a=t.getElementsByTagName("textarea")[0]),r(a)}else{if(t.className.includes("choiceWidgetAnnotation")&&e.type==="input")return r(t.getElementsByTagName("select")[0]);if(t.className.includes("buttonWidgetAnnotation checkBox")&&e.type==="change")return r(t.getElementsByTagName("input")[0]);if(t.className.includes("buttonWidgetAnnotation radioButton")&&e.type==="change"){const a=t.dataset.annotationId;if(a){const l=u("id",a,n)[0],d=[];for(const m of u("fieldName",l.fieldName,n))m.buttonValue&&d.push(m.buttonValue);return r(t.getElementsByTagName("input")[0],{value:l.buttonValue,defaultValue:l.fieldValue,options:d})}}else if(t.className.includes("buttonWidgetAnnotation pushButton")&&e.type==="click"){const a=t.dataset.annotationId;if(a){const l=u("id",a,n)[0];return l.resetForm?r({name:l.fieldName,type:"button"},{actions:l.actions,reset:!0}):r({name:l.fieldName,type:"button"},{actions:l.actions,reset:!1})}}}}c(B,"annotationEventsHandler");exports.EVENTS_TO_HANDLER=E;exports.annotationEventsHandler=B;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
var g = Object.defineProperty;
|
|
2
|
+
var c = (e, o) => g(e, "name", { value: o, configurable: !0 });
|
|
3
|
+
const f = "internal-link", p = "link", b = "file-attachment", y = "form-text", A = "form-select", h = "form-checkbox", T = "form-radio", k = "form-button", O = ["click", "dblclick", "mouseover", "input", "change"];
|
|
4
|
+
function u(e, o, n) {
|
|
5
|
+
const t = [];
|
|
6
|
+
if (n)
|
|
7
|
+
for (const s of n)
|
|
8
|
+
s[e] === o && t.push(s);
|
|
9
|
+
return t;
|
|
10
|
+
}
|
|
11
|
+
c(u, "getAnnotationsByKey");
|
|
12
|
+
function i(e, o) {
|
|
13
|
+
return { type: e, data: o };
|
|
14
|
+
}
|
|
15
|
+
c(i, "buildAnnotationData");
|
|
16
|
+
function r(e, o) {
|
|
17
|
+
switch (e.type) {
|
|
18
|
+
case "textarea":
|
|
19
|
+
case "text":
|
|
20
|
+
return i(y, {
|
|
21
|
+
fieldName: e.name,
|
|
22
|
+
value: e.value
|
|
23
|
+
});
|
|
24
|
+
case "select-one":
|
|
25
|
+
case "select-multiple":
|
|
26
|
+
const n = [];
|
|
27
|
+
for (const s of e.options)
|
|
28
|
+
n.push({
|
|
29
|
+
value: s.value,
|
|
30
|
+
label: s.label
|
|
31
|
+
});
|
|
32
|
+
const t = [];
|
|
33
|
+
for (const s of e.selectedOptions)
|
|
34
|
+
t.push({
|
|
35
|
+
value: s.value,
|
|
36
|
+
label: s.label
|
|
37
|
+
});
|
|
38
|
+
return i(A, {
|
|
39
|
+
fieldName: e.name,
|
|
40
|
+
value: t,
|
|
41
|
+
options: n
|
|
42
|
+
});
|
|
43
|
+
case "checkbox":
|
|
44
|
+
return i(h, {
|
|
45
|
+
fieldName: e.name,
|
|
46
|
+
checked: e.checked
|
|
47
|
+
});
|
|
48
|
+
case "radio":
|
|
49
|
+
return i(T, {
|
|
50
|
+
fieldName: e.name,
|
|
51
|
+
...o
|
|
52
|
+
});
|
|
53
|
+
case "button":
|
|
54
|
+
return i(k, {
|
|
55
|
+
fieldName: e.name,
|
|
56
|
+
...o
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
c(r, "inputAnnotation");
|
|
61
|
+
function x(e) {
|
|
62
|
+
return i(b, e.file);
|
|
63
|
+
}
|
|
64
|
+
c(x, "fileAnnotation");
|
|
65
|
+
async function B(e, o) {
|
|
66
|
+
if (e.dest) {
|
|
67
|
+
let n;
|
|
68
|
+
if (typeof e.dest == "string" ? n = await o.getDestination(e.dest) : n = e.dest, !Array.isArray(n))
|
|
69
|
+
return console.warn(`Destination "${n}" is not a valid destination (dest="${e.dest}")`), i(f, {
|
|
70
|
+
referencedPage: null,
|
|
71
|
+
offset: null
|
|
72
|
+
});
|
|
73
|
+
let t = null;
|
|
74
|
+
n.length === 5 && (t = {
|
|
75
|
+
left: e.dest[2],
|
|
76
|
+
bottom: e.dest[3]
|
|
77
|
+
});
|
|
78
|
+
const [s] = n;
|
|
79
|
+
if (Number.isInteger(s))
|
|
80
|
+
return i(f, {
|
|
81
|
+
referencedPage: Number(s) + 1,
|
|
82
|
+
offset: t
|
|
83
|
+
});
|
|
84
|
+
if (typeof s == "object") {
|
|
85
|
+
const a = await o.getPageIndex(s);
|
|
86
|
+
return i(f, {
|
|
87
|
+
referencedPage: a + 1,
|
|
88
|
+
offset: t
|
|
89
|
+
});
|
|
90
|
+
} else
|
|
91
|
+
return console.warn(`Destination "${s}" is not a valid destination (dest="${e.dest}")`), i(f, {
|
|
92
|
+
referencedPage: null,
|
|
93
|
+
offset: null
|
|
94
|
+
});
|
|
95
|
+
} else if (e.url)
|
|
96
|
+
return i(p, {
|
|
97
|
+
url: e.url,
|
|
98
|
+
unsafeUrl: e.unsafeUrl
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
c(B, "linkAnnotation");
|
|
102
|
+
function N(e) {
|
|
103
|
+
const o = e.getElementsByTagName("span");
|
|
104
|
+
for (const n of o) {
|
|
105
|
+
let t = n.textContent;
|
|
106
|
+
const s = JSON.parse(n.dataset.l10nArgs ?? "{}");
|
|
107
|
+
if (t)
|
|
108
|
+
for (const a in s) t = t.replace(`{{${a}}}`, s[a]);
|
|
109
|
+
n.textContent = t;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
c(N, "mergePopupArgs");
|
|
113
|
+
function E(e, o, n) {
|
|
114
|
+
var s;
|
|
115
|
+
let t = e.target.parentNode;
|
|
116
|
+
if (t.tagName === "DIV" && (t = t.firstChild), t.className === "linkAnnotation" && e.type === "click") {
|
|
117
|
+
const a = (s = t.dataset) == null ? void 0 : s.annotationId;
|
|
118
|
+
if (a) return B(u("id", a, n)[0], o);
|
|
119
|
+
} else if (t.className.includes("popupAnnotation") || t.className.includes("textAnnotation"))
|
|
120
|
+
N(t);
|
|
121
|
+
else if (t.className.includes("fileAttachmentAnnotation")) {
|
|
122
|
+
N(t);
|
|
123
|
+
const a = t.dataset.annotationId;
|
|
124
|
+
if (a && e.type === "dblclick") return x(u("id", a, n)[0]);
|
|
125
|
+
} else if (t.className.includes("textWidgetAnnotation") && e.type === "input") {
|
|
126
|
+
let a = t.getElementsByTagName("input")[0];
|
|
127
|
+
return a || (a = t.getElementsByTagName("textarea")[0]), r(a);
|
|
128
|
+
} else {
|
|
129
|
+
if (t.className.includes("choiceWidgetAnnotation") && e.type === "input")
|
|
130
|
+
return r(t.getElementsByTagName("select")[0]);
|
|
131
|
+
if (t.className.includes("buttonWidgetAnnotation checkBox") && e.type === "change")
|
|
132
|
+
return r(t.getElementsByTagName("input")[0]);
|
|
133
|
+
if (t.className.includes("buttonWidgetAnnotation radioButton") && e.type === "change") {
|
|
134
|
+
const a = t.dataset.annotationId;
|
|
135
|
+
if (a) {
|
|
136
|
+
const l = u("id", a, n)[0], d = [];
|
|
137
|
+
for (const m of u("fieldName", l.fieldName, n))
|
|
138
|
+
m.buttonValue && d.push(m.buttonValue);
|
|
139
|
+
return r(t.getElementsByTagName("input")[0], {
|
|
140
|
+
value: l.buttonValue,
|
|
141
|
+
defaultValue: l.fieldValue,
|
|
142
|
+
options: d
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
} else if (t.className.includes("buttonWidgetAnnotation pushButton") && e.type === "click") {
|
|
146
|
+
const a = t.dataset.annotationId;
|
|
147
|
+
if (a) {
|
|
148
|
+
const l = u("id", a, n)[0];
|
|
149
|
+
return l.resetForm ? r({ name: l.fieldName, type: "button" }, { actions: l.actions, reset: !0 }) : r({ name: l.fieldName, type: "button" }, { actions: l.actions, reset: !1 });
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
c(E, "annotationEventsHandler");
|
|
155
|
+
export {
|
|
156
|
+
O as EVENTS_TO_HANDLER,
|
|
157
|
+
E as annotationEventsHandler
|
|
158
|
+
};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var r=Object.defineProperty;var i=(t,e)=>r(t,"name",{value:e,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function s(t){return!!(typeof t=="object"&&t&&"gen"in t&&"num"in t)}i(s,"isRefProxy");async function c(t,e){return typeof e=="string"?t.getDestination(e):e}i(c,"getDestinationArray");async function o(t,e){return e&&s(e[0])?e[0]:null}i(o,"getDestinationRef");const u=i(t=>t.type==="XYZ"&&t.spec.length===3,"isXYZ"),f=i(t=>t.type==="Fit"&&t.spec.length===0,"isFit"),p=i(t=>t.type==="FitH"&&t.spec.length===1,"isFitH"),g=i(t=>t.type==="FitV"&&t.spec.length===1,"isFitV"),l=i(t=>t.type==="FitR"&&t.spec.length===4,"isFitR"),y=i(t=>t.type==="FitB"&&t.spec.length===0,"isFitB"),a=i(t=>t.type==="FitBH"&&t.spec.length===1,"isFitBH"),F=i(t=>t.type==="FitBV"&&t.spec.length===1,"isFitBV");function h(t,e){const n={type:t,spec:e};return u(n)||f(n)||p(n)||g(n)||l(n)||y(n)||a(n)||F(n)?n:(console.warn("no location type found for ",t,e),null)}i(h,"getLocation");const B=i(t=>t&&t.every(e=>!isNaN(e)),"isSpecLike");exports.getDestinationArray=c;exports.getDestinationRef=o;exports.getLocation=h;exports.isSpecLike=B;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
var r = Object.defineProperty;
|
|
2
|
+
var i = (t, e) => r(t, "name", { value: e, configurable: !0 });
|
|
3
|
+
function s(t) {
|
|
4
|
+
return !!(typeof t == "object" && t && "gen" in t && "num" in t);
|
|
5
|
+
}
|
|
6
|
+
i(s, "isRefProxy");
|
|
7
|
+
async function a(t, e) {
|
|
8
|
+
return typeof e == "string" ? t.getDestination(e) : e;
|
|
9
|
+
}
|
|
10
|
+
i(a, "getDestinationArray");
|
|
11
|
+
async function h(t, e) {
|
|
12
|
+
return e && s(e[0]) ? e[0] : null;
|
|
13
|
+
}
|
|
14
|
+
i(h, "getDestinationRef");
|
|
15
|
+
const c = /* @__PURE__ */ i((t) => t.type === "XYZ" && t.spec.length === 3, "isXYZ"), o = /* @__PURE__ */ i((t) => t.type === "Fit" && t.spec.length === 0, "isFit"), u = /* @__PURE__ */ i((t) => t.type === "FitH" && t.spec.length === 1, "isFitH"), f = /* @__PURE__ */ i((t) => t.type === "FitV" && t.spec.length === 1, "isFitV"), p = /* @__PURE__ */ i((t) => t.type === "FitR" && t.spec.length === 4, "isFitR"), g = /* @__PURE__ */ i((t) => t.type === "FitB" && t.spec.length === 0, "isFitB"), l = /* @__PURE__ */ i((t) => t.type === "FitBH" && t.spec.length === 1, "isFitBH"), F = /* @__PURE__ */ i((t) => t.type === "FitBV" && t.spec.length === 1, "isFitBV");
|
|
16
|
+
function B(t, e) {
|
|
17
|
+
const n = { type: t, spec: e };
|
|
18
|
+
return c(n) || o(n) || u(n) || f(n) || p(n) || g(n) || l(n) || F(n) ? n : (console.warn("no location type found for ", t, e), null);
|
|
19
|
+
}
|
|
20
|
+
i(B, "getLocation");
|
|
21
|
+
const H = /* @__PURE__ */ i((t) => t && t.every((e) => !isNaN(e)), "isSpecLike");
|
|
22
|
+
export {
|
|
23
|
+
a as getDestinationArray,
|
|
24
|
+
h as getDestinationRef,
|
|
25
|
+
B as getLocation,
|
|
26
|
+
H as isSpecLike
|
|
27
|
+
};
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var b=Object.defineProperty;var g=(r,l)=>b(r,"name",{value:l,configurable:!0});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function v(r,l,h){const t=[];for(const a of r.items)if(a.hasEOL)if(a.str.endsWith("-")){const p=a.str.lastIndexOf("-");t.push(a.str.substring(0,p))}else t.push(a.str,`
|
|
2
|
+
`);else t.push(a.str);const n=t.join("").replace(/\n/g," "),e=["g"];h.ignoreCase&&e.push("i");let o=l.trim().replace(/[.*+?^${}()|[\]\\]/g,"\\$&");h.completeWords&&(o=`\\b${o}\\b`);const u=new RegExp(o,e.join("")),s=[];let i;for(;(i=u.exec(n))!==null;)s.push([i.index,i[0].length,i[0]]);return s}g(v,"searchQuery");function y(r,l){function h(s){return s.hasEOL?s.str.endsWith("-")?-1:1:0}g(h,"endOfLineOffset");let t=0,n=0;const e=l.items,o=e.length-1,u=[];for(let s=0;s<r.length;s++){let i=r[s][0];for(;t!==o&&i>=n+e[t].str.length;){const c=e[t];n+=c.str.length+h(c),t++}const a={idx:t,offset:i-n};for(i+=r[s][1];t!==o&&i>n+e[t].str.length;){const c=e[t];n+=c.str.length+h(c),t++}const p={idx:t,offset:i-n};u.push({start:a,end:p,str:r[s][2],oindex:r[s][0]})}return u}g(y,"convertMatches");function M(r,l,h){function t(n,e=-1,o=-1){const u=l.items[n],s=[];let i="",a="",p="",c=h[n];if(!c)return;if(c.nodeType===Node.TEXT_NODE){const d=document.createElement("span");c.before(d),d.append(c),h[n]=d,c=d}e>=0&&o>=0?i=u.str.substring(e,o):e<0&&o<0?i=u.str:e>=0?i=u.str.substring(e):o>=0&&(i=u.str.substring(0,o));const T=document.createTextNode(i),m=document.createElement("span");if(m.className="highlight appended",m.append(T),s.push(m),e>0)if(c.childNodes.length===1&&c.childNodes[0].nodeType===Node.TEXT_NODE){a=u.str.substring(0,e);const d=document.createTextNode(a);s.unshift(d)}else{let d=0;const N=[],E=c.childNodes||[];for(const f of E){const x=f.nodeType===Node.TEXT_NODE?f.nodeValue:f.firstChild.nodeValue;d+=x.length,d<=e?N.push(f):e>=d-x.length&&o<=d&&N.push(document.createTextNode(x.substring(0,e-(d-x.length))))}s.unshift(...N)}if(o>0){p=u.str.substring(o);const d=document.createTextNode(p);s.push(d)}c.replaceChildren(...s)}g(t,"appendHighlightDiv");for(const n of r)if(n.start.idx===n.end.idx)t(n.start.idx,n.start.offset,n.end.offset);else for(let e=n.start.idx,o=n.end.idx;e<=o;e++)e===n.start.idx?t(e,n.start.offset):e===n.end.idx?t(e,-1,n.end.offset):t(e)}g(M,"highlightMatches");function C(r,l){const h=r.items.map(t=>t.str);for(let t=0;t<l.length;t++){const n=l[t];if(n&&n.nodeType!==Node.TEXT_NODE){const e=document.createTextNode(h[t]);n.replaceChildren(e)}}}g(C,"resetDivs");function D(r,l,h){const t=[];for(const n of r){const e=v(l,n,h);t.push(...y(e,l))}return t}g(D,"findMatches");exports.findMatches=D;exports.highlightMatches=M;exports.resetDivs=C;
|