@labelbee/lb-components 1.23.0-alpha.110 → 1.23.0-alpha.112
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"),audio=require("../../../utils/audio.js"),ahooks=require("ahooks"),index=require("../zoomSlider/index.js");const useAudioScroll=
|
|
1
|
+
"use strict";var React=require("react"),audio=require("../../../utils/audio.js"),ahooks=require("ahooks"),index=require("../zoomSlider/index.js");const useAudioScroll=f=>{const{container:e,target:i,bufferWidth:o=10,clipping:g=!1,zoom:r=1,zoomHandler:c}=f,h=ahooks.useLatest(e),a=ahooks.useLatest(r),u=t=>{var n;t.ctrlKey&&((n=h.current)==null?void 0:n.contains(t.target))&&(t.deltaY>0?c(audio.precisionAdd(a.current,index.audioZoomInfo.ratio)):c(audio.precisionMinus(a.current,index.audioZoomInfo.ratio)))};if(React.useEffect(()=>(document.addEventListener("wheel",u),()=>{document.removeEventListener("wheel",u)}),[]),e&&i&&g&&r>1){const{scrollLeft:t}=e,{right:n,left:s,width:m}=i.getBoundingClientRect(),{right:l,left:d,width:R}=e.getBoundingClientRect();if(m>R)return;d+o>s&&s>d&&window.requestAnimationFrame(()=>{e.scrollLeft=t-20}),n+o>l&&n<l&&window.requestAnimationFrame(()=>{e.scrollLeft=t+20})}};module.exports=useAudioScroll;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useEffect as w}from"react";import{precisionAdd as B,precisionMinus as C}from"../../../utils/audio.js";import{useLatest as
|
|
1
|
+
import{useEffect as w}from"react";import{precisionAdd as B,precisionMinus as C}from"../../../utils/audio.js";import{useLatest as f}from"ahooks";import{audioZoomInfo as g}from"../zoomSlider/index.js";const v=m=>{const{container:t,target:i,bufferWidth:o=10,clipping:h=!1,zoom:r=1,zoomHandler:c}=m,R=f(t),l=f(r),a=e=>{var n;e.ctrlKey&&((n=R.current)==null?void 0:n.contains(e.target))&&(e.deltaY>0?c(B(l.current,g.ratio)):c(C(l.current,g.ratio)))};if(w(()=>(document.addEventListener("wheel",a),()=>{document.removeEventListener("wheel",a)}),[]),t&&i&&h&&r>1){const{scrollLeft:e}=t,{right:n,left:d,width:p}=i.getBoundingClientRect(),{right:s,left:u,width:L}=t.getBoundingClientRect();if(p>L)return;u+o>d&&d>u&&window.requestAnimationFrame(()=>{t.scrollLeft=e-20}),n+o>s&&n<s&&window.requestAnimationFrame(()=>{t.scrollLeft=e+20})}};export{v as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@labelbee/lb-components",
|
|
3
|
-
"version": "1.23.0-alpha.
|
|
3
|
+
"version": "1.23.0-alpha.112",
|
|
4
4
|
"description": "Provide a complete library of annotation components",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"es": "./es/index.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@ant-design/icons": "^4.6.2",
|
|
46
|
-
"@labelbee/lb-annotation": "1.27.0-alpha.
|
|
46
|
+
"@labelbee/lb-annotation": "1.27.0-alpha.53",
|
|
47
47
|
"@labelbee/lb-utils": "1.19.0-alpha.22",
|
|
48
48
|
"@labelbee/wavesurfer": "1.1.0-alpha.1",
|
|
49
49
|
"@types/react-dom": "^18.2.7",
|