@nice2dev/ui 1.0.24 → 1.0.26
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 +57 -0
- package/dist/NiceErrorBoundary-B91z3IjT.cjs +1 -0
- package/dist/NiceErrorBoundary-CVybqo3l.js +770 -0
- package/dist/NiceErrorBoundary-D0NwBkFl.cjs +1 -0
- package/dist/NiceErrorBoundary-DQLk-68V.js +770 -0
- package/dist/NiceForm-8_p8P0uJ.js +5386 -0
- package/dist/NiceForm-BrBaLUkv.js +5386 -0
- package/dist/NiceForm-DkVFd5Z5.cjs +382 -0
- package/dist/NiceForm-DoiApS60.cjs +382 -0
- package/dist/NiceModal-C582SiK7.cjs +1 -0
- package/dist/NiceModal-CdiLaYTg.cjs +1 -0
- package/dist/NiceModal-D6Yj67eH.js +95 -0
- package/dist/NiceModal-sFJw1CWm.js +95 -0
- package/dist/NiceModuleLifecyclePanel-Bhd8VNjU.js +6856 -0
- package/dist/NiceModuleLifecyclePanel-Cn_nB4dg.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-D22ycAMQ.js +6817 -0
- package/dist/NiceModuleLifecyclePanel-shRuDyp3.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel.css +1 -1
- package/dist/NicePagination-CtyaW_b4.cjs +1 -0
- package/dist/NicePagination-Dnlho_8O.cjs +1 -0
- package/dist/NicePagination-hGlKrWYL.js +171 -0
- package/dist/NicePagination-kokSP8ls.js +171 -0
- package/dist/NicePinCodeInput-1YGb7l2o.cjs +696 -0
- package/dist/NicePinCodeInput-CZpYON--.js +13097 -0
- package/dist/NicePinCodeInput-DPUlM3E1.cjs +696 -0
- package/dist/NicePinCodeInput-xSuOVhE8.js +13097 -0
- package/dist/NiceSavedQueryPanel-C6pPtOAf.js +6893 -0
- package/dist/NiceSavedQueryPanel-DOixGvLP.cjs +596 -0
- package/dist/NiceSavedQueryPanel-DzB0g0ak.cjs +596 -0
- package/dist/NiceSavedQueryPanel-Mz4jAsGJ.js +6893 -0
- package/dist/NiceTabs-1o8cpB_-.js +1657 -0
- package/dist/NiceTabs-B-FDOecP.cjs +1 -0
- package/dist/NiceTabs-DHiA02RD.cjs +1 -0
- package/dist/NiceTabs-MBVJomax.js +1657 -0
- package/dist/NiceWindow-9zQsi0zF.cjs +1 -0
- package/dist/NiceWindow-DUOkdKuX.js +1592 -0
- package/dist/NiceWindow-Dq-xx9cw.js +1592 -0
- package/dist/NiceWindow-ZAAUD3LJ.cjs +1 -0
- package/dist/charts-B_lYNVMJ.cjs +761 -0
- package/dist/charts-CABhvyAA.js +4657 -0
- package/dist/charts-DNQXBPGB.js +4657 -0
- package/dist/charts-IP38F-wh.cjs +761 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-BHZDvnBo.js +25364 -0
- package/dist/core-C7CI2mWz.js +25248 -0
- package/dist/core-C7PK1L9r.cjs +122 -0
- package/dist/core-CjUAwZ6z.cjs +122 -0
- package/dist/data-branching-BGw7O52F.js +6133 -0
- package/dist/data-branching-Bv-f_gZk.cjs +1 -0
- package/dist/data-branching-CNi8vtZ1.js +6133 -0
- package/dist/data-branching-Dz3xLUZM.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 +19 -1
- package/dist/data.mjs +1 -1
- package/dist/devops-CX538_rA.js +7684 -0
- package/dist/devops-JwBTMk0A.cjs +17 -0
- package/dist/devops-ZWKP6vRh.cjs +17 -0
- package/dist/devops-draw6Jrm.js +7684 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.mjs +1 -1
- package/dist/editors.cjs +1 -1
- package/dist/editors.mjs +3 -3
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.mjs +2 -2
- package/dist/index-BkLJ4tzy.js +68026 -0
- package/dist/index-CTe-G23X.cjs +5518 -0
- package/dist/index-CwOe80Ws.cjs +5518 -0
- package/dist/index-DGjd42Q9.js +68223 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +179 -1
- package/dist/index.mjs +822 -812
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.d.ts +40 -0
- package/dist/navigation.mjs +4 -4
- package/dist/no-code-BndAN6hG.cjs +332 -0
- package/dist/no-code-CIf6wiUc.js +7133 -0
- package/dist/no-code-DKYzw5If.js +7133 -0
- package/dist/no-code-DSa5Yn6l.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.mjs +55 -55
- package/dist/style.css +2 -2
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),V=require("./core-C7PK1L9r.cjs"),n=require("react"),ht=({visible:t,onClose:i,title:s,items:l,showCancelButton:m=!0,cancelText:h,className:x,style:w})=>{const{t:p}=V.Zt();return t?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"nice-actionsheet__overlay",onClick:i}),e.jsxs("div",{className:`nice-actionsheet ${x||""}`,style:w,children:[s&&e.jsx("div",{className:"nice-actionsheet__title",children:s}),e.jsx("div",{className:"nice-actionsheet__items",children:l.map((b,a)=>e.jsxs("button",{className:`nice-actionsheet__item ${b.type==="danger"?"nice-actionsheet__item--danger":""}`,disabled:b.disabled,onClick:()=>{b.onClick?.(),i()},children:[b.icon&&e.jsx("span",{className:"nice-actionsheet__icon",children:b.icon}),b.text]},a))}),m&&e.jsx("button",{className:"nice-actionsheet__cancel",onClick:i,children:h||p("cancel","Cancel")})]})]}):null},ft=({visible:t,onClose:i,targetRef:s,position:l="bottom",title:m,showArrow:h=!0,width:x,children:w,className:p,style:b,displayStyle:a})=>{V.Hs("tooltip",a);const N=n.useRef(null),[Y,S]=n.useState({top:0,left:0}),E=n.useCallback(()=>{const R=s.current,B=N.current;if(!R||!B)return;const c=R.getBoundingClientRect(),g=B.getBoundingClientRect();let r=0,j=0;const _=8;switch(l){case"top":r=c.top-g.height-_,j=c.left+(c.width-g.width)/2;break;case"bottom":r=c.bottom+_,j=c.left+(c.width-g.width)/2;break;case"left":r=c.top+(c.height-g.height)/2,j=c.left-g.width-_;break;case"right":r=c.top+(c.height-g.height)/2,j=c.right+_;break}S({top:r+window.scrollY,left:j+window.scrollX})},[s,l]);return n.useEffect(()=>{if(t){requestAnimationFrame(E);const R=B=>{N.current&&!N.current.contains(B.target)&&s.current&&!s.current.contains(B.target)&&i()};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)}},[t,E,i,s]),t?e.jsxs("div",{ref:N,className:`nice-popover nice-popover--${l} ${p||""}`,style:{...b,position:"absolute",top:Y.top,left:Y.left,width:x},children:[h&&e.jsx("div",{className:`nice-popover__arrow nice-popover__arrow--${l}`}),m&&e.jsx("div",{className:"nice-popover__title",children:m}),e.jsx("div",{className:"nice-popover__content",children:w})]}):null},pt=({visible:t,message:i,container:s,showIndicator:l=!0,shading:m=!0,className:h,style:x})=>{const{t:w}=V.Zt();if(!t)return null;const p=!!s?.current,b=e.jsxs("div",{className:`nice-loadpanel ${h||""}`,style:x,children:[m&&e.jsx("div",{className:"nice-loadpanel__shade"}),e.jsxs("div",{className:"nice-loadpanel__box",children:[l&&e.jsx("div",{className:"nice-spinner nice-spinner--md"}),e.jsx("span",{className:"nice-loadpanel__text",children:i||w("loading","Loading...")})]})]});if(p&&s.current){const a=s.current;return a.style.position=a.style.position||"relative",b}return b},xt=({direction:t="row",align:i,justify:s,wrap:l,gap:m,flex:h,children:x,className:w,style:p})=>e.jsx("div",{className:`nice-box ${w||""}`,style:{display:"flex",flexDirection:t,alignItems:i,justifyContent:s,flexWrap:l?"wrap":void 0,gap:m,flex:h,...p},children:x}),wt=({direction:t="row",items:i,gap:s,className:l,style:m})=>e.jsx("div",{className:`nice-responsivebox ${l||""}`,style:{display:"flex",flexDirection:t,gap:s,...m},children:i.map((h,x)=>e.jsx("div",{style:{flex:h.ratio??1,flexBasis:h.baseSize,flexShrink:h.shrink??1},children:h.children},x))}),_t=({width:t=200,height:i=200,minWidth:s=50,minHeight:l=50,maxWidth:m=1/0,maxHeight:h=1/0,handles:x=["right","bottom","bottomRight"],onResize:w,children:p,className:b,style:a})=>{const[N,Y]=n.useState({width:t,height:i}),S=n.useRef(null),E=(c,g)=>{g.preventDefault();const r=g.clientX,j=g.clientY,_=N.width,H=N.height,M={n:"top",s:"bottom",e:"right",w:"left",ne:"topRight",se:"bottomRight",sw:"bottomLeft",nw:"topLeft"}[c]??c,o=M==="right"||M==="topRight"||M==="bottomRight",k=M==="left"||M==="topLeft"||M==="bottomLeft",y=M==="bottom"||M==="bottomRight"||M==="bottomLeft",I=M==="top"||M==="topRight"||M==="topLeft",d=u=>{const L=u.clientX-r,f=u.clientY-j;let P=_,O=H;o&&(P=_+L),k&&(P=_-L),y&&(O=H+f),I&&(O=H-f),P=Math.max(s,Math.min(m,P)),O=Math.max(l,Math.min(h,O)),Y({width:P,height:O}),w?.({width:P,height:O})},v=()=>{document.removeEventListener("pointermove",d),document.removeEventListener("pointerup",v)};document.addEventListener("pointermove",d),document.addEventListener("pointerup",v)},R=c=>{switch(c){case"top":case"bottom":return"ns-resize";case"left":case"right":return"ew-resize";case"topLeft":case"bottomRight":return"nwse-resize";case"topRight":case"bottomLeft":return"nesw-resize";default:return"default"}},B=c=>{const g={position:"absolute",zIndex:1},r=8;return c==="right"?{...g,top:0,right:-r/2,width:r,height:"100%",cursor:R(c)}:c==="bottom"?{...g,left:0,bottom:-r/2,width:"100%",height:r,cursor:R(c)}:c==="left"?{...g,top:0,left:-r/2,width:r,height:"100%",cursor:R(c)}:c==="top"?{...g,top:-r/2,left:0,width:"100%",height:r,cursor:R(c)}:c==="bottomRight"?{...g,bottom:-r/2,right:-r/2,width:r*2,height:r*2,cursor:R(c)}:c==="bottomLeft"?{...g,bottom:-r/2,left:-r/2,width:r*2,height:r*2,cursor:R(c)}:c==="topRight"?{...g,top:-r/2,right:-r/2,width:r*2,height:r*2,cursor:R(c)}:c==="topLeft"?{...g,top:-r/2,left:-r/2,width:r*2,height:r*2,cursor:R(c)}:g};return e.jsxs("div",{ref:S,className:`nice-resizable ${b||""}`,style:{...a,width:N.width,height:N.height,position:"relative",overflow:"hidden"},children:[p,x.map(c=>e.jsx("div",{style:B(c),onPointerDown:g=>E(c,g)},c))]})},gt=({direction:t="vertical",showScrollbar:i="onInteraction",width:s,height:l,onScroll:m,children:h,className:x,style:w})=>{const p=t==="horizontal"||t==="both"?"auto":"hidden",b=t==="vertical"||t==="both"?"auto":"hidden",a=i==="never"?"nice-scrollview--hide-sb":i==="always"?"nice-scrollview--show-sb":"";return e.jsx("div",{className:`nice-scrollview ${a} ${x||""}`,style:{...w,width:s,height:l,overflowX:p,overflowY:b},onScroll:m,children:h})};function Me(t,i){if(!t)return{score:1,indices:[]};const s=t.toLowerCase(),l=i.toLowerCase();let m=0;const h=[];let x=0,w=-1;for(let p=0;p<l.length&&m<s.length;p++)l[p]===s[m]&&(h.push(p),w===p-1&&(x+=3),(p===0||/[\s\-_/.]/.test(i[p-1]))&&(x+=5),i[p]===t[m]&&(x+=1),x+=1,w=p,m++);return m<s.length?null:(x-=h[0]*.1,{score:x,indices:h})}function Oe(t,i){if(i.length===0)return[t];const s=[];let l=0;const m=new Set(i);for(let h=0;h<t.length;h++)m.has(h)&&(l<h&&s.push(t.slice(l,h)),s.push(n.createElement("mark",{key:`m-${h}`,className:"nice-command-palette__match"},t[h])),l=h+1);return l<t.length&&s.push(t.slice(l)),s}function bt(t,i){switch(i.type){case"REGISTER":{const s=new Map(t.commands);return s.set(i.command.id,i.command),{...t,commands:s}}case"REGISTER_BATCH":{const s=new Map(t.commands);for(const l of i.commands)s.set(l.id,l);return{...t,commands:s}}case"UNREGISTER":{const s=new Map(t.commands);return s.delete(i.id),{...t,commands:s}}case"OPEN":return{...t,isOpen:!0,query:"",selectedIndex:0};case"CLOSE":return{...t,isOpen:!1,query:"",selectedIndex:0};case"SET_QUERY":return{...t,query:i.query,selectedIndex:0};case"SET_SELECTED":return{...t,selectedIndex:i.index};case"ADD_RECENT":{const s=t.recentIds.filter(l=>l!==i.id);return{...t,recentIds:[i.id,...s].slice(0,i.maxRecent)}}default:return t}}const qe=n.createContext(null);function We(){const t=n.useContext(qe);if(!t)throw new Error("useCommandPalette must be used within NiceCommandPaletteProvider");return t}const Ae=({children:t,commands:i,placeholder:s="Type a command...",maxVisible:l=10,maxRecent:m=5,className:h,emptyText:x="No commands found",closeOnAction:w=!0,onOpen:p,onClose:b})=>{const[a,N]=n.useReducer(bt,{commands:new Map(i?.map(d=>[d.id,d])??[]),isOpen:!1,query:"",selectedIndex:0,recentIds:[]}),Y=n.useRef(null),S=n.useRef(null),[E,R]=n.useState(!1),B=n.useCallback(d=>{N({type:"REGISTER",command:d})},[]),c=n.useCallback(d=>{N({type:"UNREGISTER",id:d})},[]),g=n.useCallback(d=>{N({type:"REGISTER_BATCH",commands:d})},[]),r=n.useCallback(()=>{N({type:"OPEN"}),p?.()},[p]),j=n.useCallback(()=>{N({type:"CLOSE"}),b?.()},[b]),_=n.useCallback(()=>{a.isOpen?j():r()},[a.isOpen,j,r]),D=n.useMemo(()=>{const d=Array.from(a.commands.values()).filter(u=>!u.hidden);if(!a.query.trim()){const u=a.recentIds.map(f=>a.commands.get(f)).filter(f=>!!f&&!f.hidden),L=d.filter(f=>!a.recentIds.includes(f.id));return L.sort((f,P)=>f.label.localeCompare(P.label)),[...u,...L].map(f=>({command:f,match:null,isRecent:a.recentIds.includes(f.id)}))}return d.map(u=>{const L=Me(a.query,u.label),f=u.description?Me(a.query,u.description):null,P=u.keywords?.map(U=>Me(a.query,U)).filter(Boolean)[0]??null,O=[L,f,P].filter(Boolean).sort((U,J)=>(J?.score??0)-(U?.score??0))[0];return{command:u,match:O,isRecent:!1}}).filter(u=>u.match!==null).sort((u,L)=>(L.match?.score??0)-(u.match?.score??0))},[a.commands,a.query,a.recentIds]).slice(0,l),M=n.useCallback(async d=>{const v=a.commands.get(d);if(!(!v||v.disabled)){R(!0);try{await v.action(),N({type:"ADD_RECENT",id:d,maxRecent:m})}finally{R(!1),w&&j()}}},[a.commands,m,w,j]);n.useEffect(()=>{const d=v=>{(v.metaKey||v.ctrlKey)&&v.key==="k"&&(v.preventDefault(),_()),v.key==="Escape"&&a.isOpen&&(v.preventDefault(),j())};return document.addEventListener("keydown",d),()=>document.removeEventListener("keydown",d)},[_,a.isOpen,j]),n.useEffect(()=>{a.isOpen&&requestAnimationFrame(()=>Y.current?.focus())},[a.isOpen]);const o=n.useCallback(d=>{const v=D.length;if(v){if(d.key==="ArrowDown")d.preventDefault(),N({type:"SET_SELECTED",index:(a.selectedIndex+1)%v});else if(d.key==="ArrowUp")d.preventDefault(),N({type:"SET_SELECTED",index:(a.selectedIndex-1+v)%v});else if(d.key==="Enter"){d.preventDefault();const u=D[a.selectedIndex];u&&M(u.command.id)}}},[D,a.selectedIndex,M]);n.useEffect(()=>{if(!S.current)return;S.current.children[a.selectedIndex]?.scrollIntoView({block:"nearest"})},[a.selectedIndex]);const k=n.useMemo(()=>({registerCommand:B,unregisterCommand:c,registerCommands:g,open:r,close:j,toggle:_,isOpen:a.isOpen,executeCommand:M}),[B,c,g,r,j,_,a.isOpen,M]),y=n.useMemo(()=>{const d=new Map;for(const v of D){const u=v.command.category??"General";d.has(u)||d.set(u,[]),d.get(u).push(v)}return d},[D]);let I=0;return e.jsxs(qe.Provider,{value:k,children:[t,a.isOpen&&e.jsx("div",{className:`nice-command-palette__overlay ${h??""}`,onClick:j,children:e.jsxs("div",{className:"nice-command-palette",role:"dialog","aria-label":"Command Palette","aria-modal":"true",onClick:d=>d.stopPropagation(),children:[e.jsx("div",{className:"nice-command-palette__input-wrapper",children:e.jsx("input",{ref:Y,className:"nice-command-palette__input",type:"text",placeholder:s,value:a.query,onChange:d=>N({type:"SET_QUERY",query:d.target.value}),onKeyDown:o,"aria-label":"Search commands","aria-autocomplete":"list","aria-controls":"nice-command-palette-list","aria-activedescendant":D[a.selectedIndex]?`nice-cmd-${D[a.selectedIndex].command.id}`:void 0})}),e.jsxs("div",{ref:S,id:"nice-command-palette-list",className:"nice-command-palette__list",role:"listbox",children:[D.length===0&&e.jsx("div",{className:"nice-command-palette__empty",children:x}),Array.from(y.entries()).map(([d,v])=>e.jsxs("div",{className:"nice-command-palette__group",children:[e.jsx("div",{className:"nice-command-palette__category",children:d}),v.map(u=>{const L=I++,f=L===a.selectedIndex;return e.jsxs("div",{id:`nice-cmd-${u.command.id}`,className:`nice-command-palette__item ${f?"nice-command-palette__item--selected":""} ${u.command.disabled?"nice-command-palette__item--disabled":""}`,role:"option","aria-selected":f,"aria-disabled":u.command.disabled,onClick:()=>!u.command.disabled&&M(u.command.id),onMouseEnter:()=>N({type:"SET_SELECTED",index:L}),children:[u.command.icon&&e.jsx("span",{className:"nice-command-palette__icon",children:u.command.icon}),e.jsxs("div",{className:"nice-command-palette__label-group",children:[e.jsx("span",{className:"nice-command-palette__label",children:u.match&&a.query?Oe(u.command.label,u.match.indices):u.command.label}),u.command.description&&e.jsx("span",{className:"nice-command-palette__description",children:u.command.description})]}),u.command.shortcut&&e.jsx("kbd",{className:"nice-command-palette__shortcut",children:u.command.shortcut}),u.isRecent&&e.jsx("span",{className:"nice-command-palette__recent-badge",children:"Recent"})]},u.command.id)})]},d))]}),E&&e.jsx("div",{className:"nice-command-palette__executing",children:"Executing..."})]})})]})};Ae.displayName="NiceCommandPaletteProvider";function vt(t){const{registerCommands:i,unregisterCommand:s}=We();n.useEffect(()=>(i(t),()=>{for(const l of t)s(l.id)}),[])}const Fe=n.forwardRef(({blocked:t,message:i,children:s,className:l,style:m,id:h},x)=>{const w=V.Gs(h);return e.jsxs("div",{ref:x,id:w,className:`nice-block-ui ${l||""}`,style:{position:"relative",...m},children:[s,t&&e.jsx("div",{className:"nice-block-ui__overlay","aria-busy":"true",role:"alert",children:i&&e.jsx("div",{className:"nice-block-ui__message",children:i})})]})});Fe.displayName="NiceBlockUI";const He=n.forwardRef(({windows:t,children:i,onChange:s,onClose:l,onFocus:m,showTaskbar:h=!0,size:x="md",className:w,style:p,id:b,...a},N)=>{const Y=V.Gs(b),{t:S}=V.Zt(),[E,R]=n.useState(null),B=n.useRef(null),c=t??[],g=Math.max(1,...c.map(o=>o.zIndex??1)),r=n.useCallback((o,k)=>{const y=c.map(I=>I.key===o?{...I,...k}:I);s?.(y)},[c,s]),j=n.useCallback(o=>{r(o,{zIndex:g+1}),m?.(o)},[r,g,m]),_=n.useCallback(o=>{l?.(o),s?.(c.filter(k=>k.key!==o))},[c,s,l]),H=n.useCallback(o=>{const k=c.find(y=>y.key===o);k&&r(o,{minimized:!k.minimized,maximized:!1})},[c,r]),D=n.useCallback(o=>{const k=c.find(y=>y.key===o);k&&r(o,{maximized:!k.maximized,minimized:!1})},[c,r]);n.useEffect(()=>{if(!E)return;const o=y=>{const I=c.find(d=>d.key===E.key);if(I)if(E.mode==="move")r(E.key,{x:y.clientX-E.offsetX,y:y.clientY-E.offsetY});else{const v=B.current?.getBoundingClientRect(),u=v?.left??0,L=v?.top??0;r(E.key,{width:Math.max(200,y.clientX-u-I.x),height:Math.max(100,y.clientY-L-I.y)})}},k=()=>R(null);return document.addEventListener("mousemove",o),document.addEventListener("mouseup",k),()=>{document.removeEventListener("mousemove",o),document.removeEventListener("mouseup",k)}},[E,c,r]);const M=n.useCallback((o,k,y)=>{k.preventDefault();const I=c.find(d=>d.key===o);I&&(j(o),R({key:o,offsetX:y==="move"?k.clientX-I.x:0,offsetY:y==="move"?k.clientY-I.y:0,mode:y}))},[c,j]);return e.jsxs("div",{ref:o=>{B.current=o,typeof N=="function"?N(o):N&&(N.current=o)},id:Y,className:`nice-wm nice-wm--${x} ${w??""}`,style:{...p,position:"relative",overflow:"hidden"},...a,children:[c.map(o=>{if(o.minimized)return null;const k=o.maximized,y=k?{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:o.zIndex??1}:{position:"absolute",top:o.y,left:o.x,width:o.width,height:o.height,zIndex:o.zIndex??1};return e.jsxs("div",{className:`nice-wm__window ${k?"nice-wm__window--maximized":""}`,style:y,onMouseDown:()=>j(o.key),role:"dialog","aria-label":o.title,children:[e.jsxs("div",{className:"nice-wm__titlebar",onMouseDown:I=>!k&&M(o.key,I,"move"),children:[o.icon&&e.jsx("span",{className:"nice-wm__icon",children:o.icon}),e.jsx("span",{className:"nice-wm__title",children:o.title}),e.jsxs("div",{className:"nice-wm__controls",children:[(o.minimizable??!0)&&e.jsx("button",{type:"button",className:"nice-wm__ctrl-btn nice-wm__ctrl-btn--min",onClick:()=>H(o.key),title:S("wm.minimize","Minimize"),children:"─"}),(o.maximizable??!0)&&e.jsx("button",{type:"button",className:"nice-wm__ctrl-btn nice-wm__ctrl-btn--max",onClick:()=>D(o.key),title:S("wm.maximize","Maximize"),children:k?"❐":"☐"}),(o.closable??!0)&&e.jsx("button",{type:"button",className:"nice-wm__ctrl-btn nice-wm__ctrl-btn--close",onClick:()=>_(o.key),title:S("wm.close","Close"),children:"✕"})]})]}),e.jsx("div",{className:"nice-wm__body",children:o.content}),(o.resizable??!0)&&!k&&e.jsx("div",{className:"nice-wm__resize-handle",onMouseDown:I=>M(o.key,I,"resize")})]},o.key)}),t===void 0&&i,h&&e.jsx("div",{className:"nice-wm__taskbar",role:"toolbar","aria-label":S("wm.taskbar","Taskbar"),children:c.map(o=>e.jsxs("button",{type:"button",className:`nice-wm__taskbar-btn ${o.minimized?"nice-wm__taskbar-btn--minimized":""}`,onClick:()=>{o.minimized&&H(o.key),j(o.key)},children:[o.icon&&e.jsx("span",{className:"nice-wm__taskbar-icon",children:o.icon}),e.jsx("span",{className:"nice-wm__taskbar-label",children:o.title})]},o.key))})]})});He.displayName="NiceWindowManager";function yt(t,i){const s=document.querySelector(t);if(!s)return null;const l=s.getBoundingClientRect();return{top:l.top-i+window.scrollY,left:l.left-i+window.scrollX,width:l.width+i*2,height:l.height+i*2}}function Nt(t,i,s,l){const h={w:window.innerWidth,h:window.innerHeight+window.scrollY},x={top:{top:t.top-s-12,left:t.left+t.width/2-i/2},bottom:{top:t.top+t.height+12,left:t.left+t.width/2-i/2},left:{top:t.top+t.height/2-s/2,left:t.left-i-12},right:{top:t.top+t.height/2-s/2,left:t.left+t.width+12}};if(l&&l!=="auto")return{...x[l],actualPlacement:l};for(const w of["bottom","top","right","left"]){const p=x[w];if(p.top>=0&&p.left>=0&&p.top+s<=h.h&&p.left+i<=h.w)return{...p,actualPlacement:w}}return{...x.bottom,actualPlacement:"bottom"}}const be={width:16,height:16,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":!0};function jt(){return e.jsxs("svg",{...be,children:[e.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),e.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})}function kt(){return e.jsx("svg",{...be,children:e.jsx("polyline",{points:"15 18 9 12 15 6"})})}function Ct(){return e.jsx("svg",{...be,children:e.jsx("polyline",{points:"9 18 15 12 9 6"})})}function Et(){return e.jsxs("svg",{...be,children:[e.jsx("polygon",{points:"5 4 15 12 5 20 5 4"}),e.jsx("line",{x1:"19",y1:"5",x2:"19",y2:"19"})]})}function zt(){return e.jsx("svg",{...be,children:e.jsx("polygon",{points:"6 4 20 12 6 20 6 4",fill:"currentColor"})})}function St(){return e.jsxs("svg",{...be,children:[e.jsx("rect",{x:"6",y:"4",width:"4",height:"16",fill:"currentColor"}),e.jsx("rect",{x:"14",y:"4",width:"4",height:"16",fill:"currentColor"})]})}function Re(t,i,s){return s==="text"?e.jsx("span",{className:"nice-tutorial__btn-label",children:i}):s==="icon-text"?e.jsxs(e.Fragment,{children:[t,e.jsx("span",{className:"nice-tutorial__btn-label",children:i})]}):t}const Be=({steps:t,active:i,onFinish:s,onSkip:l,onStepChange:m,closeOnEscape:h=!0,closeOnOverlayClick:x=!1,showProgress:w=!0,showSkipButton:p=!0,labels:b,animationDuration:a=300,overlayOpacity:N=.6,zIndex:Y=1e4,buttonsPlacement:S="floating-bottom",buttonsDisplay:E="icon",showAutoplay:R=!0,autoplayInterval:B=5e3,autoplaySpeedRange:c={min:2e3,max:15e3},onAutoplayChange:g})=>{const[r,j]=n.useState(0),[_,H]=n.useState(null),[D,M]=n.useState({w:340,h:200}),[o,k]=n.useState(!0),[y,I]=n.useState(!1),[d,v]=n.useState(B),u=n.useRef(null),L=n.useRef(-1),f=t[r],P=r===t.length-1,O=r===0,U=b?.next??"Next",J=b?.back??"Back",ee=b?.finish??"Finish",ue=b?.skip??"Skip",me=b?.stepOf??"of",he=b?.play??"Play",fe=b?.pause??"Pause",ze=b?.speed??"Speed",ve=b?.close??"Close";n.useEffect(()=>{i&&(j(0),I(!1),v(B))},[i,B]),n.useEffect(()=>{if(u.current){const z=u.current.getBoundingClientRect();M({w:z.width,h:z.height})}},[r,i]),n.useEffect(()=>{if(!i||!f)return;const z=f.highlightPadding??0,T=()=>{const W=yt(f.target,z);H(W)};if(T(),f.scrollIntoView!==!1){document.querySelector(f.target)?.scrollIntoView({behavior:"smooth",block:"center"});const G=setTimeout(T,350);return()=>clearTimeout(G)}},[i,f,r]),n.useEffect(()=>{!i||!f||L.current!==r&&(L.current>=0&&L.current<t.length&&t[L.current]?.onLeave?.(),f.onEnter?.(),L.current=r)},[i,f,r,t]);const te=n.useCallback(()=>{if(P)f?.onLeave?.(),s?.();else{const z=r+1;j(z),m?.(z)}},[r,P,s,m,f]),pe=n.useCallback(()=>{if(!O){const z=r-1;j(z),m?.(z)}},[r,O,m]);n.useEffect(()=>{if(!i||!f?.advanceOn)return;const z=document.querySelector(f.target);if(!z)return;const T=()=>te();return z.addEventListener(f.advanceOn.event,T),()=>z.removeEventListener(f.advanceOn.event,T)},[i,f,r,te]),n.useEffect(()=>{if(!i)return;const z=T=>{T.key==="Escape"&&h?l?.():T.key==="ArrowRight"?te():T.key==="ArrowLeft"&&pe()};return document.addEventListener("keydown",z),()=>document.removeEventListener("keydown",z)},[i,r,h,te,pe,l]),n.useEffect(()=>{k(!0);const z=setTimeout(()=>k(!1),a);return()=>clearTimeout(z)},[r,a]),n.useEffect(()=>{if(!i||!y)return;const z=setInterval(()=>{j(T=>{if(T>=t.length-1)return I(!1),g?.(!1),t[T]?.onLeave?.(),s?.(),T;const W=T+1;return m?.(W),W})},Math.max(500,d));return()=>clearInterval(z)},[i,y,d,t,g,s,m]);const Se=n.useCallback(()=>{I(z=>{const T=!z;return g?.(T),T})},[g]),xe=n.useMemo(()=>_?Nt(_,D.w,D.h,f?.placement):{top:typeof window<"u"?window.innerHeight/2:0,left:typeof window<"u"?window.innerWidth/2:0,actualPlacement:"bottom"},[_,D,f?.placement]),ye=t.length===0?0:(r+1)/t.length*100,ne=n.useCallback(z=>{const T=R&&t.length>1,W=p&&!P&&e.jsx("button",{type:"button",className:`nice-tutorial__btn nice-tutorial__btn--skip nice-tutorial__btn--${E}`,onClick:l,"aria-label":ue,title:ue,children:Re(e.jsx(Et,{}),ue,E)}),G=!O&&e.jsx("button",{type:"button",className:`nice-tutorial__btn nice-tutorial__btn--back nice-tutorial__btn--${E}`,onClick:pe,"aria-label":J,title:J,children:Re(e.jsx(kt,{}),J,E)}),we=!f?.waitForAction&&e.jsx("button",{type:"button",className:`nice-tutorial__btn nice-tutorial__btn--next nice-tutorial__btn--${E}`,onClick:te,"aria-label":P?ee:U,title:P?ee:U,children:Re(e.jsx(Ct,{}),P?ee:U,E)}),_e=T&&e.jsx("button",{type:"button",className:["nice-tutorial__btn","nice-tutorial__btn--play",`nice-tutorial__btn--${E}`,y?"nice-tutorial__btn--active":""].filter(Boolean).join(" "),onClick:Se,"aria-label":y?fe:he,title:y?fe:he,"aria-pressed":y,children:Re(y?e.jsx(St,{}):e.jsx(zt,{}),y?fe:he,E)});return e.jsxs("div",{className:["nice-tutorial__controls",z?"nice-tutorial__controls--inline":"nice-tutorial__controls--floating-bottom"].join(" "),style:z?void 0:{zIndex:Y+2},role:"group","aria-label":"Tutorial controls",children:[W,G,w&&e.jsxs("span",{className:"nice-tutorial__step-label","aria-live":"polite",children:[r+1," ",me," ",t.length]}),we,T&&e.jsx("div",{className:"nice-tutorial__progress-bar",role:"progressbar","aria-valuenow":Math.round(ye),"aria-valuemin":0,"aria-valuemax":100,"aria-label":`${r+1} ${me} ${t.length}`,children:e.jsx("div",{className:"nice-tutorial__progress-bar-fill",style:{width:`${ye}%`}})}),_e,T&&e.jsxs("label",{className:"nice-tutorial__speed",children:[e.jsx("input",{type:"range",className:"nice-tutorial__speed-slider",min:c.min,max:c.max,step:500,value:c.min+c.max-d,onChange:Ie=>v(c.min+c.max-Number(Ie.target.value)),"aria-label":ze}),e.jsxs("span",{className:"nice-tutorial__speed-value",children:[(d/1e3).toFixed(1),"s"]})]})]})},[R,p,w,E,O,P,l,ue,J,U,ee,he,fe,ze,me,pe,te,f,y,Se,r,t.length,ye,d,c,Y]);if(!i||!f)return null;const Ne=typeof document<"u"?Math.max(document.documentElement.scrollWidth,window.innerWidth):0,X=typeof document<"u"?Math.max(document.documentElement.scrollHeight,window.innerHeight):0;return e.jsxs("div",{className:"nice-tutorial",style:{zIndex:Y},"aria-modal":"true",role:"dialog","aria-label":"Tutorial",children:[e.jsxs("svg",{className:"nice-tutorial__overlay",style:{position:"absolute",top:0,left:0,width:Ne,height:X,pointerEvents:"auto"},onClick:x?l:void 0,children:[e.jsx("defs",{children:e.jsxs("mask",{id:"nice-tutorial-mask",children:[e.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white"}),_&&e.jsx("rect",{x:_.left,y:_.top,width:_.width,height:_.height,rx:"4",fill:"black",className:o?"nice-tutorial__spotlight--entering":""})]})}),e.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`rgba(0,0,0,${N})`,mask:"url(#nice-tutorial-mask)"})]}),_&&e.jsx("div",{className:`nice-tutorial__highlight ${o?"nice-tutorial__highlight--entering":""}`,style:{position:"absolute",top:_.top,left:_.left,width:_.width,height:_.height,transition:`all ${a}ms ease`}}),f.disableInteraction&&_&&e.jsx("div",{className:"nice-tutorial__blocker",style:{position:"absolute",top:_.top,left:_.left,width:_.width,height:_.height}}),e.jsxs("div",{ref:u,className:`nice-tutorial__tooltip nice-tutorial__tooltip--${xe.actualPlacement} ${o?"nice-tutorial__tooltip--entering":""}`,style:{position:"absolute",top:xe.top,left:xe.left,transition:`all ${a}ms ease`,maxWidth:380,zIndex:Y+1},children:[f.showArrow!==!1&&e.jsx("div",{className:`nice-tutorial__arrow nice-tutorial__arrow--${xe.actualPlacement}`}),e.jsxs("div",{className:"nice-tutorial__header",children:[e.jsx("h4",{className:"nice-tutorial__title",children:f.title}),p&&e.jsx("button",{type:"button",className:"nice-tutorial__close",onClick:l,"aria-label":ve,title:ve,children:e.jsx(jt,{})})]}),e.jsx("div",{className:"nice-tutorial__content",dangerouslySetInnerHTML:{__html:V.Ws(f.content)}}),S==="inline"&&ne(!0)]}),S==="floating-bottom"&&ne(!1)]})};Be.displayName="NiceTutorial";const Ue=n.createContext({startTutorial:()=>{},stopTutorial:()=>{},isActive:!1,currentStep:0,nextStep:()=>{},prevStep:()=>{},goToStep:()=>{}});function Rt(){return n.useContext(Ue)}const Ge=({children:t})=>{const[i,s]=n.useState([]),[l,m]=n.useState(!1),[h,x]=n.useState(0),w=n.useCallback(S=>{s(S),x(0),m(!0)},[]),p=n.useCallback(()=>{m(!1),x(0),s([])},[]),b=n.useCallback(()=>{x(S=>Math.min(S+1,i.length-1))},[i.length]),a=n.useCallback(()=>{x(S=>Math.max(S-1,0))},[]),N=n.useCallback(S=>{x(Math.max(0,Math.min(S,i.length-1)))},[i.length]),Y={startTutorial:w,stopTutorial:p,isActive:l,currentStep:h,nextStep:b,prevStep:a,goToStep:N};return e.jsxs(Ue.Provider,{value:Y,children:[t,l&&i.length>0&&e.jsx(Be,{steps:i,active:l,onFinish:p,onSkip:p,onStepChange:x})]})};Ge.displayName="NiceTutorialProvider";function Mt(t,i,s,l,m){const h=t<=m,x=t+m>=s,w=i<=m,p=i+m>=l;return w&&h?"top-left":w&&x?"top-right":p&&h?"bottom-left":p&&x?"bottom-right":h?"left":x?"right":w?"top":p?"bottom":"none"}function It(t){switch(t){case"left":return{left:0,top:0,width:"50%",height:"100%"};case"right":return{left:"50%",top:0,width:"50%",height:"100%"};case"top":return{left:0,top:0,width:"100%",height:"50%"};case"bottom":return{left:0,top:"50%",width:"100%",height:"50%"};case"top-left":return{left:0,top:0,width:"50%",height:"50%"};case"top-right":return{left:"50%",top:0,width:"50%",height:"50%"};case"bottom-left":return{left:0,top:"50%",width:"50%",height:"50%"};case"bottom-right":return{left:"50%",top:"50%",width:"50%",height:"50%"};default:return null}}const Ke=n.forwardRef(({windowKey:t,title:i,icon:s,children:l,footer:m,x:h,y:x,defaultPosition:w,width:p=480,height:b=360,minWidth:a=200,minHeight:N=120,maxWidth:Y,maxHeight:S,zIndex:E=1,closable:R=!0,minimizable:B=!0,maximizable:c=!0,fullscreenable:g=!1,pinnable:r=!1,resizable:j=!0,draggable:_=!0,snappable:H=!0,snapThreshold:D=20,minimized:M,maximized:o,fullscreen:k,pinned:y,focused:I,onClose:d,onMinimize:v,onMaximize:u,onFullscreen:L,onPin:f,onFocus:P,onMove:O,onResize:U,onSnap:J,onTitleBarDoubleClick:ee,size:ue="md",statusBar:me,titleBarActions:he,className:fe,style:ze,id:ve,accessMode:te,...pe},Se)=>{const xe=V.Gs(ve),ye=V.pc(te,ve),{t:ne}=V.Zt(),Ne=n.useRef(null);Ne.current==null&&(Ne.current=`nice-window-${Math.random().toString(36).slice(2,10)}`);const X=t??Ne.current,z=h??w?.x??100,T=x??w?.y??100;if(ye==="hidden")return null;const[W,G]=n.useState({x:z,y:T}),[we,_e]=n.useState({width:p,height:b}),[Ie,Ve]=n.useState(!1),[Ze,Qe]=n.useState(!1),[Je,et]=n.useState(!1),[tt,nt]=n.useState(!1),[Z,Le]=n.useState("none"),it=M??Ie,K=o??Ze,A=k??Je,je=y??tt,Te=I??!0,ae=W.x,de=W.y,ie=we.width,se=we.height,oe=n.useRef(null),F=n.useRef(null),$=n.useRef(null),st=n.useCallback(()=>{d?.(X)},[X,d]),ot=n.useCallback(()=>{Ve(!0),v?.(X)},[X,v]),Pe=n.useCallback(()=>{const C=!K;Qe(C),!C&&$.current?(G({x:$.current.x,y:$.current.y}),_e({width:$.current.w,height:$.current.h}),$.current=null):C&&($.current={x:ae,y:de,w:ie,h:se}),Le("none"),u?.(X,C)},[X,K,ae,de,ie,se,u]),$e=n.useCallback(()=>{const C=!A;et(C),C?$.current={x:ae,y:de,w:ie,h:se}:$.current&&(G({x:$.current.x,y:$.current.y}),_e({width:$.current.w,height:$.current.h}),$.current=null),L?.(X,C)},[X,A,ae,de,ie,se,L]),ct=n.useCallback(()=>{const C=!je;nt(C),f?.(X,C)},[X,je,f]),ke=n.useCallback(()=>{P?.(X)},[X,P]),rt=n.useCallback(()=>{ee?ee(X):c&&Pe()},[X,c,Pe,ee]);n.useEffect(()=>{const C=ce=>{if(!oe.current)return;const Q=ce.clientX-oe.current.startX+oe.current.origX,Ce=ce.clientY-oe.current.startY+oe.current.origY;G({x:Q,y:Ce}),O?.(X,{x:Q,y:Ce})},q=ce=>{if(oe.current){if(H){const Q=Mt(ce.clientX,ce.clientY,window.innerWidth,window.innerHeight,D);Q!=="none"&&($.current={x:W.x,y:W.y,w:ie,h:se},Le(Q),J?.(X,Q))}oe.current=null}};return document.addEventListener("mousemove",C),document.addEventListener("mouseup",q),()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",q)}});const lt=n.useCallback(C=>{!_||K||A||(C.preventDefault(),Z!=="none"&&($.current&&(G({x:$.current.x,y:$.current.y}),_e({width:$.current.w,height:$.current.h})),Le("none")),ke(),oe.current={startX:C.clientX,startY:C.clientY,origX:ae,origY:de})},[_,K,A,Z,ae,de,ke]);n.useEffect(()=>{const C=ce=>{if(!F.current)return;const Q=ce.clientX-F.current.startX,Ce=ce.clientY-F.current.startY,ge=F.current.handle;let re=F.current.origW,le=F.current.origH;if(ge.includes("e")&&(re=F.current.origW+Q),ge.includes("w")&&(re=F.current.origW-Q),ge.includes("s")&&(le=F.current.origH+Ce),ge.includes("n")&&(le=F.current.origH-Ce),re=Math.max(a,Y?Math.min(Y,re):re),le=Math.max(N,S?Math.min(S,le):le),ge.includes("w")){const Ye=we.width-re;G(Ee=>({...Ee,x:Ee.x+Ye}))}if(ge.includes("n")){const Ye=we.height-le;G(Ee=>({...Ee,y:Ee.y+Ye}))}_e({width:re,height:le}),U?.(X,{width:re,height:le})},q=()=>{F.current=null};return document.addEventListener("mousemove",C),document.addEventListener("mouseup",q),()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",q)}});const at=n.useCallback((C,q)=>{!j||K||A||Z!=="none"||(q.preventDefault(),q.stopPropagation(),ke(),F.current={startX:q.clientX,startY:q.clientY,origW:ie,origH:se,handle:C})},[j,K,A,Z,ie,se,ke]);if(n.useEffect(()=>{if(!Te)return;const C=q=>{q.key==="Escape"&&A&&$e()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[Te,A,$e]),it)return null;const Xe=Z!=="none"?It(Z):null,De=K||A,dt=A?{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:999999}:K?{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:E}:Xe?{position:"absolute",...Xe,zIndex:E}:{position:"absolute",top:de,left:ae,width:ie,height:se,zIndex:E},ut=["n","e","s","w","ne","se","sw","nw"],mt={n:"ns-resize",s:"ns-resize",e:"ew-resize",w:"ew-resize",ne:"nesw-resize",sw:"nesw-resize",nw:"nwse-resize",se:"nwse-resize"};return e.jsxs("div",{ref:Se,id:xe,className:`nice-window nice-window--${ue} ${Te?"nice-window--focused":""} ${je?"nice-window--pinned":""} ${De?"nice-window--maximized":""} ${Z!=="none"?`nice-window--snapped-${Z}`:""} ${fe??""}`,style:{...dt,...ze},onMouseDown:ke,role:"dialog","aria-label":i,...pe,children:[e.jsxs("div",{className:"nice-window__titlebar",onMouseDown:lt,onDoubleClick:rt,children:[s&&e.jsx("span",{className:"nice-window__icon",children:s}),e.jsx("span",{className:"nice-window__title",children:i}),e.jsxs("div",{className:"nice-window__actions",children:[he,r&&e.jsx("button",{type:"button",className:`nice-window__action nice-window__action--pin ${je?"nice-window__action--active":""}`,onClick:ct,title:ne("window.pin",je?"Unpin":"Pin"),children:"📌"}),B&&e.jsx("button",{type:"button",className:"nice-window__action nice-window__action--minimize",onClick:ot,title:ne("window.minimize","Minimize"),children:"─"}),c&&e.jsx("button",{type:"button",className:"nice-window__action nice-window__action--maximize",onClick:Pe,title:ne("window.maximize",K?"Restore":"Maximize"),children:K?"❐":"☐"}),g&&e.jsx("button",{type:"button",className:"nice-window__action nice-window__action--fullscreen",onClick:$e,title:ne("window.fullscreen",A?"Exit Full Screen":"Full Screen"),children:A?"⇲":"⇱"}),R&&e.jsx("button",{type:"button",className:"nice-window__action nice-window__action--close",onClick:st,title:ne("window.close","Close"),children:"✕"})]})]}),e.jsx("div",{className:"nice-window__body",children:l}),m&&e.jsx("div",{className:"nice-window__footer",children:m}),me&&e.jsx("div",{className:"nice-window__statusbar",children:me}),j&&!De&&Z==="none"&&e.jsx(e.Fragment,{children:ut.map(C=>e.jsx("div",{className:`nice-window__resize nice-window__resize--${C}`,style:{cursor:mt[C]},onMouseDown:q=>at(C,q)},C))})]})});Ke.displayName="NiceWindow";exports.NiceActionSheet=ht;exports.NiceBlockUI=Fe;exports.NiceBox=xt;exports.NiceCommandPaletteProvider=Ae;exports.NiceLoadPanel=pt;exports.NicePopover=ft;exports.NiceResizable=_t;exports.NiceResponsiveBox=wt;exports.NiceScrollView=gt;exports.NiceTutorial=Be;exports.NiceTutorialProvider=Ge;exports.NiceWindow=Ke;exports.NiceWindowManager=He;exports.fuzzyMatch=Me;exports.highlightMatches=Oe;exports.useCommandPalette=We;exports.useNiceTutorial=Rt;exports.useRegisterCommands=vt;
|