decord/source/modules/markup/native/MarkupReactCommandRule.tsx

243 lines
8.9 KiB
TypeScript
Raw Normal View History

2026-09-03 10:05:34 +00:00
// Module ID: 9062
// Function ID: 9063
2026-07-20 16:05:17 +00:00
// Name: handleTapCommandMention
2026-09-03 10:05:34 +00:00
// Dependencies: [19, 1386, 1497, 4953, 4954, 21, 7278, 4333, 4445, 1625, 4859, 1233, 1296, 9063, 4193, 5990, 4166, 9065, 5995, 9067, 4474, 4340, 9069, 8017, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-09-03 10:05:34 +00:00
// Module 9062 (handleTapCommandMention)
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
2026-09-02 09:53:35 +00:00
import closure_4 from "ensureGuildLoaded" /* 1386 */;
import APP_LAUNCHER_BUILT_IN_SECTION_ICON from "APP_LAUNCHER_BUILT_IN_SECTION_ICON" /* 1497 */;
2026-09-03 10:05:34 +00:00
import { SUB_COMMAND_KEY_SEPARATOR } from "TRUE_OPTION_NAME" /* 4953 */;
import { COMMAND_SENTINEL } from "regExp" /* 4954 */;
2026-08-24 06:08:38 +00:00
import { jsxs } from "jsxProd" /* 21 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function handleTapCommandMention(channelId) {
({ appLauncherNavigator, onSetCommand } = channelId);
2026-07-23 10:11:24 +00:00
({ onOpenCustomKeyboard: importDefault, commandId, commandName } = channelId);
let sum1;
channel = channel.getChannel(channelId.channelId);
2026-07-20 16:05:17 +00:00
if (null != channel) {
if (null != channel.guild_id) {
2026-07-23 10:11:24 +00:00
sum1 = commandId;
2026-07-20 16:05:17 +00:00
if (commandName.includes(" ")) {
const sum = commandId + SUB_COMMAND_KEY_SEPARATOR;
const parts = commandName.split(" ");
const substr = parts.slice(1);
sum1 = sum + substr.join(SUB_COMMAND_KEY_SEPARATOR);
}
if (null != appLauncherNavigator) {
if (null != channel) {
2026-08-06 08:05:19 +00:00
let obj = { analyticsLocation: null, preSelectedCommand: null, context: null };
2026-07-29 08:29:29 +00:00
obj[0] = onSetCommand(sum1[6]).ApplicationCommandTriggerLocations.MENTION;
2026-08-06 08:05:19 +00:00
obj = { commandId: null };
obj[0] = sum1;
2026-07-29 08:29:29 +00:00
obj[1] = obj;
2026-08-24 06:08:38 +00:00
obj1 = { type: "channel", channel: null };
2026-08-06 08:05:19 +00:00
obj1[1] = channel;
obj[2] = obj1;
appLauncherNavigator.navigate(constants.COMMAND_VIEW, obj);
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
obj1 = onSetCommand(sum1[7]);
2026-07-20 16:05:17 +00:00
const rootNavigationRef = obj1.getRootNavigationRef();
if (null != rootNavigationRef) {
const state = rootNavigationRef.getState();
let length;
2026-07-29 08:29:29 +00:00
if (state != null) {
2026-07-20 16:05:17 +00:00
const routes = state.routes;
2026-07-29 08:29:29 +00:00
if (routes != null) {
2026-07-20 16:05:17 +00:00
length = routes.length;
}
}
if (length > 1) {
const state1 = rootNavigationRef.getState();
2026-07-29 08:29:29 +00:00
let num3;
if (state1 != null) {
2026-07-20 16:05:17 +00:00
const routes1 = state1.routes;
2026-07-29 08:29:29 +00:00
if (routes1 != null) {
num3 = routes1.length;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
if (num3 == null) {
num3 = 0;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (num3 > 1) {
2026-07-20 16:05:17 +00:00
do {
let goBackResult = rootNavigationRef.goBack();
2026-07-29 08:29:29 +00:00
num3 = num3 - 1;
} while (num3 > 1);
2026-07-20 16:05:17 +00:00
}
}
}
2026-08-06 08:05:19 +00:00
importDefault(sum1[8]).hideActionSheet();
2026-07-20 16:05:17 +00:00
const _setTimeout = setTimeout;
const timerId = setTimeout(() => {
2026-07-29 08:29:29 +00:00
let obj = { type: onSetCommand(sum1[9]).KeyboardTypes.APP_LAUNCHER, context: null };
2026-08-24 06:08:38 +00:00
obj = { initialRouteName: closure_1_5.COMMAND_VIEW, analyticsLocation: onSetCommand(sum1[6]).ApplicationCommandTriggerLocations.MENTION, preSelectedCommand: obj };
2026-07-20 16:05:17 +00:00
obj = { commandId: sum1 };
2026-07-29 08:29:29 +00:00
obj[1] = obj;
2026-07-20 16:05:17 +00:00
return callback(obj);
}, 0);
2026-08-06 08:05:19 +00:00
const obj4 = importDefault(sum1[8]);
2026-07-20 16:05:17 +00:00
}
}
if ("" === channelId.currentText) {
onSetCommand();
} else {
2026-08-06 08:05:19 +00:00
const obj2 = { title: null, confirmText: null, onConfirm: null, cancelText: null, confirmColor: null, body: null };
2026-07-23 10:11:24 +00:00
const intl = onSetCommand(sum1[11]).intl;
2026-08-06 08:05:19 +00:00
obj2[0] = intl.string(onSetCommand(sum1[11]).t.pe26Cj);
2026-07-23 10:11:24 +00:00
const intl2 = onSetCommand(sum1[11]).intl;
2026-08-06 08:05:19 +00:00
obj2[1] = intl2.string(onSetCommand(sum1[11]).t.VkKicb);
obj2[2] = function onConfirm() {
2026-07-20 16:05:17 +00:00
return onSetCommand();
};
2026-07-23 10:11:24 +00:00
const intl3 = onSetCommand(sum1[11]).intl;
2026-08-06 08:05:19 +00:00
obj2[3] = intl3.string(onSetCommand(sum1[11]).t["ETE/oC"]);
obj2[4] = onSetCommand(sum1[12]).ButtonColors.BRAND;
2026-07-23 10:11:24 +00:00
const intl4 = onSetCommand(sum1[11]).intl;
2026-08-06 08:05:19 +00:00
obj2[5] = intl4.string(onSetCommand(sum1[11]).t["+awCIy"]);
importDefault(sum1[10]).show(obj2);
const obj8 = importDefault(sum1[10]);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
function handleLongPressCommandMention(arg0, arg1) {
const _require = arg0;
2026-08-24 06:08:38 +00:00
closure_1 = arg1;
2026-07-29 08:29:29 +00:00
let obj = { label: null, IconComponent: null, onPress: null };
2026-09-02 09:53:35 +00:00
const intl = _require(1233).intl;
obj[0] = intl.string(_require(1233).t["42H+Nb"]);
2026-09-03 10:05:34 +00:00
obj[1] = _require(9063).SlashBoxIcon;
2026-07-29 08:29:29 +00:00
obj[2] = function onPress() {
2026-08-24 06:08:38 +00:00
callback(closure_1_2[14]).presentCommandCopied();
const obj = callback(closure_1_2[14]);
callback(closure_1_2[15]).copy("" + closure_1_8 + callback);
2026-07-20 16:05:17 +00:00
};
const items = [obj];
2026-09-01 10:26:29 +00:00
const DeveloperMode = _require(4166).DeveloperMode;
2026-07-20 16:05:17 +00:00
if (DeveloperMode.getSetting()) {
2026-07-29 08:29:29 +00:00
obj = { label: null, IconComponent: null, onPress: null };
2026-09-02 09:53:35 +00:00
const intl2 = tmp(1233).intl;
obj[0] = intl2.string(tmp(1233).t.oJ1Muw);
2026-09-03 10:05:34 +00:00
obj[1] = tmp(9065).IdIcon;
2026-07-29 08:29:29 +00:00
obj[2] = function onPress() {
2026-08-24 06:08:38 +00:00
callback(closure_1_2[14]).presentIdCopied();
const obj = callback(closure_1_2[14]);
callback(closure_1_2[15]).copy(closure_1);
2026-07-20 16:05:17 +00:00
};
items.push(obj);
}
2026-09-03 10:05:34 +00:00
const result = _require(5995).showSimpleActionSheet({ key: "LongPressCommandMention", options: items, hasIcons: true });
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ AppLauncherRouteName: c5, useAppLauncherNavigation: closure_6 } = APP_LAUNCHER_BUILT_IN_SECTION_ICON);
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/markup/native/MarkupReactCommandRule.tsx");
2026-07-20 16:05:17 +00:00
export default function MarkupReactCommandRule(node) {
node = node.node;
2026-08-24 06:08:38 +00:00
closure_1 = undefined;
dependencyMap = undefined;
2026-07-20 16:05:17 +00:00
({ output, state, style } = node);
2026-09-03 10:05:34 +00:00
closure_1 = null != React.useContext(node(9067).AppLauncherContext);
2026-07-29 08:29:29 +00:00
dependencyMap = callback();
2026-07-23 10:11:24 +00:00
let obj = {
2026-07-20 16:05:17 +00:00
style,
variant: "text-md/bold",
onPress() {
2026-07-23 10:11:24 +00:00
let obj = node(table[21]);
2026-07-20 16:05:17 +00:00
const bestActiveInput = obj.getBestActiveInput();
let tmp2;
if (closure_1) {
2026-07-23 10:11:24 +00:00
tmp2 = table;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { appLauncherNavigator: tmp2, channelId: bestActiveInput.channelId, commandId: bestActiveInput.commandId, commandName: bestActiveInput.commandName, currentText: null, onOpenCustomKeyboard: null, onSetCommand: null };
let str;
if (bestActiveInput != null) {
str = bestActiveInput.getText();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (str == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[4] = str;
obj[5] = function onOpenCustomKeyboard(arg0) {
2026-07-20 16:05:17 +00:00
let openCustomKeyboardResult;
2026-07-29 08:29:29 +00:00
if (bestActiveInput != null) {
2026-07-20 16:05:17 +00:00
openCustomKeyboardResult = bestActiveInput.openCustomKeyboard(arg0);
}
return openCustomKeyboardResult;
};
2026-07-29 08:29:29 +00:00
obj[6] = function onSetCommand() {
2026-09-03 10:05:34 +00:00
callback(9069)();
2026-09-01 10:26:29 +00:00
callback(4445).hideActionSheet();
2026-07-29 08:29:29 +00:00
if (bestActiveInput != null) {
obj2.openSystemKeyboard();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (bestActiveInput != null) {
const applicationCommandManager = obj2.getApplicationCommandManager();
if (applicationCommandManager != null) {
({ commandId, commandName } = bestActiveInput);
2026-09-03 10:05:34 +00:00
applicationCommandManager.setPartialCommand(commandId, commandName, node(7278).ApplicationCommandTriggerLocations.MENTION);
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
}
};
2026-08-24 06:08:38 +00:00
closure_1_10(obj);
2026-07-20 16:05:17 +00:00
},
onLongPress() {
2026-08-24 06:08:38 +00:00
closure_1_11(node.commandName, node.commandId);
2026-07-29 08:29:29 +00:00
},
children: null
2026-07-20 16:05:17 +00:00
};
2026-09-03 10:05:34 +00:00
const items = ["/", node(8017).smartOutput(node, output, state)];
2026-07-29 08:29:29 +00:00
obj[4] = items;
2026-09-01 10:26:29 +00:00
return jsxs(node(4474).Text, {
2026-07-23 10:11:24 +00:00
style,
variant: "text-md/bold",
onPress() {
let obj = node(table[21]);
const bestActiveInput = obj.getBestActiveInput();
let tmp2;
if (closure_1) {
tmp2 = table;
}
2026-07-29 08:29:29 +00:00
obj = { appLauncherNavigator: tmp2, channelId: bestActiveInput.channelId, commandId: bestActiveInput.commandId, commandName: bestActiveInput.commandName, currentText: null, onOpenCustomKeyboard: null, onSetCommand: null };
let str;
if (bestActiveInput != null) {
str = bestActiveInput.getText();
2026-07-23 10:11:24 +00:00
}
2026-07-29 08:29:29 +00:00
if (str == null) {
str = "";
2026-07-23 10:11:24 +00:00
}
2026-07-29 08:29:29 +00:00
obj[4] = str;
obj[5] = function onOpenCustomKeyboard(arg0) {
2026-07-23 10:11:24 +00:00
let openCustomKeyboardResult;
2026-07-29 08:29:29 +00:00
if (bestActiveInput != null) {
2026-07-23 10:11:24 +00:00
openCustomKeyboardResult = bestActiveInput.openCustomKeyboard(arg0);
}
return openCustomKeyboardResult;
};
2026-07-29 08:29:29 +00:00
obj[6] = function onSetCommand() {
2026-09-03 10:05:34 +00:00
callback(9069)();
2026-09-01 10:26:29 +00:00
callback(4445).hideActionSheet();
2026-07-29 08:29:29 +00:00
if (bestActiveInput != null) {
obj2.openSystemKeyboard();
2026-07-23 10:11:24 +00:00
}
2026-07-29 08:29:29 +00:00
if (bestActiveInput != null) {
const applicationCommandManager = obj2.getApplicationCommandManager();
if (applicationCommandManager != null) {
({ commandId, commandName } = bestActiveInput);
2026-09-03 10:05:34 +00:00
applicationCommandManager.setPartialCommand(commandId, commandName, node(7278).ApplicationCommandTriggerLocations.MENTION);
2026-07-29 08:29:29 +00:00
}
2026-07-23 10:11:24 +00:00
}
};
2026-08-24 06:08:38 +00:00
closure_1_10(obj);
2026-07-23 10:11:24 +00:00
},
onLongPress() {
2026-08-24 06:08:38 +00:00
closure_1_11(node.commandName, node.commandId);
2026-07-29 08:29:29 +00:00
},
children: null
2026-07-23 10:11:24 +00:00
});
2026-07-20 16:05:17 +00:00
};
export { handleTapCommandMention };
export { handleLongPressCommandMention };