decord/alpha/source/modules/safe_area/useSafeAreaInsetsKeyboardAware.native.tsx

187 lines
5.4 KiB
TypeScript
Raw Normal View History

2026-10-06 11:16:32 +00:00
// Module ID: 6478
// Function ID: 6479
2026-07-20 16:05:17 +00:00
// Name: useSafeAreaInsetsKeyboardAware
2026-10-06 11:16:32 +00:00
// Dependencies: [32, 19, 1486, 558, 576, 6479, 6480, 1618, 1487, 1369, 1884, 4753, 1616, 6481, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-10-06 11:16:32 +00:00
// Module 6478 (useSafeAreaInsetsKeyboardAware)
2026-10-03 08:58:59 +00:00
import PlatformUtils from "PlatformUtils" /* 1369 */;
import KeyboardTypes from "KeyboardTypes" /* 1616 */;
import useSystemKeyboardHeight from "useSystemKeyboardHeight" /* 1884 */;
2026-10-06 11:16:32 +00:00
import useKeyboardType from "useKeyboardType" /* 4753 */;
import useKeyboardDuration from "useKeyboardDuration" /* 6479 */;
import useCustomKeyboardHeight from "useCustomKeyboardHeight" /* 6481 */;
2026-10-03 08:58:59 +00:00
import _slicedToArray from "_slicedToArray" /* 32 */;
import react from "react" /* 19 */;
import subscribeToKeyboardUIStore from "subscribeToKeyboardUIStore" /* 1486 */;
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
let tmp;
2026-10-06 11:16:32 +00:00
const DeprecatedLayoutAnimation = tmp(6480);
2026-10-03 08:58:59 +00:00
let closure_6 = ReactCompilerGating.isReactCompilerEnabled() ? ((arg0) => {
let disabled;
let keyboardHeight;
let tmp2;
let obj = disabled(576);
const cResult = obj.c(5);
({ keyboardHeight, disabled } = arg0);
const ref = react.useRef(false);
const obj2 = react;
if (cResult[0] !== disabled) {
const fn = function o() {
const obj = useKeyboardDuration;
const keyboardDuration = obj.getKeyboardDuration();
const tmp4 = ref;
if (ref.current) {
if (0 !== keyboardDuration) {
const tmp5 = disabled;
if (!tmp5) {
const tmpResult = DeprecatedLayoutAnimation;
const result = tmpResult.DeprecatedLayoutAnimationKeyboard(keyboardDuration);
}
}
}
tmp4.current = true;
};
cResult[0] = disabled;
cResult[1] = fn;
tmp2 = fn;
} else {
tmp2 = cResult[1];
}
if (cResult[2] === disabled) {
let tmp3;
if (cResult[3] === keyboardHeight) {
tmp3 = cResult[4];
}
const effect = obj2.useEffect(tmp2, tmp3);
}
const items = [keyboardHeight, disabled];
cResult[2] = disabled;
cResult[3] = keyboardHeight;
cResult[4] = items;
tmp3 = items;
}) : ((disabled) => {
disabled = disabled.disabled;
const keyboardHeight = disabled.keyboardHeight;
const ref = react.useRef(false);
const items = [keyboardHeight, disabled];
const effect = react.useEffect(() => {
const obj = useKeyboardDuration;
const keyboardDuration = obj.getKeyboardDuration();
const tmp4 = ref;
if (ref.current) {
if (0 !== keyboardDuration) {
const tmp5 = disabled;
if (!tmp5) {
const tmpResult = DeprecatedLayoutAnimation;
const result = tmpResult.DeprecatedLayoutAnimationKeyboard(keyboardDuration);
}
}
}
tmp4.current = true;
}, items);
});
let result = size.fileFinishedImporting("modules/safe_area/useSafeAreaInsetsKeyboardAware.native.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default function useSafeAreaInsetsKeyboardAware() {
2026-10-03 08:58:59 +00:00
let c6;
let isAndroidResult;
let tmp8;
2026-07-29 08:29:29 +00:00
let obj = arg0;
if (arg0 === undefined) {
2026-07-20 16:05:17 +00:00
obj = {};
}
let flag = obj.isKeyboardAwareOnIOS;
if (flag === undefined) {
flag = true;
}
let flag2 = obj.isKeyboardAwareOnAndroid;
if (flag2 === undefined) {
flag2 = true;
}
let flag3 = obj.includeCustomKeyboardHeight;
if (flag3 === undefined) {
flag3 = true;
}
let flag4 = obj.includeKeyboardHeight;
if (flag4 === undefined) {
flag4 = false;
}
let callback;
2026-07-29 08:29:29 +00:00
c6 = undefined;
2026-10-03 08:58:59 +00:00
let tmp = flag3;
const tmp2 = flag2(flag3[7])();
let tmp3 = flag;
let obj2 = flag(flag3[8]);
const appEntryKey = obj2.useAppEntryKey();
2026-07-29 08:29:29 +00:00
const items = [appEntryKey, flag3, flag, flag2];
2026-07-23 10:11:24 +00:00
callback = callback.useCallback(() => {
2026-10-03 08:58:59 +00:00
const obj = PlatformUtils;
2026-07-20 16:05:17 +00:00
if (obj.isIOS()) {
2026-10-03 08:58:59 +00:00
const tmp3 = flag;
if (!tmp3) {
2026-07-20 16:05:17 +00:00
return 0;
}
}
2026-10-03 08:58:59 +00:00
const tmpResult = PlatformUtils;
2026-07-29 08:29:29 +00:00
if (tmpResult.isAndroid()) {
2026-10-03 08:58:59 +00:00
const tmp4 = flag2;
if (!tmp4) {
2026-07-20 16:05:17 +00:00
return 0;
}
}
2026-10-03 08:58:59 +00:00
const obj2 = { appEntryKey };
const tmpResult4 = useSystemKeyboardHeight;
let systemKeyboardHeight = tmpResult4.getSystemKeyboardHeight(obj2);
2026-07-20 16:05:17 +00:00
if (0 === systemKeyboardHeight) {
2026-10-03 08:58:59 +00:00
const tmpResult5 = useKeyboardType;
const keyboardType = tmpResult5.getKeyboardType(tmp5);
2026-07-29 08:29:29 +00:00
let num3 = 0;
2026-10-03 08:58:59 +00:00
if (keyboardType !== KeyboardTypes.KeyboardTypes.SYSTEM) {
2026-07-29 08:29:29 +00:00
num3 = 0;
2026-07-20 16:05:17 +00:00
if (flag3) {
2026-10-03 08:58:59 +00:00
const tmpResult6 = useCustomKeyboardHeight;
num3 = tmpResult6.getCustomKeyboardHeight(tmp5);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
systemKeyboardHeight = num3;
2026-07-20 16:05:17 +00:00
}
return systemKeyboardHeight;
}, items);
const ref = callback.useRef(callback());
2026-07-29 08:29:29 +00:00
[tmp8, c6] = appEntryKey(callback.useState(ref.current), 2);
2026-07-20 16:05:17 +00:00
const items1 = [callback, flag, flag2];
2026-10-03 08:58:59 +00:00
appEntryKey(callback.useState(ref.current), 2);
const effect = callback.useEffect(() => subscribeToKeyboardUIStore(() => {
2026-07-29 08:29:29 +00:00
const tmp = callback();
if (ref.current !== tmp) {
ref.current = tmp;
closure_1_6(tmp);
2026-07-20 16:05:17 +00:00
}
}), items1);
2026-10-03 08:58:59 +00:00
const obj3 = { keyboardHeight: tmp8, disabled: isAndroidResult };
isAndroidResult = !flag;
const tmp10 = c6;
2026-07-29 08:29:29 +00:00
if (flag) {
isAndroidResult = !flag4;
}
2026-07-20 16:05:17 +00:00
if (!isAndroidResult) {
2026-10-03 08:58:59 +00:00
const tmp3Result = tmp3(tmp[9]);
isAndroidResult = tmp3Result.isAndroid();
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
tmp10(obj3);
2026-07-29 08:29:29 +00:00
let num = 0;
2026-07-20 16:05:17 +00:00
if (flag4) {
2026-07-29 08:29:29 +00:00
num = tmp8;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let insets = tmp2;
if (tmp8 > 0) {
2026-10-03 08:58:59 +00:00
const obj4 = { bottom: num };
2026-07-29 08:29:29 +00:00
const merged = Object.assign(tmp2);
insets = obj4;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return { insets };
2026-07-20 16:05:17 +00:00
};