@nice2dev/ui 1.0.10 → 1.0.12

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.
Files changed (89) hide show
  1. package/README.md +44 -0
  2. package/dist/NiceErrorBoundary-BZEHCXNM.cjs +1 -0
  3. package/dist/NiceErrorBoundary-D6jw6wwD.js +762 -0
  4. package/dist/NiceErrorBoundary-DT5XPTeu.cjs +1 -0
  5. package/dist/NiceErrorBoundary-SqPtbIxK.js +762 -0
  6. package/dist/NiceForm-BgR-m8T9.cjs +382 -0
  7. package/dist/NiceForm-CI_vgkD4.cjs +382 -0
  8. package/dist/NiceForm-DYKciCeR.js +5131 -0
  9. package/dist/NiceForm-t9zdH8kU.js +5343 -0
  10. package/dist/NiceForm.css +1 -1
  11. package/dist/NiceModal-Br3J9jOV.cjs +1 -0
  12. package/dist/NiceModal-DQ7u-xVm.cjs +1 -0
  13. package/dist/NiceModal-DVAsBzHP.js +95 -0
  14. package/dist/NiceModal-IkSunDgK.js +95 -0
  15. package/dist/NiceModuleLifecyclePanel-Cj4x54sw.cjs +1 -0
  16. package/dist/NiceModuleLifecyclePanel-D-xBAp1_.js +5228 -0
  17. package/dist/NiceModuleLifecyclePanel-D3azLDdj.js +5249 -0
  18. package/dist/NiceModuleLifecyclePanel-DEfAIhFf.cjs +1 -0
  19. package/dist/NiceModuleLifecyclePanel.css +1 -1
  20. package/dist/NicePagination-CbB5P1N_.js +171 -0
  21. package/dist/NicePagination-DDFkSRr9.js +171 -0
  22. package/dist/NicePagination-DGHtXqy1.cjs +1 -0
  23. package/dist/NicePagination-UGjzvRUS.cjs +1 -0
  24. package/dist/NicePinCodeInput-BhIABBTV.cjs +419 -0
  25. package/dist/NicePinCodeInput-BmRO9HSQ.js +11830 -0
  26. package/dist/NicePinCodeInput-D91uvVsF.cjs +419 -0
  27. package/dist/NicePinCodeInput-jMNfPqOx.js +11866 -0
  28. package/dist/NicePinCodeInput.css +1 -1
  29. package/dist/NiceSavedQueryPanel-7nZe46t8.cjs +596 -0
  30. package/dist/NiceSavedQueryPanel-BSGzs7Oc.js +6449 -0
  31. package/dist/NiceSavedQueryPanel-BkYRk5cX.js +6441 -0
  32. package/dist/NiceSavedQueryPanel-CmFSi21-.cjs +596 -0
  33. package/dist/NiceSavedQueryPanel.css +1 -1
  34. package/dist/NiceTabs-BeaxZzAO.js +1636 -0
  35. package/dist/NiceTabs-C4H5un8J.cjs +1 -0
  36. package/dist/NiceTabs-DcbYFIWR.cjs +1 -0
  37. package/dist/NiceTabs-DlsCMth_.js +1622 -0
  38. package/dist/NiceWindow-BNrA5Dxq.js +1409 -0
  39. package/dist/NiceWindow-Bga9fOkg.js +1409 -0
  40. package/dist/NiceWindow-CbzJmurQ.cjs +1 -0
  41. package/dist/NiceWindow-CxWTj5xH.cjs +1 -0
  42. package/dist/charts-BcvKWYUl.cjs +759 -0
  43. package/dist/charts-DZvmvfhM.js +4621 -0
  44. package/dist/charts-F_b5-OR8.js +4621 -0
  45. package/dist/charts-e10jGjuF.cjs +759 -0
  46. package/dist/charts.cjs +1 -1
  47. package/dist/charts.css +1 -1
  48. package/dist/charts.mjs +1 -1
  49. package/dist/core-B4b1BmHt.js +22177 -0
  50. package/dist/core-CSfXTICE.cjs +96 -0
  51. package/dist/core-CjmLbclt.cjs +96 -0
  52. package/dist/core-ClmvtMVZ.js +22253 -0
  53. package/dist/data-branching-B_9C6-hE.cjs +1 -0
  54. package/dist/data-branching-BmCKIXgr.js +6121 -0
  55. package/dist/data-branching.cjs +1 -1
  56. package/dist/data-branching.mjs +1 -1
  57. package/dist/data.cjs +1 -1
  58. package/dist/data.d.ts +2 -2
  59. package/dist/data.mjs +1 -1
  60. package/dist/devops-BL39OCVh.js +7660 -0
  61. package/dist/devops-CkuTC7RJ.cjs +17 -0
  62. package/dist/devops.cjs +1 -1
  63. package/dist/devops.mjs +1 -1
  64. package/dist/editors.cjs +1 -1
  65. package/dist/editors.d.ts +92 -6
  66. package/dist/editors.mjs +3 -3
  67. package/dist/feedback.cjs +1 -1
  68. package/dist/feedback.mjs +2 -2
  69. package/dist/index-BU6KCDpP.js +57872 -0
  70. package/dist/index-D7i7sZGV.cjs +5194 -0
  71. package/dist/index-DlHlXz8e.js +57319 -0
  72. package/dist/index-Dx726U90.cjs +5192 -0
  73. package/dist/index.cjs +1 -1
  74. package/dist/index.css +1 -1
  75. package/dist/index.d.ts +448 -20
  76. package/dist/index.mjs +881 -868
  77. package/dist/lazy.cjs +1 -1
  78. package/dist/lazy.mjs +24 -24
  79. package/dist/navigation.cjs +1 -1
  80. package/dist/navigation.mjs +24 -24
  81. package/dist/no-code-Bb3QFKdm.cjs +332 -0
  82. package/dist/no-code-snLY0d6I.js +7065 -0
  83. package/dist/no-code.cjs +1 -1
  84. package/dist/no-code.mjs +1 -1
  85. package/dist/overlays.cjs +1 -1
  86. package/dist/overlays.mjs +81 -81
  87. package/dist/vendor-DF586kuF.js +271 -0
  88. package/dist/vendor-DHEorsoy.cjs +1 -0
  89. package/package.json +5 -4
package/dist/no-code.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./no-code-B5bzduNP.cjs");exports.NiceAPIFlow=e.NiceAPIFlow;exports.NiceCodePreview=e.NiceCodePreview;exports.NiceCodeTemplate=e.NiceCodeTemplate;exports.NiceComponentDesigner=e.NiceComponentDesigner;exports.NiceDataMapper=e.NiceDataMapper;exports.NiceEventOrchestrator=e.NiceEventOrchestrator;exports.NiceLowCodeStudio=e.NiceLowCodeStudio;exports.NicePageBuilder=e.NicePageBuilder;exports.NiceStateDesigner=e.NiceStateDesigner;exports.NiceTestBuilder=e.NiceTestBuilder;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./no-code-Bb3QFKdm.cjs");exports.NiceAPIFlow=e.NiceAPIFlow;exports.NiceCodePreview=e.NiceCodePreview;exports.NiceCodeTemplate=e.NiceCodeTemplate;exports.NiceComponentDesigner=e.NiceComponentDesigner;exports.NiceDataMapper=e.NiceDataMapper;exports.NiceEventOrchestrator=e.NiceEventOrchestrator;exports.NiceLowCodeStudio=e.NiceLowCodeStudio;exports.NicePageBuilder=e.NicePageBuilder;exports.NiceStateDesigner=e.NiceStateDesigner;exports.NiceTestBuilder=e.NiceTestBuilder;
package/dist/no-code.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { N as i, a as s, b as c, c as o, d as r, e as t, f as N, g as d, h as n, i as p } from "./no-code-D8RJ7lx0.js";
1
+ import { N as i, a as s, b as c, c as o, d as r, e as t, f as N, g as d, h as n, i as p } from "./no-code-snLY0d6I.js";
2
2
  export {
3
3
  i as NiceAPIFlow,
4
4
  s as NiceCodePreview,
package/dist/overlays.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./NiceWindow-CVgkxcCz.cjs"),r=require("react/jsx-runtime"),e=require("react"),I=require("react-dom"),M=require("./core-C2ZmWe_u.cjs");function B(){const t=e.useContext(M.NiceThemeContext);return t?.portalTarget?t.portalTarget:typeof document<"u"?document.body:null}const O=({open:t,onClose:i,children:v,title:o,size:g="md",closeOnBackdropClick:l=!0,closeOnEscape:d=!0,disableFocusTrap:u=!1,disableBodyScroll:T=!0,zIndex:p=1e3,className:_,style:C})=>{const w=e.useRef(null);M.useFocusTrap(w,t&&!u);const y=B();e.useEffect(()=>{if(!T&&t){const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}}},[t,T]),e.useEffect(()=>{if(!d||!t)return;const n=x=>{x.key==="Escape"&&(x.preventDefault(),i())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[d,t,i]);const f=e.useCallback(n=>{l&&n.target===n.currentTarget&&i()},[l,i]);if(!t)return null;const s={sm:"nice-modal--sm",md:"nice-modal--md",lg:"nice-modal--lg",xl:"nice-modal--xl",full:"nice-modal--full"}[g];return I.createPortal(r.jsx("div",{className:"nice-modal__overlay",style:{zIndex:p},onClick:f,role:"presentation",children:r.jsx("div",{ref:w,className:`nice-modal ${s} ${_||""}`,role:"dialog","aria-modal":"true","aria-label":o,style:C,tabIndex:-1,children:v})}),y)},W=({children:t,showClose:i=!0,onClose:v,className:o})=>r.jsxs("div",{className:`nice-modal__header ${o||""}`,children:[r.jsx("div",{className:"nice-modal__title",children:t}),i&&v&&r.jsx("button",{type:"button",className:"nice-modal__close",onClick:v,"aria-label":"Close",children:r.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:r.jsx("path",{d:"M4 4l12 12M4 16L16 4"})})})]}),F=({children:t,className:i})=>r.jsx("div",{className:`nice-modal__body ${i||""}`,children:t}),X=({children:t,className:i})=>r.jsx("div",{className:`nice-modal__footer ${i||""}`,children:t}),q=({open:t,onClose:i,children:v,position:o="right",size:g=320,title:l,closeOnBackdropClick:d=!0,closeOnEscape:u=!0,swipeToClose:T=!0,zIndex:p=1e3,className:_,style:C})=>{const w=e.useRef(null),[y,f]=e.useState(!1),[s,n]=e.useState(0);M.useFocusTrap(w,t);const x=B();e.useEffect(()=>{if(!u||!t)return;const a=k=>{k.key==="Escape"&&(k.preventDefault(),i())};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[u,t,i]);const h=e.useCallback(a=>{let k=0;switch(o){case"left":k=Math.min(0,a.deltaX);break;case"right":k=Math.max(0,a.deltaX);break;case"top":k=Math.min(0,a.deltaY);break;case"bottom":k=Math.max(0,a.deltaY);break}n(k)},[o]),D=e.useCallback(a=>{let P=!1;switch(o){case"left":P=a.deltaX<-100;break;case"right":P=a.deltaX>100;break;case"top":P=a.deltaY<-100;break;case"bottom":P=a.deltaY>100;break}P&&(M.triggerHaptic("light"),i()),n(0),f(!1)},[o,i]),{ref:E}=M.usePan({enabled:T&&t,onPanStart:()=>f(!0),onPan:h,onPanEnd:D}),$=e.useCallback(a=>{d&&a.target===a.currentTarget&&i()},[d,i]);if(!t)return null;const S=o==="left"||o==="right",L=S?{width:typeof g=="number"?`${g}px`:g}:{height:typeof g=="number"?`${g}px`:g},c=()=>{if(y)return S?`translateX(${s}px)`:`translateY(${s}px)`};return I.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`nice-drawer__overlay ${t?"nice-drawer__overlay--visible":""}`,style:{zIndex:p},onClick:$}),r.jsx("div",{ref:a=>{w.current=a,E.current=a},className:`nice-drawer nice-drawer--${o} ${t?"nice-drawer--open":""} ${_||""}`,style:{...L,zIndex:p+1,transform:c(),transition:y?"none":void 0,...C},role:"dialog","aria-modal":"true","aria-label":l,tabIndex:-1,children:v})]}),x)},K=({open:t,onClose:i,children:v,title:o,showHandle:g=!0,snapPoints:l=[.5,.9],initialSnap:d=0,expandable:u=!0,closeOnBackdropClick:T=!0,closeOnEscape:p=!0,hapticFeedback:_=!0,zIndex:C=1e3,className:w,style:y})=>{const f=e.useRef(null),s=e.useRef(null),[n,x]=e.useState(d),[h,D]=e.useState(!1),[E,$]=e.useState(0),S=e.useRef(0);e.useEffect(()=>{t&&(x(d),$(0))},[t,d]),M.useFocusTrap(f,t);const L=B();e.useEffect(()=>{if(!p||!t)return;const m=b=>{b.key==="Escape"&&(b.preventDefault(),i())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[p,t,i]),e.useEffect(()=>{if(t){const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m}}},[t]);const c=e.useCallback(m=>{const b=m.target.closest(".nice-bottom-sheet__handle"),H=s.current,Y=!H||H.scrollTop<=0;!b&&!Y||(D(!0),S.current=m.touches[0].clientY)},[]),a=e.useCallback(m=>{if(!h)return;const b=m.touches[0].clientY-S.current;(b>0||n<l.length-1)&&$(b)},[h,n,l.length]),k=e.useCallback(()=>{if(!h)return;const m=window.innerHeight;l[n]*m;const b=-E,H=m*.15;b>H&&u&&n<l.length-1?(x(n+1),_&&M.triggerHaptic("selection")):b<-H&&(n>0?(x(n-1),_&&M.triggerHaptic("selection")):(_&&M.triggerHaptic("light"),i())),D(!1),$(0)},[h,E,n,l,u,_,i]),P=e.useCallback(()=>{T&&i()},[T,i]);if(!t)return null;const j=l[n]*100,R=h?E:0;return I.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`nice-bottom-sheet__overlay ${t?"nice-bottom-sheet__overlay--visible":""}`,style:{zIndex:C},onClick:P}),r.jsxs("div",{ref:f,className:`nice-bottom-sheet ${t?"nice-bottom-sheet--open":""} ${w||""}`,style:{zIndex:C+1,height:`${j}vh`,transform:`translateY(${Math.max(0,R)}px)`,transition:h?"none":"transform 0.3s ease-out, height 0.3s ease-out",...y},role:"dialog","aria-modal":"true","aria-label":o,tabIndex:-1,onTouchStart:c,onTouchMove:a,onTouchEnd:k,children:[g&&r.jsx("div",{className:"nice-bottom-sheet__handle","aria-hidden":"true"}),o&&r.jsx("div",{className:"nice-bottom-sheet__title",children:o}),r.jsx("div",{ref:s,className:"nice-bottom-sheet__content",children:v})]})]}),L)},z=({trigger:t,children:i,placement:v="bottom",triggerMode:o="click",open:g,onOpenChange:l,hoverDelay:d=200,offset:u=8,className:T,showArrow:p=!0})=>{const[_,C]=e.useState(!1),w=e.useRef(null),y=e.useRef(null),f=e.useRef(null),s=B(),n=g!==void 0,x=n?g:_,h=e.useCallback(c=>{n||C(c),l?.(c)},[n,l]);M.useClickOutside(y,()=>{o!=="manual"&&x&&h(!1)});const D=e.useCallback(()=>{o==="click"&&h(!x)},[o,x,h]),E=e.useCallback(()=>{o==="hover"&&(f.current&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>h(!0),d))},[o,d,h]),$=e.useCallback(()=>{o==="hover"&&(f.current&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>h(!1),d))},[o,d,h]),[S,L]=e.useState({top:0,left:0});return e.useEffect(()=>{if(!x||!w.current||!y.current)return;const c=w.current.getBoundingClientRect(),a=y.current.getBoundingClientRect(),k=window.innerWidth,P=window.innerHeight;let j=0,R=0;const[m,b="center"]=v.split("-");switch(m){case"top":j=c.top-a.height-u,R=c.left+(c.width-a.width)/2;break;case"bottom":j=c.bottom+u,R=c.left+(c.width-a.width)/2;break;case"left":j=c.top+(c.height-a.height)/2,R=c.left-a.width-u;break;case"right":j=c.top+(c.height-a.height)/2,R=c.right+u;break}m==="top"||m==="bottom"?(b==="start"&&(R=c.left),b==="end"&&(R=c.right-a.width)):(b==="start"&&(j=c.top),b==="end"&&(j=c.bottom-a.height)),R=Math.max(8,Math.min(k-a.width-8,R)),j=Math.max(8,Math.min(P-a.height-8,j)),L({top:j,left:R})},[x,v,u]),r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:w,className:"nice-popover__trigger",onClick:D,onMouseEnter:E,onMouseLeave:$,style:{display:"inline-block"},children:t}),x&&I.createPortal(r.jsxs("div",{ref:y,className:`nice-popover nice-popover--${v} ${T||""}`,style:{position:"fixed",top:S.top,left:S.left,zIndex:1100},onMouseEnter:E,onMouseLeave:$,role:"tooltip",children:[p&&r.jsx("div",{className:"nice-popover__arrow"}),r.jsx("div",{className:"nice-popover__content",children:i})]}),s)]})},A=({items:t,children:i,onOpen:v,onClose:o,className:g})=>{const[l,d]=e.useState(!1),[u,T]=e.useState({x:0,y:0}),p=e.useRef(null),_=e.useRef(null),C=B();M.useClickOutside(p,()=>{l&&(d(!1),o?.())});const w=e.useCallback(s=>{s.preventDefault(),T({x:s.clientX,y:s.clientY}),d(!0),v?.()},[v]),y=e.useCallback(s=>{!s.disabled&&s.onClick&&(s.onClick(),d(!1),o?.())},[o]);e.useEffect(()=>{if(!l)return;const s=n=>{n.key==="Escape"&&(d(!1),o?.())};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[l,o]);const f=s=>r.jsx("ul",{className:"nice-context-menu__list",role:"menu",children:s.map(n=>n.divider?r.jsx("li",{className:"nice-context-menu__divider",role:"separator"},n.key):r.jsx("li",{role:"presentation",children:r.jsxs("button",{type:"button",className:`nice-context-menu__item ${n.disabled?"nice-context-menu__item--disabled":""} ${n.danger?"nice-context-menu__item--danger":""}`,role:"menuitem",disabled:n.disabled,onClick:()=>y(n),children:[n.icon&&r.jsx("span",{className:"nice-context-menu__icon",children:n.icon}),r.jsx("span",{className:"nice-context-menu__label",children:n.label})]})},n.key))});return r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:_,onContextMenu:w,style:{display:"contents"},children:i}),l&&I.createPortal(r.jsx("div",{ref:p,className:`nice-context-menu ${g||""}`,style:{position:"fixed",left:u.x,top:u.y,zIndex:1200},role:"menu",children:f(t)}),C)]})};exports.NiceActionSheet=N.NiceActionSheet;exports.NiceBlockUI=N.NiceBlockUI;exports.NiceBox=N.NiceBox;exports.NiceCommandPaletteProvider=N.NiceCommandPaletteProvider;exports.NiceLoadPanel=N.NiceLoadPanel;exports.NicePopover=N.NicePopover;exports.NiceResizable=N.NiceResizable;exports.NiceResponsiveBox=N.NiceResponsiveBox;exports.NiceScrollView=N.NiceScrollView;exports.NiceTutorial=N.NiceTutorial;exports.NiceTutorialProvider=N.NiceTutorialProvider;exports.NiceWindow=N.NiceWindow;exports.NiceWindowManager=N.NiceWindowManager;exports.useCommandPalette=N.useCommandPalette;exports.useRegisterCommands=N.useRegisterCommands;exports.NiceBottomSheet=K;exports.NiceContextMenu=A;exports.NiceDrawer=q;exports.NiceModal=O;exports.NiceModalBody=F;exports.NiceModalFooter=X;exports.NiceModalHeader=W;exports.NiceOverlayPopover=z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("./NiceWindow-CbzJmurQ.cjs"),r=require("react/jsx-runtime"),M=require("./core-CSfXTICE.cjs"),e=require("react"),I=require("react-dom");function B(){const t=e.useContext(M.tr);return t?.portalTarget?t.portalTarget:typeof document<"u"?document.body:null}const W=({open:t,onClose:s,children:v,title:a,size:g="md",closeOnBackdropClick:l=!0,closeOnEscape:d=!0,disableFocusTrap:u=!1,disableBodyScroll:j=!0,zIndex:_=1e3,className:p,style:C})=>{const N=e.useRef(null);M.ks(N,t&&!u);const y=B();e.useEffect(()=>{if(!j&&t){const n=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=n}}},[t,j]),e.useEffect(()=>{if(!d||!t)return;const n=x=>{x.key==="Escape"&&(x.preventDefault(),s())};return document.addEventListener("keydown",n),()=>document.removeEventListener("keydown",n)},[d,t,s]);const f=e.useCallback(n=>{l&&n.target===n.currentTarget&&s()},[l,s]);if(!t)return null;const i={sm:"nice-modal--sm",md:"nice-modal--md",lg:"nice-modal--lg",xl:"nice-modal--xl",full:"nice-modal--full"}[g];return I.createPortal(r.jsx("div",{className:"nice-modal__overlay",style:{zIndex:_},onClick:f,role:"presentation",children:r.jsx("div",{ref:N,className:`nice-modal ${i} ${p||""}`,role:"dialog","aria-modal":"true","aria-label":a,style:C,tabIndex:-1,children:v})}),y)},X=({children:t,showClose:s=!0,onClose:v,className:a})=>r.jsxs("div",{className:`nice-modal__header ${a||""}`,children:[r.jsx("div",{className:"nice-modal__title",children:t}),s&&v&&r.jsx("button",{type:"button",className:"nice-modal__close",onClick:v,"aria-label":"Close",children:r.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"2",children:r.jsx("path",{d:"M4 4l12 12M4 16L16 4"})})})]}),O=({children:t,className:s})=>r.jsx("div",{className:`nice-modal__body ${s||""}`,children:t}),q=({children:t,className:s})=>r.jsx("div",{className:`nice-modal__footer ${s||""}`,children:t}),K=({open:t,onClose:s,children:v,position:a="right",size:g=320,title:l,closeOnBackdropClick:d=!0,closeOnEscape:u=!0,swipeToClose:j=!0,zIndex:_=1e3,className:p,style:C})=>{const N=e.useRef(null),[y,f]=e.useState(!1),[i,n]=e.useState(0);M.ks(N,t);const x=B();e.useEffect(()=>{if(!u||!t)return;const o=k=>{k.key==="Escape"&&(k.preventDefault(),s())};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[u,t,s]);const h=e.useCallback(o=>{let k=0;switch(a){case"left":k=Math.min(0,o.deltaX);break;case"right":k=Math.max(0,o.deltaX);break;case"top":k=Math.min(0,o.deltaY);break;case"bottom":k=Math.max(0,o.deltaY);break}n(k)},[a]),D=e.useCallback(o=>{let E=!1;switch(a){case"left":E=o.deltaX<-100;break;case"right":E=o.deltaX>100;break;case"top":E=o.deltaY<-100;break;case"bottom":E=o.deltaY>100;break}E&&(M.Hr("light"),s()),n(0),f(!1)},[a,s]),{ref:P}=M.Xs({enabled:j&&t,onPanStart:()=>f(!0),onPan:h,onPanEnd:D}),$=e.useCallback(o=>{d&&o.target===o.currentTarget&&s()},[d,s]);if(!t)return null;const S=a==="left"||a==="right",L=S?{width:typeof g=="number"?`${g}px`:g}:{height:typeof g=="number"?`${g}px`:g},c=()=>{if(y)return S?`translateX(${i}px)`:`translateY(${i}px)`};return I.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`nice-drawer__overlay ${t?"nice-drawer__overlay--visible":""}`,style:{zIndex:_},onClick:$}),r.jsx("div",{ref:o=>{N.current=o,P.current=o},className:`nice-drawer nice-drawer--${a} ${t?"nice-drawer--open":""} ${p||""}`,style:{...L,zIndex:_+1,transform:c(),transition:y?"none":void 0,...C},role:"dialog","aria-modal":"true","aria-label":l,tabIndex:-1,children:v})]}),x)},F=({open:t,onClose:s,children:v,title:a,showHandle:g=!0,snapPoints:l=[.5,.9],initialSnap:d=0,expandable:u=!0,closeOnBackdropClick:j=!0,closeOnEscape:_=!0,hapticFeedback:p=!0,zIndex:C=1e3,className:N,style:y})=>{const f=e.useRef(null),i=e.useRef(null),[n,x]=e.useState(d),[h,D]=e.useState(!1),[P,$]=e.useState(0),S=e.useRef(0);e.useEffect(()=>{t&&(x(d),$(0))},[t,d]),M.ks(f,t);const L=B();e.useEffect(()=>{if(!_||!t)return;const m=b=>{b.key==="Escape"&&(b.preventDefault(),s())};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[_,t,s]),e.useEffect(()=>{if(t){const m=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=m}}},[t]);const c=e.useCallback(m=>{const b=m.target.closest(".nice-bottom-sheet__handle"),H=i.current,Y=!H||H.scrollTop<=0;!b&&!Y||(D(!0),S.current=m.touches[0].clientY)},[]),o=e.useCallback(m=>{if(!h)return;const b=m.touches[0].clientY-S.current;(b>0||n<l.length-1)&&$(b)},[h,n,l.length]),k=e.useCallback(()=>{if(!h)return;const m=window.innerHeight;l[n]*m;const b=-P,H=m*.15;b>H&&u&&n<l.length-1?(x(n+1),p&&M.Hr("selection")):b<-H&&(n>0?(x(n-1),p&&M.Hr("selection")):(p&&M.Hr("light"),s())),D(!1),$(0)},[h,P,n,l,u,p,s]),E=e.useCallback(()=>{j&&s()},[j,s]);if(!t)return null;const R=l[n]*100,T=h?P:0;return I.createPortal(r.jsxs(r.Fragment,{children:[r.jsx("div",{className:`nice-bottom-sheet__overlay ${t?"nice-bottom-sheet__overlay--visible":""}`,style:{zIndex:C},onClick:E}),r.jsxs("div",{ref:f,className:`nice-bottom-sheet ${t?"nice-bottom-sheet--open":""} ${N||""}`,style:{zIndex:C+1,height:`${R}vh`,transform:`translateY(${Math.max(0,T)}px)`,transition:h?"none":"transform 0.3s ease-out, height 0.3s ease-out",...y},role:"dialog","aria-modal":"true","aria-label":a,tabIndex:-1,onTouchStart:c,onTouchMove:o,onTouchEnd:k,children:[g&&r.jsx("div",{className:"nice-bottom-sheet__handle","aria-hidden":"true"}),a&&r.jsx("div",{className:"nice-bottom-sheet__title",children:a}),r.jsx("div",{ref:i,className:"nice-bottom-sheet__content",children:v})]})]}),L)},z=({trigger:t,children:s,placement:v="bottom",triggerMode:a="click",open:g,onOpenChange:l,hoverDelay:d=200,offset:u=8,className:j,showArrow:_=!0})=>{const[p,C]=e.useState(!1),N=e.useRef(null),y=e.useRef(null),f=e.useRef(null),i=B(),n=g!==void 0,x=n?g:p,h=e.useCallback(c=>{n||C(c),l?.(c)},[n,l]);M.ws(y,()=>{a!=="manual"&&x&&h(!1)});const D=e.useCallback(()=>{a==="click"&&h(!x)},[a,x,h]),P=e.useCallback(()=>{a==="hover"&&(f.current&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>h(!0),d))},[a,d,h]),$=e.useCallback(()=>{a==="hover"&&(f.current&&window.clearTimeout(f.current),f.current=window.setTimeout(()=>h(!1),d))},[a,d,h]),[S,L]=e.useState({top:0,left:0});return e.useEffect(()=>{if(!x||!N.current||!y.current)return;const c=N.current.getBoundingClientRect(),o=y.current.getBoundingClientRect(),k=window.innerWidth,E=window.innerHeight;let R=0,T=0;const[m,b="center"]=v.split("-");switch(m){case"top":R=c.top-o.height-u,T=c.left+(c.width-o.width)/2;break;case"bottom":R=c.bottom+u,T=c.left+(c.width-o.width)/2;break;case"left":R=c.top+(c.height-o.height)/2,T=c.left-o.width-u;break;case"right":R=c.top+(c.height-o.height)/2,T=c.right+u;break}m==="top"||m==="bottom"?(b==="start"&&(T=c.left),b==="end"&&(T=c.right-o.width)):(b==="start"&&(R=c.top),b==="end"&&(R=c.bottom-o.height)),T=Math.max(8,Math.min(k-o.width-8,T)),R=Math.max(8,Math.min(E-o.height-8,R)),L({top:R,left:T})},[x,v,u]),r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:N,className:"nice-popover__trigger",onClick:D,onMouseEnter:P,onMouseLeave:$,style:{display:"inline-block"},children:t}),x&&I.createPortal(r.jsxs("div",{ref:y,className:`nice-popover nice-popover--${v} ${j||""}`,style:{position:"fixed",top:S.top,left:S.left,zIndex:1100},onMouseEnter:P,onMouseLeave:$,role:"tooltip",children:[_&&r.jsx("div",{className:"nice-popover__arrow"}),r.jsx("div",{className:"nice-popover__content",children:s})]}),i)]})},A=({items:t,children:s,onOpen:v,onClose:a,className:g})=>{const[l,d]=e.useState(!1),[u,j]=e.useState({x:0,y:0}),_=e.useRef(null),p=e.useRef(null),C=B();M.ws(_,()=>{l&&(d(!1),a?.())});const N=e.useCallback(i=>{i.preventDefault(),j({x:i.clientX,y:i.clientY}),d(!0),v?.()},[v]),y=e.useCallback(i=>{!i.disabled&&i.onClick&&(i.onClick(),d(!1),a?.())},[a]);e.useEffect(()=>{if(!l)return;const i=n=>{n.key==="Escape"&&(d(!1),a?.())};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[l,a]);const f=i=>r.jsx("ul",{className:"nice-context-menu__list",role:"menu",children:i.map(n=>n.divider?r.jsx("li",{className:"nice-context-menu__divider",role:"separator"},n.key):r.jsx("li",{role:"presentation",children:r.jsxs("button",{type:"button",className:`nice-context-menu__item ${n.disabled?"nice-context-menu__item--disabled":""} ${n.danger?"nice-context-menu__item--danger":""}`,role:"menuitem",disabled:n.disabled,onClick:()=>y(n),children:[n.icon&&r.jsx("span",{className:"nice-context-menu__icon",children:n.icon}),r.jsx("span",{className:"nice-context-menu__label",children:n.label})]})},n.key))});return r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:p,onContextMenu:N,style:{display:"contents"},children:s}),l&&I.createPortal(r.jsx("div",{ref:_,className:`nice-context-menu ${g||""}`,style:{position:"fixed",left:u.x,top:u.y,zIndex:1200},role:"menu",children:f(t)}),C)]})};exports.NiceActionSheet=w.NiceActionSheet;exports.NiceBlockUI=w.NiceBlockUI;exports.NiceBox=w.NiceBox;exports.NiceCommandPaletteProvider=w.NiceCommandPaletteProvider;exports.NiceLoadPanel=w.NiceLoadPanel;exports.NicePopover=w.NicePopover;exports.NiceResizable=w.NiceResizable;exports.NiceResponsiveBox=w.NiceResponsiveBox;exports.NiceScrollView=w.NiceScrollView;exports.NiceTutorial=w.NiceTutorial;exports.NiceTutorialProvider=w.NiceTutorialProvider;exports.NiceWindow=w.NiceWindow;exports.NiceWindowManager=w.NiceWindowManager;exports.useCommandPalette=w.useCommandPalette;exports.useRegisterCommands=w.useRegisterCommands;exports.NiceBottomSheet=F;exports.NiceContextMenu=A;exports.NiceDrawer=K;exports.NiceModal=W;exports.NiceModalBody=O;exports.NiceModalFooter=q;exports.NiceModalHeader=X;exports.NiceOverlayPopover=z;
package/dist/overlays.mjs CHANGED
@@ -1,13 +1,13 @@
1
- import { N as se, a as de, b as ue, c as he, d as fe, e as me, f as ve, g as ge, h as we, i as be, j as ye, k as pe, l as Ne, u as _e, m as ke } from "./NiceWindow-DeC83yfE.js";
2
- import { jsxs as C, Fragment as K, jsx as a } from "react/jsx-runtime";
3
- import { useRef as E, useState as P, useEffect as Y, useCallback as b, useContext as U } from "react";
4
- import { createPortal as X } from "react-dom";
5
- import { e as j, t as W, f as z, g as V, N as q } from "./core-Da43q-pO.js";
6
- function O() {
7
- const e = U(q);
1
+ import { N as se, a as de, b as ue, c as he, d as fe, e as me, f as ve, g as ge, h as we, i as be, j as ye, k as pe, l as _e, u as Ne, m as ke } from "./NiceWindow-BNrA5Dxq.js";
2
+ import { jsxs as H, Fragment as O, jsx as a } from "react/jsx-runtime";
3
+ import { k as j, H as K, b as z, X as U, t as V } from "./core-ClmvtMVZ.js";
4
+ import { useRef as E, useState as D, useEffect as Y, useCallback as b, useContext as q } from "react";
5
+ import { createPortal as C } from "react-dom";
6
+ function W() {
7
+ const e = q(V);
8
8
  return e?.portalTarget ? e.portalTarget : typeof document < "u" ? document.body : null;
9
9
  }
10
- const Z = ({
10
+ const F = ({
11
11
  open: e,
12
12
  onClose: o,
13
13
  children: m,
@@ -17,13 +17,13 @@ const Z = ({
17
17
  closeOnEscape: s = !0,
18
18
  disableFocusTrap: d = !1,
19
19
  disableBodyScroll: x = !0,
20
- zIndex: _ = 1e3,
20
+ zIndex: N = 1e3,
21
21
  className: k,
22
22
  style: M
23
23
  }) => {
24
24
  const y = E(null);
25
25
  j(y, e && !d);
26
- const p = O();
26
+ const p = W();
27
27
  Y(() => {
28
28
  if (!x && e) {
29
29
  const t = document.body.style.overflow;
@@ -54,12 +54,12 @@ const Z = ({
54
54
  xl: "nice-modal--xl",
55
55
  full: "nice-modal--full"
56
56
  }[v];
57
- return X(
57
+ return C(
58
58
  /* @__PURE__ */ a(
59
59
  "div",
60
60
  {
61
61
  className: "nice-modal__overlay",
62
- style: { zIndex: _ },
62
+ style: { zIndex: N },
63
63
  onClick: u,
64
64
  role: "presentation",
65
65
  children: /* @__PURE__ */ a(
@@ -84,7 +84,7 @@ const Z = ({
84
84
  showClose: o = !0,
85
85
  onClose: m,
86
86
  className: r
87
- }) => /* @__PURE__ */ C("div", { className: `nice-modal__header ${r || ""}`, children: [
87
+ }) => /* @__PURE__ */ H("div", { className: `nice-modal__header ${r || ""}`, children: [
88
88
  /* @__PURE__ */ a("div", { className: "nice-modal__title", children: e }),
89
89
  o && m && /* @__PURE__ */ a("button", { type: "button", className: "nice-modal__close", onClick: m, "aria-label": "Close", children: /* @__PURE__ */ a(
90
90
  "svg",
@@ -108,42 +108,42 @@ const Z = ({
108
108
  closeOnBackdropClick: s = !0,
109
109
  closeOnEscape: d = !0,
110
110
  swipeToClose: x = !0,
111
- zIndex: _ = 1e3,
111
+ zIndex: N = 1e3,
112
112
  className: k,
113
113
  style: M
114
114
  }) => {
115
- const y = E(null), [p, u] = P(!1), [c, t] = P(0);
115
+ const y = E(null), [p, u] = D(!1), [c, t] = D(0);
116
116
  j(y, e);
117
- const g = O();
117
+ const g = W();
118
118
  Y(() => {
119
119
  if (!d || !e)
120
120
  return;
121
- const n = (N) => {
122
- N.key === "Escape" && (N.preventDefault(), o());
121
+ const n = (_) => {
122
+ _.key === "Escape" && (_.preventDefault(), o());
123
123
  };
124
124
  return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
125
125
  }, [d, e, o]);
126
126
  const h = b(
127
127
  (n) => {
128
- let N = 0;
128
+ let _ = 0;
129
129
  switch (r) {
130
130
  case "left":
131
- N = Math.min(0, n.deltaX);
131
+ _ = Math.min(0, n.deltaX);
132
132
  break;
133
133
  case "right":
134
- N = Math.max(0, n.deltaX);
134
+ _ = Math.max(0, n.deltaX);
135
135
  break;
136
136
  case "top":
137
- N = Math.min(0, n.deltaY);
137
+ _ = Math.min(0, n.deltaY);
138
138
  break;
139
139
  case "bottom":
140
- N = Math.max(0, n.deltaY);
140
+ _ = Math.max(0, n.deltaY);
141
141
  break;
142
142
  }
143
- t(N);
143
+ t(_);
144
144
  },
145
145
  [r]
146
- ), H = b(
146
+ ), S = b(
147
147
  (n) => {
148
148
  let R = !1;
149
149
  switch (r) {
@@ -160,15 +160,15 @@ const Z = ({
160
160
  R = n.deltaY > 100;
161
161
  break;
162
162
  }
163
- R && (W("light"), o()), t(0), u(!1);
163
+ R && (K("light"), o()), t(0), u(!1);
164
164
  },
165
165
  [r, o]
166
- ), { ref: D } = V({
166
+ ), { ref: L } = U({
167
167
  enabled: x && e,
168
168
  onPanStart: () => u(!0),
169
169
  onPan: h,
170
- onPanEnd: H
171
- }), L = b(
170
+ onPanEnd: S
171
+ }), P = b(
172
172
  (n) => {
173
173
  s && n.target === n.currentTarget && o();
174
174
  },
@@ -176,30 +176,30 @@ const Z = ({
176
176
  );
177
177
  if (!e)
178
178
  return null;
179
- const I = r === "left" || r === "right", S = I ? { width: typeof v == "number" ? `${v}px` : v } : { height: typeof v == "number" ? `${v}px` : v }, i = () => {
179
+ const I = r === "left" || r === "right", X = I ? { width: typeof v == "number" ? `${v}px` : v } : { height: typeof v == "number" ? `${v}px` : v }, i = () => {
180
180
  if (p)
181
181
  return I ? `translateX(${c}px)` : `translateY(${c}px)`;
182
182
  };
183
- return X(
184
- /* @__PURE__ */ C(K, { children: [
183
+ return C(
184
+ /* @__PURE__ */ H(O, { children: [
185
185
  /* @__PURE__ */ a(
186
186
  "div",
187
187
  {
188
188
  className: `nice-drawer__overlay ${e ? "nice-drawer__overlay--visible" : ""}`,
189
- style: { zIndex: _ },
190
- onClick: L
189
+ style: { zIndex: N },
190
+ onClick: P
191
191
  }
192
192
  ),
193
193
  /* @__PURE__ */ a(
194
194
  "div",
195
195
  {
196
196
  ref: (n) => {
197
- y.current = n, D.current = n;
197
+ y.current = n, L.current = n;
198
198
  },
199
199
  className: `nice-drawer nice-drawer--${r} ${e ? "nice-drawer--open" : ""} ${k || ""}`,
200
200
  style: {
201
- ...S,
202
- zIndex: _ + 1,
201
+ ...X,
202
+ zIndex: N + 1,
203
203
  transform: i(),
204
204
  transition: p ? "none" : void 0,
205
205
  ...M
@@ -224,25 +224,25 @@ const Z = ({
224
224
  initialSnap: s = 0,
225
225
  expandable: d = !0,
226
226
  closeOnBackdropClick: x = !0,
227
- closeOnEscape: _ = !0,
227
+ closeOnEscape: N = !0,
228
228
  hapticFeedback: k = !0,
229
229
  zIndex: M = 1e3,
230
230
  className: y,
231
231
  style: p
232
232
  }) => {
233
- const u = E(null), c = E(null), [t, g] = P(s), [h, H] = P(!1), [D, L] = P(0), I = E(0);
233
+ const u = E(null), c = E(null), [t, g] = D(s), [h, S] = D(!1), [L, P] = D(0), I = E(0);
234
234
  Y(() => {
235
- e && (g(s), L(0));
235
+ e && (g(s), P(0));
236
236
  }, [e, s]), j(u, e);
237
- const S = O();
237
+ const X = W();
238
238
  Y(() => {
239
- if (!_ || !e)
239
+ if (!N || !e)
240
240
  return;
241
241
  const f = (w) => {
242
242
  w.key === "Escape" && (w.preventDefault(), o());
243
243
  };
244
244
  return document.addEventListener("keydown", f), () => document.removeEventListener("keydown", f);
245
- }, [_, e, o]), Y(() => {
245
+ }, [N, e, o]), Y(() => {
246
246
  if (e) {
247
247
  const f = document.body.style.overflow;
248
248
  return document.body.style.overflow = "hidden", () => {
@@ -252,30 +252,30 @@ const Z = ({
252
252
  }, [e]);
253
253
  const i = b((f) => {
254
254
  const w = f.target.closest(".nice-bottom-sheet__handle"), B = c.current, A = !B || B.scrollTop <= 0;
255
- !w && !A || (H(!0), I.current = f.touches[0].clientY);
255
+ !w && !A || (S(!0), I.current = f.touches[0].clientY);
256
256
  }, []), n = b(
257
257
  (f) => {
258
258
  if (!h)
259
259
  return;
260
260
  const w = f.touches[0].clientY - I.current;
261
- (w > 0 || t < l.length - 1) && L(w);
261
+ (w > 0 || t < l.length - 1) && P(w);
262
262
  },
263
263
  [h, t, l.length]
264
- ), N = b(() => {
264
+ ), _ = b(() => {
265
265
  if (!h)
266
266
  return;
267
267
  const f = window.innerHeight;
268
268
  l[t] * f;
269
- const w = -D, B = f * 0.15;
270
- w > B && d && t < l.length - 1 ? (g(t + 1), k && W("selection")) : w < -B && (t > 0 ? (g(t - 1), k && W("selection")) : (k && W("light"), o())), H(!1), L(0);
271
- }, [h, D, t, l, d, k, o]), R = b(() => {
269
+ const w = -L, B = f * 0.15;
270
+ w > B && d && t < l.length - 1 ? (g(t + 1), k && K("selection")) : w < -B && (t > 0 ? (g(t - 1), k && K("selection")) : (k && K("light"), o())), S(!1), P(0);
271
+ }, [h, L, t, l, d, k, o]), R = b(() => {
272
272
  x && o();
273
273
  }, [x, o]);
274
274
  if (!e)
275
275
  return null;
276
- const T = l[t] * 100, $ = h ? D : 0;
277
- return X(
278
- /* @__PURE__ */ C(K, { children: [
276
+ const T = l[t] * 100, $ = h ? L : 0;
277
+ return C(
278
+ /* @__PURE__ */ H(O, { children: [
279
279
  /* @__PURE__ */ a(
280
280
  "div",
281
281
  {
@@ -284,7 +284,7 @@ const Z = ({
284
284
  onClick: R
285
285
  }
286
286
  ),
287
- /* @__PURE__ */ C(
287
+ /* @__PURE__ */ H(
288
288
  "div",
289
289
  {
290
290
  ref: u,
@@ -302,7 +302,7 @@ const Z = ({
302
302
  tabIndex: -1,
303
303
  onTouchStart: i,
304
304
  onTouchMove: n,
305
- onTouchEnd: N,
305
+ onTouchEnd: _,
306
306
  children: [
307
307
  v && /* @__PURE__ */ a("div", { className: "nice-bottom-sheet__handle", "aria-hidden": "true" }),
308
308
  r && /* @__PURE__ */ a("div", { className: "nice-bottom-sheet__title", children: r }),
@@ -311,7 +311,7 @@ const Z = ({
311
311
  }
312
312
  )
313
313
  ] }),
314
- S
314
+ X
315
315
  );
316
316
  }, ae = ({
317
317
  trigger: e,
@@ -323,9 +323,9 @@ const Z = ({
323
323
  hoverDelay: s = 200,
324
324
  offset: d = 8,
325
325
  className: x,
326
- showArrow: _ = !0
326
+ showArrow: N = !0
327
327
  }) => {
328
- const [k, M] = P(!1), y = E(null), p = E(null), u = E(null), c = O(), t = v !== void 0, g = t ? v : k, h = b(
328
+ const [k, M] = D(!1), y = E(null), p = E(null), u = E(null), c = W(), t = v !== void 0, g = t ? v : k, h = b(
329
329
  (i) => {
330
330
  t || M(i), l?.(i);
331
331
  },
@@ -334,17 +334,17 @@ const Z = ({
334
334
  z(p, () => {
335
335
  r !== "manual" && g && h(!1);
336
336
  });
337
- const H = b(() => {
337
+ const S = b(() => {
338
338
  r === "click" && h(!g);
339
- }, [r, g, h]), D = b(() => {
339
+ }, [r, g, h]), L = b(() => {
340
340
  r === "hover" && (u.current && window.clearTimeout(u.current), u.current = window.setTimeout(() => h(!0), s));
341
- }, [r, s, h]), L = b(() => {
341
+ }, [r, s, h]), P = b(() => {
342
342
  r === "hover" && (u.current && window.clearTimeout(u.current), u.current = window.setTimeout(() => h(!1), s));
343
- }, [r, s, h]), [I, S] = P({ top: 0, left: 0 });
343
+ }, [r, s, h]), [I, X] = D({ top: 0, left: 0 });
344
344
  return Y(() => {
345
345
  if (!g || !y.current || !p.current)
346
346
  return;
347
- const i = y.current.getBoundingClientRect(), n = p.current.getBoundingClientRect(), N = window.innerWidth, R = window.innerHeight;
347
+ const i = y.current.getBoundingClientRect(), n = p.current.getBoundingClientRect(), _ = window.innerWidth, R = window.innerHeight;
348
348
  let T = 0, $ = 0;
349
349
  const [f, w = "center"] = m.split("-");
350
350
  switch (f) {
@@ -361,22 +361,22 @@ const Z = ({
361
361
  T = i.top + (i.height - n.height) / 2, $ = i.right + d;
362
362
  break;
363
363
  }
364
- f === "top" || f === "bottom" ? (w === "start" && ($ = i.left), w === "end" && ($ = i.right - n.width)) : (w === "start" && (T = i.top), w === "end" && (T = i.bottom - n.height)), $ = Math.max(8, Math.min(N - n.width - 8, $)), T = Math.max(8, Math.min(R - n.height - 8, T)), S({ top: T, left: $ });
365
- }, [g, m, d]), /* @__PURE__ */ C(K, { children: [
364
+ f === "top" || f === "bottom" ? (w === "start" && ($ = i.left), w === "end" && ($ = i.right - n.width)) : (w === "start" && (T = i.top), w === "end" && (T = i.bottom - n.height)), $ = Math.max(8, Math.min(_ - n.width - 8, $)), T = Math.max(8, Math.min(R - n.height - 8, T)), X({ top: T, left: $ });
365
+ }, [g, m, d]), /* @__PURE__ */ H(O, { children: [
366
366
  /* @__PURE__ */ a(
367
367
  "div",
368
368
  {
369
369
  ref: y,
370
370
  className: "nice-popover__trigger",
371
- onClick: H,
372
- onMouseEnter: D,
373
- onMouseLeave: L,
371
+ onClick: S,
372
+ onMouseEnter: L,
373
+ onMouseLeave: P,
374
374
  style: { display: "inline-block" },
375
375
  children: e
376
376
  }
377
377
  ),
378
- g && X(
379
- /* @__PURE__ */ C(
378
+ g && C(
379
+ /* @__PURE__ */ H(
380
380
  "div",
381
381
  {
382
382
  ref: p,
@@ -387,11 +387,11 @@ const Z = ({
387
387
  left: I.left,
388
388
  zIndex: 1100
389
389
  },
390
- onMouseEnter: D,
391
- onMouseLeave: L,
390
+ onMouseEnter: L,
391
+ onMouseLeave: P,
392
392
  role: "tooltip",
393
393
  children: [
394
- _ && /* @__PURE__ */ a("div", { className: "nice-popover__arrow" }),
394
+ N && /* @__PURE__ */ a("div", { className: "nice-popover__arrow" }),
395
395
  /* @__PURE__ */ a("div", { className: "nice-popover__content", children: o })
396
396
  ]
397
397
  }
@@ -406,8 +406,8 @@ const Z = ({
406
406
  onClose: r,
407
407
  className: v
408
408
  }) => {
409
- const [l, s] = P(!1), [d, x] = P({ x: 0, y: 0 }), _ = E(null), k = E(null), M = O();
410
- z(_, () => {
409
+ const [l, s] = D(!1), [d, x] = D({ x: 0, y: 0 }), N = E(null), k = E(null), M = W();
410
+ z(N, () => {
411
411
  l && (s(!1), r?.());
412
412
  });
413
413
  const y = b(
@@ -429,7 +429,7 @@ const Z = ({
429
429
  };
430
430
  return document.addEventListener("keydown", c), () => document.removeEventListener("keydown", c);
431
431
  }, [l, r]);
432
- const u = (c) => /* @__PURE__ */ a("ul", { className: "nice-context-menu__list", role: "menu", children: c.map((t) => t.divider ? /* @__PURE__ */ a("li", { className: "nice-context-menu__divider", role: "separator" }, t.key) : /* @__PURE__ */ a("li", { role: "presentation", children: /* @__PURE__ */ C(
432
+ const u = (c) => /* @__PURE__ */ a("ul", { className: "nice-context-menu__list", role: "menu", children: c.map((t) => t.divider ? /* @__PURE__ */ a("li", { className: "nice-context-menu__divider", role: "separator" }, t.key) : /* @__PURE__ */ a("li", { role: "presentation", children: /* @__PURE__ */ H(
433
433
  "button",
434
434
  {
435
435
  type: "button",
@@ -443,13 +443,13 @@ const Z = ({
443
443
  ]
444
444
  }
445
445
  ) }, t.key)) });
446
- return /* @__PURE__ */ C(K, { children: [
446
+ return /* @__PURE__ */ H(O, { children: [
447
447
  /* @__PURE__ */ a("div", { ref: k, onContextMenu: y, style: { display: "contents" }, children: o }),
448
- l && X(
448
+ l && C(
449
449
  /* @__PURE__ */ a(
450
450
  "div",
451
451
  {
452
- ref: _,
452
+ ref: N,
453
453
  className: `nice-context-menu ${v || ""}`,
454
454
  style: {
455
455
  position: "fixed",
@@ -474,7 +474,7 @@ export {
474
474
  ie as NiceContextMenu,
475
475
  re as NiceDrawer,
476
476
  fe as NiceLoadPanel,
477
- Z as NiceModal,
477
+ F as NiceModal,
478
478
  te as NiceModalBody,
479
479
  ne as NiceModalFooter,
480
480
  ee as NiceModalHeader,
@@ -486,7 +486,7 @@ export {
486
486
  be as NiceTutorial,
487
487
  ye as NiceTutorialProvider,
488
488
  pe as NiceWindow,
489
- Ne as NiceWindowManager,
490
- _e as useCommandPalette,
489
+ _e as NiceWindowManager,
490
+ Ne as useCommandPalette,
491
491
  ke as useRegisterCommands
492
492
  };