decord/source/modules/chat_input/native/FloatingChatInputContainer.tsx

102 lines
3.2 KiB
TypeScript
Raw Normal View History

2026-08-13 07:00:46 +00:00
// Module ID: 11420
// Function ID: 11421
2026-08-03 11:20:01 +00:00
// Name: useKeyboardOpenPaddingStyle
2026-08-13 07:00:46 +00:00
// Dependencies: [32, 19, 21, 4083, 4065, 712, 1642, 4207, 1626, 4343, 4346, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-13 07:00:46 +00:00
// Module 11420 (useKeyboardOpenPaddingStyle)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
2026-07-29 08:29:29 +00:00
import noop from "noop";
2026-07-23 10:11:24 +00:00
import { jsx } from "jsxProd";
2026-08-12 06:57:52 +00:00
import { Easing } from "module_4083";
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-03 11:20:01 +00:00
function useKeyboardOpenPaddingStyle() {
2026-07-29 08:29:29 +00:00
let importDefault;
2026-08-03 11:20:01 +00:00
let tmp5;
2026-08-12 06:57:52 +00:00
token = token(4065).useToken(importDefault(712).modules.mobile.CHAT_INPUT_FLOATING_CONTENT_PADDING_VERTICAL);
let obj = token(4065);
2026-07-29 08:29:29 +00:00
const obj2 = React;
2026-08-03 11:20:01 +00:00
[tmp5, importDefault] = sharedValue(React.useState(() => {
const KeyboardController = token(tmp5[6]).KeyboardController;
2026-07-29 08:29:29 +00:00
const stateResult = KeyboardController.state();
let num;
if (stateResult != null) {
num = stateResult.height;
}
if (num == null) {
num = 0;
}
return num > 0;
}), 2);
const effect = React.useEffect(() => {
2026-08-03 11:20:01 +00:00
const KeyboardEvents = token(tmp5[6]).KeyboardEvents;
2026-07-29 08:29:29 +00:00
let closure_0 = KeyboardEvents.addListener("keyboardWillShow", () => lib(true));
2026-08-03 11:20:01 +00:00
const KeyboardEvents2 = token(tmp5[6]).KeyboardEvents;
2026-07-29 08:29:29 +00:00
let closure_1 = KeyboardEvents2.addListener("keyboardWillHide", () => lib(false));
return () => {
closure_0.remove();
lib.remove();
};
}, []);
2026-08-03 11:20:01 +00:00
const tmp4 = sharedValue(React.useState(() => {
const KeyboardController = token(tmp5[6]).KeyboardController;
2026-07-29 08:29:29 +00:00
const stateResult = KeyboardController.state();
let num;
if (stateResult != null) {
num = stateResult.height;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num == null) {
num = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return num > 0;
}), 2);
2026-08-13 07:00:46 +00:00
const obj3 = token(4207);
2026-08-03 11:20:01 +00:00
if (!tmp5) {
2026-08-11 06:20:06 +00:00
tmp5 = true === obj3.useKeyboardContextForType(token(1626).KeyboardTypes.SYSTEM).keyboardWillOpen;
2026-07-29 08:29:29 +00:00
}
2026-08-03 11:20:01 +00:00
if (!tmp5) {
2026-08-11 06:20:06 +00:00
tmp5 = tmp7 !== token(1626).KeyboardTypes.SYSTEM;
2026-07-29 08:29:29 +00:00
}
2026-08-03 11:20:01 +00:00
const dependencyMap = tmp5;
2026-08-12 06:57:52 +00:00
let tmpResult = tmp(4083);
2026-07-29 08:29:29 +00:00
let num = 0;
2026-08-03 11:20:01 +00:00
if (tmp5) {
2026-07-29 08:29:29 +00:00
num = token;
}
sharedValue = tmpResult.useSharedValue(num);
2026-08-03 11:20:01 +00:00
const items = [tmp5, token, sharedValue];
2026-07-29 08:29:29 +00:00
const effect1 = obj2.useEffect(() => {
2026-08-03 11:20:01 +00:00
let obj = token(tmp5[9]);
2026-07-20 16:05:17 +00:00
let num = 0;
2026-08-03 11:20:01 +00:00
if (tmp5) {
2026-07-20 16:05:17 +00:00
num = token;
}
2026-08-03 11:20:01 +00:00
obj = { duration: token(tmp5[10]).timingStandardDuration, easing: outer1_6 };
2026-07-29 08:29:29 +00:00
const result = sharedValue.set(obj.withTiming(num, obj));
}, items);
2026-08-12 06:57:52 +00:00
tmpResult = tmp(4083);
2026-08-03 11:20:01 +00:00
const fn = function b() {
return { paddingBottom: sharedValue.get() };
};
fn.__closure = { paddingSV: sharedValue };
fn.__workletHash = 5673482424037;
fn.__initData = closure_7;
return tmpResult.useAnimatedStyle(fn);
}
let closure_6 = Easing.bezier(0.2, 0, 0, 1);
let closure_7 = { code: "function FloatingChatInputContainerTsx1(){const{paddingSV}=this.__closure;return{paddingBottom:paddingSV.get()};}" };
let result = require("jsxProd").fileFinishedImporting("modules/chat_input/native/FloatingChatInputContainer.tsx");
export default function FloatingChatInputContainer(arg0) {
let children;
let onLayout;
let style;
({ style, onLayout, children } = arg0);
2026-07-29 08:29:29 +00:00
style = [, ];
style[0] = style;
2026-08-03 11:20:01 +00:00
style[1] = useKeyboardOpenPaddingStyle();
2026-08-12 06:57:52 +00:00
return jsx(importDefault(4083).View, { style, onLayout, children });
2026-07-20 16:05:17 +00:00
};
2026-08-03 11:20:01 +00:00
export { useKeyboardOpenPaddingStyle };