d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 1 | <svelte:options immutable /> |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 2 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 3 | <script lang="ts"> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 4 | import MediaAttachmentView from './MediaAttachmentView.svelte'; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 5 | import MxcAvatar from './MxcAvatar.svelte'; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 6 | import Emoji from './Emoji.svelte'; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 7 | import EmojiText from './EmojiText.svelte'; |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 8 | import MessageText from './MessageText.svelte'; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 9 | import ReactionPicker from './ReactionPicker.svelte'; |
b8ab00377c20 | atagen | 2026-10-22 05:13 UTC | 10 | import LinkCard from './LinkCard.svelte'; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 11 | import { afterUpdate, onDestroy } from 'svelte'; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 12 | import { dissolve, expand, rowIn, rowOut, settleHeight } from './motion'; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 13 | import { selectedRow } from './selected-row'; |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 14 | import { mediaUrl, messageMediaUrl } from './api'; |
a4555a7eae2d | atagen | 2026-10-25 09:18 UTC | 15 | import { keywordMatcher } from './keywords'; |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 16 | import type { ImagePack, LinkPreview, Person, QuickReaction, ReplyReference, SendState, TimelineContent, TimelineEvent } from './types'; |
8c81366a752f | atagen | 2026-10-26 03:56 UTC | 17 | import { QUICK_REACTIONS_PER_ROW, senderLabel } from './types'; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 18 | import { formatClock, formatDay, initialsOf, senderHue } from './format'; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 19 | import { findUrls } from './urls'; |
787cdbbf0721 | atagen | 2026-10-24 06:50 UTC | 20 | import { mentionsFromHtml, resolveMentions, stripMarkdownPills } from './mentions'; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 21 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 22 | export let itemId: string; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 23 | export let event: TimelineEvent; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 24 | export let showSender: boolean; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 25 | export let reacting: boolean; |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 26 | export let onReact: (eventId: string, key: string, shortcode?: string) => void; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 27 | export let senderAvatar: string | null = null; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 28 | export let quickReactions: QuickReaction[] = []; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 29 | export let packs: ImagePack[] = []; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 30 | export let onQuickChange: (list: QuickReaction[]) => void = () => {}; |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 31 | export let linkPreviews: Record<string, LinkPreview | null> = {}; |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 32 | export let loadPreview: ((url: string) => void) | null = null; |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 33 | export let people: Record<string, Person> = {}; |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 34 | export let onReply: ((target: ReplyReference) => void) | null = null; |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 35 | export let onJump: ((eventId: string) => void) | null = null; |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 36 | export let onEdit: ((eventId: string, body: string) => void) | null = null; |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 37 | export let editing = false; |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 38 | export let showSent = true; |
668ab5c30531 | atagen | 2026-10-25 03:13 UTC | 39 | export let readOnly = false; |
705b1e1062c2 | atagen | 2026-10-23 09:05 UTC | 40 | export let self: string | null = null; |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 41 | export let onUser: ((userId: string, x: number, y: number, menu: boolean) => void) | null = null; |
d095131eec0e | atagen | 2026-10-24 08:39 UTC | 42 | export let onCloneSticker: ((eventId: string, body: string, x: number, y: number) => void) | null = null; |
0380cd8c765c | atagen | 2026-10-24 09:08 UTC | 43 | export let onMore: ((event: TimelineEvent, x: number, y: number) => void) | null = null; |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 44 | export let onOpenThread: ((rootEventId: string) => void) | null = null; |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 45 | |
d2a34d0f4861 | atagen | 2026-10-25 07:29 UTC | 46 | $: lag = lagLabel(event); |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 47 | $: threadRoot = onOpenThread && interactive && event.event_id && !event.thread_root ? event.event_id : null; |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 48 | $: threadReplies = event.thread_summary?.reply_count ?? 0; |
d2a34d0f4861 | atagen | 2026-10-25 07:29 UTC | 49 | |
d2a34d0f4861 | atagen | 2026-10-25 07:29 UTC | 50 | function lagLabel(event: TimelineEvent): string | null { |
d2a34d0f4861 | atagen | 2026-10-25 07:29 UTC | 51 | const lag = event.delivery_lag_ms; |
d2a34d0f4861 | atagen | 2026-10-25 07:29 UTC | 52 | if (!lag) return null; |
d2a34d0f4861 | atagen | 2026-10-25 07:29 UTC | 53 | if (lag < 60 * 60 * 1000) return `${Math.max(1, Math.floor(lag / 60000))}m`; |
d2a34d0f4861 | atagen | 2026-10-25 07:29 UTC | 54 | if (lag < 24 * 60 * 60 * 1000) return `${Math.floor(lag / 3600000)}h`; |
d2a34d0f4861 | atagen | 2026-10-25 07:29 UTC | 55 | return `${Math.floor(lag / 86400000)}d`; |
d2a34d0f4861 | atagen | 2026-10-25 07:29 UTC | 56 | } |
d2a34d0f4861 | atagen | 2026-10-25 07:29 UTC | 57 | |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 58 | function openUser(ev: MouseEvent, menu: boolean): void { |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 59 | if (!onUser) return; |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 60 | const rect = (ev.currentTarget as HTMLElement).getBoundingClientRect(); |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 61 | onUser(event.sender.user_id, menu ? ev.clientX : rect.left, menu ? ev.clientY : rect.bottom + 4, menu); |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 62 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 63 | |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 64 | const PICKER_WIDTH = 320; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 65 | const PICKER_HEIGHT = 380; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 66 | const PICKER_MARGIN = 8; |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 67 | const MAX_READERS = 3; |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 68 | const STATE_LABELS: Record<string, string> = { |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 69 | 'm.room.pinned_events': 'changed the pinned messages', |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 70 | 'm.room.power_levels': 'changed the room permissions', |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 71 | 'm.room.join_rules': 'changed who can join', |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 72 | 'm.room.history_visibility': 'changed who can read history', |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 73 | 'm.room.guest_access': 'changed guest access', |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 74 | 'm.room.canonical_alias': 'changed the room address', |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 75 | 'm.room.server_acl': 'changed the server access list', |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 76 | 'm.space.child': 'changed the rooms in this space', |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 77 | 'm.space.parent': 'changed the parent space', |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 78 | 'im.ponies.room_emotes': 'updated a sticker pack' |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 79 | }; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 80 | |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 81 | const owner = Symbol(); |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 82 | let row: HTMLDivElement; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 83 | let pickerPop: HTMLDivElement | undefined; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 84 | let hovered = false; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 85 | let focused = false; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 86 | let reactorKey: string | null = null; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 87 | let pickerOpen = false; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 88 | let pickerStyle = ''; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 89 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 90 | const MEMBERSHIP_LABELS: Record<string, string> = { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 91 | Joined: 'joined the room', |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 92 | Left: 'left the room', |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 93 | Banned: 'was banned', |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 94 | Unbanned: 'was unbanned', |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 95 | Kicked: 'was kicked', |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 96 | KickedAndBanned: 'was kicked and banned', |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 97 | Invited: 'was invited', |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 98 | InvitationAccepted: 'accepted the invite', |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 99 | InvitationRejected: 'rejected the invite', |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 100 | InvitationRevoked: 'had the invite revoked', |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 101 | Knocked: 'requested to join', |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 102 | KnockAccepted: 'was let in', |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 103 | KnockRetracted: 'withdrew the request to join', |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 104 | KnockDenied: 'had the request to join denied' |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 105 | }; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 106 | |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 107 | $: name = event.sender.display_name ?? people[event.sender.user_id]?.name ?? event.sender.user_id; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 108 | $: displayName = event.sender.name_ambiguous ? `${name} (${event.sender.user_id})` : name; |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 109 | $: readers = event.read_by.map((id) => people[id] ?? { user_id: id, name: id, avatar: null }); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 110 | $: interactive = event.content.kind === 'Message' || event.content.kind === 'Sticker' || event.content.kind === 'Poll'; |
705b1e1062c2 | atagen | 2026-10-23 09:05 UTC | 111 | $: message = event.content.kind === 'Message' ? event.content.message : null; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 112 | $: rawText = message ? (message.media ? message.media.caption : message.body) ?? '' : ''; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 113 | $: formattedBody = message?.formatted_body ?? null; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 114 | $: hasMessage = message !== null; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 115 | $: stripped = stripMarkdownPills(rawText); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 116 | $: linked = hasMessage ? [...mentionsFromHtml(formattedBody), ...stripped.mentions] : []; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 117 | $: nameOf = (id: string) => people[id]?.name ?? null; |
787cdbbf0721 | atagen | 2026-10-24 06:50 UTC | 118 | $: mentions = resolveMentions(stripped.text, linked); |
787cdbbf0721 | atagen | 2026-10-24 06:50 UTC | 119 | $: mentionsMe = self !== null && [...linked, ...mentions].some((m) => m.user_id === self); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 120 | $: own = event.own; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 121 | $: highlighted = event.highlight === true; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 122 | $: keywordHit = !own && (highlighted || (hasMessage && ($keywordMatcher?.test(stripped.text) ?? false))); |
705b1e1062c2 | atagen | 2026-10-23 09:05 UTC | 123 | $: previews = findUrls(stripped.text); |
705b1e1062c2 | atagen | 2026-10-23 09:05 UTC | 124 | $: bundled = message ? message.link_previews : []; |
705b1e1062c2 | atagen | 2026-10-23 09:05 UTC | 125 | $: cards = previews |
705b1e1062c2 | atagen | 2026-10-23 09:05 UTC | 126 | .map((link) => ({ link, preview: bundled.find((b) => b.url === link.href) ?? linkPreviews[link.href] ?? null })) |
705b1e1062c2 | atagen | 2026-10-23 09:05 UTC | 127 | .filter((c) => c.preview && (c.preview.title || c.preview.description || c.preview.image)); |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 128 | $: if (loadPreview) { |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 129 | for (const link of previews) { |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 130 | if (!bundled.some((b) => b.url === link.href) && !(link.href in linkPreviews)) loadPreview(link.href); |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 131 | } |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 132 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 133 | |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 134 | $: sent = interactive && showSent && event.own && event.send_state.kind === 'Sent' && event.event_id !== null; |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 135 | |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 136 | let lastShape = ''; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 137 | let heightBefore: number | null = null; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 138 | $: noteShape(`${event.content.kind}|${rawText}|${formattedBody}|${message?.edited}|${event.reply_to?.details.kind}|${showSender}`); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 139 | |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 140 | function noteShape(shape: string): void { |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 141 | if (row && lastShape && shape !== lastShape) heightBefore = row.offsetHeight; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 142 | lastShape = shape; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 143 | } |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 144 | |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 145 | afterUpdate(() => { |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 146 | if (heightBefore === null) return; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 147 | const from = heightBefore; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 148 | heightBefore = null; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 149 | requestAnimationFrame(() => row && settleHeight(row, from)); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 150 | }); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 151 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 152 | function sendLabel(state: SendState): string { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 153 | if (state.kind === 'Failed') return state.will_retry ? 'failed — will retry' : 'failed — not delivered'; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 154 | if (state.kind === 'Sending') return 'sending…'; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 155 | return ''; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 156 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 157 | |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 158 | $: selected = $selectedRow === owner; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 159 | $: showActions = !readOnly && interactive && !!event.event_id && (selected || pickerOpen || ($selectedRow === null && (hovered || focused))); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 160 | |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 161 | $: syncSelectionListeners(selected); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 162 | $: syncPickerListeners(pickerOpen); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 163 | |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 164 | function onEscape(e: KeyboardEvent) { |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 165 | if (e.key === 'Escape') select(false); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 166 | } |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 167 | |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 168 | let selectionAttached = false; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 169 | let pickerAttached = false; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 170 | |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 171 | function syncSelectionListeners(on: boolean) { |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 172 | if (on === selectionAttached) return; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 173 | selectionAttached = on; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 174 | if (on) { |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 175 | window.addEventListener('pointerdown', deselectOutside); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 176 | window.addEventListener('keydown', onEscape); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 177 | } else { |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 178 | window.removeEventListener('pointerdown', deselectOutside); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 179 | window.removeEventListener('keydown', onEscape); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 180 | } |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 181 | } |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 182 | |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 183 | function syncPickerListeners(on: boolean) { |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 184 | if (on === pickerAttached) return; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 185 | pickerAttached = on; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 186 | const op = on ? 'addEventListener' : 'removeEventListener'; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 187 | window[op]('scroll', closeOnScroll, true); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 188 | window[op]('resize', closePicker); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 189 | } |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 190 | |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 191 | onDestroy(() => { |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 192 | syncSelectionListeners(false); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 193 | syncPickerListeners(false); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 194 | selectedRow.update((o) => (o === owner ? null : o)); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 195 | }); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 196 | |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 197 | function select(on: boolean) { |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 198 | selectedRow.update((o) => (on ? owner : o === owner ? null : o)); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 199 | } |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 200 | |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 201 | function toggleSelected(e: MouseEvent) { |
668ab5c30531 | atagen | 2026-10-25 03:13 UTC | 202 | if (readOnly || !interactive || (e.target as Element).closest('a, button, input, video, audio, .picker-pop')) return; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 203 | select(!selected); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 204 | } |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 205 | |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 206 | function onRowKeydown(e: KeyboardEvent) { |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 207 | if (e.target !== row || readOnly || !interactive) return; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 208 | if (e.key === 'Enter' || e.key === ' ') { |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 209 | e.preventDefault(); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 210 | select(!selected); |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 211 | } |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 212 | } |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 213 | |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 214 | function onFocusOut(e: FocusEvent) { |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 215 | if (!row.contains(e.relatedTarget as Node | null)) focused = false; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 216 | } |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 217 | |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 218 | function deselectOutside(e: PointerEvent) { |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 219 | if (selected && !pickerOpen && !row.contains(e.target as Node)) select(false); |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 220 | } |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 221 | |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 222 | function openPicker(e: MouseEvent) { |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 223 | if (pickerOpen) { |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 224 | pickerOpen = false; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 225 | return; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 226 | } |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 227 | const rect = (e.currentTarget as HTMLElement).getBoundingClientRect(); |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 228 | const height = Math.min(PICKER_HEIGHT, window.innerHeight - 2 * PICKER_MARGIN); |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 229 | const below = window.innerHeight - rect.bottom - PICKER_MARGIN >= height; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 230 | const top = below ? rect.bottom + 4 : Math.max(PICKER_MARGIN, rect.top - height - 4); |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 231 | const maxLeft = window.innerWidth - PICKER_WIDTH - PICKER_MARGIN; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 232 | const left = Math.max(PICKER_MARGIN, Math.min(rect.right - PICKER_WIDTH, maxLeft)); |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 233 | pickerStyle = `top:${top}px;left:${left}px;height:${height}px`; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 234 | select(true); |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 235 | pickerOpen = true; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 236 | } |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 237 | |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 238 | function closePicker() { |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 239 | pickerOpen = false; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 240 | } |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 241 | |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 242 | function isImageKey(key: string): boolean { |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 243 | return key.startsWith('mxc://') || packs.some((p) => p.images.some((i) => i.reaction_key === key)); |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 244 | } |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 245 | |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 246 | function react(key: string, shortcode: string | null) { |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 247 | if (shortcode && isImageKey(key)) onReact(event.event_id ?? '', key, shortcode); |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 248 | else onReact(event.event_id ?? '', key); |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 249 | } |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 250 | |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 251 | function reply() { |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 252 | if (!event.event_id || !onReply) return; |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 253 | onReply({ |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 254 | event_id: event.event_id, |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 255 | details: { kind: 'Ready', sender: event.sender, content: event.content, timestamp_ms: event.timestamp_ms } |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 256 | }); |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 257 | } |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 258 | |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 259 | $: editableBody = |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 260 | event.own && event.editable && event.event_id && event.content.kind === 'Message' && event.content.message.kind === 'Text' |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 261 | ? event.content.message.body |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 262 | : null; |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 263 | |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 264 | function edit() { |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 265 | if (!event.event_id || editableBody === null || !onEdit) return; |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 266 | onEdit(event.event_id, editableBody); |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 267 | } |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 268 | |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 269 | function reactorNames(senders: string[]): string { |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 270 | const names = senders.map((id) => people[id]?.name ?? id); |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 271 | if (names.length <= 12) return names.join(', '); |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 272 | return `${names.slice(0, 12).join(', ')} and ${names.length - 12} more`; |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 273 | } |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 274 | |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 275 | function pick(key: string, shortcode: string | null) { |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 276 | pickerOpen = false; |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 277 | react(key, shortcode); |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 278 | } |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 279 | |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 280 | function closeOnScroll(e: Event) { |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 281 | if (pickerOpen && !pickerPop?.contains(e.target as Node)) pickerOpen = false; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 282 | } |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 283 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 284 | function actorLabel(userId: string, name: string | null): string { |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 285 | return name ?? people[userId]?.name ?? userId; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 286 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 287 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 288 | function replyPreview(content: TimelineContent): string { |
705b1e1062c2 | atagen | 2026-10-23 09:05 UTC | 289 | if (content.kind === 'Message') return stripMarkdownPills(content.message.body).text; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 290 | if (content.kind === 'Sticker') return content.body || 'Sticker'; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 291 | if (content.kind === 'Poll') return `Poll: ${content.question}`; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 292 | if (content.kind === 'Redacted') return 'Message deleted'; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 293 | if (content.kind === 'UnableToDecrypt') return 'Unable to decrypt'; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 294 | return systemLine(content); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 295 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 296 | |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 297 | function systemLine(content: TimelineContent, actor = displayName): string { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 298 | switch (content.kind) { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 299 | case 'Redacted': |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 300 | return 'Message deleted'; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 301 | case 'UnableToDecrypt': |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 302 | return `Message from ${actor} could not be decrypted`; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 303 | case 'Membership': { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 304 | const who = actorLabel(content.user_id, content.display_name); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 305 | return `${who} ${MEMBERSHIP_LABELS[content.change] ?? 'updated their membership'}`; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 306 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 307 | case 'Profile': { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 308 | const who = actorLabel(content.user_id, null); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 309 | const parts: string[] = []; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 310 | if (content.display_name) { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 311 | parts.push( |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 312 | content.display_name.new |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 313 | ? `changed their display name to "${content.display_name.new}"` |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 314 | : 'removed their display name' |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 315 | ); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 316 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 317 | if (content.avatar) parts.push('changed their avatar'); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 318 | return `${who} ${parts.length > 0 ? parts.join(' and ') : 'updated their profile'}`; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 319 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 320 | case 'RoomName': |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 321 | return content.name |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 322 | ? `${actor} changed the room name to "${content.name}"` |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 323 | : `${actor} removed the room name`; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 324 | case 'RoomTopic': |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 325 | return content.topic |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 326 | ? `${actor} changed the topic to "${content.topic}"` |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 327 | : `${actor} removed the topic`; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 328 | case 'RoomAvatar': |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 329 | return content.avatar ? `${actor} changed the room avatar` : `${actor} removed the room avatar`; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 330 | case 'EncryptionEnabled': |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 331 | return `${actor} enabled encryption in this room`; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 332 | case 'RoomCreated': |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 333 | return `${actor} created the room`; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 334 | case 'RoomUpgraded': |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 335 | return `${actor} upgraded the room to a new version`; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 336 | case 'OtherState': |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 337 | return `${actor} ${STATE_LABELS[content.event_type] ?? `sent a state event (${content.event_type})`}`; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 338 | case 'Other': |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 339 | return `${actor} sent an event (${content.event_type})`; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 340 | default: |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 341 | return actor; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 342 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 343 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 344 | </script> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 345 | |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 346 | <!-- svelte-ignore a11y_no_noninteractive_tabindex a11y_no_noninteractive_element_interactions --> |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 347 | <div |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 348 | class="msg" |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 349 | role="group" |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 350 | tabindex={interactive && !readOnly ? 0 : undefined} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 351 | class:own={event.own} |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 352 | class:editing |
a4555a7eae2d | atagen | 2026-10-25 09:18 UTC | 353 | class:mentioned={mentionsMe || keywordHit} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 354 | class:system={!interactive} |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 355 | class:has-readers={interactive && readers.length > 0} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 356 | class:selected |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 357 | data-item={itemId} |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 358 | data-event={event.event_id} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 359 | in:rowIn|global |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 360 | out:rowOut|global |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 361 | bind:this={row} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 362 | on:click={toggleSelected} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 363 | on:keydown={onRowKeydown} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 364 | on:pointerenter={() => (hovered = true)} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 365 | on:pointerleave={() => (hovered = false)} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 366 | on:focusin={() => (focused = true)} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 367 | on:focusout={onFocusOut} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 368 | > |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 369 | {#if showActions && event.event_id} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 370 | <div class="actions" role="toolbar" aria-label={`Actions for message from ${displayName}`}> |
8c81366a752f | atagen | 2026-10-26 03:56 UTC | 371 | <div class="quick" style={`--quick-cols:${Math.min(quickReactions.length, QUICK_REACTIONS_PER_ROW)}`}> |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 372 | {#each quickReactions as r (r.key)} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 373 | {@const label = r.shortcode ? `:${r.shortcode}:` : r.key} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 374 | <button |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 375 | type="button" |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 376 | title={`React ${label}`} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 377 | aria-label={`React ${label} to message from ${displayName}`} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 378 | disabled={reacting} |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 379 | on:click={() => react(r.key, r.shortcode)} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 380 | > |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 381 | {#if r.key.startsWith('mxc://')} |
7643577c76bb | atagen | 2026-10-25 07:37 UTC | 382 | <img class="emote" src={mediaUrl(r.key, 64) ?? ''} alt="" /> |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 383 | {:else} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 384 | <Emoji emoji={r.key} size={18} /> |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 385 | {/if} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 386 | </button> |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 387 | {/each} |
8c81366a752f | atagen | 2026-10-26 03:56 UTC | 388 | </div> |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 389 | <button |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 390 | type="button" |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 391 | title="Add reaction" |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 392 | aria-label={`Add reaction to message from ${displayName}`} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 393 | aria-haspopup="dialog" |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 394 | aria-expanded={pickerOpen} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 395 | on:pointerdown|stopPropagation |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 396 | on:click={openPicker} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 397 | > |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 398 | ☺+ |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 399 | </button> |
d095131eec0e | atagen | 2026-10-24 08:39 UTC | 400 | {#if onCloneSticker && event.content.kind === 'Sticker'} |
d095131eec0e | atagen | 2026-10-24 08:39 UTC | 401 | {@const stickerBody = event.content.body} |
d095131eec0e | atagen | 2026-10-24 08:39 UTC | 402 | {@const stickerId = event.event_id} |
d095131eec0e | atagen | 2026-10-24 08:39 UTC | 403 | <button |
d095131eec0e | atagen | 2026-10-24 08:39 UTC | 404 | type="button" |
d095131eec0e | atagen | 2026-10-24 08:39 UTC | 405 | title="Clone sticker" |
d095131eec0e | atagen | 2026-10-24 08:39 UTC | 406 | aria-label="Clone sticker to one of your packs" |
d095131eec0e | atagen | 2026-10-24 08:39 UTC | 407 | on:click|stopPropagation={(ev) => onCloneSticker?.(stickerId, stickerBody, ev.clientX, ev.clientY)} |
d095131eec0e | atagen | 2026-10-24 08:39 UTC | 408 | > |
d095131eec0e | atagen | 2026-10-24 08:39 UTC | 409 | ⧉ |
d095131eec0e | atagen | 2026-10-24 08:39 UTC | 410 | </button> |
d095131eec0e | atagen | 2026-10-24 08:39 UTC | 411 | {/if} |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 412 | {#if onReply} |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 413 | <button |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 414 | type="button" |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 415 | title="Reply" |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 416 | aria-label={`Reply to message from ${displayName}`} |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 417 | on:click|stopPropagation={reply} |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 418 | > |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 419 | ↩ |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 420 | </button> |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 421 | {/if} |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 422 | {#if threadRoot} |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 423 | {@const root = threadRoot} |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 424 | <button |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 425 | type="button" |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 426 | title="Reply in thread" |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 427 | aria-label={`Reply in thread to message from ${displayName}`} |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 428 | on:click|stopPropagation={() => onOpenThread?.(root)} |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 429 | > |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 430 | <svg width="14" height="14" viewBox="0 0 16 16" aria-hidden="true"><path d="M2.5 3h11v7h-6l-3 3v-3h-2z" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linejoin="round"/><path d="M5 6h6M5 8h4" stroke="currentColor" stroke-width="1.2" stroke-linecap="round"/></svg> |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 431 | </button> |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 432 | {/if} |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 433 | {#if onEdit && editableBody !== null} |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 434 | <button type="button" title="Edit" aria-label="Edit your message" on:click|stopPropagation={edit}> |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 435 | ✎ |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 436 | </button> |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 437 | {/if} |
0380cd8c765c | atagen | 2026-10-24 09:08 UTC | 438 | {#if onMore} |
0380cd8c765c | atagen | 2026-10-24 09:08 UTC | 439 | <button |
0380cd8c765c | atagen | 2026-10-24 09:08 UTC | 440 | type="button" |
0380cd8c765c | atagen | 2026-10-24 09:08 UTC | 441 | title="More" |
0380cd8c765c | atagen | 2026-10-24 09:08 UTC | 442 | aria-label={`More actions for message from ${displayName}`} |
0380cd8c765c | atagen | 2026-10-24 09:08 UTC | 443 | aria-haspopup="menu" |
0380cd8c765c | atagen | 2026-10-24 09:08 UTC | 444 | on:click|stopPropagation={(ev) => onMore?.(event, ev.clientX, ev.clientY)} |
0380cd8c765c | atagen | 2026-10-24 09:08 UTC | 445 | > |
0380cd8c765c | atagen | 2026-10-24 09:08 UTC | 446 | ⋯ |
0380cd8c765c | atagen | 2026-10-24 09:08 UTC | 447 | </button> |
0380cd8c765c | atagen | 2026-10-24 09:08 UTC | 448 | {/if} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 449 | </div> |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 450 | {#if pickerOpen} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 451 | <div class="picker-pop" style={pickerStyle} bind:this={pickerPop}> |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 452 | <ReactionPicker {packs} quick={quickReactions} onPick={pick} {onQuickChange} onClose={closePicker} /> |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 453 | </div> |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 454 | {/if} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 455 | {/if} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 456 | {#if event.reply_to} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 457 | {@const target = event.reply_to.event_id} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 458 | <div class="reply-line" class:linked={showSender}> |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 459 | <button |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 460 | type="button" |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 461 | class="reply-quote" |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 462 | disabled={!onJump} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 463 | title="Jump to the original message" |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 464 | on:click|stopPropagation={() => onJump?.(target)} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 465 | > |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 466 | {#if event.reply_to.details.kind === 'Ready'} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 467 | <span class="reply-sender"><EmojiText text={event.reply_to.details.sender.display_name ?? people[event.reply_to.details.sender.user_id]?.name ?? senderLabel(event.reply_to.details.sender)} /></span> |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 468 | <span class="reply-text"><EmojiText text={replyPreview(event.reply_to.details.content)} /></span> |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 469 | {:else if event.reply_to.details.kind === 'Pending'} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 470 | Loading reply… |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 471 | {:else} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 472 | Reply unavailable |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 473 | {/if} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 474 | </button> |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 475 | </div> |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 476 | {/if} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 477 | {#if showSender} |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 478 | <button |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 479 | type="button" |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 480 | class="user-hit" |
668ab5c30531 | atagen | 2026-10-25 03:13 UTC | 481 | disabled={!onUser} |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 482 | tabindex="-1" |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 483 | aria-hidden="true" |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 484 | on:click|stopPropagation={(ev) => openUser(ev, false)} |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 485 | on:contextmenu|preventDefault|stopPropagation={(ev) => openUser(ev, true)} |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 486 | > |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 487 | {#if senderAvatar} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 488 | <MxcAvatar mxc={senderAvatar} label={name} size={34} eager /> |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 489 | {:else} |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 490 | <span class="avatar" style={`background:hsl(${senderHue(event.sender.user_id)} 35% 32%)`}> |
445bf199a9cf | atagen | 2026-10-25 02:56 UTC | 491 | <span><EmojiText text={initialsOf(name)} /></span> |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 492 | </span> |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 493 | {/if} |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 494 | </button> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 495 | {:else} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 496 | <div class="avatar-spacer" aria-hidden="true"> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 497 | <span class="hover-time">{formatClock(event.timestamp_ms)}</span> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 498 | </div> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 499 | {/if} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 500 | <div class="msg-body"> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 501 | {#if showSender} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 502 | <div class="msg-head"> |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 503 | <button |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 504 | type="button" |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 505 | class="sender" |
668ab5c30531 | atagen | 2026-10-25 03:13 UTC | 506 | disabled={!onUser} |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 507 | style={`color:hsl(${senderHue(event.sender.user_id)} 70% var(--name-lightness))`} |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 508 | on:click|stopPropagation={(ev) => openUser(ev, false)} |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 509 | on:contextmenu|preventDefault|stopPropagation={(ev) => openUser(ev, true)} |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 510 | > |
445bf199a9cf | atagen | 2026-10-25 02:56 UTC | 511 | <EmojiText text={displayName} /> |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 512 | </button> |
d2a34d0f4861 | atagen | 2026-10-25 07:29 UTC | 513 | {#if lag} |
d2a34d0f4861 | atagen | 2026-10-25 07:29 UTC | 514 | <span class="federation-lag" title="Possibly delayed by federation" aria-label={`Arrived ${lag} late, possibly delayed by federation`}> |
d2a34d0f4861 | atagen | 2026-10-25 07:29 UTC | 515 | <span aria-hidden="true">◷</span><span>{lag}</span> |
d2a34d0f4861 | atagen | 2026-10-25 07:29 UTC | 516 | </span> |
d2a34d0f4861 | atagen | 2026-10-25 07:29 UTC | 517 | {/if} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 518 | <time class="time" datetime={new Date(event.timestamp_ms).toISOString()}> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 519 | {formatDay(event.timestamp_ms)} {formatClock(event.timestamp_ms)} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 520 | </time> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 521 | {#if event.content.kind === 'Message' && event.content.message.edited} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 522 | <span class="edited" title="Edited" transition:dissolve>(edited)</span> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 523 | {/if} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 524 | </div> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 525 | {/if} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 526 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 527 | {#if event.content.kind === 'Message'} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 528 | {@const m = event.content.message} |
705b1e1062c2 | atagen | 2026-10-23 09:05 UTC | 529 | {#if stripped.text} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 530 | <div class="text" class:emote={m.kind === 'Emote'} class:notice={m.kind === 'Notice' || m.kind === 'ServerNotice'}>{#if m.kind === 'Emote'}* <EmojiText text={displayName} /> {/if}<MessageText text={stripped.text} html={m.formatted_body} jumbo={m.kind === 'Text'} {mentions} {self} {nameOf} />{#if m.edited && !showSender}<span class="edited" title="Edited" transition:dissolve>(edited)</span>{/if}</div> |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 531 | {/if} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 532 | {#if m.media} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 533 | <MediaAttachmentView attachment={m.media} /> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 534 | {/if} |
705b1e1062c2 | atagen | 2026-10-23 09:05 UTC | 535 | {#if cards.length > 0} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 536 | <div class="link-previews" transition:expand> |
705b1e1062c2 | atagen | 2026-10-23 09:05 UTC | 537 | {#each cards as card (card.link.href)} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 538 | <div transition:expand><LinkCard link={card.link} preview={card.preview} /></div> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 539 | {/each} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 540 | </div> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 541 | {/if} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 542 | {:else if event.content.kind === 'Sticker'} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 543 | {#if event.content.media} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 544 | <MediaAttachmentView attachment={event.content.media} /> |
dfd1feaae855 | atagen | 2026-10-24 10:54 UTC | 545 | {:else if event.content.body}<p class="text"><EmojiText text={event.content.body} /></p>{/if} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 546 | {:else if event.content.kind === 'Poll'} |
445bf199a9cf | atagen | 2026-10-25 02:56 UTC | 547 | <p class="text"><EmojiText text={`📊 ${event.content.question}`} /></p> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 548 | {:else} |
445bf199a9cf | atagen | 2026-10-25 02:56 UTC | 549 | <p class="system-line"><EmojiText text={systemLine(event.content, displayName)} /></p> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 550 | {/if} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 551 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 552 | {#if interactive && event.reactions.length > 0} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 553 | <div class="reactions" aria-label="Reactions" transition:expand> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 554 | {#each event.reactions as r (r.key)} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 555 | <button |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 556 | type="button" |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 557 | class="reaction" |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 558 | transition:expand={{ axis: 'x' }} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 559 | class:mine={r.own} |
d4c0d65f690a | atagen | 2026-10-24 12:50 UTC | 560 | aria-label={`${r.shortcode ? `:${r.shortcode}:` : r.key.startsWith('mxc://') ? 'custom emote' : r.key}, ${r.count} reaction${r.count === 1 ? '' : 's'}`} |
668ab5c30531 | atagen | 2026-10-25 03:13 UTC | 561 | disabled={readOnly || !event.event_id || reacting} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 562 | aria-describedby={reactorKey === r.key ? `${itemId}-reactors-${r.key}` : undefined} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 563 | on:pointerenter={() => (reactorKey = r.key)} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 564 | on:pointerleave={() => (reactorKey = null)} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 565 | on:focus={() => (reactorKey = r.key)} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 566 | on:blur={() => (reactorKey = null)} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 567 | on:click={() => event.event_id && onReact(event.event_id, r.key)} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 568 | > |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 569 | {#if r.image} |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 570 | <img class="emote" src={messageMediaUrl(r.image, 'Thumbnail')} alt={r.shortcode ?? ''} title={r.shortcode ?? ''} /> |
ecb8598b38af | atagen | 2026-10-22 09:19 UTC | 571 | {:else if r.key.startsWith('mxc://')} |
7643577c76bb | atagen | 2026-10-25 07:37 UTC | 572 | <img class="emote" src={mediaUrl(r.key, 64) ?? ''} alt="" /> |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 573 | {:else} |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 574 | <Emoji emoji={r.key} size={16} /> |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 575 | {/if} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 576 | <span class="count">{r.count}</span> |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 577 | {#if reactorKey === r.key} |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 578 | <span class="reactors" role="tooltip" id={`${itemId}-reactors-${r.key}`}> |
2021154f9e16 | atagen | 2026-10-25 02:37 UTC | 579 | <span class="reactors-key"><EmojiText text={r.shortcode ? `:${r.shortcode}:` : r.key.startsWith('mxc://') ? 'custom emote' : r.key} /></span> |
2021154f9e16 | atagen | 2026-10-25 02:37 UTC | 580 | <EmojiText text={reactorNames(r.senders)} /> |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 581 | </span> |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 582 | {/if} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 583 | </button> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 584 | {/each} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 585 | </div> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 586 | {/if} |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 587 | {#if threadRoot && threadReplies > 0} |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 588 | {@const root = threadRoot} |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 589 | {@const latest = event.thread_summary?.latest_event_timestamp_ms ?? null} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 590 | <button type="button" class="thread-chip" transition:expand on:click|stopPropagation={() => onOpenThread?.(root)}> |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 591 | <span class="thread-count">{threadReplies} {threadReplies === 1 ? 'reply' : 'replies'}</span> |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 592 | {#if latest}<time datetime={new Date(latest).toISOString()}>{formatDay(latest)} {formatClock(latest)}</time>{/if} |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 593 | </button> |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 594 | {/if} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 595 | {#if sent}<span class="sent-tick" title="Sent" aria-label="Sent" transition:dissolve>✓</span>{/if} |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 596 | {#if interactive && sendLabel(event.send_state)} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 597 | <div class="msg-foot" transition:expand> |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 598 | <span class="sendstate" class:failed={event.send_state.kind === 'Failed'}>{sendLabel(event.send_state)}</span> |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 599 | </div> |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 600 | {/if} |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 601 | {#if interactive && readers.length > 0} |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 602 | {@const seenBy = `Seen by ${readers.map((r) => r.name).join(', ')}`} |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 603 | <div class="readby" transition:dissolve title={seenBy} aria-label={seenBy} role="img"> |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 604 | {#each readers.slice(0, MAX_READERS) as r (r.user_id)} |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 605 | <MxcAvatar mxc={r.avatar} label={r.name} size={16} /> |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 606 | {/each} |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 607 | {#if readers.length > MAX_READERS}<span class="more">+{readers.length - MAX_READERS}</span>{/if} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 608 | </div> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 609 | {/if} |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 610 | </div> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 611 | </div> |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 612 | |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 613 | <style> |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 614 | .msg { position: relative; display: flex; flex-wrap: wrap; gap: 0 10px; padding: var(--msg-gap, 3px) 0; } |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 615 | .reply-line { position: relative; flex: 0 0 100%; min-width: 0; padding-left: 44px; } |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 616 | .reply-line.linked::before { content: ''; position: absolute; left: 16px; top: 50%; bottom: -3px; width: 24px; border-left: 2px solid var(--border); border-top: 2px solid var(--border); border-top-left-radius: 8px; pointer-events: none; } |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 617 | .msg:hover, .msg.selected { background: var(--hover-faint); } |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 618 | .msg:hover .hover-time, .msg.selected .hover-time { opacity: 1; } |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 619 | .msg-foot { display: flex; align-items: center; gap: 8px; } |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 620 | .thread-chip { display: inline-flex; align-items: baseline; gap: 8px; margin-top: 4px; padding: 3px 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg-soft); color: var(--text); font: inherit; font-size: 12px; cursor: pointer; transition: border-color var(--pop), background var(--pop); } |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 621 | .thread-chip:hover { border-color: var(--accent); background: var(--hover-faint); } |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 622 | .thread-count { color: var(--accent); font-weight: 650; } |
7ebc2472a9e3 | atagen | 2026-10-25 09:53 UTC | 623 | .thread-chip time { color: var(--muted); font-size: 11px; } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 624 | .sendstate { font-size: 11px; color: var(--muted); } |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 625 | .sent-tick { position: absolute; right: 12px; bottom: 4px; font-size: 11px; color: var(--muted); } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 626 | .sendstate.failed { color: var(--danger); } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 627 | .link-previews { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-width: 420px; } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 628 | .avatar { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 629 | flex: none; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 630 | width: 34px; height: 34px; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 631 | border-radius: 50%; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 632 | display: grid; place-items: center; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 633 | font-size: 12px; font-weight: 700; color: #fff; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 634 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 635 | .avatar-spacer { flex: none; width: 34px; padding-top: 2px; text-align: center; } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 636 | .hover-time { opacity: 0; font-size: 10.5px; color: var(--muted); } |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 637 | .msg-body { min-width: 0; flex: 1; transition: padding-right var(--pop); } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 638 | .msg-head { display: flex; align-items: baseline; gap: 8px; } |
d2a34d0f4861 | atagen | 2026-10-25 07:29 UTC | 639 | .federation-lag { display: inline-flex; align-items: center; gap: 3px; color: var(--danger); font-size: 11px; font-weight: 650; } |
d2a34d0f4861 | atagen | 2026-10-25 07:29 UTC | 640 | .federation-lag > span:last-child { display: inline-grid; place-items: center; min-width: 24px; height: 18px; padding: 0 4px; border: 1px solid currentColor; border-radius: 999px; } |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 641 | .sender { font-weight: 650; font-size: 13.5px; padding: 0; border: none; background: none; font-family: inherit; cursor: pointer; } |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 642 | .sender:hover { text-decoration: underline; } |
d8624c214c04 | atagen | 2026-10-24 08:24 UTC | 643 | .user-hit { flex: none; align-self: flex-start; padding: 0; border: none; background: none; border-radius: 50%; cursor: pointer; } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 644 | .time, .edited { color: var(--muted); font-size: 11.5px; } |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 645 | .text .edited { margin-left: 6px; } |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 646 | .msg.editing { background: color-mix(in srgb, var(--accent) 10%, transparent); } |
705b1e1062c2 | atagen | 2026-10-23 09:05 UTC | 647 | .msg.mentioned { background: color-mix(in srgb, var(--warn) 8%, transparent); box-shadow: inset 2px 0 0 var(--warn); } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 648 | .reply-quote { |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 649 | display: flex; gap: 6px; align-items: baseline; |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 650 | max-width: min(100%, 520px); |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 651 | border: none; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 652 | border-left: 2px solid var(--accent); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 653 | padding: 2px 8px; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 654 | margin: 2px 0 4px; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 655 | color: var(--muted); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 656 | font-size: 12.5px; |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 657 | text-align: left; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 658 | background: var(--bg-soft); |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 659 | border-radius: 0 var(--r-sm) var(--r-sm) 0; |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 660 | cursor: pointer; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 661 | } |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 662 | .reply-quote:disabled { cursor: default; } |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 663 | .reply-quote:hover:not(:disabled) { color: var(--text); } |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 664 | .reply-sender { flex: none; font-weight: 650; } |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 665 | .reply-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 666 | :global(.msg.flash) { animation: reply-flash 1.2s ease-out; } |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 667 | @keyframes -global-reply-flash { from { background: color-mix(in srgb, var(--accent) 22%, transparent); } } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 668 | .text { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 669 | margin: 1px 0 2px; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 670 | font-size: 14px; |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 671 | line-height: var(--msg-line-height, 1.5); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 672 | white-space: pre-wrap; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 673 | overflow-wrap: anywhere; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 674 | } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 675 | .text.emote { font-style: italic; color: var(--muted); } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 676 | .text.notice { color: var(--muted); } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 677 | .system-line { color: var(--muted); font-size: 12.5px; font-style: italic; margin: 1px 0; } |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 678 | .msg.system { opacity: 0.85; --msg-gap: 1.5px; } |
f604ef6df0c4 | atagen | 2026-10-24 10:08 UTC | 679 | .msg.system .avatar-spacer { height: 0; padding-top: 0; } |
dfd1feaae855 | atagen | 2026-10-24 10:54 UTC | 680 | .reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: max(4px, var(--msg-gap, 3px)); } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 681 | .reaction { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 682 | display: inline-flex; align-items: center; gap: 4px; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 683 | background: var(--bg-soft); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 684 | border: 1px solid var(--border); |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 685 | border-radius: var(--r-sm); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 686 | padding: 1px 8px; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 687 | font-size: 13px; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 688 | color: var(--text); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 689 | cursor: pointer; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 690 | } |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 691 | .reaction { position: relative; } |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 692 | .reactors { |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 693 | position: absolute; |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 694 | left: 0; |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 695 | bottom: calc(100% + 6px); |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 696 | z-index: 15; |
d07bca5da4ae | atagen | 2026-10-26 03:48 UTC | 697 | display: block; |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 698 | width: max-content; |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 699 | max-width: 260px; |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 700 | padding: 6px 9px; |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 701 | border: 1px solid var(--border); |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 702 | border-radius: var(--r-md); |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 703 | background: var(--panel-2); |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 704 | box-shadow: 0 6px 18px rgb(0 0 0 / 0.3); |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 705 | color: var(--text); |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 706 | font-size: 12px; |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 707 | line-height: 1.35; |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 708 | text-align: left; |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 709 | white-space: normal; |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 710 | pointer-events: none; |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 711 | } |
cf23dbf4e77c | atagen | 2026-10-23 06:36 UTC | 712 | .reactors-key { display: block; color: var(--muted); font-size: 11px; } |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 713 | .reaction.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 714 | .reaction:disabled { cursor: default; opacity: 0.85; } |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 715 | .msg.has-readers .msg-body { padding-right: 72px; } |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 716 | .readby { position: absolute; right: 12px; bottom: 4px; display: flex; align-items: center; } |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 717 | .readby > :global(* + *) { margin-left: -4px; } |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 718 | .readby :global(.mxc-avatar), .readby :global(.mxc-fallback) { box-shadow: 0 0 0 1.5px var(--bg); } |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 719 | .readby .more { margin-left: 3px; font-size: 10.5px; color: var(--muted); } |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 720 | .actions { |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 721 | position: absolute; top: -12px; right: 10px; z-index: 2; |
8c81366a752f | atagen | 2026-10-26 03:56 UTC | 722 | display: flex; align-items: flex-start; gap: 2px; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 723 | padding: 2px; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 724 | background: var(--bg-soft); |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 725 | border: 1px solid var(--border); |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 726 | border-radius: var(--r-md); |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 727 | box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 728 | } |
8c81366a752f | atagen | 2026-10-26 03:56 UTC | 729 | .quick { display: grid; grid-template-columns: repeat(var(--quick-cols, 8), auto); gap: 2px; } |
8c81366a752f | atagen | 2026-10-26 03:56 UTC | 730 | .quick:empty { display: none; } |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 731 | .actions button { |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 732 | background: transparent; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 733 | border: 1px solid transparent; |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 734 | border-radius: var(--r-sm); |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 735 | cursor: pointer; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 736 | font-size: 14px; |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 737 | padding: 1px 5px; |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 738 | } |
df3c0f2b3da4 | atagen | 2026-10-22 13:07 UTC | 739 | .actions button:hover:not(:disabled) { border-color: var(--border); background: var(--hover); } |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 740 | .actions button:disabled { opacity: 0.4; cursor: default; } |
544a170ead2c | atagen | 2026-10-20 11:47 UTC | 741 | .emote { width: 1.3em; height: 1.3em; object-fit: contain; vertical-align: middle; } |
05a48e9e7942 | atagen | 2026-10-24 09:32 UTC | 742 | .picker-pop { position: fixed; z-index: 60; width: 320px; max-width: calc(100vw - 16px); animation: pop-in var(--pop); } |
973f8fbdaf80 | atagen | 2026-09-28 09:10 UTC | 743 | </style> |