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

101 lines
3.3 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 5585
2026-07-25 08:10:48 +00:00
// Function ID: 47420
2026-07-20 16:05:17 +00:00
// Name: getKeyboardHeightWithOffset
2026-07-25 08:10:48 +00:00
// Dependencies: [57, 31, 27, 1452, 33, 1823, 3997, 1555, 5162, 5160, 5161, 2]
2026-07-20 16:05:17 +00:00
2026-07-24 07:16:23 +00:00
// Module 5585 (getKeyboardHeightWithOffset)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
import importAllResult from "result";
import get_ActivityIndicator from "get ActivityIndicator";
import subscribeToKeyboardUIStore from "subscribeToKeyboardUIStore";
import { jsx } from "jsxProd";
let closure_4;
let closure_5;
const require = arg1;
2026-07-20 16:05:17 +00:00
function getKeyboardHeightWithOffset(style) {
2026-07-23 10:11:24 +00:00
let systemKeyboardHeight = require(1823) /* useSystemKeyboardHeight */.getSystemKeyboardHeight();
2026-07-20 16:05:17 +00:00
if (0 === systemKeyboardHeight) {
2026-07-25 08:10:48 +00:00
const keyboardType = require(3997) /* getKeyboardContextForType */.getKeyboardType();
2026-07-20 16:05:17 +00:00
let num3 = 0;
2026-07-23 10:11:24 +00:00
if (keyboardType !== require(1555) /* KeyboardTypes */.KeyboardTypes.SYSTEM) {
2026-07-25 08:10:48 +00:00
num3 = require(5162) /* useCustomKeyboardHeight */.getCustomKeyboardHeight();
const obj3 = require(5162) /* useCustomKeyboardHeight */;
2026-07-20 16:05:17 +00:00
}
systemKeyboardHeight = num3;
2026-07-25 08:10:48 +00:00
const obj2 = require(3997) /* getKeyboardContextForType */;
2026-07-20 16:05:17 +00:00
}
return Math.max(0, systemKeyboardHeight + style);
}
2026-07-23 10:11:24 +00:00
({ View: closure_4, StyleSheet: closure_5 } = get_ActivityIndicator);
2026-07-20 16:05:17 +00:00
const memoResult = importAllResult.memo(function KeyboardAwareView(style) {
let children;
let pointerEvents;
style = style.style;
let flag = style.animated;
({ children, pointerEvents } = style);
if (flag === undefined) {
flag = true;
}
let num = style.keyboardHeightOffset;
if (num === undefined) {
num = 0;
}
2026-07-23 10:11:24 +00:00
let ref;
2026-07-20 16:05:17 +00:00
let first;
let closure_5;
2026-07-23 10:11:24 +00:00
let subscribeToKeyboardUIStore;
ref = ref.useRef(getKeyboardHeightWithOffset(num));
const tmp2 = num(ref.useState(ref.current), 2);
2026-07-20 16:05:17 +00:00
first = tmp2[0];
closure_5 = tmp2[1];
const items = [num];
2026-07-23 10:11:24 +00:00
const effect = ref.useEffect(() => ref(() => {
const tmp = outer2_8(outer1_2);
if (outer1_3.current !== tmp) {
outer1_3.current = tmp;
outer1_5(tmp);
2026-07-20 16:05:17 +00:00
}
}), items);
2026-07-23 10:11:24 +00:00
subscribeToKeyboardUIStore = ref.useRef(false);
2026-07-20 16:05:17 +00:00
const items1 = [flag, first];
2026-07-23 10:11:24 +00:00
const effect1 = ref.useEffect(() => {
2026-07-20 16:05:17 +00:00
if (ref.current) {
const keyboardDuration = style(flag[9]).getKeyboardDuration();
let tmp5 = flag;
if (flag) {
tmp5 = keyboardDuration > 0;
}
if (tmp5) {
const result = style(flag[10]).DeprecatedLayoutAnimationKeyboard(keyboardDuration);
const obj2 = style(flag[10]);
}
const obj = style(flag[9]);
} else {
ref.current = true;
}
}, items1);
const items2 = [first, style];
2026-07-23 10:11:24 +00:00
return <first style={ref.useMemo(() => {
2026-07-20 16:05:17 +00:00
if (null == style) {
let obj = { marginBottom: first };
return obj;
} else {
const flattenResult = closure_5.flatten(style);
if ("number" === typeof flattenResult.marginBottom) {
obj = {};
const merged = Object.assign(flattenResult);
obj["marginBottom"] = flattenResult.marginBottom + first;
} else {
obj = {};
const merged1 = Object.assign(flattenResult);
obj["marginBottom"] = first;
}
return obj;
}
}, items2)} pointerEvents={pointerEvents}>{children}</first>;
});
2026-07-23 10:11:24 +00:00
let result = require("get ActivityIndicator").fileFinishedImporting("modules/keyboard/native/KeyboardAwareView.tsx");
2026-07-20 16:05:17 +00:00
export default memoResult;