2026-09-28 16:18:32 +00:00
|
|
|
// Module ID: 11189
|
|
|
|
|
// Function ID: 11190
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: useShareChatInputActions
|
2026-09-28 16:18:32 +00:00
|
|
|
// Dependencies: [32, 19, 1375, 10583, 2]
|
2026-09-26 17:57:22 +00:00
|
|
|
// Exports: useShareChatInputActions
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-09-28 16:18:32 +00:00
|
|
|
// 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-09-18 19:45:33 +00:00
|
|
|
|
2026-10-01 14:13:23 +00:00
|
|
|
let _slicedToArray = _slicedToArray_mod;
|
|
|
|
|
const EmojiIntention = EmojiConstants.EmojiIntention;
|
2026-09-18 19:45:33 +00:00
|
|
|
let result = size.fileFinishedImporting("modules/share/native/useShareChatInputActions.tsx");
|
|
|
|
|
|
2026-09-26 17:57:22 +00:00
|
|
|
export const useShareChatInputActions = function useShareChatInputActions(setText, selectedDestinationChannel, appEntryKey) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let closure_5;
|
|
|
|
|
let ref;
|
|
|
|
|
let tmp3;
|
2026-09-26 17:57:22 +00:00
|
|
|
const channel = selectedDestinationChannel;
|
2026-09-18 19:45:33 +00:00
|
|
|
_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;
|
2026-09-18 19:45:33 +00:00
|
|
|
const callback = ref.useCallback((nativeEvent) => {
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = {};
|
2026-09-18 19:45:33 +00:00
|
|
|
const merged = Object.assign(nativeEvent.nativeEvent.selection);
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_4.current = obj;
|
2026-09-18 19:45:33 +00:00
|
|
|
}, []);
|
|
|
|
|
const callback1 = ref.useCallback(() => {
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_5(true);
|
2026-09-18 19:45:33 +00:00
|
|
|
}, []);
|
2026-09-26 17:57:22 +00:00
|
|
|
const items = [setText];
|
2026-09-18 19:45:33 +00:00
|
|
|
const callback2 = ref.useCallback(() => {
|
2026-10-01 14:13:23 +00:00
|
|
|
closure_5(false);
|
2026-09-18 19:45:33 +00:00
|
|
|
}, []);
|
|
|
|
|
const callback3 = ref.useCallback((id) => {
|
2026-10-01 14:13:23 +00:00
|
|
|
let closure_0;
|
2026-09-26 17:57:22 +00:00
|
|
|
setText = "";
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null == id.id) {
|
|
|
|
|
if (null != id.surrogates) {
|
2026-09-26 17:57:22 +00:00
|
|
|
setText = id.surrogates;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-09-26 17:57:22 +00:00
|
|
|
setText((arr) => {
|
2026-09-18 19:45:33 +00:00
|
|
|
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;
|
2026-09-18 19:45:33 +00:00
|
|
|
if ("" !== id.uniqueName) {
|
2026-10-01 14:13:23 +00:00
|
|
|
name = id.uniqueName;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
const _HermesInternal = HermesInternal;
|
2026-09-26 17:57:22 +00:00
|
|
|
setText = ":" + name + ": ";
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
name = id.name;
|
|
|
|
|
}, items);
|
|
|
|
|
const callback4 = ref.useCallback(() => {
|
|
|
|
|
const current = ref.current;
|
|
|
|
|
if (current != null) {
|
|
|
|
|
current.focus();
|
|
|
|
|
}
|
|
|
|
|
}, []);
|
2026-09-26 17:57:22 +00:00
|
|
|
const items1 = [callback4, callback3, selectedDestinationChannel, appEntryKey];
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj = {
|
2026-09-18 19:45:33 +00:00
|
|
|
textInputRef: ref,
|
|
|
|
|
isInputFocused: tmp3,
|
|
|
|
|
handleSelectionChange: callback,
|
|
|
|
|
handleMessageFocus: callback1,
|
|
|
|
|
handleMessageBlur: callback2,
|
|
|
|
|
handlePressEmoji: ref.useCallback(() => {
|
2026-10-01 14:13:23 +00:00
|
|
|
let guildId;
|
2026-09-18 19:45:33 +00:00
|
|
|
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;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (channel != null) {
|
2026-10-01 14:13:23 +00:00
|
|
|
guildId = obj2.getGuildId();
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const result = openEmojiPickerActionSheet(obj);
|
2026-09-18 19:45:33 +00:00
|
|
|
}, items1)
|
|
|
|
|
};
|
2026-10-01 14:13:23 +00:00
|
|
|
return obj;
|
2026-09-26 17:57:22 +00:00
|
|
|
};
|