重新构建dev产物(清理调试残留日志+本轮3处修复的编译产物)

This commit is contained in:
Your Name
2026-09-06 15:04:00 +08:00
parent 4715ea4497
commit cd092108c2
6 changed files with 118 additions and 28 deletions
+32 -10
View File
@@ -9334,12 +9334,13 @@ const TYPE_ROUTE = {
const TYPE_LABELS = [['all', '全部'], ['image', '图片'], ['video', '视频'], ['file', '文件'], ['voice', '语音'], ['text', '文本'], ['link', '链接']];
function Favorites({
view,
hashParams,
tinode,
onToast
}) {
const initialType = view === 'favorites-files' ? 'file' : view === 'favorites-text' ? 'text' : view === 'favorites-voice' ? 'voice' : view === 'favorites-links' ? 'link' : view === 'favorites-image' ? 'image' : view === 'favorites-video' ? 'video' : 'all';
const selecting = view === 'favorites-select';
const [type, setType] = react__WEBPACK_IMPORTED_MODULE_0___default().useState(selecting ? 'file' : initialType);
const [type, setType] = react__WEBPACK_IMPORTED_MODULE_0___default().useState(selecting ? hashParams && hashParams.type || 'file' : initialType);
const [queryInput, setQueryInput] = react__WEBPACK_IMPORTED_MODULE_0___default().useState('');
const query = (0,_lib_use_cached_data_js__WEBPACK_IMPORTED_MODULE_6__.useDebouncedValue)(queryInput, 300);
const [selected, setSelected] = react__WEBPACK_IMPORTED_MODULE_0___default().useState([]);
@@ -9432,9 +9433,11 @@ function Favorites({
className: "library-page",
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(Header, {
title: selecting ? `已选择 ${selected.length} 项` : '我的收藏',
back: selecting ? 'favorites-files' : 'messages-home',
back: selecting ? TYPE_ROUTE[type] || 'favorites-files' : 'messages-home',
right: selecting ? '取消' : '多选',
onRight: () => navigate(selecting ? 'favorites-files' : 'favorites-select')
onRight: () => navigate(selecting ? TYPE_ROUTE[type] || 'favorites-files' : 'favorites-select', selecting ? undefined : {
type
})
}, void 0, false), (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(Search, {
value: queryInput,
onChange: setQueryInput,
@@ -9446,6 +9449,7 @@ function Favorites({
className: type === id ? 'active' : '',
onClick: () => {
setType(id);
setSelected([]);
if (TYPE_ROUTE[id] && !selecting) navigateReplace(TYPE_ROUTE[id]);
},
children: label
@@ -9535,7 +9539,7 @@ function FavoriteShare({
return forTarget.length > 0 && forTarget.every(r => r.status === 'sent');
}).length;
onToast(successTargets === selected.length ? `已分享给 ${selected.length} 个会话` : `${successTargets}/${selected.length} 个会话分享成功`);
window.setTimeout(() => navigate('favorites-files'), 700);
window.setTimeout(() => navigate(TYPE_ROUTE[preview && preview.type] || 'favorites-files'), 700);
}).catch(err => onToast(err.message || '分享失败')).finally(() => setSending(false));
};
const previewAtt = preview && firstAttachment(preview.snapshot && preview.snapshot.content);
@@ -9548,7 +9552,10 @@ function FavoriteShare({
className: "library-page",
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(Header, {
title: "分享",
back: "favorites-select"
back: "favorites-select",
backParams: preview ? {
type: preview.type
} : undefined
}, void 0, false), !confirming ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.Fragment, {
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(Search, {
value: query,
@@ -10043,6 +10050,7 @@ function ContentLibraryView({
let content;
if (view.startsWith('favorites')) content = (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(Favorites, {
view: view,
hashParams: hashParams,
tinode: tinode,
onToast: setToast
}, void 0, false);else if (view === 'favorite-share') content = (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxDEV)(FavoriteShare, {
@@ -12609,6 +12617,14 @@ const FILE_TYPE_META = {
document: ['description', '#e05d44'],
file: ['insert_drive_file', '#8a8f98']
};
const DOCUMENT_EXT = ['pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx', 'txt'];
function fileTypeFromMime(mime, name) {
const prefix = (mime || '').split('/')[0];
if (prefix === 'image' || prefix === 'video' || prefix === 'audio') return prefix;
const ext = (/\.([a-zA-Z0-9]+)$/.exec(name || '') || [])[1];
if (mime === 'application/pdf' || DOCUMENT_EXT.includes((ext || '').toLowerCase())) return 'document';
return 'file';
}
function GroupFiles({
topic,
tinode,
@@ -12678,7 +12694,8 @@ function GroupFiles({
fileId,
fileName: file.name,
mimeType: file.type,
fileSize: file.size
fileSize: file.size,
fileType: fileTypeFromMime(file.type, file.name)
})).then(() => {
setUploading(null);
load();
@@ -13769,6 +13786,7 @@ function MessageActions() {
const NOTIFICATION_TEXT = {
'group.created': '你创建了一个新群聊',
'group.join_request.created': '有人申请加入你管理的群聊',
'group.announcement.updated': '群公告有更新',
'group.member.joined': '有成员加入了群聊',
'group.member.left': '有成员退出了群聊',
'group.member.updated': '群成员资料有更新',
@@ -18448,7 +18466,7 @@ class TinodeWeb extends (react__WEBPACK_IMPORTED_MODULE_0___default().Component)
}
let topicName = hash.path[1] || null;
if (topicName != this.state.topicSelected) {
if (!tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.topicType(topicName)) {
if (!tinode_sdk__WEBPACK_IMPORTED_MODULE_4__.Tinode.topicType(topicName) || !this.tinode.isAuthenticated()) {
topicName = null;
newState.mobilePanel = 'sidepanel';
} else {
@@ -20866,16 +20884,18 @@ function ImgFromFile({
}
const LEVEL_NUMERALS = ['一', '二', '三', '四', '五', '六', '七', '八', '九', '十'];
const levelLabel = n => LEVEL_NUMERALS[n - 1] || String(n);
const isMyUserId = (id, myUserId) => id === myUserId || 'usr' + id === myUserId;
function DeptRow({
dept,
depth,
expanded,
containsMe,
onToggle
}) {
const icon = depth === 0 ? 'business' : 'diamond';
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("button", {
type: "button",
className: `organization-department depth-${depth}${expanded ? ' expanded' : ''}`,
className: `organization-department depth-${depth}${containsMe ? ' me' : ''}`,
style: {
paddingLeft: `${1 + depth * 1.1}rem`
},
@@ -20961,11 +20981,13 @@ function DeptNode({
react__WEBPACK_IMPORTED_MODULE_0___default().useEffect(() => {
if (expanded) load();
}, []);
const containsMe = (members || []).some(p => isMyUserId(p.user_id, myUserId));
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)(DeptRow, {
dept: dept,
depth: depth,
expanded: expanded,
containsMe: containsMe,
onToggle: toggle
}, void 0, false), expanded && loading ? (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("p", {
className: "organization-loading",
@@ -20989,7 +21011,7 @@ function DeptNode({
person: person,
depth: depth + 1,
level: depth + 2,
isMe: person.user_id === myUserId || 'usr' + person.user_id === myUserId
isMe: isMyUserId(person.user_id, myUserId)
}, person.user_id, false))]
}, void 0, true) : null]
}, void 0, true);
@@ -21560,7 +21582,7 @@ function OrganizationDirectory({
person: item.user,
depth: 0,
level: 3,
isMe: item.user && (item.user.user_id === myUserId || 'usr' + item.user.user_id === myUserId)
isMe: !!(item.user && isMyUserId(item.user.user_id, myUserId))
}, 'u' + (item.user && item.user.user_id || idx), false))
}, void 0, false) : (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxDEV)("section", {
className: "organization-tree",
+1 -1
View File
File diff suppressed because one or more lines are too long
+30 -5
View File
@@ -619,13 +619,13 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
return nextState;
}
subscribe(topic) {
if (topic.isSubscribed() || !this.props.ready) {
if (!this.props.ready) {
return;
}
const newTopic = this.props.newTopicParams && this.props.newTopicParams._topicName == this.props.topic;
let getQuery = topic.startMetaQuery().withLaterDesc().withLaterSub().withAux();
if (this.state.isReader || newTopic) {
getQuery = getQuery.withLaterData(_config_js__WEBPACK_IMPORTED_MODULE_15__.MESSAGES_PAGE);
getQuery = getQuery.withData(undefined, undefined, _config_js__WEBPACK_IMPORTED_MODULE_15__.MESSAGES_PAGE);
if (this.state.isReader) {
getQuery = getQuery.withLaterDel();
}
@@ -634,7 +634,7 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
});
}
const setQuery = newTopic ? this.props.newTopicParams : undefined;
topic.subscribe(getQuery.build(), setQuery).then(ctrl => {
const doSubscribe = () => topic.subscribe(getQuery.build(), setQuery).then(ctrl => {
if (ctrl.code == 303) {
_lib_navigation_js__WEBPACK_IMPORTED_MODULE_20__["default"].navigateTo(_lib_navigation_js__WEBPACK_IMPORTED_MODULE_20__["default"].setUrlTopic('', ctrl.params.topic));
return;
@@ -673,6 +673,11 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
blankState.title = this.props.intl.formatMessage(messages.not_found);
this.setState(blankState);
});
if (topic.isSubscribed()) {
topic.leave(false).catch(_ => {}).then(doSubscribe);
return;
}
doSubscribe();
}
leave(oldTopicName) {
if (!oldTopicName || !this.props.tinode.isTopicCached(oldTopicName)) {
@@ -1317,7 +1322,6 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
if (!msg && this.props.forwardMessage) {
msg = this.props.forwardMessage.msg;
head = this.props.forwardMessage.head;
this.handleCancelReply();
} else if (this.state.reply) {
if (this.state.reply.editing) {
if (msg == this.state.contentToEdit) {
@@ -1337,7 +1341,6 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
}
msg = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.append(tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.sanitizeEntities(this.state.reply.content), msg);
}
this.handleCancelReply();
} else if (typeof msg == 'string' && this.mentionedUsers && this.mentionedUsers.length) {
const parsed = tinode_sdk__WEBPACK_IMPORTED_MODULE_2__.Drafty.parse(msg);
this.applyMentionResolution(parsed);
@@ -1360,6 +1363,7 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
const topicForDraft = this.state.topic;
const draftVersionAtSend = this.state.draftVersion || 0;
const doSend = () => {
this.handleCancelReply();
const result = this.props.sendMessage(msg, uploadCompletionPromise, uploader, head);
if (originalText != null && result && typeof result.then == 'function' && topicForDraft) {
result.then(() => this.clearDraft(topicForDraft, draftVersionAtSend));
@@ -2033,11 +2037,26 @@ class MessagesView extends (react__WEBPACK_IMPORTED_MODULE_0___default().Compone
if (!replyToSeq || isNaN(replyToSeq)) {
replyToSeq = null;
}
const systemActions = msg.content && typeof msg.content == 'object' && Array.isArray(msg.content.actions) ? msg.content.actions : null;
const isActionableSystemMessage = systemActions && systemActions.some(a => a && a.type == 'group_invitation_accept');
const isPlainSystemMessage = msg.head && (msg.head['x-im-type'] == 'system_notice' || msg.head['x-im-type'] == 'system_action') && !isActionableSystemMessage && msg.content && typeof msg.content == 'object' && typeof msg.content.text == 'string';
if (msg.hi) {
messageNodes.push((0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxDEV)(_widgets_meta_message_jsx__WEBPACK_IMPORTED_MODULE_11__["default"], {
deleted: true,
deletedText: this.props.intl.formatMessage(messages.message_deleted)
}, msg.seq, false));
} else if (isPlainSystemMessage) {
const thisDate = new Date(msg.ts);
if (!prevDate || prevDate.toDateString() != thisDate.toDateString()) {
messageNodes.push((0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxDEV)(_widgets_meta_message_jsx__WEBPACK_IMPORTED_MODULE_11__["default"], {
date: (0,_lib_strformat_js__WEBPACK_IMPORTED_MODULE_21__.relativeDateFormat)(msg.ts),
locale: this.props.intl.locale
}, 'date-' + msg.seq, false));
prevDate = thisDate;
}
messageNodes.push((0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxDEV)(_widgets_meta_message_jsx__WEBPACK_IMPORTED_MODULE_11__["default"], {
systemText: msg.content.text
}, msg.seq, false));
} else {
const thisDate = new Date(msg.ts);
if (!prevDate || prevDate.toDateString() != thisDate.toDateString()) {
@@ -3266,6 +3285,12 @@ class MetaMessage extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureComp
children: this.props.deletedText || '消息已删除'
}, void 0, false);
bubbleClass += ' deleted';
} else if (this.props.systemText) {
content = (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxDEV)("span", {
className: "gray",
children: this.props.systemText
}, void 0, false);
bubbleClass += ' system';
}
if (!content) {
return (0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxDEV)(react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
File diff suppressed because one or more lines are too long
+53 -10
View File
@@ -71,6 +71,7 @@ class CallPanel extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCompon
};
this.isOutgoingCall = props.callState == _constants_js__WEBPACK_IMPORTED_MODULE_4__.CALL_STATE_OUTGOING_INITATED;
this.containerRef = react__WEBPACK_IMPORTED_MODULE_0___default().createRef();
this.selfBoxRef = react__WEBPACK_IMPORTED_MODULE_0___default().createRef();
this.localRef = react__WEBPACK_IMPORTED_MODULE_0___default().createRef();
this.remoteRef = react__WEBPACK_IMPORTED_MODULE_0___default().createRef();
this.remoteIceCandidatesCache = [];
@@ -113,6 +114,7 @@ class CallPanel extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCompon
this.handleDataChannelOpen = this.handleDataChannelOpen.bind(this);
this.handleDataChannelClose = this.handleDataChannelClose.bind(this);
this.bounds = {};
this.dragTarget = null;
this.dragStart = event => {
if (!event.target.closest('.draggable')) {
return;
@@ -135,32 +137,72 @@ class CallPanel extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCompon
const parent = el.offsetParent;
this.bounds.maxX = parent.offsetWidth;
this.bounds.maxY = parent.offsetHeight;
this.dragTarget = 'container';
return;
}
if (!this.props.minimized && !this.state.audioOnly && this.selfBoxRef.current && event.target.closest('.call-party.self')) {
event.stopPropagation();
const el = this.selfBoxRef.current;
this.containerRef.current.setPointerCapture(event.pointerId);
el.style.cursor = 'grabbing';
this.bounds.left = el.offsetLeft;
this.bounds.top = el.offsetTop;
this.bounds.width = el.offsetWidth;
this.bounds.height = el.offsetHeight;
el.style.right = 'auto';
el.style.bottom = 'auto';
el.style.left = `${this.bounds.left}px`;
el.style.top = `${this.bounds.top}px`;
const parent = el.offsetParent;
this.bounds.maxX = parent.offsetWidth;
this.bounds.maxY = parent.offsetHeight;
this.dragTarget = 'self';
}
};
this.drag = event => {
event.stopPropagation();
const el = this.containerRef.current;
if (this.props.minimized && this.containerRef && el.hasPointerCapture(event.pointerId)) {
this.bounds.left = Math.min(Math.max(this.bounds.left + event.movementX, 0), this.bounds.maxX - this.bounds.width);
this.bounds.top = Math.min(Math.max(this.bounds.top + event.movementY, 0), this.bounds.maxY - this.bounds.height);
el.style.left = `${this.bounds.left}px`;
el.style.top = `${this.bounds.top}px`;
const container = this.containerRef.current;
if (!this.dragTarget || !container.hasPointerCapture(event.pointerId)) {
return;
}
const el = this.dragTarget == 'self' ? this.selfBoxRef.current : container;
if (!el) {
return;
}
this.bounds.left = Math.min(Math.max(this.bounds.left + event.movementX, 0), this.bounds.maxX - this.bounds.width);
this.bounds.top = Math.min(Math.max(this.bounds.top + event.movementY, 0), this.bounds.maxY - this.bounds.height);
el.style.left = `${this.bounds.left}px`;
el.style.top = `${this.bounds.top}px`;
};
this.dragEnd = event => {
event.stopPropagation();
if (this.props.minimized && this.containerRef) {
this.containerRef.current.releasePointerCapture(event.pointerId);
this.containerRef.current.style.cursor = 'grab';
const container = this.containerRef.current;
if (!this.dragTarget) {
return;
}
const el = this.dragTarget == 'self' ? this.selfBoxRef.current : container;
if (container && container.hasPointerCapture(event.pointerId)) {
container.releasePointerCapture(event.pointerId);
}
if (el) {
el.style.cursor = 'grab';
}
this.dragTarget = null;
};
this.handleWindowResize = () => {
if (this.props.minimized && this.containerRef && this.containerRef.current && window.matchMedia('(width<=640px)').matches) {
if (this.props.minimized && this.containerRef.current && window.matchMedia('(width<=640px)').matches) {
const el = this.containerRef.current;
el.style.removeProperty('left');
el.style.removeProperty('right');
el.style.removeProperty('top');
}
if (!this.props.minimized && this.selfBoxRef.current && window.matchMedia('(width<=768px)').matches) {
const el = this.selfBoxRef.current;
el.style.removeProperty('left');
el.style.removeProperty('right');
el.style.removeProperty('top');
el.style.removeProperty('bottom');
}
};
}
componentDidMount() {
@@ -782,6 +824,7 @@ class CallPanel extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCompon
className: "draggable",
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("div", {
className: "call-party self",
ref: this.selfBoxRef,
disabled: this.state.audioOnly || this.props.minimized,
children: [(0,react_jsx_dev_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxDEV)("video", {
ref: this.localRef,
File diff suppressed because one or more lines are too long