Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
123 lines
3.6 KiB
TypeScript
123 lines
3.6 KiB
TypeScript
// Module ID: 7258
|
|
// Function ID: 7259
|
|
// Name: useSafeAreaInsetsKeyboardAware
|
|
// Dependencies: [32, 19, 1480, 5829, 5830, 1612, 1481, 1364, 1878, 4656, 1610, 5828, 2]
|
|
// Exports: default
|
|
|
|
// Module 7258 (useSafeAreaInsetsKeyboardAware)
|
|
import PlatformUtils from "PlatformUtils" /* 1364 */;
|
|
import useSystemKeyboardHeight from "useSystemKeyboardHeight" /* 1878 */;
|
|
import useKeyboardDuration from "useKeyboardDuration" /* 5829 */;
|
|
import DeprecatedLayoutAnimation from "DeprecatedLayoutAnimation" /* 5830 */;
|
|
import _slicedToArray from "module_32" /* 32 */;
|
|
import noop from "module_19" /* 19 */;
|
|
import subscribeToKeyboardUIStore from "subscribeToKeyboardUIStore" /* 1480 */;
|
|
|
|
require = fn;
|
|
const size = fn(2);
|
|
let result = size.fileFinishedImporting("modules/safe_area/useSafeAreaInsetsKeyboardAware.native.tsx");
|
|
|
|
export default function useSafeAreaInsetsKeyboardAware() {
|
|
let obj = arg0;
|
|
if (arg0 === undefined) {
|
|
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;
|
|
c6 = undefined;
|
|
const tmp2 = flag2(flag3[5])();
|
|
const appEntryKey = flag(flag3[6]).useAppEntryKey();
|
|
const items = [appEntryKey, flag3, flag, flag2];
|
|
callback = callback.useCallback(() => {
|
|
if (obj.isIOS()) {
|
|
if (!flag) {
|
|
return 0;
|
|
}
|
|
}
|
|
obj = PlatformUtils;
|
|
if (tmpResult.isAndroid()) {
|
|
if (!flag2) {
|
|
return 0;
|
|
}
|
|
}
|
|
tmpResult = PlatformUtils;
|
|
let systemKeyboardHeight = useSystemKeyboardHeight.getSystemKeyboardHeight({ appEntryKey });
|
|
if (0 === systemKeyboardHeight) {
|
|
const keyboardType = tmp(4656).getKeyboardType(tmp5);
|
|
let num3 = 0;
|
|
if (keyboardType !== tmp(1610).KeyboardTypes.SYSTEM) {
|
|
num3 = 0;
|
|
if (flag3) {
|
|
num3 = tmp(5828).getCustomKeyboardHeight(tmp5);
|
|
const tmpResult6 = tmp(5828);
|
|
}
|
|
}
|
|
systemKeyboardHeight = num3;
|
|
const tmpResult5 = tmp(4656);
|
|
}
|
|
return systemKeyboardHeight;
|
|
}, items);
|
|
const ref = callback.useRef(callback());
|
|
const obj2 = flag(flag3[6]);
|
|
let tmp = flag3;
|
|
const tmp3 = flag;
|
|
[tmp8, c6] = appEntryKey(callback.useState(ref.current), 2);
|
|
const items1 = [callback, flag, flag2];
|
|
const effect = callback.useEffect(() => subscribeToKeyboardUIStore(() => {
|
|
const tmp = callback();
|
|
if (ref.current !== tmp) {
|
|
ref.current = tmp;
|
|
closure_1_6(tmp);
|
|
}
|
|
}), items1);
|
|
let isAndroidResult = !flag;
|
|
if (flag) {
|
|
isAndroidResult = !flag4;
|
|
}
|
|
if (!isAndroidResult) {
|
|
isAndroidResult = tmp3(tmp[7]).isAndroid();
|
|
const tmp3Result = tmp3(tmp[7]);
|
|
}
|
|
closure_129_0 = isAndroidResult;
|
|
closure_129_1 = obj3.useRef(false);
|
|
const items2 = [tmp8, isAndroidResult];
|
|
const effect1 = obj3.useEffect(() => {
|
|
const keyboardDuration = useKeyboardDuration.getKeyboardDuration();
|
|
if (flag2.current) {
|
|
if (0 !== keyboardDuration) {
|
|
if (!flag) {
|
|
const result = DeprecatedLayoutAnimation.DeprecatedLayoutAnimationKeyboard(keyboardDuration);
|
|
const tmpResult = DeprecatedLayoutAnimation;
|
|
}
|
|
}
|
|
}
|
|
flag2.current = true;
|
|
}, items2);
|
|
let num = 0;
|
|
if (flag4) {
|
|
num = tmp8;
|
|
}
|
|
let insets = tmp2;
|
|
if (tmp8 > 0) {
|
|
const obj4 = {};
|
|
const merged = Object.assign(tmp2);
|
|
obj4.bottom = num;
|
|
insets = obj4;
|
|
}
|
|
return { insets };
|
|
};
|