ono-react-element 0.0.20 → 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.
- package/dist/es/AutoSliderList-DD7w6KlD.js +1 -0
- package/dist/es/AvatarCrop-CSkrjAcy.js +1 -0
- package/dist/es/Button-DXWGWvF-.js +1 -0
- package/dist/es/Card3D-DrfpLxw2.js +1 -0
- package/dist/es/Checkbox-jOOMkqbP.js +1 -0
- package/dist/es/ContextMenu-BL414VF5.js +1 -0
- package/dist/es/InjunctiveBox-vLlRm8LB.js +1 -0
- package/dist/es/Input-lVK5hctw.js +1 -0
- package/dist/es/List-DXRmDwDo.js +1 -0
- package/dist/es/MenuButton-C22ekETH.js +1 -0
- package/dist/es/Message-AC7MOJ5X.js +1 -0
- package/dist/es/Modal-e1dQi2y3.js +1 -0
- package/dist/es/Pagination-L17GYQVO.js +1 -0
- package/dist/es/PortalRenderer-izu9LyVc.js +1 -0
- package/dist/es/Radio-m9BOKzf5.js +1 -0
- package/dist/es/ScrollableTabs-DgcrSjsb.js +1 -0
- package/dist/es/Select-BSNVfoEp.js +1 -0
- package/dist/es/SvgImg-HkuwJQ4_.js +1 -0
- package/dist/es/Switch-DoiR9_x4.js +1 -0
- package/dist/es/TemplateDialog-D4D6YS2U.js +1 -0
- package/dist/es/Toast-CERLQ4i7.js +1 -0
- package/dist/es/Tooltip-DDUtx7BP.js +1 -0
- package/dist/es/VirtualList-YXDe-9GK.js +1 -0
- package/dist/es/Waterfall-D8AExUDu.js +1 -0
- package/dist/es/colorUtils.ts-Cxx4mvOB.js +1 -0
- package/dist/es/common.ts-OTJMJPHg.js +1 -0
- package/dist/es/dependencies-B7YNjh_z.js +15719 -0
- package/dist/es/event-B2tGdMqN.js +1 -0
- package/dist/es/fileFormatConversion.ts-3AQHtta9.js +1 -0
- package/dist/es/formatTimeUtils.ts-ng_eAUID.js +1 -0
- package/dist/es/index.js +1 -1
- package/dist/es/useClickOutSide.tsx-C6XuLZzd.js +1 -0
- package/dist/es/useCountdown.tsx-DWqs6wNp.js +1 -0
- package/dist/es/useEventListener.tsx-C8V9Qip6.js +1 -0
- package/dist/es/useGetElementSize.tsx-DML7z5Xp.js +1 -0
- package/dist/es/useKeyPress.tsx-hgs6v_Jt.js +1 -0
- package/dist/es/useMouseClick.tsx-BmzbuM6X.js +1 -0
- package/dist/es/useTheme.tsx-C-GCpzAS.js +1 -0
- package/dist/es/useThemePro.tsx-BIU8EPPB.js +1 -0
- package/dist/es/viewTransitionUtils.ts-tmSvCt31.js +1 -0
- package/dist/types/components/ContextMenu/ContextMenu.d.ts +9 -0
- package/dist/types/components/ContextMenu/index.d.ts +1 -0
- package/dist/types/components/Modal/types.d.ts +1 -1
- package/dist/types/components/index.d.ts +1 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/umd/index.umd.cjs +1 -1
- package/dist/umd/index.umd.cjs.br +0 -0
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/package.json +1 -1
- package/dist/es/AutoSliderList-tkaOmfnx.js +0 -1
- package/dist/es/AvatarCrop-DrA-SARP.js +0 -1
- package/dist/es/Button-QIC7QPK9.js +0 -1
- package/dist/es/Card3D-DMvCSUhe.js +0 -1
- package/dist/es/Checkbox-daBabj14.js +0 -1
- package/dist/es/InjunctiveBox-DUNoNHCO.js +0 -1
- package/dist/es/Input-DLOeg2pz.js +0 -1
- package/dist/es/List-UAKCMuGC.js +0 -1
- package/dist/es/MenuButton-DHkU5Bq7.js +0 -1
- package/dist/es/Message-BGDILiLc.js +0 -1
- package/dist/es/Modal-D2289ZPX.js +0 -1
- package/dist/es/Pagination-m71H2tfS.js +0 -1
- package/dist/es/PortalRenderer-CDAzQJgm.js +0 -1
- package/dist/es/Radio-D_GKVoOC.js +0 -1
- package/dist/es/ScrollableTabs--449B73p.js +0 -1
- package/dist/es/Select-B11NvK-I.js +0 -1
- package/dist/es/SvgImg-CZwq2D7J.js +0 -1
- package/dist/es/Switch-C61q7rR5.js +0 -1
- package/dist/es/TemplateDialog-CAimG5cv.js +0 -1
- package/dist/es/Toast-CQEsbqUJ.js +0 -1
- package/dist/es/Tooltip-CgttMIcX.js +0 -1
- package/dist/es/VirtualList-BAiIymCF.js +0 -1
- package/dist/es/Waterfall-C7SWCxJ1.js +0 -1
- package/dist/es/colorUtils.ts-DYuRvCXZ.js +0 -1
- package/dist/es/common.ts-BbDnZ7vC.js +0 -1
- package/dist/es/dependencies-CbQbPZZ-.js +0 -15524
- package/dist/es/event-CtX9rswE.js +0 -1
- package/dist/es/fileFormatConversion.ts-tUlewYon.js +0 -1
- package/dist/es/formatTimeUtils.ts-CkdWJ_Sl.js +0 -1
- package/dist/es/useClickOutSide.tsx-CMvd2uTW.js +0 -1
- package/dist/es/useCountdown.tsx-Btzj-keH.js +0 -1
- package/dist/es/useEventListener.tsx-BBGVcI5T.js +0 -1
- package/dist/es/useGetElementSize.tsx-Dtshth0Y.js +0 -1
- package/dist/es/useKeyPress.tsx-Db44HXXz.js +0 -1
- package/dist/es/useMouseClick.tsx-C7uAH4n4.js +0 -1
- package/dist/es/useTheme.tsx-C5b7BRYz.js +0 -1
- package/dist/es/useThemePro.tsx-DQuSI8J7.js +0 -1
- package/dist/es/viewTransitionUtils.ts-CHa9uBpi.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var __defProp=Object.defineProperty;var __defNormalProp=(obj,key,value)=>key in obj ? __defProp(obj,key,{enumerable:true,configurable:true,writable:true,value}):obj[key]=value;var __publicField=(obj,key,value)=>__defNormalProp(obj,typeof key!=="symbol" ? key+"":key,value);class e{constructor(e2){__publicField(this,"events",{});e2.forEach((e3)=>{this.events[e3]=new Set();});}emit(e2,...t2){if(!this.events[e2])throw new Error(`Event ${e2}does not exist`);this.events[e2].forEach((e3)=>{e3(...t2);});}on(e2,t2){this.events[e2]||(this.events[e2]=new Set()),this.events[e2].add(t2);}cancel(e2,t2){this.events[e2]&&this.events[e2].delete(t2);}}let t=null;const s=(s2)=>(t||(t=new e(s2)),t);export{s as c};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t=(t2)=>{const e2=t2.split(","),a2=e2[0].match(/:(.*?);/)[1],s2=atob(e2[1]);let n2=s2.length;const o2=new Uint8Array(n2);for(;n2--;)o2[n2]=s2.charCodeAt(n2);return new Blob([o2],{type:a2});},e=(t2,e2)=>{const a2=t2.split(","),s2=a2[0].match(/:(.*?);/u)[1],n2=atob(a2[1]);let o2=n2.length,i2="jpeg"===s2.split("/")[1] ? ".jpg":"."+s2.split("/")[1];const r2=new Uint8Array(o2);for(;o2--;)r2[o2]=n2.charCodeAt(o2);const l2=new Blob([r2],{type:s2});return new File([l2],e2+i2,{type:s2,lastModified:(new Date()).getTime()});},a=(t2)=>new Promise((e2)=>{const a2=new FileReader();a2.readAsDataURL(t2),a2.onload=(t3)=>{var _a;const a3=(_a=t3.target)==null ? void 0:_a.result,s2=a3.split(",")[1];e2(s2);};}),s=(t2,e2="abc.jpg")=>new File([t2],e2,{type:t2.type}),n=(t2)=>new Promise((e2)=>{const a2=new FileReader();a2.readAsDataURL(t2),a2.onload=(t3)=>{var _a;return e2((_a=t3.target)==null ? void 0:_a.result);};}),o=(t2)=>t2.slice(0,t2.size,t2.type),i=async(t2)=>await(await fetch(t2)).blob(),r=async(t2)=>s(await i(t2)),l=async(t2)=>await a(await i(t2));export{e as a,t as b,a as c,s as d,o as e,n as f,i as g,r as h,l as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t=(t2)=>t2<10 ? `0${t2}`:`${t2}`,e=(t2)=>t2.toString().length>13 ? new Date(Number(t2.toString().substring(0,13))):13===t2.toString().length ? new Date(t2):t2.toString().length<13&&t2.toString().length>10 ? new Date(Number((t2.toString()+"000").substring(0,13))):10===t2.toString().length ? new Date(1e3*t2):new Date(Number((t2.toString()+"000000000000").substring(0,13))),n=(n2,r2="YY-MM-DD hh:mm:ss")=>{const s2=["YY","MM","DD","hh","mm","ss"],u2=[],o=e(n2);u2.push(o.getFullYear().toString()),u2.push(t(o.getMonth()+1)),u2.push(t(o.getDate())),u2.push(t(o.getHours())),u2.push(t(o.getMinutes())),u2.push(t(o.getSeconds()));for(let t2 in u2)r2=r2.replace(s2[t2],u2[t2]);return r2;},r=(n2,r2="YY-MM-DD hh:mm:ss",s2="cn")=>{const u2=["YY","MM","DD","hh","mm","ss"],o=[],h=e(n2);o.push(((t2,e2)=>{const n3={en:["0","1","2","3","4","5","6","7","8","9"],cn:["零","一","二","三","四","五","六","七","八","九"]};return t2.split("").map((t3)=>n3[e2][Number(t3)]).join("");})(h.getFullYear().toString(),s2)),o.push(((t2,e2)=>({en:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"],cn:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]})[e2][Number(t2)-1])(t(h.getMonth()+1),s2)),o.push(((t2,e2)=>{let n3;return "en"===e2 ? n3="01"===t2||"21"===t2||"31"===t2 ? Number(t2)+"st":"02"===t2||"22"===t2 ? Number(t2)+"nd":"03"===t2||"23"===t2 ? Number(t2)+"rd":Number(t2)+"th":"01"===t2 ? n3="一日":"02"===t2 ? n3="二日":"03"===t2 ? n3="三日":"04"===t2 ? n3="四日":"05"===t2 ? n3="五日":"06"===t2 ? n3="六日":"07"===t2 ? n3="七日":"08"===t2 ? n3="八日":"09"===t2 ? n3="九日":"10"===t2 ? n3="十日":"11"===t2 ? n3="十一日":"12"===t2 ? n3="十二日":"13"===t2 ? n3="十三日":"14"===t2 ? n3="十四日":"15"===t2 ? n3="十五日":"16"===t2 ? n3="十六日":"17"===t2 ? n3="十七日":"18"===t2 ? n3="十八日":"19"===t2 ? n3="十九日":"20"===t2 ? n3="二十日":"21"===t2 ? n3="二十一日":"22"===t2 ? n3="二十二日":"23"===t2 ? n3="二十三日":"24"===t2 ? n3="二十四日":"25"===t2 ? n3="二十五日":"26"===t2 ? n3="二十六日":"27"===t2 ? n3="二十七日":"28"===t2 ? n3="二十八日":"29"===t2 ? n3="二十九日":"30"===t2 ? n3="三十日":"31"===t2&&(n3="三十一日"),n3 ?? t2;})(t(h.getDate()),s2)),o.push(t(h.getHours())),o.push(t(h.getMinutes())),o.push(t(h.getSeconds()));for(let t2 in o)r2=r2.replace(u2[t2],o[t2]);return r2;},s=(e2,n2)=>{const r2=["DD","hh","mm","ss"],s2=[];s2.push(Math.floor(e2/86400)),s2.push(t(Math.floor(e2%86400/3600))),s2.push(t(Math.floor(e2%3600/60))),s2.push(t(e2%60));for(let t2=0;t2<r2.length;t2++)n2=n2.replace(r2[t2],s2[t2].toString());return n2;},u=(t2,e2)=>{const n2={year:31536e3,month:2592e3,day:86400,hour:3600,minute:60,second:1};if(!n2[e2])throw new Error('Invalid type. Please use "day","hour","minute",or "second".');return Math.floor(t2/n2[e2]);};export{u as c,n as f,r as l,s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as e}from "./useEventListener.tsx-BBGVcI5T.js";const t=(t2,n,r)=>e(((e2)=>{const t3="string"==typeof e2 ? [e2]:e2;if(new Set(t3).size!==t3.length)throw new Error("there are duplicates in the event type");return t3;})((r==null ? void 0:r.event)||"click"),(e2)=>{if(t2)if(t2 instanceof Array)t2.map((e3)=>e3 instanceof HTMLElement ? e3:e3.current).some((t3)=>!!t3&&t3.contains(e2.target))||n(e2);else{const r2=t2 instanceof HTMLElement ? t2:t2.current;r2&&!r2.contains(e2.target)&&n(e2);}},{deps:[t2,...(r==null ? void 0:r.deps)||[]]});export{t as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useState as r,useRef as e,useCallback as t,useEffect as u}from "react";const n=(n2=60,c)=>{const [l,o]=r(n2),[i,m]=r(false),a=e(null),s=t(()=>m(true),[]),T=t(()=>{m(false),o(n2),a.current&&(clearTimeout(a.current),a.current=null),c==null ? void 0:c();},[n2,c]);return u(()=>{if(i)return l>0 ? a.current=setTimeout(()=>{o((r2)=>r2-1);},1e3):T(),()=>{a.current&&(clearTimeout(a.current),a.current=null);};},[i,l,T]),[l,s,T];};export{n as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useEffect as e}from "react";const t=(t2,n,r)=>{const{target:o,deps:i,isDeferred:d}=r||{},s=(e2)=>n(e2);return e(()=>("string"==typeof t2 ?!d&&(o||window).addEventListener(t2,s):t2.forEach((e2)=>!d&&(o||window).addEventListener(e2,s)),()=>{"string"==typeof t2 ?(o||window).removeEventListener(t2,s):t2.forEach((e2)=>(o||window).removeEventListener(e2,s));}),[o,...i||[]]),d ?()=>{"string"==typeof t2 ?(o||window).addEventListener(t2,s):t2.forEach((e2)=>(o||window).addEventListener(e2,s));}:void 0;};export{t as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useState as e,useEffect as n}from "react";const o=(o2)=>{const [t,i]=e({w:0,h:0}),r=new ResizeObserver((e2)=>{for(const n2 of e2)i({w:n2.borderBoxSize[0].inlineSize,h:n2.borderBoxSize[0].blockSize});}),s=()=>{if(o2&&"function"!=typeof o2)r.observe(o2 instanceof HTMLElement ? o2:o2.current);else if(o2&&"function"==typeof o2){const e2=o2();r.observe(e2 instanceof HTMLElement ? e2:e2.current);}else i({w:window.innerWidth,h:window.innerHeight});};return n(()=>(s(),window.addEventListener("resize",s),()=>{if(window.removeEventListener("resize",s),o2&&"function"!=typeof o2)r.unobserve(o2 instanceof HTMLElement ? o2:o2.current);else if(o2&&"function"==typeof o2){const e2=o2();r.unobserve(e2 instanceof HTMLElement ? e2:e2.current);}}),[o2]),t;};export{o as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as e}from "./useEventListener.tsx-BBGVcI5T.js";const t=(e2)=>e2.toString().toLocaleLowerCase(),s=(s2,n,a)=>{const l=(l2)=>e(l2,(e2)=>((e3,s3,a2)=>{e3.forEach((e4)=>{if(e4.includes("+")&&e4.length>1){const t2=e4.split("+"),a3=s3.ctrlKey&&t2.includes("ctrl"),l3=s3.shiftKey&&t2.includes("shift"),c=s3.altKey&&t2.includes("alt"),o=s3.metaKey&&t2.includes("meta"),r=(s3.ctrlKey||s3.metaKey)&&t2.includes("commandorcontrol");2===t2.length ?(a3||l3||c||o||r)&&s3.key.toLocaleLowerCase()===t2[t2.length-1]&&n(s3,e4):3===t2.length&&(a3&&l3||a3&&c||a3&&o||a3&&r||l3&&c||l3&&o||l3&&r||c&&o||c&&r||o&&r)&&s3.key.toLocaleLowerCase()===t2[t2.length-1]&&n(s3,e4);}else if(e4.includes(t(s3.key))){if(a2)e4===t(s3.key)&&n(s3,e4);else if(!(s3.ctrlKey||s3.metaKey||s3.shiftKey||s3.altKey))return n(s3,e4);}});})(s2 instanceof Array ? s2.map((e3)=>t(e3)):[t(s2)],e2,(a==null ? void 0:a.exactMatch)||false),{deps:[a==null ? void 0:a.target,...(a==null ? void 0:a.deps)||[]]});(a==null ? void 0:a.events)instanceof Array ? a.events.forEach((e2)=>l(e2)):l((a==null ? void 0:a.events)||"keydown");};export{s as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useState as e}from "react";import{u as c}from "./useEventListener.tsx-BBGVcI5T.js";const n=()=>{const [n2,t]=e({clientX:0,clientY:0,screenX:0,screenY:0,pageX:0,pageY:0});return c("click",(e2)=>{const c2=e2.clientX,n3=e2.clientY,r=e2.screenX,s=e2.screenY,a=e2.pageX,i=e2.pageY;t({clientX:c2,clientY:n3,screenX:r,screenY:s,pageX:a,pageY:i});}),n2;};export{n as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{useEffect as e}from "react";let t=false;const a=({theme:a2,onDark:r,onLight:c})=>{const n=window.matchMedia("(prefers-color-scheme:dark)"),o=()=>{n.matches ? r():c();};e(()=>{(()=>{switch(t&&(t=false,n.removeEventListener("change",o)),a2){case "light":c();break;case "dark":r();break;default:o(),t=true,n.addEventListener("change",o);}})();},[a2]);};export{a as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{v as e}from "./viewTransitionUtils.ts-CHa9uBpi.js";import{useState as t,useRef as n}from "react";import{u as r}from "./useTheme.tsx-C5b7BRYz.js";const m=(m2)=>{const{initTheme:a="light",themeRules:s=(e2)=>{e2 ? document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark");}}=m2||Object.assign({}),[o,i]=t(a),c=n(null);return r({theme:o,onDark:()=>{c.current ? e.changeThemeClipPathCircle({element:c.current,onChangeTheme:()=>s(true)}):s(true);},onLight:()=>{c.current ? e.changeThemeClipPathCircle({element:c.current,onChangeTheme:()=>s(false)}):s(false);}}),[o,({targetTheme:e2,element:t2,onChange:n2})=>{c.current=t2||null,requestAnimationFrame(()=>{n2==null ? void 0:n2(),i(e2);});}];};export{m as u};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t={changeThemeClipPathCircle:(t2)=>{const e="ono-view-transition-clip-path-circle",{element:n,duration:i=300,themeRules:o,onChangeTheme:a}=t2,r=(o==null ? void 0:o())||document.documentElement.classList.contains("dark")? "dark":"light";if(!document.startViewTransition)return a("dark"===r ? "light":"dark");const d=document.startViewTransition(()=>{const t3=document.documentElement.classList.contains("dark");a(t3 ? "light":"dark");}),{top:s,left:c,width:l,height:h}=n.getBoundingClientRect(),m=c+l/2,u=s+h/2,w=[`circle(0%at ${m}px ${u}px)`,`circle(${Math.hypot(Math.max(m,window.innerWidth-m),Math.max(u,window.innerHeight-u))}px at ${m}px ${u}px)`];((t3,e2)=>{const n2=document.createElement("style");n2.setAttribute("type","text/css"),n2.setAttribute("data-style-tag",e2),n2.textContent="\n::view-transition-old(root),\n::view-transition-new(root){\n animation:none;\n}\n .dark::view-transition-old(root){\n z-index:1;\n}\n\n .dark::view-transition-new(root){\n z-index:999;\n}\n\n::view-transition-old(root){\n z-index:999;\n}\n\n::view-transition-new(root){\n z-index:1;\n}\n ",document.head.appendChild(n2);})(0,e),d.ready.then(()=>{document.documentElement.animate({clipPath:"light"===r ? w:w.reverse()},{duration:i,easing:"ease-in-out",pseudoElement:"light"===r ? "::view-transition-new(root)":"::view-transition-old(root)"}),setTimeout(()=>((t3)=>{document.head.querySelectorAll("style").forEach((e2)=>e2.getAttribute("data-style-tag")===t3&&e2.remove());})(e),i+100);});}};export{t as v};
|