@nice2dev/ui 1.0.30 → 1.1.5
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 +848 -0
- package/README.md +30 -31
- package/dist/NiceCalendarScheduler.doc-BEtQkZjV.cjs +9 -0
- package/dist/NiceCalendarScheduler.doc-D__LRgOx.js +33 -0
- package/dist/NiceCodeEditor-BVUwp9yX.js +1134 -0
- package/dist/NiceCodeEditor-cIqUSk3j.cjs +260 -0
- package/dist/NiceColorPicker-C8NZZcXE.js +596 -0
- package/dist/NiceColorPicker-CKVbjicN.cjs +1 -0
- package/dist/NiceConfirmDialog-B57cl_F7.cjs +1 -0
- package/dist/NiceConfirmDialog-DmBX1Iea.js +81 -0
- package/dist/NiceConfirmDialog-N9fBTLYm.js +81 -0
- package/dist/NiceConfirmDialog-oSxVpsCs.cjs +1 -0
- package/dist/NiceDataGrid-3AIf2D3t.cjs +10 -0
- package/dist/NiceDataGrid-CXCUAkRb.js +1736 -0
- package/dist/NiceDocumentViewer-B-uEPZAf.js +672 -0
- package/dist/NiceDocumentViewer-BE0gKBlw.cjs +180 -0
- package/dist/NiceDrawingCanvas.doc-Dv5vB4gY.js +32 -0
- package/dist/NiceDrawingCanvas.doc-Ww9zz17x.cjs +8 -0
- package/dist/NiceErrorBoundary-BD-uqk_q.js +709 -0
- package/dist/NiceErrorBoundary-CIPXaYik.cjs +1 -0
- package/dist/NiceFileManagerViews.doc-CKlnm6cX.cjs +1 -0
- package/dist/NiceFileManagerViews.doc-Cg21DArG.js +25 -0
- package/dist/NiceForm-BNZB31Pg.js +4499 -0
- package/dist/NiceForm-C6F0HvrX.cjs +1 -0
- package/dist/NiceForm-CCyfWgIs.js +4805 -0
- package/dist/NiceForm-CPyAXxBO.cjs +1 -0
- package/dist/NiceGantt-CSFLZD2y.js +328 -0
- package/dist/NiceGantt-_ysNSVYR.cjs +1 -0
- package/dist/NiceHtmlEditor-B8B8AcSC.js +841 -0
- package/dist/NiceHtmlEditor-D8RQcBNp.cjs +10 -0
- package/dist/NiceLoginForm-Bai7aN8V.js +708 -0
- package/dist/NiceLoginForm-BrvIc-wq.cjs +1 -0
- package/dist/NiceMegaMenu.doc-7UyOCd3l.cjs +7 -0
- package/dist/NiceMegaMenu.doc-zeIyVa65.js +31 -0
- package/dist/NiceMention-CWoLD0SE.js +11082 -0
- package/dist/NiceMention-J1lUDLhg.cjs +430 -0
- package/dist/NiceMention.css +1 -0
- package/dist/NiceModal-0UxviEYE.cjs +1 -0
- package/dist/NiceModal-Bj53SKLI.js +95 -0
- package/dist/NiceModal-D-iOonog.js +95 -0
- package/dist/NiceModal-DC0UlQhc.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-4hzDw6it.js +6999 -0
- package/dist/NiceModuleLifecyclePanel-BBOg9g0b.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-Df_1k5qW.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-DtuXRiLR.js +6991 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NicePagination-Bjxy9aEc.js +172 -0
- package/dist/NicePagination-CPn-Q1h_.js +172 -0
- package/dist/NicePagination-CfFfNwrg.cjs +1 -0
- package/dist/NicePagination-EEQ6o1dF.cjs +1 -0
- package/dist/NicePivotGrid-Cmiolup9.cjs +152 -0
- package/dist/NicePivotGrid-DX_iUj2X.js +1167 -0
- package/dist/NiceSavedQueryPanel-BhjFJBvn.cjs +586 -0
- package/dist/NiceSavedQueryPanel-CH5c3rUG.js +6988 -0
- package/dist/NiceSavedQueryPanel-KvyXTnFx.js +5129 -0
- package/dist/NiceSavedQueryPanel-aQrEmmcC.cjs +596 -0
- package/dist/NiceScannerControl-Cd5KXJA9.js +12769 -0
- package/dist/NiceScannerControl-DZsERSw_.cjs +698 -0
- package/dist/NiceScannerControl.css +1 -0
- package/dist/NiceScheduler-DuxPzQQZ.js +1645 -0
- package/dist/NiceScheduler-nW7fMzKL.cjs +5 -0
- package/dist/NiceSelect-BVoqtfYN.cjs +1 -0
- package/dist/NiceSelect-DHowflmX.js +433 -0
- package/dist/NiceWindow-BoDzlGk-.js +1621 -0
- package/dist/NiceWindow-DdD9k4nc.cjs +1 -0
- package/dist/NiceWindow-DgONWxBm.cjs +1 -0
- package/dist/NiceWindow-xnTSHdHv.js +1623 -0
- package/dist/charts-B-sl1V9y.cjs +882 -0
- package/dist/charts-Bs0aDM0X.js +4671 -0
- package/dist/charts-DO2z6Ziu.js +31920 -0
- package/dist/charts-DjjKkw0q.cjs +761 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.mjs +7 -7
- package/dist/core-BUsZ7_vI.js +27914 -0
- package/dist/core-C2KhqEaU.cjs +1 -0
- package/dist/core-CLfcCDKc.cjs +122 -0
- package/dist/core-K2DIxXLn.js +795 -0
- package/dist/data-branching-D7l_kILW.cjs +1 -0
- package/dist/data-branching-DC6hcBQN.cjs +1 -0
- package/dist/data-branching-DykdTpjJ.js +6255 -0
- package/dist/data-branching-lJ07lDN-.js +6255 -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 +70 -44
- package/dist/data.mjs +17 -16
- package/dist/devops-Bi8MXtko.js +8165 -0
- package/dist/devops-CU0sOVEA.cjs +17 -0
- package/dist/devops-CXyEwQeM.js +8165 -0
- package/dist/devops-On_1wRf9.cjs +17 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +288 -432
- package/dist/editors.mjs +58 -62
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.d.ts +1 -1
- package/dist/feedback.mjs +3 -3
- package/dist/index-BDH1yDSg.js +69235 -0
- package/dist/index-C9njkNOD.cjs +5470 -0
- package/dist/index.cjs +5137 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +556 -929
- package/dist/index.mjs +66371 -1017
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +31 -213
- package/dist/navigation.mjs +105 -113
- package/dist/no-code-8lO7o6xi.js +7425 -0
- package/dist/no-code-C58g8_fb.cjs +332 -0
- package/dist/no-code-Cj4xJ3w9.js +7425 -0
- package/dist/no-code-K8tOLNew.cjs +332 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.mjs +1 -1
- package/dist/overlays.cjs +1 -1
- package/dist/overlays.d.ts +10 -0
- package/dist/overlays.mjs +36 -36
- package/dist/pickerCommons-B-wOzHFh.cjs +1 -0
- package/dist/pickerCommons-CORo9j2a.js +2119 -0
- package/dist/pickerCommons-COiSUiP2.js +1122 -0
- package/dist/pickerCommons-D3WShRrR.cjs +1 -0
- package/dist/style.css +6 -6
- package/dist/vendor-BPVpdtPp.js +271 -0
- package/dist/vendor-Bo2Q64AF.cjs +1 -0
- package/package.json +17 -17
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),v=require("./charts-B-sl1V9y.cjs"),t=require("react");function ve(n,i){const a=n.split(".").pop()?.toLowerCase().split("?")[0]??"";return a==="pdf"?"pdf":["jpg","jpeg","png","gif","bmp","webp","svg","ico","tiff","tif"].includes(a)?"image":["mp4","webm","ogg","mov","avi","mkv"].includes(a)?"video":["mp3","wav","flac","aac","m4a","ogg"].includes(a)?"audio":["doc","docx","xls","xlsx","ppt","pptx","odt","ods","odp"].includes(a)?"office":a==="html"||a==="htm"?"html":["txt","log","md","json","xml","csv","yaml","yml"].includes(a)?"text":"unknown"}function ge(n){if(n===0)return"0 B";const i=1024,a=["B","KB","MB","GB"],o=Math.floor(Math.log(n)/Math.log(i));return parseFloat((n/Math.pow(i,o)).toFixed(1))+" "+a[o]}function we(n){const i=Math.floor(n/3600),a=Math.floor(n%3600/60),o=Math.floor(n%60);return i>0?`${i}:${a.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`:`${a}:${o.toString().padStart(2,"0")}`}function xe({src:n,page:i,zoom:a,rotation:o,onPageChange:m,onLoad:s,onError:p,workerUrl:u}){const h=t.useRef(null),y=t.useRef(null),[g,B]=t.useState(0),[I,T]=t.useState(!1);return t.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(n).promise;if(x)return;y.current=w,B(w.numPages),s({name:n.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}},[n,u,s,p]),t.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(i,g)),N=await x.getPage(w);if(l)return;const P=N.getViewport({scale:a,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}},[i,a,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:n,zoom:i,rotation:a,onLoad:o,onError:m}){const[s,p]=t.useState(!1),u=t.useCallback(y=>{const g=y.currentTarget;p(!0),o({name:n.split("/").pop()??"image",type:"image",width:g.naturalWidth,height:g.naturalHeight})},[n,o]),h=t.useCallback(()=>{m(new Error("Failed to load image"))},[m]);return e.jsx("div",{className:"nice-document-viewer__image",children:e.jsx("img",{src:n,alt:"Document",onLoad:u,onError:h,style:{transform:`scale(${i}) rotate(${a}deg)`,opacity:s?1:0},draggable:!1})})}function _e({src:n,type:i,onLoad:a,onError:o}){const m=t.useRef(null),s=t.useCallback(()=>{const u=m.current;if(!u)return;const h={name:n.split("/").pop()??(i==="video"?"video":"audio"),type:i,duration:u.duration};i==="video"&&"videoWidth"in u&&(h.width=u.videoWidth,h.height=u.videoHeight),a(h)},[n,i,a]),p=t.useCallback(()=>{o(new Error(`Failed to load ${i}`))},[i,o]);return i==="video"?e.jsx("div",{className:"nice-document-viewer__video",children:e.jsx("video",{ref:m,src:n,controls:!0,onLoadedMetadata:s,onError:p})}):e.jsx("div",{className:"nice-document-viewer__audio",children:e.jsx("audio",{ref:m,src:n,controls:!0,onLoadedMetadata:s,onError:p})})}function je({src:n,viewerUrl:i,onLoad:a}){const[o,m]=t.useState(!1),p=`${i??"https://view.officeapps.live.com/op/embed.aspx?src="}${encodeURIComponent(n)}`,u=t.useCallback(()=>{m(!0),a({name:n.split("/").pop()??"document",type:"office"})},[n,a]);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:n,onLoad:i,onError:a}){const[o,m]=t.useState(null);return t.useEffect(()=>{fetch(n).then(s=>{if(!s.ok)throw new Error("Failed to fetch text");return s.text()}).then(s=>{m(s),i({name:n.split("/").pop()??"text",type:"text",size:s.length})}).catch(s=>{a(s instanceof Error?s:new Error("Failed to load text"))})},[n,i,a]),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:n,onLoad:i}){const a=t.useCallback(()=>{i({name:n.split("/").pop()??"page.html",type:"html"})},[n,i]);return e.jsx("div",{className:"nice-document-viewer__html",children:e.jsx("iframe",{src:n,onLoad:a,title:"HTML Document",sandbox:"allow-same-origin allow-scripts"})})}const Ce=t.forwardRef(function(i,a){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:te,officeViewerUrl:ne,loading:oe,errorContent:O,className:ae,"data-testid":ie}=i,U=t.useRef(null),[c,re]=t.useState(null),[b,ce]=t.useState(B),[C,se]=t.useState(h),[Y,de]=t.useState(0),[Z,J]=t.useState(!1),[$,le]=t.useState(null),[ue,Q]=t.useState(!0),_=t.useMemo(()=>m??ve(o),[o,m]),z=t.useCallback(r=>{re(r),Q(!1),P?.(r)},[P]),K=t.useCallback(r=>{le(r),Q(!1),E?.(r)},[E]),f=t.useCallback(r=>{const d=c?.pageCount??1,X=Math.max(1,Math.min(r,d));ce(X),G?.(X)},[c?.pageCount,G]),S=t.useCallback(()=>f(b+1),[b,f]),D=t.useCallback(()=>f(b-1),[b,f]),j=t.useCallback(r=>{const d=Math.max(y,Math.min(r,g));se(d),A?.(d)},[y,g,A]),L=t.useCallback(()=>j(C*1.25),[C,j]),M=t.useCallback(()=>j(C/1.25),[C,j]),F=t.useCallback(()=>j(1),[j]),V=t.useCallback(r=>{de(d=>(d+r)%360)},[]),W=t.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=t.useCallback(()=>{const r=window.open(o,"_blank");r&&(r.onload=()=>r.print())},[o]),R=t.useCallback(()=>{U.current&&(Z?(document.exitFullscreen?.(),J(!1)):(U.current.requestFullscreen?.(),J(!0)))},[Z]);t.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]),t.useImperativeHandle(a,()=>({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:te});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:ne,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":""} ${ae??""}`,style:{height:p,width:u},"data-testid":ie,"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 n=document.createElement("style");n.id=ee,n.textContent=`
|
|
2
|
+
.nice-document-viewer {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
border: 1px solid var(--border-color, #e5e7eb);
|
|
6
|
+
border-radius: var(--nice-radius-sm, 4px);
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
background: var(--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(--bg-primary, #ffffff);
|
|
28
|
+
border-bottom: 1px solid var(--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(--border-color, #e5e7eb);
|
|
43
|
+
border-radius: var(--nice-radius-sm, 4px);
|
|
44
|
+
background: var(--bg-primary, #ffffff);
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.nice-document-viewer__toolbar button:hover:not(:disabled) {
|
|
50
|
+
background: var(--hover-bg, color-mix(in srgb, var(--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(--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(--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(--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(--bg-primary, #ffffff);
|
|
170
|
+
border-top: 1px solid var(--border-color, #e5e7eb);
|
|
171
|
+
font-size: 12px;
|
|
172
|
+
color: var(--text-secondary, #475569);
|
|
173
|
+
flex-shrink: 0;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.nice-document-viewer__name {
|
|
177
|
+
font-weight: 500;
|
|
178
|
+
color: var(--text-primary, #0f172a);
|
|
179
|
+
}
|
|
180
|
+
`,document.head.appendChild(n)}exports.NiceDocumentViewer=Ce;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const e = "https://nice2dev.com/schemas/component-doc-v1.json", n = "NiceDrawingCanvas", t = "Freeform drawing canvas with brush tools.", a = "editors", o = "1.0.0", s = "planned", i = [{ name: "value", type: "string", description: "Canvas data URL" }, { name: "onChange", type: "(dataUrl: string) => void", required: !0, description: "Change callback" }, { name: "width", type: "number | string", default: "'100%'", description: "Canvas width" }, { name: "height", type: "number | string", default: "400", description: "Canvas height" }, { name: "tools", type: "DrawingTool[]", description: "Available tools" }, { name: "colors", type: "string[]", description: "Color palette" }, { name: "brushSizes", type: "number[]", description: "Brush sizes" }, { name: "showToolbar", type: "boolean", default: "true", description: "Show toolbar" }, { name: "undoSteps", type: "number", default: "50", description: "Max undo steps" }, { name: "disabled", type: "boolean", default: "false", description: "Disabled state" }], r = [{ title: "Drawing Canvas", description: "Draw freeform", code: `<NiceDrawingCanvas
|
|
2
|
+
value={drawing}
|
|
3
|
+
onChange={setDrawing}
|
|
4
|
+
width={800}
|
|
5
|
+
height={600}
|
|
6
|
+
tools={['brush', 'eraser', 'line', 'rectangle']}
|
|
7
|
+
showToolbar
|
|
8
|
+
/>` }], c = { keyboard: ["Tab through tools", "Shortcuts for tools"], aria: ["Drawing canvas", "Tool descriptions"] }, d = ["NiceSignature", "NiceImageEditor"], l = {
|
|
9
|
+
$schema: e,
|
|
10
|
+
name: n,
|
|
11
|
+
description: t,
|
|
12
|
+
category: a,
|
|
13
|
+
since: o,
|
|
14
|
+
status: s,
|
|
15
|
+
props: i,
|
|
16
|
+
examples: r,
|
|
17
|
+
accessibility: c,
|
|
18
|
+
seeAlso: d
|
|
19
|
+
};
|
|
20
|
+
export {
|
|
21
|
+
e as $schema,
|
|
22
|
+
c as accessibility,
|
|
23
|
+
a as category,
|
|
24
|
+
l as default,
|
|
25
|
+
t as description,
|
|
26
|
+
r as examples,
|
|
27
|
+
n as name,
|
|
28
|
+
i as props,
|
|
29
|
+
d as seeAlso,
|
|
30
|
+
o as since,
|
|
31
|
+
s as status
|
|
32
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="https://nice2dev.com/schemas/component-doc-v1.json",t="NiceDrawingCanvas",n="Freeform drawing canvas with brush tools.",s="editors",a="1.0.0",o="planned",i=[{name:"value",type:"string",description:"Canvas data URL"},{name:"onChange",type:"(dataUrl: string) => void",required:!0,description:"Change callback"},{name:"width",type:"number | string",default:"'100%'",description:"Canvas width"},{name:"height",type:"number | string",default:"400",description:"Canvas height"},{name:"tools",type:"DrawingTool[]",description:"Available tools"},{name:"colors",type:"string[]",description:"Color palette"},{name:"brushSizes",type:"number[]",description:"Brush sizes"},{name:"showToolbar",type:"boolean",default:"true",description:"Show toolbar"},{name:"undoSteps",type:"number",default:"50",description:"Max undo steps"},{name:"disabled",type:"boolean",default:"false",description:"Disabled state"}],r=[{title:"Drawing Canvas",description:"Draw freeform",code:`<NiceDrawingCanvas
|
|
2
|
+
value={drawing}
|
|
3
|
+
onChange={setDrawing}
|
|
4
|
+
width={800}
|
|
5
|
+
height={600}
|
|
6
|
+
tools={['brush', 'eraser', 'line', 'rectangle']}
|
|
7
|
+
showToolbar
|
|
8
|
+
/>`}],c={keyboard:["Tab through tools","Shortcuts for tools"],aria:["Drawing canvas","Tool descriptions"]},l=["NiceSignature","NiceImageEditor"],d={$schema:e,name:t,description:n,category:s,since:a,status:o,props:i,examples:r,accessibility:c,seeAlso:l};exports.$schema=e;exports.accessibility=c;exports.category=s;exports.default=d;exports.description=n;exports.examples=r;exports.name=t;exports.props=i;exports.seeAlso=l;exports.since=a;exports.status=o;
|