@buildocsdev/sdk 1.1.12 → 1.1.13
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/{chunk-EZRYTFEF.js → chunk-3KS2H3RQ.js} +1 -1
- package/dist/{chunk-NFXYWVU4.js → chunk-DB2DYK3E.js} +1 -1
- package/dist/{fileviewer-DREV3IV3.js → fileviewer-3RB5ZB4B.js} +1 -1
- package/dist/form.js +1 -1
- package/dist/{formeditor-QJH4RKPB.js → formeditor-GHVV3GVX.js} +1 -1
- package/dist/formeditor.js +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/pdfviewer-CYJI3EZN.js +2 -0
- package/package.json +1 -1
- package/dist/pdfviewer-3X5PCX7Y.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-7RKPIXVG.js';import {b}from'./chunk-LBMVBVXW.js';import {q}from'./chunk-3QKKOFXC.js';import'./chunk-AR42AC7J.js';import'./chunk-5TBO732O.js';import {useState,useRef}from'react';import {pdfjs,Document,Page}from'react-pdf';import'react-pdf/dist/Page/TextLayer.css';import'react-pdf/dist/Page/AnnotationLayer.css';import U from'@mui/icons-material/ZoomIn';import A from'@mui/icons-material/ZoomOut';import O from'@mui/icons-material/RotateLeft';import j from'@mui/icons-material/RotateRight';import T from'@mui/material/Box';import i from'@mui/material/IconButton';import V from'@mui/icons-material/CloudDownloadOutlined';import {useTranslation}from'react-i18next';import {jsxs,jsx}from'react/jsx-runtime';pdfjs.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${pdfjs.version}/build/pdf.worker.min.mjs`;var M=c=>{let n=window.atob(c),a=n.length,l=new Uint8Array(a);for(let e=0;e<a;e++)l[e]=n.charCodeAt(e);return new Blob([l],{type:"application/pdf"})},N=({fileName:c,fileInbase64:n})=>{let[a$1,l]=useState(null),[e,f]=useState(1.5),[h,u]=useState(0),p=useRef(null),{events:P}=a(p),{viewPort:x}=b(),{t:g}=useTranslation(),I=()=>{f(e+.3);},L=()=>{e>.3&&f(e-.3);},R=()=>{u(t=>t+90);},S=()=>{u(t=>t-90);},B=({numPages:t})=>{l(t);},k=t=>{if(t==null)return;let s=M(t),r=document.createElement("a");r.href=URL.createObjectURL(s),r.download=c,document.body.appendChild(r),r.click(),document.body.removeChild(r);};return jsxs("div",{style:{display:"flex",height:"95vh",minWidth:300},children:[jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",maxWidth:"4.3em"},children:jsxs("div",{style:{textAlign:"center"},children:[jsx(i,{onPointerUp:I,children:jsx(U,{fontSize:"large"})}),jsx(i,{onPointerUp:L,children:jsx(A,{fontSize:"large"})}),jsx(i,{onPointerUp:R,children:jsx(j,{fontSize:"large"})}),jsx(i,{onPointerUp:S,children:jsx(O,{fontSize:"large"})}),jsx(T,{sx:{mt:5}}),jsx(i,{onPointerUp:()=>k(n),children:jsx(V,{fontSize:"large"})})]})}),jsx("div",{ref:p,...P,style:{overflow:"auto",whiteSpace:"nowrap",display:"flex",justifyContent:x.isMobileDevice?"none":"center",width:"100%",height:"100vh",cursor:"grab"},children:jsx("div",{className:"pdf-viewer-isolate",children:jsx(Document,{file:{data:n?atob(n):void 0},onLoadSuccess:B,loading:jsx(q,{text:g("Loading file..."),size:120,textVariant:"body2",variant:void 0}),children:Array.from(new Array(a$1),(t,s)=>jsx(Page,{pageNumber:s+1,scale:e,rotate:h,renderTextLayer:false,renderAnnotationLayer:false,loading:jsx(q,{text:g("Loading file..."),size:120,textVariant:"body2",variant:void 0})},`page_${s+1}`))})})})]})},no=N;
|
|
2
|
+
export{no as default};
|
package/package.json
CHANGED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a}from'./chunk-7RKPIXVG.js';import {b}from'./chunk-LBMVBVXW.js';import {q}from'./chunk-3QKKOFXC.js';import'./chunk-AR42AC7J.js';import'./chunk-5TBO732O.js';import R,{useState,useRef}from'react';import B from'@mui/icons-material/ZoomIn';import U from'@mui/icons-material/ZoomOut';import D from'@mui/icons-material/RotateLeft';import O from'@mui/icons-material/RotateRight';import j from'@mui/material/Box';import l from'@mui/material/IconButton';import A from'@mui/icons-material/CloudDownloadOutlined';import {useTranslation}from'react-i18next';import {jsx,jsxs}from'react/jsx-runtime';var V=R.lazy(()=>new Function('return import("react-pdf")')().then(s=>{let{Document:n,Page:i,pdfjs:r}=s;return r.GlobalWorkerOptions.workerSrc=`https://unpkg.com/pdfjs-dist@${r.version}/build/pdf.worker.min.mjs`,{default:({fileInbase64:d,zoom:g,rotation:c,onLoadSuccess:m,numPages:b,t:u})=>jsx(n,{file:{data:d?atob(d):void 0},onLoadSuccess:m,loading:jsx(q,{text:u("Loading file..."),size:120,textVariant:"body2",variant:void 0}),children:Array.from(new Array(b),(P,f)=>jsx(i,{pageNumber:f+1,scale:g,rotate:c,renderTextLayer:false,renderAnnotationLayer:false,loading:jsx(q,{text:u("Loading file..."),size:120,textVariant:"body2",variant:void 0})},`page_${f+1}`))})}}).catch(()=>({default:(()=>null)}))),Z=s=>{let n=window.atob(s),i=n.length,r=new Uint8Array(i);for(let t=0;t<i;t++)r[t]=n.charCodeAt(t);return new Blob([r],{type:"application/pdf"})},M=({fileName:s,fileInbase64:n})=>{let[i,r]=useState(null),[t,d]=useState(1.5),[g,c]=useState(0),m=useRef(null),{events:b$1}=a(m),{viewPort:u}=b(),{t:P}=useTranslation(),f=()=>d(t+.3),L=()=>{t>.3&&d(t-.3);},S=()=>c(o=>o+90),x=()=>c(o=>o-90),I=({numPages:o})=>r(o),z=o=>{if(o==null)return;let k=Z(o),a=document.createElement("a");a.href=URL.createObjectURL(k),a.download=s,document.body.appendChild(a),a.click(),document.body.removeChild(a),URL.revokeObjectURL(a.href);};return jsxs("div",{style:{display:"flex",height:"95vh",minWidth:300},children:[jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",maxWidth:"4.3em"},children:jsxs("div",{style:{textAlign:"center"},children:[jsx(l,{onPointerUp:f,children:jsx(B,{fontSize:"large"})}),jsx(l,{onPointerUp:L,children:jsx(U,{fontSize:"large"})}),jsx(l,{onPointerUp:S,children:jsx(O,{fontSize:"large"})}),jsx(l,{onPointerUp:x,children:jsx(D,{fontSize:"large"})}),jsx(j,{sx:{mt:5}}),jsx(l,{onPointerUp:()=>z(n),children:jsx(A,{fontSize:"large"})})]})}),jsx("div",{ref:m,...b$1,style:{overflow:"auto",whiteSpace:"nowrap",display:"flex",justifyContent:u.isMobileDevice?"none":"center",width:"100%",height:"100vh",cursor:"grab"},children:jsx("div",{className:"pdf-viewer-isolate",children:jsx(R.Suspense,{fallback:jsx(q,{text:P("Loading file..."),size:120,textVariant:"body2",variant:void 0}),children:jsx(V,{fileInbase64:n,zoom:t,rotation:g,onLoadSuccess:I,numPages:i,t:P})})})})]})},X=M;
|
|
2
|
-
export{X as default};
|