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

257 lines
9.1 KiB
TypeScript
Raw Normal View History

2026-08-14 17:33:39 +00:00
// Module ID: 9606
// Function ID: 9607
2026-07-20 16:05:17 +00:00
// Name: handleTapCommandMention
2026-08-14 17:33:39 +00:00
// Dependencies: [19, 1391, 1498, 4800, 4801, 21, 7052, 4198, 4310, 1626, 4706, 1236, 1297, 9607, 4061, 5817, 4034, 9609, 5822, 9611, 4338, 4205, 9614, 8262, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-14 17:33:39 +00:00
// Module 9606 (handleTapCommandMention)
2026-07-29 08:29:29 +00:00
import context from "context";
import ensureGuildLoaded from "ensureGuildLoaded";
2026-07-23 10:11:24 +00:00
import APP_LAUNCHER_BUILT_IN_SECTION_ICON from "APP_LAUNCHER_BUILT_IN_SECTION_ICON";
import { SUB_COMMAND_KEY_SEPARATOR } from "TRUE_OPTION_NAME";
2026-07-24 07:16:23 +00:00
import { COMMAND_SENTINEL } from "regExp";
2026-07-29 08:29:29 +00:00
import { jsxs } from "getBestActiveInput";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c5;
2026-07-23 10:11:24 +00:00
let closure_6;
const require = arg1;
2026-07-20 16:05:17 +00:00
function handleTapCommandMention(channelId) {
let appLauncherNavigator;
let commandId;
let commandName;
2026-07-23 10:11:24 +00:00
let importDefault;
2026-07-20 16:05:17 +00:00
let onSetCommand;
({ 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-06 08:05:19 +00:00
let obj1 = { type: "channel", channel: null };
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-07-23 10:11:24 +00:00
obj = { initialRouteName: outer1_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;
let closure_1 = arg1;
let obj = { label: null, IconComponent: null, onPress: null };
const intl = _require(1236).intl;
obj[0] = intl.string(_require(1236).t["42H+Nb"]);
2026-08-14 17:33:39 +00:00
obj[1] = _require(9607).SlashBoxIcon;
2026-07-29 08:29:29 +00:00
obj[2] = function onPress() {
callback(outer1_2[14]).presentCommandCopied();
const obj = callback(outer1_2[14]);
callback(outer1_2[15]).copy("" + outer1_8 + callback);
2026-07-20 16:05:17 +00:00
};
const items = [obj];
2026-08-12 06:57:52 +00:00
const DeveloperMode = _require(4034).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 };
const intl2 = tmp(1236).intl;
obj[0] = intl2.string(tmp(1236).t.oJ1Muw);
2026-08-14 17:33:39 +00:00
obj[1] = tmp(9609).IdIcon;
2026-07-29 08:29:29 +00:00
obj[2] = function onPress() {
callback(outer1_2[14]).presentIdCopied();
const obj = callback(outer1_2[14]);
callback(outer1_2[15]).copy(closure_1);
2026-07-20 16:05:17 +00:00
};
items.push(obj);
}
2026-08-14 17:33:39 +00:00
const result = _require(5822).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-07-23 10:11:24 +00:00
let result = require("APP_LAUNCHER_BUILT_IN_SECTION_ICON").fileFinishedImporting("modules/markup/native/MarkupReactCommandRule.tsx");
2026-07-20 16:05:17 +00:00
export default function MarkupReactCommandRule(node) {
let output;
let state;
let style;
node = node.node;
2026-07-29 08:29:29 +00:00
let closure_1;
let dependencyMap;
2026-07-20 16:05:17 +00:00
({ output, state, style } = node);
2026-08-14 17:33:39 +00:00
closure_1 = null != React.useContext(node(9611).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-07-20 16:05:17 +00:00
let commandId;
let commandName;
2026-08-14 17:33:39 +00:00
callback(9614)();
2026-08-13 07:00:46 +00:00
callback(4310).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-08-14 17:33:39 +00:00
applicationCommandManager.setPartialCommand(commandId, commandName, node(7052).ApplicationCommandTriggerLocations.MENTION);
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
}
};
2026-07-23 10:11:24 +00:00
outer1_10(obj);
2026-07-20 16:05:17 +00:00
},
onLongPress() {
2026-07-23 10:11:24 +00:00
outer1_11(node.commandName, node.commandId);
2026-07-29 08:29:29 +00:00
},
children: null
2026-07-20 16:05:17 +00:00
};
2026-08-14 17:33:39 +00:00
const items = ["/", node(8262).smartOutput(node, output, state)];
2026-07-29 08:29:29 +00:00
obj[4] = items;
2026-08-13 07:00:46 +00:00
return jsxs(node(4338).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-07-23 10:11:24 +00:00
let commandId;
let commandName;
2026-08-14 17:33:39 +00:00
callback(9614)();
2026-08-13 07:00:46 +00:00
callback(4310).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-08-14 17:33:39 +00:00
applicationCommandManager.setPartialCommand(commandId, commandName, node(7052).ApplicationCommandTriggerLocations.MENTION);
2026-07-29 08:29:29 +00:00
}
2026-07-23 10:11:24 +00:00
}
};
outer1_10(obj);
},
onLongPress() {
outer1_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 };