201 lines
11 KiB
TypeScript
201 lines
11 KiB
TypeScript
/* Metro module 5463; source: modules/safe_area/useSafeAreaInsetsKeyboardAware.native.tsx; dependencies: [57, 31, 1480, 5464, 5465, 1585, 1481, 477, 1851, 4022, 1583, 5466, 2] */
|
|
import Module00057 from '../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import SubscribeToKeyboardUIStore from '../keyboard/native/subscribeToKeyboardUIStore.tsx'; /* Metro dependency 1480 */
|
|
import UseSafeAreaInsetsNative from './useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as PlatformUtilsModule from '../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
|
|
import * as AppEntryKeyContextModule from '../window/native/AppEntryKeyContext.tsx'; /* Metro dependency 1481 */
|
|
import * as KeyboardTypesModule from '../keyboard/native/KeyboardTypes.tsx'; /* Metro dependency 1583 */
|
|
import * as UseKeyboardDurationModule from '../keyboard/native/useKeyboardDuration.tsx'; /* Metro dependency 5464 */
|
|
|
|
function _fun48033(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#48033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5641:6, offset: 0x011d7c60, size: 151 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/safe_area/useSafeAreaInsetsKeyboardAware.native.tsx');
|
|
exports.default = useSafeAreaInsetsKeyboardAware;
|
|
function useSafeAreaInsetsKeyboardAware() { // fn#48034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5641:230, offset: 0x011d7cf7, size: 398 bytes, params: 1, frame: 22
|
|
var object2;
|
|
var r1;
|
|
var object;
|
|
let value = a0;
|
|
const r0 = value !== undefined ? value : {};
|
|
let isKeyboardAwareOnIOS = r0.isKeyboardAwareOnIOS;
|
|
isKeyboardAwareOnIOS = isKeyboardAwareOnIOS === undefined || isKeyboardAwareOnIOS;
|
|
let isKeyboardAwareOnAndroid = r0.isKeyboardAwareOnAndroid;
|
|
isKeyboardAwareOnAndroid = isKeyboardAwareOnAndroid === undefined || isKeyboardAwareOnAndroid;
|
|
let includeCustomKeyboardHeight = r0.includeCustomKeyboardHeight;
|
|
includeCustomKeyboardHeight = includeCustomKeyboardHeight === undefined || includeCustomKeyboardHeight;
|
|
let includeKeyboardHeight = r0.includeKeyboardHeight;
|
|
includeKeyboardHeight = !(includeKeyboardHeight === undefined) && includeKeyboardHeight;
|
|
const env0_4 = undefined;
|
|
const value2 = (UseSafeAreaInsetsNative)();
|
|
const value3 = (AppEntryKeyContextModule).useAppEntryKey();
|
|
const env0_3 = value3;
|
|
const binding = env0_4;
|
|
const value4 = binding.useCallback(_fun48035, [value3, includeCustomKeyboardHeight, isKeyboardAwareOnIOS,
|
|
isKeyboardAwareOnAndroid]);
|
|
const value5 = binding.useRef(value4());
|
|
const useState = binding.useState;
|
|
const value7 = env0_3(Reflect.apply(useState, binding, [value5.current]), 2);
|
|
const value8 = 0;
|
|
const property = value7[value8];
|
|
const env0_6 = value7[1];
|
|
binding.useEffect(function() {
|
|
return SubscribeToKeyboardUIStore(_fun48037);
|
|
}, [value4, isKeyboardAwareOnIOS, isKeyboardAwareOnAndroid]);
|
|
object2 = {keyboardHeight: property};
|
|
let r7 = isKeyboardAwareOnIOS ? !includeKeyboardHeight : !isKeyboardAwareOnIOS;
|
|
if (!r7) {
|
|
value = require(477) /* metro dependency 477: PlatformUtils */;
|
|
value = value.isAndroid();
|
|
r7 = value;
|
|
}
|
|
object2.disabled = r7;
|
|
useAnimateChanges(object2);
|
|
if (property > value8) {
|
|
object = {};
|
|
copyDataProperties(object, value2, value4);
|
|
object['bottom'] = includeKeyboardHeight ? property : value8;
|
|
r1 = object;
|
|
} else {
|
|
r1 = value2;
|
|
}
|
|
return {insets: r1};
|
|
function _fun48035() { // fn#48035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5641:452, offset: 0x011d7e85, size: 261 bytes, params: 1, frame: 18
|
|
var r1;
|
|
var r0;
|
|
var moduleValue2;
|
|
var systemKeyboardHeight;
|
|
var value6;
|
|
const KeyboardTypes = (KeyboardTypesModule).KeyboardTypes;
|
|
let value = environment.__proto__;
|
|
if (PlatformUtilsModule.isIOS()) {
|
|
if (isKeyboardAwareOnIOS) {
|
|
moduleValue2 = PlatformUtilsModule;
|
|
if (moduleValue2.isAndroid()) {
|
|
if (isKeyboardAwareOnAndroid) {
|
|
systemKeyboardHeight = (require(1851) /* metro dependency 1851: useSystemKeyboardHeightNative */).getSystemKeyboardHeight({appEntryKey: env0_3});
|
|
value6 = 0;
|
|
if (value6 !== systemKeyboardHeight) {
|
|
r0 = systemKeyboardHeight;
|
|
} else {
|
|
if ((require(4022) /* metro dependency 4022: useKeyboardType */).getKeyboardType(env0_3) === KeyboardTypes.SYSTEM) {
|
|
r1 = value6;
|
|
} else if (includeCustomKeyboardHeight) {
|
|
value = require(5466) /* metro dependency 5466: useCustomKeyboardHeight */;
|
|
value = value.getCustomKeyboardHeight(env0_3);
|
|
r1 = value;
|
|
} else {
|
|
r1 = value6;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
return 0;
|
|
}
|
|
systemKeyboardHeight = (require(1851) /* metro dependency 1851: useSystemKeyboardHeightNative */).getSystemKeyboardHeight({appEntryKey: env0_3});
|
|
value6 = 0;
|
|
if (value6 !== systemKeyboardHeight) {
|
|
r0 = systemKeyboardHeight;
|
|
} else {
|
|
if ((require(4022) /* metro dependency 4022: useKeyboardType */).getKeyboardType(env0_3) === KeyboardTypes.SYSTEM) {
|
|
r1 = value6;
|
|
} else if (includeCustomKeyboardHeight) {
|
|
value = require(5466) /* metro dependency 5466: useCustomKeyboardHeight */;
|
|
value = value.getCustomKeyboardHeight(env0_3);
|
|
r1 = value;
|
|
} else {
|
|
r1 = value6;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
return 0;
|
|
}
|
|
moduleValue2 = PlatformUtilsModule;
|
|
if (moduleValue2.isAndroid()) {
|
|
if (isKeyboardAwareOnAndroid) {
|
|
systemKeyboardHeight = (require(1851) /* metro dependency 1851: useSystemKeyboardHeightNative */).getSystemKeyboardHeight({appEntryKey: env0_3});
|
|
value6 = 0;
|
|
if (value6 !== systemKeyboardHeight) {
|
|
r0 = systemKeyboardHeight;
|
|
} else {
|
|
if ((require(4022) /* metro dependency 4022: useKeyboardType */).getKeyboardType(env0_3) === KeyboardTypes.SYSTEM) {
|
|
r1 = value6;
|
|
} else if (includeCustomKeyboardHeight) {
|
|
value = require(5466) /* metro dependency 5466: useCustomKeyboardHeight */;
|
|
value = value.getCustomKeyboardHeight(env0_3);
|
|
r1 = value;
|
|
} else {
|
|
r1 = value6;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
return 0;
|
|
}
|
|
systemKeyboardHeight = (require(1851) /* metro dependency 1851: useSystemKeyboardHeightNative */).getSystemKeyboardHeight({appEntryKey: env0_3});
|
|
value6 = 0;
|
|
if (value6 !== systemKeyboardHeight) {
|
|
r0 = systemKeyboardHeight;
|
|
} else {
|
|
if ((require(4022) /* metro dependency 4022: useKeyboardType */).getKeyboardType(env0_3) === KeyboardTypes.SYSTEM) {
|
|
r1 = value6;
|
|
} else if (includeCustomKeyboardHeight) {
|
|
value = require(5466) /* metro dependency 5466: useCustomKeyboardHeight */;
|
|
value = value.getCustomKeyboardHeight(env0_3);
|
|
r1 = value;
|
|
} else {
|
|
r1 = value6;
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun48036() { // fn#48036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5641:784, offset: 0x011d7f8a, size: 23 bytes, params: 1, frame: 11
|
|
return SubscribeToKeyboardUIStore(_fun48037);
|
|
function _fun48037() { // fn#48037, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5641:798, offset: 0x011d7fa1, size: 47 bytes, params: 1, frame: 12
|
|
const value2 = env1_4();
|
|
if (env1_5.current !== value2) {
|
|
env1_5.current = value2;
|
|
env1_6(value2);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
function useAnimateChanges({keyboardHeight, disabled}) { // fn#48038, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5641:870, owner: useSafeAreaInsetsKeyboardAware.useAnimateChanges, offset: 0x011d7fd0, size: 75 bytes, params: 2, frame: 15
|
|
const binding = env1_4;
|
|
const env0_1 = binding.useRef(false);
|
|
binding.useEffect(_fun48039, [keyboardHeight, disabled]);
|
|
function _fun48039() { // fn#48039, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5641:960, offset: 0x011d801b, size: 110 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__.__proto__;
|
|
const keyboardDuration = (UseKeyboardDurationModule).getKeyboardDuration();
|
|
if (env0_1.current) {
|
|
if (keyboardDuration === 0) {
|
|
env0_1.current = true;
|
|
} else if (disabled) {
|
|
env0_1.current = true;
|
|
} else {
|
|
(require(5465) /* metro dependency 5465: DeprecatedLayoutAnimation */).DeprecatedLayoutAnimationKeyboard(keyboardDuration);
|
|
}
|
|
} else {
|
|
env0_1.current = true;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun48033, 5463, [57, 31, 1480, 5464, 5465, 1585, 1481, 477, 1851, 4022, 1583, 5466,
|
|
2]) /* metro module 5463, dependencies: [57, 31, 1480, 5464, 5465, 1585, 1481, 477, 1851, 4022, 1583, 5466, 2] */;
|