mirror of
https://github.com/storytold/artcraft.git
synced 2026-11-06 02:00:46 +00:00
housekeeping for netlify check for merge
This commit is contained in:
1 parent
758a50f9ee
commit
bb27e8f6cb
3 files changed
+28
-28
No files matched your search
+2
-2
@@ -60,7 +60,7 @@ export const TimeCursor = ({
|
||||
};
|
||||
}, [handleWindowResize])
|
||||
|
||||
const handleOnScrubStart = () => {
|
||||
const handleOnScrubStart = useCallback(() => {
|
||||
isLockedForScrubbing.current = true;
|
||||
if(videoElement!==null) {
|
||||
if (videoElement.paused) wasPlaying.current = false;
|
||||
@@ -69,7 +69,7 @@ export const TimeCursor = ({
|
||||
videoElement.pause();
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [videoElement])
|
||||
|
||||
const handleOnScrubEnd = useCallback( (newPos: number)=>{
|
||||
isLockedForScrubbing.current = false;
|
||||
|
||||
+7
-7
@@ -36,13 +36,13 @@ export const withScrubbing = <P extends withScrubbingPropsI>(Component: React.Co
|
||||
onScrubEnd,
|
||||
...rest
|
||||
}: withScrubbingPropsI) => {
|
||||
const debug = true || propsDebug;
|
||||
// const debug = true || propsDebug;
|
||||
|
||||
|
||||
const refEl = useRef<HTMLDivElement| null>(null);
|
||||
const refListener = useRef<number>(Date.now());
|
||||
// const refListener = useRef<number>(Date.now());
|
||||
|
||||
if (debug) console.log(`${refListener.current} withSCRUBBING reRENDERING!! `);
|
||||
// if (debug) console.log(`${refListener.current} withSCRUBBING reRENDERING!! `);
|
||||
|
||||
const [{
|
||||
currLeftOffset, pointerStartPos,
|
||||
@@ -56,7 +56,7 @@ export const withScrubbing = <P extends withScrubbingPropsI>(Component: React.Co
|
||||
useLayoutEffect(() => {
|
||||
// if (debug) console.log(`withSCRUBBING useLAYOUTeffect!! `);
|
||||
function handleScrubStart (e: PointerEvent) {
|
||||
if (debug) console.log(`${refListener.current} withSCRUBBING SCRUB_START!! `);
|
||||
// if (debug) console.log(`${refListener.current} withSCRUBBING SCRUB_START!! `);
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if(refEl.current){
|
||||
@@ -73,7 +73,7 @@ export const withScrubbing = <P extends withScrubbingPropsI>(Component: React.Co
|
||||
}
|
||||
};
|
||||
function handleScrubEnd (e: PointerEvent){
|
||||
if (debug) console.log(`${refListener.current} withSCRUBBING SCRUB_END!! `);
|
||||
// if (debug) console.log(`${refListener.current} withSCRUBBING SCRUB_END!! `);
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
@@ -86,7 +86,7 @@ export const withScrubbing = <P extends withScrubbingPropsI>(Component: React.Co
|
||||
}));
|
||||
};
|
||||
function handleScrubMove (e: PointerEvent){
|
||||
if (debug) console.log(`${refListener.current} withSCRUBBING SCRUB_MOVE!! `);
|
||||
// if (debug) console.log(`${refListener.current} withSCRUBBING SCRUB_MOVE!! `);
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
@@ -120,7 +120,7 @@ export const withScrubbing = <P extends withScrubbingPropsI>(Component: React.Co
|
||||
window.removeEventListener("pointermove", handleScrubMove);
|
||||
};
|
||||
// }
|
||||
}, [scrubberWidth, boundingWidth]);
|
||||
}, [scrubberWidth, boundingWidth, onScrubStart]);
|
||||
|
||||
// useEffect(()=>{
|
||||
// // if (debug) console.log(`${refListener.current} withSCRUBBING useEFFECT for scrubStart!! `);
|
||||
|
||||
+19
-19
@@ -34,13 +34,13 @@ export const withScrubbing = <P extends withScrubbingPropsI>(Component: React.Co
|
||||
onScrubEnd,
|
||||
...rest
|
||||
}: withScrubbingPropsI) => {
|
||||
const debug = true; //|| propsDebug;
|
||||
// const debug = true; //|| propsDebug;
|
||||
|
||||
|
||||
const refEl = useRef<HTMLDivElement| null>(null);
|
||||
const refListener = useRef<number>(Date.now());
|
||||
// const refListener = useRef<number>(Date.now());
|
||||
|
||||
if (debug) console.log(`${refListener.current} withSCRUBBING reRENDERING!! `);
|
||||
// if (debug) console.log(`${refListener.current} withSCRUBBING reRENDERING!! `);
|
||||
|
||||
const [{
|
||||
currLeftOffset, pointerStartPos,
|
||||
@@ -54,7 +54,7 @@ export const withScrubbing = <P extends withScrubbingPropsI>(Component: React.Co
|
||||
useLayoutEffect(() => {
|
||||
// if (debug) console.log(`withSCRUBBING useLAYOUTeffect!! `);
|
||||
function handleScrubStart (e: MouseEvent) {
|
||||
if (debug) console.log(`${refListener.current} withSCRUBBING SCRUB_START!! `);
|
||||
// if (debug) console.log(`${refListener.current} withSCRUBBING SCRUB_START!! `);
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if(refEl.current){
|
||||
@@ -70,7 +70,7 @@ export const withScrubbing = <P extends withScrubbingPropsI>(Component: React.Co
|
||||
}
|
||||
};
|
||||
function handleScrubEnd (e: MouseEvent){
|
||||
if (debug) console.log(`${refListener.current} withSCRUBBING SCRUB_END!! `);
|
||||
// if (debug) console.log(`${refListener.current} withSCRUBBING SCRUB_END!! `);
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
@@ -83,7 +83,7 @@ export const withScrubbing = <P extends withScrubbingPropsI>(Component: React.Co
|
||||
}));
|
||||
};
|
||||
function handleScrubMove (e: MouseEvent){
|
||||
if (debug) console.log(`${refListener.current} withSCRUBBING SCRUB_MOVE!! `);
|
||||
// if (debug) console.log(`${refListener.current} withSCRUBBING SCRUB_MOVE!! `);
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
@@ -106,28 +106,28 @@ export const withScrubbing = <P extends withScrubbingPropsI>(Component: React.Co
|
||||
});
|
||||
};
|
||||
|
||||
if(!(window as any)[`listener-id-${refListener.current}`]){
|
||||
(window as any)[`listender-id-${refListener.current}`] = true;
|
||||
window.addEventListener("pointerdown", handleScrubStart);
|
||||
window.addEventListener("pointerup", handleScrubEnd);
|
||||
return () => {
|
||||
(window as any)[`listener-id-${refListener.current}`] = false;
|
||||
window.removeEventListener("pointerdown", handleScrubStart);
|
||||
window.removeEventListener("pointerup", handleScrubEnd);
|
||||
window.removeEventListener("pointermove", handleScrubMove);
|
||||
};
|
||||
}
|
||||
// if(!(window as any)[`listener-id-${refListener.current}`]){
|
||||
// (window as any)[`listender-id-${refListener.current}`] = true;
|
||||
window.addEventListener("pointerdown", handleScrubStart);
|
||||
window.addEventListener("pointerup", handleScrubEnd);
|
||||
return () => {
|
||||
// (window as any)[`listener-id-${refListener.current}`] = false;
|
||||
window.removeEventListener("pointerdown", handleScrubStart);
|
||||
window.removeEventListener("pointerup", handleScrubEnd);
|
||||
window.removeEventListener("pointermove", handleScrubMove);
|
||||
};
|
||||
// }
|
||||
}, [scrubberWidth, boundingWidth]);
|
||||
|
||||
useEffect(()=>{
|
||||
if (debug) console.log(`${refListener.current} withSCRUBBING useEFFECT for scrubStart!! `);
|
||||
// if (debug) console.log(`${refListener.current} withSCRUBBING useEFFECT for scrubStart!! `);
|
||||
if(onScrubStart && pointerStartPos > 0){
|
||||
onScrubStart();
|
||||
}
|
||||
},[pointerStartPos, onScrubStart]);
|
||||
|
||||
useEffect(()=>{
|
||||
if (debug) console.log(`${refListener.current} withSCRUBBING useEFFECT for scrubEend!! `);
|
||||
// if (debug) console.log(`${refListener.current} withSCRUBBING useEFFECT for scrubEend!! `);
|
||||
if(onScrubEnd && boundingWidth > 0 && prevLeftOffset >= 0 && propsLeftOffset !== prevLeftOffset){
|
||||
onScrubEnd(prevLeftOffset);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user