decord/source/modules/chat/native/NativeChatUtils.tsx

243 lines
7.6 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 10894
// Function ID: 10895
2026-07-20 16:05:17 +00:00
// Name: ChatScrollPosition
2026-08-05 07:35:12 +00:00
// Dependencies: [17, 500, 10895, 1208, 4119, 10896, 10897, 2]
2026-07-20 16:05:17 +00:00
2026-08-05 07:35:12 +00:00
// Module 10894 (ChatScrollPosition)
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;
({ NativeModules: c3, findNodeHandle: c4 } = get_ActivityIndicator);
2026-07-20 16:05:17 +00:00
let obj = { TOP: 0, [0]: "TOP", MIDDLE: 1, [1]: "MIDDLE", BOTTOM: 2, [2]: "BOTTOM", NONE: 3, [3]: "NONE" };
obj = {
scrollTo(arg0, arg1, arg2) {
if (null != arg0) {
2026-07-29 08:29:29 +00:00
let obj = arg2;
if (arg2 == null) {
2026-07-20 16:05:17 +00:00
obj = {};
}
const animated = obj.animated;
const highlight = obj.highlight;
let TOP = obj.position;
if (undefined === TOP) {
TOP = obj.TOP;
}
if (obj2.isIOS()) {
2026-07-29 08:29:29 +00:00
const tmp15 = callback(arg0);
if (null != tmp15) {
2026-07-20 16:05:17 +00:00
const DCDChatManager = closure_3.DCDChatManager;
2026-07-29 08:29:29 +00:00
DCDChatManager.scrollTo(tmp15, arg1, tmp, tmp2, TOP);
2026-07-20 16:05:17 +00:00
}
} else {
2026-08-05 07:35:12 +00:00
const Commands = tmp5(10895).Commands;
2026-07-20 16:05:17 +00:00
Commands.scrollTo(arg0, arg1, tmp, tmp2, TOP);
}
2026-07-29 08:29:29 +00:00
obj2 = require(500) /* set */;
tmp5 = require;
2026-07-20 16:05:17 +00:00
}
},
scrollToBottom(arg0, arg1) {
if (null != arg0) {
if (obj.isIOS()) {
2026-07-29 08:29:29 +00:00
const tmp6 = callback(arg0);
if (null != tmp6) {
2026-07-20 16:05:17 +00:00
const DCDChatManager = closure_3.DCDChatManager;
2026-07-29 08:29:29 +00:00
DCDChatManager.scrollToBottom(tmp6, arg1);
2026-07-20 16:05:17 +00:00
}
} else {
2026-08-05 07:35:12 +00:00
const Commands = tmp2(10895).Commands;
2026-07-20 16:05:17 +00:00
Commands.scrollToBottom(arg0, arg1);
}
2026-07-29 08:29:29 +00:00
obj = require(500) /* set */;
tmp2 = require;
2026-07-20 16:05:17 +00:00
}
},
scrollToTop(arg0, arg1) {
if (null != arg0) {
if (obj.isIOS()) {
const tmp4 = callback(arg0);
if (null != tmp4) {
const DCDChatManager = closure_3.DCDChatManager;
DCDChatManager.scrollToTop(tmp4, arg1);
}
}
2026-07-29 08:29:29 +00:00
obj = require(500) /* set */;
2026-07-20 16:05:17 +00:00
}
},
scrollToRelativeOffset(arg0, arg1, arg2) {
if (null != arg0) {
if (obj.isIOS()) {
const tmp4 = callback(arg0);
if (null != tmp4) {
const DCDChatManager = closure_3.DCDChatManager;
const result = DCDChatManager.scrollToRelativeOffset(tmp4, arg1, arg2);
}
}
2026-07-29 08:29:29 +00:00
obj = require(500) /* set */;
2026-07-20 16:05:17 +00:00
}
},
scrollIntoView(arg0, arg1, arg2) {
if (null != arg0) {
2026-07-29 08:29:29 +00:00
let obj = arg2;
if (arg2 == null) {
2026-07-20 16:05:17 +00:00
obj = {};
}
const animated = obj.animated;
const highlight = obj.highlight;
if (obj2.isIOS()) {
2026-07-29 08:29:29 +00:00
const tmp13 = callback(arg0);
if (null != tmp13) {
2026-07-20 16:05:17 +00:00
const DCDChatManager = closure_3.DCDChatManager;
2026-07-29 08:29:29 +00:00
DCDChatManager.scrollIntoView(tmp13, arg1, tmp, tmp2);
2026-07-20 16:05:17 +00:00
}
} else {
2026-08-05 07:35:12 +00:00
const Commands = tmp4(10895).Commands;
2026-07-20 16:05:17 +00:00
Commands.scrollIntoView(arg0, arg1, tmp, tmp2);
}
2026-07-29 08:29:29 +00:00
obj2 = require(500) /* set */;
tmp4 = require;
2026-07-20 16:05:17 +00:00
}
},
updateRows(arg0, rows) {
2026-07-29 08:29:29 +00:00
let forceReload;
2026-07-20 16:05:17 +00:00
if (null != arg0) {
if (obj7.isIOS()) {
2026-08-05 07:35:12 +00:00
let tmp35Result = tmp35(4119);
2026-07-29 08:29:29 +00:00
if (tmp35Result.isFabric()) {
2026-08-05 07:35:12 +00:00
tmp35Result = tmp35(10896);
2026-07-29 08:29:29 +00:00
const andIncrementChangesetIdForChat = tmp35Result.getAndIncrementChangesetIdForChat(arg0);
({ rows, forceReload } = rows);
if (forceReload == null) {
forceReload = false;
}
let obj = { category: "chat.dispatch", message: null, data: null };
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
2026-07-29 08:29:29 +00:00
obj[1] = "updateRows dispatch id=" + andIncrementChangesetIdForChat + " ops=" + rows.length;
obj = { changesetUpdateId: null, opCount: null, rows: null, forceReload: null };
obj[0] = andIncrementChangesetIdForChat;
obj[1] = rows.length;
obj[2] = rows;
obj[3] = forceReload;
obj[2] = obj;
importDefault(1208).addBreadcrumb(obj);
2026-08-05 07:35:12 +00:00
const Commands = tmp35(10895).Commands;
2026-07-20 16:05:17 +00:00
const _JSON3 = JSON;
const json = JSON.stringify(rows.rows);
const isLoadingAtTop2 = rows.isLoadingAtTop;
2026-07-29 08:29:29 +00:00
let str3 = "";
2026-07-20 16:05:17 +00:00
if (null != rows.scrollData) {
const _JSON4 = JSON;
2026-07-29 08:29:29 +00:00
str3 = JSON.stringify(rows.scrollData);
}
let flag4 = rows.HACK_iOSForceAnimations;
if (flag4 == null) {
flag4 = false;
}
let flag5 = rows.forceReload;
if (flag5 == null) {
flag5 = false;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let flag6 = rows.isAnimated;
if (flag6 == null) {
flag6 = true;
}
Commands.updateRows(arg0, json, isLoadingAtTop2, str3, andIncrementChangesetIdForChat, flag4, flag5, flag6);
const obj4 = importDefault(1208);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const tmp2 = callback(arg0);
if (null != tmp2) {
if (tmp35Result1.isIOS()) {
2026-07-20 16:05:17 +00:00
let DCDChatManager = closure_3.DCDChatManager;
} else {
2026-08-05 07:35:12 +00:00
DCDChatManager = importDefault(10897);
2026-07-20 16:05:17 +00:00
}
const _JSON = JSON;
const json1 = JSON.stringify(rows.rows);
const isLoadingAtTop = rows.isLoadingAtTop;
let json2 = null;
if (null != rows.scrollData) {
const _JSON2 = JSON;
json2 = JSON.stringify(rows.scrollData);
}
2026-07-29 08:29:29 +00:00
tmp35Result1 = tmp35(500);
2026-08-05 07:35:12 +00:00
const andIncrementChangesetIdForChat1 = tmp35(10896).getAndIncrementChangesetIdForChat(arg0);
2026-07-29 08:29:29 +00:00
let flag = rows.HACK_iOSForceAnimations;
if (flag == null) {
flag = false;
}
let flag2 = rows.forceReload;
if (flag2 == null) {
flag2 = false;
}
let flag3 = rows.isAnimated;
if (flag3 == null) {
flag3 = true;
}
DCDChatManager.updateRows(tmp2, json1, isLoadingAtTop, json2, andIncrementChangesetIdForChat1, flag, flag2, flag3);
2026-08-05 07:35:12 +00:00
const tmp35Result2 = tmp35(10896);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj7 = require(500) /* set */;
2026-07-20 16:05:17 +00:00
}
},
clearRows(arg0) {
if (null != arg0) {
if (obj5.isIOS()) {
2026-08-05 07:35:12 +00:00
let tmp7Result = tmp7(4119);
2026-07-29 08:29:29 +00:00
if (tmp7Result.isFabric()) {
2026-08-05 07:35:12 +00:00
const Commands = tmp7(10895).Commands;
tmp7Result = tmp7(10896);
2026-07-29 08:29:29 +00:00
Commands.clearRows(arg0, tmp7Result.getAndIncrementChangesetIdForChat(arg0));
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const tmp2 = callback(arg0);
if (null != tmp2) {
if (tmp7Result1.isIOS()) {
2026-07-20 16:05:17 +00:00
let DCDChatManager = closure_3.DCDChatManager;
} else {
2026-08-05 07:35:12 +00:00
DCDChatManager = importDefault(10897);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp7Result1 = tmp7(500);
2026-08-05 07:35:12 +00:00
DCDChatManager.clearRows(tmp2, tmp7(10896).getAndIncrementChangesetIdForChat(arg0));
const tmp7Result2 = tmp7(10896);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj5 = require(500) /* set */;
2026-07-20 16:05:17 +00:00
}
},
fadeIn(arg0) {
if (null != arg0) {
2026-07-29 08:29:29 +00:00
if (obj.isIOS()) {
if (tmpResult.isFabric()) {
2026-08-05 07:35:12 +00:00
const Commands = tmp(10895).Commands;
2026-07-20 16:05:17 +00:00
Commands.fadeIn(arg0);
} else {
const tmp4 = callback(arg0);
if (null != tmp4) {
const DCDChatManager = closure_3.DCDChatManager;
DCDChatManager.fadeIn(tmp4);
}
}
2026-08-05 07:35:12 +00:00
tmpResult = tmp(4119);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = require(500) /* set */;
2026-07-20 16:05:17 +00:00
}
},
focus(arg0, arg1) {
if (obj.isIOS()) {
if (null != arg0) {
2026-07-29 08:29:29 +00:00
const tmp4 = callback(arg0);
if (null != tmp4) {
2026-07-20 16:05:17 +00:00
const DCDChatManager = closure_3.DCDChatManager;
2026-07-29 08:29:29 +00:00
DCDChatManager.focus(tmp4, arg1);
2026-07-20 16:05:17 +00:00
}
}
}
}
};
2026-07-23 10:11:24 +00:00
let result = require("__INTERNAL_VIEW_CONFIG").fileFinishedImporting("modules/chat/native/NativeChatUtils.tsx");
2026-07-20 16:05:17 +00:00
export default obj;
export const ChatScrollPosition = obj;
export const ChatScrollType = { SCROLL: 0, [0]: "SCROLL", FOCUS_ONLY: 1, [1]: "FOCUS_ONLY" };