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

266 lines
9.2 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 10859
// Function ID: 84394
2026-07-20 16:05:17 +00:00
// Name: handleTapCommandMention
2026-07-27 11:26:19 +00:00
// Dependencies: [31, 1348, 1455, 4567, 4568, 33, 5676, 3983, 4099, 1555, 4472, 1212, 1273, 10860, 3831, 5490, 3804, 6719, 5495, 10862, 4127, 3990, 10864, 9929, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-27 11:26:19 +00:00
// Module 10859 (handleTapCommandMention)
2026-07-23 10:11:24 +00:00
import result from "result";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
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-23 10:11:24 +00:00
import { jsxs } from "jsxProd";
let closure_5;
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) {
let obj = { name: constants.COMMAND_VIEW };
2026-07-23 10:11:24 +00:00
obj = { analyticsLocation: onSetCommand(sum1[6]).ApplicationCommandTriggerLocations.MENTION };
2026-07-20 16:05:17 +00:00
let obj1 = { commandId: sum1 };
obj.preSelectedCommand = obj1;
const obj2 = { type: "channel", channel };
obj.context = obj2;
obj.params = obj;
appLauncherNavigator.navigate(obj);
}
}
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;
if (null != state) {
const routes = state.routes;
if (null != routes) {
length = routes.length;
}
}
if (length > 1) {
const state1 = rootNavigationRef.getState();
let length1;
if (null != state1) {
const routes1 = state1.routes;
if (null != routes1) {
length1 = routes1.length;
}
}
let num4 = 0;
if (null != length1) {
num4 = length1;
}
if (num4 > 1) {
do {
let goBackResult = rootNavigationRef.goBack();
num4 = num4 - 1;
} while (num4 > 1);
}
}
}
2026-07-23 10:11:24 +00:00
let obj3 = importDefault(sum1[8]);
2026-07-20 16:05:17 +00:00
obj3.hideActionSheet();
const _setTimeout = setTimeout;
const timerId = setTimeout(() => {
let obj = { type: onSetCommand(sum1[9]).KeyboardTypes.APP_LAUNCHER };
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 };
obj.context = obj;
return callback(obj);
}, 0);
}
}
if ("" === channelId.currentText) {
onSetCommand();
} else {
obj3 = {};
2026-07-23 10:11:24 +00:00
const intl = onSetCommand(sum1[11]).intl;
obj3.title = intl.string(onSetCommand(sum1[11]).t.pe26Cj);
const intl2 = onSetCommand(sum1[11]).intl;
obj3.confirmText = intl2.string(onSetCommand(sum1[11]).t.VkKicb);
2026-07-20 16:05:17 +00:00
obj3.onConfirm = function onConfirm() {
return onSetCommand();
};
2026-07-23 10:11:24 +00:00
const intl3 = onSetCommand(sum1[11]).intl;
obj3.cancelText = intl3.string(onSetCommand(sum1[11]).t["ETE/oC"]);
obj3.confirmColor = onSetCommand(sum1[12]).ButtonColors.BRAND;
const intl4 = onSetCommand(sum1[11]).intl;
obj3.body = intl4.string(onSetCommand(sum1[11]).t["+awCIy"]);
importDefault(sum1[10]).show(obj3);
const obj9 = importDefault(sum1[10]);
2026-07-20 16:05:17 +00:00
}
}
function handleLongPressCommandMention(commandName, commandId) {
2026-07-23 10:11:24 +00:00
const _require = commandName;
let closure_1 = commandId;
2026-07-20 16:05:17 +00:00
let obj = {};
2026-07-23 10:11:24 +00:00
const intl = _require(1212).intl;
obj.label = intl.string(_require(1212).t["42H+Nb"]);
2026-07-27 11:26:19 +00:00
obj.IconComponent = _require(10860).SlashBoxIcon;
2026-07-20 16:05:17 +00:00
obj.onPress = function onPress() {
2026-07-23 10:11:24 +00:00
commandName(outer1_2[14]).presentCommandCopied();
const obj = commandName(outer1_2[14]);
commandName(outer1_2[15]).copy("" + outer1_8 + commandName);
2026-07-20 16:05:17 +00:00
};
const items = [obj];
2026-07-25 08:10:48 +00:00
const DeveloperMode = _require(3804).DeveloperMode;
2026-07-20 16:05:17 +00:00
if (DeveloperMode.getSetting()) {
obj = {};
2026-07-23 10:11:24 +00:00
const intl2 = _require(1212).intl;
obj.label = intl2.string(_require(1212).t.oJ1Muw);
2026-07-25 08:10:48 +00:00
obj.IconComponent = _require(6719).IdIcon;
2026-07-20 16:05:17 +00:00
obj.onPress = function onPress() {
2026-07-23 10:11:24 +00:00
commandName(outer1_2[14]).presentIdCopied();
const obj = commandName(outer1_2[14]);
commandName(outer1_2[15]).copy(closure_1);
2026-07-20 16:05:17 +00:00
};
items.push(obj);
}
2026-07-23 10:11:24 +00:00
obj = { key: "LongPressCommandMention", options: items, hasIcons: true };
2026-07-24 07:16:23 +00:00
const result = _require(5495).showSimpleActionSheet(obj);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
({ AppLauncherRouteName: closure_5, useAppLauncherNavigation: closure_6 } = APP_LAUNCHER_BUILT_IN_SECTION_ICON);
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;
({ output, state, style } = node);
2026-07-27 11:26:19 +00:00
let closure_1 = null != React.useContext(node(10862).AppLauncherContext);
2026-07-23 10:11:24 +00:00
const dependencyMap = callback();
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();
obj = {};
let tmp2;
if (closure_1) {
2026-07-23 10:11:24 +00:00
tmp2 = table;
2026-07-20 16:05:17 +00:00
}
obj.appLauncherNavigator = tmp2;
2026-07-23 10:11:24 +00:00
({ channelId: obj3.channelId, commandId: obj3.commandId, commandName: obj3.commandName } = bestActiveInput);
2026-07-20 16:05:17 +00:00
let text;
if (null != bestActiveInput) {
text = bestActiveInput.getText();
}
let str = "";
if (null != text) {
str = text;
}
obj.currentText = str;
obj.onOpenCustomKeyboard = function onOpenCustomKeyboard(arg0) {
let openCustomKeyboardResult;
if (null != bestActiveInput) {
openCustomKeyboardResult = bestActiveInput.openCustomKeyboard(arg0);
}
return openCustomKeyboardResult;
};
obj.onSetCommand = function onSetCommand() {
let commandId;
let commandName;
2026-07-27 11:26:19 +00:00
callback(10864)();
2026-07-25 08:10:48 +00:00
callback(4099).hideActionSheet();
2026-07-20 16:05:17 +00:00
if (null != bestActiveInput) {
bestActiveInput.openSystemKeyboard();
}
let tmp5 = null == bestActiveInput;
if (!tmp5) {
const applicationCommandManager = bestActiveInput.getApplicationCommandManager();
tmp5 = null == applicationCommandManager;
const obj2 = applicationCommandManager;
}
if (!tmp5) {
({ commandId, commandName } = bestActiveInput);
2026-07-25 08:10:48 +00:00
obj2.setPartialCommand(commandId, commandName, node(5676).ApplicationCommandTriggerLocations.MENTION);
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-20 16:05:17 +00:00
}
};
2026-07-25 08:10:48 +00:00
const items = ["/", node(9929).smartOutput(node, output, state)];
2026-07-20 16:05:17 +00:00
obj.children = items;
2026-07-25 08:10:48 +00:00
return jsxs(node(4127).Text, {
2026-07-23 10:11:24 +00:00
style,
variant: "text-md/bold",
onPress() {
let obj = node(table[21]);
const bestActiveInput = obj.getBestActiveInput();
obj = {};
let tmp2;
if (closure_1) {
tmp2 = table;
}
obj.appLauncherNavigator = tmp2;
({ channelId: obj3.channelId, commandId: obj3.commandId, commandName: obj3.commandName } = bestActiveInput);
let text;
if (null != bestActiveInput) {
text = bestActiveInput.getText();
}
let str = "";
if (null != text) {
str = text;
}
obj.currentText = str;
obj.onOpenCustomKeyboard = function onOpenCustomKeyboard(arg0) {
let openCustomKeyboardResult;
if (null != bestActiveInput) {
openCustomKeyboardResult = bestActiveInput.openCustomKeyboard(arg0);
}
return openCustomKeyboardResult;
};
obj.onSetCommand = function onSetCommand() {
let commandId;
let commandName;
2026-07-27 11:26:19 +00:00
callback(10864)();
2026-07-25 08:10:48 +00:00
callback(4099).hideActionSheet();
2026-07-23 10:11:24 +00:00
if (null != bestActiveInput) {
bestActiveInput.openSystemKeyboard();
}
let tmp5 = null == bestActiveInput;
if (!tmp5) {
const applicationCommandManager = bestActiveInput.getApplicationCommandManager();
tmp5 = null == applicationCommandManager;
const obj2 = applicationCommandManager;
}
if (!tmp5) {
({ commandId, commandName } = bestActiveInput);
2026-07-25 08:10:48 +00:00
obj2.setPartialCommand(commandId, commandName, node(5676).ApplicationCommandTriggerLocations.MENTION);
2026-07-23 10:11:24 +00:00
}
};
outer1_10(obj);
},
onLongPress() {
outer1_11(node.commandName, node.commandId);
}
});
2026-07-20 16:05:17 +00:00
};
export { handleTapCommandMention };
export { handleLongPressCommandMention };