decord/alpha/source/modules/keyboard/native/KeyboardAwareView.tsx

119 lines
3.8 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 6727
// Function ID: 6728
// Name: KeyboardAwareView
2026-10-09 10:00:15 +00:00
// Dependencies: [32, 19, 17, 1499, 21, 1897, 4948, 1629, 6666, 6664, 6665, 2]
2026-07-20 16:05:17 +00:00
2026-10-09 10:00:15 +00:00
// Module 6727 (KeyboardAwareView)
2026-10-03 08:58:59 +00:00
import Fragment from "Fragment" /* 21 */;
2026-10-09 10:00:15 +00:00
import useKeyboardDuration from "useKeyboardDuration" /* 6664 */;
2026-10-03 08:58:59 +00:00
import _slicedToArray from "_slicedToArray" /* 32 */;
import react from "react" /* 19 */;
import react_native from "react-native" /* 17 */;
2026-10-09 10:00:15 +00:00
import subscribeToKeyboardUIStore from "subscribeToKeyboardUIStore" /* 1499 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
let closure_4;
let hasOwnProperty;
({ View: closure_4, StyleSheet: hasOwnProperty } = react_native);
const jsx = Fragment.jsx;
const memoResult = react.memo(function KeyboardAwareView(style) {
let children;
let pointerEvents;
2026-07-20 16:05:17 +00:00
style = style.style;
let flag = style.animated;
({ children, pointerEvents } = style);
if (flag === undefined) {
flag = true;
}
let num = style.keyboardHeightOffset;
if (num === undefined) {
num = 0;
}
let marginBottom;
2026-10-03 08:58:59 +00:00
let closure_5;
let ref;
2026-10-03 08:58:59 +00:00
let obj = ref;
let tmp = style;
let tmp2 = flag;
const useRef = ref.useRef;
let _Math = Math;
const obj2 = style(flag[5]);
let systemKeyboardHeight = obj2.getSystemKeyboardHeight();
2026-07-29 08:29:29 +00:00
if (0 === systemKeyboardHeight) {
2026-10-03 08:58:59 +00:00
const tmpResult = tmp(tmp2[6]);
let keyboardType = tmpResult.getKeyboardType();
2026-07-29 08:29:29 +00:00
let num2 = 0;
if (keyboardType !== tmp(tmp2[7]).KeyboardTypes.SYSTEM) {
const tmpResult2 = tmp(tmp2[8]);
2026-10-03 08:58:59 +00:00
num2 = tmpResult2.getCustomKeyboardHeight();
2026-07-29 08:29:29 +00:00
}
systemKeyboardHeight = num2;
}
2026-10-03 08:58:59 +00:00
ref = useRef(max(0, systemKeyboardHeight + num));
const tmp6 = num(obj.useState(ref.current), 2);
marginBottom = tmp6[0];
2026-07-29 08:29:29 +00:00
closure_5 = tmp6[1];
2026-07-20 16:05:17 +00:00
const items = [num];
2026-10-08 09:57:35 +00:00
const effect = obj.useEffect(() => subscribeToKeyboardUIStore(function keyboardHeightUpdater() {
2026-10-03 08:58:59 +00:00
const _Math = Math;
const obj = style(flag[5]);
let systemKeyboardHeight = obj.getSystemKeyboardHeight();
const tmp = closure_1_2;
2026-07-29 08:29:29 +00:00
if (0 === systemKeyboardHeight) {
2026-10-03 08:58:59 +00:00
const tmp2Result = style(flag[6]);
const keyboardType = tmp2Result.getKeyboardType();
2026-08-24 06:08:38 +00:00
num = 0;
2026-10-03 08:58:59 +00:00
if (keyboardType !== style(flag[7]).KeyboardTypes.SYSTEM) {
const tmp2Result2 = style(flag[8]);
num = tmp2Result2.getCustomKeyboardHeight();
2026-07-29 08:29:29 +00:00
}
systemKeyboardHeight = num;
}
2026-10-03 08:58:59 +00:00
const maxResult = max(0, systemKeyboardHeight + tmp);
if (ref.current !== maxResult) {
ref.current = maxResult;
closure_1_5(maxResult);
2026-07-20 16:05:17 +00:00
}
}), items);
ref = obj.useRef(false);
const items1 = [flag, marginBottom];
2026-07-29 08:29:29 +00:00
const effect1 = obj.useEffect(() => {
2026-07-20 16:05:17 +00:00
if (ref.current) {
2026-10-03 08:58:59 +00:00
const obj = useKeyboardDuration;
const keyboardDuration = obj.getKeyboardDuration();
2026-07-20 16:05:17 +00:00
let tmp5 = flag;
2026-10-03 08:58:59 +00:00
const tmp2 = require;
if (tmp5) {
2026-07-20 16:05:17 +00:00
tmp5 = keyboardDuration > 0;
}
if (tmp5) {
2026-10-09 10:00:15 +00:00
const tmp2Result = tmp2(6665);
2026-10-03 08:58:59 +00:00
const result = tmp2Result.DeprecatedLayoutAnimationKeyboard(keyboardDuration);
2026-07-20 16:05:17 +00:00
}
} else {
2026-07-29 08:29:29 +00:00
tmp.current = true;
2026-07-20 16:05:17 +00:00
}
}, items1);
const items2 = [marginBottom, style];
2026-10-03 08:58:59 +00:00
return <marginBottom style={obj.useMemo(() => {
2026-07-20 16:05:17 +00:00
if (null == style) {
2026-10-03 08:58:59 +00:00
return { marginBottom };
2026-07-20 16:05:17 +00:00
} else {
2026-10-03 08:58:59 +00:00
let obj3;
const flattenResult = hasOwnProperty.flatten(tmp);
2026-08-04 21:03:28 +00:00
if (typeof flattenResult.marginBottom === "number") {
2026-10-03 08:58:59 +00:00
const obj = { marginBottom: flattenResult.marginBottom + marginBottom };
2026-07-20 16:05:17 +00:00
const merged = Object.assign(flattenResult);
2026-10-03 08:58:59 +00:00
obj3 = obj;
2026-07-20 16:05:17 +00:00
} else {
2026-10-03 08:58:59 +00:00
obj3 = { marginBottom };
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(flattenResult);
}
return obj3;
2026-07-20 16:05:17 +00:00
}
}, items2)} pointerEvents={pointerEvents}>{children}</marginBottom>;
2026-07-20 16:05:17 +00:00
});
2026-10-03 08:58:59 +00:00
let result = size.fileFinishedImporting("modules/keyboard/native/KeyboardAwareView.tsx");
export default memoResult;