Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
220 lines
18 KiB
JavaScript
220 lines
18 KiB
JavaScript
// Module ID: 6898
|
|
// Function ID: 6899
|
|
// Dependencies: [17, 6729, 6736, 1636, 6899, 6900]
|
|
// Exports: useGestureEventsHandlersDefault
|
|
|
|
// Module 6898
|
|
import cancelAnimation from "cancelAnimation" /* 1636 */;
|
|
import value22 from "value2" /* 6729 */;
|
|
import _mod6899 from "module_6899" /* 6899 */;
|
|
import _mod6900 from "module_6900" /* 6900 */;
|
|
import get_ActivityIndicator from "module_17" /* 17 */;
|
|
|
|
const Platform = get_ActivityIndicator.Platform;
|
|
let obj = { initialPosition: 0, initialKeyboardState: value22.KEYBOARD_STATE.UNDETERMINED, isScrollablePositionLocked: false };
|
|
const dismiss = get_ActivityIndicator.Keyboard.dismiss;
|
|
const fn = function t(arg0) {
|
|
closure_0 = arg0;
|
|
const keys = Object.keys(arg0);
|
|
const mapped = keys.map((item) => {
|
|
closure_0[item] = undefined;
|
|
});
|
|
};
|
|
fn.__closure = {};
|
|
fn.__workletHash = 16627033127293;
|
|
fn.__initData = { code: "function pnpm_useGestureEventsHandlersDefaultTsx1(context){Object.keys(context).map(function(key){context[key]=undefined;});}" };
|
|
let closure_6 = { code: "function handleOnStart_Pnpm_useGestureEventsHandlersDefaultTsx2(__,_){const{stopAnimation,animatedKeyboardState,enableBlurKeyboardOnGesture,KEYBOARD_STATE,runOnJS,dismissKeyboard,context,animatedPosition,animatedScrollableContentOffsetY}=this.__closure;stopAnimation();let initialKeyboardState=animatedKeyboardState.value;if(enableBlurKeyboardOnGesture&&initialKeyboardState===KEYBOARD_STATE.SHOWN){initialKeyboardState=KEYBOARD_STATE.HIDDEN;runOnJS(dismissKeyboard)();}context.value={...context.value,initialPosition:animatedPosition.value,initialKeyboardState:animatedKeyboardState.value};if(animatedScrollableContentOffsetY.value>0){context.value={...context.value,isScrollablePositionLocked:true};}}" };
|
|
let closure_7 = { code: "function handleOnChange_Pnpm_useGestureEventsHandlersDefaultTsx3(source,{translationY:translationY}){const{animatedHighestSnapPoint,isInTemporaryPosition,context,KEYBOARD_STATE,enablePanDownToClose,animatedContainerHeight,animatedSnapPoints,GESTURE_SOURCE,isScrollableRefreshable,animatedPosition,animatedScrollableContentOffsetY,clamp,enableOverDrag,animatedScrollableType,SCROLLABLE_TYPE,overDragResistanceFactor}=this.__closure;let highestSnapPoint=animatedHighestSnapPoint.value;if(isInTemporaryPosition.value&&context.value.initialKeyboardState===KEYBOARD_STATE.SHOWN){highestSnapPoint=context.value.initialPosition;}if(isInTemporaryPosition.value&&context.value.initialPosition<highestSnapPoint){highestSnapPoint=context.value.initialPosition;}const lowestSnapPoint=enablePanDownToClose?animatedContainerHeight.value:animatedSnapPoints.value[0];if(source===GESTURE_SOURCE.CONTENT&&isScrollableRefreshable.value&&animatedPosition.value===highestSnapPoint){return;}const negativeScrollableContentOffset=context.value.initialPosition===highestSnapPoint&&source===GESTURE_SOURCE.CONTENT||!context.value.isScrollablePositionLocked?animatedScrollableContentOffsetY.value*-1:0;const draggedPosition=context.value.initialPosition+translationY;const accumulatedDraggedPosition=draggedPosition+negativeScrollableContentOffset;const clampedPosition=clamp(accumulatedDraggedPosition,highestSnapPoint,lowestSnapPoint);if(context.value.isScrollablePositionLocked&&source===GESTURE_SOURCE.CONTENT&&animatedPosition.value===highestSnapPoint){context.value={...context.value,isScrollablePositionLocked:false};}if(enableOverDrag){if((source===GESTURE_SOURCE.HANDLE||animatedScrollableType.value===SCROLLABLE_TYPE.VIEW)&&draggedPosition<highestSnapPoint){const resistedPosition=highestSnapPoint-Math.sqrt(1+(highestSnapPoint-draggedPosition))*overDragResistanceFactor;animatedPosition.value=resistedPosition;return;}if(source===GESTURE_SOURCE.HANDLE&&draggedPosition>lowestSnapPoint){const resistedPosition=lowestSnapPoint+Math.sqrt(1+(draggedPosition-lowestSnapPoint))*overDragResistanceFactor;animatedPosition.value=resistedPosition;return;}if(source===GESTURE_SOURCE.CONTENT&&draggedPosition+negativeScrollableContentOffset>lowestSnapPoint){const resistedPosition=lowestSnapPoint+Math.sqrt(1+(draggedPosition+negativeScrollableContentOffset-lowestSnapPoint))*overDragResistanceFactor;animatedPosition.value=resistedPosition;return;}}animatedPosition.value=clampedPosition;}" };
|
|
let closure_8 = { code: "function handleOnEnd_Pnpm_useGestureEventsHandlersDefaultTsx4(source,{translationY:translationY,absoluteY:absoluteY,velocityY:velocityY}){const{animatedHighestSnapPoint,animatedPosition,GESTURE_SOURCE,isScrollableRefreshable,isInTemporaryPosition,context,animateToPosition,ANIMATION_SOURCE,animatedScrollableType,SCROLLABLE_TYPE,KEYBOARD_STATE,Platform,WINDOW_HEIGHT,animatedKeyboardHeight,runOnJS,dismissKeyboard,animatedSnapPoints,enablePanDownToClose,animatedClosedPosition,snapPoint,animatedScrollableContentOffsetY}=this.__closure;const highestSnapPoint=animatedHighestSnapPoint.value;const isSheetAtHighestSnapPoint=animatedPosition.value===highestSnapPoint;if(source===GESTURE_SOURCE.CONTENT&&isScrollableRefreshable.value&&isSheetAtHighestSnapPoint){return;}if(isInTemporaryPosition.value&&context.value.initialPosition>=animatedPosition.value){if(context.value.initialPosition>animatedPosition.value){animateToPosition(context.value.initialPosition,ANIMATION_SOURCE.GESTURE,velocityY/2);}return;}const isScrollable=animatedScrollableType.value!==SCROLLABLE_TYPE.UNDETERMINED&&animatedScrollableType.value!==SCROLLABLE_TYPE.VIEW;if(context.value.initialKeyboardState===KEYBOARD_STATE.SHOWN&&animatedPosition.value>context.value.initialPosition){if(!(Platform.OS==='ios'&&isScrollable&&absoluteY>WINDOW_HEIGHT-animatedKeyboardHeight.value)){runOnJS(dismissKeyboard)();}}if(isInTemporaryPosition.value){isInTemporaryPosition.value=false;}const snapPoints=animatedSnapPoints.value.slice();if(enablePanDownToClose){snapPoints.unshift(animatedClosedPosition.value);}const destinationPoint=snapPoint(translationY+context.value.initialPosition,velocityY,snapPoints);if(destinationPoint===animatedPosition.value){return;}const wasGestureHandledByScrollView=source===GESTURE_SOURCE.CONTENT&&animatedScrollableContentOffsetY.value>0;if(wasGestureHandledByScrollView&&isSheetAtHighestSnapPoint){return;}animateToPosition(destinationPoint,ANIMATION_SOURCE.GESTURE,velocityY/2);}" };
|
|
let closure_9 = { code: "function handleOnFinalize_Pnpm_useGestureEventsHandlersDefaultTsx5(){const{resetContext,context}=this.__closure;resetContext(context);}" };
|
|
|
|
export const useGestureEventsHandlersDefault = () => {
|
|
const bottomSheetInternal = animatedPosition(animatedSnapPoints[2]).useBottomSheetInternal();
|
|
animatedPosition = bottomSheetInternal.animatedPosition;
|
|
animatedSnapPoints = bottomSheetInternal.animatedSnapPoints;
|
|
const animatedKeyboardState = bottomSheetInternal.animatedKeyboardState;
|
|
({ animatedKeyboardHeight, animatedContainerHeight } = bottomSheetInternal);
|
|
const animatedScrollableType = bottomSheetInternal.animatedScrollableType;
|
|
const animatedHighestSnapPoint = bottomSheetInternal.animatedHighestSnapPoint;
|
|
const animatedClosedPosition = bottomSheetInternal.animatedClosedPosition;
|
|
const animatedScrollableContentOffsetY = bottomSheetInternal.animatedScrollableContentOffsetY;
|
|
const enableOverDrag = bottomSheetInternal.enableOverDrag;
|
|
const enablePanDownToClose = bottomSheetInternal.enablePanDownToClose;
|
|
const overDragResistanceFactor = bottomSheetInternal.overDragResistanceFactor;
|
|
const isInTemporaryPosition = bottomSheetInternal.isInTemporaryPosition;
|
|
const isScrollableRefreshable = bottomSheetInternal.isScrollableRefreshable;
|
|
const enableBlurKeyboardOnGesture = bottomSheetInternal.enableBlurKeyboardOnGesture;
|
|
const animateToPosition = bottomSheetInternal.animateToPosition;
|
|
const stopAnimation = bottomSheetInternal.stopAnimation;
|
|
obj = animatedPosition(animatedSnapPoints[2]);
|
|
let merged = Object.assign(animatedContainerHeight);
|
|
const sharedValue = animatedPosition(animatedSnapPoints[3]).useSharedValue({});
|
|
const obj4 = { handleOnStart: null, handleOnChange: null, handleOnEnd: null, handleOnFinalize: null };
|
|
let obj2 = animatedPosition(animatedSnapPoints[3]);
|
|
let obj3 = {};
|
|
function handleOnStart(arg0, arg1) {
|
|
stopAnimation();
|
|
let tmp3 = enableBlurKeyboardOnGesture;
|
|
if (enableBlurKeyboardOnGesture) {
|
|
tmp3 = tmp2 === value22.KEYBOARD_STATE.SHOWN;
|
|
}
|
|
if (tmp3) {
|
|
const HIDDEN = value22.KEYBOARD_STATE.HIDDEN;
|
|
cancelAnimation.runOnJS(dismiss)();
|
|
}
|
|
const obj2 = {};
|
|
const merged = Object.assign(sharedValue.value);
|
|
obj2.initialPosition = animatedPosition.value;
|
|
obj2.initialKeyboardState = animatedKeyboardState.value;
|
|
sharedValue.value = obj2;
|
|
if (animatedScrollableContentOffsetY.value > 0) {
|
|
const obj3 = {};
|
|
const merged1 = Object.assign(iter2.value);
|
|
obj3.isScrollablePositionLocked = true;
|
|
iter2.value = obj3;
|
|
}
|
|
}
|
|
const obj5 = animatedPosition(animatedSnapPoints[3]);
|
|
handleOnStart.__closure = { stopAnimation, animatedKeyboardState, enableBlurKeyboardOnGesture, KEYBOARD_STATE: animatedPosition(animatedSnapPoints[1]).KEYBOARD_STATE, runOnJS: animatedPosition(animatedSnapPoints[3]).runOnJS, dismissKeyboard: animatedScrollableType, context: sharedValue, animatedPosition, animatedScrollableContentOffsetY };
|
|
handleOnStart.__workletHash = 9400766587341;
|
|
handleOnStart.__initData = animatedClosedPosition;
|
|
const items = [stopAnimation, enableBlurKeyboardOnGesture, animatedPosition, animatedKeyboardState, animatedScrollableContentOffsetY];
|
|
obj4.handleOnStart = obj5.useWorkletCallback(handleOnStart, items);
|
|
const obj6 = { stopAnimation, animatedKeyboardState, enableBlurKeyboardOnGesture, KEYBOARD_STATE: animatedPosition(animatedSnapPoints[1]).KEYBOARD_STATE, runOnJS: animatedPosition(animatedSnapPoints[3]).runOnJS, dismissKeyboard: animatedScrollableType, context: sharedValue, animatedPosition, animatedScrollableContentOffsetY };
|
|
function handleOnChange(arg0, translationY) {
|
|
let initialPosition = animatedHighestSnapPoint.value;
|
|
value = isInTemporaryPosition.value;
|
|
if (value) {
|
|
value = sharedValue.value.initialKeyboardState === value22.KEYBOARD_STATE.SHOWN;
|
|
}
|
|
if (value) {
|
|
initialPosition = sharedValue.value.initialPosition;
|
|
}
|
|
value2 = isInTemporaryPosition.value;
|
|
if (value2) {
|
|
value2 = sharedValue.value.initialPosition < initialPosition;
|
|
}
|
|
if (value2) {
|
|
initialPosition = sharedValue.value.initialPosition;
|
|
}
|
|
if (enablePanDownToClose) {
|
|
let value3 = animatedContainerHeight.value;
|
|
} else {
|
|
value3 = animatedSnapPoints.value[0];
|
|
}
|
|
if (sharedValue.value.initialPosition !== initialPosition) {
|
|
let num = 0;
|
|
const sum = iter2.value.initialPosition + translationY.translationY;
|
|
const sum1 = sum + num;
|
|
let isScrollablePositionLocked = iter2.value.isScrollablePositionLocked;
|
|
if (isScrollablePositionLocked) {
|
|
isScrollablePositionLocked = arg0 === value22.GESTURE_SOURCE.CONTENT;
|
|
}
|
|
if (isScrollablePositionLocked) {
|
|
isScrollablePositionLocked = animatedPosition.value === initialPosition;
|
|
}
|
|
if (isScrollablePositionLocked) {
|
|
const obj2 = {};
|
|
const merged = Object.assign(iter2.value);
|
|
obj2.isScrollablePositionLocked = false;
|
|
iter2.value = obj2;
|
|
}
|
|
if (enableOverDrag) {
|
|
if (arg0 === value22.GESTURE_SOURCE.HANDLE) {
|
|
if (sum < initialPosition) {
|
|
const _Math3 = Math;
|
|
animatedPosition.value = initialPosition - Math.sqrt(initialPosition - sum + 1) * overDragResistanceFactor;
|
|
}
|
|
}
|
|
if (arg0 === value22.GESTURE_SOURCE.HANDLE) {
|
|
if (sum > value3) {
|
|
const _Math2 = Math;
|
|
animatedPosition.value = value3 + Math.sqrt(sum - value3 + 1) * overDragResistanceFactor;
|
|
}
|
|
}
|
|
if (arg0 === value22.GESTURE_SOURCE.CONTENT) {
|
|
if (sum + num > value3) {
|
|
const _Math = Math;
|
|
animatedPosition.value = value3 + Math.sqrt(sum + num - value3 + 1) * overDragResistanceFactor;
|
|
}
|
|
}
|
|
}
|
|
animatedPosition.value = _mod6899.clamp(sum1, initialPosition, value3);
|
|
const clampResult = _mod6899.clamp(sum1, initialPosition, value3);
|
|
}
|
|
num = -1 * animatedScrollableContentOffsetY.value;
|
|
}
|
|
const obj7 = animatedPosition(animatedSnapPoints[3]);
|
|
handleOnChange.__closure = { animatedHighestSnapPoint, isInTemporaryPosition, context: sharedValue, KEYBOARD_STATE: animatedPosition(animatedSnapPoints[1]).KEYBOARD_STATE, enablePanDownToClose, animatedContainerHeight, animatedSnapPoints, GESTURE_SOURCE: animatedPosition(animatedSnapPoints[1]).GESTURE_SOURCE, isScrollableRefreshable, animatedPosition, animatedScrollableContentOffsetY, clamp: animatedPosition(animatedSnapPoints[4]).clamp, enableOverDrag, animatedScrollableType, SCROLLABLE_TYPE: animatedPosition(animatedSnapPoints[1]).SCROLLABLE_TYPE, overDragResistanceFactor };
|
|
handleOnChange.__workletHash = 6221237616078;
|
|
handleOnChange.__initData = animatedScrollableContentOffsetY;
|
|
const items1 = [enableOverDrag, enablePanDownToClose, overDragResistanceFactor, isInTemporaryPosition, isScrollableRefreshable, animatedHighestSnapPoint, animatedContainerHeight, animatedSnapPoints, animatedPosition, animatedScrollableType, animatedScrollableContentOffsetY];
|
|
obj4.handleOnChange = obj7.useWorkletCallback(handleOnChange, items1);
|
|
const obj8 = { animatedHighestSnapPoint, isInTemporaryPosition, context: sharedValue, KEYBOARD_STATE: animatedPosition(animatedSnapPoints[1]).KEYBOARD_STATE, enablePanDownToClose, animatedContainerHeight, animatedSnapPoints, GESTURE_SOURCE: animatedPosition(animatedSnapPoints[1]).GESTURE_SOURCE, isScrollableRefreshable, animatedPosition, animatedScrollableContentOffsetY, clamp: animatedPosition(animatedSnapPoints[4]).clamp, enableOverDrag, animatedScrollableType, SCROLLABLE_TYPE: animatedPosition(animatedSnapPoints[1]).SCROLLABLE_TYPE, overDragResistanceFactor };
|
|
function handleOnEnd(arg0, translationY) {
|
|
({ absoluteY, velocityY } = translationY);
|
|
if (isInTemporaryPosition.value) {
|
|
if (sharedValue.value.initialPosition >= iter.value) {
|
|
if (iter3.value.initialPosition > iter.value) {
|
|
animateToPosition(iter3.value.initialPosition, tmp2(6729).ANIMATION_SOURCE.GESTURE, velocityY / 2);
|
|
}
|
|
}
|
|
}
|
|
if (animatedScrollableType.value !== value22.SCROLLABLE_TYPE.UNDETERMINED) {
|
|
value = iter4.value;
|
|
const VIEW = tmp2(6729).SCROLLABLE_TYPE.VIEW;
|
|
}
|
|
if (tmp5) {
|
|
tmp2(1636).runOnJS(dismiss)();
|
|
const tmp2Result = tmp2(1636);
|
|
}
|
|
if (isInTemporaryPosition.value) {
|
|
iter2.value = false;
|
|
}
|
|
value2 = animatedSnapPoints.value;
|
|
const substr = value2.slice();
|
|
if (enablePanDownToClose) {
|
|
substr.unshift(animatedClosedPosition.value);
|
|
}
|
|
iter4 = animatedScrollableType;
|
|
tmp5 = sharedValue.value.initialKeyboardState === value22.KEYBOARD_STATE.SHOWN && animatedPosition.value > sharedValue.value.initialPosition;
|
|
const snapPointResult = _mod6900.snapPoint(translationY.translationY + sharedValue.value.initialPosition, velocityY, substr);
|
|
if (snapPointResult !== animatedPosition.value) {
|
|
let tmp12 = arg0 === tmp2(6729).GESTURE_SOURCE.CONTENT;
|
|
if (tmp12) {
|
|
tmp12 = animatedScrollableContentOffsetY.value > 0;
|
|
}
|
|
if (tmp12) {
|
|
tmp12 = tmp;
|
|
}
|
|
if (!tmp12) {
|
|
animateToPosition(snapPointResult, tmp2(6729).ANIMATION_SOURCE.GESTURE, velocityY / 2);
|
|
}
|
|
}
|
|
}
|
|
const obj9 = animatedPosition(animatedSnapPoints[3]);
|
|
handleOnEnd.__closure = { animatedHighestSnapPoint, animatedPosition, GESTURE_SOURCE: animatedPosition(animatedSnapPoints[1]).GESTURE_SOURCE, isScrollableRefreshable, isInTemporaryPosition, context: sharedValue, animateToPosition, ANIMATION_SOURCE: animatedPosition(animatedSnapPoints[1]).ANIMATION_SOURCE, animatedScrollableType, SCROLLABLE_TYPE: animatedPosition(animatedSnapPoints[1]).SCROLLABLE_TYPE, KEYBOARD_STATE: animatedPosition(animatedSnapPoints[1]).KEYBOARD_STATE, Platform: animatedKeyboardState, WINDOW_HEIGHT: animatedPosition(animatedSnapPoints[1]).WINDOW_HEIGHT, animatedKeyboardHeight, runOnJS: animatedPosition(animatedSnapPoints[3]).runOnJS, dismissKeyboard: animatedScrollableType, animatedSnapPoints, enablePanDownToClose, animatedClosedPosition, snapPoint: animatedPosition(animatedSnapPoints[5]).snapPoint, animatedScrollableContentOffsetY };
|
|
handleOnEnd.__workletHash = 8667894097210;
|
|
handleOnEnd.__initData = enableOverDrag;
|
|
const items2 = [enablePanDownToClose, isInTemporaryPosition, isScrollableRefreshable, animatedClosedPosition, animatedHighestSnapPoint, animatedKeyboardHeight, animatedPosition, animatedScrollableType, animatedSnapPoints, animatedScrollableContentOffsetY, animateToPosition];
|
|
obj4.handleOnEnd = obj9.useWorkletCallback(handleOnEnd, items2);
|
|
const obj10 = { animatedHighestSnapPoint, animatedPosition, GESTURE_SOURCE: animatedPosition(animatedSnapPoints[1]).GESTURE_SOURCE, isScrollableRefreshable, isInTemporaryPosition, context: sharedValue, animateToPosition, ANIMATION_SOURCE: animatedPosition(animatedSnapPoints[1]).ANIMATION_SOURCE, animatedScrollableType, SCROLLABLE_TYPE: animatedPosition(animatedSnapPoints[1]).SCROLLABLE_TYPE, KEYBOARD_STATE: animatedPosition(animatedSnapPoints[1]).KEYBOARD_STATE, Platform: animatedKeyboardState, WINDOW_HEIGHT: animatedPosition(animatedSnapPoints[1]).WINDOW_HEIGHT, animatedKeyboardHeight, runOnJS: animatedPosition(animatedSnapPoints[3]).runOnJS, dismissKeyboard: animatedScrollableType, animatedSnapPoints, enablePanDownToClose, animatedClosedPosition, snapPoint: animatedPosition(animatedSnapPoints[5]).snapPoint, animatedScrollableContentOffsetY };
|
|
function handleOnFinalize() {
|
|
if (typeof fn === "function") {
|
|
closure_0 = tmp;
|
|
const _Object = Object;
|
|
const keys = Object.keys(tmp);
|
|
const mapped = keys.map((item) => {
|
|
closure_0[item] = undefined;
|
|
});
|
|
} else {
|
|
throw new TypeError("Trying to call a non-function");
|
|
}
|
|
}
|
|
handleOnFinalize.__closure = { resetContext: animatedHighestSnapPoint, context: sharedValue };
|
|
handleOnFinalize.__workletHash = 8824211868683;
|
|
handleOnFinalize.__initData = enablePanDownToClose;
|
|
const items3 = [sharedValue];
|
|
obj4.handleOnFinalize = animatedPosition(animatedSnapPoints[3]).useWorkletCallback(handleOnFinalize, items3);
|
|
return obj4;
|
|
};
|