@nice2dev/ui 1.1.6 → 1.1.7
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/CHANGELOG.md +52 -0
- package/README.md +50 -29
- package/css/legacy-bg-text-aliases.css +65 -61
- package/dist/NiceCodeEditor-Bc81wiaN.js +1134 -0
- package/dist/NiceCodeEditor-D6f8KdHN.js +1134 -0
- package/dist/NiceCodeEditor-DE3saxyt.cjs +260 -0
- package/dist/NiceCodeEditor-DZM16My5.cjs +260 -0
- package/dist/NiceCodeEditor-HqmcJjmZ.js +1179 -0
- package/dist/NiceColorPicker-6EqXaDj0.cjs +1 -0
- package/dist/NiceColorPicker-BiEWqWnd.js +596 -0
- package/dist/NiceColorPicker-Cuc6YXqz.cjs +1 -0
- package/dist/NiceColorPicker-DMATcNWG.js +596 -0
- package/dist/NiceColorPicker-R3O1nemp.js +596 -0
- package/dist/NiceConfirmDialog-B0e10fRL.cjs +1 -0
- package/dist/NiceConfirmDialog-BBDgEMHv.js +81 -0
- package/dist/NiceConfirmDialog-C7kdr8jJ.js +81 -0
- package/dist/NiceConfirmDialog-DMHqPfFM.js +81 -0
- package/dist/NiceConfirmDialog-ZJpQLQQS.cjs +1 -0
- package/dist/NiceDataGrid-BzUw4dSu.cjs +10 -0
- package/dist/NiceDataGrid-CPKcVOVz.js +1743 -0
- package/dist/NiceDataGrid-DJr33WMy.cjs +10 -0
- package/dist/NiceDataGrid-D_4gZ1Hu.js +1736 -0
- package/dist/NiceDataGrid-DlUAaXhD.js +1736 -0
- package/dist/NiceDocumentViewer-8ghRVtfO.js +672 -0
- package/dist/NiceDocumentViewer-ChWtA_Ry.cjs +180 -0
- package/dist/NiceDocumentViewer-DwLUV7Tc.js +672 -0
- package/dist/NiceDocumentViewer-goMzF1w3.cjs +180 -0
- package/dist/NiceDocumentViewer-gt1mxzP8.js +672 -0
- package/dist/NiceForm-CHEAHxDw.js +4805 -0
- package/dist/NiceForm-CJUp1CL0.cjs +1 -0
- package/dist/NiceForm-Cp_RH3Yj.js +4805 -0
- package/dist/NiceForm-a6tGr6ss.js +4819 -0
- package/dist/NiceForm-jU89oe2S.cjs +1 -0
- package/dist/NiceGantt-BnQwyTfG.cjs +1 -0
- package/dist/NiceGantt-D8coFAvK.js +328 -0
- package/dist/NiceGantt-DOZfT6r5.js +328 -0
- package/dist/NiceGantt-DQzH1V-R.js +328 -0
- package/dist/NiceGantt-jQ8ZpXko.cjs +1 -0
- package/dist/NiceHtmlEditor-B1nlXJNW.cjs +10 -0
- package/dist/NiceHtmlEditor-Bv3VqJPG.js +862 -0
- package/dist/NiceHtmlEditor-CKsGj-Ei.cjs +10 -0
- package/dist/NiceHtmlEditor-CloMgyzg.js +841 -0
- package/dist/NiceHtmlEditor-DUAHmkWI.js +841 -0
- package/dist/NiceLoginForm-Ce_QLnLf.js +736 -0
- package/dist/NiceLoginForm-DLpNTQlR.cjs +1 -0
- package/dist/NiceLoginForm-Dg0286Cc.js +736 -0
- package/dist/NiceLoginForm-X05Vadeg.js +708 -0
- package/dist/NiceLoginForm-f_dBCnUi.cjs +1 -0
- package/dist/NiceMention-BByI4nFG.js +11120 -0
- package/dist/NiceMention-C2TPiMph.cjs +430 -0
- package/dist/NiceMention-C67vT6m0.js +11145 -0
- package/dist/NiceMention-D1cdy63w.cjs +430 -0
- package/dist/NiceMention-QIuggb9Y.js +11122 -0
- package/dist/NiceMention.css +1 -1
- package/dist/NiceModal-CHaan9al.js +95 -0
- package/dist/NiceModal-Czq6OEAT.js +95 -0
- package/dist/NiceModal-D-HFwawr.js +95 -0
- package/dist/NiceModal-DOy2XTzc.cjs +1 -0
- package/dist/NiceModal-DkawKzEE.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-1CsP8Zst.js +6997 -0
- package/dist/NiceModuleLifecyclePanel-Bkx4Yg-3.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-C5oYtczk.js +6999 -0
- package/dist/NiceModuleLifecyclePanel-DCcy2yYi.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-DqdgW-0s.js +7004 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NicePagination-7od5KUa3.cjs +1 -0
- package/dist/NicePagination-DMrkR8hH.cjs +1 -0
- package/dist/NicePagination-DQmZpsSQ.js +179 -0
- package/dist/NicePagination-DipQRjPq.js +172 -0
- package/dist/NicePagination-KhlVXYaT.js +172 -0
- package/dist/NicePivotGrid-B-KthuqL.cjs +152 -0
- package/dist/NicePivotGrid-CLCTHkKO.cjs +152 -0
- package/dist/NicePivotGrid-DV54FCsH.js +1174 -0
- package/dist/NicePivotGrid-DoWLUPUs.js +1167 -0
- package/dist/NicePivotGrid-etwpfccz.js +1167 -0
- package/dist/NiceSavedQueryPanel-BABkTNc5.js +5129 -0
- package/dist/NiceSavedQueryPanel-Cfeig83P.cjs +586 -0
- package/dist/NiceSavedQueryPanel-DTWRLseb.cjs +586 -0
- package/dist/NiceSavedQueryPanel-Dy154sxE.js +5129 -0
- package/dist/NiceSavedQueryPanel-v7AffOOe.js +5129 -0
- package/dist/NiceSavedQueryPanel.css +1 -1
- package/dist/NiceScheduler-BEgB7ZgF.cjs +5 -0
- package/dist/NiceScheduler-C9JprsEI.cjs +5 -0
- package/dist/NiceScheduler-DSP-PPh0.js +1645 -0
- package/dist/NiceScheduler-DuPnaA3t.js +1652 -0
- package/dist/NiceScheduler-Oa89YZx9.js +1645 -0
- package/dist/NiceSelect-A336yeLZ.js +433 -0
- package/dist/NiceSelect-B5hTbqi2.js +433 -0
- package/dist/NiceSelect-BYSgDYzq.cjs +1 -0
- package/dist/NiceSelect-Dudf2T5T.js +433 -0
- package/dist/NiceSelect-DwBAIrX7.cjs +1 -0
- package/dist/NiceWindow-B6zjBTl9.cjs +1 -0
- package/dist/NiceWindow-BKQEx7Vf.js +1623 -0
- package/dist/NiceWindow-BnTH7Gy0.js +1623 -0
- package/dist/NiceWindow-CZN9NVZw.cjs +1 -0
- package/dist/NiceWindow-lxtPR7yZ.js +1623 -0
- package/dist/NiceWindow.css +1 -1
- package/dist/charts-B8_V3_nq.cjs +882 -0
- package/dist/charts-BZgyyybE.js +31933 -0
- package/dist/charts-FuDk5-r6.js +31958 -0
- package/dist/charts-INj3yFo5.js +31946 -0
- package/dist/charts-NolNXKUL.cjs +882 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.css +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-A_A6c7an.js +795 -0
- package/dist/core-B2iH2J_X.js +795 -0
- package/dist/core-BmspZEfD.js +795 -0
- package/dist/core-DAfLOet6.cjs +1 -0
- package/dist/core-ZG3bgnBR.cjs +1 -0
- package/dist/data-branching-B3TOqXAO.cjs +1 -0
- package/dist/data-branching-BUGiICDZ.js +6275 -0
- package/dist/data-branching-DMXmcocj.js +6275 -0
- package/dist/data-branching-YE8P9M5P.js +6275 -0
- package/dist/data-branching-t6uhAwIm.cjs +1 -0
- package/dist/data-branching.cjs +1 -1
- package/dist/data-branching.mjs +1 -1
- package/dist/data.cjs +1 -1
- package/dist/data.d.ts +7 -2
- package/dist/data.mjs +3 -3
- package/dist/devops-BhV3OmF7.js +8285 -0
- package/dist/devops-BqUxnbRi.cjs +17 -0
- package/dist/devops-Bx-Qwj9w.cjs +17 -0
- package/dist/devops-DYZatW45.js +8251 -0
- package/dist/devops-R98k2zpd.js +8251 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.d.ts +29 -16
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +35 -20
- package/dist/editors.mjs +7 -7
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.mjs +3 -3
- package/dist/index.cjs +445 -445
- package/dist/index.css +1 -1
- package/dist/index.d.ts +190 -111
- package/dist/index.mjs +16635 -16351
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.d.ts +31 -18
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +17 -14
- package/dist/navigation.mjs +130 -130
- package/dist/no-code-BPaAS4wW.cjs +332 -0
- package/dist/no-code-CBwUVL1i.js +7447 -0
- package/dist/no-code-CjktkQ50.js +7447 -0
- package/dist/no-code-DW2NrRba.js +7447 -0
- package/dist/no-code-DmFxrZ5T.cjs +332 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.d.ts +2 -2
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +4 -4
- package/dist/overlays.mjs +2 -2
- package/dist/pickerCommons-C4XWRUvH.cjs +1 -0
- package/dist/pickerCommons-C_BpYs_m.cjs +1 -0
- package/dist/pickerCommons-DAOXH_u5.js +1122 -0
- package/dist/pickerCommons-Dn4wnDco.js +1122 -0
- package/dist/pickerCommons-DskswPS5.js +1122 -0
- package/dist/pickerCommons.css +1 -1
- package/dist/style.css +7 -7
- package/package.json +3 -3
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("./charts-NolNXKUL.cjs"),n=require("react");function ve(t,a){const i=t.split(".").pop()?.toLowerCase().split("?")[0]??"";return i==="pdf"?"pdf":["jpg","jpeg","png","gif","bmp","webp","svg","ico","tiff","tif"].includes(i)?"image":["mp4","webm","ogg","mov","avi","mkv"].includes(i)?"video":["mp3","wav","flac","aac","m4a","ogg"].includes(i)?"audio":["doc","docx","xls","xlsx","ppt","pptx","odt","ods","odp"].includes(i)?"office":i==="html"||i==="htm"?"html":["txt","log","md","json","xml","csv","yaml","yml"].includes(i)?"text":"unknown"}function ge(t){if(t===0)return"0 B";const a=1024,i=["B","KB","MB","GB"],o=Math.floor(Math.log(t)/Math.log(a));return parseFloat((t/Math.pow(a,o)).toFixed(1))+" "+i[o]}function we(t){const a=Math.floor(t/3600),i=Math.floor(t%3600/60),o=Math.floor(t%60);return a>0?`${a}:${i.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`:`${i}:${o.toString().padStart(2,"0")}`}function xe({src:t,page:a,zoom:i,rotation:o,onPageChange:m,onLoad:s,onError:p,workerUrl:u}){const h=n.useRef(null),y=n.useRef(null),[g,B]=n.useState(0),[I,T]=n.useState(!1);return n.useEffect(()=>{let x=!1;return(async()=>{try{let l;if(l=window.pdfjsLib,!l)try{l=await new Function("m","return import(m)")("pdfjs-dist")}catch{throw new Error('PDF.js library not found. Please install pdfjs-dist or include it via CDN: <script src="https://cdnjs.cloudflare.com/ajax/libs/pdf.js/3.11.174/pdf.min.js"><\/script>')}u?l.GlobalWorkerOptions.workerSrc=u:l.version&&(l.GlobalWorkerOptions.workerSrc=`https://cdnjs.cloudflare.com/ajax/libs/pdf.js/${l.version}/pdf.worker.min.js`);const w=await l.getDocument(t).promise;if(x)return;y.current=w,B(w.numPages),s({name:t.split("/").pop()??"document.pdf",type:"pdf",mimeType:"application/pdf",pageCount:w.numPages})}catch(l){x||p(l instanceof Error?l:new Error("Failed to load PDF"))}})(),()=>{x=!0}},[t,u,s,p]),n.useEffect(()=>{const x=y.current,k=h.current;if(!x||!k||g===0)return;let l=!1;return(async()=>{if(!I){T(!0);try{const w=Math.max(1,Math.min(a,g)),N=await x.getPage(w);if(l)return;const P=N.getViewport({scale:i,rotation:o}),E=k.getContext("2d");if(!E)return;k.height=P.height,k.width=P.width,await N.render({canvasContext:E,viewport:P}).promise}catch(w){console.error("Error rendering PDF page:",w)}finally{l||T(!1)}}})(),()=>{l=!0}},[a,i,o,g,I]),e.jsx("div",{className:"nice-document-viewer__pdf",children:e.jsx("canvas",{ref:h,className:"nice-document-viewer__pdf-canvas"})})}function be({src:t,zoom:a,rotation:i,onLoad:o,onError:m}){const[s,p]=n.useState(!1),u=n.useCallback(y=>{const g=y.currentTarget;p(!0),o({name:t.split("/").pop()??"image",type:"image",width:g.naturalWidth,height:g.naturalHeight})},[t,o]),h=n.useCallback(()=>{m(new Error("Failed to load image"))},[m]);return e.jsx("div",{className:"nice-document-viewer__image",children:e.jsx("img",{src:t,alt:"Document",onLoad:u,onError:h,style:{transform:`scale(${a}) rotate(${i}deg)`,opacity:s?1:0},draggable:!1})})}function _e({src:t,type:a,onLoad:i,onError:o}){const m=n.useRef(null),s=n.useCallback(()=>{const u=m.current;if(!u)return;const h={name:t.split("/").pop()??(a==="video"?"video":"audio"),type:a,duration:u.duration};a==="video"&&"videoWidth"in u&&(h.width=u.videoWidth,h.height=u.videoHeight),i(h)},[t,a,i]),p=n.useCallback(()=>{o(new Error(`Failed to load ${a}`))},[a,o]);return a==="video"?e.jsx("div",{className:"nice-document-viewer__video",children:e.jsx("video",{ref:m,src:t,controls:!0,onLoadedMetadata:s,onError:p})}):e.jsx("div",{className:"nice-document-viewer__audio",children:e.jsx("audio",{ref:m,src:t,controls:!0,onLoadedMetadata:s,onError:p})})}function je({src:t,viewerUrl:a,onLoad:i}){const[o,m]=n.useState(!1),p=`${a??"https://view.officeapps.live.com/op/embed.aspx?src="}${encodeURIComponent(t)}`,u=n.useCallback(()=>{m(!0),i({name:t.split("/").pop()??"document",type:"office"})},[t,i]);return e.jsx("div",{className:"nice-document-viewer__office",children:e.jsx("iframe",{src:p,onLoad:u,title:"Office Document",style:{opacity:o?1:0}})})}function ye({src:t,onLoad:a,onError:i}){const[o,m]=n.useState(null);return n.useEffect(()=>{fetch(t).then(s=>{if(!s.ok)throw new Error("Failed to fetch text");return s.text()}).then(s=>{m(s),a({name:t.split("/").pop()??"text",type:"text",size:s.length})}).catch(s=>{i(s instanceof Error?s:new Error("Failed to load text"))})},[t,a,i]),o===null?e.jsx("div",{className:"nice-document-viewer__loading",children:"Loading..."}):e.jsx("div",{className:"nice-document-viewer__text",children:e.jsx("pre",{children:o})})}function ke({src:t,onLoad:a}){const i=n.useCallback(()=>{a({name:t.split("/").pop()??"page.html",type:"html"})},[t,a]);return e.jsx("div",{className:"nice-document-viewer__html",children:e.jsx("iframe",{src:t,onLoad:i,title:"HTML Document",sandbox:"allow-same-origin allow-scripts"})})}const Ce=n.forwardRef(function(a,i){const{src:o,type:m,name:s,height:p=600,width:u="100%",zoom:h=1,minZoom:y=.25,maxZoom:g=4,page:B=1,showToolbar:I=!0,showPageNav:T=!0,showZoomControls:x=!0,showFullscreen:k=!0,showDownload:l=!0,showPrint:H=!0,showRotate:w=!0,enableKeyboard:N=!0,onLoad:P,onError:E,onPageChange:G,onZoomChange:A,pdfWorkerUrl:ne,officeViewerUrl:te,loading:oe,errorContent:O,className:ie,"data-testid":ae}=a,U=n.useRef(null),[c,re]=n.useState(null),[b,ce]=n.useState(B),[C,se]=n.useState(h),[Y,de]=n.useState(0),[Z,J]=n.useState(!1),[$,le]=n.useState(null),[ue,Q]=n.useState(!0),_=n.useMemo(()=>m??ve(o),[o,m]),z=n.useCallback(r=>{re(r),Q(!1),P?.(r)},[P]),K=n.useCallback(r=>{le(r),Q(!1),E?.(r)},[E]),f=n.useCallback(r=>{const d=c?.pageCount??1,X=Math.max(1,Math.min(r,d));ce(X),G?.(X)},[c?.pageCount,G]),S=n.useCallback(()=>f(b+1),[b,f]),D=n.useCallback(()=>f(b-1),[b,f]),j=n.useCallback(r=>{const d=Math.max(y,Math.min(r,g));se(d),A?.(d)},[y,g,A]),L=n.useCallback(()=>j(C*1.25),[C,j]),M=n.useCallback(()=>j(C/1.25),[C,j]),F=n.useCallback(()=>j(1),[j]),V=n.useCallback(r=>{de(d=>(d+r)%360)},[]),W=n.useCallback(()=>{const r=document.createElement("a");r.href=o,r.download=s??c?.name??"document",document.body.appendChild(r),r.click(),document.body.removeChild(r)},[o,s,c?.name]),q=n.useCallback(()=>{const r=window.open(o,"_blank");r&&(r.onload=()=>r.print())},[o]),R=n.useCallback(()=>{U.current&&(Z?(document.exitFullscreen?.(),J(!1)):(U.current.requestFullscreen?.(),J(!0)))},[Z]);n.useEffect(()=>{if(!N)return;const r=d=>{switch(d.key){case"ArrowRight":case"PageDown":S();break;case"ArrowLeft":case"PageUp":D();break;case"Home":f(1);break;case"End":f(c?.pageCount??1);break;case"+":case"=":(d.ctrlKey||d.metaKey)&&(d.preventDefault(),L());break;case"-":(d.ctrlKey||d.metaKey)&&(d.preventDefault(),M());break;case"0":(d.ctrlKey||d.metaKey)&&(d.preventDefault(),F());break;case"f":(d.ctrlKey||d.metaKey)&&(d.preventDefault(),R());break}};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[N,S,D,f,c?.pageCount,L,M,F,R]),n.useImperativeHandle(i,()=>({goToPage:f,nextPage:S,prevPage:D,setZoom:j,zoomIn:L,zoomOut:M,resetZoom:F,rotate:V,download:W,print:q,toggleFullscreen:R,getInfo:()=>c}),[f,S,D,j,L,M,F,V,W,q,R,c]);const me=()=>{if($)return(typeof O=="function"?O($):O)??e.jsx("div",{className:"nice-document-viewer__error",children:e.jsxs("span",{children:[e.jsx(v.oa,{name:"warning",size:14})," ",$.message]})});switch(_){case"pdf":return e.jsx(xe,{src:o,page:b,zoom:C,rotation:Y,onPageChange:f,onLoad:z,onError:K,workerUrl:ne});case"image":return e.jsx(be,{src:o,zoom:C,rotation:Y,onLoad:z,onError:K});case"video":case"audio":return e.jsx(_e,{src:o,type:_,onLoad:z,onError:K});case"office":return e.jsx(je,{src:o,viewerUrl:te,onLoad:z});case"text":return e.jsx(ye,{src:o,onLoad:z,onError:K});case"html":return e.jsx(ke,{src:o,onLoad:z});default:return e.jsxs("div",{className:"nice-document-viewer__unknown",children:[e.jsxs("span",{children:[e.jsx(v.oa,{name:"file",size:14})," Unknown document type"]}),e.jsx("button",{type:"button",onClick:W,children:"Download"})]})}},pe=T&&_==="pdf"&&(c?.pageCount??0)>1,fe=x&&(_==="pdf"||_==="image"),he=w&&(_==="pdf"||_==="image");return e.jsxs("div",{ref:U,className:`nice-document-viewer ${Z?"nice-document-viewer--fullscreen":""} ${ie??""}`,style:{height:p,width:u},"data-testid":ae,"data-type":_,children:[I&&e.jsxs("div",{className:"nice-document-viewer__toolbar",children:[e.jsx("div",{className:"nice-document-viewer__toolbar-left",children:pe&&e.jsxs("div",{className:"nice-document-viewer__pagination",children:[e.jsx("button",{type:"button",onClick:D,disabled:b<=1,"aria-label":"Previous page",children:e.jsx(v.oa,{name:"chevron-left",size:16})}),e.jsxs("span",{children:[e.jsx("input",{type:"number",value:b,onChange:r=>f(parseInt(r.target.value,10)),min:1,max:c?.pageCount??1}),"/ ",c?.pageCount??1]}),e.jsx("button",{type:"button",onClick:S,disabled:b>=(c?.pageCount??1),"aria-label":"Next page",children:e.jsx(v.oa,{name:"chevron-right",size:16})})]})}),e.jsxs("div",{className:"nice-document-viewer__toolbar-center",children:[fe&&e.jsxs("div",{className:"nice-document-viewer__zoom",children:[e.jsx("button",{type:"button",onClick:M,"aria-label":"Zoom out",children:"−"}),e.jsxs("span",{children:[Math.round(C*100),"%"]}),e.jsx("button",{type:"button",onClick:L,"aria-label":"Zoom in",children:"+"}),e.jsx("button",{type:"button",onClick:F,"aria-label":"Reset zoom",children:e.jsx(v.oa,{name:"refresh",size:16})})]}),he&&e.jsxs("div",{className:"nice-document-viewer__rotation",children:[e.jsx("button",{type:"button",onClick:()=>V(270),"aria-label":"Rotate left",children:e.jsx(v.oa,{name:"refresh",size:16})}),e.jsx("button",{type:"button",onClick:()=>V(90),"aria-label":"Rotate right",children:e.jsx(v.oa,{name:"refresh",size:16})})]})]}),e.jsxs("div",{className:"nice-document-viewer__toolbar-right",children:[l&&e.jsx("button",{type:"button",onClick:W,"aria-label":"Download",children:e.jsx(v.oa,{name:"download",size:16})}),H&&e.jsx("button",{type:"button",onClick:q,"aria-label":"Print",children:e.jsx(v.oa,{name:"printer",size:16})}),k&&e.jsx("button",{type:"button",onClick:R,"aria-label":"Fullscreen",children:e.jsx(v.oa,{name:Z?"collapse":"expand",size:16})})]})]}),e.jsxs("div",{className:"nice-document-viewer__content",children:[ue&&!$&&(oe??e.jsx("div",{className:"nice-document-viewer__loading",children:"Loading..."})),me()]}),c&&e.jsxs("div",{className:"nice-document-viewer__info",children:[e.jsx("span",{className:"nice-document-viewer__name",children:s??c.name}),c.size&&e.jsx("span",{className:"nice-document-viewer__size",children:ge(c.size)}),c.width&&c.height&&e.jsxs("span",{className:"nice-document-viewer__dimensions",children:[c.width," × ",c.height]}),c.duration&&e.jsx("span",{className:"nice-document-viewer__duration",children:we(c.duration)})]})]})}),ee="nice-document-viewer-styles";if(typeof document<"u"&&!document.getElementById(ee)){const t=document.createElement("style");t.id=ee,t.textContent=`
|
|
2
|
+
.nice-document-viewer {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
border: 1px solid var(--nice-border-color, #e5e7eb);
|
|
6
|
+
border-radius: var(--nice-radius-sm, 4px);
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.nice-document-viewer--fullscreen {
|
|
12
|
+
position: fixed;
|
|
13
|
+
top: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
right: 0;
|
|
16
|
+
bottom: 0;
|
|
17
|
+
z-index: 9999;
|
|
18
|
+
border: none;
|
|
19
|
+
border-radius: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.nice-document-viewer__toolbar {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
justify-content: space-between;
|
|
26
|
+
padding: var(--nice-space-2, 8px) var(--nice-space-3, 12px);
|
|
27
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
28
|
+
border-bottom: 1px solid var(--nice-border-color, #e5e7eb);
|
|
29
|
+
flex-shrink: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.nice-document-viewer__toolbar-left,
|
|
33
|
+
.nice-document-viewer__toolbar-center,
|
|
34
|
+
.nice-document-viewer__toolbar-right {
|
|
35
|
+
display: flex;
|
|
36
|
+
align-items: center;
|
|
37
|
+
gap: var(--nice-space-2, 8px);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.nice-document-viewer__toolbar button {
|
|
41
|
+
padding: var(--nice-space-1-5, 6px) var(--nice-space-2-5, 10px);
|
|
42
|
+
border: 1px solid var(--nice-border-color, #e5e7eb);
|
|
43
|
+
border-radius: var(--nice-radius-sm, 4px);
|
|
44
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.nice-document-viewer__toolbar button:hover:not(:disabled) {
|
|
50
|
+
background: var(--nice-hover-bg, color-mix(in srgb, var(--nice-text-primary, #000) 4%, transparent));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.nice-document-viewer__toolbar button:disabled {
|
|
54
|
+
opacity: 0.4;
|
|
55
|
+
cursor: not-allowed;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.nice-document-viewer__pagination,
|
|
59
|
+
.nice-document-viewer__zoom,
|
|
60
|
+
.nice-document-viewer__rotation {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: var(--nice-space-1-5, 6px);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.nice-document-viewer__pagination input {
|
|
67
|
+
width: 50px;
|
|
68
|
+
padding: var(--nice-space-1, 4px);
|
|
69
|
+
border: 1px solid var(--nice-border-color, #e5e7eb);
|
|
70
|
+
border-radius: var(--nice-radius-sm, 4px);
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.nice-document-viewer__zoom span {
|
|
75
|
+
min-width: 50px;
|
|
76
|
+
text-align: center;
|
|
77
|
+
font-size: 13px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.nice-document-viewer__content {
|
|
81
|
+
flex: 1;
|
|
82
|
+
overflow: auto;
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
justify-content: center;
|
|
86
|
+
position: relative;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.nice-document-viewer__loading,
|
|
90
|
+
.nice-document-viewer__error,
|
|
91
|
+
.nice-document-viewer__unknown {
|
|
92
|
+
display: flex;
|
|
93
|
+
flex-direction: column;
|
|
94
|
+
align-items: center;
|
|
95
|
+
justify-content: center;
|
|
96
|
+
gap: var(--nice-space-3, 12px);
|
|
97
|
+
padding: var(--nice-space-10, 40px);
|
|
98
|
+
color: var(--nice-text-secondary, #475569);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.nice-document-viewer__error span {
|
|
102
|
+
color: var(--nice-error, #d32f2f);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.nice-document-viewer__pdf,
|
|
106
|
+
.nice-document-viewer__image {
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: center;
|
|
109
|
+
justify-content: center;
|
|
110
|
+
min-height: 100%;
|
|
111
|
+
min-width: 100%;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.nice-document-viewer__pdf-canvas {
|
|
115
|
+
max-width: 100%;
|
|
116
|
+
height: auto;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.nice-document-viewer__image img {
|
|
120
|
+
max-width: 100%;
|
|
121
|
+
max-height: 100%;
|
|
122
|
+
object-fit: contain;
|
|
123
|
+
transition: transform 0.2s;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.nice-document-viewer__video,
|
|
127
|
+
.nice-document-viewer__audio {
|
|
128
|
+
display: flex;
|
|
129
|
+
align-items: center;
|
|
130
|
+
justify-content: center;
|
|
131
|
+
width: 100%;
|
|
132
|
+
height: 100%;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.nice-document-viewer__video video,
|
|
136
|
+
.nice-document-viewer__audio audio {
|
|
137
|
+
max-width: 100%;
|
|
138
|
+
max-height: 100%;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.nice-document-viewer__office iframe,
|
|
142
|
+
.nice-document-viewer__html iframe {
|
|
143
|
+
width: 100%;
|
|
144
|
+
height: 100%;
|
|
145
|
+
border: none;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.nice-document-viewer__text {
|
|
149
|
+
width: 100%;
|
|
150
|
+
height: 100%;
|
|
151
|
+
overflow: auto;
|
|
152
|
+
padding: var(--nice-space-4, 16px);
|
|
153
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.nice-document-viewer__text pre {
|
|
157
|
+
margin: 0;
|
|
158
|
+
font-family: 'Fira Code', monospace;
|
|
159
|
+
font-size: 13px;
|
|
160
|
+
white-space: pre-wrap;
|
|
161
|
+
word-wrap: break-word;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.nice-document-viewer__info {
|
|
165
|
+
display: flex;
|
|
166
|
+
align-items: center;
|
|
167
|
+
gap: var(--nice-space-4, 16px);
|
|
168
|
+
padding: var(--nice-space-1-5, 6px) var(--nice-space-3, 12px);
|
|
169
|
+
background: var(--nice-bg-primary, #ffffff);
|
|
170
|
+
border-top: 1px solid var(--nice-border-color, #e5e7eb);
|
|
171
|
+
font-size: 12px;
|
|
172
|
+
color: var(--nice-text-secondary, #475569);
|
|
173
|
+
flex-shrink: 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.nice-document-viewer__name {
|
|
177
|
+
font-weight: 500;
|
|
178
|
+
color: var(--nice-text-primary, #0f172a);
|
|
179
|
+
}
|
|
180
|
+
`,document.head.appendChild(t)}exports.NiceDocumentViewer=Ce;
|