decord/beta/source/modules/share/native/useShareChatInputActions.tsx

98 lines
3.1 KiB
TypeScript
Raw Normal View History

// Module ID: 11189
// Function ID: 11190
// Name: useShareChatInputActions
// Dependencies: [32, 19, 1375, 10583, 2]
// Exports: useShareChatInputActions
// Module 11189 (useShareChatInputActions)
2026-10-01 14:13:23 +00:00
import EmojiConstants from "EmojiConstants" /* 1375 */;
import openEmojiPickerActionSheet2 from "openEmojiPickerActionSheet" /* 10583 */;
import _slicedToArray_mod from "_slicedToArray" /* 32 */;
import react from "react" /* 19 */;
import size from "module_2" /* 2 */;
2026-10-01 14:13:23 +00:00
let _slicedToArray = _slicedToArray_mod;
const EmojiIntention = EmojiConstants.EmojiIntention;
let result = size.fileFinishedImporting("modules/share/native/useShareChatInputActions.tsx");
export const useShareChatInputActions = function useShareChatInputActions(setText, selectedDestinationChannel, appEntryKey) {
2026-10-01 14:13:23 +00:00
let closure_5;
let ref;
let tmp3;
const channel = selectedDestinationChannel;
_slicedToArray = appEntryKey;
ref = ref.useRef(null);
2026-10-01 14:13:23 +00:00
let closure_4 = ref.useRef({ start: 0, end: 0 });
const tmp2 = _slicedToArray(ref.useState(false), 2);
[tmp3, closure_5] = tmp2;
const callback = ref.useCallback((nativeEvent) => {
2026-10-01 14:13:23 +00:00
const obj = {};
const merged = Object.assign(nativeEvent.nativeEvent.selection);
2026-10-01 14:13:23 +00:00
closure_4.current = obj;
}, []);
const callback1 = ref.useCallback(() => {
2026-10-01 14:13:23 +00:00
closure_5(true);
}, []);
const items = [setText];
const callback2 = ref.useCallback(() => {
2026-10-01 14:13:23 +00:00
closure_5(false);
}, []);
const callback3 = ref.useCallback((id) => {
2026-10-01 14:13:23 +00:00
let closure_0;
setText = "";
if (null == id.id) {
if (null != id.surrogates) {
setText = id.surrogates;
}
setText((arr) => {
const sum = arr.slice(0, ref.current.start) + closure_0;
return sum + arr.slice(ref.current.end);
});
const current = ref.current;
if (current != null) {
current.focus();
}
}
if (null != id.uniqueName) {
2026-10-01 14:13:23 +00:00
let name;
if ("" !== id.uniqueName) {
2026-10-01 14:13:23 +00:00
name = id.uniqueName;
}
const _HermesInternal = HermesInternal;
setText = ":" + name + ": ";
}
name = id.name;
}, items);
const callback4 = ref.useCallback(() => {
const current = ref.current;
if (current != null) {
current.focus();
}
}, []);
const items1 = [callback4, callback3, selectedDestinationChannel, appEntryKey];
2026-10-01 14:13:23 +00:00
let obj = {
textInputRef: ref,
isInputFocused: tmp3,
handleSelectionChange: callback,
handleMessageFocus: callback1,
handleMessageBlur: callback2,
handlePressEmoji: ref.useCallback(() => {
2026-10-01 14:13:23 +00:00
let guildId;
const current = ref.current;
if (current != null) {
current.blur();
}
2026-10-01 14:13:23 +00:00
const obj = { onPressEmoji: callback3, onClose: callback4, pickerIntention: EmojiIntention.CHAT, autoFocus: false, startExpanded: false, channel, appEntryKey, guildId };
guildId = undefined;
const openEmojiPickerActionSheet = openEmojiPickerActionSheet2.openEmojiPickerActionSheet;
openEmojiPickerActionSheet2;
const obj2 = channel;
if (channel != null) {
2026-10-01 14:13:23 +00:00
guildId = obj2.getGuildId();
}
2026-10-01 14:13:23 +00:00
const result = openEmojiPickerActionSheet(obj);
}, items1)
};
2026-10-01 14:13:23 +00:00
return obj;
};