@labelbee/lb-components 1.2.3-alpha.3 → 1.2.3-alpha.4

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.
@@ -1 +1 @@
1
- "use strict";var React=require("react");const useRafState=t=>{const e=React.useRef(0),[a,r]=React.useState(t),n=React.useCallback(c=>{!cancelAnimationFrame||!requestAnimationFrame||(cancelAnimationFrame(e.current),e.current=requestAnimationFrame(()=>{r(c)}))},[]);return React.useEffect(()=>{if(!!cancelAnimationFrame)return()=>cancelAnimationFrame(e.current)},[]),[a,n]};module.exports=useRafState;
1
+ "use strict";var React=require("react");const useRafState=t=>{const e=React.useRef(0),[r,a]=React.useState(t),n=React.useCallback(c=>{!window||(cancelAnimationFrame(e.current),e.current=requestAnimationFrame(()=>{a(c)}))},[]);return React.useEffect(()=>{if(!!window)return()=>cancelAnimationFrame(e.current)},[]),[r,n]};module.exports=useRafState;
@@ -1 +1 @@
1
- import{useRef as i,useState as m,useCallback as s,useEffect as u}from"react";const o=t=>{const e=i(0),[a,n]=m(t),r=s(c=>{!cancelAnimationFrame||!requestAnimationFrame||(cancelAnimationFrame(e.current),e.current=requestAnimationFrame(()=>{n(c)}))},[]);return u(()=>{if(!!cancelAnimationFrame)return()=>cancelAnimationFrame(e.current)},[]),[a,r]};export{o as default};
1
+ import{useRef as s,useState as u,useCallback as o,useEffect as i}from"react";const f=t=>{const e=s(0),[r,a]=u(t),n=o(c=>{!window||(cancelAnimationFrame(e.current),e.current=requestAnimationFrame(()=>{a(c)}))},[]);return i(()=>{if(!!window)return()=>cancelAnimationFrame(e.current)},[]),[r,n]};export{f as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labelbee/lb-components",
3
- "version": "1.2.3-alpha.3",
3
+ "version": "1.2.3-alpha.4",
4
4
  "description": "Provide a complete library of annotation components",
5
5
  "main": "./dist/index.js",
6
6
  "es": "./es/index.js",