decord/source/__polyfill/06xxx/module_6902.js
github-actions da5b5e5efe chore: update source for alpha 346.6
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-12 13:45:10 +00:00

101 lines
6.1 KiB
JavaScript

// Module ID: 6902
// Function ID: 6903
// Dependencies: [19, 17, 1636, 6729]
// Exports: useKeyboard
// Module 6902
import _mod19 from "module_19" /* 19 */;
import value22 from "value2" /* 6729 */;
import get_ActivityIndicator from "module_17" /* 17 */;
const useEffect = _mod19.useEffect;
({ Keyboard: c3, Platform } = get_ActivityIndicator);
const keyboardDidShow = "keyboardDidShow";
const keyboardDidHide = "keyboardDidHide";
let closure_6 = { code: "function pnpm_useKeyboardTs1(state,height,duration,easing,bottomOffset){const{KEYBOARD_STATE,shouldHandleKeyboardEvents,temporaryCachedKeyboardEvent,keyboardHeight,includeBottomOffset,keyboardAnimationDuration,keyboardAnimationEasing,keyboardState}=this.__closure;if(state===KEYBOARD_STATE.SHOWN&&!shouldHandleKeyboardEvents.value){temporaryCachedKeyboardEvent.value=[state,height,duration,easing];return;}keyboardHeight.value=state===KEYBOARD_STATE.SHOWN?height:keyboardHeight.value;if(bottomOffset&&includeBottomOffset){keyboardHeight.value=keyboardHeight.value+bottomOffset;}keyboardAnimationDuration.value=duration;keyboardAnimationEasing.value=easing;keyboardState.value=state;temporaryCachedKeyboardEvent.value=[];}" };
let closure_7 = { code: "function pnpm_useKeyboardTs2(){const{shouldHandleKeyboardEvents}=this.__closure;return shouldHandleKeyboardEvents.value;}" };
const __initData = { code: "function pnpm_useKeyboardTs3(result){const{temporaryCachedKeyboardEvent,handleKeyboardEvent}=this.__closure;const params=temporaryCachedKeyboardEvent.value;if(result&&params.length>0){handleKeyboardEvent(params[0],params[1],params[2],params[3]);}}" };
export const useKeyboard = (includeBottomOffset) => {
includeBottomOffset = includeBottomOffset.includeBottomOffset;
let shouldHandleKeyboardEvents;
shouldHandleKeyboardEvents = includeBottomOffset(shouldHandleKeyboardEvents[2]).useSharedValue(false);
let obj = includeBottomOffset(shouldHandleKeyboardEvents[2]);
const state = includeBottomOffset(shouldHandleKeyboardEvents[2]).useSharedValue(includeBottomOffset(shouldHandleKeyboardEvents[3]).KEYBOARD_STATE.UNDETERMINED);
const obj2 = includeBottomOffset(shouldHandleKeyboardEvents[2]);
const height = includeBottomOffset(shouldHandleKeyboardEvents[2]).useSharedValue(0);
const obj3 = includeBottomOffset(shouldHandleKeyboardEvents[2]);
const animationEasing = includeBottomOffset(shouldHandleKeyboardEvents[2]).useSharedValue("keyboard");
const obj4 = includeBottomOffset(shouldHandleKeyboardEvents[2]);
const animationDuration = includeBottomOffset(shouldHandleKeyboardEvents[2]).useSharedValue(500);
const obj5 = includeBottomOffset(shouldHandleKeyboardEvents[2]);
const sharedValue5 = includeBottomOffset(shouldHandleKeyboardEvents[2]).useSharedValue([]);
const obj6 = includeBottomOffset(shouldHandleKeyboardEvents[2]);
const fn = function v(value, arg1, value2, value3, arg4) {
value = arg1;
if (value === value22.KEYBOARD_STATE.SHOWN) {
if (!shouldHandleKeyboardEvents.value) {
const items = [value, value, value2, value3];
sharedValue5.value = items;
}
}
if (value !== value22.KEYBOARD_STATE.SHOWN) {
value = iter.value;
}
height.value = value;
let tmp5 = arg4;
if (arg4) {
tmp5 = includeBottomOffset;
}
if (tmp5) {
iter.value = iter.value + arg4;
}
animationDuration.value = value2;
animationEasing.value = value3;
state.value = value;
sharedValue5.value = [];
};
const obj7 = includeBottomOffset(shouldHandleKeyboardEvents[2]);
fn.__closure = { KEYBOARD_STATE: includeBottomOffset(shouldHandleKeyboardEvents[3]).KEYBOARD_STATE, shouldHandleKeyboardEvents, temporaryCachedKeyboardEvent: sharedValue5, keyboardHeight: height, includeBottomOffset, keyboardAnimationDuration: animationDuration, keyboardAnimationEasing: animationEasing, keyboardState: state };
fn.__workletHash = 7905199978020;
fn.__initData = sharedValue5;
const workletCallback = obj7.useWorkletCallback(fn, []);
let items = [workletCallback];
state(() => {
closure_0 = height.addListener(animationEasing, (endCoordinates) => {
const obj = includeBottomOffset(shouldHandleKeyboardEvents[2]);
({ duration, easing } = endCoordinates);
includeBottomOffset(shouldHandleKeyboardEvents[2]).runOnUI(workletCallback)(includeBottomOffset(shouldHandleKeyboardEvents[3]).KEYBOARD_STATE.SHOWN, endCoordinates.endCoordinates.height, duration, easing, includeBottomOffset(shouldHandleKeyboardEvents[3]).SCREEN_HEIGHT - endCoordinates.endCoordinates.height - endCoordinates.endCoordinates.screenY);
});
closure_1 = height.addListener(animationDuration, (endCoordinates) => {
const obj = includeBottomOffset(shouldHandleKeyboardEvents[2]);
includeBottomOffset(shouldHandleKeyboardEvents[2]).runOnUI(workletCallback)(includeBottomOffset(shouldHandleKeyboardEvents[3]).KEYBOARD_STATE.HIDDEN, endCoordinates.endCoordinates.height, endCoordinates.duration, endCoordinates.easing);
});
return () => {
closure_0.remove();
closure_1.remove();
};
}, items);
const obj8 = { KEYBOARD_STATE: includeBottomOffset(shouldHandleKeyboardEvents[3]).KEYBOARD_STATE, shouldHandleKeyboardEvents, temporaryCachedKeyboardEvent: sharedValue5, keyboardHeight: height, includeBottomOffset, keyboardAnimationDuration: animationDuration, keyboardAnimationEasing: animationEasing, keyboardState: state };
const fn2 = function b() {
return shouldHandleKeyboardEvents.value;
};
fn2.__closure = { shouldHandleKeyboardEvents };
fn2.__workletHash = 11615500623565;
fn2.__initData = workletCallback;
const fn3 = function y(arg0) {
let tmp = arg0;
value = sharedValue5.value;
if (arg0) {
tmp = value.length > 0;
}
if (tmp) {
workletCallback(value[0], value[1], value[2], value[3]);
}
};
fn3.__closure = { temporaryCachedKeyboardEvent: sharedValue5, handleKeyboardEvent: workletCallback };
fn3.__workletHash = 16636741173520;
fn3.__initData = __initData;
const animatedReaction = includeBottomOffset(shouldHandleKeyboardEvents[2]).useAnimatedReaction(fn2, fn3, []);
return { state, height, animationEasing, animationDuration, shouldHandleKeyboardEvents };
};