react-modern-audio-player 1.2.0 → 1.2.1
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/index.cjs +1 -1
- package/dist/index.es.js +6 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -419,7 +419,7 @@
|
|
|
419
419
|
left: ${e==="right"?`${t.width}px`:void 0};
|
|
420
420
|
right: ${e==="left"?`${t.width}px`:void 0};
|
|
421
421
|
`}
|
|
422
|
-
`,ma=({children:e})=>C("div",{className:"dropdown-trigger-wrapper",children:e});Se.Content=ha;Se.Trigger=ma;const va=({triggerRef:e,initialState:t})=>{const{playerPlacement:n}=F(X),[i,u]=O.useState(t);return O.useEffect(()=>{e.current
|
|
422
|
+
`,ma=({children:e})=>C("div",{className:"dropdown-trigger-wrapper",children:e});Se.Content=ha;Se.Trigger=ma;const va=({triggerRef:e,initialState:t})=>{const{playerPlacement:n}=F(X),[i,u]=O.useState(t);return O.useEffect(()=>{if(e.current){const h=()=>e.current.getBoundingClientRect().top<window.innerHeight/2?"bottom":"top",p=setTimeout(()=>{u(h())},0);return()=>{clearTimeout(p)}}},[n,e]),i},ya=()=>{const e=O.useRef(null),{activeUI:{volumeSlider:t,all:n},volumeSliderPlacement:i}=F(X),u=va({triggerRef:e,initialState:"bottom"});return Z(Se,{placement:i||u,triggerType:"hover",disabled:!(t!=null?t:n),children:[C(Se.Trigger,{children:C(ir,{ref:e})}),C(Se.Content,{children:C(ca,{placement:i||u})})]})},ga=()=>{var i,u,h,p,l,d,y,v,w,A,E,M,_,x,S,P,T;const{interfacePlacement:e,activeUI:t}=F(X),n=(i=document.querySelector(".rm-audio-player-provider"))==null?void 0:i.getBoundingClientRect().top;return Z(ye,{children:[C(le.Item,{gridArea:((u=e==null?void 0:e.itemCustomArea)==null?void 0:u.progress)||((h=e==null?void 0:e.templateArea)==null?void 0:h.progress)||re.templateArea.progress,width:"100%",visible:Boolean(t.progress!==void 0?t.progress:t.all),children:C(ua,{})}),C(le.Item,{gridArea:((p=e==null?void 0:e.itemCustomArea)==null?void 0:p.repeatType)||((l=e==null?void 0:e.templateArea)==null?void 0:l.repeatType)||re.templateArea.repeatType,visible:Boolean((d=t.repeatType)!=null?d:t.all),children:C(Mn,{})}),C(le.Item,{gridArea:((y=e==null?void 0:e.itemCustomArea)==null?void 0:y.playButton)||((v=e==null?void 0:e.templateArea)==null?void 0:v.playButton)||re.templateArea.playButton,visible:Boolean((w=t.playButton)!=null?w:t.all),children:Z(ur,{UNSAFE_className:"btn-wrapper",alignItems:"center",gap:"10px",children:[C(It,{type:"prev",visible:Boolean((A=t.prevNnext)!=null?A:t.all)}),C(Cn,{}),C(It,{type:"next",visible:Boolean((E=t.prevNnext)!=null?E:t.all)})]})}),C(le.Item,{gridArea:((M=e==null?void 0:e.itemCustomArea)==null?void 0:M.volume)||((_=e==null?void 0:e.templateArea)==null?void 0:_.volume)||re.templateArea.volume,visible:Boolean((x=t.volume)!=null?x:t.all),children:C(ya,{},n)}),C(le.Item,{gridArea:((S=e==null?void 0:e.itemCustomArea)==null?void 0:S.playList)||((P=e==null?void 0:e.templateArea)==null?void 0:P.playList)||re.templateArea.playList,visible:Boolean((T=t.playList)!=null?T:t.all),children:C(ra,{})})]})},ba=K.default.div`
|
|
423
423
|
display: flex;
|
|
424
424
|
align-items: center;
|
|
425
425
|
width: 100%;
|
package/dist/index.es.js
CHANGED
|
@@ -7596,7 +7596,12 @@ const useVolumeSliderPlacement = ({
|
|
|
7596
7596
|
}
|
|
7597
7597
|
return "top";
|
|
7598
7598
|
};
|
|
7599
|
-
|
|
7599
|
+
const volumeSliderPlacementTimeout = setTimeout(() => {
|
|
7600
|
+
setVolumeSliderPlacement(placementValidation());
|
|
7601
|
+
}, 0);
|
|
7602
|
+
return () => {
|
|
7603
|
+
clearTimeout(volumeSliderPlacementTimeout);
|
|
7604
|
+
};
|
|
7600
7605
|
}
|
|
7601
7606
|
}, [playerPlacement, triggerRef]);
|
|
7602
7607
|
return volumeSliderPlacement;
|