ono-react-element 0.0.19 → 0.0.21

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 (87) hide show
  1. package/dist/es/AutoSliderList-DD7w6KlD.js +1 -0
  2. package/dist/es/AvatarCrop-CSkrjAcy.js +1 -0
  3. package/dist/es/Button-DXWGWvF-.js +1 -0
  4. package/dist/es/Card3D-DrfpLxw2.js +1 -0
  5. package/dist/es/Checkbox-jOOMkqbP.js +1 -0
  6. package/dist/es/ContextMenu-BL414VF5.js +1 -0
  7. package/dist/es/InjunctiveBox-vLlRm8LB.js +1 -0
  8. package/dist/es/Input-lVK5hctw.js +1 -0
  9. package/dist/es/List-DXRmDwDo.js +1 -0
  10. package/dist/es/MenuButton-C22ekETH.js +1 -0
  11. package/dist/es/Message-AC7MOJ5X.js +1 -0
  12. package/dist/es/Modal-e1dQi2y3.js +1 -0
  13. package/dist/es/Pagination-L17GYQVO.js +1 -0
  14. package/dist/es/PortalRenderer-izu9LyVc.js +1 -0
  15. package/dist/es/Radio-m9BOKzf5.js +1 -0
  16. package/dist/es/ScrollableTabs-DgcrSjsb.js +1 -0
  17. package/dist/es/Select-BSNVfoEp.js +1 -0
  18. package/dist/es/SvgImg-HkuwJQ4_.js +1 -0
  19. package/dist/es/Switch-DoiR9_x4.js +1 -0
  20. package/dist/es/TemplateDialog-D4D6YS2U.js +1 -0
  21. package/dist/es/Toast-CERLQ4i7.js +1 -0
  22. package/dist/es/Tooltip-DDUtx7BP.js +1 -0
  23. package/dist/es/VirtualList-YXDe-9GK.js +1 -0
  24. package/dist/es/Waterfall-D8AExUDu.js +1 -0
  25. package/dist/es/colorUtils.ts-Cxx4mvOB.js +1 -0
  26. package/dist/es/common.ts-OTJMJPHg.js +1 -0
  27. package/dist/es/dependencies-B7YNjh_z.js +15719 -0
  28. package/dist/es/event-B2tGdMqN.js +1 -0
  29. package/dist/es/fileFormatConversion.ts-3AQHtta9.js +1 -0
  30. package/dist/es/formatTimeUtils.ts-ng_eAUID.js +1 -0
  31. package/dist/es/index.js +1 -1
  32. package/dist/es/useClickOutSide.tsx-C6XuLZzd.js +1 -0
  33. package/dist/es/useCountdown.tsx-DWqs6wNp.js +1 -0
  34. package/dist/es/useEventListener.tsx-C8V9Qip6.js +1 -0
  35. package/dist/es/useGetElementSize.tsx-DML7z5Xp.js +1 -0
  36. package/dist/es/useKeyPress.tsx-hgs6v_Jt.js +1 -0
  37. package/dist/es/useMouseClick.tsx-BmzbuM6X.js +1 -0
  38. package/dist/es/useTheme.tsx-C-GCpzAS.js +1 -0
  39. package/dist/es/useThemePro.tsx-BIU8EPPB.js +1 -0
  40. package/dist/es/viewTransitionUtils.ts-tmSvCt31.js +1 -0
  41. package/dist/types/components/ContextMenu/ContextMenu.d.ts +9 -0
  42. package/dist/types/components/ContextMenu/index.d.ts +1 -0
  43. package/dist/types/components/Modal/types.d.ts +1 -1
  44. package/dist/types/components/index.d.ts +1 -0
  45. package/dist/types/index.d.ts +2 -2
  46. package/dist/umd/index.umd.cjs +1 -1
  47. package/dist/umd/index.umd.cjs.br +0 -0
  48. package/dist/umd/index.umd.cjs.gz +0 -0
  49. package/package.json +1 -1
  50. package/dist/es/AutoSliderList-tkaOmfnx.js +0 -1
  51. package/dist/es/AvatarCrop-DrA-SARP.js +0 -1
  52. package/dist/es/Button-QIC7QPK9.js +0 -1
  53. package/dist/es/Card3D-DMvCSUhe.js +0 -1
  54. package/dist/es/Checkbox-daBabj14.js +0 -1
  55. package/dist/es/InjunctiveBox-DUNoNHCO.js +0 -1
  56. package/dist/es/Input-DLOeg2pz.js +0 -1
  57. package/dist/es/List-UAKCMuGC.js +0 -1
  58. package/dist/es/MenuButton-DHkU5Bq7.js +0 -1
  59. package/dist/es/Message-BGDILiLc.js +0 -1
  60. package/dist/es/Modal-D2289ZPX.js +0 -1
  61. package/dist/es/Pagination-m71H2tfS.js +0 -1
  62. package/dist/es/PortalRenderer-CDAzQJgm.js +0 -1
  63. package/dist/es/Radio-D_GKVoOC.js +0 -1
  64. package/dist/es/ScrollableTabs--449B73p.js +0 -1
  65. package/dist/es/Select-B11NvK-I.js +0 -1
  66. package/dist/es/SvgImg-CZwq2D7J.js +0 -1
  67. package/dist/es/Switch-C61q7rR5.js +0 -1
  68. package/dist/es/TemplateDialog-CAimG5cv.js +0 -1
  69. package/dist/es/Toast-CQEsbqUJ.js +0 -1
  70. package/dist/es/Tooltip-CgttMIcX.js +0 -1
  71. package/dist/es/VirtualList-BAiIymCF.js +0 -1
  72. package/dist/es/Waterfall-C7SWCxJ1.js +0 -1
  73. package/dist/es/colorUtils.ts-DYuRvCXZ.js +0 -1
  74. package/dist/es/common.ts-BbDnZ7vC.js +0 -1
  75. package/dist/es/dependencies-CbQbPZZ-.js +0 -1
  76. package/dist/es/event-CtX9rswE.js +0 -1
  77. package/dist/es/fileFormatConversion.ts-tUlewYon.js +0 -1
  78. package/dist/es/formatTimeUtils.ts-CkdWJ_Sl.js +0 -1
  79. package/dist/es/useClickOutSide.tsx-CMvd2uTW.js +0 -1
  80. package/dist/es/useCountdown.tsx-Btzj-keH.js +0 -1
  81. package/dist/es/useEventListener.tsx-BBGVcI5T.js +0 -1
  82. package/dist/es/useGetElementSize.tsx-Dtshth0Y.js +0 -1
  83. package/dist/es/useKeyPress.tsx-Db44HXXz.js +0 -1
  84. package/dist/es/useMouseClick.tsx-C7uAH4n4.js +0 -1
  85. package/dist/es/useTheme.tsx-C5b7BRYz.js +0 -1
  86. package/dist/es/useThemePro.tsx-DQuSI8J7.js +0 -1
  87. package/dist/es/viewTransitionUtils.ts-CHa9uBpi.js +0 -1
@@ -0,0 +1 @@
1
+ var o=Object.defineProperty;var v=(s,t,e)=>t in s ? o(s,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):s[t]=e;var h=(s,t,e)=>v(s,typeof t!="symbol" ? t+"":t,e);class c{constructor(t){h(this,"events",{});t.forEach((e)=>{this.events[e]=new Set();});}emit(t,...e){if(!this.events[t])throw new Error(`Event ${t}does not exist`);this.events[t].forEach((i)=>{i(...e);});}on(t,e){this.events[t]||(this.events[t]=new Set()),this.events[t].add(e);}cancel(t,e){this.events[t]&&this.events[t].delete(e);}}let n=null;const a=(s)=>(n||(n=new c(s)),n);export{a as c};
@@ -0,0 +1 @@
1
+ const d=(e)=>{const s=e.split(","),n=s[0].match(/:(.*?);/)[1],t=atob(s[1]);let a=t.length;const o=new Uint8Array(a);for(;a--;)o[a]=t.charCodeAt(a);return new Blob([o],{type:n});},y=(e,s)=>{const n=e.split(","),t=n[0].match(/:(.*?);/u)[1],a=atob(n[1]);let o=a.length,i=t.split("/")[1]==="jpeg" ? ".jpg":"."+t.split("/")[1];const r=new Uint8Array(o);for(;o--;)r[o]=a.charCodeAt(o);const c=new Blob([r],{type:t});return new File([c],s+i,{type:t,lastModified:(new Date()).getTime()});},w=(e)=>new Promise((s)=>{const n=new FileReader();n.readAsDataURL(e),n.onload=(t)=>{var i;const a=(i=t.target)==null ? void 0:i.result,o=a.split(",")[1];s(o);};}),p=(e,s="abc.jpg")=>new File([e],s,{type:e.type}),g=(e)=>new Promise((s)=>{const n=new FileReader();n.readAsDataURL(e),n.onload=(t)=>{var a;return s((a=t.target)==null ? void 0:a.result);};}),b=(e)=>e.slice(0,e.size,e.type),l=async(e)=>await(await fetch(e)).blob(),h=async(e)=>p(await l(e)),u=async(e)=>await w(await l(e));export{y as a,d as b,w as c,p as d,b as e,g as f,l as g,h,u};
@@ -0,0 +1 @@
1
+ const h=(r)=>r<10 ? `0${r}`:`${r}`,l=(r)=>r.toString().length>13 ? new Date(Number(r.toString().substring(0,13))):r.toString().length===13 ? new Date(r):r.toString().length<13&&r.toString().length>10 ? new Date(Number((r.toString()+"000").substring(0,13))):r.toString().length===10 ? new Date(1e3*r):new Date(Number((r.toString()+"000000000000").substring(0,13))),i=(r,o="YY-MM-DD hh:mm:ss")=>{const t=["YY","MM","DD","hh","mm","ss"],u=[],s=l(r);u.push(s.getFullYear().toString()),u.push(h(s.getMonth()+1)),u.push(h(s.getDate())),u.push(h(s.getHours())),u.push(h(s.getMinutes())),u.push(h(s.getSeconds()));for(let g in u)o=o.replace(t[g],u[g]);return o;},m=(r,o="YY-MM-DD hh:mm:ss",t="cn")=>{const u=["YY","MM","DD","hh","mm","ss"],s=[],g=l(r);s.push(((e,a)=>{const n={en:["0","1","2","3","4","5","6","7","8","9"],cn:["零","一","二","三","四","五","六","七","八","九"]};return e.split("").map((p)=>n[a][Number(p)]).join("");})(g.getFullYear().toString(),t)),s.push(((e,a)=>({en:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],cn:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]})[a][Number(e)-1])(h(g.getMonth()+1),t)),s.push(((e,a)=>{let n;return a==="en" ? n=e==="01"||e==="21"||e==="31" ? Number(e)+"st":e==="02"||e==="22" ? Number(e)+"nd":e==="03"||e==="23" ? Number(e)+"rd":Number(e)+"th":e==="01" ? n="一日":e==="02" ? n="二日":e==="03" ? n="三日":e==="04" ? n="四日":e==="05" ? n="五日":e==="06" ? n="六日":e==="07" ? n="七日":e==="08" ? n="八日":e==="09" ? n="九日":e==="10" ? n="十日":e==="11" ? n="十一日":e==="12" ? n="十二日":e==="13" ? n="十三日":e==="14" ? n="十四日":e==="15" ? n="十五日":e==="16" ? n="十六日":e==="17" ? n="十七日":e==="18" ? n="十八日":e==="19" ? n="十九日":e==="20" ? n="二十日":e==="21" ? n="二十一日":e==="22" ? n="二十二日":e==="23" ? n="二十三日":e==="24" ? n="二十四日":e==="25" ? n="二十五日":e==="26" ? n="二十六日":e==="27" ? n="二十七日":e==="28" ? n="二十八日":e==="29" ? n="二十九日":e==="30" ? n="三十日":e==="31"&&(n="三十一日"),n ?? e;})(h(g.getDate()),t)),s.push(h(g.getHours())),s.push(h(g.getMinutes())),s.push(h(g.getSeconds()));for(let e in s)o=o.replace(u[e],s[e]);return o;},c=(r,o)=>{const t=["DD","hh","mm","ss"],u=[];u.push(Math.floor(r/86400)),u.push(h(Math.floor(r%86400/3600))),u.push(h(Math.floor(r%3600/60))),u.push(h(r%60));for(let s=0;s<t.length;s++)o=o.replace(t[s],u[s].toString());return o;},D=(r,o)=>{const t={year:31536e3,month:2592e3,day:86400,hour:3600,minute:60,second:1};if(!t[o])throw new Error('Invalid type. Please use "day","hour","minute",or "second".');return Math.floor(r/t[o]);};export{D as c,i as f,m as l,c as s};
package/dist/es/index.js CHANGED
@@ -1 +1 @@
1
- import{u}from "./useClickOutSide.tsx-CMvd2uTW.js";import{u as u2}from "./useCountdown.tsx-Btzj-keH.js";import{u as u3}from "./useEventListener.tsx-BBGVcI5T.js";import{u as u4}from "./useGetElementSize.tsx-Dtshth0Y.js";import{u as u5}from "./useKeyPress.tsx-Db44HXXz.js";import{u as u6}from "./useMouseClick.tsx-C7uAH4n4.js";import{u as u7}from "./useTheme.tsx-C5b7BRYz.js";import{u as u8}from "./useThemePro.tsx-DQuSI8J7.js";import{a,c}from "./colorUtils.ts-DYuRvCXZ.js";import{a as a2,b,c as c2,d,e,f,h,i,j,k,l,m,n,o,q,g,r,s,u as u9,v,w,x,y,z,A,B,C,D,p,E,F,G,H,I,t}from "./common.ts-BbDnZ7vC.js";import{b as b2,a as a3,c as c3,d as d2,f as f2,e as e2,u as u10,g as g2,h as h2}from "./fileFormatConversion.ts-tUlewYon.js";import{c as c4,f as f3,l as l2,s as s2}from "./formatTimeUtils.ts-CkdWJ_Sl.js";import{c as c5}from "./event-CtX9rswE.js";import{A as A2,D as D2}from "./AutoSliderList-tkaOmfnx.js";import{A as A3}from "./AvatarCrop-DrA-SARP.js";import{A as A4,L}from "./List-UAKCMuGC.js";import{B as B2}from "./Button-QIC7QPK9.js";import{C as C2}from "./Card3D-DMvCSUhe.js";import{C as C3}from "./Checkbox-daBabj14.js";import{E as E2,c as c6}from "./VirtualList-BAiIymCF.js";import{i as i2}from "./InjunctiveBox-DUNoNHCO.js";import{M}from "./MenuButton-DHkU5Bq7.js";import{m as m2}from "./Message-BGDILiLc.js";import{M as M2}from "./Modal-D2289ZPX.js";import{O,a as a4}from "./Input-DLOeg2pz.js";import{O as O2}from "./Select-B11NvK-I.js";import{P}from "./Pagination-m71H2tfS.js";import{p as p2}from "./PortalRenderer-CDAzQJgm.js";import{R,a as a5}from "./Radio-D_GKVoOC.js";import{S}from "./ScrollableTabs--449B73p.js";import{S as S2}from "./SvgImg-CZwq2D7J.js";import{S as S3}from "./Switch-C61q7rR5.js";import{T}from "./TemplateDialog-CAimG5cv.js";import{t as t2}from "./Toast-CQEsbqUJ.js";import{T as T2}from "./Tooltip-CgttMIcX.js";import{W}from "./Waterfall-C7SWCxJ1.js";export{A2 as AutoSliderList,A3 as AvatarCrop,A4 as AwaitList,B2 as Button,C2 as Card3D,C3 as Checkbox,D2 as Direction,E2 as EstimatedVirtualList,L as List,M as MenuButton,M2 as Modal,O as OnoInput,O2 as OnoSelect,a4 as OnoTextarea,P as Pagination,R as Radio,a5 as RadioGroup,S as ScrollableTabs,S2 as SvgImg,S3 as Switch,T as TemplateDialog,T2 as Tooltip,W as Waterfall,a2 as addCommasToNumber,b as addEventWithOriginHandler,a as adjustingColors,b2 as base64ToBlob,a3 as base64ToFile,c3 as blobToBase64,d2 as blobToFile,c2 as calculateAspectRatio,d as checkDeviceIsMobile,e as checkStatusCode,c as colorUtils,f as common,c4 as convertSecondToOtherTime,h as copy2Clipboard,c6 as createDataSource,c5 as createEventEmitter,i as createIntersectionObserver,j as dayOfYear,k as debounce,l as deepCopy,m as downloadFile,n as ellipsisString,f2 as fileToBase64,e2 as fileToBlob,o as formatFileSize,q as formatSecondes,f3 as formatTime,g as getElementCenterPosition,r as getFileName,s as getFileSuffix,u9 as getImageSIze,v as getPointDistance,w as getURLSearchParams,x as grayColor,i2 as injunctiveBox,y as isPureNumber,l2 as localFormat,z as mediaAutoplayPolicies,m2 as message,A as parseQuery,B as passwordStrength,C as pick,p2 as portalRenderer,D as printStr,p as pureNumber,E as quickSort,F as rafTimeout,G as randomString,H as safeCapitalizeWord,s2 as second2Day,I as singleton,t as throttle,t2 as toast,u10 as urlToBase64,g2 as urlToBlob,h2 as urlToFile,u as useClickOutSide,u2 as useCountdown,u3 as useEventListener,u4 as useGetElementSize,u5 as useKeyPress,u6 as useMouseClick,u7 as useTheme,u8 as useThemePro};
1
+ import{u as o}from "./useClickOutSide.tsx-C6XuLZzd.js";import{u as r}from "./useCountdown.tsx-DWqs6wNp.js";import{u as i}from "./useEventListener.tsx-C8V9Qip6.js";import{u as p}from "./useGetElementSize.tsx-DML7z5Xp.js";import{u as f}from "./useKeyPress.tsx-hgs6v_Jt.js";import{u as n}from "./useMouseClick.tsx-BmzbuM6X.js";import{u as x}from "./useTheme.tsx-C-GCpzAS.js";import{u as S}from "./useThemePro.tsx-BIU8EPPB.js";import{a as b,c as g}from "./colorUtils.ts-Cxx4mvOB.js";import{a as h,b as B,c as O,d as v,e as y,f as A,h as D,i as E,j as F,k as P,l as k,m as I,n as L,o as M,q as w,g as R,r as z,s as N,u as W,v as G,w as j,x as q,y as H,z as U,A as K,B as Q,C as V,D as Y,p as J,E as X,F as Z,G as _,H as $,I as ee,t as ae}from "./common.ts-OTJMJPHg.js";import{b as se,a as re,c as te,d as ie,f as me,e as pe,u as le,g as fe,h as ue}from "./fileFormatConversion.ts-3AQHtta9.js";import{c as ce,f as xe,l as de,s as Se}from "./formatTimeUtils.ts-ng_eAUID.js";import{c as be}from "./event-B2tGdMqN.js";import{A as Ce,D as he}from "./AutoSliderList-DD7w6KlD.js";import{A as Oe}from "./AvatarCrop-CSkrjAcy.js";import{A as ye,L as Ae}from "./List-DXRmDwDo.js";import{B as Ee}from "./Button-DXWGWvF-.js";import{C as Pe}from "./Card3D-DrfpLxw2.js";import{C as Ie}from "./Checkbox-jOOMkqbP.js";import{c as Me}from "./ContextMenu-BL414VF5.js";import{E as Re,c as ze}from "./VirtualList-YXDe-9GK.js";import{M as We}from "./MenuButton-C22ekETH.js";import{m as je}from "./Message-AC7MOJ5X.js";import{M as He}from "./Modal-e1dQi2y3.js";import{O as Ke,a as Qe}from "./Input-lVK5hctw.js";import{O as Ye}from "./Select-BSNVfoEp.js";import{P as Xe}from "./Pagination-L17GYQVO.js";import{p as _e}from "./PortalRenderer-izu9LyVc.js";import{R as ea,a as aa}from "./Radio-m9BOKzf5.js";import{S as sa}from "./ScrollableTabs-DgcrSjsb.js";import{S as ta}from "./SvgImg-HkuwJQ4_.js";import{S as ma}from "./Switch-DoiR9_x4.js";import{T as la}from "./TemplateDialog-D4D6YS2U.js";import{t as ua}from "./Toast-CERLQ4i7.js";import{T as ca}from "./Tooltip-DDUtx7BP.js";import{W as da}from "./Waterfall-D8AExUDu.js";export{Ce as AutoSliderList,Oe as AvatarCrop,ye as AwaitList,Ee as Button,Pe as Card3D,Ie as Checkbox,he as Direction,Re as EstimatedVirtualList,Ae as List,We as MenuButton,He as Modal,Ke as OnoInput,Ye as OnoSelect,Qe as OnoTextarea,Xe as Pagination,ea as Radio,aa as RadioGroup,sa as ScrollableTabs,ta as SvgImg,ma as Switch,la as TemplateDialog,ca as Tooltip,da as Waterfall,h as addCommasToNumber,B as addEventWithOriginHandler,b as adjustingColors,se as base64ToBlob,re as base64ToFile,te as blobToBase64,ie as blobToFile,O as calculateAspectRatio,v as checkDeviceIsMobile,y as checkStatusCode,g as colorUtils,A as common,Me as contextMenu,ce as convertSecondToOtherTime,D as copy2Clipboard,ze as createDataSource,be as createEventEmitter,E as createIntersectionObserver,F as dayOfYear,P as debounce,k as deepCopy,I as downloadFile,L as ellipsisString,me as fileToBase64,pe as fileToBlob,M as formatFileSize,w as formatSecondes,xe as formatTime,R as getElementCenterPosition,z as getFileName,N as getFileSuffix,W as getImageSIze,G as getPointDistance,j as getURLSearchParams,q as grayColor,H as isPureNumber,de as localFormat,U as mediaAutoplayPolicies,je as message,K as parseQuery,Q as passwordStrength,V as pick,_e as portalRenderer,Y as printStr,J as pureNumber,X as quickSort,Z as rafTimeout,_ as randomString,$ as safeCapitalizeWord,Se as second2Day,ee as singleton,ae as throttle,ua as toast,le as urlToBase64,fe as urlToBlob,ue as urlToFile,o as useClickOutSide,r as useCountdown,i as useEventListener,p as useGetElementSize,f as useKeyPress,n as useMouseClick,x as useTheme,S as useThemePro};
@@ -0,0 +1 @@
1
+ import{u as i}from "./useEventListener.tsx-C8V9Qip6.js";const c=(n,o,s)=>i(((t)=>{const e=typeof t=="string" ? [t]:t;if(new Set(e).size!==e.length)throw new Error("there are duplicates in the event type");return e;})((s==null ? void 0:s.event)||"click"),(t)=>{if(n)if(n instanceof Array)n.map((e)=>e instanceof HTMLElement ? e:e.current).some((e)=>!!e&&e.contains(t.target))||o(t);else{const e=n instanceof HTMLElement ? n:n.current;e&&!e.contains(t.target)&&o(t);}},{deps:[n,...(s==null ? void 0:s.deps)||[]]});export{c as u};
@@ -0,0 +1 @@
1
+ import{useState as o,useRef as f,useCallback as c,useEffect as T}from "react";const b=(t=60,r)=>{const [u,s]=o(t),[a,l]=o(!1),e=f(null),i=c(()=>l(!0),[]),n=c(()=>{l(!1),s(t),e.current&&(clearTimeout(e.current),e.current=null),r==null||r();},[t,r]);return T(()=>{if(a)return u>0 ? e.current=setTimeout(()=>{s((m)=>m-1);},1e3):n(),()=>{e.current&&(clearTimeout(e.current),e.current=null);};},[a,u,n]),[u,i,n];};export{b as u};
@@ -0,0 +1 @@
1
+ import{useEffect as w}from "react";const f=(e,t,d)=>{const{target:n,deps:s,isDeferred:i}=d||{},o=(r)=>t(r);return w(()=>(typeof e=="string" ?!i&&(n||window).addEventListener(e,o):e.forEach((r)=>!i&&(n||window).addEventListener(r,o)),()=>{typeof e=="string" ?(n||window).removeEventListener(e,o):e.forEach((r)=>(n||window).removeEventListener(r,o));}),[n,...s||[]]),i ?()=>{typeof e=="string" ?(n||window).addEventListener(e,o):e.forEach((r)=>(n||window).addEventListener(r,o));}:void 0;};export{f as u};
@@ -0,0 +1 @@
1
+ import{useState as o,useEffect as c}from "react";const w=(e)=>{const [f,r]=o({w:0,h:0}),t=new ResizeObserver((n)=>{for(const s of n)r({w:s.borderBoxSize[0].inlineSize,h:s.borderBoxSize[0].blockSize});}),i=()=>{if(e&&typeof e!="function")t.observe(e instanceof HTMLElement ? e:e.current);else if(e&&typeof e=="function"){const n=e();t.observe(n instanceof HTMLElement ? n:n.current);}else r({w:window.innerWidth,h:window.innerHeight});};return c(()=>(i(),window.addEventListener("resize",i),()=>{if(window.removeEventListener("resize",i),e&&typeof e!="function")t.unobserve(e instanceof HTMLElement ? e:e.current);else if(e&&typeof e=="function"){const n=e();t.unobserve(n instanceof HTMLElement ? n:n.current);}}),[e]),f;};export{w as u};
@@ -0,0 +1 @@
1
+ import{u as p}from "./useEventListener.tsx-C8V9Qip6.js";const h=(o)=>o.toString().toLocaleLowerCase(),k=(o,d,t)=>{const K=(s)=>p(s,(m)=>((u,e,g)=>{u.forEach((c)=>{if(c.includes("+")&&c.length>1){const l=c.split("+"),n=e.ctrlKey&&l.includes("ctrl"),r=e.shiftKey&&l.includes("shift"),i=e.altKey&&l.includes("alt"),y=e.metaKey&&l.includes("meta"),f=(e.ctrlKey||e.metaKey)&&l.includes("commandorcontrol");l.length===2 ?(n||r||i||y||f)&&e.key.toLocaleLowerCase()===l[l.length-1]&&d(e,c):l.length===3&&(n&&r||n&&i||n&&y||n&&f||r&&i||r&&y||r&&f||i&&y||i&&f||y&&f)&&e.key.toLocaleLowerCase()===l[l.length-1]&&d(e,c);}else if(c.includes(h(e.key))){if(g)c===h(e.key)&&d(e,c);else if(!(e.ctrlKey||e.metaKey||e.shiftKey||e.altKey))return d(e,c);}});})(o instanceof Array ? o.map((u)=>h(u)):[h(o)],m,(t==null ? void 0:t.exactMatch)||!1),{deps:[t==null ? void 0:t.target,...(t==null ? void 0:t.deps)||[]]});(t==null ? void 0:t.events)instanceof Array ? t.events.forEach((s)=>K(s)):K((t==null ? void 0:t.events)||"keydown");};export{k as u};
@@ -0,0 +1 @@
1
+ import{useState as X}from "react";import{u as Y}from "./useEventListener.tsx-C8V9Qip6.js";const g=()=>{const [c,n]=X({clientX:0,clientY:0,screenX:0,screenY:0,pageX:0,pageY:0});return Y("click",(e)=>{const t=e.clientX,r=e.clientY,s=e.screenX,a=e.screenY,i=e.pageX,p=e.pageY;n({clientX:t,clientY:r,screenX:s,screenY:a,pageX:i,pageY:p});}),c;};export{g as u};
@@ -0,0 +1 @@
1
+ import{useEffect as o}from "react";let a=!1;const h=({theme:r,onDark:s,onLight:n})=>{const e=window.matchMedia("(prefers-color-scheme:dark)"),t=()=>{e.matches ? s():n();};o(()=>{(()=>{switch(a&&(a=!1,e.removeEventListener("change",t)),r){case "light":n();break;case "dark":s();break;default:t(),a=!0,e.addEventListener("change",t);}})();},[r]);};export{h as u};
@@ -0,0 +1 @@
1
+ import{v as a}from "./viewTransitionUtils.ts-tmSvCt31.js";import{useState as h,useRef as i}from "react";import{u as l}from "./useTheme.tsx-C-GCpzAS.js";const p=(o)=>{const{initTheme:s="light",themeRules:t=(n)=>{n ? document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark");}}=o||Object.assign({}),[m,c]=h(s),e=i(null);return l({theme:m,onDark:()=>{e.current ? a.changeThemeClipPathCircle({element:e.current,onChangeTheme:()=>t(!0)}):t(!0);},onLight:()=>{e.current ? a.changeThemeClipPathCircle({element:e.current,onChangeTheme:()=>t(!1)}):t(!1);}}),[m,({targetTheme:n,element:u,onChange:r})=>{e.current=u||null,requestAnimationFrame(()=>{r==null||r(),c(n);});}];};export{p as u};
@@ -0,0 +1 @@
1
+ const v={changeThemeClipPathCircle:(h)=>{const d="ono-view-transition-clip-path-circle",{element:m,duration:s=300,themeRules:a,onChangeTheme:c}=h,r=a!=null&&a()||document.documentElement.classList.contains("dark")? "dark":"light";if(!document.startViewTransition)return c(r==="dark" ? "light":"dark");const u=document.startViewTransition(()=>{const e=document.documentElement.classList.contains("dark");c(e ? "light":"dark");}),{top:w,left:p,width:g,height:x}=m.getBoundingClientRect(),t=p+g/2,n=w+x/2,l=[`circle(0%at ${t}px ${n}px)`,`circle(${Math.hypot(Math.max(t,window.innerWidth-t),Math.max(n,window.innerHeight-n))}px at ${t}px ${n}px)`];((e,i)=>{const o=document.createElement("style");o.setAttribute("type","text/css"),o.setAttribute("data-style-tag",i),o.textContent=`::view-transition-old(root),::view-transition-new(root){animation:none;}.dark::view-transition-old(root){z-index:1;}.dark::view-transition-new(root){z-index:999;}::view-transition-old(root){z-index:999;}::view-transition-new(root){z-index:1;}`,document.head.appendChild(o);})(0,d),u.ready.then(()=>{document.documentElement.animate({clipPath:r==="light" ? l:l.reverse()},{duration:s,easing:"ease-in-out",pseudoElement:r==="light" ? "::view-transition-new(root)":"::view-transition-old(root)"}),setTimeout(()=>((e)=>{document.head.querySelectorAll("style").forEach((i)=>i.getAttribute("data-style-tag")===e&&i.remove());})(d),s+100);});}};export{v};
@@ -0,0 +1,9 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ interface ContextMenuProps {
3
+ e: React.MouseEvent<HTMLElement, MouseEvent>;
4
+ className?: string;
5
+ content: ReactNode | ((onCloseMenu: () => void) => ReactNode);
6
+ style?: CSSProperties;
7
+ }
8
+ export declare const contextMenu: ({ e, style, content, className }: ContextMenuProps) => void;
9
+ export {};
@@ -0,0 +1 @@
1
+ export { contextMenu } from './ContextMenu';
@@ -5,7 +5,7 @@ export type ModalBoxProps = {
5
5
  content?: ReactNode;
6
6
  okText?: string;
7
7
  cancelText?: string;
8
- position?: {
8
+ startPosition?: {
9
9
  x: number;
10
10
  y: number;
11
11
  };
@@ -3,6 +3,7 @@ export * from './AvatarCrop';
3
3
  export * from './Button';
4
4
  export * from './Card3D';
5
5
  export * from './Checkbox';
6
+ export * from './ContextMenu';
6
7
  export * from './InjunctiveBox';
7
8
  export * from './Input';
8
9
  export * from './List';
@@ -1,4 +1,4 @@
1
- import { AutoSliderList, AvatarCrop, AwaitList, Button, Card3D, Checkbox, createDataSource, Direction, EstimatedVirtualList, injunctiveBox, List, MenuButton, message, Modal, OnoInput, OnoSelect, OnoTextarea, Pagination, portalRenderer, Radio, RadioGroup, ScrollableTabs, SvgImg, Switch, TemplateDialog, toast, Tooltip, Waterfall, ImageItem } from './components';
1
+ import { AutoSliderList, AvatarCrop, AwaitList, Button, Card3D, Checkbox, contextMenu, createDataSource, Direction, EstimatedVirtualList, List, MenuButton, message, Modal, OnoInput, OnoSelect, OnoTextarea, Pagination, portalRenderer, Radio, RadioGroup, ScrollableTabs, SvgImg, Switch, TemplateDialog, toast, Tooltip, Waterfall, ImageItem } from './components';
2
2
  import { createEventEmitter } from './event';
3
3
  import { default as useClickOutSide } from './hooks/useClickOutSide';
4
4
  import { default as useCountdown } from './hooks/useCountdown';
@@ -12,5 +12,5 @@ import { default as colorUtils, adjustingColors } from './utils/colorUtils';
12
12
  import { default as common, addCommasToNumber, addEventWithOriginHandler, calculateAspectRatio, checkDeviceIsMobile, checkStatusCode, copy2Clipboard, createIntersectionObserver, dayOfYear, debounce, deepCopy, downloadFile, ellipsisString, formatFileSize, formatSecondes, getElementCenterPosition, getFileName, getFileSuffix, getImageSIze, getPointDistance, getURLSearchParams, grayColor, isPureNumber, mediaAutoplayPolicies, parseQuery, passwordStrength, pick, printStr, pureNumber, quickSort, rafTimeout, randomString, safeCapitalizeWord, singleton, throttle } from './utils/common';
13
13
  import { base64ToBlob, base64ToFile, blobToBase64, blobToFile, fileToBase64, fileToBlob, urlToBase64, urlToBlob, urlToFile } from './utils/fileFormatConversion';
14
14
  import { convertSecondToOtherTime, formatTime, localFormat, second2Day } from './utils/formatTimeUtils';
15
- export { addCommasToNumber, addEventWithOriginHandler, adjustingColors, AutoSliderList, AvatarCrop, AwaitList, base64ToBlob, base64ToFile, blobToBase64, blobToFile, Button, calculateAspectRatio, Card3D, Checkbox, checkDeviceIsMobile, checkStatusCode, colorUtils, common, convertSecondToOtherTime, copy2Clipboard, createDataSource, createEventEmitter, createIntersectionObserver, dayOfYear, debounce, deepCopy, Direction, downloadFile, ellipsisString, EstimatedVirtualList, fileToBase64, fileToBlob, formatFileSize, formatSecondes, formatTime, getElementCenterPosition, getFileName, getFileSuffix, getImageSIze, getPointDistance, getURLSearchParams, grayColor, injunctiveBox, isPureNumber, List, localFormat, mediaAutoplayPolicies, MenuButton, message, Modal, OnoInput, OnoSelect, OnoTextarea, Pagination, parseQuery, passwordStrength, pick, portalRenderer, printStr, pureNumber, quickSort, Radio, RadioGroup, rafTimeout, randomString, safeCapitalizeWord, ScrollableTabs, second2Day, singleton, SvgImg, Switch, TemplateDialog, throttle, toast, Tooltip, urlToBase64, urlToBlob, urlToFile, useClickOutSide, useCountdown, useEventListener, useGetElementSize, useKeyPress, useMouseClick, useTheme, useThemePro, Waterfall };
15
+ export { addCommasToNumber, addEventWithOriginHandler, adjustingColors, AutoSliderList, AvatarCrop, AwaitList, base64ToBlob, base64ToFile, blobToBase64, blobToFile, Button, calculateAspectRatio, Card3D, Checkbox, checkDeviceIsMobile, checkStatusCode, colorUtils, common, contextMenu, convertSecondToOtherTime, copy2Clipboard, createDataSource, createEventEmitter, createIntersectionObserver, dayOfYear, debounce, deepCopy, Direction, downloadFile, ellipsisString, EstimatedVirtualList, fileToBase64, fileToBlob, formatFileSize, formatSecondes, formatTime, getElementCenterPosition, getFileName, getFileSuffix, getImageSIze, getPointDistance, getURLSearchParams, grayColor, isPureNumber, List, localFormat, mediaAutoplayPolicies, MenuButton, message, Modal, OnoInput, OnoSelect, OnoTextarea, Pagination, parseQuery, passwordStrength, pick, portalRenderer, printStr, pureNumber, quickSort, Radio, RadioGroup, rafTimeout, randomString, safeCapitalizeWord, ScrollableTabs, second2Day, singleton, SvgImg, Switch, TemplateDialog, throttle, toast, Tooltip, urlToBase64, urlToBlob, urlToFile, useClickOutSide, useCountdown, useEventListener, useGetElementSize, useKeyPress, useMouseClick, useTheme, useThemePro, Waterfall };
16
16
  export type { ImageItem, ThemeType };