114 lines
6.4 KiB
TypeScript
114 lines
6.4 KiB
TypeScript
/* Metro module 5467; source: modules/keyboard/native/KeyboardAwareView.tsx; dependencies: [57, 31, 27, 1480, 33, 1851, 4022, 1583, 5466, 5464, 5465, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import SubscribeToKeyboardUIStore from './subscribeToKeyboardUIStore.tsx'; /* Metro dependency 1480 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as UseSystemKeyboardHeightNativeModule from './useSystemKeyboardHeight.native.tsx'; /* Metro dependency 1851 */
|
|
|
|
function _fun48049(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#48049, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5645:6, offset: 0x011d8449, size: 218 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
value = value.memo(KeyboardAwareView);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/keyboard/native/KeyboardAwareView.tsx');
|
|
exports.default = value;
|
|
function getKeyboardHeightWithOffset(a0) { // fn#48050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5645:174, offset: 0x011d8523, size: 162 bytes, params: 2, frame: 19
|
|
var r0;
|
|
var r4;
|
|
const Math = global.Math;
|
|
const max = Math.max;
|
|
var value;
|
|
const systemKeyboardHeight = (UseSystemKeyboardHeightNativeModule).getSystemKeyboardHeight();
|
|
const value3 = 0;
|
|
if (value3 !== systemKeyboardHeight) {
|
|
r4 = systemKeyboardHeight;
|
|
} else {
|
|
if ((require(4022) /* metro dependency 4022: useKeyboardType */).getKeyboardType() === (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes.SYSTEM) {
|
|
r0 = value3;
|
|
} else {
|
|
value = require(5466) /* metro dependency 5466: useCustomKeyboardHeight */;
|
|
value = value.getCustomKeyboardHeight();
|
|
r0 = value;
|
|
}
|
|
r4 = r0;
|
|
}
|
|
return Reflect.apply(max, Math, [value3, r4 + a0]);
|
|
}
|
|
|
|
function KeyboardAwareView({style, children, pointerEvents, animated, keyboardHeightOffset}) { // fn#48051, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5645:429, offset: 0x011d85c5, size: 283 bytes, params: 2, frame: 21
|
|
animated = animated === undefined || animated;
|
|
keyboardHeightOffset = keyboardHeightOffset === undefined ? 0 : keyboardHeightOffset;
|
|
const keyboardHeightOffset2 = keyboardHeightOffset;
|
|
const binding = undefined;
|
|
const value2 = binding.useRef(getKeyboardHeightWithOffset(keyboardHeightOffset));
|
|
const useState = binding.useState;
|
|
const value4 = keyboardHeightOffset2(Reflect.apply(useState, binding, [value2.current]), 2);
|
|
const property = value4[0];
|
|
const env0_5 = value4[1];
|
|
binding.useEffect(function() {
|
|
return SubscribeToKeyboardUIStore(_fun48053);
|
|
}, [keyboardHeightOffset]);
|
|
const env0_6 = binding.useRef(false);
|
|
binding.useEffect(_fun48054, [animated, property]);
|
|
return (
|
|
<View style={binding.useMemo(_fun48055, [property, style])} pointerEvents={pointerEvents}>
|
|
{children}
|
|
</View>
|
|
);
|
|
function _fun48052() { // fn#48052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5645:640, offset: 0x011d86e0, size: 23 bytes, params: 1, frame: 11
|
|
return SubscribeToKeyboardUIStore(_fun48053);
|
|
function _fun48053() { // fn#48053, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5645:647, offset: 0x011d86f7, size: 55 bytes, params: 1, frame: 12
|
|
const keyboardHeightWithOffset = getKeyboardHeightWithOffset(keyboardHeightOffset);
|
|
if (env1_3.current !== keyboardHeightWithOffset) {
|
|
env1_3.current = keyboardHeightWithOffset;
|
|
env1_5(keyboardHeightWithOffset);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function _fun48054() { // fn#48054, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5645:764, offset: 0x011d872e, size: 115 bytes, params: 1, frame: 13
|
|
var value2;
|
|
var keyboardDuration;
|
|
if (env0_6.current) {
|
|
value2 = environment.__proto__;
|
|
keyboardDuration = (require(5464) /* metro dependency 5464: useKeyboardDuration */).getKeyboardDuration();
|
|
if (animated && keyboardDuration > 0) {
|
|
(require(5465) /* metro dependency 5465: DeprecatedLayoutAnimation */).DeprecatedLayoutAnimationKeyboard(keyboardDuration);
|
|
}
|
|
} else {
|
|
env0_6.current = true;
|
|
}
|
|
}
|
|
|
|
function _fun48055() { // fn#48055, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5645:917, offset: 0x011d87a1, size: 129 bytes, params: 1, frame: 14
|
|
var r0;
|
|
var object;
|
|
if (style == null) {
|
|
return {marginBottom: ReactNativeModule.View};
|
|
}
|
|
const value3 = StyleSheet.flatten(style);
|
|
if (typeof value3.marginBottom === 'number') {
|
|
object = {};
|
|
copyDataProperties(object, value3, undefined);
|
|
object['marginBottom'] = value3.marginBottom + ReactNativeModule.View;
|
|
r0 = object;
|
|
} else {
|
|
object = {};
|
|
copyDataProperties(object, value3, undefined);
|
|
object['marginBottom'] = ReactNativeModule.View;
|
|
r0 = object;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun48049, 5467, [57, 31, 27, 1480, 33, 1851, 4022, 1583, 5466, 5464, 5465,
|
|
2]) /* metro module 5467, dependencies: [57, 31, 27, 1480, 33, 1851, 4022, 1583, 5466, 5464, 5465, 2] */;
|