@nice2dev/ui 1.0.29 → 1.0.30
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 +17 -0
- package/dist/NiceBackupStatusBadge.doc-Bx2bFmBQ.cjs +1 -0
- package/dist/NiceBackupStatusBadge.doc-CdDxIQ-M.js +25 -0
- package/dist/NiceConfirmDialog-BiTJVR4-.js +81 -0
- package/dist/NiceConfirmDialog-Bjw_rN4o.cjs +1 -0
- package/dist/NiceErrorBoundary-1H751jK7.cjs +1 -0
- package/dist/NiceErrorBoundary-B-txoU3Y.js +709 -0
- package/dist/NiceForm-DGUTmaZT.js +5014 -0
- package/dist/NiceForm-DmU-gmyv.cjs +382 -0
- package/dist/NiceModal-BClAtR5T.js +95 -0
- package/dist/NiceModal-iKwtagFB.cjs +1 -0
- package/dist/NiceModuleLifecyclePanel-BO8Hw_W9.js +7619 -0
- package/dist/NiceModuleLifecyclePanel-Ch7HRRoy.cjs +1 -0
- package/dist/NicePagination-BVo-4KAD.js +172 -0
- package/dist/NicePagination-CaohvQsY.cjs +1 -0
- package/dist/NicePinCodeInput-DsyLuc0b.cjs +696 -0
- package/dist/NicePinCodeInput-nuRCN-9R.js +13223 -0
- package/dist/NiceSavedQueryPanel-BBFV4qiF.js +6969 -0
- package/dist/NiceSavedQueryPanel-CsiVNkCT.cjs +596 -0
- package/dist/NiceWindow-Cm9E6EAi.cjs +1 -0
- package/dist/NiceWindow-FMrVS7zo.js +1603 -0
- package/dist/charts-B90sSFeJ.cjs +761 -0
- package/dist/charts-DaLf19vS.js +4671 -0
- package/dist/charts.cjs +1 -1
- package/dist/charts.mjs +1 -1
- package/dist/core-BUTtIHg0.js +27766 -0
- package/dist/core-CESNSRyS.cjs +122 -0
- package/dist/data-branching-ByQdcjKO.cjs +1 -0
- package/dist/data-branching-psTzlcrT.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.mjs +1 -1
- package/dist/devops-D7bQ3rE4.cjs +17 -0
- package/dist/devops-jCmpD6O-.js +8165 -0
- package/dist/devops.cjs +1 -1
- package/dist/devops.mjs +3 -3
- package/dist/editors.cjs +1 -1
- package/dist/editors.d.ts +4 -0
- package/dist/editors.mjs +3 -3
- package/dist/feedback.cjs +1 -1
- package/dist/feedback.mjs +3 -3
- package/dist/index-BpixglWg.js +69337 -0
- package/dist/index-DLR-aWZR.cjs +5506 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +359 -145
- package/dist/index.mjs +986 -976
- package/dist/lazy.cjs +1 -1
- package/dist/lazy.mjs +24 -24
- package/dist/navigation.cjs +1 -1
- package/dist/navigation.mjs +146 -146
- package/dist/no-code-BHo5WrXr.js +7425 -0
- package/dist/no-code-DyA_1_Th.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 +4 -0
- package/dist/overlays.mjs +66 -66
- package/dist/pickerCommons-BEc3pZ_s.js +2044 -0
- package/dist/pickerCommons-CrITwM88.cjs +1 -0
- package/dist/style.css +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("react/jsx-runtime"),D=require("./core-CESNSRyS.cjs"),n=require("react"),ht=({visible:t,onClose:i,title:s,items:l,showCancelButton:m=!0,cancelText:h,className:x,style:w})=>{const{t:f}=D.Gt();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((g,a)=>e.jsxs("button",{className:`nice-actionsheet__item ${g.type==="danger"?"nice-actionsheet__item--danger":""}`,disabled:g.disabled,onClick:()=>{g.onClick?.(),i()},children:[g.icon&&e.jsx("span",{className:"nice-actionsheet__icon",children:g.icon}),g.text]},a))}),m&&e.jsx("button",{className:"nice-actionsheet__cancel",onClick:i,children:h||f("cancel","Cancel")})]})]}):null},ft=({visible:t,onClose:i,targetRef:s,position:l="bottom",title:m,showArrow:h=!0,width:x,children:w,className:f,style:g,displayStyle:a})=>{D.ac("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(),b=B.getBoundingClientRect();let r=0,j=0;const _=8;switch(l){case"top":r=c.top-b.height-_,j=c.left+(c.width-b.width)/2;break;case"bottom":r=c.bottom+_,j=c.left+(c.width-b.width)/2;break;case"left":r=c.top+(c.height-b.height)/2,j=c.left-b.width-_;break;case"right":r=c.top+(c.height-b.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} ${f||""}`,style:{...g,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}=D.Gt();if(!t)return null;const f=!!s?.current,g=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(f&&s.current){const a=s.current;return a.style.position=a.style.position||"relative",g}return g},xt=({direction:t="row",align:i,justify:s,wrap:l,gap:m,flex:h,children:x,className:w,style:f})=>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,...f},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:f,className:g,style:a})=>{const[N,Y]=n.useState({width:t,height:i}),S=n.useRef(null),E=(c,b)=>{b.preventDefault();const r=b.clientX,j=b.clientY,_=N.width,G=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,p=u.clientY-j;let $=_,q=G;o&&($=_+L),k&&($=_-L),y&&(q=G+p),I&&(q=G-p),$=Math.max(s,Math.min(m,$)),q=Math.max(l,Math.min(h,q)),Y({width:$,height:q}),w?.({width:$,height:q})},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 b={position:"absolute",zIndex:1},r=8;return c==="right"?{...b,top:0,right:-r/2,width:r,height:"100%",cursor:R(c)}:c==="bottom"?{...b,left:0,bottom:-r/2,width:"100%",height:r,cursor:R(c)}:c==="left"?{...b,top:0,left:-r/2,width:r,height:"100%",cursor:R(c)}:c==="top"?{...b,top:-r/2,left:0,width:"100%",height:r,cursor:R(c)}:c==="bottomRight"?{...b,bottom:-r/2,right:-r/2,width:r*2,height:r*2,cursor:R(c)}:c==="bottomLeft"?{...b,bottom:-r/2,left:-r/2,width:r*2,height:r*2,cursor:R(c)}:c==="topRight"?{...b,top:-r/2,right:-r/2,width:r*2,height:r*2,cursor:R(c)}:c==="topLeft"?{...b,top:-r/2,left:-r/2,width:r*2,height:r*2,cursor:R(c)}:b};return e.jsxs("div",{ref:S,className:`nice-resizable ${g||""}`,style:{...a,width:N.width,height:N.height,position:"relative",overflow:"hidden"},children:[f,x.map(c=>e.jsx("div",{style:B(c),onPointerDown:b=>E(c,b)},c))]})},gt=({direction:t="vertical",showScrollbar:i="onInteraction",width:s,height:l,onScroll:m,children:h,className:x,style:w})=>{const f=t==="horizontal"||t==="both"?"auto":"hidden",g=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:f,overflowY:g},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 f=0;f<l.length&&m<s.length;f++)l[f]===s[m]&&(h.push(f),w===f-1&&(x+=3),(f===0||/[\s\-_/.]/.test(i[f-1]))&&(x+=5),i[f]===t[m]&&(x+=1),x+=1,w=f,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:f,onClose:g})=>{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})},[]),b=n.useCallback(d=>{N({type:"REGISTER_BATCH",commands:d})},[]),r=n.useCallback(()=>{N({type:"OPEN"}),f?.()},[f]),j=n.useCallback(()=>{N({type:"CLOSE"}),g?.()},[g]),_=n.useCallback(()=>{a.isOpen?j():r()},[a.isOpen,j,r]),O=n.useMemo(()=>{const d=Array.from(a.commands.values()).filter(u=>!u.hidden);if(!a.query.trim()){const u=a.recentIds.map(p=>a.commands.get(p)).filter(p=>!!p&&!p.hidden),L=d.filter(p=>!a.recentIds.includes(p.id));return L.sort((p,$)=>p.label.localeCompare($.label)),[...u,...L].map(p=>({command:p,match:null,isRecent:a.recentIds.includes(p.id)}))}return d.map(u=>{const L=Me(a.query,u.label),p=u.description?Me(a.query,u.description):null,$=u.keywords?.map(H=>Me(a.query,H)).filter(Boolean)[0]??null,q=[L,p,$].filter(Boolean).sort((H,J)=>(J?.score??0)-(H?.score??0))[0];return{command:u,match:q,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=O.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=O[a.selectedIndex];u&&M(u.command.id)}}},[O,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:b,open:r,close:j,toggle:_,isOpen:a.isOpen,executeCommand:M}),[B,c,b,r,j,_,a.isOpen,M]),y=n.useMemo(()=>{const d=new Map;for(const v of O){const u=v.command.category??"General";d.has(u)||d.set(u,[]),d.get(u).push(v)}return d},[O]);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":O[a.selectedIndex]?`nice-cmd-${O[a.selectedIndex].command.id}`:void 0})}),e.jsxs("div",{ref:S,id:"nice-command-palette-list",className:"nice-command-palette__list",role:"listbox",children:[O.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++,p=L===a.selectedIndex;return e.jsxs("div",{id:`nice-cmd-${u.command.id}`,className:`nice-command-palette__item ${p?"nice-command-palette__item--selected":""} ${u.command.disabled?"nice-command-palette__item--disabled":""}`,role:"option","aria-selected":p,"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,spinner:s,blur:l,children:m,className:h,style:x,id:w},f)=>{const g=D.hc(w);return e.jsxs("div",{ref:f,id:g,className:`nice-block-ui ${h||""}`,style:{position:"relative",...x},children:[m,t&&e.jsx("div",{className:`nice-block-ui__overlay${l?" nice-block-ui__overlay--blur":""}`,"aria-busy":"true",role:"alert",children:(s||i)&&e.jsxs("div",{className:"nice-block-ui__content",children:[s&&e.jsx("div",{className:"nice-block-ui__spinner","aria-hidden":"true"}),i&&e.jsx("div",{className:"nice-block-ui__message",children:i})]})})]})});Fe.displayName="NiceBlockUI";const Ue=n.forwardRef(({windows:t,children:i,onChange:s,onClose:l,onFocus:m,showTaskbar:h=!0,size:x="md",className:w,style:f,id:g,...a},N)=>{const Y=D.hc(g),{t:S}=D.Gt(),[E,R]=n.useState(null),B=n.useRef(null),c=t??[],b=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:b+1}),m?.(o)},[r,b,m]),_=n.useCallback(o=>{l?.(o),s?.(c.filter(k=>k.key!==o))},[c,s,l]),G=n.useCallback(o=>{const k=c.find(y=>y.key===o);k&&r(o,{minimized:!k.minimized,maximized:!1})},[c,r]),O=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:{...f,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:()=>G(o.key),title:S("wm.minimize","Minimize"),children:e.jsx(D.oa,{name:"minus",size:14})}),(o.maximizable??!0)&&e.jsx("button",{type:"button",className:"nice-wm__ctrl-btn nice-wm__ctrl-btn--max",onClick:()=>O(o.key),title:S("wm.maximize","Maximize"),children:e.jsx(D.oa,{name:k?"copy":"window",size:14})}),(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(D.oa,{name:"close",size:14})})]})]}),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&&G(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))})]})});Ue.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 f=x[w];if(f.top>=0&&f.left>=0&&f.top+s<=h.h&&f.left+i<=h.w)return{...f,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:f=!0,labels:g,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:b})=>{const[r,j]=n.useState(0),[_,G]=n.useState(null),[O,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),p=t[r],$=r===t.length-1,q=r===0,H=g?.next??"Next",J=g?.back??"Back",ee=g?.finish??"Finish",ue=g?.skip??"Skip",me=g?.stepOf??"of",he=g?.play??"Play",fe=g?.pause??"Pause",ze=g?.speed??"Speed",ve=g?.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||!p)return;const z=p.highlightPadding??0,T=()=>{const A=yt(p.target,z);G(A)};if(T(),p.scrollIntoView!==!1){document.querySelector(p.target)?.scrollIntoView({behavior:"smooth",block:"center"});const K=setTimeout(T,350);return()=>clearTimeout(K)}},[i,p,r]),n.useEffect(()=>{!i||!p||L.current!==r&&(L.current>=0&&L.current<t.length&&t[L.current]?.onLeave?.(),p.onEnter?.(),L.current=r)},[i,p,r,t]);const te=n.useCallback(()=>{if($)p?.onLeave?.(),s?.();else{const z=r+1;j(z),m?.(z)}},[r,$,s,m,p]),pe=n.useCallback(()=>{if(!q){const z=r-1;j(z),m?.(z)}},[r,q,m]);n.useEffect(()=>{if(!i||!p?.advanceOn)return;const z=document.querySelector(p.target);if(!z)return;const T=()=>te();return z.addEventListener(p.advanceOn.event,T),()=>z.removeEventListener(p.advanceOn.event,T)},[i,p,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),b?.(!1),t[T]?.onLeave?.(),s?.(),T;const A=T+1;return m?.(A),A})},Math.max(500,d));return()=>clearInterval(z)},[i,y,d,t,b,s,m]);const Se=n.useCallback(()=>{I(z=>{const T=!z;return b?.(T),T})},[b]),xe=n.useMemo(()=>_?Nt(_,O.w,O.h,p?.placement):{top:typeof window<"u"?window.innerHeight/2:0,left:typeof window<"u"?window.innerWidth/2:0,actualPlacement:"bottom"},[_,O,p?.placement]),ye=t.length===0?0:(r+1)/t.length*100,ne=n.useCallback(z=>{const T=R&&t.length>1,A=f&&!$&&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)}),K=!q&&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=!p?.waitForAction&&e.jsx("button",{type:"button",className:`nice-tutorial__btn nice-tutorial__btn--next nice-tutorial__btn--${E}`,onClick:te,"aria-label":$?ee:H,title:$?ee:H,children:Re(e.jsx(Ct,{}),$?ee:H,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:[A,K,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,f,w,E,q,$,l,ue,J,H,ee,he,fe,ze,me,pe,te,p,y,Se,r,t.length,ye,d,c,Y]);if(!i||!p)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`}}),p.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:[p.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:p.title}),f&&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:D.lc(p.content)}}),S==="inline"&&ne(!0)]}),S==="floating-bottom"&&ne(!1)]})};Be.displayName="NiceTutorial";const Ge=n.createContext({startTutorial:()=>{},stopTutorial:()=>{},isActive:!1,currentStep:0,nextStep:()=>{},prevStep:()=>{},goToStep:()=>{}});function Rt(){return n.useContext(Ge)}const He=({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)},[]),f=n.useCallback(()=>{m(!1),x(0),s([])},[]),g=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:f,isActive:l,currentStep:h,nextStep:g,prevStep:a,goToStep:N};return e.jsxs(Ge.Provider,{value:Y,children:[t,l&&i.length>0&&e.jsx(Be,{steps:i,active:l,onFinish:f,onSkip:f,onStepChange:x})]})};He.displayName="NiceTutorialProvider";function Mt(t,i,s,l,m){const h=t<=m,x=t+m>=s,w=i<=m,f=i+m>=l;return w&&h?"top-left":w&&x?"top-right":f&&h?"bottom-left":f&&x?"bottom-right":h?"left":x?"right":w?"top":f?"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:f=480,height:g=360,minWidth:a=200,minHeight:N=120,maxWidth:Y,maxHeight:S,zIndex:E=1,closable:R=!0,minimizable:B=!0,maximizable:c=!0,fullscreenable:b=!1,pinnable:r=!1,resizable:j=!0,draggable:_=!0,snappable:G=!0,snapThreshold:O=20,minimized:M,maximized:o,fullscreen:k,pinned:y,focused:I,onClose:d,onMinimize:v,onMaximize:u,onFullscreen:L,onPin:p,onFocus:$,onMove:q,onResize:H,onSnap:J,onTitleBarDoubleClick:ee,size:ue="md",statusBar:me,titleBarActions:he,className:fe,style:ze,id:ve,accessMode:te,...pe},Se)=>{const xe=D.hc(ve),ye=D.$c(te,ve),{t:ne}=D.Gt(),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[A,K]=n.useState({x:z,y:T}),[we,_e]=n.useState({width:f,height:g}),[Ie,Ve]=n.useState(!1),[Qe,Ze]=n.useState(!1),[Je,et]=n.useState(!1),[tt,nt]=n.useState(!1),[Q,Le]=n.useState("none"),it=M??Ie,V=o??Qe,F=k??Je,je=y??tt,Te=I??!0,ae=A.x,de=A.y,ie=we.width,se=we.height,oe=n.useRef(null),U=n.useRef(null),P=n.useRef(null),st=n.useCallback(()=>{d?.(X)},[X,d]),ot=n.useCallback(()=>{Ve(!0),v?.(X)},[X,v]),$e=n.useCallback(()=>{const C=!V;Ze(C),!C&&P.current?(K({x:P.current.x,y:P.current.y}),_e({width:P.current.w,height:P.current.h}),P.current=null):C&&(P.current={x:ae,y:de,w:ie,h:se}),Le("none"),u?.(X,C)},[X,V,ae,de,ie,se,u]),Pe=n.useCallback(()=>{const C=!F;et(C),C?P.current={x:ae,y:de,w:ie,h:se}:P.current&&(K({x:P.current.x,y:P.current.y}),_e({width:P.current.w,height:P.current.h}),P.current=null),L?.(X,C)},[X,F,ae,de,ie,se,L]),ct=n.useCallback(()=>{const C=!je;nt(C),p?.(X,C)},[X,je,p]),ke=n.useCallback(()=>{$?.(X)},[X,$]),rt=n.useCallback(()=>{ee?ee(X):c&&$e()},[X,c,$e,ee]);n.useEffect(()=>{const C=ce=>{if(!oe.current)return;const Z=ce.clientX-oe.current.startX+oe.current.origX,Ce=ce.clientY-oe.current.startY+oe.current.origY;K({x:Z,y:Ce}),q?.(X,{x:Z,y:Ce})},W=ce=>{if(oe.current){if(G){const Z=Mt(ce.clientX,ce.clientY,window.innerWidth,window.innerHeight,O);Z!=="none"&&(P.current={x:A.x,y:A.y,w:ie,h:se},Le(Z),J?.(X,Z))}oe.current=null}};return document.addEventListener("mousemove",C),document.addEventListener("mouseup",W),()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",W)}});const lt=n.useCallback(C=>{!_||V||F||(C.preventDefault(),Q!=="none"&&(P.current&&(K({x:P.current.x,y:P.current.y}),_e({width:P.current.w,height:P.current.h})),Le("none")),ke(),oe.current={startX:C.clientX,startY:C.clientY,origX:ae,origY:de})},[_,V,F,Q,ae,de,ke]);n.useEffect(()=>{const C=ce=>{if(!U.current)return;const Z=ce.clientX-U.current.startX,Ce=ce.clientY-U.current.startY,ge=U.current.handle;let re=U.current.origW,le=U.current.origH;if(ge.includes("e")&&(re=U.current.origW+Z),ge.includes("w")&&(re=U.current.origW-Z),ge.includes("s")&&(le=U.current.origH+Ce),ge.includes("n")&&(le=U.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;K(Ee=>({...Ee,x:Ee.x+Ye}))}if(ge.includes("n")){const Ye=we.height-le;K(Ee=>({...Ee,y:Ee.y+Ye}))}_e({width:re,height:le}),H?.(X,{width:re,height:le})},W=()=>{U.current=null};return document.addEventListener("mousemove",C),document.addEventListener("mouseup",W),()=>{document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",W)}});const at=n.useCallback((C,W)=>{!j||V||F||Q!=="none"||(W.preventDefault(),W.stopPropagation(),ke(),U.current={startX:W.clientX,startY:W.clientY,origW:ie,origH:se,handle:C})},[j,V,F,Q,ie,se,ke]);if(n.useEffect(()=>{if(!Te)return;const C=W=>{W.key==="Escape"&&F&&Pe()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[Te,F,Pe]),it)return null;const Xe=Q!=="none"?It(Q):null,De=V||F,dt=F?{position:"fixed",top:0,left:0,width:"100vw",height:"100vh",zIndex:999999}:V?{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":""} ${Q!=="none"?`nice-window--snapped-${Q}`:""} ${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:e.jsx(D.oa,{name:"paperclip",size:14})}),B&&e.jsx("button",{type:"button",className:"nice-window__action nice-window__action--minimize",onClick:ot,title:ne("window.minimize","Minimize"),children:e.jsx(D.oa,{name:"minus",size:14})}),c&&e.jsx("button",{type:"button",className:"nice-window__action nice-window__action--maximize",onClick:$e,title:ne("window.maximize",V?"Restore":"Maximize"),children:e.jsx(D.oa,{name:V?"copy":"window",size:14})}),b&&e.jsx("button",{type:"button",className:"nice-window__action nice-window__action--fullscreen",onClick:Pe,title:ne("window.fullscreen",F?"Exit Full Screen":"Full Screen"),children:e.jsx(D.oa,{name:F?"collapse":"expand",size:14})}),R&&e.jsx("button",{type:"button",className:"nice-window__action nice-window__action--close",onClick:st,title:ne("window.close","Close"),children:e.jsx(D.oa,{name:"close",size:14})})]})]}),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&&Q==="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:W=>at(C,W)},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=He;exports.NiceWindow=Ke;exports.NiceWindowManager=Ue;exports.fuzzyMatch=Me;exports.highlightMatches=Oe;exports.useCommandPalette=We;exports.useNiceTutorial=Rt;exports.useRegisterCommands=vt;
|