78 lines
5.0 KiB
TypeScript
78 lines
5.0 KiB
TypeScript
/* Metro module 15040; source: modules/search/native/hooks/usePlaceholderStyles.tsx; dependencies: [4502, 9615, 1478, 566, 4017, 4504, 1305, 2] */
|
|
function _fun113822(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#113822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15237:6, offset: 0x024071f4, size: 169 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
|
|
const env0_4 = (require(9615) /* metro dependency 9615: SearchConstants */).FADE_LAYOUT_ANIMATION_DURATION;
|
|
object = {code: 'function usePlaceholderStylesTsx1(){const{useReducedMotion,visible,withRepeat,withSequence,withTiming,STANDARD_EASING,FADE_LAYOUT_ANIMATION_DURATION}=this.__closure;if(useReducedMotion){return{opacity:visible?1:0};}if(visible){return{opacity:withRepeat(withSequence(withTiming(0.5,{duration:0}),withTiming(1,{duration:1300,easing:STANDARD_EASING}),withTiming(0.5,{duration:1300,easing:STANDARD_EASING})),-1)};}return{opacity:withTiming(0,{duration:FADE_LAYOUT_ANIMATION_DURATION})};}'};
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/search/native/hooks/usePlaceholderStyles.tsx');
|
|
exports.useFullscreenPlaceholderCount = useFullscreenPlaceholderCount;
|
|
exports.usePlaceholderAnimatedStyle = usePlaceholderAnimatedStyle;
|
|
}
|
|
|
|
function useFullscreenPlaceholderCount({placeholderHeight, numColumns}) { // fn#113823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15237:764, offset: 0x0240729d, size: 88 bytes, params: 2, frame: 14
|
|
const height = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)({ignoreKeyboard: true}).height;
|
|
const Math = global.Math;
|
|
return Math.ceil(height / placeholderHeight) * numColumns;
|
|
}
|
|
|
|
function usePlaceholderAnimatedStyle(a0) { // fn#113824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15237:936, offset: 0x024072f5, size: 237 bytes, params: 2, frame: 20
|
|
var object2;
|
|
const env0_0 = a0;
|
|
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
|
|
const closure = usePlaceholderAnimatedStyleA;
|
|
object2 = {useReducedMotion: useReducedMotion, visible: a0};
|
|
object2.withRepeat = reanimatedRexportModule.withRepeat;
|
|
object2.withSequence = reanimatedRexportModule.withSequence;
|
|
object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
|
|
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
|
|
object2.STANDARD_EASING = STANDARD_EASING;
|
|
object2.FADE_LAYOUT_ANIMATION_DURATION = FADE_LAYOUT_ANIMATION_DURATION;
|
|
closure.__closure = object2;
|
|
closure.__workletHash = 9750536800906;
|
|
closure.__initData = env0_5;
|
|
return Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
|
|
}
|
|
|
|
function usePlaceholderAnimatedStyleA() { // fn#113826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15237:1077, owner: usePlaceholderAnimatedStyle.A, offset: 0x024073e2, size: 307 bytes, params: 1, frame: 29
|
|
var withRepeat;
|
|
var moduleValue2;
|
|
var withSequence;
|
|
var value2;
|
|
const STANDARD_EASING = (require(1305) /* metro dependency 1305: native */).STANDARD_EASING;
|
|
var value3;
|
|
var moduleValue5;
|
|
var value;
|
|
const object2 = {};
|
|
const binding = env0_0;
|
|
if (useReducedMotion) {
|
|
object2.opacity = binding ? 1 : 0;
|
|
} else {
|
|
value = environment.__proto__;
|
|
if (binding) {
|
|
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
withRepeat = value.withRepeat;
|
|
moduleValue2 = require(4017) /* metro dependency 4017: ReanimatedRexport */;
|
|
withSequence = moduleValue2.withSequence;
|
|
value2 = (require(4504) /* metro dependency 4504: timing */).withTiming(0.5, {duration: 0});
|
|
value3 = (require(4504) /* metro dependency 4504: timing */).withTiming(1, {duration: 1300,
|
|
easing: STANDARD_EASING});
|
|
moduleValue5 = require(4504) /* metro dependency 4504: timing */;
|
|
object2.opacity = Reflect.apply(withRepeat, value, [Reflect.apply(withSequence, moduleValue2, [value2,
|
|
value3,
|
|
moduleValue5.withTiming(0.5, {duration: 1300, easing: STANDARD_EASING})]), -1]);
|
|
} else {
|
|
object2.opacity = (require(4504) /* metro dependency 4504: timing */).withTiming(0,
|
|
{duration: FADE_LAYOUT_ANIMATION_DURATION});
|
|
}
|
|
}
|
|
return object2;
|
|
}
|
|
|