@awiki/dsh-plugin 0.3.0-rc.1 → 0.3.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -7
- package/README.zh.md +7 -3
- package/lib/client.js +1608 -478
- package/lib/client.js.map +1 -1
- package/lib/index.js +373 -36
- package/lib/provider.js +1 -1
- package/lib/{sdk-adapter-DLhLrLI6.mjs → sdk-adapter-BIbsJmRj.mjs} +28 -4
- package/lib/typert.host.js +221 -81
- package/lib/typert.remote-client.d.ts +5 -1
- package/lib/typert.remote-client.d.ts.map +1 -1
- package/lib/typert.remote-client.js +221 -81
- package/lib/types/client/AwikiGroupAccessNotice.d.ts +12 -0
- package/lib/types/client/AwikiGroupAccessNotice.d.ts.map +1 -0
- package/lib/types/client/AwikiGroupAccessNotice.js +31 -0
- package/lib/types/client/AwikiGroupAccessNotice.js.map +1 -0
- package/lib/types/client/AwikiGroupDetails.d.ts +8 -1
- package/lib/types/client/AwikiGroupDetails.d.ts.map +1 -1
- package/lib/types/client/AwikiGroupDetails.js +40 -4
- package/lib/types/client/AwikiGroupDetails.js.map +1 -1
- package/lib/types/client/AwikiIdentityAccess.d.ts +2 -1
- package/lib/types/client/AwikiIdentityAccess.d.ts.map +1 -1
- package/lib/types/client/AwikiIdentityAccess.js +10 -2
- package/lib/types/client/AwikiIdentityAccess.js.map +1 -1
- package/lib/types/client/AwikiMail.d.ts.map +1 -1
- package/lib/types/client/AwikiMail.js +5 -1
- package/lib/types/client/AwikiMail.js.map +1 -1
- package/lib/types/client/AwikiOnboarding.d.ts.map +1 -1
- package/lib/types/client/AwikiOnboarding.js +4 -1
- package/lib/types/client/AwikiOnboarding.js.map +1 -1
- package/lib/types/client/AwikiOverlay.d.ts.map +1 -1
- package/lib/types/client/AwikiOverlay.js +72 -11
- package/lib/types/client/AwikiOverlay.js.map +1 -1
- package/lib/types/client/AwikiRecoveryForm.d.ts +3 -0
- package/lib/types/client/AwikiRecoveryForm.d.ts.map +1 -1
- package/lib/types/client/AwikiRecoveryForm.js +10 -6
- package/lib/types/client/AwikiRecoveryForm.js.map +1 -1
- package/lib/types/client/AwikiSettingsSection.d.ts.map +1 -1
- package/lib/types/client/AwikiSettingsSection.js +5 -1
- package/lib/types/client/AwikiSettingsSection.js.map +1 -1
- package/lib/types/client/controller.d.ts +38 -2
- package/lib/types/client/controller.d.ts.map +1 -1
- package/lib/types/client/controller.js +473 -47
- package/lib/types/client/controller.js.map +1 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/index.js +3 -0
- package/lib/types/client/index.js.map +1 -1
- package/lib/types/client/recharge-availability.d.ts +1 -1
- package/lib/types/client/recharge-availability.d.ts.map +1 -1
- package/lib/types/client/recharge-availability.js +1 -1
- package/lib/types/client/recharge-availability.js.map +1 -1
- package/lib/types/client/settings-locales.d.ts +1 -1
- package/lib/types/client/settings-locales.d.ts.map +1 -1
- package/lib/types/client/settings-locales.js +6 -0
- package/lib/types/client/settings-locales.js.map +1 -1
- package/lib/types/client/slots.d.ts +6 -0
- package/lib/types/client/slots.d.ts.map +1 -1
- package/lib/types/conversation-preferences.d.ts +20 -0
- package/lib/types/conversation-preferences.d.ts.map +1 -0
- package/lib/types/conversation-preferences.js +294 -0
- package/lib/types/conversation-preferences.js.map +1 -0
- package/lib/types/index.d.ts +6 -1
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +39 -0
- package/lib/types/index.js.map +1 -1
- package/lib/types/sdk-adapter.d.ts.map +1 -1
- package/lib/types/sdk-adapter.js +35 -4
- package/lib/types/sdk-adapter.js.map +1 -1
- package/lib/types/types.d.ts +32 -1
- package/lib/types/types.d.ts.map +1 -1
- package/lib/types/types.js.map +1 -1
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ export function AwikiOnboarding(props) {
|
|
|
30
30
|
const enableModels = () => {
|
|
31
31
|
void props.models.setEnabled(true).catch(() => undefined);
|
|
32
32
|
};
|
|
33
|
-
const identityAccess = (sessionStatus) => (_jsx(AwikiIdentityAccess, { sessionStatus: sessionStatus, recoveryOperationId: identity.recoveryOperationId ?? null, recoveryProgress: identity.recoveryProgress ?? null, pending: identity.pending !== null, autoFocusHandle: sessionStatus === 'unregistered', inspectIdentityAccess: request => props.identity.inspectIdentityAccess(request), sendRegistrationOtp: request => props.identity.sendRegistrationOtp(request), registerIdentity: request => props.identity.registerIdentity(request), login: () => props.identity.login(), clearLocalIdentity: async () => {
|
|
33
|
+
const identityAccess = (sessionStatus) => (_jsx(AwikiIdentityAccess, { sessionStatus: sessionStatus, identity: identity.identity, recoveryOperationId: identity.recoveryOperationId ?? null, recoveryProgress: identity.recoveryProgress ?? null, pending: identity.pending !== null, autoFocusHandle: sessionStatus === 'unregistered', inspectIdentityAccess: request => props.identity.inspectIdentityAccess(request), sendRegistrationOtp: request => props.identity.sendRegistrationOtp(request), registerIdentity: request => props.identity.registerIdentity(request), login: () => props.identity.login(), clearLocalIdentity: async () => {
|
|
34
34
|
const result = await props.identity.clearLocalData({ confirmation: AWIKI_CLEAR_LOCAL_DATA_CONFIRMATION });
|
|
35
35
|
return result.ok ? { ok: true, value: undefined } : result;
|
|
36
36
|
}, sendRecoveryOtp: request => props.identity.sendRecoveryOtp(request), prepareRecovery: request => props.identity.prepareRecovery(request), activateRecovery: () => props.identity.activateRecovery(), refreshRecoveryStatus: () => props.identity.refreshRecoveryStatus(), resumeRecovery: () => props.identity.resumeRecovery(), discardRecovery: () => props.identity.discardRecovery() }));
|
|
@@ -77,6 +77,9 @@ export function AwikiOnboarding(props) {
|
|
|
77
77
|
if (identity.sessionStatus === 'signed-out') {
|
|
78
78
|
return (_jsxs(OnboardingModal, { title: t('onboardingRestoreTitle'), closeLabel: t('onboardingClose'), onClose: dismiss, children: [_jsx("p", { className: css.description, children: t('onboardingRestoreDescription') }), identityAccess('signed-out'), _jsx("div", { className: css.actions, children: alternatives })] }));
|
|
79
79
|
}
|
|
80
|
+
if (identity.sessionStatus === 'recovery-required') {
|
|
81
|
+
return (_jsxs(OnboardingModal, { title: t('onboardingRecoveryRequiredTitle'), closeLabel: t('onboardingClose'), onClose: dismiss, children: [_jsx("p", { className: css.description, children: t('onboardingRecoveryRequiredDescription') }), identityAccess('recovery-required'), _jsx("div", { className: css.actions, children: alternatives })] }));
|
|
82
|
+
}
|
|
80
83
|
if ((models.status === 'idle' || models.status === 'loading') && models.account === null)
|
|
81
84
|
return null;
|
|
82
85
|
const account = models.account?.account;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AwikiOnboarding.js","sourceRoot":"","sources":["../../../src/client/AwikiOnboarding.tsx"],"names":[],"mappings":";AAAA,mFAAmF;AAEnF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,uCAAuC,CAAA;AAKrE,OAAO,EAAE,mCAAmC,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA2B,CAAA;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAAgC,CAAA;AACzE,OAAO,GAAG,MAAM,8BAA8B,CAAA;AAoB9C,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,MAAM,EAAE,CAAC,EAAE,GAAG,KAAK,CAAA;IACnB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,QAAQ,CAAA;IAC/C,MAAM,QAAQ,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAC,KAAgB,EAAE,EAAE,CAAC,KAAK,CAAC,CAAA;IACtE,MAAM,YAAY,GAAG,KAAK,CAAC,yBAAyB,CAAC,CAAC,KAA4B,EAAE,EAAE,CAAC,KAAK,CAAC,CAAA;IAC7F,MAAM,MAAM,GAAG,KAAK,CAAC,kBAAkB,CAAC,CAAC,KAA0B,EAAE,EAAE,CAAC,KAAK,CAAC,CAAA;IAC9E,MAAM,CAAC,sBAAs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AC,GAC/D,CACV,CAAC,CAAC,CAAC,IAAI,EACP,YAAY,IACT,IACU,CACnB,CAAA;AACH,CAAC;AAED,SAAS,eAAe,CAAC,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAK9D;IACC,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,IAAI,GAAG,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAA;QAC5C,IAAI,IAAI,KAAK,IAAI;YAAE,OAAM;QACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAA;QAC3B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAA;QACjB,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAA,CAAC,CAAC,CAAA;IACxC,CAAC,EAAE,EAAE,CAAC,CAAA;IACN,OAAO,CACL,KAAC,KAAK,IAAC,IAAI,QAAC,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,IAAI,EAAE,EAAE,gBAAgB,EAAE,GAAG,CAAC,YAAsB,YAC3I,cAAK,SAAS,EAAE,GAAG,CAAC,OAAO,YACxB,QAAQ,GACL,GACA,CACT,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AwikiOverlay.d.ts","sourceRoot":"","sources":["../../../src/client/AwikiOverlay.tsx"],"names":[],"mappings":"AAAA,+EAA+E;
|
|
1
|
+
{"version":3,"file":"AwikiOverlay.d.ts","sourceRoot":"","sources":["../../../src/client/AwikiOverlay.tsx"],"names":[],"mappings":"AAAA,+EAA+E;AAkD/E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAGnD,eAAO,MAAM,2BAA2B,mCAAmC,CAAA;AAC3E,eAAO,MAAM,sBAAsB,8BAA8B,CAAA;AAmBjE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,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wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,+BAwuBpD"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
/** AWiki trigger, identity registration, and direct/group messaging drawer. */
|
|
3
3
|
import { useEffect, useId, useLayoutEffect, useRef, useState } from 'react';
|
|
4
|
-
import { IconChevronLeftOutline14, IconCheckOutline16, IconChecklistOutline14, IconChevronDownOutline14, IconCloseOutline16, IconCopyOutline16, IconDataOutline16, IconDownloadOutline16, IconGlobeOutline14, IconGoalOutline16, IconLoadingOutline16, IconPaperclipOutline16, IconPlusOutline16, IconRefreshOutline16, IconRefreshOutline14, IconSendOutline16, IconSettingsOutline16, IconSparkle16, Button, Menu, Modal, Tooltip, } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
4
|
+
import { IconChevronLeftOutline14, IconCheckOutline16, IconChecklistOutline14, IconArchiveOutline20, IconChevronDownOutline14, IconCloseOutline16, IconCopyOutline16, IconDataOutline16, IconDownloadOutline16, IconEllipsisOutline16, IconGlobeOutline14, IconGoalOutline16, IconLoadingOutline16, IconPaperclipOutline16, IconPlusOutline16, IconRefreshOutline16, IconRefreshOutline14, IconSendOutline16, IconSettingsOutline16, IconSparkle16, Button, Menu, Modal, Tooltip, } from '@deepseek-ai/dsh-client-ui-primitives';
|
|
5
5
|
import { AWIKI_ME_APP_ICON_DATA_URL } from "./assets.js";
|
|
6
6
|
import { createAttachmentObjectUrl, fileToBase64, saveDownloadedAttachment } from "./file.js";
|
|
7
7
|
import { AwikiMail } from "./AwikiMail.js";
|
|
8
|
+
import { AwikiGroupAccessNotice } from "./AwikiGroupAccessNotice.js";
|
|
8
9
|
import { AwikiGroupDetails } from "./AwikiGroupDetails.js";
|
|
9
10
|
import { AwikiIdentityAccess } from "./AwikiIdentityAccess.js";
|
|
10
11
|
import { AwikiProfileCard } from "./AwikiProfileCard.js";
|
|
@@ -15,7 +16,7 @@ export const AWIKI_LAUNCHER_POSITION_KEY = 'dsh-awiki-launcher-position-v1';
|
|
|
15
16
|
export const AWIKI_DRAWER_FRAME_KEY = 'dsh-awiki-drawer-frame-v1';
|
|
16
17
|
const LAUNCHER_SIZE = 48;
|
|
17
18
|
const LAUNCHER_EDGE_GAP = 8;
|
|
18
|
-
const
|
|
19
|
+
const LAUNCHER_LEFT_OFFSET = 176;
|
|
19
20
|
const LAUNCHER_BOTTOM_CLEARANCE = 152;
|
|
20
21
|
const LAUNCHER_DRAG_THRESHOLD = 4;
|
|
21
22
|
const DRAWER_LONG_PRESS_MS = 300;
|
|
@@ -117,7 +118,7 @@ export function resizeAwikiDrawerFrame(frame, direction, deltaX, deltaY, viewpor
|
|
|
117
118
|
}
|
|
118
119
|
function defaultLauncherPosition() {
|
|
119
120
|
return clampAwikiLauncherPosition({
|
|
120
|
-
left:
|
|
121
|
+
left: LAUNCHER_LEFT_OFFSET,
|
|
121
122
|
top: window.innerHeight - LAUNCHER_SIZE - LAUNCHER_BOTTOM_CLEARANCE,
|
|
122
123
|
}, window.innerWidth, window.innerHeight);
|
|
123
124
|
}
|
|
@@ -203,11 +204,20 @@ function senderLabel(message, peerLabel) {
|
|
|
203
204
|
}
|
|
204
205
|
/** Render one direct or group conversation row. */
|
|
205
206
|
function ConversationRow(props) {
|
|
207
|
+
const [menuOpen, setMenuOpen] = useState(false);
|
|
208
|
+
const labelId = useId();
|
|
206
209
|
const label = conversationLabel(props.conversation);
|
|
207
210
|
const unreadCount = props.conversation.unreadCount ?? 0;
|
|
208
211
|
const unreadLabel = unreadCount > 99 ? '99+' : String(unreadCount);
|
|
209
212
|
const preview = props.conversation.lastMessagePreview ?? '暂无消息';
|
|
210
|
-
return (_jsxs("
|
|
213
|
+
return (_jsxs("div", { className: css.conversationRow, "data-active": props.active || undefined, children: [_jsxs("button", { type: "button", className: css.conversationSelect, "aria-label": unreadCount > 0 ? `${label},${unreadCount} 条未读消息` : undefined, onClick: props.onSelect, children: [_jsxs("span", { className: css.avatar, children: [props.conversation.kind === 'direct' ? '私' : '群', unreadCount > 0 && _jsx("span", { className: css.conversationUnreadBadge, "aria-hidden": "true", children: unreadLabel })] }), _jsxs("span", { className: css.conversationText, children: [_jsxs("span", { className: css.conversationHeader, children: [_jsx("strong", { id: labelId, children: label }), props.conversation.lastMessageAt !== undefined && (_jsx("time", { className: css.conversationTime, children: conversationTime(props.conversation.lastMessageAt) }))] }), _jsx("small", { children: preview })] })] }), _jsx(Menu, { open: menuOpen, onClose: () => { setMenuOpen(false); }, align: "end", portal: true, compact: true, items: [{
|
|
214
|
+
id: 'remove',
|
|
215
|
+
label: '从会话列表移除',
|
|
216
|
+
icon: _jsx(IconArchiveOutline20, { size: 14 }),
|
|
217
|
+
}], onSelect: () => {
|
|
218
|
+
setMenuOpen(false);
|
|
219
|
+
props.onRemove();
|
|
220
|
+
}, anchor: (_jsx("button", { type: "button", className: css.conversationMenu, "aria-label": "\u66F4\u591A\u4F1A\u8BDD\u64CD\u4F5C", "aria-describedby": labelId, title: `管理会话:${label}`, "aria-expanded": menuOpen, "aria-haspopup": "menu", disabled: props.pending, onClick: (event) => { event.stopPropagation(); setMenuOpen(value => !value); }, children: _jsx(IconEllipsisOutline16, { size: 15 }) })) })] }));
|
|
211
221
|
}
|
|
212
222
|
/** Render one AWiki message, including an attachment download action. */
|
|
213
223
|
function MessageRow(props) {
|
|
@@ -315,6 +325,10 @@ function Chat(props) {
|
|
|
315
325
|
const [file, setFile] = useState(null);
|
|
316
326
|
const [sendingDraft, setSendingDraft] = useState(null);
|
|
317
327
|
const [groupDetailsOpen, setGroupDetailsOpen] = useState(false);
|
|
328
|
+
const [threadMenuOpen, setThreadMenuOpen] = useState(false);
|
|
329
|
+
const [hiddenConversationsOpen, setHiddenConversationsOpen] = useState(false);
|
|
330
|
+
const [removeCandidate, setRemoveCandidate] = useState(null);
|
|
331
|
+
const [conversationPreferenceError, setConversationPreferenceError] = useState(null);
|
|
318
332
|
const [previewUrl, setPreviewUrl] = useState(null);
|
|
319
333
|
const [fileError, setFileError] = useState(null);
|
|
320
334
|
const input = useRef(null);
|
|
@@ -329,6 +343,12 @@ function Chat(props) {
|
|
|
329
343
|
const [historyAwayFromBottom, setHistoryAwayFromBottom] = useState(false);
|
|
330
344
|
const [unseenMessageCount, setUnseenMessageCount] = useState(0);
|
|
331
345
|
const selected = view.conversations.find(value => value.id === view.selectedConversationId);
|
|
346
|
+
const selectedGroupAccess = selected?.kind === 'group'
|
|
347
|
+
? view.groupAccess?.groupDid === selected.groupDid
|
|
348
|
+
? view.groupAccess
|
|
349
|
+
: { groupDid: selected.groupDid, status: 'loading' }
|
|
350
|
+
: null;
|
|
351
|
+
const groupWritable = selectedGroupAccess === null || selectedGroupAccess.status === 'available';
|
|
332
352
|
const candidates = mentionQuery === null || selected?.kind !== 'group'
|
|
333
353
|
? []
|
|
334
354
|
: mentionCandidates(view.groupMembers, view.identity.did, mentionQuery.query);
|
|
@@ -345,7 +365,12 @@ function Chat(props) {
|
|
|
345
365
|
setMentionQuery(null);
|
|
346
366
|
setMentionCandidateIndex(0);
|
|
347
367
|
setGroupDetailsOpen(false);
|
|
368
|
+
setThreadMenuOpen(false);
|
|
348
369
|
}, [view.selectedConversationId]);
|
|
370
|
+
useEffect(() => {
|
|
371
|
+
if (view.hiddenConversations.length === 0)
|
|
372
|
+
setHiddenConversationsOpen(false);
|
|
373
|
+
}, [view.hiddenConversations.length]);
|
|
349
374
|
useEffect(() => {
|
|
350
375
|
if (mentionCandidateIndex >= candidates.length)
|
|
351
376
|
setMentionCandidateIndex(0);
|
|
@@ -578,7 +603,25 @@ function Chat(props) {
|
|
|
578
603
|
setMentionDrafts(mentionDrafts);
|
|
579
604
|
}
|
|
580
605
|
};
|
|
581
|
-
|
|
606
|
+
const removeConversation = async () => {
|
|
607
|
+
if (removeCandidate === null)
|
|
608
|
+
return;
|
|
609
|
+
setConversationPreferenceError(null);
|
|
610
|
+
const result = await props.hideConversation(removeCandidate.id);
|
|
611
|
+
if (!result.ok) {
|
|
612
|
+
setConversationPreferenceError(result.error);
|
|
613
|
+
return;
|
|
614
|
+
}
|
|
615
|
+
setRemoveCandidate(null);
|
|
616
|
+
setGroupDetailsOpen(false);
|
|
617
|
+
};
|
|
618
|
+
const restoreConversation = async (conversationId) => {
|
|
619
|
+
setConversationPreferenceError(null);
|
|
620
|
+
const result = await props.restoreConversation(conversationId);
|
|
621
|
+
if (!result.ok)
|
|
622
|
+
setConversationPreferenceError(result.error);
|
|
623
|
+
};
|
|
624
|
+
return (_jsxs("div", { className: css.chat, children: [_jsxs("aside", { className: css.roster, "data-hidden": selected !== undefined || undefined, "aria-label": "\u4F1A\u8BDD", children: [_jsx(AwikiProfileCard, { identity: view.identity, profile: view.profile, pending: view.pending !== null, updateProfile: props.updateProfile }), props.modeTabs, _jsxs("div", { className: css.rosterHeader, children: [_jsx("div", { className: css.rosterTitle, children: "\u4F1A\u8BDD" }), _jsxs("div", { className: css.rosterActions, children: [view.hiddenConversations.length > 0 && (_jsx(Tooltip, { label: "\u67E5\u770B\u5DF2\u9690\u85CF\u4F1A\u8BDD", side: "right", children: _jsxs("button", { type: "button", className: css.rosterAction, "aria-label": `查看已隐藏会话,${view.hiddenConversations.length} 个`, onClick: () => { setConversationPreferenceError(null); setHiddenConversationsOpen(true); }, children: [_jsx(IconArchiveOutline20, { size: 15 }), _jsx("small", { children: view.hiddenConversations.length > 99 ? '99+' : view.hiddenConversations.length })] }) })), props.composeMenu] })] }), view.groupRecovery !== null && (_jsxs("div", { className: css.groupRecoveryNotice, "data-status": view.groupRecovery.status, role: view.groupRecovery.status === 'blocked' ? 'alert' : 'status', children: [_jsxs("span", { children: [_jsx("strong", { children: view.groupRecovery.status === 'pending'
|
|
582
625
|
? '正在恢复旧群聊身份'
|
|
583
626
|
: view.groupRecovery.status === 'blocked'
|
|
584
627
|
? '部分旧群聊需要处理'
|
|
@@ -586,7 +629,15 @@ function Chat(props) {
|
|
|
586
629
|
? `${view.groupRecovery.pending} 个群聊尚未完成,其他会话不受影响。`
|
|
587
630
|
: view.groupRecovery.status === 'blocked'
|
|
588
631
|
? `${view.groupRecovery.blocked} 个群聊未能自动恢复,其他会话不受影响。`
|
|
589
|
-
: '私聊和新群聊不受影响,可稍后重试。' })] }), _jsx(Tooltip, { label: "\u91CD\u8BD5\u7FA4\u804A\u8EAB\u4EFD\u6062\u590D", side: "right", children: _jsx("button", { type: "button", "aria-label": "\u91CD\u8BD5\u7FA4\u804A\u8EAB\u4EFD\u6062\u590D", disabled: view.pending !== null, onClick: () => { void props.retryGroupRebindRecovery(); }, children: _jsx(IconRefreshOutline14, { size: 14 }) }) })] })), _jsxs("div", { className: css.conversationList, children: [view.conversations.map(conversation => (_jsx(ConversationRow, { conversation: conversation, active: conversation.id === view.selectedConversationId, onSelect: () => { void props.selectConversation(conversation.id); } }, conversation.id))), view.conversations.length === 0 && _jsx("p", { className: css.empty, children: "\u8FD8\u6CA1\u6709\u53EF\u7528\u7684\u79C1\u804A\u6216\u7FA4\u804A\u3002" })] }), view.conversationsHasMore && _jsx("button", { type: "button", className: css.more, onClick: () => { void props.loadMoreConversations(); }, children: "\u52A0\u8F7D\u66F4\u591A\u4F1A\u8BDD" })] }), _jsx("section", { className: css.thread, "data-visible": selected !== undefined || undefined, children: selected === undefined ? (_jsxs("div", { className: css.threadEmpty, children: [_jsx(IconGlobeOutline14, { size: 28 }), _jsx("p", { children: "\u9009\u62E9\u4E00\u4E2A\u79C1\u804A\u6216\u7FA4\u804A\u67E5\u770B\u6D88\u606F\u3002" })] })) : (_jsxs(_Fragment, { children: [_jsxs("header", { className: css.threadHeader, children: [_jsx("button", { type: "button", className: css.back, "aria-label": "\u8FD4\u56DE\u4F1A\u8BDD\u5217\u8868", onClick: () => { void props.selectConversation(null); }, children: _jsx(IconChevronLeftOutline14, {}) }), _jsxs("div", { className: css.threadTitle, children: [_jsx("strong", { children: conversationLabel(selected) }), _jsx("small", { children: selected.kind === 'direct' ? '私聊' : '群聊' })] }), selected.kind === 'group' && (_jsx(Tooltip, { label: "\u7FA4\u804A\u8BE6\u60C5", side: "bottom", children: _jsx("button", { type: "button", className: css.threadAction, "aria-label": "\u6253\u5F00\u7FA4\u804A\u8BE6\u60C5", "aria-expanded": groupDetailsOpen, onClick: () => { setGroupDetailsOpen(value => !value); }, children: _jsx(IconSettingsOutline16, { size: 15 }) }) })),
|
|
632
|
+
: '私聊和新群聊不受影响,可稍后重试。' })] }), _jsx(Tooltip, { label: "\u91CD\u8BD5\u7FA4\u804A\u8EAB\u4EFD\u6062\u590D", side: "right", children: _jsx("button", { type: "button", "aria-label": "\u91CD\u8BD5\u7FA4\u804A\u8EAB\u4EFD\u6062\u590D", disabled: view.pending !== null, onClick: () => { void props.retryGroupRebindRecovery(); }, children: _jsx(IconRefreshOutline14, { size: 14 }) }) }), _jsx(Tooltip, { label: "\u7A0D\u540E\u5904\u7406", side: "right", children: _jsx("button", { type: "button", "aria-label": "\u5173\u95ED\u65E7\u7FA4\u804A\u5904\u7406\u63D0\u793A", disabled: view.pending !== null, onClick: () => { void props.dismissGroupRecoveryNotice(); }, children: _jsx(IconCloseOutline16, { size: 14 }) }) })] })), _jsxs("div", { className: css.conversationList, children: [view.conversations.map(conversation => (_jsx(ConversationRow, { conversation: conversation, active: conversation.id === view.selectedConversationId, pending: view.pending !== null, onSelect: () => { void props.selectConversation(conversation.id); }, onRemove: () => { setConversationPreferenceError(null); setRemoveCandidate(conversation); } }, conversation.id))), view.conversations.length === 0 && _jsx("p", { className: css.empty, children: "\u8FD8\u6CA1\u6709\u53EF\u7528\u7684\u79C1\u804A\u6216\u7FA4\u804A\u3002" })] }), view.conversationsHasMore && _jsx("button", { type: "button", className: css.more, onClick: () => { void props.loadMoreConversations(); }, children: "\u52A0\u8F7D\u66F4\u591A\u4F1A\u8BDD" })] }), _jsx("section", { className: css.thread, "data-visible": selected !== undefined || undefined, children: selected === undefined ? (_jsxs("div", { className: css.threadEmpty, children: [_jsx(IconGlobeOutline14, { size: 28 }), _jsx("p", { children: "\u9009\u62E9\u4E00\u4E2A\u79C1\u804A\u6216\u7FA4\u804A\u67E5\u770B\u6D88\u606F\u3002" })] })) : (_jsxs(_Fragment, { children: [_jsxs("header", { className: css.threadHeader, children: [_jsx("button", { type: "button", className: css.back, "aria-label": "\u8FD4\u56DE\u4F1A\u8BDD\u5217\u8868", onClick: () => { void props.selectConversation(null); }, children: _jsx(IconChevronLeftOutline14, {}) }), _jsxs("div", { className: css.threadTitle, children: [_jsx("strong", { children: conversationLabel(selected) }), _jsx("small", { children: selected.kind === 'direct' ? '私聊' : '群聊' })] }), selected.kind === 'group' && (_jsx(Tooltip, { label: "\u7FA4\u804A\u8BE6\u60C5", side: "bottom", children: _jsx("button", { type: "button", className: css.threadAction, "aria-label": "\u6253\u5F00\u7FA4\u804A\u8BE6\u60C5", "aria-expanded": groupDetailsOpen, onClick: () => { setGroupDetailsOpen(value => !value); }, children: _jsx(IconSettingsOutline16, { size: 15 }) }) })), _jsx(Menu, { open: threadMenuOpen, onClose: () => { setThreadMenuOpen(false); }, align: "end", portal: true, compact: true, items: [{
|
|
633
|
+
id: 'remove',
|
|
634
|
+
label: '从会话列表移除',
|
|
635
|
+
icon: _jsx(IconArchiveOutline20, { size: 14 }),
|
|
636
|
+
}], onSelect: () => {
|
|
637
|
+
setThreadMenuOpen(false);
|
|
638
|
+
setConversationPreferenceError(null);
|
|
639
|
+
setRemoveCandidate(selected);
|
|
640
|
+
}, anchor: (_jsx("button", { type: "button", className: css.threadAction, "aria-label": "\u66F4\u591A\u4F1A\u8BDD\u64CD\u4F5C", "aria-expanded": threadMenuOpen, "aria-haspopup": "menu", disabled: view.pending !== null, onClick: () => { setThreadMenuOpen(value => !value); }, children: _jsx(IconEllipsisOutline16, { size: 15 }) })) }), _jsxs("button", { type: "button", className: css.summaryTrigger, "aria-controls": summaryPanelId, "aria-expanded": summary === undefined ? undefined : !summary.collapsed, "aria-label": summary?.status === 'loading' ? '正在生成 AI 总结' : summary?.collapsed === true ? '展开 AI 总结' : '生成 AI 总结', disabled: summary?.status === 'loading', onClick: () => {
|
|
590
641
|
if (summary !== undefined && !summary.collapsed && summary.status !== 'error') {
|
|
591
642
|
props.setSummaryCollapsed(selected.id, true);
|
|
592
643
|
}
|
|
@@ -596,9 +647,9 @@ function Chat(props) {
|
|
|
596
647
|
else {
|
|
597
648
|
void props.summarizeConversation();
|
|
598
649
|
}
|
|
599
|
-
}, children: [summary?.status === 'loading' ? _jsx(IconLoadingOutline16, { size: 14 }) : _jsx(IconSparkle16, { size: 14 }), _jsx("span", { children: summary?.status === 'loading' ? '总结中' : 'AI 总结' }), summary !== undefined && _jsx(IconChevronDownOutline14, { size: 12 })] })] }), selected.kind === 'group' && groupDetailsOpen && (_jsx(AwikiGroupDetails, { group: view.selectedGroup, members: view.groupMembers, hasMore: view.groupMembersHasMore, identity: view.identity, pending: view.pending !== null, refreshSelectedGroup: props.refreshSelectedGroup, loadMoreGroupMembers: props.loadMoreGroupMembers, addSelectedGroupMember: props.addSelectedGroupMember, removeSelectedGroupMember: props.removeSelectedGroupMember, leaveSelectedGroup: props.leaveSelectedGroup, onClose: () => { setGroupDetailsOpen(false); } })), summary !== undefined && (_jsx(SummaryPanel, { id: summaryPanelId, summary: summary, regenerate: () => { void props.summarizeConversation(); }, collapse: collapsed => { props.setSummaryCollapsed(selected.id, collapsed); }, viewSource: viewSummarySource })), _jsxs("div", { className: css.historyShell, children: [_jsxs("div", { ref: history, className: css.history, role: "log", "aria-label": "\u6D88\u606F\u8BB0\u5F55", onScroll: syncHistoryPosition, children: [view.historyHasMore && _jsx("button", { type: "button", className: css.more, onClick: () => { void props.loadOlderHistory(); }, children: "\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F" }), view.localPending && (_jsxs("div", { className: css.historyLoading, role: "status", "aria-live": "polite", "aria-label": "\u6B63\u5728\u8BFB\u53D6\u672C\u5730\u6D88\u606F", children: [_jsx(IconLoadingOutline16, { size: 18 }), _jsx("span", { children: "\u6B63\u5728\u8BFB\u53D6\u672C\u5730\u6D88\u606F\u2026" })] })), !view.localPending && view.refreshing && view.messages.length === 0 && (_jsxs("div", { className: css.historyLoading, role: "status", "aria-live": "polite", "aria-label": "\u6B63\u5728\u540C\u6B65\u6D88\u606F", children: [_jsx(IconLoadingOutline16, { size: 18 }), _jsx("span", { children: "\u6B63\u5728\u540C\u6B65\u6D88\u606F\u2026" })] })), view.messages.map(message => (_jsx(MessageRow, { message: message, peerLabel: selected.kind === 'direct' ? conversationLabel(selected) : undefined, download: props.downloadAttachment, onImageLoad: scrollAfterInitialImage }, message.id))), visibleSendingDraft !== null && _jsx(PendingMessageRow, { draft: visibleSendingDraft }), !view.localPending && !view.refreshing && view.messages.length === 0 && visibleSendingDraft === null && _jsx("p", { className: css.empty, children: "\u6682\u65E0\u6D88\u606F\u3002" })] }), historyAwayFromBottom && (_jsxs("button", { type: "button", className: css.latestMessages, "aria-label": unseenMessageCount === 0 ? '下滑到最新消息' : `有 ${unseenMessageCount} 条新消息,下滑到最新消息`, onClick: () => { scrollHistoryToLatest(true); }, children: [_jsx(IconChevronDownOutline14, { size: 14 }), unseenMessageCount > 0 && _jsxs("span", { children: ["\u65B0\u6D88\u606F\uFF08", unseenMessageCount, "\uFF09"] })] }))] }), _jsxs("div", { className: css.composer, children: [fileError !== null && _jsx("small", { className: css.inlineError, role: "alert", children: fileError }), _jsxs("div", { className: css.composeInput, children: [file !== null && (_jsxs("div", { className: css.filePreview, "data-image": previewUrl !== null || undefined, children: [previewUrl === null
|
|
650
|
+
}, children: [summary?.status === 'loading' ? _jsx(IconLoadingOutline16, { size: 14 }) : _jsx(IconSparkle16, { size: 14 }), _jsx("span", { children: summary?.status === 'loading' ? '总结中' : 'AI 总结' }), summary !== undefined && _jsx(IconChevronDownOutline14, { size: 12 })] })] }), selectedGroupAccess !== null && selectedGroupAccess.status !== 'available' && (_jsx(AwikiGroupAccessNotice, { access: selectedGroupAccess, pending: view.pending !== null, onRetry: () => { void props.refreshSelectedGroup(); }, onRejoin: () => { void props.joinGroup(selectedGroupAccess.groupDid); }, onBack: () => { void props.selectConversation(null); }, onRemove: () => { setConversationPreferenceError(null); setRemoveCandidate(selected); } })), selected.kind === 'group' && groupDetailsOpen && (_jsx(AwikiGroupDetails, { group: view.selectedGroup, fallback: { groupDid: selected.groupDid, title: conversationLabel(selected) }, access: selectedGroupAccess ?? { groupDid: selected.groupDid, status: 'loading' }, members: view.groupMembers, hasMore: view.groupMembersHasMore, identity: view.identity, pending: view.pending !== null, refreshSelectedGroup: props.refreshSelectedGroup, loadMoreGroupMembers: props.loadMoreGroupMembers, addSelectedGroupMember: props.addSelectedGroupMember, removeSelectedGroupMember: props.removeSelectedGroupMember, leaveSelectedGroup: props.leaveSelectedGroup, joinGroup: props.joinGroup, onClose: () => { setGroupDetailsOpen(false); }, onRemove: () => { setConversationPreferenceError(null); setRemoveCandidate(selected); } })), summary !== undefined && (_jsx(SummaryPanel, { id: summaryPanelId, summary: summary, regenerate: () => { void props.summarizeConversation(); }, collapse: collapsed => { props.setSummaryCollapsed(selected.id, collapsed); }, viewSource: viewSummarySource })), _jsxs("div", { className: css.historyShell, children: [_jsxs("div", { ref: history, className: css.history, role: "log", "aria-label": "\u6D88\u606F\u8BB0\u5F55", onScroll: syncHistoryPosition, children: [view.historyHasMore && _jsx("button", { type: "button", className: css.more, onClick: () => { void props.loadOlderHistory(); }, children: "\u52A0\u8F7D\u66F4\u65E9\u6D88\u606F" }), view.localPending && (_jsxs("div", { className: css.historyLoading, role: "status", "aria-live": "polite", "aria-label": "\u6B63\u5728\u8BFB\u53D6\u672C\u5730\u6D88\u606F", children: [_jsx(IconLoadingOutline16, { size: 18 }), _jsx("span", { children: "\u6B63\u5728\u8BFB\u53D6\u672C\u5730\u6D88\u606F\u2026" })] })), !view.localPending && view.refreshing && view.messages.length === 0 && (_jsxs("div", { className: css.historyLoading, role: "status", "aria-live": "polite", "aria-label": "\u6B63\u5728\u540C\u6B65\u6D88\u606F", children: [_jsx(IconLoadingOutline16, { size: 18 }), _jsx("span", { children: "\u6B63\u5728\u540C\u6B65\u6D88\u606F\u2026" })] })), view.messages.map(message => (_jsx(MessageRow, { message: message, peerLabel: selected.kind === 'direct' ? conversationLabel(selected) : undefined, download: props.downloadAttachment, onImageLoad: scrollAfterInitialImage }, message.id))), visibleSendingDraft !== null && _jsx(PendingMessageRow, { draft: visibleSendingDraft }), !view.localPending && !view.refreshing && view.messages.length === 0 && visibleSendingDraft === null && _jsx("p", { className: css.empty, children: "\u6682\u65E0\u6D88\u606F\u3002" })] }), historyAwayFromBottom && (_jsxs("button", { type: "button", className: css.latestMessages, "aria-label": unseenMessageCount === 0 ? '下滑到最新消息' : `有 ${unseenMessageCount} 条新消息,下滑到最新消息`, onClick: () => { scrollHistoryToLatest(true); }, children: [_jsx(IconChevronDownOutline14, { size: 14 }), unseenMessageCount > 0 && _jsxs("span", { children: ["\u65B0\u6D88\u606F\uFF08", unseenMessageCount, "\uFF09"] })] }))] }), _jsxs("div", { className: css.composer, children: [fileError !== null && _jsx("small", { className: css.inlineError, role: "alert", children: fileError }), _jsxs("div", { className: css.composeInput, children: [file !== null && (_jsxs("div", { className: css.filePreview, "data-image": previewUrl !== null || undefined, children: [previewUrl === null
|
|
600
651
|
? _jsx("span", { className: css.filePreviewIcon, children: _jsx(IconPaperclipOutline16, {}) })
|
|
601
|
-
: _jsx("img", { src: previewUrl, alt: file.name }), previewUrl === null && _jsx("span", { className: css.filePreviewName, children: file.name }), _jsx("button", { type: "button", className: css.removeFile, "aria-label": `移除附件 ${file.name}`, onClick: clearFile, children: _jsx(IconCloseOutline16, { size: 12 }) })] })), mentionQuery !== null && candidates.length > 0 && (_jsx("div", { id: mentionListId, className: css.mentionCandidates, role: "listbox", "aria-label": "\u53EF\u63D0\u53CA\u7684\u7FA4\u6210\u5458", children: candidates.map((candidate, index) => (_jsxs("button", { type: "button", role: "option", "aria-selected": index === mentionCandidateIndex, onMouseDown: (event) => { event.preventDefault(); chooseMention(index); }, children: [_jsx("span", { children: candidate.label.slice(0, 1).toLocaleUpperCase() }), _jsx("strong", { children: candidate.label }), _jsx("small", { children: candidate.member.handle ?? candidate.member.did })] }, candidate.member.did))) })), _jsx("textarea", { ref: composer, value: text, "aria-controls": mentionQuery !== null && candidates.length > 0 ? mentionListId : undefined, "aria-expanded": mentionQuery !== null && candidates.length > 0, "aria-autocomplete": "list", onChange: (event) => {
|
|
652
|
+
: _jsx("img", { src: previewUrl, alt: file.name }), previewUrl === null && _jsx("span", { className: css.filePreviewName, children: file.name }), _jsx("button", { type: "button", className: css.removeFile, "aria-label": `移除附件 ${file.name}`, disabled: !groupWritable, onClick: clearFile, children: _jsx(IconCloseOutline16, { size: 12 }) })] })), mentionQuery !== null && candidates.length > 0 && (_jsx("div", { id: mentionListId, className: css.mentionCandidates, role: "listbox", "aria-label": "\u53EF\u63D0\u53CA\u7684\u7FA4\u6210\u5458", children: candidates.map((candidate, index) => (_jsxs("button", { type: "button", role: "option", "aria-selected": index === mentionCandidateIndex, onMouseDown: (event) => { event.preventDefault(); chooseMention(index); }, children: [_jsx("span", { children: candidate.label.slice(0, 1).toLocaleUpperCase() }), _jsx("strong", { children: candidate.label }), _jsx("small", { children: candidate.member.handle ?? candidate.member.did })] }, candidate.member.did))) })), _jsx("textarea", { ref: composer, value: text, disabled: !groupWritable, "aria-controls": mentionQuery !== null && candidates.length > 0 ? mentionListId : undefined, "aria-expanded": mentionQuery !== null && candidates.length > 0, "aria-autocomplete": "list", onChange: (event) => {
|
|
602
653
|
const next = event.target.value;
|
|
603
654
|
setMentionDrafts(current => transformMentionDrafts(text, next, current));
|
|
604
655
|
setText(next);
|
|
@@ -631,7 +682,15 @@ function Chat(props) {
|
|
|
631
682
|
event.preventDefault();
|
|
632
683
|
if (view.pending === null && sendingDraft === null && (file !== null || text.trim() !== ''))
|
|
633
684
|
void sendMessage();
|
|
634
|
-
}, placeholder:
|
|
685
|
+
}, placeholder: groupWritable ? '输入消息' : '当前群聊暂不可发送消息', rows: 2 }), _jsxs("div", { className: css.composeActions, children: [_jsx(Tooltip, { label: "\u6DFB\u52A0\u9644\u4EF6", side: "top", children: _jsx("button", { type: "button", className: css.filePicker, "aria-label": "\u6DFB\u52A0\u9644\u4EF6", disabled: !groupWritable || view.pending !== null || sendingDraft !== null, onClick: () => { input.current?.click(); }, children: _jsx(IconPaperclipOutline16, {}) }) }), _jsx("input", { ref: input, type: "file", className: css.fileInput, "aria-label": "\u9009\u62E9\u4E00\u4E2A\u9644\u4EF6", disabled: !groupWritable, onChange: (event) => { setFile(event.target.files?.[0] ?? null); setFileError(null); } }), _jsx("button", { type: "button", className: css.send, "aria-label": "\u53D1\u9001\u6D88\u606F", disabled: !groupWritable || view.pending !== null || sendingDraft !== null || (file === null && text.trim() === ''), onClick: () => { void sendMessage(); }, children: _jsx(IconSendOutline16, {}) })] })] })] })] })) }), _jsx(Modal, { open: removeCandidate !== null, onClose: () => { if (view.pending === null) {
|
|
686
|
+
setRemoveCandidate(null);
|
|
687
|
+
setConversationPreferenceError(null);
|
|
688
|
+
} }, title: "\u4ECE\u4F1A\u8BDD\u5217\u8868\u79FB\u9664", closeLabel: "\u53D6\u6D88", className: css.compactModal ?? '', description: removeCandidate === null
|
|
689
|
+
? ''
|
|
690
|
+
: `“${conversationLabel(removeCandidate)}”只会从本机最近会话中移除,不会${removeCandidate.kind === 'group' ? '退出群聊或' : ''}清除已有消息。收到新消息后可能重新出现。`, footer: _jsxs(_Fragment, { children: [_jsx(Button, { type: "button", variant: "outline", disabled: view.pending !== null, onClick: () => { setRemoveCandidate(null); setConversationPreferenceError(null); }, children: "\u53D6\u6D88" }), _jsx(Button, { type: "button", variant: "outline", disabled: view.pending !== null, onClick: () => { void removeConversation(); }, children: "\u786E\u8BA4\u79FB\u9664" })] }), children: conversationPreferenceError !== null && _jsx("div", { className: css.conversationPreferenceError, role: "alert", children: conversationPreferenceError }) }), _jsxs(Modal, { open: hiddenConversationsOpen, onClose: () => { if (view.pending === null) {
|
|
691
|
+
setHiddenConversationsOpen(false);
|
|
692
|
+
setConversationPreferenceError(null);
|
|
693
|
+
} }, title: "\u5DF2\u9690\u85CF\u4F1A\u8BDD", closeLabel: "\u5173\u95ED", className: css.compactModal ?? '', description: "\u8FD9\u4E9B\u4F1A\u8BDD\u53EA\u5728\u672C\u673A\u5217\u8868\u4E2D\u9690\u85CF\uFF0C\u6D88\u606F\u548C\u7FA4\u6210\u5458\u5173\u7CFB\u6CA1\u6709\u6539\u53D8\u3002", footer: _jsx(Button, { type: "button", variant: "outline", disabled: view.pending !== null, onClick: () => { setHiddenConversationsOpen(false); setConversationPreferenceError(null); }, children: "\u5B8C\u6210" }), children: [_jsx("div", { className: css.hiddenConversationList, children: view.hiddenConversations.map(conversation => (_jsxs("div", { className: css.hiddenConversationRow, children: [_jsx("span", { className: css.avatar, children: conversation.kind === 'direct' ? '私' : '群' }), _jsxs("span", { children: [_jsx("strong", { children: conversationLabel(conversation) }), _jsx("small", { children: conversation.lastMessagePreview ?? '暂无消息' })] }), _jsx("button", { type: "button", disabled: view.pending !== null, onClick: () => { void restoreConversation(conversation.id); }, children: "\u6062\u590D" })] }, conversation.id))) }), conversationPreferenceError !== null && _jsx("div", { className: css.conversationPreferenceError, role: "alert", children: conversationPreferenceError })] })] }));
|
|
635
694
|
}
|
|
636
695
|
/**
|
|
637
696
|
* Render the frame-wide AWiki trigger and right-side drawer.
|
|
@@ -675,7 +734,7 @@ export function AwikiOverlay(props) {
|
|
|
675
734
|
const launcherDrag = useRef(null);
|
|
676
735
|
const drawerDrag = useRef(null);
|
|
677
736
|
const drawerResize = useRef(null);
|
|
678
|
-
const registered = view.status === 'ready' && view.identity !== null;
|
|
737
|
+
const registered = view.status === 'ready' && view.sessionStatus === 'active' && view.identity !== null;
|
|
679
738
|
const unreadCount = view.conversations.reduce((total, conversation) => total + (conversation.unreadCount ?? 0), 0);
|
|
680
739
|
const unreadLabel = unreadCount > 99 ? '99+' : String(unreadCount);
|
|
681
740
|
const nominalDrawerWidth = Math.min(mode === 'mail' ? MAIL_DRAWER_NOMINAL_WIDTH : DRAWER_NOMINAL_WIDTH, Math.max(1, window.innerWidth - (window.innerWidth <= 620 ? DRAWER_COMPACT_HORIZONTAL_RESERVE : DRAWER_HORIZONTAL_RESERVE)));
|
|
@@ -1052,7 +1111,9 @@ export function AwikiOverlay(props) {
|
|
|
1052
1111
|
setAccountMenuOpen(false);
|
|
1053
1112
|
setLogoutError(null);
|
|
1054
1113
|
setLogoutOpen(true);
|
|
1055
|
-
}, anchor: (_jsx("button", { type: "button", "aria-label": "AWiki \u8D26\u6237\u83DC\u5355", "aria-expanded": accountMenuOpen, "aria-haspopup": "menu", onClick: () => { setAccountMenuOpen(value => !value); }, children: _jsx(IconGlobeOutline14, { size: 18 }) })) })) : _jsx(IconGlobeOutline14, { size: 18 }), _jsx("h2", { id: titleId, children: "AWiki" })] }), mode === 'chat' && (_jsx("button", { type: "button", "aria-label": "\u5237\u65B0 AWiki", disabled: view.pending !== null, onClick: () => { void props.open(); }, children: _jsx(IconRefreshOutline16, {}) })), _jsx("button", { type: "button", "aria-label": "\u5173\u95ED AWiki", onClick: props.actions.close, children: _jsx(IconCloseOutline16, {}) })] }), view.status === 'loading' && _jsx("div", { className: css.centerState, role: "status", children: "\u6B63\u5728\u8FDE\u63A5 AWiki\u2026" }), view.status === 'error' && _jsxs("div", { className: css.centerState, children: [_jsx("p", { children: view.error }), _jsx("button", { type: "button", className: css.primary, onClick: () => { void props.open(); }, children: "\u91CD\u8BD5" })] }), view.status === 'ready' && (view.sessionStatus === 'unregistered'
|
|
1114
|
+
}, anchor: (_jsx("button", { type: "button", "aria-label": "AWiki \u8D26\u6237\u83DC\u5355", "aria-expanded": accountMenuOpen, "aria-haspopup": "menu", onClick: () => { setAccountMenuOpen(value => !value); }, children: _jsx(IconGlobeOutline14, { size: 18 }) })) })) : _jsx(IconGlobeOutline14, { size: 18 }), _jsx("h2", { id: titleId, children: "AWiki" })] }), mode === 'chat' && (_jsx("button", { type: "button", "aria-label": "\u5237\u65B0 AWiki", disabled: view.pending !== null, onClick: () => { void props.open(); }, children: _jsx(IconRefreshOutline16, {}) })), _jsx("button", { type: "button", "aria-label": "\u5173\u95ED AWiki", onClick: props.actions.close, children: _jsx(IconCloseOutline16, {}) })] }), view.status === 'loading' && _jsx("div", { className: css.centerState, role: "status", children: "\u6B63\u5728\u8FDE\u63A5 AWiki\u2026" }), view.status === 'error' && _jsxs("div", { className: css.centerState, children: [_jsx("p", { children: view.error }), _jsx("button", { type: "button", className: css.primary, onClick: () => { void props.open(); }, children: "\u91CD\u8BD5" })] }), view.status === 'ready' && (view.sessionStatus === 'unregistered'
|
|
1115
|
+
|| view.sessionStatus === 'signed-out'
|
|
1116
|
+
|| view.sessionStatus === 'recovery-required') && (_jsx("div", { className: css.identityAccess, children: _jsx(AwikiIdentityAccess, { ...props, sessionStatus: view.sessionStatus, identity: view.identity, recoveryOperationId: view.recoveryOperationId, recoveryProgress: view.recoveryProgress, pending: view.pending !== null }) })), view.status === 'ready' && view.sessionStatus === 'active' && view.identity !== null && (_jsxs(_Fragment, { children: [_jsx("div", { className: css.modePanel, "data-active": mode === 'chat' || undefined, hidden: mode !== 'chat', children: _jsx(Chat, { ...props, selectConversation: selectConversation, view: { ...view, identity: view.identity }, modeTabs: _jsx(ModeTabs, { mode: mode, mailUnreadCount: mailUnreadCount, onChange: setMode }), composeMenu: (_jsx(Menu, { open: menuOpen, onClose: () => { setMenuOpen(false); }, align: "end", portal: true, compact: true, items: [
|
|
1056
1117
|
{ id: 'direct', label: '发起私聊' },
|
|
1057
1118
|
{ id: 'group', label: '发起群聊' },
|
|
1058
1119
|
{ id: 'join-group', label: '加入群聊' },
|