@k2b/ui 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/base.css +147 -2
- package/dist/browser/actions/ContextMenu.js +30 -4
- package/dist/browser/actions/ContextMenu.js.map +1 -1
- package/dist/browser/actions/Dropdown.js +184 -158
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/GestureMenu.js +71 -138
- package/dist/browser/actions/GestureMenu.js.map +1 -1
- package/dist/browser/actions/Toolbar.js +379 -48
- package/dist/browser/actions/Toolbar.js.map +1 -1
- package/dist/browser/actions/index.js.map +1 -1
- package/dist/browser/actions/menu-rows.js +15 -0
- package/dist/browser/actions/menu-rows.js.map +1 -0
- package/dist/browser/actions/menu-sheet.js +154 -0
- package/dist/browser/actions/menu-sheet.js.map +1 -0
- package/dist/browser/actions/toolbar-messages.js +20 -0
- package/dist/browser/actions/toolbar-messages.js.map +1 -0
- package/dist/browser/chart-inspection.js +3 -0
- package/dist/browser/chart-inspection.js.map +1 -0
- package/dist/browser/chat/ChatComposer.js +1020 -431
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/chat/chat-behavior.js +4 -0
- package/dist/browser/chat/chat-behavior.js.map +1 -1
- package/dist/browser/chat/chat-messages.js +33 -1
- package/dist/browser/chat/chat-messages.js.map +1 -1
- package/dist/browser/chat/command-search.js +173 -0
- package/dist/browser/chat/command-search.js.map +1 -0
- package/dist/browser/chat/composer-document.js +1 -1
- package/dist/browser/chat/composer-document.js.map +1 -1
- package/dist/browser/chat/index.js +2 -0
- package/dist/browser/chat/index.js.map +1 -1
- package/dist/browser/chat/reaction-people.js +15 -0
- package/dist/browser/chat/reaction-people.js.map +1 -0
- package/dist/browser/content/CalendarDayView.js +28 -3
- package/dist/browser/content/CalendarDayView.js.map +1 -1
- package/dist/browser/content/Chart.js +6 -15
- package/dist/browser/content/Chart.js.map +1 -1
- package/dist/browser/content/ChartSnapshotView.js +7 -10
- package/dist/browser/content/ChartSnapshotView.js.map +1 -1
- package/dist/browser/content/MessageRow.js +330 -448
- package/dist/browser/content/MessageRow.js.map +1 -1
- package/dist/browser/content/ReactionBar.js +419 -0
- package/dist/browser/content/ReactionBar.js.map +1 -0
- package/dist/browser/content/chart-inspection-core.js +557 -0
- package/dist/browser/content/chart-inspection-core.js.map +1 -0
- package/dist/browser/content/chart-inspection.js +10 -445
- package/dist/browser/content/chart-inspection.js.map +1 -1
- package/dist/browser/content/chart-line-gaps.js +1 -1
- package/dist/browser/content/chart-line-gaps.js.map +1 -1
- package/dist/browser/content/chart-snapshot.js +1 -1
- package/dist/browser/content/chart-snapshot.js.map +1 -1
- package/dist/browser/content/index.js +1 -0
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/feedback/dialog-core.js +135 -23
- package/dist/browser/feedback/dialog-core.js.map +1 -1
- package/dist/browser/index.js +1 -0
- package/dist/browser/index.js.map +1 -1
- package/dist/browser/input-mode.js +40 -0
- package/dist/browser/input-mode.js.map +1 -0
- package/dist/browser/inputs/Combobox.js +4 -2
- package/dist/browser/inputs/Combobox.js.map +1 -1
- package/dist/browser/inputs/FileDropTarget.js +24 -9
- package/dist/browser/inputs/FileDropTarget.js.map +1 -1
- package/dist/browser/inputs/FileInputs.js +2 -2
- package/dist/browser/inputs/FileInputs.js.map +1 -1
- package/dist/browser/inputs/SelectChip.js +52 -12
- package/dist/browser/inputs/SelectChip.js.map +1 -1
- package/dist/browser/inputs/emoji/EmojiPicker.js +13 -0
- package/dist/browser/inputs/emoji/EmojiPicker.js.map +1 -1
- package/dist/browser/inputs/file-drop.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +708 -515
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/BottomSheet.js +8 -0
- package/dist/browser/layout/BottomSheet.js.map +1 -1
- package/dist/browser/layout/DetailPanel.js +283 -197
- package/dist/browser/layout/DetailPanel.js.map +1 -1
- package/dist/browser/layout/Discussion.js +233 -185
- package/dist/browser/layout/Discussion.js.map +1 -1
- package/dist/browser/layout/TableOfContents.js +10 -2
- package/dist/browser/layout/TableOfContents.js.map +1 -1
- package/dist/browser/layout/app-workspace-controller.js +155 -23
- package/dist/browser/layout/app-workspace-controller.js.map +1 -1
- package/dist/browser/layout/app-workspace-state.js +5 -1
- package/dist/browser/layout/app-workspace-state.js.map +1 -1
- package/dist/browser/layout/detail-panel-messages.js +35 -0
- package/dist/browser/layout/detail-panel-messages.js.map +1 -0
- package/dist/browser/layout/index.js +1 -1
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/surfaces/Avatar.js +50 -20
- package/dist/browser/surfaces/Avatar.js.map +1 -1
- package/dist/browser/surfaces/AvatarStack.js +406 -0
- package/dist/browser/surfaces/AvatarStack.js.map +1 -0
- package/dist/browser/surfaces/avatar-messages.js +8 -2
- package/dist/browser/surfaces/avatar-messages.js.map +1 -1
- package/dist/browser/surfaces/index.js +1 -0
- package/dist/browser/surfaces/index.js.map +1 -1
- package/dist/ssr/actions/ContextMenu.js +21 -3
- package/dist/ssr/actions/ContextMenu.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +140 -72
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/GestureMenu.js +52 -106
- package/dist/ssr/actions/GestureMenu.js.map +1 -1
- package/dist/ssr/actions/Toolbar.js +294 -14
- package/dist/ssr/actions/Toolbar.js.map +1 -1
- package/dist/ssr/actions/index.js.map +1 -1
- package/dist/ssr/actions/menu-rows.js +15 -0
- package/dist/ssr/actions/menu-rows.js.map +1 -0
- package/dist/ssr/actions/menu-sheet.js +138 -0
- package/dist/ssr/actions/menu-sheet.js.map +1 -0
- package/dist/ssr/actions/toolbar-messages.js +20 -0
- package/dist/ssr/actions/toolbar-messages.js.map +1 -0
- package/dist/ssr/chart-inspection.js +3 -0
- package/dist/ssr/chart-inspection.js.map +1 -0
- package/dist/ssr/chat/ChatComposer.js +604 -113
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/chat/chat-behavior.js +4 -0
- package/dist/ssr/chat/chat-behavior.js.map +1 -1
- package/dist/ssr/chat/chat-messages.js +33 -1
- package/dist/ssr/chat/chat-messages.js.map +1 -1
- package/dist/ssr/chat/command-search.js +173 -0
- package/dist/ssr/chat/command-search.js.map +1 -0
- package/dist/ssr/chat/composer-document.js +1 -1
- package/dist/ssr/chat/composer-document.js.map +1 -1
- package/dist/ssr/chat/index.js +2 -0
- package/dist/ssr/chat/index.js.map +1 -1
- package/dist/ssr/chat/reaction-people.js +15 -0
- package/dist/ssr/chat/reaction-people.js.map +1 -0
- package/dist/ssr/content/CalendarDayView.js +28 -3
- package/dist/ssr/content/CalendarDayView.js.map +1 -1
- package/dist/ssr/content/Chart.js +6 -15
- package/dist/ssr/content/Chart.js.map +1 -1
- package/dist/ssr/content/ChartSnapshotView.js +7 -10
- package/dist/ssr/content/ChartSnapshotView.js.map +1 -1
- package/dist/ssr/content/MessageRow.js +98 -152
- package/dist/ssr/content/MessageRow.js.map +1 -1
- package/dist/ssr/content/ReactionBar.js +304 -0
- package/dist/ssr/content/ReactionBar.js.map +1 -0
- package/dist/ssr/content/chart-inspection-core.js +557 -0
- package/dist/ssr/content/chart-inspection-core.js.map +1 -0
- package/dist/ssr/content/chart-inspection.js +10 -445
- package/dist/ssr/content/chart-inspection.js.map +1 -1
- package/dist/ssr/content/chart-line-gaps.js +1 -1
- package/dist/ssr/content/chart-line-gaps.js.map +1 -1
- package/dist/ssr/content/chart-snapshot.js +1 -1
- package/dist/ssr/content/chart-snapshot.js.map +1 -1
- package/dist/ssr/content/index.js +1 -0
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/feedback/dialog-core.js +135 -23
- package/dist/ssr/feedback/dialog-core.js.map +1 -1
- package/dist/ssr/index.js +1 -0
- package/dist/ssr/index.js.map +1 -1
- package/dist/ssr/input-mode.js +40 -0
- package/dist/ssr/input-mode.js.map +1 -0
- package/dist/ssr/inputs/Combobox.js +4 -2
- package/dist/ssr/inputs/Combobox.js.map +1 -1
- package/dist/ssr/inputs/FileDropTarget.js +17 -5
- package/dist/ssr/inputs/FileDropTarget.js.map +1 -1
- package/dist/ssr/inputs/FileInputs.js +2 -2
- package/dist/ssr/inputs/FileInputs.js.map +1 -1
- package/dist/ssr/inputs/SelectChip.js +44 -11
- package/dist/ssr/inputs/SelectChip.js.map +1 -1
- package/dist/ssr/inputs/emoji/EmojiPicker.js +12 -0
- package/dist/ssr/inputs/emoji/EmojiPicker.js.map +1 -1
- package/dist/ssr/inputs/file-drop.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +242 -105
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/BottomSheet.js +8 -0
- package/dist/ssr/layout/BottomSheet.js.map +1 -1
- package/dist/ssr/layout/DetailPanel.js +112 -58
- package/dist/ssr/layout/DetailPanel.js.map +1 -1
- package/dist/ssr/layout/Discussion.js +63 -36
- package/dist/ssr/layout/Discussion.js.map +1 -1
- package/dist/ssr/layout/TableOfContents.js +10 -2
- package/dist/ssr/layout/TableOfContents.js.map +1 -1
- package/dist/ssr/layout/app-workspace-controller.js +155 -23
- package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
- package/dist/ssr/layout/app-workspace-state.js +5 -1
- package/dist/ssr/layout/app-workspace-state.js.map +1 -1
- package/dist/ssr/layout/detail-panel-messages.js +35 -0
- package/dist/ssr/layout/detail-panel-messages.js.map +1 -0
- package/dist/ssr/layout/index.js +1 -1
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/surfaces/Avatar.js +20 -2
- package/dist/ssr/surfaces/Avatar.js.map +1 -1
- package/dist/ssr/surfaces/AvatarStack.js +286 -0
- package/dist/ssr/surfaces/AvatarStack.js.map +1 -0
- package/dist/ssr/surfaces/avatar-messages.js +8 -2
- package/dist/ssr/surfaces/avatar-messages.js.map +1 -1
- package/dist/ssr/surfaces/index.js +1 -0
- package/dist/ssr/surfaces/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/types/actions/ContextMenu.d.ts +8 -0
- package/dist/types/actions/Dropdown.d.ts +12 -5
- package/dist/types/actions/GestureMenu.d.ts +6 -4
- package/dist/types/actions/Toolbar.d.ts +20 -0
- package/dist/types/actions/index.d.ts +1 -1
- package/dist/types/actions/menu-rows.d.ts +5 -0
- package/dist/types/actions/menu-sheet.d.ts +22 -0
- package/dist/types/actions/toolbar-messages.d.ts +8 -0
- package/dist/types/chart-inspection.d.ts +2 -0
- package/dist/types/chat/ChatComposer.d.ts +51 -2
- package/dist/types/chat/chat-behavior.d.ts +4 -0
- package/dist/types/chat/chat-messages.d.ts +17 -2
- package/dist/types/chat/command-search.d.ts +41 -0
- package/dist/types/chat/index.d.ts +3 -1
- package/dist/types/chat/reaction-people.d.ts +9 -0
- package/dist/types/content/Chart.d.ts +2 -2
- package/dist/types/content/MessageRow.d.ts +3 -10
- package/dist/types/content/ReactionBar.d.ts +32 -0
- package/dist/types/content/chart-inspection-core.d.ts +61 -0
- package/dist/types/content/chart-inspection.d.ts +4 -20
- package/dist/types/content/chart-snapshot.d.ts +1 -1
- package/dist/types/content/index.d.ts +2 -1
- package/dist/types/feedback/dialog-core.d.ts +16 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/input-mode.d.ts +7 -0
- package/dist/types/inputs/FileDropTarget.d.ts +6 -3
- package/dist/types/inputs/SelectChip.d.ts +6 -0
- package/dist/types/inputs/file-drop.d.ts +2 -0
- package/dist/types/layout/AppWorkspace.d.ts +13 -1
- package/dist/types/layout/BottomSheet.d.ts +8 -0
- package/dist/types/layout/DetailPanel.d.ts +11 -0
- package/dist/types/layout/Discussion.d.ts +8 -0
- package/dist/types/layout/TableOfContents.d.ts +2 -0
- package/dist/types/layout/detail-panel-messages.d.ts +15 -0
- package/dist/types/layout/index.d.ts +1 -1
- package/dist/types/surfaces/Avatar.d.ts +12 -0
- package/dist/types/surfaces/AvatarStack.d.ts +41 -0
- package/dist/types/surfaces/avatar-messages.d.ts +3 -0
- package/dist/types/surfaces/index.d.ts +3 -1
- package/package.json +9 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["content/MessageRow.tsx"],"sourcesContent":["import { fileIcons } from \"@k2b/stdlib\";\nimport type { Token, Tokens } from \"marked\";\nimport { type Accessor, createMemo, createSignal, createUniqueId, For, type JSX, onCleanup, Show } from \"solid-js\";\nimport { Button, IconButton } from \"../actions/Button\";\nimport { copyText } from \"../actions/CopyButton\";\nimport { type ChatMessages, useChatMessages } from \"../chat/chat-messages\";\nimport { announce } from \"../feedback/announce\";\nimport { useLocale } from \"../intl/locale\";\nimport { type UiMessages, useUiMessages } from \"../intl/messages\";\nimport { ScrollArea } from \"../layout/ScrollArea\";\nimport { Avatar } from \"../surfaces/Avatar\";\nimport { createSafeMarked, createSafeRenderer, escapeHtml } from \"./MarkdownView\";\n\n/** Messages by the same author within this time continue a group. */\nconst GROUP_WINDOW_MS = 5 * 60_000;\n/**\n * A message collapses to ten lines (`.k2b-message-row__text[data-collapsed]`) when its rendered text takes more lines\n * than this. `renderedLines` counts the fewest lines the text takes at any width, so a collapsed message always hides\n * some of it.\n */\nconst COLLAPSE_LINES = 14;\n/** Visible characters that take at least one line of a message, even at its widest. */\nconst LINE_CHARS = 100;\n/** Lines at the bottom of a collapsed message that fade out, as `.k2b-message-row__text[data-collapsed]` draws them. */\nconst FADE_LINES = 2;\nconst COPIED_MS = 2_000;\n/** Links in messages may only use these schemes; other links show as their text. */\nconst LINK_PROTOCOLS = [\"https:\", \"http:\", \"mailto:\"] as const;\n/** Attachments open and load only from these schemes or from a relative URL. */\nconst ATTACHMENT_PROTOCOLS = new Set([\"https:\", \"http:\"]);\n/**\n * A picture may also show a file that is still uploading. A `blob:` URL runs in the page's origin when it is opened,\n * so links never use one.\n */\nconst PICTURE_PROTOCOLS = new Set([...ATTACHMENT_PROTOCOLS, \"blob:\"]);\n/** A grid shows this many images or videos; the last one tells how many more there are. */\nconst MEDIA_SHOWN = 4;\n/** A single image keeps its own aspect ratio within these bounds; beyond them it is cropped to fit. */\nconst MEDIA_RATIO_MIN = 0.5;\nconst MEDIA_RATIO_MAX = 3;\n\nexport type MessageRowAuthor = {\n /** Display name, shown at the start of a group and read before every message. */\n name: string;\n /** Picture URL. Without one, the avatar shows initials on the author's tint. */\n avatar?: string | null;\n /** Icon class shown instead of initials, for example for an automated author. */\n icon?: string;\n};\n\nexport type MessageRowStatus = \"pending\" | \"sent\" | \"failed\";\n\nexport type MessageRowAction = {\n id: string;\n /** Accessible name and tooltip. */\n label: string;\n /** Icon class, for example `ti ti-arrow-back-up`. */\n icon: string;\n onSelect: () => void;\n disabled?: boolean;\n};\n\nexport type MessageRowQuote = {\n /** Name of the quoted message's author. */\n author: string;\n /** Plain text of the quoted message. It shows at most two lines. */\n text: string;\n /** Opens the quoted message, for example by scrolling to it. Without it, the quote is not a control. */\n onSelect?: () => void;\n};\n\nexport type MessageRowReaction = {\n /** Stable identity of the reaction, passed to `onToggleReaction`. */\n key: string;\n emoji: string;\n count: number;\n /** The reader reacted this way; the chip shows pressed. */\n own?: boolean;\n /** Who reacted, for example \"Nora, Tobias\". Read by screen readers and shown as a tooltip. */\n label?: string;\n};\n\nexport type MessageRowThread = {\n /** Number of replies. */\n count: number;\n /** People who replied, most recent first; the bar shows up to three. */\n participants?: readonly MessageRowAuthor[];\n /** Visible time of the last reply, formatted by the caller. */\n lastReply?: string;\n lastReplyDateTime?: string | Date;\n onOpen: () => void;\n};\n\ntype MessageRowAttachmentTarget = {\n /** Opens the attachment, for example in a lightbox. Takes precedence over `href`. */\n onOpen?: () => void;\n /** Opens the attachment in a new tab. Absolute `https` or `http`, or relative. */\n href?: string;\n};\n\nexport type MessageRowMedia = MessageRowAttachmentTarget & {\n kind: \"image\" | \"video\";\n /** The image, or the poster frame of a video. Absolute `https` or `http`, relative, `blob`, or `data:image/`. */\n src: string;\n /** Describes the image or video for people who cannot see it. */\n alt: string;\n /** Stored pixel size. The row reserves the area from it, so nothing moves when the image loads. */\n width: number;\n height: number;\n /** Visible length of a video, for example \"0:42\". */\n duration?: string;\n};\n\nexport type MessageRowFile = MessageRowAttachmentTarget & {\n kind: \"file\";\n name: string;\n /** Second line, for example \"PDF · 412 KB\". */\n detail?: string;\n /** Media type, used with the name to choose the icon. */\n mediaType?: string;\n /** Icon class instead of the one chosen from the name. */\n icon?: string;\n};\n\nexport type MessageRowAttachment = MessageRowMedia | MessageRowFile;\n\nexport type MessageRowProgress = {\n /** What is happening, for example \"Writing\" or \"Searching the files\". */\n status: string;\n /** Called by \"Stop\". */\n onStop?: () => void;\n};\n\nexport type MessageRowProps = {\n author: MessageRowAuthor;\n /** Message text as Markdown. Raw HTML shows as text; links must be absolute and use `https`, `http`, or `mailto`. */\n text: string;\n /** Visible time, formatted by the caller, so server and browser render the same text. */\n time: string;\n /** Machine-readable time for the `<time>` element. */\n dateTime?: string | Date;\n /** The reader's own message: on the right in the accent tint, without avatar or name. */\n own?: boolean;\n /**\n * Starts a group with avatar, name, badge, and time. A continuation shows only its text; screen readers still hear\n * the author and time. Defaults to true; `startsMessageGroup` decides it from the previous message.\n */\n groupStart?: boolean;\n /** Shown next to the name at the start of a group, for example the kind of account. */\n badge?: JSX.Element;\n /** Send state. Sets a line of fixed height below the message: a clock, a check, or \"Not sent\" with \"Retry\". */\n status?: MessageRowStatus;\n /** Text shown in that line instead of the check once someone has read the message, for example \"Read by Nora\". */\n receipt?: string;\n /** Called by \"Retry\" while `status` is `\"failed\"`. */\n onRetry?: () => void;\n /** Shown as a toolbar over the message while it is hovered or focused. It never moves the layout. */\n actions?: readonly MessageRowAction[];\n /** The message this one answers, shown above it. */\n quote?: MessageRowQuote;\n /** Marks the message as forwarded from somewhere else. */\n forwarded?: boolean;\n /** Marks the message as edited after it was sent. */\n edited?: boolean;\n /** Shows \"This message was deleted\" instead of the text, quote, attachments, previews, and reactions. */\n deleted?: boolean;\n /** Images and videos in a grid with areas reserved from their stored size, then files as chips. */\n attachments?: readonly MessageRowAttachment[];\n /** A preview of a link in the text, supplied with its final height. */\n linkPreview?: JSX.Element;\n /** A card for an element the message refers to, such as a task or a document, supplied with its final height. */\n card?: JSX.Element;\n /**\n * Reactions in a bar of fixed height. The bar shows whenever this is set, even to an empty list, so chips that come\n * and go never change the row. Only setting it where it was unset adds a line, so pass it on own messages and on\n * messages that have or had reactions, and leave it out on others' messages that never had one.\n */\n reactions?: readonly MessageRowReaction[];\n /** Called with a reaction's `key` when the reader presses its chip. Without it, the chips are not controls. */\n onToggleReaction?: (key: string) => void;\n /** Called by \"Add reaction\" in the reaction bar, with the button to anchor a picker to. */\n onAddReaction?: (anchor: HTMLElement) => void;\n /** A bar of fixed height that opens the replies to this message. */\n thread?: MessageRowThread;\n /** The message is still being written, by a person or an automated author alike: a status line with \"Stop\". */\n progress?: MessageRowProgress;\n class?: string;\n};\n\nexport type MessageSystemRowProps = {\n /** What happened, for example \"Nora added Tobias\". */\n children: JSX.Element;\n /** Visible time, formatted by the caller. */\n time?: string;\n dateTime?: string | Date;\n /** Icon class shown before the text. */\n icon?: string;\n class?: string;\n};\n\nexport type MessageGroupEntry = {\n /** Stable identity of the author. */\n author: string;\n at: Date | number | string;\n /** System rows never belong to a group. */\n system?: boolean;\n};\n\nconst timestamp = (value: Date | number | string) => (value instanceof Date ? value.getTime() : new Date(value).getTime());\n\n/**\n * Whether a message starts a new group: there is no previous message, either is a system row, the author changes, or\n * more than five minutes passed. Also start a group where you show a separator such as a new day.\n */\nexport const startsMessageGroup = (entry: MessageGroupEntry, previous?: MessageGroupEntry | null): boolean => {\n if (!previous || entry.system || previous.system || entry.author !== previous.author) return true;\n const gap = timestamp(entry.at) - timestamp(previous.at);\n return !(gap >= 0 && gap <= GROUP_WINDOW_MS);\n};\n\n/** Text that wraps: every `LINE_CHARS` visible characters of a line take at least one line. */\nconst wrappedLines = (text: string): number =>\n text.split(\"\\n\").reduce((lines, line) => lines + Math.ceil(line.trim().length / LINE_CHARS), 0);\n\n/** What inline tokens show: a link its label, never its destination. */\nconst inlineText = (tokens: readonly Token[]): string => {\n let text = \"\";\n for (const token of tokens) {\n if (token.type === \"br\") text += \"\\n\";\n else if (\"tokens\" in token && token.tokens) text += inlineText(token.tokens);\n else if (\"text\" in token) text += token.text;\n }\n return text;\n};\n\n/**\n * The fewest lines the rendered tokens take at any width. Code never wraps, so each of its lines is one line, blank\n * ones too, and its bar one more. Link destinations and reference definitions show nothing. Decided from the text\n * alone, so the row has its final height when it mounts.\n */\nconst renderedLines = (tokens: readonly Token[]): number => {\n let lines = 0;\n for (const token of tokens) {\n switch (token.type) {\n case \"code\":\n lines += token.text.split(\"\\n\").length + 1;\n break;\n case \"list\":\n for (const item of token.items) lines += Math.max(1, renderedLines(item.tokens));\n break;\n case \"table\":\n lines += token.rows.length + (token.header.some((cell: Tokens.TableCell) => cell.text.trim()) ? 1 : 0);\n break;\n case \"paragraph\":\n case \"heading\":\n case \"text\":\n lines += wrappedLines(token.tokens ? inlineText(token.tokens) : token.text);\n break;\n case \"hr\":\n lines += 1;\n break;\n case \"space\":\n case \"def\":\n break;\n default:\n if (\"tokens\" in token && token.tokens) lines += renderedLines(token.tokens);\n else if (\"text\" in token) lines += wrappedLines(token.text);\n }\n }\n return lines;\n};\n\n/** Messages link only to absolute URLs; a relative one would lead somewhere else on every page that shows it. */\nconst isAbsoluteUrl = (href: string): boolean => {\n try {\n return new URL(href).protocol !== \"\";\n } catch {\n return false;\n }\n};\n\nconst dateTimeOf = (value: string | Date | undefined): string | undefined => {\n if (value === undefined) return undefined;\n const date = value instanceof Date ? value : new Date(value);\n return Number.isFinite(date.getTime()) ? date.toISOString() : undefined;\n};\n\n/**\n * An attachment URL the row may load or open: absolute with an allowed scheme, or relative to the page. A picture may\n * also be a `blob:` URL or a `data:image/` URL, which an image element shows without running anything.\n */\nconst attachmentUrl = (url: string | undefined, picture = false): string | undefined => {\n if (!url) return undefined;\n if (picture && /^data:image\\//i.test(url)) return url;\n try {\n return (picture ? PICTURE_PROTOCOLS : ATTACHMENT_PROTOCOLS).has(new URL(url, \"https://relative.invalid/\").protocol) ? url : undefined;\n } catch {\n return undefined;\n }\n};\n\n/** The aspect ratio a single image or video reserves, from its stored size. */\nconst mediaRatio = (media: MessageRowMedia): number => {\n const ratio = media.width > 0 && media.height > 0 ? media.width / media.height : 4 / 3;\n return Math.min(MEDIA_RATIO_MAX, Math.max(MEDIA_RATIO_MIN, ratio));\n};\n\n/** The width of a single image or video: its stored width, at most the row's media height tall, never wider than the row. */\nconst mediaWidth = (media: MessageRowMedia): string => {\n const natural = Number.isFinite(media.width) && media.width > 0 ? `${media.width}px, ` : \"\";\n return `min(100%, ${natural}calc(var(--k2b-message-media-height) * ${mediaRatio(media)}))`;\n};\n\n/** Only the `ti-*` glyph of `fileIcons`, which may add colour utilities that `@k2b/ui` does not ship. */\nconst fileIcon = (file: MessageRowFile): string =>\n file.icon ??\n `ti ${fileIcons\n .getFileIcon({ name: file.name, type: \"file\", mimeType: file.mediaType })\n .split(/\\s+/)\n .filter((token) => token.startsWith(\"ti-\"))\n .join(\" \")}`;\n\n/** A link, a button, or neither, depending on what the caller passes. */\nfunction AttachmentTarget(\n props: MessageRowAttachmentTarget & {\n class: string;\n style?: JSX.CSSProperties;\n /** Names a picture; without a link or button around it, the element becomes the image. */\n label?: string;\n children: JSX.Element;\n },\n): JSX.Element {\n return (\n <Show\n when={props.onOpen}\n fallback={\n <Show\n when={attachmentUrl(props.href)}\n fallback={\n <Show\n when={props.label}\n fallback={\n <span class={props.class} style={props.style}>\n {props.children}\n </span>\n }\n >\n {(label) => (\n <span class={props.class} style={props.style} role=\"img\" aria-label={label()}>\n {props.children}\n </span>\n )}\n </Show>\n }\n >\n {(href) => (\n <a class={props.class} style={props.style} href={href()} target=\"_blank\" rel=\"noopener noreferrer\" aria-label={props.label}>\n {props.children}\n </a>\n )}\n </Show>\n }\n >\n {(open) => (\n <button type=\"button\" class={props.class} style={props.style} aria-label={props.label} onClick={() => open()()}>\n {props.children}\n </button>\n )}\n </Show>\n );\n}\n\n/**\n * Renders the safe Markdown of `MarkdownView` with line breaks kept, absolute links only, and a copy control above\n * every code block, and counts the fewest lines it takes. An edited message that does not collapse ends with the marker.\n */\nconst renderMessage = (\n text: string,\n locale: string,\n messages: UiMessages,\n chatMessages: ChatMessages,\n edited: boolean,\n): { html: string; lines: number } => {\n const renderer = createSafeRenderer({ allowImages: false, linkProtocols: LINK_PROTOCOLS, linkTarget: \"_blank\", locale });\n const renderLink = renderer.link.bind(renderer);\n renderer.link = (token: Tokens.Link) => (isAbsoluteUrl(token.href) ? renderLink(token) : renderer.parser.parseInline(token.tokens));\n const renderCode = renderer.code.bind(renderer);\n renderer.code = (token: Tokens.Code) => {\n const language = token.lang?.match(/^\\S{1,24}/)?.[0];\n const block = renderCode(token).replace(/^<pre>/, '<pre tabindex=\"0\">');\n return (\n '<div class=\"k2b-message-row__code\" data-gesture-ignore><div class=\"k2b-message-row__code-bar\">' +\n `<span class=\"k2b-message-row__code-label\">${escapeHtml(language ?? messages.code)}</span>` +\n '<button type=\"button\" class=\"k2b-message-row__copy\">' +\n `<span class=\"k2b-message-row__copy-idle\"><i class=\"ti ti-copy\" aria-hidden=\"true\"></i>${escapeHtml(messages.copy)}</span>` +\n `<span class=\"k2b-message-row__copy-done\"><i class=\"ti ti-check\" aria-hidden=\"true\"></i>${escapeHtml(messages.copied)}</span>` +\n `</button></div>${block}</div>`\n );\n };\n const marked = createSafeMarked(locale).setOptions({ breaks: true, renderer });\n const tokens = marked.lexer(text);\n const html = marked.parser(tokens);\n const lines = renderedLines(tokens);\n // A collapsed message would hide the end of its text, so its marker sits next to \"Show more\" instead.\n if (!edited || lines > COLLAPSE_LINES) return { html, lines };\n // The marker ends the last paragraph, so it takes no line of its own there.\n const marker = `<span class=\"k2b-message-row__edited\">${escapeHtml(chatMessages.messageEdited)}</span>`;\n const end = html.trimEnd();\n return { html: end.endsWith(\"</p>\") ? `${end.slice(0, -4)} ${marker}</p>` : `${html}<p>${marker}</p>`, lines };\n};\n\n/**\n * One message in a conversation with many people: own messages on the right, others on the left with avatar, name,\n * and time at the start of a group. Every part has its final height when the row mounts, so a virtualized list such\n * as `VirtualFeed` keeps its positions.\n */\nexport function MessageRow(props: MessageRowProps): JSX.Element {\n const messages = useUiMessages();\n const chatMessages = useChatMessages();\n const locale = useLocale();\n const textId = `k2b-message-${createUniqueId()}`;\n const [expanded, setExpanded] = createSignal(false);\n const rendered = createMemo(() => renderMessage(props.text, locale(), messages(), chatMessages(), Boolean(props.edited)));\n const collapsible = () => rendered().lines > COLLAPSE_LINES;\n const collapsed = () => collapsible() && !expanded();\n const groupStart = () => props.groupStart ?? true;\n const hasLine = () => props.progress !== undefined || props.status !== undefined || props.receipt !== undefined;\n const reactions = () => (props.deleted ? undefined : props.reactions);\n // Chips follow their keys, so a chip keeps its element, and focus, when the caller passes new objects for it.\n const reactionKeys = createMemo(() => reactions()?.map((reaction) => reaction.key) ?? []);\n const reactionByKey = createMemo(() => new Map(reactions()?.map((reaction) => [reaction.key, reaction])));\n const hasFooter = () => hasLine() || reactions() !== undefined;\n const writing = () => props.progress !== undefined && !props.deleted && props.text.trim() === \"\";\n const hasBubble = () => props.deleted || writing() || props.text.trim() !== \"\";\n const content = () => !props.deleted;\n const media = createMemo(() =>\n content() ? (props.attachments ?? []).filter((attachment): attachment is MessageRowMedia => attachment.kind !== \"file\") : [],\n );\n const files = createMemo(() =>\n content() ? (props.attachments ?? []).filter((attachment): attachment is MessageRowFile => attachment.kind === \"file\") : [],\n );\n const shownMedia = () => media().slice(0, MEDIA_SHOWN);\n const hiddenMedia = () => media().length - shownMedia().length;\n let text: HTMLDivElement | undefined;\n let copiedTimer: ReturnType<typeof setTimeout> | undefined;\n\n onCleanup(() => clearTimeout(copiedTimer));\n\n const copyCode = (event: MouseEvent) => {\n const button = (event.target as Element | null)?.closest?.<HTMLButtonElement>(\".k2b-message-row__copy\");\n if (!button || !text?.contains(button)) return;\n const code = button.closest(\".k2b-message-row__code\")?.querySelector(\"pre\")?.textContent ?? \"\";\n copyText(code).then(\n () => {\n for (const other of text?.querySelectorAll<HTMLElement>(\".k2b-message-row__copy[data-copied]\") ?? []) delete other.dataset.copied;\n button.dataset.copied = \"\";\n announce(messages().copied);\n clearTimeout(copiedTimer);\n copiedTimer = setTimeout(() => delete button.dataset.copied, COPIED_MS);\n },\n () => {},\n );\n };\n\n // A keyboard user who reaches a link or code block in the hidden or faded part of a collapsed message gets the whole\n // message. The collapsed text clips instead of scrolling, so the browser cannot scroll it to the target instead.\n const revealFocus = (event: FocusEvent) => {\n if (!text || !collapsed() || !(event.target instanceof Element)) return;\n const fade = text.getBoundingClientRect().bottom - FADE_LINES * Number.parseFloat(getComputedStyle(text).lineHeight);\n if (event.target.getBoundingClientRect().bottom > fade) setExpanded(true);\n };\n\n const header = () => (\n <>\n <span class=\"k2b-message-row__name\">{props.author.name}</span>\n <Show when={props.badge}>\n <span class=\"k2b-message-row__badge\">{props.badge}</span>\n </Show>\n <time class=\"k2b-message-row__time\" datetime={dateTimeOf(props.dateTime)}>\n {props.time}\n </time>\n </>\n );\n\n const quote = (value: MessageRowQuote) => (\n <>\n <i class=\"ti ti-arrow-back-up\" aria-hidden=\"true\" />\n <span class=\"k2b-message-row__quote-text\">\n <span class=\"k2b-sr-only\">{chatMessages().messageReplyTo} </span>\n <span class=\"k2b-message-row__quote-author\">{value.author}</span> {value.text}\n </span>\n </>\n );\n\n /** The picture's description, then that it is a video and how long, then how many more the grid hides. */\n const mediaLabel = (item: MessageRowMedia, more: number) =>\n [\n item.alt,\n item.kind === \"video\" ? [chatMessages().messageVideo, item.duration].filter(Boolean).join(\" \") : \"\",\n more > 0 ? chatMessages().messageMoreAttachments({ count: more }) : \"\",\n ]\n .filter(Boolean)\n .join(\", \");\n\n /** A toggle button, or with no `onToggleReaction` a labelled image that also says whether the reader reacted. */\n const reactionChip = (key: string, reaction: Accessor<MessageRowReaction>) => {\n const label = (own: boolean) =>\n chatMessages().messageReaction({ emoji: reaction().emoji, count: reaction().count, names: reaction().label, own });\n return (\n <Show\n when={props.onToggleReaction}\n fallback={\n <span\n class=\"k2b-message-row__reaction\"\n role=\"img\"\n aria-label={label(Boolean(reaction().own))}\n title={reaction().label}\n data-own={reaction().own ? \"\" : undefined}\n >\n <span aria-hidden=\"true\">{reaction().emoji}</span>\n <span aria-hidden=\"true\">{reaction().count}</span>\n </span>\n }\n >\n {(toggle) => (\n <button\n type=\"button\"\n class=\"k2b-message-row__reaction\"\n aria-pressed={reaction().own ? \"true\" : \"false\"}\n aria-label={label(false)}\n title={reaction().label}\n data-own={reaction().own ? \"\" : undefined}\n onClick={() => toggle()(key)}\n >\n <span aria-hidden=\"true\">{reaction().emoji}</span>\n <span aria-hidden=\"true\">{reaction().count}</span>\n </button>\n )}\n </Show>\n );\n };\n\n const mediaItem = (item: MessageRowMedia, index: () => number) => {\n const more = () => (index() === shownMedia().length - 1 ? hiddenMedia() : 0);\n return (\n <AttachmentTarget\n class=\"k2b-message-row__media-item\"\n style={media().length === 1 ? { \"aspect-ratio\": String(mediaRatio(item)) } : undefined}\n label={mediaLabel(item, more())}\n onOpen={item.onOpen}\n href={item.href}\n >\n <img\n src={attachmentUrl(item.src, true)}\n alt=\"\"\n width={item.width > 0 ? item.width : undefined}\n height={item.height > 0 ? item.height : undefined}\n loading=\"lazy\"\n decoding=\"async\"\n />\n <Show when={item.kind === \"video\"}>\n <span class=\"k2b-message-row__media-play\" aria-hidden=\"true\">\n <i class=\"ti ti-player-play\" />\n </span>\n <Show when={item.duration}>\n <span class=\"k2b-message-row__media-duration\" aria-hidden=\"true\">\n {item.duration}\n </span>\n </Show>\n </Show>\n <Show when={more() > 0}>\n <span class=\"k2b-message-row__media-more\" aria-hidden=\"true\">\n +{more()}\n </span>\n </Show>\n </AttachmentTarget>\n );\n };\n\n return (\n <div\n class={props.class ? `k2b-message-row ${props.class}` : \"k2b-message-row\"}\n data-own={props.own ? \"\" : undefined}\n data-group-start={groupStart() ? \"\" : undefined}\n data-status={props.status}\n data-media={media().length > 0 ? \"\" : undefined}\n >\n <Show when={!props.own}>\n <div class=\"k2b-message-row__gutter\">\n <Show when={groupStart()}>\n <span class=\"k2b-message-row__avatar\" aria-hidden=\"true\">\n <Avatar name={props.author.name} src={props.author.avatar} icon={props.author.icon} size=\"sm\" />\n </span>\n </Show>\n </div>\n </Show>\n <div class=\"k2b-message-row__body\">\n <Show\n when={groupStart()}\n fallback={\n <span class=\"k2b-sr-only\">\n {props.author.name}, {props.time}:{\" \"}\n </span>\n }\n >\n <Show\n when={!props.own}\n fallback={\n <div class=\"k2b-message-row__meta\">\n <span class=\"k2b-sr-only\">{props.author.name}, </span>\n <time class=\"k2b-message-row__time\" datetime={dateTimeOf(props.dateTime)}>\n {props.time}\n </time>\n </div>\n }\n >\n <div class=\"k2b-message-row__meta\">{header()}</div>\n </Show>\n </Show>\n <Show when={content() && props.forwarded}>\n <div class=\"k2b-message-row__marker\">\n <i class=\"ti ti-arrow-forward-up\" aria-hidden=\"true\" />\n <span>{chatMessages().messageForwarded}</span>\n </div>\n </Show>\n <Show when={content() && props.quote}>\n {(value) => (\n <Show when={value().onSelect} fallback={<div class=\"k2b-message-row__quote\">{quote(value())}</div>}>\n {(select) => (\n <button type=\"button\" class=\"k2b-message-row__quote\" onClick={() => select()()}>\n {quote(value())}\n </button>\n )}\n </Show>\n )}\n </Show>\n <Show when={hasBubble()}>\n <div\n class=\"k2b-message-row__bubble\"\n data-deleted={props.deleted ? \"\" : undefined}\n aria-busy={props.progress && !props.deleted ? \"true\" : undefined}\n >\n <Show\n when={!props.deleted}\n fallback={\n <span class=\"k2b-message-row__deleted\">\n <i class=\"ti ti-message-off\" aria-hidden=\"true\" />\n {chatMessages().messageDeleted}\n </span>\n }\n >\n <Show\n when={!writing()}\n fallback={\n <span class=\"k2b-message-row__writing\">\n <span class=\"k2b-chat-progress-dots\" aria-hidden=\"true\">\n <span />\n <span />\n <span />\n </span>\n </span>\n }\n >\n {/* biome-ignore lint/a11y/noStaticElementInteractions lint/a11y/useKeyWithClickEvents: the native copy buttons inside the rendered Markdown are the targets; their clicks, including from the keyboard, bubble here. */}\n <div\n ref={text}\n id={textId}\n class=\"k2b-content-markdown k2b-message-row__text\"\n data-heading-scale=\"compact\"\n data-collapsed={collapsed() ? \"\" : undefined}\n onClick={copyCode}\n onFocusIn={revealFocus}\n innerHTML={rendered().html}\n />\n <Show when={collapsible()}>\n <div class=\"k2b-message-row__more-line\">\n <Button\n variant=\"text\"\n size=\"xs\"\n class=\"k2b-message-row__more\"\n aria-expanded={expanded() ? \"true\" : \"false\"}\n aria-controls={textId}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? chatMessages().messageShowLess : chatMessages().messageShowMore}\n </Button>\n <Show when={props.edited}>\n <span class=\"k2b-message-row__edited\">{chatMessages().messageEdited}</span>\n </Show>\n </div>\n </Show>\n </Show>\n </Show>\n </div>\n </Show>\n {/* Without a bubble to end, the edit marker takes the bubble's place. */}\n <Show when={content() && props.edited && !hasBubble()}>\n <div class=\"k2b-message-row__marker\">\n <i class=\"ti ti-pencil\" aria-hidden=\"true\" />\n <span class=\"k2b-message-row__edited\">{chatMessages().messageEdited}</span>\n </div>\n </Show>\n <Show when={media().length > 0}>\n <div\n class=\"k2b-message-row__media\"\n role=\"group\"\n aria-label={chatMessages().attachments}\n data-count={Math.min(media().length, MEDIA_SHOWN)}\n style={media().length === 1 ? { width: mediaWidth(media()[0]!) } : undefined}\n >\n <For each={shownMedia()}>{(item, index) => mediaItem(item, index)}</For>\n </div>\n </Show>\n <Show when={files().length > 0}>\n <div class=\"k2b-message-row__files\">\n <For each={files()}>\n {(file) => (\n <AttachmentTarget class=\"k2b-message-row__file\" onOpen={file.onOpen} href={file.href}>\n <span class=\"k2b-message-row__file-icon\" aria-hidden=\"true\">\n <i class={fileIcon(file)} />\n </span>\n <span class=\"k2b-message-row__file-copy\">\n <span class=\"k2b-message-row__file-name\">{file.name}</span>\n <Show when={file.detail}>\n <span class=\"k2b-message-row__file-detail\">{file.detail}</span>\n </Show>\n </span>\n </AttachmentTarget>\n )}\n </For>\n </div>\n </Show>\n <Show when={content() && props.linkPreview}>\n <div class=\"k2b-message-row__slot\" data-gesture-ignore>\n {props.linkPreview}\n </div>\n </Show>\n <Show when={content() && props.card}>\n <div class=\"k2b-message-row__slot\" data-gesture-ignore>\n {props.card}\n </div>\n </Show>\n <Show when={props.thread}>\n {(thread) => (\n <button type=\"button\" class=\"k2b-message-row__thread\" onClick={() => thread().onOpen()}>\n <Show when={(thread().participants?.length ?? 0) > 0}>\n <span class=\"k2b-message-row__thread-people\" aria-hidden=\"true\">\n <For each={thread().participants?.slice(0, 3)}>\n {(person) => <Avatar name={person.name} src={person.avatar} icon={person.icon} size=\"xs\" />}\n </For>\n </span>\n </Show>\n <span class=\"k2b-message-row__thread-count\">{chatMessages().messageReplies({ count: thread().count })}</span>\n <Show when={thread().lastReply}>\n {(time) => (\n <time class=\"k2b-message-row__thread-time\" datetime={dateTimeOf(thread().lastReplyDateTime)}>\n {chatMessages().messageLastReply({ time: time() })}\n </time>\n )}\n </Show>\n </button>\n )}\n </Show>\n <Show when={hasFooter()}>\n <div class=\"k2b-message-row__footer\">\n <Show when={reactions()}>\n {(list) => (\n <div\n class=\"k2b-message-row__reactions\"\n role=\"group\"\n aria-label={chatMessages().messageReactions}\n data-empty={list().length === 0 ? \"\" : undefined}\n >\n <Show when={list().length > 0}>\n {/* Chips that do not fit scroll sideways behind a fade. Read-only chips are no tab stops, so the list\n is one: a keyboard can scroll it. */}\n <ScrollArea\n orientation=\"horizontal\"\n class=\"k2b-message-row__reaction-list\"\n tabindex={props.onToggleReaction ? undefined : 0}\n >\n <For each={reactionKeys()}>\n {(key) => <Show when={reactionByKey().get(key)}>{(reaction) => reactionChip(key, reaction)}</Show>}\n </For>\n </ScrollArea>\n </Show>\n <Show when={props.onAddReaction}>\n {(add) => (\n <IconButton\n label={chatMessages().messageAddReaction}\n size=\"xs\"\n class=\"k2b-message-row__react\"\n onClick={(event) => add()(event.currentTarget)}\n >\n <i class=\"ti ti-mood-plus\" aria-hidden=\"true\" />\n </IconButton>\n )}\n </Show>\n </div>\n )}\n </Show>\n <Show when={hasLine()}>\n <div class=\"k2b-message-row__line\">\n <Show\n when={props.progress}\n fallback={\n <>\n <Show when={props.status === \"pending\"}>\n <i class=\"ti ti-clock\" aria-hidden=\"true\" />\n <span>{chatMessages().sending}</span>\n </Show>\n <Show when={props.status === \"failed\"}>\n <i class=\"ti ti-alert-circle\" aria-hidden=\"true\" />\n <span>{chatMessages().messageNotSent}</span>\n <Show when={props.onRetry}>\n {(retry) => (\n <Button variant=\"text\" size=\"xs\" onClick={() => retry()()}>\n {chatMessages().messageRetry}\n </Button>\n )}\n </Show>\n </Show>\n <Show when={props.status !== \"pending\" && props.status !== \"failed\"}>\n <Show\n when={props.receipt}\n fallback={\n <Show when={props.status === \"sent\"}>\n <i class=\"ti ti-check\" aria-hidden=\"true\" />\n <span class=\"k2b-sr-only\">{chatMessages().messageSent}</span>\n </Show>\n }\n >\n {(receipt) => (\n <>\n <i class=\"ti ti-checks\" aria-hidden=\"true\" />\n <span class=\"k2b-message-row__receipt\">{receipt()}</span>\n </>\n )}\n </Show>\n </Show>\n </>\n }\n >\n {(progress) => (\n <>\n <i class=\"ti ti-loader-2 k2b-spin\" aria-hidden=\"true\" />\n <span class=\"k2b-message-row__line-text\">{progress().status}</span>\n <Show when={progress().onStop}>\n {(stop) => (\n <Button variant=\"text\" size=\"xs\" onClick={() => stop()()}>\n {chatMessages().messageStop}\n </Button>\n )}\n </Show>\n </>\n )}\n </Show>\n </div>\n </Show>\n </div>\n </Show>\n </div>\n <Show when={(props.actions?.length ?? 0) > 0}>\n <div class=\"k2b-message-row__actions\" role=\"group\" aria-label={chatMessages().messageActions}>\n <For each={props.actions}>\n {(action) => (\n <IconButton label={action.label} size=\"sm\" disabled={action.disabled} onClick={() => action.onSelect()}>\n <i class={action.icon} aria-hidden=\"true\" />\n </IconButton>\n )}\n </For>\n </div>\n </Show>\n </div>\n );\n}\n\n/** A quiet, centered line for something that happened in the conversation, such as a person joining. */\nexport function MessageSystemRow(props: MessageSystemRowProps): JSX.Element {\n return (\n <div class={props.class ? `k2b-message-system-row ${props.class}` : \"k2b-message-system-row\"}>\n <Show when={props.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>\n <span>{props.children}</span>\n <Show when={props.time}>\n <time datetime={dateTimeOf(props.dateTime)}>{props.time}</time>\n </Show>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS,QAAQ,aAAa;AAEvC,SAAwB,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,EAAY,SAAS,EAAE,IAAI,QAAQ,UAAU;AAClH,SAAS,MAAM,EAAE,UAAU,QAAQ,mBAAmB;AACtD,SAAS,QAAQ,QAAQ,uBAAuB;AAChD,SAA4B,eAAe,QAAQ,uBAAuB;AAC1E,SAAS,QAAQ,QAAQ,sBAAsB;AAC/C,SAAS,SAAS,QAAQ,gBAAgB;AAC1C,SAA0B,aAAa,QAAQ,kBAAkB;AACjE,SAAS,UAAU,QAAQ,sBAAsB;AACjD,SAAS,MAAM,QAAQ,oBAAoB;AAC3C,SAAS,gBAAgB,EAAE,kBAAkB,EAAE,UAAU,QAAQ,gBAAgB;;AAEjF;AACA,MAAM,eAAe,GAAG,CAAC,GAAG,MAAM;AAClC;AACA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAG,EAAE;AACzB;AACA,MAAM,UAAU,GAAG,GAAG;AACtB;AACA,MAAM,UAAU,GAAG,CAAC;AACpB,MAAM,SAAS,GAAG,KAAK;AACvB;AACA,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAU;AAC9D;AACA,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,CAAC,QA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C,KAA4B,EAAe;EAC1E,+CACc,KAAK,CAAC,KAAK,GAAG,mCAA0B,KAAK,CAAC,KAAK,SAAE,GAAG,wBAAwB,qCACzF,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,KAAK,CAAC,IAAI;IAAA;IAAA,UAAI,IAAI,qDAAe,IAAI,CAAC,CAAC;EAAuB,cACnE,KAAK,CAAC,QAAQ,8BACpB,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,KAAK,CAAC,IAAI;IAAA;IAAA;MAAA,2DACJ,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,0BAAG,KAAK,CAAC,IAAI;IAAA;EAAA;AAI/D","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["content/MessageRow.tsx"],"sourcesContent":["import { fileIcons } from \"@k2b/stdlib\";\nimport type { Token, Tokens } from \"marked\";\nimport { createMemo, createSignal, createUniqueId, For, type JSX, onCleanup, Show } from \"solid-js\";\nimport { Button, IconButton } from \"../actions/Button\";\nimport { copyText } from \"../actions/CopyButton\";\nimport { type ChatMessages, useChatMessages } from \"../chat/chat-messages\";\nimport { announce } from \"../feedback/announce\";\nimport { useLocale } from \"../intl/locale\";\nimport { type UiMessages, useUiMessages } from \"../intl/messages\";\nimport { Avatar } from \"../surfaces/Avatar\";\nimport { createSafeMarked, createSafeRenderer, escapeHtml } from \"./MarkdownView\";\nimport { ReactionBar, type ReactionBarItem } from \"./ReactionBar\";\n\n/** Messages by the same author within this time continue a group. */\nconst GROUP_WINDOW_MS = 5 * 60_000;\n/**\n * A message collapses to ten lines (`.k2b-message-row__text[data-collapsed]`) when its rendered text takes more lines\n * than this. `renderedLines` counts the fewest lines the text takes at any width, so a collapsed message always hides\n * some of it.\n */\nconst COLLAPSE_LINES = 14;\n/** Visible characters that take at least one line of a message, even at its widest. */\nconst LINE_CHARS = 100;\n/** Lines at the bottom of a collapsed message that fade out, as `.k2b-message-row__text[data-collapsed]` draws them. */\nconst FADE_LINES = 2;\nconst COPIED_MS = 2_000;\n/** Links in messages may only use these schemes; other links show as their text. */\nconst LINK_PROTOCOLS = [\"https:\", \"http:\", \"mailto:\"] as const;\n/** Attachments open and load only from these schemes or from a relative URL. */\nconst ATTACHMENT_PROTOCOLS = new Set([\"https:\", \"http:\"]);\n/**\n * A picture may also show a file that is still uploading. A `blob:` URL runs in the page's origin when it is opened,\n * so links never use one.\n */\nconst PICTURE_PROTOCOLS = new Set([...ATTACHMENT_PROTOCOLS, \"blob:\"]);\n/** A grid shows this many images or videos; the last one tells how many more there are. */\nconst MEDIA_SHOWN = 4;\n/** A single image keeps its own aspect ratio within these bounds; beyond them it is cropped to fit. */\nconst MEDIA_RATIO_MIN = 0.5;\nconst MEDIA_RATIO_MAX = 3;\n\nexport type MessageRowAuthor = {\n /** Display name, shown at the start of a group and read before every message. */\n name: string;\n /** Picture URL. Without one, the avatar shows initials on the author's tint. */\n avatar?: string | null;\n /** Icon class shown instead of initials, for example for an automated author. */\n icon?: string;\n};\n\nexport type MessageRowStatus = \"pending\" | \"sent\" | \"failed\";\n\nexport type MessageRowAction = {\n id: string;\n /** Accessible name and tooltip. */\n label: string;\n /** Icon class, for example `ti ti-arrow-back-up`. */\n icon: string;\n onSelect: () => void;\n disabled?: boolean;\n};\n\nexport type MessageRowQuote = {\n /** Name of the quoted message's author. */\n author: string;\n /** Plain text of the quoted message. It shows at most two lines. */\n text: string;\n /** Opens the quoted message, for example by scrolling to it. Without it, the quote is not a control. */\n onSelect?: () => void;\n};\n\n/** Reaction labels are read by screen readers and shown in the names hint. */\nexport type MessageRowReaction = ReactionBarItem;\n\nexport type MessageRowThread = {\n /** Number of replies. */\n count: number;\n /** People who replied, most recent first; the bar shows up to three. */\n participants?: readonly MessageRowAuthor[];\n /** Visible time of the last reply, formatted by the caller. */\n lastReply?: string;\n lastReplyDateTime?: string | Date;\n onOpen: () => void;\n};\n\ntype MessageRowAttachmentTarget = {\n /** Opens the attachment, for example in a lightbox. Takes precedence over `href`. */\n onOpen?: () => void;\n /** Opens the attachment in a new tab. Absolute `https` or `http`, or relative. */\n href?: string;\n};\n\nexport type MessageRowMedia = MessageRowAttachmentTarget & {\n kind: \"image\" | \"video\";\n /** The image, or the poster frame of a video. Absolute `https` or `http`, relative, `blob`, or `data:image/`. */\n src: string;\n /** Describes the image or video for people who cannot see it. */\n alt: string;\n /** Stored pixel size. The row reserves the area from it, so nothing moves when the image loads. */\n width: number;\n height: number;\n /** Visible length of a video, for example \"0:42\". */\n duration?: string;\n};\n\nexport type MessageRowFile = MessageRowAttachmentTarget & {\n kind: \"file\";\n name: string;\n /** Second line, for example \"PDF · 412 KB\". */\n detail?: string;\n /** Media type, used with the name to choose the icon. */\n mediaType?: string;\n /** Icon class instead of the one chosen from the name. */\n icon?: string;\n};\n\nexport type MessageRowAttachment = MessageRowMedia | MessageRowFile;\n\nexport type MessageRowProgress = {\n /** What is happening, for example \"Writing\" or \"Searching the files\". */\n status: string;\n /** Called by \"Stop\". */\n onStop?: () => void;\n};\n\nexport type MessageRowProps = {\n author: MessageRowAuthor;\n /** Message text as Markdown. Raw HTML shows as text; links must be absolute and use `https`, `http`, or `mailto`. */\n text: string;\n /** Visible time, formatted by the caller, so server and browser render the same text. */\n time: string;\n /** Machine-readable time for the `<time>` element. */\n dateTime?: string | Date;\n /** The reader's own message: on the right in the accent tint, without avatar or name. */\n own?: boolean;\n /**\n * Starts a group with avatar, name, badge, and time. A continuation shows only its text; screen readers still hear\n * the author and time. Defaults to true; `startsMessageGroup` decides it from the previous message.\n */\n groupStart?: boolean;\n /** Shown next to the name at the start of a group, for example the kind of account. */\n badge?: JSX.Element;\n /** Send state. Sets a line of fixed height below the message: a clock, a check, or \"Not sent\" with \"Retry\". */\n status?: MessageRowStatus;\n /** Text shown in that line instead of the check once someone has read the message, for example \"Read by Nora\". */\n receipt?: string;\n /** Called by \"Retry\" while `status` is `\"failed\"`. */\n onRetry?: () => void;\n /** Shown as a toolbar over the message while it is hovered or focused. It never moves the layout. */\n actions?: readonly MessageRowAction[];\n /** The message this one answers, shown above it. */\n quote?: MessageRowQuote;\n /** Marks the message as forwarded from somewhere else. */\n forwarded?: boolean;\n /** Marks the message as edited after it was sent. */\n edited?: boolean;\n /** Shows \"This message was deleted\" instead of the text, quote, attachments, previews, and reactions. */\n deleted?: boolean;\n /** Images and videos in a grid with areas reserved from their stored size, then files as chips. */\n attachments?: readonly MessageRowAttachment[];\n /** A preview of a link in the text, supplied with its final height. */\n linkPreview?: JSX.Element;\n /** A card for an element the message refers to, such as a task or a document, supplied with its final height. */\n card?: JSX.Element;\n /**\n * Reactions in a bar of fixed height. The bar shows whenever this is set, even to an empty list, so chips that come\n * and go never change the row. Only setting it where it was unset adds a line, so pass it on own messages and on\n * messages that have or had reactions, and leave it out on others' messages that never had one.\n */\n reactions?: readonly MessageRowReaction[];\n /** Called with a reaction's `key` when the reader presses its chip. Without it, the chips are not controls. */\n onToggleReaction?: (key: string) => void;\n /** Called by \"Add reaction\" in the reaction bar, with the button to anchor a picker to. */\n onAddReaction?: (anchor: HTMLElement) => void;\n /** A bar of fixed height that opens the replies to this message. */\n thread?: MessageRowThread;\n /** The message is still being written, by a person or an automated author alike: a status line with \"Stop\". */\n progress?: MessageRowProgress;\n class?: string;\n};\n\nexport type MessageSystemRowProps = {\n /** What happened, for example \"Nora added Tobias\". */\n children: JSX.Element;\n /** Visible time, formatted by the caller. */\n time?: string;\n dateTime?: string | Date;\n /** Icon class shown before the text. */\n icon?: string;\n class?: string;\n};\n\nexport type MessageGroupEntry = {\n /** Stable identity of the author. */\n author: string;\n at: Date | number | string;\n /** System rows never belong to a group. */\n system?: boolean;\n};\n\nconst timestamp = (value: Date | number | string) => (value instanceof Date ? value.getTime() : new Date(value).getTime());\n\n/**\n * Whether a message starts a new group: there is no previous message, either is a system row, the author changes, or\n * more than five minutes passed. Also start a group where you show a separator such as a new day.\n */\nexport const startsMessageGroup = (entry: MessageGroupEntry, previous?: MessageGroupEntry | null): boolean => {\n if (!previous || entry.system || previous.system || entry.author !== previous.author) return true;\n const gap = timestamp(entry.at) - timestamp(previous.at);\n return !(gap >= 0 && gap <= GROUP_WINDOW_MS);\n};\n\n/** Text that wraps: every `LINE_CHARS` visible characters of a line take at least one line. */\nconst wrappedLines = (text: string): number =>\n text.split(\"\\n\").reduce((lines, line) => lines + Math.ceil(line.trim().length / LINE_CHARS), 0);\n\n/** What inline tokens show: a link its label, never its destination. */\nconst inlineText = (tokens: readonly Token[]): string => {\n let text = \"\";\n for (const token of tokens) {\n if (token.type === \"br\") text += \"\\n\";\n else if (\"tokens\" in token && token.tokens) text += inlineText(token.tokens);\n else if (\"text\" in token) text += token.text;\n }\n return text;\n};\n\n/**\n * The fewest lines the rendered tokens take at any width. Code never wraps, so each of its lines is one line, blank\n * ones too, and its bar one more. Link destinations and reference definitions show nothing. Decided from the text\n * alone, so the row has its final height when it mounts.\n */\nconst renderedLines = (tokens: readonly Token[]): number => {\n let lines = 0;\n for (const token of tokens) {\n switch (token.type) {\n case \"code\":\n lines += token.text.split(\"\\n\").length + 1;\n break;\n case \"list\":\n for (const item of token.items) lines += Math.max(1, renderedLines(item.tokens));\n break;\n case \"table\":\n lines += token.rows.length + (token.header.some((cell: Tokens.TableCell) => cell.text.trim()) ? 1 : 0);\n break;\n case \"paragraph\":\n case \"heading\":\n case \"text\":\n lines += wrappedLines(token.tokens ? inlineText(token.tokens) : token.text);\n break;\n case \"hr\":\n lines += 1;\n break;\n case \"space\":\n case \"def\":\n break;\n default:\n if (\"tokens\" in token && token.tokens) lines += renderedLines(token.tokens);\n else if (\"text\" in token) lines += wrappedLines(token.text);\n }\n }\n return lines;\n};\n\n/** Messages link only to absolute URLs; a relative one would lead somewhere else on every page that shows it. */\nconst isAbsoluteUrl = (href: string): boolean => {\n try {\n return new URL(href).protocol !== \"\";\n } catch {\n return false;\n }\n};\n\nconst dateTimeOf = (value: string | Date | undefined): string | undefined => {\n if (value === undefined) return undefined;\n const date = value instanceof Date ? value : new Date(value);\n return Number.isFinite(date.getTime()) ? date.toISOString() : undefined;\n};\n\n/**\n * An attachment URL the row may load or open: absolute with an allowed scheme, or relative to the page. A picture may\n * also be a `blob:` URL or a `data:image/` URL, which an image element shows without running anything.\n */\nconst attachmentUrl = (url: string | undefined, picture = false): string | undefined => {\n if (!url) return undefined;\n if (picture && /^data:image\\//i.test(url)) return url;\n try {\n return (picture ? PICTURE_PROTOCOLS : ATTACHMENT_PROTOCOLS).has(new URL(url, \"https://relative.invalid/\").protocol) ? url : undefined;\n } catch {\n return undefined;\n }\n};\n\n/** The aspect ratio a single image or video reserves, from its stored size. */\nconst mediaRatio = (media: MessageRowMedia): number => {\n const ratio = media.width > 0 && media.height > 0 ? media.width / media.height : 4 / 3;\n return Math.min(MEDIA_RATIO_MAX, Math.max(MEDIA_RATIO_MIN, ratio));\n};\n\n/** The width of a single image or video: its stored width, at most the row's media height tall, never wider than the row. */\nconst mediaWidth = (media: MessageRowMedia): string => {\n const natural = Number.isFinite(media.width) && media.width > 0 ? `${media.width}px, ` : \"\";\n return `min(100%, ${natural}calc(var(--k2b-message-media-height) * ${mediaRatio(media)}))`;\n};\n\n/** Only the `ti-*` glyph of `fileIcons`, which may add colour utilities that `@k2b/ui` does not ship. */\nconst fileIcon = (file: MessageRowFile): string =>\n file.icon ??\n `ti ${fileIcons\n .getFileIcon({ name: file.name, type: \"file\", mimeType: file.mediaType })\n .split(/\\s+/)\n .filter((token) => token.startsWith(\"ti-\"))\n .join(\" \")}`;\n\n/** A link, a button, or neither, depending on what the caller passes. */\nfunction AttachmentTarget(\n props: MessageRowAttachmentTarget & {\n class: string;\n style?: JSX.CSSProperties;\n /** Names a picture; without a link or button around it, the element becomes the image. */\n label?: string;\n children: JSX.Element;\n },\n): JSX.Element {\n return (\n <Show\n when={props.onOpen}\n fallback={\n <Show\n when={attachmentUrl(props.href)}\n fallback={\n <Show\n when={props.label}\n fallback={\n <span class={props.class} style={props.style}>\n {props.children}\n </span>\n }\n >\n {(label) => (\n <span class={props.class} style={props.style} role=\"img\" aria-label={label()}>\n {props.children}\n </span>\n )}\n </Show>\n }\n >\n {(href) => (\n <a class={props.class} style={props.style} href={href()} target=\"_blank\" rel=\"noopener noreferrer\" aria-label={props.label}>\n {props.children}\n </a>\n )}\n </Show>\n }\n >\n {(open) => (\n <button type=\"button\" class={props.class} style={props.style} aria-label={props.label} onClick={() => open()()}>\n {props.children}\n </button>\n )}\n </Show>\n );\n}\n\n/**\n * Renders the safe Markdown of `MarkdownView` with line breaks kept, absolute links only, and a copy control above\n * every code block, and counts the fewest lines it takes. An edited message that does not collapse ends with the marker.\n */\nconst renderMessage = (\n text: string,\n locale: string,\n messages: UiMessages,\n chatMessages: ChatMessages,\n edited: boolean,\n): { html: string; lines: number } => {\n const renderer = createSafeRenderer({ allowImages: false, linkProtocols: LINK_PROTOCOLS, linkTarget: \"_blank\", locale });\n const renderLink = renderer.link.bind(renderer);\n renderer.link = (token: Tokens.Link) => (isAbsoluteUrl(token.href) ? renderLink(token) : renderer.parser.parseInline(token.tokens));\n const renderCode = renderer.code.bind(renderer);\n renderer.code = (token: Tokens.Code) => {\n const language = token.lang?.match(/^\\S{1,24}/)?.[0];\n const block = renderCode(token).replace(/^<pre>/, '<pre tabindex=\"0\">');\n return (\n '<div class=\"k2b-message-row__code\" data-gesture-ignore><div class=\"k2b-message-row__code-bar\">' +\n `<span class=\"k2b-message-row__code-label\">${escapeHtml(language ?? messages.code)}</span>` +\n '<button type=\"button\" class=\"k2b-message-row__copy\">' +\n `<span class=\"k2b-message-row__copy-idle\"><i class=\"ti ti-copy\" aria-hidden=\"true\"></i>${escapeHtml(messages.copy)}</span>` +\n `<span class=\"k2b-message-row__copy-done\"><i class=\"ti ti-check\" aria-hidden=\"true\"></i>${escapeHtml(messages.copied)}</span>` +\n `</button></div>${block}</div>`\n );\n };\n const marked = createSafeMarked(locale).setOptions({ breaks: true, renderer });\n const tokens = marked.lexer(text);\n const html = marked.parser(tokens);\n const lines = renderedLines(tokens);\n // A collapsed message would hide the end of its text, so its marker sits next to \"Show more\" instead.\n if (!edited || lines > COLLAPSE_LINES) return { html, lines };\n // The marker ends the last paragraph, so it takes no line of its own there.\n const marker = `<span class=\"k2b-message-row__edited\">${escapeHtml(chatMessages.messageEdited)}</span>`;\n const end = html.trimEnd();\n return { html: end.endsWith(\"</p>\") ? `${end.slice(0, -4)} ${marker}</p>` : `${html}<p>${marker}</p>`, lines };\n};\n\n/**\n * One message in a conversation with many people: own messages on the right, others on the left with avatar, name,\n * and time at the start of a group. Every part has its final height when the row mounts, so a virtualized list such\n * as `VirtualFeed` keeps its positions.\n */\nexport function MessageRow(props: MessageRowProps): JSX.Element {\n const messages = useUiMessages();\n const chatMessages = useChatMessages();\n const locale = useLocale();\n const textId = `k2b-message-${createUniqueId()}`;\n const [expanded, setExpanded] = createSignal(false);\n const rendered = createMemo(() => renderMessage(props.text, locale(), messages(), chatMessages(), Boolean(props.edited)));\n const collapsible = () => rendered().lines > COLLAPSE_LINES;\n const collapsed = () => collapsible() && !expanded();\n const groupStart = () => props.groupStart ?? true;\n const hasLine = () => props.progress !== undefined || props.status !== undefined || props.receipt !== undefined;\n const reactions = () => (props.deleted ? undefined : props.reactions);\n const hasFooter = () => hasLine() || reactions() !== undefined;\n const writing = () => props.progress !== undefined && !props.deleted && props.text.trim() === \"\";\n const hasBubble = () => props.deleted || writing() || props.text.trim() !== \"\";\n const content = () => !props.deleted;\n const media = createMemo(() =>\n content() ? (props.attachments ?? []).filter((attachment): attachment is MessageRowMedia => attachment.kind !== \"file\") : [],\n );\n const files = createMemo(() =>\n content() ? (props.attachments ?? []).filter((attachment): attachment is MessageRowFile => attachment.kind === \"file\") : [],\n );\n const shownMedia = () => media().slice(0, MEDIA_SHOWN);\n const hiddenMedia = () => media().length - shownMedia().length;\n let text: HTMLDivElement | undefined;\n let copiedTimer: ReturnType<typeof setTimeout> | undefined;\n\n onCleanup(() => clearTimeout(copiedTimer));\n\n const copyCode = (event: MouseEvent) => {\n const button = (event.target as Element | null)?.closest?.<HTMLButtonElement>(\".k2b-message-row__copy\");\n if (!button || !text?.contains(button)) return;\n const code = button.closest(\".k2b-message-row__code\")?.querySelector(\"pre\")?.textContent ?? \"\";\n copyText(code).then(\n () => {\n for (const other of text?.querySelectorAll<HTMLElement>(\".k2b-message-row__copy[data-copied]\") ?? []) delete other.dataset.copied;\n button.dataset.copied = \"\";\n announce(messages().copied);\n clearTimeout(copiedTimer);\n copiedTimer = setTimeout(() => delete button.dataset.copied, COPIED_MS);\n },\n () => {},\n );\n };\n\n // A keyboard user who reaches a link or code block in the hidden or faded part of a collapsed message gets the whole\n // message. The collapsed text clips instead of scrolling, so the browser cannot scroll it to the target instead.\n const revealFocus = (event: FocusEvent) => {\n if (!text || !collapsed() || !(event.target instanceof Element)) return;\n const fade = text.getBoundingClientRect().bottom - FADE_LINES * Number.parseFloat(getComputedStyle(text).lineHeight);\n if (event.target.getBoundingClientRect().bottom > fade) setExpanded(true);\n };\n\n const header = () => (\n <>\n <span class=\"k2b-message-row__name\">{props.author.name}</span>\n <Show when={props.badge}>\n <span class=\"k2b-message-row__badge\">{props.badge}</span>\n </Show>\n <time class=\"k2b-message-row__time\" datetime={dateTimeOf(props.dateTime)}>\n {props.time}\n </time>\n </>\n );\n\n const quote = (value: MessageRowQuote) => (\n <>\n <i class=\"ti ti-arrow-back-up\" aria-hidden=\"true\" />\n <span class=\"k2b-message-row__quote-text\">\n <span class=\"k2b-sr-only\">{chatMessages().messageReplyTo} </span>\n <span class=\"k2b-message-row__quote-author\">{value.author}</span> {value.text}\n </span>\n </>\n );\n\n /** The picture's description, then that it is a video and how long, then how many more the grid hides. */\n const mediaLabel = (item: MessageRowMedia, more: number) =>\n [\n item.alt,\n item.kind === \"video\" ? [chatMessages().messageVideo, item.duration].filter(Boolean).join(\" \") : \"\",\n more > 0 ? chatMessages().messageMoreAttachments({ count: more }) : \"\",\n ]\n .filter(Boolean)\n .join(\", \");\n\n const mediaItem = (item: MessageRowMedia, index: () => number) => {\n const more = () => (index() === shownMedia().length - 1 ? hiddenMedia() : 0);\n return (\n <AttachmentTarget\n class=\"k2b-message-row__media-item\"\n style={media().length === 1 ? { \"aspect-ratio\": String(mediaRatio(item)) } : undefined}\n label={mediaLabel(item, more())}\n onOpen={item.onOpen}\n href={item.href}\n >\n <img\n src={attachmentUrl(item.src, true)}\n alt=\"\"\n width={item.width > 0 ? item.width : undefined}\n height={item.height > 0 ? item.height : undefined}\n loading=\"lazy\"\n decoding=\"async\"\n />\n <Show when={item.kind === \"video\"}>\n <span class=\"k2b-message-row__media-play\" aria-hidden=\"true\">\n <i class=\"ti ti-player-play\" />\n </span>\n <Show when={item.duration}>\n <span class=\"k2b-message-row__media-duration\" aria-hidden=\"true\">\n {item.duration}\n </span>\n </Show>\n </Show>\n <Show when={more() > 0}>\n <span class=\"k2b-message-row__media-more\" aria-hidden=\"true\">\n +{more()}\n </span>\n </Show>\n </AttachmentTarget>\n );\n };\n\n return (\n <div\n class={props.class ? `k2b-message-row ${props.class}` : \"k2b-message-row\"}\n data-own={props.own ? \"\" : undefined}\n data-group-start={groupStart() ? \"\" : undefined}\n data-status={props.status}\n data-media={media().length > 0 ? \"\" : undefined}\n >\n <Show when={!props.own}>\n <div class=\"k2b-message-row__gutter\">\n <Show when={groupStart()}>\n <span class=\"k2b-message-row__avatar\" aria-hidden=\"true\">\n <Avatar name={props.author.name} src={props.author.avatar} icon={props.author.icon} size=\"sm\" />\n </span>\n </Show>\n </div>\n </Show>\n <div class=\"k2b-message-row__body\">\n <Show\n when={groupStart()}\n fallback={\n <span class=\"k2b-sr-only\">\n {props.author.name}, {props.time}:{\" \"}\n </span>\n }\n >\n <Show\n when={!props.own}\n fallback={\n <div class=\"k2b-message-row__meta\">\n <span class=\"k2b-sr-only\">{props.author.name}, </span>\n <time class=\"k2b-message-row__time\" datetime={dateTimeOf(props.dateTime)}>\n {props.time}\n </time>\n </div>\n }\n >\n <div class=\"k2b-message-row__meta\">{header()}</div>\n </Show>\n </Show>\n <Show when={content() && props.forwarded}>\n <div class=\"k2b-message-row__marker\">\n <i class=\"ti ti-arrow-forward-up\" aria-hidden=\"true\" />\n <span>{chatMessages().messageForwarded}</span>\n </div>\n </Show>\n <Show when={content() && props.quote}>\n {(value) => (\n <Show when={value().onSelect} fallback={<div class=\"k2b-message-row__quote\">{quote(value())}</div>}>\n {(select) => (\n <button type=\"button\" class=\"k2b-message-row__quote\" onClick={() => select()()}>\n {quote(value())}\n </button>\n )}\n </Show>\n )}\n </Show>\n <Show when={hasBubble()}>\n <div\n class=\"k2b-message-row__bubble\"\n data-deleted={props.deleted ? \"\" : undefined}\n aria-busy={props.progress && !props.deleted ? \"true\" : undefined}\n >\n <Show\n when={!props.deleted}\n fallback={\n <span class=\"k2b-message-row__deleted\">\n <i class=\"ti ti-message-off\" aria-hidden=\"true\" />\n {chatMessages().messageDeleted}\n </span>\n }\n >\n <Show\n when={!writing()}\n fallback={\n <span class=\"k2b-message-row__writing\">\n <span class=\"k2b-chat-progress-dots\" aria-hidden=\"true\">\n <span />\n <span />\n <span />\n </span>\n </span>\n }\n >\n {/* biome-ignore lint/a11y/noStaticElementInteractions lint/a11y/useKeyWithClickEvents: the native copy buttons inside the rendered Markdown are the targets; their clicks, including from the keyboard, bubble here. */}\n <div\n ref={text}\n id={textId}\n class=\"k2b-content-markdown k2b-message-row__text\"\n data-heading-scale=\"compact\"\n data-collapsed={collapsed() ? \"\" : undefined}\n onClick={copyCode}\n onFocusIn={revealFocus}\n innerHTML={rendered().html}\n />\n <Show when={collapsible()}>\n <div class=\"k2b-message-row__more-line\">\n <Button\n variant=\"text\"\n size=\"xs\"\n class=\"k2b-message-row__more\"\n aria-expanded={expanded() ? \"true\" : \"false\"}\n aria-controls={textId}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? chatMessages().messageShowLess : chatMessages().messageShowMore}\n </Button>\n <Show when={props.edited}>\n <span class=\"k2b-message-row__edited\">{chatMessages().messageEdited}</span>\n </Show>\n </div>\n </Show>\n </Show>\n </Show>\n </div>\n </Show>\n {/* Without a bubble to end, the edit marker takes the bubble's place. */}\n <Show when={content() && props.edited && !hasBubble()}>\n <div class=\"k2b-message-row__marker\">\n <i class=\"ti ti-pencil\" aria-hidden=\"true\" />\n <span class=\"k2b-message-row__edited\">{chatMessages().messageEdited}</span>\n </div>\n </Show>\n <Show when={media().length > 0}>\n <div\n class=\"k2b-message-row__media\"\n role=\"group\"\n aria-label={chatMessages().attachments}\n data-count={Math.min(media().length, MEDIA_SHOWN)}\n style={media().length === 1 ? { width: mediaWidth(media()[0]!) } : undefined}\n >\n <For each={shownMedia()}>{(item, index) => mediaItem(item, index)}</For>\n </div>\n </Show>\n <Show when={files().length > 0}>\n <div class=\"k2b-message-row__files\">\n <For each={files()}>\n {(file) => (\n <AttachmentTarget class=\"k2b-message-row__file\" onOpen={file.onOpen} href={file.href}>\n <span class=\"k2b-message-row__file-icon\" aria-hidden=\"true\">\n <i class={fileIcon(file)} />\n </span>\n <span class=\"k2b-message-row__file-copy\">\n <span class=\"k2b-message-row__file-name\">{file.name}</span>\n <Show when={file.detail}>\n <span class=\"k2b-message-row__file-detail\">{file.detail}</span>\n </Show>\n </span>\n </AttachmentTarget>\n )}\n </For>\n </div>\n </Show>\n <Show when={content() && props.linkPreview}>\n <div class=\"k2b-message-row__slot\" data-gesture-ignore>\n {props.linkPreview}\n </div>\n </Show>\n <Show when={content() && props.card}>\n <div class=\"k2b-message-row__slot\" data-gesture-ignore>\n {props.card}\n </div>\n </Show>\n <Show when={props.thread}>\n {(thread) => (\n <button type=\"button\" class=\"k2b-message-row__thread\" onClick={() => thread().onOpen()}>\n <Show when={(thread().participants?.length ?? 0) > 0}>\n <span class=\"k2b-message-row__thread-people\" aria-hidden=\"true\">\n <For each={thread().participants?.slice(0, 3)}>\n {(person) => <Avatar name={person.name} src={person.avatar} icon={person.icon} size=\"xs\" />}\n </For>\n </span>\n </Show>\n <span class=\"k2b-message-row__thread-count\">{chatMessages().messageReplies({ count: thread().count })}</span>\n <Show when={thread().lastReply}>\n {(time) => (\n <time class=\"k2b-message-row__thread-time\" datetime={dateTimeOf(thread().lastReplyDateTime)}>\n {chatMessages().messageLastReply({ time: time() })}\n </time>\n )}\n </Show>\n </button>\n )}\n </Show>\n <Show when={hasFooter()}>\n <div class=\"k2b-message-row__footer\">\n <Show when={reactions()}>\n {(list) => <ReactionBar reactions={list()} onToggle={props.onToggleReaction} onAdd={props.onAddReaction} />}\n </Show>\n <Show when={hasLine()}>\n <div class=\"k2b-message-row__line\">\n <Show\n when={props.progress}\n fallback={\n <>\n <Show when={props.status === \"pending\"}>\n <i class=\"ti ti-clock\" aria-hidden=\"true\" />\n <span>{chatMessages().sending}</span>\n </Show>\n <Show when={props.status === \"failed\"}>\n <i class=\"ti ti-alert-circle\" aria-hidden=\"true\" />\n <span>{chatMessages().messageNotSent}</span>\n <Show when={props.onRetry}>\n {(retry) => (\n <Button variant=\"text\" size=\"xs\" onClick={() => retry()()}>\n {chatMessages().messageRetry}\n </Button>\n )}\n </Show>\n </Show>\n <Show when={props.status !== \"pending\" && props.status !== \"failed\"}>\n <Show\n when={props.receipt}\n fallback={\n <Show when={props.status === \"sent\"}>\n <i class=\"ti ti-check\" aria-hidden=\"true\" />\n <span class=\"k2b-sr-only\">{chatMessages().messageSent}</span>\n </Show>\n }\n >\n {(receipt) => (\n <>\n <i class=\"ti ti-checks\" aria-hidden=\"true\" />\n <span class=\"k2b-message-row__receipt\">{receipt()}</span>\n </>\n )}\n </Show>\n </Show>\n </>\n }\n >\n {(progress) => (\n <>\n <i class=\"ti ti-loader-2 k2b-spin\" aria-hidden=\"true\" />\n <span class=\"k2b-message-row__line-text\">{progress().status}</span>\n <Show when={progress().onStop}>\n {(stop) => (\n <Button variant=\"text\" size=\"xs\" onClick={() => stop()()}>\n {chatMessages().messageStop}\n </Button>\n )}\n </Show>\n </>\n )}\n </Show>\n </div>\n </Show>\n </div>\n </Show>\n </div>\n <Show when={(props.actions?.length ?? 0) > 0}>\n <div class=\"k2b-message-row__actions\" role=\"group\" aria-label={chatMessages().messageActions}>\n <For each={props.actions}>\n {(action) => (\n <IconButton label={action.label} size=\"sm\" disabled={action.disabled} onClick={() => action.onSelect()}>\n <i class={action.icon} aria-hidden=\"true\" />\n </IconButton>\n )}\n </For>\n </div>\n </Show>\n </div>\n );\n}\n\n/** A quiet, centered line for something that happened in the conversation, such as a person joining. */\nexport function MessageSystemRow(props: MessageSystemRowProps): JSX.Element {\n return (\n <div class={props.class ? `k2b-message-system-row ${props.class}` : \"k2b-message-system-row\"}>\n <Show when={props.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>\n <span>{props.children}</span>\n <Show when={props.time}>\n <time datetime={dateTimeOf(props.dateTime)}>{props.time}</time>\n </Show>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS,QAAQ,aAAa;AAEvC,SAAS,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,EAAY,SAAS,EAAE,IAAI,QAAQ,UAAU;AACnG,SAAS,MAAM,EAAE,UAAU,QAAQ,mBAAmB;AACtD,SAAS,QAAQ,QAAQ,uBAAuB;AAChD,SAA4B,eAAe,QAAQ,uBAAuB;AAC1E,SAAS,QAAQ,QAAQ,sBAAsB;AAC/C,SAAS,SAAS,QAAQ,gBAAgB;AAC1C,SAA0B,aAAa,QAAQ,kBAAkB;AACjE,SAAS,MAAM,QAAQ,oBAAoB;AAC3C,SAAS,gBAAgB,EAAE,kBAAkB,EAAE,UAAU,QAAQ,gBAAgB;AACjF,SAAS,WAAW,QAA8B,eAAe;;AAEjE;AACA,MAAM,eAAe,GAAG,CAAC,GAAG,MAAM;AAClC;AACA;AACA;AACA;AACA;AACA,MAAM,cAAc,GAAG,EAAE;AACzB;AACA,MAAM,UAAU,GAAG,GAAG;AACtB;AACA,MAAM,UAAU,GAAG,CAAC;AACpB,MAAM,SAAS,GAAG,KAAK;AACvB;AACA,M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MAAA;IAAA;EAAA,gCAOZ,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC;IAAA;IAAA;MAAA,6DACqB,YAAY,CAAC,CAAC,CAAC,cAAc,4CACzF,GAAG;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,OAAO;QAAA;QAAA,UACpB,MAAM,sBACL,UAAU;UAAA,IAAC,KAAK;YAAA,OAAE,MAAM,CAAC,KAAK;UAAA;UAAE,IAAI;UAAA,IAAM,QAAQ;YAAA,OAAE,MAAM,CAAC,QAAQ;UAAA;UAAE,OAAO,EAAE,MAAM,MAAM,CAAC,QAAQ,CAAC,CAAC;UAAA;YAAA,wDAC1F,MAAM,CAAC,IAAI;UAAA;QAAA;MAExB;IAAA;EAAA;AAMb;;AAEA;AACA,OAAO,SAAS,gBAAgB,CAAC,KAA4B,EAAe;EAC1E,+CACc,KAAK,CAAC,KAAK,GAAG,mCAA0B,KAAK,CAAC,KAAK,SAAE,GAAG,wBAAwB,qCACzF,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,KAAK,CAAC,IAAI;IAAA;IAAA,UAAI,IAAI,qDAAe,IAAI,CAAC,CAAC;EAAuB,cACnE,KAAK,CAAC,QAAQ,8BACpB,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,KAAK,CAAC,IAAI;IAAA;IAAA;MAAA,2DACJ,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC,0BAAG,KAAK,CAAC,IAAI;IAAA;EAAA;AAI/D","ignoreList":[]}
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
import { memo as _$memo } from "solid-js/web";
|
|
2
|
+
import { ssr as _$ssr } from "solid-js/web";
|
|
3
|
+
import { ssrAttribute as _$ssrAttribute } from "solid-js/web";
|
|
4
|
+
import { escape as _$escape } from "solid-js/web";
|
|
5
|
+
import { createComponent as _$createComponent } from "solid-js/web";
|
|
6
|
+
var _tmpl$ = ["<span class=\"k2b-reaction-bar__chip\" role=\"img\"", " data-gesture-ignore><span aria-hidden=\"true\">", "</span><span aria-hidden=\"true\">", "</span></span>"],
|
|
7
|
+
_tmpl$2 = ["<button type=\"button\" class=\"k2b-reaction-bar__chip\"", "><span aria-hidden=\"true\">", "</span><span aria-hidden=\"true\">", "</span></button>"],
|
|
8
|
+
_tmpl$3 = ["<span class=\"k2b-reaction-bar__more\"><span aria-hidden=\"true\">+", "</span><span class=\"k2b-sr-only\">", "</span></span>"],
|
|
9
|
+
_tmpl$4 = ["<div", " role=\"group\"", ">", "", "", "<span class=\"k2b-tooltip k2b-reaction-bar__hint\" popover=\"manual\" role=\"tooltip\" aria-hidden=\"true\"", ">", "</span></div>"],
|
|
10
|
+
_tmpl$5 = ["<div class=\"k2b-reaction-bar__list\">", "</div>"],
|
|
11
|
+
_tmpl$6 = "<i class=\"ti ti-mood-plus\" aria-hidden=\"true\"></i>",
|
|
12
|
+
_tmpl$7 = ["<span class=\"", "\">", "</span>"];
|
|
13
|
+
import { createEffect, createMemo, createSignal, For, on, onCleanup, onMount, Show } from "solid-js";
|
|
14
|
+
import { IconButton } from "../actions/Button";
|
|
15
|
+
import { useChatMessages } from "../chat/chat-messages";
|
|
16
|
+
import { positionTooltipSurface } from "../feedback/tooltip-position";
|
|
17
|
+
import { ScrollArea } from "../layout/ScrollArea";
|
|
18
|
+
const HOVER_MS = 250;
|
|
19
|
+
const HOLD_MS = 500;
|
|
20
|
+
const MOVE_TOLERANCE = 8;
|
|
21
|
+
export function ReactionBar(props) {
|
|
22
|
+
const chatMessages = useChatMessages();
|
|
23
|
+
// A max uses the wrapping layout, so the shown chips, +n, and add button wrap together.
|
|
24
|
+
const overflow = () => props.max !== undefined ? "wrap" : props.overflow ?? "scroll";
|
|
25
|
+
const shown = createMemo(() => props.max === undefined ? props.reactions : props.reactions.slice(0, props.max));
|
|
26
|
+
const keys = createMemo(() => shown().map(reaction => reaction.key));
|
|
27
|
+
const byKey = createMemo(() => new Map(shown().map(reaction => [reaction.key, reaction])));
|
|
28
|
+
const more = () => props.reactions.length - shown().length;
|
|
29
|
+
/** The reaction whose names the hint shows; it follows that reaction while the caller updates it. */
|
|
30
|
+
const [hintKey, setHintKey] = createSignal();
|
|
31
|
+
const hinted = () => {
|
|
32
|
+
const key = hintKey();
|
|
33
|
+
const reaction = key === undefined ? undefined : byKey().get(key);
|
|
34
|
+
return reaction?.label?.trim() ? reaction : undefined;
|
|
35
|
+
};
|
|
36
|
+
const hint = () => {
|
|
37
|
+
const reaction = hinted();
|
|
38
|
+
return reaction ? `${reaction.emoji} ${reaction.label}` : "";
|
|
39
|
+
};
|
|
40
|
+
const [touch, setTouch] = createSignal(false);
|
|
41
|
+
let root;
|
|
42
|
+
let surface;
|
|
43
|
+
onMount(() => {
|
|
44
|
+
if (!root || !surface) return;
|
|
45
|
+
const bar = root;
|
|
46
|
+
const tooltip = surface;
|
|
47
|
+
let timer;
|
|
48
|
+
let openChip;
|
|
49
|
+
let swallowClick = false;
|
|
50
|
+
let press;
|
|
51
|
+
const chipOf = target => {
|
|
52
|
+
const chip = target instanceof Element ? target.closest("[data-reaction-key]") : null;
|
|
53
|
+
return chip && chip.closest(".k2b-reaction-bar") === bar ? chip : undefined;
|
|
54
|
+
};
|
|
55
|
+
const clearTimer = () => {
|
|
56
|
+
clearTimeout(timer);
|
|
57
|
+
timer = undefined;
|
|
58
|
+
};
|
|
59
|
+
const close = () => {
|
|
60
|
+
clearTimer();
|
|
61
|
+
openChip = undefined;
|
|
62
|
+
try {
|
|
63
|
+
tooltip.hidePopover();
|
|
64
|
+
} catch {
|
|
65
|
+
/* The surface may already be disconnected. */
|
|
66
|
+
}
|
|
67
|
+
document.removeEventListener("pointerdown", dismiss, true);
|
|
68
|
+
document.removeEventListener("keydown", escape);
|
|
69
|
+
window.removeEventListener("scroll", close, true);
|
|
70
|
+
window.removeEventListener("resize", close);
|
|
71
|
+
};
|
|
72
|
+
const dismiss = () => close();
|
|
73
|
+
const escape = event => {
|
|
74
|
+
if (event.key === "Escape") close();
|
|
75
|
+
};
|
|
76
|
+
/** Opens the names hint over a chip; false when the chip has no names to show. */
|
|
77
|
+
const open = (chip, fromTouch) => {
|
|
78
|
+
clearTimer();
|
|
79
|
+
const reaction = byKey().get(chip.dataset.reactionKey ?? "");
|
|
80
|
+
if (!reaction?.label?.trim() || !chip.isConnected) return false;
|
|
81
|
+
setHintKey(reaction.key);
|
|
82
|
+
setTouch(fromTouch);
|
|
83
|
+
if (!tooltip.matches(":popover-open")) {
|
|
84
|
+
try {
|
|
85
|
+
tooltip.showPopover();
|
|
86
|
+
} catch {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
openChip = chip;
|
|
91
|
+
positionTooltipSurface(tooltip, chip, "top");
|
|
92
|
+
document.addEventListener("pointerdown", dismiss, true);
|
|
93
|
+
document.addEventListener("keydown", escape);
|
|
94
|
+
window.addEventListener("scroll", close, true);
|
|
95
|
+
window.addEventListener("resize", close);
|
|
96
|
+
return true;
|
|
97
|
+
};
|
|
98
|
+
// An open hint follows its reaction: new names show at once, and it closes when the reaction, its names, or its
|
|
99
|
+
// chip go away.
|
|
100
|
+
createEffect(on(hinted, reaction => {
|
|
101
|
+
if (!openChip) return;
|
|
102
|
+
if (!reaction || !openChip.isConnected) close();else positionTooltipSurface(tooltip, openChip, "top");
|
|
103
|
+
}));
|
|
104
|
+
const delayed = chip => {
|
|
105
|
+
if (touch() && openChip) return;
|
|
106
|
+
if (!byKey().get(chip.dataset.reactionKey ?? "")?.label?.trim()) {
|
|
107
|
+
close();
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
clearTimer();
|
|
111
|
+
if (openChip) open(chip, false);else timer = setTimeout(() => open(chip, false), HOVER_MS);
|
|
112
|
+
};
|
|
113
|
+
const enter = event => {
|
|
114
|
+
const chip = chipOf(event.target);
|
|
115
|
+
if (chip && event.target === chip && event.pointerType !== "touch") delayed(chip);
|
|
116
|
+
};
|
|
117
|
+
const leave = event => {
|
|
118
|
+
if (event.target !== chipOf(event.target) || touch() && openChip) return;
|
|
119
|
+
// Moving directly to another chip keeps an open hint available for its immediate update.
|
|
120
|
+
const next = chipOf(event.relatedTarget);
|
|
121
|
+
if (!next || !byKey().get(next.dataset.reactionKey ?? "")?.label?.trim()) close();
|
|
122
|
+
};
|
|
123
|
+
const focusIn = event => {
|
|
124
|
+
const chip = chipOf(event.target);
|
|
125
|
+
if (chip?.matches(":focus-visible")) delayed(chip);
|
|
126
|
+
};
|
|
127
|
+
const focusOut = event => {
|
|
128
|
+
if (chipOf(event.target) && !chipOf(event.relatedTarget) && !(touch() && openChip)) close();
|
|
129
|
+
};
|
|
130
|
+
const resetSwallow = () => {
|
|
131
|
+
swallowClick = false;
|
|
132
|
+
document.removeEventListener("pointerdown", resetSwallow, true);
|
|
133
|
+
};
|
|
134
|
+
const endPress = () => {
|
|
135
|
+
clearTimer();
|
|
136
|
+
press = undefined;
|
|
137
|
+
document.removeEventListener("pointermove", move, true);
|
|
138
|
+
document.removeEventListener("pointerup", up, true);
|
|
139
|
+
document.removeEventListener("pointercancel", cancel, true);
|
|
140
|
+
};
|
|
141
|
+
const down = event => {
|
|
142
|
+
resetSwallow();
|
|
143
|
+
close();
|
|
144
|
+
endPress();
|
|
145
|
+
const chip = chipOf(event.target);
|
|
146
|
+
if (!chip || event.pointerType !== "touch" && event.pointerType !== "pen") return;
|
|
147
|
+
press = {
|
|
148
|
+
chip,
|
|
149
|
+
id: event.pointerId,
|
|
150
|
+
x: event.clientX,
|
|
151
|
+
y: event.clientY,
|
|
152
|
+
held: false,
|
|
153
|
+
moved: false
|
|
154
|
+
};
|
|
155
|
+
timer = setTimeout(() => {
|
|
156
|
+
timer = undefined;
|
|
157
|
+
if (!press || press.moved) return;
|
|
158
|
+
// Only a hold that shows names takes the press; on a chip without names it stays an ordinary press.
|
|
159
|
+
press.held = open(press.chip, true);
|
|
160
|
+
}, HOLD_MS);
|
|
161
|
+
document.addEventListener("pointermove", move, true);
|
|
162
|
+
document.addEventListener("pointerup", up, true);
|
|
163
|
+
document.addEventListener("pointercancel", cancel, true);
|
|
164
|
+
};
|
|
165
|
+
const move = event => {
|
|
166
|
+
if (!press || event.pointerId !== press.id) return;
|
|
167
|
+
if (Math.hypot(event.clientX - press.x, event.clientY - press.y) > MOVE_TOLERANCE) {
|
|
168
|
+
press.moved = true;
|
|
169
|
+
clearTimer();
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
const up = event => {
|
|
173
|
+
if (!press || event.pointerId !== press.id) return;
|
|
174
|
+
if (press.held) {
|
|
175
|
+
swallowClick = true;
|
|
176
|
+
// Some browsers send no click after a hold. Never consume the next real tap.
|
|
177
|
+
document.addEventListener("pointerdown", resetSwallow, true);
|
|
178
|
+
} else if (!press.moved && !props.onToggle) open(press.chip, true);
|
|
179
|
+
endPress();
|
|
180
|
+
};
|
|
181
|
+
const cancel = event => {
|
|
182
|
+
if (event.pointerId === press?.id) endPress();
|
|
183
|
+
};
|
|
184
|
+
const touchEnd = event => {
|
|
185
|
+
if (!swallowClick || !event.cancelable) return;
|
|
186
|
+
// A cancelled touchend sends no click, so nothing is left to swallow.
|
|
187
|
+
event.preventDefault();
|
|
188
|
+
resetSwallow();
|
|
189
|
+
};
|
|
190
|
+
// Only the click of the held finger or pen is swallowed; a keyboard's click has no detail and always goes through.
|
|
191
|
+
const click = event => {
|
|
192
|
+
if (!swallowClick || event.detail === 0) return;
|
|
193
|
+
event.preventDefault();
|
|
194
|
+
event.stopPropagation();
|
|
195
|
+
resetSwallow();
|
|
196
|
+
};
|
|
197
|
+
const contextMenu = event => {
|
|
198
|
+
if (chipOf(event.target) && (press || swallowClick || touch() && openChip)) event.preventDefault();
|
|
199
|
+
};
|
|
200
|
+
bar.addEventListener("pointerenter", enter, true);
|
|
201
|
+
bar.addEventListener("pointerleave", leave, true);
|
|
202
|
+
bar.addEventListener("focusin", focusIn);
|
|
203
|
+
bar.addEventListener("focusout", focusOut);
|
|
204
|
+
bar.addEventListener("pointerdown", down);
|
|
205
|
+
bar.addEventListener("touchend", touchEnd, {
|
|
206
|
+
passive: false
|
|
207
|
+
});
|
|
208
|
+
bar.addEventListener("click", click, true);
|
|
209
|
+
bar.addEventListener("contextmenu", contextMenu);
|
|
210
|
+
onCleanup(() => {
|
|
211
|
+
close();
|
|
212
|
+
endPress();
|
|
213
|
+
resetSwallow();
|
|
214
|
+
bar.removeEventListener("pointerenter", enter, true);
|
|
215
|
+
bar.removeEventListener("pointerleave", leave, true);
|
|
216
|
+
bar.removeEventListener("focusin", focusIn);
|
|
217
|
+
bar.removeEventListener("focusout", focusOut);
|
|
218
|
+
bar.removeEventListener("pointerdown", down);
|
|
219
|
+
bar.removeEventListener("touchend", touchEnd);
|
|
220
|
+
bar.removeEventListener("click", click, true);
|
|
221
|
+
bar.removeEventListener("contextmenu", contextMenu);
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
const chip = (key, reaction) => {
|
|
225
|
+
const label = own => chatMessages().messageReaction({
|
|
226
|
+
emoji: reaction().emoji,
|
|
227
|
+
count: reaction().count,
|
|
228
|
+
names: reaction().label,
|
|
229
|
+
own
|
|
230
|
+
});
|
|
231
|
+
return _$createComponent(Show, {
|
|
232
|
+
get when() {
|
|
233
|
+
return props.onToggle;
|
|
234
|
+
},
|
|
235
|
+
get fallback() {
|
|
236
|
+
return _$ssr(_tmpl$, _$ssrAttribute("aria-label", _$escape(label(Boolean(reaction().own)), true), false) + _$ssrAttribute("aria-busy", reaction().busy ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("data-own", reaction().own ? "" : _$escape(undefined, true), false) + _$ssrAttribute("data-reaction-key", _$escape(key, true), false), _$escape(reaction().emoji), _$escape(reaction().count));
|
|
237
|
+
},
|
|
238
|
+
children: toggle => _$ssr(_tmpl$2, _$ssrAttribute("aria-pressed", reaction().own ? "true" : "false", false) + _$ssrAttribute("aria-label", _$escape(label(false), true), false) + _$ssrAttribute("aria-busy", reaction().busy ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("data-own", reaction().own ? "" : _$escape(undefined, true), false) + _$ssrAttribute("data-reaction-key", _$escape(key, true), false), _$escape(reaction().emoji), _$escape(reaction().count))
|
|
239
|
+
});
|
|
240
|
+
};
|
|
241
|
+
const chips = () => _$createComponent(For, {
|
|
242
|
+
get each() {
|
|
243
|
+
return keys();
|
|
244
|
+
},
|
|
245
|
+
children: key => _$createComponent(Show, {
|
|
246
|
+
get when() {
|
|
247
|
+
return byKey().get(key);
|
|
248
|
+
},
|
|
249
|
+
children: reaction => chip(key, reaction)
|
|
250
|
+
})
|
|
251
|
+
});
|
|
252
|
+
return _$ssr(_tmpl$4, _$ssrAttribute("class", props.class ? `k2b-reaction-bar ${_$escape(props.class, true)}` : "k2b-reaction-bar", false), _$ssrAttribute("aria-label", _$escape(chatMessages().messageReactions, true), false) + _$ssrAttribute("data-density", _$escape(props.density ?? "default", true), false) + _$ssrAttribute("data-overflow", _$escape(overflow(), true), false) + _$ssrAttribute("data-add", props.onAdd ? _$escape(props.add ?? "always", true) : _$escape(undefined, true), false) + _$ssrAttribute("data-empty", props.reactions.length === 0 ? "" : _$escape(undefined, true), false), _$escape(_$createComponent(Show, {
|
|
253
|
+
get when() {
|
|
254
|
+
return overflow() === "scroll";
|
|
255
|
+
},
|
|
256
|
+
get fallback() {
|
|
257
|
+
return _$ssr(_tmpl$5, _$escape(chips()));
|
|
258
|
+
},
|
|
259
|
+
get children() {
|
|
260
|
+
return _$createComponent(Show, {
|
|
261
|
+
get when() {
|
|
262
|
+
return shown().length > 0;
|
|
263
|
+
},
|
|
264
|
+
get children() {
|
|
265
|
+
return _$createComponent(ScrollArea, {
|
|
266
|
+
orientation: "horizontal",
|
|
267
|
+
"class": "k2b-reaction-bar__scroll",
|
|
268
|
+
get tabindex() {
|
|
269
|
+
return props.onToggle ? undefined : 0;
|
|
270
|
+
},
|
|
271
|
+
get children() {
|
|
272
|
+
return chips();
|
|
273
|
+
}
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
})), _$escape(_$createComponent(Show, {
|
|
279
|
+
get when() {
|
|
280
|
+
return more() > 0;
|
|
281
|
+
},
|
|
282
|
+
get children() {
|
|
283
|
+
return _$ssr(_tmpl$3, _$escape(more()), _$escape(props.moreLabel?.(more()) ?? chatMessages().moreReactions({
|
|
284
|
+
count: more()
|
|
285
|
+
})));
|
|
286
|
+
}
|
|
287
|
+
})), _$escape(_$createComponent(Show, {
|
|
288
|
+
get when() {
|
|
289
|
+
return props.onAdd;
|
|
290
|
+
},
|
|
291
|
+
children: add => _$ssr(_tmpl$7, `k2b-reaction-bar__add${props.add === "progressive" ? " k2b-progressive-action" : ""}`, _$escape(_$createComponent(IconButton, {
|
|
292
|
+
get label() {
|
|
293
|
+
return chatMessages().messageAddReaction;
|
|
294
|
+
},
|
|
295
|
+
size: "xs",
|
|
296
|
+
"class": "k2b-reaction-bar__add-button",
|
|
297
|
+
onClick: event => add()(event.currentTarget),
|
|
298
|
+
get children() {
|
|
299
|
+
return _$ssr(_tmpl$6);
|
|
300
|
+
}
|
|
301
|
+
})))
|
|
302
|
+
})), _$ssrAttribute("data-touch", touch() ? "" : _$escape(undefined, true), false), _$escape(hint()));
|
|
303
|
+
}
|
|
304
|
+
//# sourceMappingURL=ReactionBar.js.map
|