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

88 lines
3.9 KiB
TypeScript
Raw Normal View History

2026-08-03 11:20:01 +00:00
// Module ID: 11285
// Function ID: 11286
2026-07-20 16:05:17 +00:00
// Name: getChatInputMaxHeight
2026-08-04 08:36:32 +00:00
// Dependencies: [32, 19, 1476, 11281, 1847, 5313, 4151, 1579, 1474, 11286, 4286, 4289, 4146, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, getChatInputHeightAnimationTiming, getChatInputMinHeight
2026-08-03 11:20:01 +00:00
// Module 11285 (getChatInputMaxHeight)
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 subscribeToKeyboardUIStore from "subscribeToKeyboardUIStore";
import { CHAT_INPUT_PILL_CONTENT_SIZE as closure_6 } from "TextAreaCta";
const require = arg1;
2026-07-20 16:05:17 +00:00
function getChatInputMaxHeight() {
2026-07-29 08:29:29 +00:00
let systemKeyboardHeight = require(1847) /* useSystemKeyboardHeight */.getSystemKeyboardHeight();
const obj = require(1847) /* useSystemKeyboardHeight */;
const tmp = require;
2026-08-04 08:36:32 +00:00
const customKeyboardHeight = require(5313) /* useCustomKeyboardHeight */.getCustomKeyboardHeight();
const obj2 = require(5313) /* useCustomKeyboardHeight */;
const keyboardType = require(4151) /* useKeyboardType */.getKeyboardType();
2026-07-29 08:29:29 +00:00
if (keyboardType !== require(1579) /* KeyboardTypes */.KeyboardTypes.SYSTEM) {
2026-07-20 16:05:17 +00:00
systemKeyboardHeight = customKeyboardHeight;
}
2026-08-04 08:36:32 +00:00
const obj3 = require(4151) /* useKeyboardType */;
2026-07-29 08:29:29 +00:00
return Math.min(200, Math.max(2 * closure_6, tmp(1474).getWindowDimensions({ ignoreKeyboard: true }).height - systemKeyboardHeight - 200));
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const result = require("subscribeToKeyboardUIStore").fileFinishedImporting("modules/chat_input/native/useChatInputMaxHeight.tsx");
2026-07-20 16:05:17 +00:00
export default function useChatInputMaxHeight(arg0) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0;
let tmp = callback(React.useState(getChatInputMaxHeight), 2);
2026-07-20 16:05:17 +00:00
let closure_1 = tmp[1];
const items = [arg0];
const effect = React.useEffect(() => {
function maybeUpdateMaxHeight() {
callback2((arg0) => {
2026-07-29 08:29:29 +00:00
let systemKeyboardHeight = outer1_0(outer1_2[4]).getSystemKeyboardHeight();
const obj = outer1_0(outer1_2[4]);
const tmp = outer1_0;
const tmp2 = outer1_2;
const customKeyboardHeight = outer1_0(outer1_2[5]).getCustomKeyboardHeight();
const obj2 = outer1_0(outer1_2[5]);
const keyboardType = outer1_0(outer1_2[6]).getKeyboardType();
if (keyboardType !== outer1_0(outer1_2[7]).KeyboardTypes.SYSTEM) {
systemKeyboardHeight = customKeyboardHeight;
}
let tmp6 = arg0;
const obj3 = outer1_0(outer1_2[6]);
const bound = Math.min(200, Math.max(2 * outer1_6, tmp(tmp2[8]).getWindowDimensions({ ignoreKeyboard: true }).height - systemKeyboardHeight - 200));
if (arg0 !== bound) {
tmp6 = bound;
if (callback != null) {
2026-07-20 16:05:17 +00:00
callback();
2026-07-29 08:29:29 +00:00
tmp6 = bound;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
return tmp6;
2026-07-20 16:05:17 +00:00
});
}
2026-07-23 10:11:24 +00:00
let closure_0 = callback(outer1_2[9])(maybeUpdateMaxHeight);
callback = outer1_5(maybeUpdateMaxHeight);
2026-07-20 16:05:17 +00:00
return () => {
callback();
callback2();
};
}, items);
return tmp[0];
};
export function getChatInputMinHeight() {
return closure_6;
}
export { getChatInputMaxHeight };
export const getChatInputHeightAnimationTiming = function getChatInputHeightAnimationTiming(height) {
2026-07-29 08:29:29 +00:00
let obj = require(1847) /* useSystemKeyboardHeight */;
let systemKeyboardHeight = obj.getSystemKeyboardHeight();
2026-08-04 08:36:32 +00:00
const customKeyboardHeight = require(5313) /* useCustomKeyboardHeight */.getCustomKeyboardHeight();
const obj2 = require(5313) /* useCustomKeyboardHeight */;
const keyboardType = require(4151) /* useKeyboardType */.getKeyboardType();
2026-07-29 08:29:29 +00:00
if (keyboardType !== require(1579) /* KeyboardTypes */.KeyboardTypes.SYSTEM) {
systemKeyboardHeight = customKeyboardHeight;
}
let tmpResult = tmp(1474);
const bound = Math.min(height, Math.min(200, Math.max(2 * closure_6, tmpResult.getWindowDimensions({ ignoreKeyboard: true }).height - systemKeyboardHeight - 200)));
2026-08-04 08:36:32 +00:00
tmpResult = tmp(4286);
obj = { duration: tmp(4289).timingFastDuration, easing: tmp(4146).Easing.linear };
2026-07-29 08:29:29 +00:00
return tmpResult.withTiming(bound, obj);
2026-07-20 16:05:17 +00:00
};