decord/source/modules/chat_input/native/ChatInputNativeCommands.tsx

208 lines
6.9 KiB
TypeScript
Raw Normal View History

2026-07-31 08:44:05 +00:00
// Module ID: 11178
// Function ID: 11179
// Dependencies: [17, 11179, 11181, 6043, 1208, 2]
2026-07-20 16:05:17 +00:00
2026-07-31 08:44:05 +00:00
// Module 11178
2026-07-23 10:11:24 +00:00
import get_ActivityIndicator from "get ActivityIndicator";
2026-07-29 08:29:29 +00:00
let c3;
let c4;
({ findNodeHandle: c3, NativeModules: c4 } = get_ActivityIndicator);
2026-07-23 10:11:24 +00:00
let result = require("__INTERNAL_VIEW_CONFIG").fileFinishedImporting("modules/chat_input/native/ChatInputNativeCommands.tsx");
2026-07-20 16:05:17 +00:00
export default {
backspace(arg0) {
if (null != arg0) {
if (obj.shouldUseFabricChatInput()) {
2026-07-31 08:44:05 +00:00
const Commands = tmp(11181).Commands;
2026-07-20 16:05:17 +00:00
Commands.backspace(arg0);
} else {
const DCDChatInputLegacyManager = closure_4.DCDChatInputLegacyManager;
DCDChatInputLegacyManager.backspace(callback(arg0));
}
2026-07-31 08:44:05 +00:00
obj = require(11179) /* useShouldUseFabricChatInput */;
2026-07-29 08:29:29 +00:00
tmp = require;
2026-07-20 16:05:17 +00:00
}
},
blur(arg0) {
if (null != arg0) {
if (obj.shouldUseFabricChatInput()) {
2026-07-31 08:44:05 +00:00
const Commands = tmp(11181).Commands;
2026-07-20 16:05:17 +00:00
Commands.blur(arg0);
} else {
const DCDChatInputLegacyManager = closure_4.DCDChatInputLegacyManager;
DCDChatInputLegacyManager.blur(callback(arg0));
}
2026-07-31 08:44:05 +00:00
obj = require(11179) /* useShouldUseFabricChatInput */;
2026-07-29 08:29:29 +00:00
tmp = require;
2026-07-20 16:05:17 +00:00
}
},
closeCustomKeyboard(arg0) {
if (null != arg0) {
if (obj.shouldUseFabricChatInput()) {
2026-07-31 08:44:05 +00:00
const Commands = tmp(11181).Commands;
2026-07-20 16:05:17 +00:00
Commands.closeCustomKeyboard(arg0);
} else {
const DCDChatInputLegacyManager = closure_4.DCDChatInputLegacyManager;
DCDChatInputLegacyManager.closeCustomKeyboard(callback(arg0));
}
2026-07-31 08:44:05 +00:00
obj = require(11179) /* useShouldUseFabricChatInput */;
2026-07-29 08:29:29 +00:00
tmp = require;
2026-07-20 16:05:17 +00:00
}
},
flushText(arg0, arg1) {
if (null != arg0) {
if (obj.shouldUseFabricChatInput()) {
2026-07-31 08:44:05 +00:00
const Commands = tmp(11181).Commands;
2026-07-20 16:05:17 +00:00
Commands.flushText(arg0, arg1);
} else {
const _Error = Error;
const error = new Error("flushText is not supported/needed on iOS");
throw error;
}
2026-07-31 08:44:05 +00:00
obj = require(11179) /* useShouldUseFabricChatInput */;
2026-07-29 08:29:29 +00:00
tmp = require;
2026-07-20 16:05:17 +00:00
}
},
getText(arg0, set) {
2026-07-23 10:11:24 +00:00
const _require = set;
2026-07-20 16:05:17 +00:00
const importDefault = arg2;
if (null == arg0) {
return null;
} else if (obj3.shouldUseFabricChatInput()) {
2026-07-29 08:29:29 +00:00
const nonce = tmp17(tmp18[3]).createNonce();
2026-07-20 16:05:17 +00:00
const result = set.set(nonce, (arg0) => {
2026-07-23 10:11:24 +00:00
set.delete(nonce);
callback(arg0);
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
const Commands = tmp17(tmp18[2]).Commands;
2026-07-20 16:05:17 +00:00
Commands.flushText(arg0, nonce);
2026-07-29 08:29:29 +00:00
const tmp17Result = tmp17(tmp18[3]);
2026-07-20 16:05:17 +00:00
} else {
const tmp2 = callback(arg0);
if (null == tmp2) {
const _Error = Error;
const error = new Error("inputRef is null");
2026-07-29 08:29:29 +00:00
importDefault(tmp18[4]).captureException(error);
const obj = importDefault(tmp18[4]);
2026-07-20 16:05:17 +00:00
} else {
const DCDChatInputLegacyManager = closure_4.DCDChatInputLegacyManager;
2026-07-29 08:29:29 +00:00
DCDChatInputLegacyManager.markTextInputChanged(tmp(arg0));
2026-07-20 16:05:17 +00:00
const DCDChatInputLegacyManager2 = closure_4.DCDChatInputLegacyManager;
const text = DCDChatInputLegacyManager2.getText(tmp2);
2026-07-29 08:29:29 +00:00
text.then(arg2).catch(importDefault(tmp18[4]).captureException);
2026-07-20 16:05:17 +00:00
const nextPromise = text.then(arg2);
}
2026-07-29 08:29:29 +00:00
tmp = callback;
2026-07-20 16:05:17 +00:00
}
},
focus(arg0) {
if (null != arg0) {
if (obj.shouldUseFabricChatInput()) {
2026-07-31 08:44:05 +00:00
const Commands = tmp(11181).Commands;
2026-07-20 16:05:17 +00:00
Commands.focus(arg0);
} else {
const DCDChatInputLegacyManager = closure_4.DCDChatInputLegacyManager;
DCDChatInputLegacyManager.focus(callback(arg0));
}
2026-07-31 08:44:05 +00:00
obj = require(11179) /* useShouldUseFabricChatInput */;
2026-07-29 08:29:29 +00:00
tmp = require;
2026-07-20 16:05:17 +00:00
}
},
openCustomKeyboard(arg0) {
if (null != arg0) {
if (obj.shouldUseFabricChatInput()) {
2026-07-31 08:44:05 +00:00
const Commands = tmp(11181).Commands;
2026-07-20 16:05:17 +00:00
Commands.openCustomKeyboard(arg0);
} else {
const _Error = Error;
const error = new Error("openCustomKeyboard is not supported/needed on iOS");
throw error;
}
2026-07-31 08:44:05 +00:00
obj = require(11179) /* useShouldUseFabricChatInput */;
2026-07-29 08:29:29 +00:00
tmp = require;
2026-07-20 16:05:17 +00:00
}
},
openSystemKeyboard(arg0) {
if (null != arg0) {
if (obj.shouldUseFabricChatInput()) {
2026-07-31 08:44:05 +00:00
const Commands = tmp(11181).Commands;
2026-07-20 16:05:17 +00:00
Commands.openSystemKeyboard(arg0);
} else {
const DCDChatInputLegacyManager = closure_4.DCDChatInputLegacyManager;
DCDChatInputLegacyManager.openSystemKeyboard(callback(arg0));
}
2026-07-31 08:44:05 +00:00
obj = require(11179) /* useShouldUseFabricChatInput */;
2026-07-29 08:29:29 +00:00
tmp = require;
2026-07-20 16:05:17 +00:00
}
},
setText(arg0, arg1) {
if (null != arg0) {
if (obj.shouldUseFabricChatInput()) {
2026-07-31 08:44:05 +00:00
const Commands = tmp2(11181).Commands;
2026-07-20 16:05:17 +00:00
Commands.setText(arg0, arg1);
} else {
const DCDChatInputLegacyManager = closure_4.DCDChatInputLegacyManager;
DCDChatInputLegacyManager.setText(callback(arg0), arg1);
}
2026-07-31 08:44:05 +00:00
obj = require(11179) /* useShouldUseFabricChatInput */;
2026-07-29 08:29:29 +00:00
tmp2 = require;
2026-07-20 16:05:17 +00:00
}
},
setSelectedRange(arg0, arg1, arg2) {
if (null != arg0) {
if (obj.shouldUseFabricChatInput()) {
2026-07-31 08:44:05 +00:00
const Commands = tmp3(11181).Commands;
2026-07-20 16:05:17 +00:00
Commands.setSelectedRange(arg0, arg1, arg2);
} else {
const DCDChatInputLegacyManager = closure_4.DCDChatInputLegacyManager;
DCDChatInputLegacyManager.setSelectedRange(callback(arg0), arg1, arg2);
}
2026-07-31 08:44:05 +00:00
obj = require(11179) /* useShouldUseFabricChatInput */;
2026-07-29 08:29:29 +00:00
tmp3 = require;
2026-07-20 16:05:17 +00:00
}
},
updateTextBlocks(arg0, arg1, arg2) {
if (null != arg0) {
if (obj.shouldUseFabricChatInput()) {
2026-07-31 08:44:05 +00:00
const Commands = tmp9(11181).Commands;
2026-07-20 16:05:17 +00:00
const _JSON = JSON;
const json = JSON.stringify(arg1);
2026-07-29 08:29:29 +00:00
Commands.updateTextBlocks(arg0, json, tmp6);
2026-07-20 16:05:17 +00:00
} else {
const DCDChatInputLegacyManager = closure_4.DCDChatInputLegacyManager;
2026-07-29 08:29:29 +00:00
DCDChatInputLegacyManager.updateTextBlocks(callback(arg0), arg1, tmp6);
2026-07-20 16:05:17 +00:00
}
2026-07-31 08:44:05 +00:00
obj = require(11179) /* useShouldUseFabricChatInput */;
2026-07-29 08:29:29 +00:00
tmp9 = require;
2026-07-20 16:05:17 +00:00
}
},
replaceRange(arg0, keepCursorPosition) {
let _location;
let length;
let nodes;
let text;
({ location: _location, length, text, nodes } = keepCursorPosition);
if (nodes === undefined) {
nodes = [];
}
let flag = keepCursorPosition.keepCursorPosition;
if (flag === undefined) {
flag = false;
}
const editId = keepCursorPosition.editId;
if (null != arg0) {
if (obj.shouldUseFabricChatInput()) {
2026-07-31 08:44:05 +00:00
const Commands = tmp20(11181).Commands;
2026-07-20 16:05:17 +00:00
const _JSON = JSON;
Commands.replaceRange(arg0, _location, length, text, JSON.stringify(nodes), flag, editId);
} else {
const DCDChatInputLegacyManager = closure_4.DCDChatInputLegacyManager;
DCDChatInputLegacyManager.replaceRange(callback(arg0), _location, length, text, nodes, flag, editId);
}
2026-07-31 08:44:05 +00:00
obj = require(11179) /* useShouldUseFabricChatInput */;
2026-07-29 08:29:29 +00:00
tmp20 = require;
2026-07-20 16:05:17 +00:00
}
}
};