@alexsun-top/opencode-chat-room 0.6.6 → 0.6.8
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/CHANGELOG.md +28 -0
- package/README.md +6 -3
- package/README.zh-CN.md +7 -3
- package/cli.ts +1 -1
- package/docs/administrator-rooms.md +11 -5
- package/index.ts +2 -2
- package/package.json +6 -2
- package/plugin.ts +57 -26
- package/server/admin-routes.ts +15 -7
- package/server/admin-state.ts +2 -2
- package/server/announcement-routes.ts +2 -2
- package/server/assets/attachments.css +25 -0
- package/server/assets/base.css +251 -39
- package/server/assets/chat/admin-badge.js +49 -0
- package/server/assets/chat/admin.js +77 -24
- package/server/assets/chat/announcements.js +27 -11
- package/server/assets/chat/attachment-store.js +106 -0
- package/server/assets/chat/attachments.js +245 -25
- package/server/assets/chat/events.js +56 -12
- package/server/assets/chat/image-zoom.js +141 -0
- package/server/assets/chat/index.js +10 -0
- package/server/assets/chat/install-prompt.js +82 -0
- package/server/assets/chat/join-requests.js +355 -0
- package/server/assets/chat/markdown.js +82 -5
- package/server/assets/chat/members.js +16 -6
- package/server/assets/chat/message-polling.js +158 -0
- package/server/assets/chat/message-window.js +14 -0
- package/server/assets/chat/messages.js +12 -132
- package/server/assets/chat/panels.js +37 -0
- package/server/assets/chat/questions.js +10 -6
- package/server/assets/chat/recall.js +279 -0
- package/server/assets/chat/receipts.js +3 -1
- package/server/assets/chat/reminders.js +67 -9
- package/server/assets/chat/replies.js +1 -1
- package/server/assets/chat/room-list.js +60 -0
- package/server/assets/chat/room-watcher.js +5 -1
- package/server/assets/chat/rooms.js +36 -84
- package/server/assets/chat/shortcuts.js +254 -0
- package/server/assets/chat/state.js +97 -24
- package/server/assets/chat/system-messages.js +28 -7
- package/server/assets/conversation.css +18 -26
- package/server/assets/keyboard-hints.css +51 -0
- package/server/assets/recall.css +29 -0
- package/server/assets/responsive.css +58 -16
- package/server/chat-server.ts +81 -62
- package/server/chat.html +238 -72
- package/server/history-route.ts +1 -1
- package/server/inbox.ts +3 -3
- package/server/join-requests.ts +106 -0
- package/server/member-routes.ts +4 -4
- package/server/message-recall-routes.ts +37 -0
- package/server/newrooms.ts +105 -13
- package/server/resource-routes.ts +19 -5
- package/server/room-join.ts +59 -0
- package/server/room-owner.ts +72 -0
- package/server/room-payload.ts +6 -2
- package/server/room-reminders.ts +3 -3
- package/server/sw.js +2 -0
- package/server/wake.ts +48 -19
- package/skills/chatroom/SKILL.md +35 -1
- package/src/README.md +22 -0
- package/src/{admin-client.ts → agent/admin-client.ts} +39 -9
- package/src/{admin-credentials.ts → agent/admin-credentials.ts} +1 -1
- package/src/{agent-presence.ts → agent/agent-presence.ts} +2 -2
- package/src/{agent-receipts.ts → agent/agent-receipts.ts} +2 -2
- package/src/{announcement-tool.ts → agent/announcement-tool.ts} +2 -2
- package/src/{chatroom-skill.ts → agent/chatroom-skill.ts} +1 -1
- package/src/{center-client.ts → center/center-client.ts} +103 -13
- package/src/{center-inbox.ts → center/center-inbox.ts} +44 -19
- package/src/{center-wake.ts → center/center-wake.ts} +31 -18
- package/src/{mentions.ts → center/mentions.ts} +1 -1
- package/src/center/message-ids.ts +7 -0
- package/src/center/notification-budget.ts +16 -0
- package/src/{queue-transport.ts → center/queue-transport.ts} +3 -3
- package/src/{queue.ts → center/queue.ts} +16 -6
- package/src/{reminder-client.ts → center/reminder-client.ts} +1 -1
- package/src/{session-delivery.ts → center/session-delivery.ts} +1 -1
- package/src/{announcements.ts → rooms/announcements.ts} +2 -2
- package/src/{resource-upload.ts → rooms/resource-upload.ts} +1 -1
- package/src/{resources.ts → rooms/resources.ts} +55 -9
- package/src/{room-service.ts → rooms/room-service.ts} +22 -2
- package/src/{background.ts → runtime/background.ts} +3 -3
- package/src/{plugin-notifications.ts → runtime/plugin-notifications.ts} +45 -19
- package/src/{v1-plugin.ts → runtime/v1-plugin.ts} +4 -4
- package/src/{v2-plugin.ts → runtime/v2-plugin.ts} +10 -10
- package/src/{v2-receiver.ts → runtime/v2-receiver.ts} +7 -7
- package/src/{watch.ts → runtime/watch.ts} +12 -12
- package/src/{member-state.ts → state/member-state.ts} +2 -2
- package/src/state/roles.ts +34 -0
- package/src/{sqlite-state.ts → state/sqlite-state.ts} +226 -37
- package/src/{store.ts → state/store.ts} +23 -4
- package/src/tests/announcement-board.ts +185 -0
- /package/src/{resource-read.ts → rooms/resource-read.ts} +0 -0
- /package/src/{receiver-owner.ts → state/receiver-owner.ts} +0 -0
- /package/src/{receiver-state.ts → state/receiver-state.ts} +0 -0
|
@@ -15,6 +15,7 @@ export const app = {
|
|
|
15
15
|
},
|
|
16
16
|
rendered: 0,
|
|
17
17
|
firstMessageId: null,
|
|
18
|
+
locale: "en",
|
|
18
19
|
pollDelay: 2000,
|
|
19
20
|
copyTimer: 0,
|
|
20
21
|
failedRenderIds: new Set(),
|
|
@@ -136,6 +137,7 @@ export function createAuth(storage, fetcher, translate = (key) => key, sessionSt
|
|
|
136
137
|
set name(value) { ensureIdentity(); browserIdentity.name = String(value ?? "").slice(0, 64); writeSession("chat.name", browserIdentity.name || null); saveIdentity(); },
|
|
137
138
|
get token() { return read("chat.token") || ""; }, set token(value) { write("chat.token", value || null); },
|
|
138
139
|
get locale() { return read("chat.locale") || "en"; }, set locale(value) { write("chat.locale", value || null); },
|
|
140
|
+
get keyHintsOff() { return read("chat.keyHintsOff") === "1"; }, set keyHintsOff(value) { write("chat.keyHintsOff", value ? "1" : null); },
|
|
139
141
|
get joinedRoomIds() {
|
|
140
142
|
try {
|
|
141
143
|
const ids = JSON.parse(readSession("chat.joinedRoomIds") || "[]");
|
|
@@ -204,12 +206,30 @@ const messages = {
|
|
|
204
206
|
languageLabel: "Language", roomIdLabel: "Room ID", roomIdPlaceholder: "Paste or enter a room ID",
|
|
205
207
|
nameLabel: "Your name", namePlaceholder: "What should we call you?", joinRoom: "Join room",
|
|
206
208
|
or: "or", newRoomNameLabel: "New room name", newRoomNamePlaceholder: "e.g. Weekend movie night",
|
|
207
|
-
createRoom: "Create room",
|
|
209
|
+
createRoom: "Create room", joinRoomTitle: "Join a room", joinRoomHint: "Someone shared a room ID with you? Paste it here.",
|
|
210
|
+
createRoomTitle: "Create a room", createRoomHint: "Start a new room and invite people with its ID.",
|
|
211
|
+
requireApproval: "Require approval to join", requireApprovalHint: "New members need a human administrator's approval. Agents may also be approved by the administrator agent.",
|
|
212
|
+
joinPolicyEditHint: "New members need a human administrator's approval. Turning this off clears all pending requests.", joinPolicyOpenConfirm: "Turn off approval? All pending join requests will be cleared.",
|
|
213
|
+
approvalRequired: "Approval required", joinRequired: "Approval required", joinPendingStatus: "Approval pending",
|
|
214
|
+
joinPendingTitle: "Waiting for approval", joinPendingBody: ({ name }) => `Your request to join “${name}” was sent. A human administrator must approve it before you can join.`,
|
|
215
|
+
joinPendingHint: "You can leave this page; the request stays pending. Check the room list later.", joinPendingNotice: ({ name }) => `Request sent to join “${name}”. Waiting for a human administrator.`, joinPendingCheck: "Check again", joinPendingStop: "Stop waiting",
|
|
216
|
+
joinPendingGoneTitle: "Request not pending", joinPendingGoneBody: "It may have been denied or cleared. You can send a new request.", joinPendingAgain: "Request again",
|
|
217
|
+
joinPendingError: "Could not check the request. Try again.", joinPendingRoomGone: "This room is gone, or you no longer have access.",
|
|
218
|
+
joinNameTaken: "That name is already used in this room. Choose another name.",
|
|
219
|
+
joinRequestsTitle: "Join requests", joinRequestsHint: "Agent requests can also be approved by the administrator agent.", joinRequestsEmpty: "No pending requests.",
|
|
220
|
+
joinRequestsLoadFailed: "Could not load join requests.", joinRequestAlreadyHandled: "This request was already handled.", joinRequestApprove: "Approve", joinRequestDeny: "Deny", joinRequestAgent: "Agent", joinRequestHuman: "Human",
|
|
221
|
+
joinRequestApproveLabel: ({ name }) => `Approve ${name}`, joinRequestDenyLabel: ({ name }) => `Deny ${name}`,
|
|
222
|
+
joinRequestTime: ({ time }) => `Requested ${time}`, joinRequestApproved: ({ name }) => `${name} approved.`, joinRequestDenied: ({ name }) => `${name} denied.`,
|
|
223
|
+
joinRequestActionFailed: ({ message }) => `Could not update the request: ${message}`, membersWithRequests: ({ count }) => `Members, ${count} join request${count === 1 ? "" : "s"} pending`,
|
|
224
|
+
joinRequestBadgeOne: " request", joinRequestBadgeMany: " requests",
|
|
225
|
+
accessKeyTitle: "Access key", accessKeyHint: "This server asks for an access key. It stays in this browser and is sent with each request.",
|
|
226
|
+
tokenOptional: "Access token (optional)", bearerToken: "Bearer token",
|
|
208
227
|
tokenPlaceholder: "Enter if the server requires it", save: "Save",
|
|
209
228
|
tokenHint: "If the server requires an access token (401), all requests will include it.",
|
|
210
229
|
existingRooms: "Rooms", noRooms: "No rooms yet. Create one.", copyRoomId: "Copy room ID", loadingHistory: "Loading earlier messages",
|
|
211
|
-
editRoom: "Edit room", roomNameLabel: "Room name", roomDescriptionLabel: "Description", adminAgentLabel: "Administrator agent",
|
|
212
|
-
|
|
230
|
+
editRoom: "Edit room", roomOwnerOnlyTitle: "Owner or administrator only", roomOwnerOnlyNote: ({ owner }) => `Only the room owner or a room administrator can change these settings. This room belongs to ${owner}.`, roomNameLabel: "Room name", roomDescriptionLabel: "Description", adminAgentLabel: "Administrator agent", roomOwnerBadge: "Owner", roomAdminBadge: "Admin",
|
|
231
|
+
adminIdsLabel: "Human administrators", adminIdsHint: "These members can edit room details, manage members, delete files, and choose a successor. The owner always has the same powers.", adminIdsEmpty: "No other members are in this room yet.", newOwnerLabel: "New owner", newOwnerHint: "Hand the room to another person who is in it. Only the owner can do this; agents cannot own a room.",
|
|
232
|
+
successorLabel: "Successor if the owner leaves", successorNone: "Longest-present member", successorHint: "If the owner leaves, this person becomes owner. If an administrator leaves, this person takes that role. Leave empty to use the longest-present member.", ownerOnlySettingsNote: "Only the owner can change the administrator agent or hand off the room.", adminAgentHint: "The designated agent can use the admin tool to inspect this room and its history. Only the owner can change this; leave empty for none.",
|
|
213
233
|
noAdminAgent: "None", roomNameRequired: "Room name is required", openQuestions: ({ count }) => `${count} unanswered question${count === 1 ? "" : "s"}`,
|
|
214
234
|
newRoom: "Create a room",
|
|
215
235
|
copyRoomIdTitle: ({ id }) => `Click to copy the full room ID: ${id}`, copied: "Copied",
|
|
@@ -221,9 +241,10 @@ const messages = {
|
|
|
221
241
|
reminderText: "Reminder text", reminderTemplateHint: "Use {{time}}, {{initiator}}, and {{room}} in your message.", reminderCreate: "Create reminder",
|
|
222
242
|
reminderLoading: "Loading reminders…", reminderEmpty: "No reminders yet.", reminderPaused: "Paused", reminderNext: ({ time }) => `Next: ${time}`,
|
|
223
243
|
reminderPause: "Pause", reminderResume: "Resume", reminderDelete: "Delete", reminderDeleteConfirm: "Delete this reminder?",
|
|
244
|
+
reminderEdit: "Edit", reminderEditHeading: "Edit reminder", reminderSave: "Save changes",
|
|
224
245
|
reminderCreated: "Reminder created.", reminderUpdated: "Reminder updated.", reminderDeleted: "Reminder deleted.",
|
|
225
246
|
reminderInvalid: "Check the date, 5-field CRON expression, IANA timezone, and reminder text.", reminderLoadFailed: "Could not load reminders. Your draft is still here.",
|
|
226
|
-
diagramLoading: "Rendering diagram…", diagramRenderFailed: "Diagram unavailable; showing its source.", resourceLoading: "Loading file…", resourceFailed: "This file could not be loaded.", resourceDownload: "Download", resourcePreview: "Preview", resourceHide: "Hide preview",
|
|
247
|
+
diagramLoading: "Rendering diagram…", diagramRenderFailed: "Diagram unavailable; showing its source.", resourceLoading: "Loading file…", resourceFailed: "This file could not be loaded.", resourceDownload: "Download", resourceMoreActions: "More actions for {name}", resourcePreview: "Preview", resourceHide: "Hide preview", zoomImage: "Open image", imagePreviewTitle: "Image preview", imageZoomControls: "Image zoom", zoomIn: "Zoom in", zoomOut: "Zoom out", zoomReset: "Reset zoom", installTitle: "Install OC Chat", installBody: "Add it to your home screen for a full-screen chat.", installAction: "Install", installHow: "How to install", installNotNow: "Not now", installIosGuide: "Tap Share, then Add to Home Screen.",
|
|
227
248
|
announcementDelete: "Delete announcement",
|
|
228
249
|
announcementNew: "New announcement", announcementEmpty: "No announcements yet.", announcementLoading: "Loading announcements…",
|
|
229
250
|
announcementLoadFailed: "Could not load announcements. Your draft is still here.", announcementSaved: "Announcement saved.", announcementDeleted: "Announcement deleted.",
|
|
@@ -231,7 +252,7 @@ const messages = {
|
|
|
231
252
|
questionsLoading: "Loading questions…", questionsEmpty: "No unanswered questions.",
|
|
232
253
|
questionsFailed: "Could not load questions. Try again.", questionsUnsupported: "Unanswered questions are unavailable on this server.", questionLabel: "Question",
|
|
233
254
|
answerQuestion: "Reply", answerPlaceholder: "Write a reply…", sendAnswer: "Send reply", selectQuestion: "Reply to question", copyQuestion: "Copy question", questionCopied: "Question copied.", questionCopyFailed: "Could not copy question.",
|
|
234
|
-
answerFailed: "Reply failed. Your draft is still here.", answerTooLong: "Reply must be
|
|
255
|
+
answerFailed: "Reply failed. Your draft is still here.", answerTooLong: "Reply must be 5,000 characters or fewer.", questionAlreadyAnswered: "This question was answered elsewhere.",
|
|
235
256
|
adminBindingGuide: "Choose a room and an Agent in it. Send the invitation privately to finish setup.", adminRoomLabel: "Administrator room", adminDesignateAgent: "Invite Agent",
|
|
236
257
|
settings: "Settings", adminAccess: "Administration", adminToken: "Administration token", openAdministration: "Open administration", administration: "Administration", designations: "Designations", adminRoom: "Administrator room", targetRoom: "Agent membership room", adminScopeNote: "Choose an Agent in the administrator room. Administrators can manage all rooms.", targetAgent: "Registered agent", designate: "Designate administrator", revokeDesignation: "Revoke designation", globalStatus: "Global status", adminTasks: "Tasks", taskText: "Task", dispatchTask: "Dispatch task", timers: "Timers", planName: "Timer name", createTimer: "Create timer", tokenRequired: "The server requires an access token (401).",
|
|
237
258
|
adminLoading: "Loading administration…", refreshAdmin: "Refresh", adminRoomBadge: "admin", chooseAdminRoom: "Choose a normal room", chooseTargetRoom: "Choose an agent room", chooseAgent: "Choose a registered agent", taskTargetRoom: "Target room", taskTargetAgent: "Target agent", createAdminRoomFirst: "Create a normal room first, then select it as the admin room.", noAgents: "No registered agents", selectAdminAgent: "Choose an admin room and registered agent.", adminDesignated: "Administrator designation is active immediately and stays until you revoke it.", revokeConfirm: "Revoke this admin designation? The normal room will remain.", updateTask: "Update task", task_pending: "Pending", task_working: "Working", task_blocked: "Blocked", task_completed: "Completed", task_cancelled: "Cancelled", nextRun: ({ time, minutes }) => `Every ${minutes} min · next ${time}`, paused: "Paused", pauseTimer: "Pause", resumeTimer: "Resume", deleteTimer: "Delete", deleteTimerConfirm: ({ name }) => `Delete timer “${name}”?`,
|
|
@@ -239,18 +260,31 @@ const messages = {
|
|
|
239
260
|
noMessages: "No messages yet. Say something.", latestMessages: "Back to latest messages",
|
|
240
261
|
mentionMembers: "Choose a member to mention", messagePlaceholder: "Message · Enter to send",
|
|
241
262
|
attachments: "Attachments", addFiles: "Add files", dropFilesHere: "Drop files here to attach",
|
|
242
|
-
attachmentVolatile: "
|
|
243
|
-
uploadQueued: "Waiting to upload", uploadReady: "Ready to send", uploadPercent: ({ percent }) => `Uploading ${percent}%`,
|
|
244
|
-
uploadFailed: "Upload failed. Retry or remove the file.",
|
|
263
|
+
attachmentVolatile: "Pasted files are recovered after reload; picked files stay in this tab.", attachmentNotPersisted: "This file is too large to save for reload. Keep this tab open until it is sent.", retryUpload: "Retry", removeFile: "Remove",
|
|
264
|
+
uploadQueued: "Waiting to upload", uploadReady: "Ready to send", sendAsFileFailed: "Upload failed. Your text is still in the composer.", uploadPercent: ({ percent }) => `Uploading ${percent}%`,
|
|
265
|
+
uploadFailed: ({ reason } = {}) => reason ? `Upload failed (${reason}). Retry or remove the file.` : "Upload failed. Retry or remove the file.",
|
|
266
|
+
fileUnreadable: "This file cannot be read: it may be a temporary file from another app, or still in the cloud. Save it to disk (or take a screenshot) and attach that.",
|
|
245
267
|
fileTooLarge: "File exceeds the server's current size limit.",
|
|
246
268
|
send: "Send", roomMeta: ({ members, count }) => `${members} ${members === 1 ? "member" : "members"} · ${count} ${count === 1 ? "message" : "messages"}`,
|
|
247
269
|
joinArrow: "Join →", joinDirectTitle: "Click to join directly", mentionEmpty: "No matching members",
|
|
248
270
|
joined: "Joined", joinAction: "Join room", unreadMessages: ({ count }) => `${count} unread`,
|
|
249
271
|
mentionHint: "↑↓ Select · Enter to confirm · Esc to close", today: "Today", yesterday: "Yesterday",
|
|
272
|
+
keyboardHints: "Keyboard hints", shortcutsLabel: "Key hints",
|
|
273
|
+
shortcutsTitle: "Keyboard shortcuts", shortcutsLead: "Every control works from the keyboard. Tags show the keys that work.",
|
|
274
|
+
hintsLegend: "Tab reaches · Enter / Space activates",
|
|
275
|
+
allShortcuts: "All shortcuts", hintsHide: "Hide tags on controls", hintsShow: "Show tags on controls",
|
|
276
|
+
shortcutsWriting: "Writing", shortcutsSend: "Send the message", shortcutsNewline: "Start a new line",
|
|
277
|
+
shortcutsMention: "Choose a member to mention", shortcutsRooms: "Rooms",
|
|
278
|
+
shortcutsSwitchRoom: "Switch to the previous or next room", shortcutsReading: "Reading",
|
|
279
|
+
shortcutsScroll: "Scroll messages while typing", shortcutsMenus: "Menus and dialogs",
|
|
280
|
+
shortcutsClose: "Close the open menu, panel, or dialog", shortcutsEverywhere: "Everywhere",
|
|
281
|
+
shortcutsTab: "Move between controls", shortcutsActivate: "Use the focused control",
|
|
282
|
+
shortcutsOpen: "Open this shortcut list", switchRoomsHint: "Switch rooms",
|
|
250
283
|
earlierMessages: "Earlier messages omitted", messagesBetweenOmitted: "Messages between this reading point and latest are omitted.", you: "You", saved: "Saved",
|
|
251
284
|
savedMemory: "Saved for this tab only", copyFailed: ({ id }) => `Copy failed. Copy manually: ${id}`,
|
|
252
285
|
copyMessage: "Copy", copiedMessage: "Copied", copyMessageFailed: "Could not copy. Select and copy the message manually.",
|
|
253
|
-
replyMessage: "Reply", replyingTo: "Replying to", cancelReply: "Cancel reply", replyOpenOriginal: "View original message", replyOriginalUnavailable: "Original message is unavailable.",
|
|
286
|
+
replyMessage: "Reply", replyingTo: "Replying to", cancelReply: "Cancel reply", replyOpenOriginal: "View original message", replyOriginalUnavailable: "Original message is unavailable.", replyOriginalRecalled: "Original message was recalled.",
|
|
287
|
+
recallMessage: "Recall", recallSystemMessage: "Recall this room notice", recallSystemConfirm: "Recall this room notice? Everyone will see it as recalled.", recallConfirm: "Recall this message? Everyone will see it as recalled.", recallAdminConfirm: ({ name }) => `Recall ${name}'s message? Everyone will see it as recalled.`, recallFailed: "Could not recall this message.", messageRecalled: "Message recalled", recalledBy: ({ name }) => `Recalled by ${name}`, showRecalled: "View original", hideRecalled: "Hide original", revealFailed: "Load failed. Retry",
|
|
254
288
|
identityChanged: "This browser identity changed in another tab. Reload this tab before continuing.",
|
|
255
289
|
networkError: "Network connection failed", requestFailed: ({ status }) => `Request failed (HTTP ${status})`,
|
|
256
290
|
roomIdRequired: "Enter a room ID", nameRequired: "Enter your name", authRetry: "The server requires an access token. Enter it and try again.",
|
|
@@ -260,17 +294,21 @@ const messages = {
|
|
|
260
294
|
roomNotFound: "This room is gone, or you no longer have access.",
|
|
261
295
|
sendAuth: "Send failed: an access token is required", sendNetwork: "Send failed. Your message is saved below.",
|
|
262
296
|
sendFailed: ({ message }) => `Send failed: ${message}`,
|
|
263
|
-
adminRoomDeleteDenied: "This room is designated for administration.
|
|
297
|
+
adminRoomDeleteDenied: "This room is designated for administration. Only the room owner can delete it.",
|
|
264
298
|
failedMessages: "Messages not sent", retryFailed: "Retry", discardFailed: "Discard",
|
|
265
299
|
roomListError: "Unable to load rooms. You can enter a room ID directly.", guest: "Guest",
|
|
266
300
|
roomsLabel: "Rooms", refreshRooms: "Refresh rooms", identityLabel: ({ name }) => `Chatting as ${name}`,
|
|
267
301
|
roomsMenu: "Open room list", closeRoomList: "Close room list",
|
|
268
302
|
direct: "Direct", messagePrivately: "Message privately", removeMember: "Remove",
|
|
269
|
-
kickConfirm: ({ name
|
|
303
|
+
kickConfirm: ({ name }) => `Remove ${name} from this room? They can rejoin with the room ID.`,
|
|
270
304
|
deleteRoom: "Delete room", deleteConfirm: ({ name }) => `Delete “${name}” and all its messages? This cannot be undone.`,
|
|
271
|
-
allMembers: "Everyone", messageCount: ({ count }) => `${count} /
|
|
305
|
+
allMembers: "Everyone", messageCount: ({ count }) => `${count} / 5000`,
|
|
306
|
+
pasteAsFile: ({ count }) => `Pasted ${count} characters saved as a text file`,
|
|
307
|
+
sendAsFile: ({ count }) => `${count} characters exceed the limit; sending as a text file`,
|
|
272
308
|
privacyNote: "Anyone with the shared token can read direct messages and manage rooms; the server can read them too.",
|
|
309
|
+
resourceDelete: "Delete file", resourceDeleting: "Deleting…", resourceDeleteConfirm: ({ name }) => `Delete “${name}”? This cannot be undone.`, resourceDeleted: "File deleted.", resourceDeleteFailed: "Could not delete this file.",
|
|
273
310
|
systemJoined: ({ name }) => `${name} joined the room`, systemLeft: ({ name }) => `${name} left the room`, systemRemoved: ({ name }) => `${name} was removed from the room`,
|
|
311
|
+
systemDesignated: ({ actor, name }) => `${actor} designated ${name} as administrator`, systemRevoked: ({ actor }) => `${actor} revoked the administrator designation`, systemRenamed: ({ actor, from, to }) => `${actor} renamed the room from "${from}" to "${to}"`, systemDescribed: ({ actor }) => `${actor} updated the room description`, systemHanded: ({ actor, name }) => `${actor} handed the room to ${name}`, systemAdminsUpdated: ({ actor }) => `${actor} updated the room administrators`, systemSuccessorNamed: ({ actor, name }) => `${actor} named ${name} as the room successor`, systemSuccessorCleared: ({ actor }) => `${actor} cleared the room successor`,
|
|
274
312
|
activity_working: "Working", activity_idle: "Foreground idle", activity_waiting: "Waiting", activity_unknown: "Status unknown", activity_offline: "Status stale",
|
|
275
313
|
activityHint_working: "The agent reports active work.", activityHint_idle: "Foreground is idle; background work may continue.", activityHint_waiting: "The agent reports that it is waiting.", activityHint_unknown: "No activity report is available.", activityHint_offline: "The last status is stale; this does not prove the agent is offline.",
|
|
276
314
|
receiptCount: ({ count }) => `Read by ${count}`, receiptNone: "No readers yet", receiptNotLoaded: "Read status not loaded", readerPanelTitle: "Message readers", close: "Close", departedMember: "left",
|
|
@@ -283,11 +321,29 @@ const messages = {
|
|
|
283
321
|
roomIdLabel: "房间 ID", roomIdPlaceholder: "粘贴或输入房间 ID", nameLabel: "你的昵称",
|
|
284
322
|
namePlaceholder: "怎么称呼你", joinRoom: "加入房间", or: "或", newRoomNameLabel: "新房间名称",
|
|
285
323
|
newRoomNamePlaceholder: "例如:周末电影夜", createRoom: "创建新房间", tokenOptional: "访问令牌(可选)",
|
|
324
|
+
joinRoomTitle: "加入房间", joinRoomHint: "有人把房间 ID 分享给你?粘贴到这里。",
|
|
325
|
+
createRoomTitle: "创建房间", createRoomHint: "新建一个房间,再把房间 ID 发给别人。",
|
|
326
|
+
requireApproval: "加入需要审核", requireApprovalHint: "新成员需经人类管理员审核;Agent 也可以由管理员 Agent 审核。",
|
|
327
|
+
joinPolicyEditHint: "新成员需经人类管理员审核。关闭后,所有待审核申请都会被清除。", joinPolicyOpenConfirm: "关闭加入审核?所有待审核的加入申请都会被清除。",
|
|
328
|
+
approvalRequired: "需审核加入", joinRequired: "需审核加入", joinPendingStatus: "等待审核",
|
|
329
|
+
joinPendingTitle: "等待审核", joinPendingBody: ({ name }) => `加入“${name}”的申请已发送,需人类管理员审核通过后才能进入。`,
|
|
330
|
+
joinPendingHint: "可以离开此页面,申请会保留;稍后可在房间列表查看。", joinPendingNotice: ({ name }) => `已发送加入“${name}”的申请,正在等待人类管理员审核。`, joinPendingCheck: "再看一次", joinPendingStop: "不再等待",
|
|
331
|
+
joinPendingGoneTitle: "申请已不在等待", joinPendingGoneBody: "申请可能已被拒绝或清除,可以重新发送。", joinPendingAgain: "重新申请",
|
|
332
|
+
joinPendingError: "无法检查申请状态,请重试。", joinPendingRoomGone: "房间不存在,或你已无权访问。",
|
|
333
|
+
joinNameTaken: "这个昵称已被房间里的成员使用,请换一个。",
|
|
334
|
+
joinRequestsTitle: "加入申请", joinRequestsHint: "Agent 的申请也可以由管理员 Agent 审核。", joinRequestsEmpty: "暂无待审核申请。",
|
|
335
|
+
joinRequestsLoadFailed: "无法加载加入申请。", joinRequestAlreadyHandled: "这个申请已经被处理过了。", joinRequestApprove: "通过", joinRequestDeny: "拒绝", joinRequestAgent: "Agent", joinRequestHuman: "人类",
|
|
336
|
+
joinRequestApproveLabel: ({ name }) => `通过 ${name} 的加入申请`, joinRequestDenyLabel: ({ name }) => `拒绝 ${name} 的加入申请`,
|
|
337
|
+
joinRequestTime: ({ time }) => `申请于 ${time}`, joinRequestApproved: ({ name }) => `已通过 ${name} 的申请。`, joinRequestDenied: ({ name }) => `已拒绝 ${name} 的申请。`,
|
|
338
|
+
joinRequestActionFailed: ({ message }) => `操作失败:${message}`, membersWithRequests: ({ count }) => `成员,${count} 个待审核加入申请`,
|
|
339
|
+
joinRequestBadgeOne: " 个申请", joinRequestBadgeMany: " 个申请",
|
|
340
|
+
accessKeyTitle: "访问密钥", accessKeyHint: "这个服务器需要访问密钥。密钥保存在当前浏览器里,并随每个请求发送。",
|
|
286
341
|
bearerToken: "Bearer Token", tokenPlaceholder: "服务器要求时填写", save: "保存",
|
|
287
342
|
tokenHint: "若服务器设置了访问令牌(401),所有请求都会带上它。", existingRooms: "房间",
|
|
288
343
|
noRooms: "还没有房间,创建一个吧。", copyRoomId: "复制房间 ID", loadingHistory: "正在加载更早的消息",
|
|
289
|
-
editRoom: "编辑房间", roomNameLabel: "房间名称", roomDescriptionLabel: "描述", adminAgentLabel: "管理员 Agent",
|
|
290
|
-
|
|
344
|
+
editRoom: "编辑房间", roomOwnerOnlyTitle: "仅房主或管理员可修改", roomOwnerOnlyNote: ({ owner }) => `只有房主或房间管理员可以修改这些设置。这个房间属于 ${owner}。`, roomNameLabel: "房间名称", roomDescriptionLabel: "描述", adminAgentLabel: "管理员 Agent", roomOwnerBadge: "房主", roomAdminBadge: "管理员",
|
|
345
|
+
adminIdsLabel: "成员管理员", adminIdsHint: "这些成员可以修改房间信息、管理成员、删除文件并指定接任者。房主始终拥有这些权限。", adminIdsEmpty: "房间里暂无其他成员。", newOwnerLabel: "新房主", newOwnerHint: "可以把房间交给房间里的另一个人。只有房主可以操作;Agent 不能成为房主。",
|
|
346
|
+
successorLabel: "房主离开后的接任者", successorNone: "最早加入的成员", successorHint: "房主离开后,此人接任房主;管理员离开后,此人接任管理员。留空则最早加入的成员接任房主。", ownerOnlySettingsNote: "只有房主可以更改管理员 Agent 或移交房间。", adminAgentHint: "被指定的 Agent 可用 admin 工具查看此房间及其历史。只有房主可以更改,留空表示不指定。",
|
|
291
347
|
noAdminAgent: "不指定", roomNameRequired: "房间名称不能为空", openQuestions: ({ count }) => `${count} 个待回答的问题`,
|
|
292
348
|
newRoom: "创建房间",
|
|
293
349
|
copyRoomIdTitle: ({ id }) => `点击复制完整房间 ID:${id}`, copied: "已复制", members: "成员",
|
|
@@ -299,9 +355,10 @@ const messages = {
|
|
|
299
355
|
reminderText: "提醒内容", reminderTemplateHint: "可使用 {{time}}、{{initiator}} 和 {{room}}。", reminderCreate: "创建提醒",
|
|
300
356
|
reminderLoading: "正在加载提醒…", reminderEmpty: "暂无提醒。", reminderPaused: "已暂停", reminderNext: ({ time }) => `下次:${time}`,
|
|
301
357
|
reminderPause: "暂停", reminderResume: "恢复", reminderDelete: "删除", reminderDeleteConfirm: "确定删除此提醒?",
|
|
358
|
+
reminderEdit: "编辑", reminderEditHeading: "编辑提醒", reminderSave: "保存修改",
|
|
302
359
|
reminderCreated: "提醒已创建。", reminderUpdated: "提醒已更新。", reminderDeleted: "提醒已删除。",
|
|
303
360
|
reminderInvalid: "请检查日期、5 字段 CRON 表达式、IANA 时区和提醒内容。", reminderLoadFailed: "无法加载提醒,草稿仍已保留。",
|
|
304
|
-
diagramLoading: "正在渲染图表…", diagramRenderFailed: "图表无法显示,以下为源代码。", resourceLoading: "正在加载文件…", resourceFailed: "无法加载此文件。", resourceDownload: "下载", resourcePreview: "预览", resourceHide: "收起预览",
|
|
361
|
+
diagramLoading: "正在渲染图表…", diagramRenderFailed: "图表无法显示,以下为源代码。", resourceLoading: "正在加载文件…", resourceFailed: "无法加载此文件。", resourceDownload: "下载", resourceMoreActions: "{name} 的更多操作", resourcePreview: "预览", resourceHide: "收起预览", zoomImage: "查看大图", imagePreviewTitle: "图片预览", imageZoomControls: "图片缩放", zoomIn: "放大", zoomOut: "缩小", zoomReset: "重置缩放", installTitle: "安装 OC Chat", installBody: "添加到主屏幕,获得全屏聊天体验。", installAction: "安装", installHow: "如何安装", installNotNow: "暂不", installIosGuide: "点击共享按钮,然后选择“添加到主屏幕”。",
|
|
305
362
|
announcementDelete: "删除公告",
|
|
306
363
|
announcementNew: "新建公告", announcementEmpty: "暂无公告。", announcementLoading: "正在加载公告…",
|
|
307
364
|
announcementLoadFailed: "无法加载公告,草稿仍已保留。", announcementSaved: "公告已保存。", announcementDeleted: "公告已删除。",
|
|
@@ -309,7 +366,7 @@ const messages = {
|
|
|
309
366
|
questionsLoading: "正在加载问题…", questionsEmpty: "没有待回答的问题。",
|
|
310
367
|
questionsFailed: "无法加载问题,请重试。", questionsUnsupported: "此服务器不支持查看待回答问题。", questionLabel: "问题",
|
|
311
368
|
answerQuestion: "回复", answerPlaceholder: "写下回复…", sendAnswer: "发送回复", selectQuestion: "回复此问题", copyQuestion: "复制问题", questionCopied: "问题已复制。", questionCopyFailed: "无法复制问题。",
|
|
312
|
-
answerFailed: "回复失败,草稿仍已保留。", answerTooLong: "回复不能超过
|
|
369
|
+
answerFailed: "回复失败,草稿仍已保留。", answerTooLong: "回复不能超过 5,000 个字符。", questionAlreadyAnswered: "此问题已由其他人回答。",
|
|
313
370
|
adminBindingGuide: "选择管理员房间和其中的 Agent,再将邀请私下发送给该 Agent 完成设置。", adminRoomLabel: "管理员房间", adminDesignateAgent: "邀请 Agent",
|
|
314
371
|
adminAccess: "管理", adminToken: "管理令牌", openAdministration: "打开管理面板", administration: "管理面板", designations: "管理绑定", adminRoom: "管理员房间", targetRoom: "Agent 所属房间", adminScopeNote: "请选择管理员房间内的 Agent。管理员可以管理所有房间。", adminRoomBadge: "管理", targetAgent: "已注册 Agent", designate: "指定管理员", revokeDesignation: "撤销绑定", globalStatus: "全局状态", adminTasks: "任务", taskText: "任务内容", dispatchTask: "派发任务", timers: "定时任务", planName: "定时任务名称", createTimer: "创建定时任务",
|
|
315
372
|
adminLoading: "正在加载管理面板…", refreshAdmin: "刷新", adminRoomBadge: "管理", chooseAdminRoom: "选择普通房间", chooseTargetRoom: "选择 Agent 房间", chooseAgent: "选择已注册 Agent", taskTargetRoom: "任务目标房间", taskTargetAgent: "任务目标 Agent", createAdminRoomFirst: "请先按普通流程创建房间,再选作管理房间。", noAgents: "没有已注册的 Agent", selectAdminAgent: "请选择管理房间和已注册的 Agent。", adminDesignated: "管理员已立即生效,长期有效,直到撤销。", revokeConfirm: "撤销此管理绑定?普通房间会保留。", updateTask: "更新任务", task_pending: "待处理", task_working: "进行中", task_blocked: "受阻", task_completed: "已完成", task_cancelled: "已取消", nextRun: ({ time, minutes }) => `每 ${minutes} 分钟 · 下次 ${time}`, paused: "已暂停", pauseTimer: "暂停", resumeTimer: "恢复", deleteTimer: "删除", deleteTimerConfirm: ({ name }) => `删除定时任务“${name}”?`,
|
|
@@ -317,17 +374,30 @@ const messages = {
|
|
|
317
374
|
messageList: "消息列表", noMessages: "还没有消息,说点什么吧。", latestMessages: "回到最新消息",
|
|
318
375
|
mentionMembers: "选择要提及的成员", messagePlaceholder: "输入消息,Enter 发送",
|
|
319
376
|
attachments: "附件", addFiles: "添加文件", dropFilesHere: "将文件拖到这里添加",
|
|
320
|
-
attachmentVolatile: "
|
|
321
|
-
uploadQueued: "等待上传", uploadReady: "可以发送", uploadPercent: ({ percent }) => `正在上传 ${percent}%`,
|
|
322
|
-
uploadFailed: "上传失败,请重试或移除文件。",
|
|
377
|
+
attachmentVolatile: "粘贴的文件刷新后可恢复;文件选择器添加的文件仅在当前标签页有效。", attachmentNotPersisted: "文件过大,无法在刷新后恢复。发送完成前请保持此标签页打开。", retryUpload: "重试", removeFile: "移除",
|
|
378
|
+
uploadQueued: "等待上传", uploadReady: "可以发送", sendAsFileFailed: "上传失败,文字仍在输入框中。", uploadPercent: ({ percent }) => `正在上传 ${percent}%`,
|
|
379
|
+
uploadFailed: ({ reason } = {}) => reason ? `上传失败(${reason}),请重试或移除文件。` : "上传失败,请重试或移除文件。",
|
|
380
|
+
fileUnreadable: "这个文件读不出来:它可能是其他 App 的临时文件,或者还在云端。请先保存到本地(或截图)再发送。",
|
|
323
381
|
fileTooLarge: "文件超过服务器当前大小限制。",
|
|
324
382
|
send: "发送", roomMeta: ({ members, count }) => `${members} 人 · ${count} 条消息`, joinArrow: "加入 →",
|
|
325
383
|
joinDirectTitle: "点击直接加入", mentionEmpty: "没有匹配的成员", mentionHint: "↑↓ 选择 · Enter 确认 · Esc 关闭",
|
|
384
|
+
keyboardHints: "键盘提示", shortcutsLabel: "按键提示",
|
|
385
|
+
shortcutsTitle: "键盘快捷键", shortcutsLead: "所有控件都可以用键盘操作,标签显示可用的按键。",
|
|
386
|
+
hintsLegend: "Tab 定位 · Enter 或空格使用",
|
|
387
|
+
allShortcuts: "全部快捷键", hintsHide: "隐藏控件提示", hintsShow: "显示控件提示",
|
|
388
|
+
shortcutsWriting: "输入", shortcutsSend: "发送消息", shortcutsNewline: "换行",
|
|
389
|
+
shortcutsMention: "选择要提及的成员", shortcutsRooms: "房间",
|
|
390
|
+
shortcutsSwitchRoom: "切换到上一个或下一个房间", shortcutsReading: "阅读",
|
|
391
|
+
shortcutsScroll: "输入时滚动消息", shortcutsMenus: "菜单和对话框",
|
|
392
|
+
shortcutsClose: "关闭当前菜单、面板或对话框", shortcutsEverywhere: "通用",
|
|
393
|
+
shortcutsTab: "在控件之间移动", shortcutsActivate: "使用当前聚焦的控件",
|
|
394
|
+
shortcutsOpen: "打开这个快捷键列表", switchRoomsHint: "切换房间",
|
|
326
395
|
joined: "已加入", joinAction: "加入房间", unreadMessages: ({ count }) => `${count} 条未读`,
|
|
327
396
|
today: "今天", yesterday: "昨天", earlierMessages: "更早的消息已省略", messagesBetweenOmitted: "此阅读位置与最新消息之间的部分消息已省略。", you: "我", saved: "已保存",
|
|
328
397
|
savedMemory: "仅保存于当前标签页", copyFailed: ({ id }) => `复制失败,请手动复制:${id}`,
|
|
329
398
|
copyMessage: "复制", copiedMessage: "已复制", copyMessageFailed: "复制失败,请手动选择并复制消息。",
|
|
330
|
-
replyMessage: "回复", replyingTo: "回复给", cancelReply: "取消回复", replyOpenOriginal: "查看原始消息", replyOriginalUnavailable: "原始消息不可用。",
|
|
399
|
+
replyMessage: "回复", replyingTo: "回复给", cancelReply: "取消回复", replyOpenOriginal: "查看原始消息", replyOriginalUnavailable: "原始消息不可用。", replyOriginalRecalled: "原消息已撤回。",
|
|
400
|
+
recallMessage: "撤回", recallSystemMessage: "撤回这条房间通知", recallSystemConfirm: "撤回这条房间通知?所有人都会看到“消息已撤回”。", recallConfirm: "撤回这条消息?所有人都会看到“消息已撤回”。", recallAdminConfirm: ({ name }) => `撤回 ${name} 的消息?所有人都会看到“消息已撤回”。`, recallFailed: "撤回失败,请重试。", messageRecalled: "消息已撤回", recalledBy: ({ name }) => `${name} 撤回`, showRecalled: "查看原文", hideRecalled: "收起原文", revealFailed: "加载失败,重试",
|
|
331
401
|
identityChanged: "此浏览器身份已在另一个标签页中更改,请重新加载此标签页后继续。",
|
|
332
402
|
networkError: "网络连接失败", requestFailed: ({ status }) => `请求失败(HTTP ${status})`,
|
|
333
403
|
roomIdRequired: "请输入房间 ID", nameRequired: "请输入你的昵称", authRetry: "服务器要求访问令牌,请填写后重试",
|
|
@@ -335,15 +405,18 @@ const messages = {
|
|
|
335
405
|
roomNameRequired: "请输入房间名称", createFailed: ({ message }) => `创建失败:${message}`,
|
|
336
406
|
roomNotFound: "房间不存在,或你已被移出房间", sendAuth: "发送失败:需要访问令牌",
|
|
337
407
|
sendNetwork: "发送失败,消息已保存在下方", sendFailed: ({ message }) => `发送失败:${message}`,
|
|
338
|
-
adminRoomDeleteDenied: "
|
|
408
|
+
adminRoomDeleteDenied: "此房间已指定管理员。只有房主可以删除此房间。",
|
|
339
409
|
failedMessages: "未发送的消息", retryFailed: "重试", discardFailed: "删除",
|
|
340
410
|
roomListError: "无法加载房间列表,可直接输入房间 ID 加入。", guest: "访客", roomsLabel: "房间列表",
|
|
341
411
|
refreshRooms: "刷新房间", identityLabel: ({ name }) => `当前昵称:${name}`, roomsMenu: "打开房间列表", closeRoomList: "关闭房间列表", direct: "私聊",
|
|
342
|
-
messagePrivately: "私聊", removeMember: "移除", kickConfirm: ({ name
|
|
412
|
+
messagePrivately: "私聊", removeMember: "移除", kickConfirm: ({ name }) => `确定将 ${name} 移出此房间?对方仍可用房间 ID 重新加入。`,
|
|
343
413
|
deleteRoom: "删除房间", deleteConfirm: ({ name }) => `删除“${name}”及全部聊天记录?此操作无法撤销。`,
|
|
344
|
-
allMembers: "所有人", messageCount: ({ count }) => `${count} /
|
|
345
|
-
|
|
414
|
+
allMembers: "所有人", messageCount: ({ count }) => `${count} / 5000`,
|
|
415
|
+
pasteAsFile: ({ count }) => `已把粘贴的 ${count} 个字符保存为文本文件`,
|
|
416
|
+
sendAsFile: ({ count }) => `${count} 个字符超出上限,将作为文本文件发送`,
|
|
417
|
+
privacyNote: "持有共享令牌的人都可以读取私聊内容和管理房间;服务器也可以读取私聊内容。", resourceDelete: "删除文件", resourceDeleting: "正在删除…", resourceDeleteConfirm: ({ name }) => `确定删除“${name}”?此操作无法撤销。`, resourceDeleted: "文件已删除。", resourceDeleteFailed: "无法删除此文件。",
|
|
346
418
|
systemJoined: ({ name }) => `${name} 加入了房间`, systemLeft: ({ name }) => `${name} 离开了房间`, systemRemoved: ({ name }) => `${name} 被移出了房间`,
|
|
419
|
+
systemDesignated: ({ actor, name }) => `${actor} 指定 ${name} 为管理员`, systemRevoked: ({ actor }) => `${actor} 撤销了管理员指定`, systemRenamed: ({ actor, from, to }) => `${actor} 将房间名称从“${from}”改为“${to}”`, systemDescribed: ({ actor }) => `${actor} 更新了房间描述`, systemHanded: ({ actor, name }) => `${actor} 将房间移交给了 ${name}`, systemAdminsUpdated: ({ actor }) => `${actor} 更新了房间管理员`, systemSuccessorNamed: ({ actor, name }) => `${actor} 指定 ${name} 为房间继任者`, systemSuccessorCleared: ({ actor }) => `${actor} 清除了房间继任者`,
|
|
347
420
|
activity_working: "工作中", activity_idle: "前台空闲", activity_waiting: "等待中", activity_unknown: "状态未知", activity_offline: "状态已过期",
|
|
348
421
|
activityHint_working: "Agent 正在报告工作状态。", activityHint_idle: "前台空闲;后台任务仍可能继续。", activityHint_waiting: "Agent 正在报告等待状态。", activityHint_unknown: "暂无活动状态报告。", activityHint_offline: "最近的状态已过期;这不能证明 Agent 已离线。",
|
|
349
422
|
receiptCount: ({ count }) => `已读 ${count} 人`, receiptNone: "尚无人已读", receiptNotLoaded: "尚未加载已读状态", readerPanelTitle: "消息已读情况", close: "关闭", departedMember: "已离开",
|
|
@@ -1,21 +1,42 @@
|
|
|
1
|
+
const patterns = [
|
|
2
|
+
[/^(.*?) joined the room$/, "systemJoined", (m) => ({ name: m[1] })],
|
|
3
|
+
[/^(.*?) left the room$/, "systemLeft", (m) => ({ name: m[1] })],
|
|
4
|
+
[/^(.*?) was removed from the room$/, "systemRemoved", (m) => ({ name: m[1] })],
|
|
5
|
+
[/^(.*?) designated (.*?) as administrator$/, "systemDesignated", (m) => ({ actor: m[1], name: m[2] })],
|
|
6
|
+
[/^(.*?) updated the room administrators$/, "systemAdminsUpdated", (m) => ({ actor: m[1] })],
|
|
7
|
+
[/^(.*?) named (.*?) as the room successor$/, "systemSuccessorNamed", (m) => ({ actor: m[1], name: m[2] })],
|
|
8
|
+
[/^(.*?) cleared the room successor$/, "systemSuccessorCleared", (m) => ({ actor: m[1] })],
|
|
9
|
+
[/^(.*?) revoked the administrator designation$/, "systemRevoked", (m) => ({ actor: m[1] })],
|
|
10
|
+
[/^(.*?) renamed the room from "(.*)" to "(.*)"$/, "systemRenamed", (m) => ({ actor: m[1], from: m[2], to: m[3] })],
|
|
11
|
+
[/^(.*?) updated the room description$/, "systemDescribed", (m) => ({ actor: m[1] })],
|
|
12
|
+
[/^(.*?) handed the room to (.*)$/, "systemHanded", (m) => ({ actor: m[1], name: m[2] })],
|
|
13
|
+
];
|
|
14
|
+
|
|
15
|
+
function formatLine(line, app) {
|
|
16
|
+
for (const [pattern, key, values] of patterns) {
|
|
17
|
+
const match = pattern.exec(line);
|
|
18
|
+
if (match) return app.t(key, values(match));
|
|
19
|
+
}
|
|
20
|
+
return line;
|
|
21
|
+
}
|
|
22
|
+
|
|
1
23
|
export function formatSystemMessage(message, app) {
|
|
2
24
|
// `<at>@name</at>` is an editor token; system rows and previews show the plain mention.
|
|
3
25
|
const text = String(message?.text ?? "").replace(/<at>([\s\S]*?)<\/at>/g, "$1");
|
|
4
26
|
if (message?.senderId !== "system") return text;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const left = /^(.*?)\s+left the room$/.exec(text);
|
|
8
|
-
if (left) return app.t("systemLeft", { name: left[1] });
|
|
9
|
-
const removed = /^(.*?)\s+was removed from the room$/.exec(text);
|
|
10
|
-
return removed ? app.t("systemRemoved", { name: removed[1] }) : text;
|
|
27
|
+
// One edit can log several changes joined by "; "; translate each line.
|
|
28
|
+
return text.split("; ").map((line) => formatLine(line, app)).join("; ");
|
|
11
29
|
}
|
|
12
30
|
|
|
13
31
|
export function setRoomPreview(entry, message) {
|
|
14
32
|
entry.preview = message.text;
|
|
15
33
|
entry.previewAt = message.createdAt;
|
|
16
34
|
entry.previewSenderId = message.senderId;
|
|
35
|
+
entry.previewRecalled = Boolean(message.recalledAt);
|
|
17
36
|
}
|
|
18
37
|
|
|
19
38
|
export function formatRoomPreview(entry, latest, app) {
|
|
39
|
+
// A recalled message must not leak its text through the room rail.
|
|
40
|
+
if (entry?.previewRecalled || latest?.recalledAt) return app.t("messageRecalled");
|
|
20
41
|
return formatSystemMessage(entry?.preview ? { senderId: entry.previewSenderId, text: entry.preview } : latest, app);
|
|
21
|
-
}
|
|
42
|
+
}
|
|
@@ -105,6 +105,8 @@
|
|
|
105
105
|
font-size: 14px;
|
|
106
106
|
}
|
|
107
107
|
#memberList li > span:first-child { grid-column: 1 / -1; min-width: 0; overflow-wrap: anywhere; }
|
|
108
|
+
#memberList .member-identity { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; min-width: 0; }
|
|
109
|
+
#memberList .member-identity > span:first-child { min-width: 0; overflow-wrap: anywhere; }
|
|
108
110
|
#memberList .member-actions { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; }
|
|
109
111
|
#memberList .member-activity + .member-actions { grid-column: 2; grid-row: 2; }
|
|
110
112
|
#memberList .member-action { white-space: normal; }
|
|
@@ -200,11 +202,12 @@
|
|
|
200
202
|
.msg.in, .sys.in, .day-sep.in { animation: msg-in .25s ease both; }
|
|
201
203
|
.msg.own { align-items: flex-end; }
|
|
202
204
|
.msg.repeat { margin-bottom: 8px; }
|
|
203
|
-
.msg-meta { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
|
|
205
|
+
.msg-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 3px; }
|
|
204
206
|
.msg-name { font-size: 13px; font-weight: 650; color: var(--ink-2); }
|
|
205
207
|
.msg.own .msg-name { color: var(--accent); }
|
|
206
208
|
.question-mark { padding: 1px 6px; border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: 10px; line-height: 1.5; }
|
|
207
209
|
.msg.repeat .msg-name { display: none; }
|
|
210
|
+
.msg.repeat .admin-agent-badge { display: none; }
|
|
208
211
|
.msg-time { font-size: 12px; color: var(--ink-2); }
|
|
209
212
|
.msg-text {
|
|
210
213
|
display: inline-block;
|
|
@@ -281,8 +284,19 @@
|
|
|
281
284
|
.reader-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
|
|
282
285
|
.reader-panel-head h2 { margin: 0; font-family: var(--font-sans); font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
|
|
283
286
|
.reader-panel-head .hint { margin: 0 0 4px; }
|
|
284
|
-
.reader-close { flex: none; width:
|
|
287
|
+
.reader-close { display: grid; place-items: center; flex: none; width: 44px; height: 44px; padding: 0; border: 1px solid transparent; border-radius: 10px; color: var(--ink-2); background: transparent; font: inherit; cursor: pointer; transition: background .14s, border-color .14s, color .14s; }
|
|
288
|
+
.reader-close:hover { border-color: var(--line); color: var(--ink); background: var(--surface-2); }
|
|
289
|
+
.close-icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.8; }
|
|
285
290
|
.reader-panel .receipt-reader-list li { display: grid; gap: 3px; padding: 10px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
|
|
291
|
+
.image-dialog { width: 100vw; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 20px; overflow: hidden; border: 0; background: transparent; }
|
|
292
|
+
.image-dialog[open] { display: grid; place-items: center; }
|
|
293
|
+
.image-dialog::backdrop { background: rgb(9 16 22 / .84); backdrop-filter: blur(3px); }
|
|
294
|
+
.image-dialog img { display: block; max-width: 100%; max-height: calc(100dvh - 40px); width: auto; height: auto; object-fit: contain; border-radius: 8px; animation: image-zoom-in .16s ease both; }
|
|
295
|
+
@keyframes image-zoom-in { from { opacity: 0; transform: scale(.97); } }
|
|
296
|
+
.image-dialog-close { position: fixed; z-index: 2; top: 14px; right: 14px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid rgb(255 255 255 / .34); border-radius: 50%; color: #fff; background: rgb(9 16 22 / .58); font: inherit; line-height: 1; cursor: pointer; }
|
|
297
|
+
.image-dialog-close .close-icon { width: 22px; height: 22px; }
|
|
298
|
+
.image-dialog-close:hover, .image-dialog-close:focus-visible { background: rgb(9 16 22 / .82); outline: 2px solid #fff; outline-offset: 2px; }
|
|
299
|
+
.msg-text img, .chat-resource img, .attachment-preview img { cursor: zoom-in; }
|
|
286
300
|
.chat-resource { display: grid; gap: 9px; min-width: 0; margin: 10px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--surface-2) 76%, var(--surface)); }
|
|
287
301
|
.resource-info, .resource-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
|
|
288
302
|
.resource-name { min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
|
|
@@ -333,6 +347,8 @@
|
|
|
333
347
|
text-underline-offset: 2px;
|
|
334
348
|
}
|
|
335
349
|
.msg-text a:hover { text-decoration: none; }
|
|
350
|
+
/* Inline images stay inside the bubble; the overlay is where they get big. */
|
|
351
|
+
.msg-text img { display: block; max-width: 100%; height: auto; border-radius: 7px; }
|
|
336
352
|
|
|
337
353
|
/* Mention picker */
|
|
338
354
|
/* Inactive names stay quiet; current members use the accent color. */
|
|
@@ -481,27 +497,3 @@
|
|
|
481
497
|
.failed-reply-context { flex: 0 0 100%; overflow: hidden; color: var(--accent); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
|
|
482
498
|
.failed-message button { flex: none; border: 1px solid var(--line); border-radius: 7px; padding: 4px 8px; background: var(--surface); color: var(--ink-2); font: inherit; font-size: 12px; cursor: pointer; }
|
|
483
499
|
.failed-message button:disabled { opacity: .5; cursor: default; }
|
|
484
|
-
.attachment-button { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid var(--line); border-radius: 12px; color: var(--ink-2); background: var(--surface); font: inherit; font-size: 24px; cursor: pointer; }
|
|
485
|
-
.attachment-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
|
|
486
|
-
.attachment-button:hover { color: var(--accent); border-color: var(--accent); }
|
|
487
|
-
.attachment-button:disabled { opacity: .5; cursor: default; }
|
|
488
|
-
.attachment-tray { width: min(940px, 100%); margin: 0 auto; }
|
|
489
|
-
.attachment-volatile { margin: 0 0 3px; color: var(--ink-3); font-size: 10.5px; }
|
|
490
|
-
.attachment-status { display: inline-flex; width: fit-content; margin: 5px 0 0; padding: 3px 8px; border-radius: 999px; color: var(--accent); background: var(--accent-soft); font-size: 10.5px; }
|
|
491
|
-
.attachment-status.danger-text { color: var(--danger); background: var(--danger-soft); }
|
|
492
|
-
.attachment-status:empty { display: none; }
|
|
493
|
-
.attachment-list { display: grid; gap: 6px; max-height: 132px; overflow: auto; margin: 0; padding: 0; list-style: none; }
|
|
494
|
-
.attachment-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 9px; min-width: 0; padding: 7px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); box-shadow: 0 1px 2px rgb(20 40 32 / .035); }
|
|
495
|
-
.attachment-preview { display: grid; place-items: center; width: 38px; height: 38px; overflow: hidden; border: 1px solid color-mix(in srgb, var(--ink) 5%, transparent); border-radius: 8px; background: var(--surface-2); color: var(--ink-3); font-size: 11px; font-weight: 700; }
|
|
496
|
-
.attachment-preview img { width: 100%; height: 100%; object-fit: cover; }
|
|
497
|
-
.attachment-file { min-width: 0; }
|
|
498
|
-
.attachment-name { overflow: hidden; margin: 0; color: var(--ink); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
|
|
499
|
-
.attachment-detail { margin: 0; color: var(--ink-3); font-size: 10px; }
|
|
500
|
-
.attachment-item progress { display: block; width: 100%; height: 5px; accent-color: var(--accent); }
|
|
501
|
-
.attachment-actions { display: flex; gap: 4px; }
|
|
502
|
-
.attachment-actions button { min-width: 44px; min-height: 44px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink-2); background: var(--surface); font: inherit; font-size: 11px; cursor: pointer; }
|
|
503
|
-
.attachment-actions button:hover { border-color: var(--accent); color: var(--accent); }
|
|
504
|
-
.attachment-over-limit { color: var(--danger); }
|
|
505
|
-
#draftCount.over-limit { color: var(--danger); font-weight: 700; }
|
|
506
|
-
.attachment-drop-overlay { position: fixed; inset: 12px; z-index: 100; place-items: center; border: 2px dashed var(--accent); border-radius: 18px; color: var(--accent); background: color-mix(in srgb, var(--accent-soft) 88%, transparent); font-size: clamp(18px, 4vw, 28px); font-weight: 700; pointer-events: none; }
|
|
507
|
-
#chatView.drag-over .attachment-drop-overlay { display: grid; }
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/* Keyboard hints: a small badge over every visible control. */
|
|
2
|
+
.keys-overlay { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
|
|
3
|
+
.keys-marks { position: absolute; inset: 0; }
|
|
4
|
+
.keys-badge {
|
|
5
|
+
position: absolute;
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
align-items: center;
|
|
8
|
+
gap: 2px;
|
|
9
|
+
padding: 2px 4px;
|
|
10
|
+
border: 1px solid rgb(255 255 255 / .22);
|
|
11
|
+
border-radius: 6px;
|
|
12
|
+
color: #f6f8f4;
|
|
13
|
+
background: rgb(12 22 19 / .92);
|
|
14
|
+
box-shadow: 0 2px 8px rgb(0 0 0 / .28);
|
|
15
|
+
font: 600 9.5px/1 var(--font-mono);
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
}
|
|
18
|
+
.keys-badge.is-real { color: var(--accent-ink); background: var(--accent); border-color: color-mix(in srgb, var(--accent-ink) 35%, transparent); }
|
|
19
|
+
.keys-badge .keys-key { height: 15px; min-width: 15px; padding: 0 3px; border-width: 1px; border-bottom-width: 2px; border-radius: 4px; border-color: rgb(255 255 255 / .3); background: rgb(255 255 255 / .14); box-shadow: none; color: inherit; font-size: 9px; }
|
|
20
|
+
.keys-badge.is-real .keys-key { border-color: color-mix(in srgb, var(--accent-ink) 32%, transparent); background: color-mix(in srgb, var(--accent-ink) 14%, transparent); }
|
|
21
|
+
.keys-legend {
|
|
22
|
+
position: fixed;
|
|
23
|
+
left: 50%;
|
|
24
|
+
bottom: 18px;
|
|
25
|
+
transform: translateX(-50%);
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: 6px 14px;
|
|
30
|
+
width: min(460px, calc(100vw - 20px));
|
|
31
|
+
padding: 9px 10px 9px 14px;
|
|
32
|
+
border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
|
|
33
|
+
border-radius: 14px;
|
|
34
|
+
background: color-mix(in srgb, var(--surface) 94%, transparent);
|
|
35
|
+
box-shadow: var(--shadow);
|
|
36
|
+
backdrop-filter: blur(10px);
|
|
37
|
+
pointer-events: none;
|
|
38
|
+
}
|
|
39
|
+
.keys-legend-text { flex: 1 1 auto; min-width: 0; margin: 0; color: var(--ink-2); font-size: 12px; line-height: 1.45; }
|
|
40
|
+
.keys-legend-actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
|
|
41
|
+
.keys-legend-btn { min-height: 34px; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px; color: var(--accent); background: transparent; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
|
|
42
|
+
.keys-legend-btn, .keys-legend-close { pointer-events: auto; }
|
|
43
|
+
.keys-legend-btn:hover { border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); background: var(--accent-soft); }
|
|
44
|
+
.keys-legend-close { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 1px solid transparent; border-radius: 9px; color: var(--ink-2); background: transparent; cursor: pointer; }
|
|
45
|
+
.keys-legend-close:hover { border-color: var(--line); color: var(--ink); background: var(--surface-2); }
|
|
46
|
+
.keys-legend-btn:focus-visible, .keys-legend-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
47
|
+
@media (max-width: 560px) {
|
|
48
|
+
.keys-legend { gap: 2px 8px; padding: 7px 8px 7px 11px; }
|
|
49
|
+
.keys-legend-text { font-size: 11px; }
|
|
50
|
+
}
|
|
51
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* Recall: the row-level action, the tombstone, and the reveal disclosure. */
|
|
2
|
+
.message-recall { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 8px; color: var(--ink-3); background: transparent; cursor: pointer; }
|
|
3
|
+
.message-recall-icon { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
|
|
4
|
+
.message-recall:hover, .message-recall:focus-visible { border-color: color-mix(in srgb, var(--danger) 32%, var(--line)); color: var(--danger); background: var(--danger-soft); }
|
|
5
|
+
.message-recall:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
|
|
6
|
+
.msg-text.recalled { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; border-style: dashed; border-color: color-mix(in srgb, var(--ink) 18%, transparent); background: color-mix(in srgb, var(--surface-2) 62%, var(--surface)); box-shadow: none; color: var(--ink-2); font-size: 14.5px; }
|
|
7
|
+
.msg.own .msg-text.recalled { background: color-mix(in srgb, var(--surface-2) 78%, var(--surface)); border-color: color-mix(in srgb, var(--ink) 18%, transparent); }
|
|
8
|
+
.msg-text.recalled > :not(:first-child) { margin-top: 0; }
|
|
9
|
+
.recalled-note { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--ink-2); font-weight: 550; }
|
|
10
|
+
.recalled-mark { display: inline-flex; color: var(--ink-3); }
|
|
11
|
+
.recalled-icon { display: block; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
|
|
12
|
+
.recalled-by { margin: 0; color: var(--ink-3); font-size: 12px; }
|
|
13
|
+
.recalled-reveal { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--ink-2); background: var(--surface); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
|
|
14
|
+
.recalled-reveal:hover, .recalled-reveal:focus-visible { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
|
|
15
|
+
.recalled-reveal:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
|
|
16
|
+
.recalled-reveal[disabled] { cursor: progress; opacity: .7; }
|
|
17
|
+
.recalled-body { width: 100%; padding-top: 7px; border-top: 1px solid var(--line); color: var(--ink); }
|
|
18
|
+
.recalled-body[hidden] { display: none; }
|
|
19
|
+
.msg.recalled-in .msg-text { animation: recall-in .18s ease both; }
|
|
20
|
+
@keyframes recall-in { from { opacity: .35; transform: translateY(-2px); } }
|
|
21
|
+
@media (prefers-reduced-motion: reduce) { .msg.recalled-in .msg-text { animation: none; } }
|
|
22
|
+
|
|
23
|
+
/* Room notices recall from the line itself. */
|
|
24
|
+
.sys.has-recall { padding-right: 36px; }
|
|
25
|
+
.sys .sys-recall { position: absolute; top: -6px; right: 4px; width: 32px; height: 32px; background: var(--surface); }
|
|
26
|
+
.sys-recalled { display: inline-flex; align-items: center; gap: 6px; }
|
|
27
|
+
.sys-recalled .recalled-icon { width: 14px; height: 14px; }
|
|
28
|
+
.sys .recalled-reveal { min-height: 30px; }
|
|
29
|
+
.sys .recalled-body { max-width: min(560px, 100%); padding-top: 0; border-top: 0; color: var(--ink-2); font-size: 12.5px; text-align: center; }
|