Files
discord-decomp/sources/design/components/Sheet/native/ActionSheetPresenter.native.tsx
T
2026-07-28 01:06:53 +03:00

155 lines
10 KiB
TypeScript

/* Metro module 12766; source: design/components/Sheet/native/ActionSheetPresenter.native.tsx; dependencies: [57, 31, 27, 3849, 661, 33, 8742, 480, 4080, 4571, 6513, 4555, 566, 11206, 4509, 2] */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import ActionSheetStore from '../../../../modules/action_sheet/native/ActionSheetStore.tsx'; /* Metro dependency 3849 */
import UseBackPressHandler from '../../../../modules/routing/native/useBackPressHandler.tsx'; /* Metro dependency 4571 */
import ActionSheetContext from '../../../../modules/action_sheet/native/ActionSheetContext.tsx'; /* Metro dependency 6513 */
import UseTrackImpression from '../../../../modules/app_analytics/useTrackImpression.tsx'; /* Metro dependency 8742 */
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 AnalyticsUtilsModule from '../../../../external/discord_common/js/packages/analytics-utils/AnalyticsUtils.tsx'; /* Metro dependency 480 */
import * as FluxModule from '../../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
import * as OverlayViewModule from '../../../void/OverlayView/native/OverlayView.tsx'; /* Metro dependency 4509 */
import * as DialogNativeModule from '../../Dialog/native/Dialog.native.tsx'; /* Metro dependency 4555 */
import * as TransitionGroupModule from '../../../../external/discord_common/js/packages/transition-group/TransitionGroup.tsx'; /* Metro dependency 11206 */
function _fun97557(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#97557, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12956:6, offset: 0x021890a7, size: 240 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_9 = ReactModule.forwardRef(_fun97558);
(FileImportTrackerModule).fileFinishedImporting('design/components/Sheet/native/ActionSheetPresenter.native.tsx');
exports.ActionSheetPresenter = ActionSheetPresenter;
function _fun97558({sheetKey, content, impressionName, impressionProperties, zIndex}, a1) { // fn#97558, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12956:192, offset: 0x02189197, size: 470 bytes, params: 3, frame: 28
const binding = env0_4;
const [property, env0_2] = env0_3(binding.useState('visible'), 2);
var env0_3 = binding.useRef(NOOP);
let useCallback = binding.useCallback;
const value4 = Reflect.apply(useCallback, binding, [_fun97559, []]);
const env0_5 = binding.useRef(NOOP);
const value5 = binding.useCallback(_fun97560, []);
const defaultImport = UseTrackImpression;
const ImpressionTypes = (AnalyticsUtilsModule).ImpressionTypes;
const HALFSHEET = ImpressionTypes.HALFSHEET;
defaultImport({type: HALFSHEET, name: impressionName, properties: impressionProperties});
binding.useImperativeHandle(a1, function() {
return {componentDidEnter: _fun97562, componentWillLeave: _fun97563, componentDidLeave: _fun97564};
}, []);
const value6 = binding.useCallback(_fun97565, [sheetKey]);
const value7 = binding.useMemo(_fun97566, [property, value6, value5, value4]);
useCallback = binding.useCallback;
(UseBackPressHandler)(Reflect.apply(useCallback, binding,
[_fun97567, [value6]]));
const Provider = (ActionSheetContext).Provider;
const Dialog = (DialogNativeModule).Dialog;
return (
<Provider value={value7}>
<Dialog
dialogKey={sheetKey}
onDismiss={value6}
zIndex={zIndex}
>
{content}
</Dialog>
</Provider>
);
function _fun97559(a0) { // fn#97559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12956:358, offset: 0x0218936d, size: 20 bytes, params: 2, frame: 2
env0_3.current = a0;
}
function _fun97560() { // fn#97560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12956:411, offset: 0x02189381, size: 20 bytes, params: 1, frame: 9
env0_5.current();
}
function _fun97561() { // fn#97561, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12956:529, offset: 0x02189395, size: 44 bytes, params: 1, frame: 3
return {componentDidEnter: componentDidEnter_97562, componentWillLeave: componentWillLeave_97563,
componentDidLeave: componentDidLeave};
function componentDidEnter_97562() { // fn#97562, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12956:535, offset: 0x021893c1, size: 20 bytes, params: 1, frame: 11
env1_2('visible');
}
function componentWillLeave_97563(a0) { // fn#97563, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12956:569, offset: 0x021893d5, size: 33 bytes, params: 2, frame: 12
env1_2('exiting');
env1_5.current = a0;
}
function componentDidLeave() { // fn#97564, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12956:617, offset: 0x021893f6, size: 37 bytes, params: 1, frame: 12
env1_2('exited');
env1_5.current = NOOP;
}
}
function _fun97565() { // fn#97565, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12956:690, offset: 0x0218941b, size: 45 bytes, params: 1, frame: 12
let value = environment.__proto__;
value = importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */;
value.hideActionSheet(sheetKey);
}
function _fun97566() { // fn#97566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12956:742, offset: 0x02189448, size: 43 bytes, params: 1, frame: 3
return {transitionState: env0_1, close: ConstantsModule.NOOP, onLeave: env0_6, registerDismissHandler: env0_4};
}
function _fun97567() { // fn#97567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12956:840, offset: 0x02189473, size: 45 bytes, params: 1, frame: 10
if (env0_3.current != null) {
env0_3.current();
}
(0, ConstantsModule.NOOP)();
return true;
}
}
function ActionSheetPresenter({appEntryKey}) { // fn#97568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12956:1134, offset: 0x021894a0, size: 209 bytes, params: 2, frame: 21
env0_4.useEffect(function() {
return _fun97570;
}, [appEntryKey]);
const useStateFromStoresArray = FluxModule.useStateFromStoresArray;
const value4 = ((a0, a1) => {
var env0_0 = a1;
return a0.filter(_fun97572);
})(Reflect.apply(useStateFromStoresArray, FluxModule, [[ActionSheetStore], function() {
return ActionSheetStore.getStack();
}, []]), appEntryKey).map(_fun97574);
const TransitionGroup = (TransitionGroupModule).TransitionGroup;
const absoluteFill = StyleSheet.absoluteFill;
const TransitionGroupOverlayView = (OverlayViewModule).TransitionGroupOverlayView;
return (
<TransitionGroup style={absoluteFill} component={TransitionGroupOverlayView}>
{value4}
</TransitionGroup>
);
function _fun97569() { // fn#97569, offset: 0x02189571, size: 11 bytes, params: 1, frame: 1
return _fun97570;
function _fun97570() { // fn#97570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12956:1198, offset: 0x0218957c, size: 45 bytes, params: 1, frame: 12
let value = environment.__proto__.__proto__;
value = importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */;
value.resetActionSheetsForAppEntryKey(appEntryKey);
}
}
function filterStackForAppEntryKey(a0, a1) { // fn#97571, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12956:1259, owner: ActionSheetPresenter.filterStackForAppEntryKey, offset: 0x021895a9, size: 31 bytes, params: 3, frame: 11
const env0_0 = a1;
return a0.filter(function({appEntryKey}) {
return appEntryKey === require;
});
function _fun97572({appEntryKey}) { // fn#97572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12956:1316, offset: 0x021895c8, size: 22 bytes, params: 2, frame: 2
return appEntryKey === require;
}
}
function _fun97574({content, key, impressionName, impressionProperties, zIndex}) { // fn#97574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12956:1408, offset: 0x021895f1, size: 79 bytes, params: 2, frame: 19
return ((Component) => <Component sheetKey={key} content={content} impressionName={impressionName} impressionProperties={impressionProperties} zIndex={zIndex} key={key} />)(env1_9);
}
}
}
global.__d(_fun97557, 12766, [57, 31, 27, 3849, 661, 33, 8742, 480, 4080, 4571, 6513, 4555, 566, 11206, 4509,
2]) /* metro module 12766, dependencies: [57, 31, 27, 3849, 661, 33, 8742, 480, 4080, 4571, 6513, 4555, 566, 11206, 4509, 2] */;