@k2b/ui 0.18.0 → 0.20.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 +3 -2
- package/dist/browser/actions/ContextMenu.js +3 -1
- package/dist/browser/actions/ContextMenu.js.map +1 -1
- package/dist/browser/actions/Dropdown.js +91 -46
- package/dist/browser/actions/Dropdown.js.map +1 -1
- package/dist/browser/actions/FilterChip.js +4 -1
- package/dist/browser/actions/FilterChip.js.map +1 -1
- package/dist/browser/actions/GestureMenu.js +467 -0
- package/dist/browser/actions/GestureMenu.js.map +1 -0
- package/dist/browser/actions/index.js +1 -0
- package/dist/browser/actions/index.js.map +1 -1
- package/dist/browser/chat/ChatComposer.js +1255 -534
- package/dist/browser/chat/ChatComposer.js.map +1 -1
- package/dist/browser/chat/ChatPrimitives.js +9 -3
- package/dist/browser/chat/ChatPrimitives.js.map +1 -1
- package/dist/browser/chat/ChatTimeline.js +19 -1
- package/dist/browser/chat/ChatTimeline.js.map +1 -1
- package/dist/browser/chat/chat-behavior.js +9 -0
- package/dist/browser/chat/chat-behavior.js.map +1 -1
- package/dist/browser/chat/index.js.map +1 -1
- package/dist/browser/chat/types.js.map +1 -1
- package/dist/browser/content/Calendar.js +579 -533
- package/dist/browser/content/Calendar.js.map +1 -1
- package/dist/browser/content/Lightbox.js +76 -40
- package/dist/browser/content/Lightbox.js.map +1 -1
- package/dist/browser/content/MessageRow.js +2 -2
- package/dist/browser/content/MessageRow.js.map +1 -1
- package/dist/browser/content/PdfPreview.js +146 -79
- package/dist/browser/content/PdfPreview.js.map +1 -1
- package/dist/browser/content/Timeline.js +1038 -0
- package/dist/browser/content/Timeline.js.map +1 -0
- package/dist/browser/content/VideoPlayer.js +29 -9
- package/dist/browser/content/VideoPlayer.js.map +1 -1
- package/dist/browser/content/chart-inspection.js +7 -2
- package/dist/browser/content/chart-inspection.js.map +1 -1
- package/dist/browser/content/index.js +1 -0
- package/dist/browser/content/index.js.map +1 -1
- package/dist/browser/content/timeline-model.js +579 -0
- package/dist/browser/content/timeline-model.js.map +1 -0
- package/dist/browser/feedback/dialog-core.js +26 -14
- package/dist/browser/feedback/dialog-core.js.map +1 -1
- package/dist/browser/inputs/ChoiceChips.js +66 -0
- package/dist/browser/inputs/ChoiceChips.js.map +1 -0
- package/dist/browser/inputs/ChoiceGroups.js +53 -12
- package/dist/browser/inputs/ChoiceGroups.js.map +1 -1
- package/dist/browser/inputs/FileInputs.js +48 -33
- package/dist/browser/inputs/FileInputs.js.map +1 -1
- package/dist/browser/inputs/SignatureInput.js +558 -0
- package/dist/browser/inputs/SignatureInput.js.map +1 -0
- package/dist/browser/inputs/TextInput.js +13 -1
- package/dist/browser/inputs/TextInput.js.map +1 -1
- package/dist/browser/inputs/emoji/EmojiPicker.js +841 -0
- package/dist/browser/inputs/emoji/EmojiPicker.js.map +1 -0
- package/dist/browser/inputs/emoji/emoji-data.js +1903 -0
- package/dist/browser/inputs/emoji/emoji-data.js.map +1 -0
- package/dist/browser/inputs/emoji/emoji-index.js +209 -0
- package/dist/browser/inputs/emoji/emoji-index.js.map +1 -0
- package/dist/browser/inputs/emoji/emoji-messages.js +64 -0
- package/dist/browser/inputs/emoji/emoji-messages.js.map +1 -0
- package/dist/browser/inputs/index.js +5 -0
- package/dist/browser/inputs/index.js.map +1 -1
- package/dist/browser/inputs/markdown/actions.js +6 -2
- package/dist/browser/inputs/markdown/actions.js.map +1 -1
- package/dist/browser/inputs/markdown/code-zone.js +38 -2
- package/dist/browser/inputs/markdown/code-zone.js.map +1 -1
- package/dist/browser/inputs/signature-messages.js +39 -0
- package/dist/browser/inputs/signature-messages.js.map +1 -0
- package/dist/browser/inputs/signature.js +208 -0
- package/dist/browser/inputs/signature.js.map +1 -0
- package/dist/browser/internal/render-error.js +49 -0
- package/dist/browser/internal/render-error.js.map +1 -0
- package/dist/browser/intl/messages.js +102 -0
- package/dist/browser/intl/messages.js.map +1 -1
- package/dist/browser/layout/AppWorkspace.js +321 -222
- package/dist/browser/layout/AppWorkspace.js.map +1 -1
- package/dist/browser/layout/FloatingWindow.js +4 -1
- package/dist/browser/layout/FloatingWindow.js.map +1 -1
- package/dist/browser/layout/SidebarItemPreview.js +5 -1
- package/dist/browser/layout/SidebarItemPreview.js.map +1 -1
- package/dist/browser/layout/index.js.map +1 -1
- package/dist/browser/surfaces/ResourceCard.js +212 -0
- package/dist/browser/surfaces/ResourceCard.js.map +1 -0
- package/dist/browser/surfaces/index.js +1 -0
- package/dist/browser/surfaces/index.js.map +1 -1
- package/dist/licenses/emojibase-data.txt +21 -0
- package/dist/ssr/actions/ContextMenu.js +3 -1
- package/dist/ssr/actions/ContextMenu.js.map +1 -1
- package/dist/ssr/actions/Dropdown.js +49 -12
- package/dist/ssr/actions/Dropdown.js.map +1 -1
- package/dist/ssr/actions/FilterChip.js +4 -1
- package/dist/ssr/actions/FilterChip.js.map +1 -1
- package/dist/ssr/actions/GestureMenu.js +411 -0
- package/dist/ssr/actions/GestureMenu.js.map +1 -0
- package/dist/ssr/actions/index.js +1 -0
- package/dist/ssr/actions/index.js.map +1 -1
- package/dist/ssr/chat/ChatComposer.js +767 -214
- package/dist/ssr/chat/ChatComposer.js.map +1 -1
- package/dist/ssr/chat/ChatPrimitives.js +9 -3
- package/dist/ssr/chat/ChatPrimitives.js.map +1 -1
- package/dist/ssr/chat/ChatTimeline.js +19 -1
- package/dist/ssr/chat/ChatTimeline.js.map +1 -1
- package/dist/ssr/chat/chat-behavior.js +9 -0
- package/dist/ssr/chat/chat-behavior.js.map +1 -1
- package/dist/ssr/chat/index.js.map +1 -1
- package/dist/ssr/chat/types.js.map +1 -1
- package/dist/ssr/content/Calendar.js +183 -142
- package/dist/ssr/content/Calendar.js.map +1 -1
- package/dist/ssr/content/Lightbox.js +19 -5
- package/dist/ssr/content/Lightbox.js.map +1 -1
- package/dist/ssr/content/MessageRow.js +2 -2
- package/dist/ssr/content/MessageRow.js.map +1 -1
- package/dist/ssr/content/PdfPreview.js +77 -36
- package/dist/ssr/content/PdfPreview.js.map +1 -1
- package/dist/ssr/content/Timeline.js +804 -0
- package/dist/ssr/content/Timeline.js.map +1 -0
- package/dist/ssr/content/VideoPlayer.js +29 -9
- package/dist/ssr/content/VideoPlayer.js.map +1 -1
- package/dist/ssr/content/chart-inspection.js +7 -2
- package/dist/ssr/content/chart-inspection.js.map +1 -1
- package/dist/ssr/content/index.js +1 -0
- package/dist/ssr/content/index.js.map +1 -1
- package/dist/ssr/content/timeline-model.js +579 -0
- package/dist/ssr/content/timeline-model.js.map +1 -0
- package/dist/ssr/feedback/dialog-core.js +26 -14
- package/dist/ssr/feedback/dialog-core.js.map +1 -1
- package/dist/ssr/inputs/ChoiceChips.js +66 -0
- package/dist/ssr/inputs/ChoiceChips.js.map +1 -0
- package/dist/ssr/inputs/ChoiceGroups.js +12 -4
- package/dist/ssr/inputs/ChoiceGroups.js.map +1 -1
- package/dist/ssr/inputs/FileInputs.js +19 -4
- package/dist/ssr/inputs/FileInputs.js.map +1 -1
- package/dist/ssr/inputs/SignatureInput.js +404 -0
- package/dist/ssr/inputs/SignatureInput.js.map +1 -0
- package/dist/ssr/inputs/TextInput.js +13 -1
- package/dist/ssr/inputs/TextInput.js.map +1 -1
- package/dist/ssr/inputs/emoji/EmojiPicker.js +551 -0
- package/dist/ssr/inputs/emoji/EmojiPicker.js.map +1 -0
- package/dist/ssr/inputs/emoji/emoji-data.js +1903 -0
- package/dist/ssr/inputs/emoji/emoji-data.js.map +1 -0
- package/dist/ssr/inputs/emoji/emoji-index.js +209 -0
- package/dist/ssr/inputs/emoji/emoji-index.js.map +1 -0
- package/dist/ssr/inputs/emoji/emoji-messages.js +64 -0
- package/dist/ssr/inputs/emoji/emoji-messages.js.map +1 -0
- package/dist/ssr/inputs/index.js +5 -0
- package/dist/ssr/inputs/index.js.map +1 -1
- package/dist/ssr/inputs/markdown/actions.js +6 -2
- package/dist/ssr/inputs/markdown/actions.js.map +1 -1
- package/dist/ssr/inputs/markdown/code-zone.js +38 -2
- package/dist/ssr/inputs/markdown/code-zone.js.map +1 -1
- package/dist/ssr/inputs/signature-messages.js +39 -0
- package/dist/ssr/inputs/signature-messages.js.map +1 -0
- package/dist/ssr/inputs/signature.js +208 -0
- package/dist/ssr/inputs/signature.js.map +1 -0
- package/dist/ssr/internal/render-error.js +49 -0
- package/dist/ssr/internal/render-error.js.map +1 -0
- package/dist/ssr/intl/messages.js +102 -0
- package/dist/ssr/intl/messages.js.map +1 -1
- package/dist/ssr/layout/AppWorkspace.js +112 -41
- package/dist/ssr/layout/AppWorkspace.js.map +1 -1
- package/dist/ssr/layout/FloatingWindow.js +4 -1
- package/dist/ssr/layout/FloatingWindow.js.map +1 -1
- package/dist/ssr/layout/SidebarItemPreview.js +5 -1
- package/dist/ssr/layout/SidebarItemPreview.js.map +1 -1
- package/dist/ssr/layout/index.js.map +1 -1
- package/dist/ssr/surfaces/ResourceCard.js +115 -0
- package/dist/ssr/surfaces/ResourceCard.js.map +1 -0
- 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/Dropdown.d.ts +13 -1
- package/dist/types/actions/FilterChip.d.ts +5 -0
- package/dist/types/actions/GestureMenu.d.ts +35 -0
- package/dist/types/actions/index.d.ts +2 -0
- package/dist/types/chat/ChatComposer.d.ts +27 -1
- package/dist/types/chat/chat-behavior.d.ts +15 -0
- package/dist/types/chat/index.d.ts +1 -1
- package/dist/types/chat/types.d.ts +34 -0
- package/dist/types/content/Calendar.d.ts +28 -8
- package/dist/types/content/Lightbox.d.ts +8 -0
- package/dist/types/content/Timeline.d.ts +49 -0
- package/dist/types/content/index.d.ts +4 -2
- package/dist/types/content/timeline-model.d.ts +148 -0
- package/dist/types/feedback/dialog-core.d.ts +1 -1
- package/dist/types/inputs/ChoiceChips.d.ts +20 -0
- package/dist/types/inputs/ChoiceGroups.d.ts +11 -2
- package/dist/types/inputs/FileInputs.d.ts +6 -0
- package/dist/types/inputs/SignatureInput.d.ts +22 -0
- package/dist/types/inputs/emoji/EmojiPicker.d.ts +42 -0
- package/dist/types/inputs/emoji/emoji-data.d.ts +2 -0
- package/dist/types/inputs/emoji/emoji-index.d.ts +109 -0
- package/dist/types/inputs/emoji/emoji-messages.d.ts +30 -0
- package/dist/types/inputs/index.d.ts +10 -0
- package/dist/types/inputs/markdown/actions.d.ts +2 -0
- package/dist/types/inputs/markdown/code-zone.d.ts +7 -0
- package/dist/types/inputs/signature-messages.d.ts +11 -0
- package/dist/types/inputs/signature.d.ts +72 -0
- package/dist/types/internal/render-error.d.ts +13 -0
- package/dist/types/intl/messages.d.ts +51 -0
- package/dist/types/layout/AppWorkspace.d.ts +17 -0
- package/dist/types/layout/SidebarItemPreview.d.ts +2 -0
- package/dist/types/layout/index.d.ts +1 -1
- package/dist/types/surfaces/ResourceCard.d.ts +31 -0
- package/dist/types/surfaces/index.d.ts +2 -0
- package/package.json +6 -5
|
@@ -9,12 +9,16 @@ var _tmpl$ = ["<span class=\"k2b-content-lightbox__counter\" aria-live=\"polite\
|
|
|
9
9
|
_tmpl$4 = ["<button type=\"button\" class=\"k2b-content-lightbox__nav\" data-direction=\"previous\"", "><i class=\"ti ti-chevron-left\" aria-hidden=\"true\"></i></button>"],
|
|
10
10
|
_tmpl$5 = ["<button type=\"button\" class=\"k2b-content-lightbox__nav\" data-direction=\"next\"", "><i class=\"ti ti-chevron-right\" aria-hidden=\"true\"></i></button>"],
|
|
11
11
|
_tmpl$6 = ["<div class=\"k2b-content-lightbox__dots\" role=\"group\"", ">", "</div>"],
|
|
12
|
-
_tmpl$7 = ["<dialog class=\"k2b-content-lightbox\"", "><div class=\"k2b-content-lightbox__bar\"><div class=\"k2b-content-lightbox__meta\">", "", "</div><div class=\"k2b-content-lightbox__actions\">", "<button type=\"button\" class=\"k2b-content-lightbox__button\"", "><i class=\"ti ti-x\" aria-hidden=\"true\"></i><span class=\"k2b-content-lightbox__button-label\">", "</span></button></div></div><div class=\"k2b-content-lightbox__stage\">", "</div>", "", "</dialog>"],
|
|
13
|
-
_tmpl$8 = ["<
|
|
14
|
-
_tmpl$9 = ["<
|
|
12
|
+
_tmpl$7 = ["<dialog class=\"k2b-content-lightbox\"", "><div class=\"k2b-content-lightbox__bar\"><div class=\"k2b-content-lightbox__meta\">", "", "</div><div class=\"k2b-content-lightbox__actions\">", "", "<button type=\"button\" class=\"k2b-content-lightbox__button\"", "><i class=\"ti ti-x\" aria-hidden=\"true\"></i><span class=\"k2b-content-lightbox__button-label\">", "</span></button></div></div><div class=\"k2b-content-lightbox__stage\">", "</div>", "", "</dialog>"],
|
|
13
|
+
_tmpl$8 = ["<button type=\"button\" class=\"k2b-content-lightbox__button\"", "><i", " aria-hidden=\"true\"></i><span class=\"k2b-content-lightbox__button-label\">", "</span></button>"],
|
|
14
|
+
_tmpl$9 = ["<img", " class=\"k2b-content-lightbox__image\" draggable=\"false\">"],
|
|
15
|
+
_tmpl$0 = ["<button type=\"button\" class=\"k2b-content-lightbox__dot\"", "></button>"];
|
|
15
16
|
import { createEffect, createSignal, For, onCleanup, onMount, Show } from "solid-js";
|
|
16
17
|
import { returnFocus, ringOnReturn } from "../internal/focus-return";
|
|
17
18
|
import { useUiMessages } from "../intl/messages";
|
|
19
|
+
|
|
20
|
+
/** One more thing to do with the shown image, beside Download: a short label, its icon class, and what it does. */
|
|
21
|
+
|
|
18
22
|
/**
|
|
19
23
|
* Minimal, accessible lightbox using native <dialog>.
|
|
20
24
|
* Supports keyboard navigation, touch swipe gestures, and screen readers.
|
|
@@ -64,8 +68,13 @@ export default function Lightbox(props) {
|
|
|
64
68
|
props.onClose();
|
|
65
69
|
};
|
|
66
70
|
|
|
71
|
+
// A key belongs to the Lightbox while focus is inside it, or on the page with no other dialog open. A dialog opened
|
|
72
|
+
// from one of its actions keeps its own keys: Escape closes that dialog, and arrows stay in its fields.
|
|
73
|
+
const ownsKey = target => target instanceof Node && (dialogRef.contains(target) || target === document.body && Array.from(document.querySelectorAll("dialog[open]")).every(dialog => dialog === dialogRef));
|
|
74
|
+
|
|
67
75
|
// Keyboard navigation
|
|
68
76
|
const handleKeyDown = e => {
|
|
77
|
+
if (!ownsKey(e.target)) return;
|
|
69
78
|
switch (e.key) {
|
|
70
79
|
case "Escape":
|
|
71
80
|
// Handled here, so WebKit does not light the returned focus for this key.
|
|
@@ -144,6 +153,11 @@ export default function Lightbox(props) {
|
|
|
144
153
|
get children() {
|
|
145
154
|
return _$ssr(_tmpl$2, _$escape(current()?.alt));
|
|
146
155
|
}
|
|
156
|
+
})), _$escape(_$createComponent(For, {
|
|
157
|
+
get each() {
|
|
158
|
+
return current()?.actions ?? [];
|
|
159
|
+
},
|
|
160
|
+
children: action => _$ssr(_tmpl$8, _$ssrAttribute("aria-label", _$escape(action.label, true), false), _$ssrAttribute("class", _$escape(action.icon, true), false), _$escape(action.label))
|
|
147
161
|
})), _$escape(_$createComponent(Show, {
|
|
148
162
|
get when() {
|
|
149
163
|
return current()?.downloadUrl;
|
|
@@ -155,7 +169,7 @@ export default function Lightbox(props) {
|
|
|
155
169
|
get when() {
|
|
156
170
|
return current();
|
|
157
171
|
},
|
|
158
|
-
children: image => _$ssr(_tmpl$
|
|
172
|
+
children: image => _$ssr(_tmpl$9, _$ssrAttribute("src", _$escape(image().src, true), false) + _$ssrAttribute("alt", _$escape(image().alt ?? "", true), false))
|
|
159
173
|
})), _$escape(_$createComponent(Show, {
|
|
160
174
|
get when() {
|
|
161
175
|
return isMultiple();
|
|
@@ -172,7 +186,7 @@ export default function Lightbox(props) {
|
|
|
172
186
|
get each() {
|
|
173
187
|
return props.images;
|
|
174
188
|
},
|
|
175
|
-
children: (_, i) => _$ssr(_tmpl$
|
|
189
|
+
children: (_, i) => _$ssr(_tmpl$0, _$ssrAttribute("aria-current", index() === i() ? "true" : _$escape(undefined, true), false) + _$ssrAttribute("aria-label", _$escape(messages().goToImage({
|
|
176
190
|
index: i() + 1
|
|
177
191
|
}), true), false))
|
|
178
192
|
})));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["content/Lightbox.tsx"],"sourcesContent":["import { createEffect, createSignal, For, onCleanup, onMount, Show } from \"solid-js\";\nimport { returnFocus, ringOnReturn } from \"../internal/focus-return\";\nimport { useUiMessages } from \"../intl/messages\";\n\nexport type LightboxImage = {\n src: string;\n alt?: string;\n downloadUrl?: string;\n};\n\ntype LightboxProps = {\n images: LightboxImage[];\n initialIndex?: number;\n onClose: () => void;\n};\n\n/**\n * Minimal, accessible lightbox using native <dialog>.\n * Supports keyboard navigation, touch swipe gestures, and screen readers.\n */\nexport default function Lightbox(props: LightboxProps) {\n const messages = useUiMessages();\n const clampIndex = (value: number, images = props.images): number =>\n images.length === 0 ? 0 : Math.max(0, Math.min(value, images.length - 1));\n const [index, setIndex] = createSignal(clampIndex(props.initialIndex ?? 0));\n let dialogRef!: HTMLDialogElement;\n let opener: HTMLElement | null = null;\n let openerRing = true;\n\n createEffect(\n (previous: { images: LightboxImage[]; initialIndex: number | undefined }) => {\n const images = props.images;\n const initialIndex = props.initialIndex;\n setIndex((currentIndex) => {\n if (initialIndex !== previous.initialIndex) return clampIndex(initialIndex ?? 0, images);\n const previousImage = previous.images[currentIndex];\n const retained = previousImage ? images.findIndex((image) => image === previousImage || image.src === previousImage.src) : -1;\n return retained >= 0 ? retained : clampIndex(currentIndex, images);\n });\n return { images, initialIndex };\n },\n { images: props.images, initialIndex: props.initialIndex },\n );\n\n // Touch gesture tracking\n let touchStartX = 0;\n let touchStartY = 0;\n const SWIPE_THRESHOLD = 50;\n\n const current = () => props.images[index()];\n const isMultiple = () => props.images.length > 1;\n const prev = () => {\n if (!isMultiple()) return;\n setIndex((i) => (i - 1 + props.images.length) % props.images.length);\n };\n const next = () => {\n if (!isMultiple()) return;\n setIndex((i) => (i + 1) % props.images.length);\n };\n\n const close = () => {\n dialogRef.close();\n returnFocus(opener, openerRing);\n props.onClose();\n };\n\n // Keyboard navigation\n const handleKeyDown = (e: KeyboardEvent) => {\n switch (e.key) {\n case \"Escape\":\n // Handled here, so WebKit does not light the returned focus for this key.\n e.preventDefault();\n close();\n break;\n case \"ArrowLeft\":\n prev();\n break;\n case \"ArrowRight\":\n next();\n break;\n }\n };\n\n // Touch handlers for swipe gestures\n const handleTouchStart = (e: TouchEvent) => {\n const touch = e.touches[0];\n if (touch) {\n touchStartX = touch.clientX;\n touchStartY = touch.clientY;\n }\n };\n\n const handleTouchEnd = (e: TouchEvent) => {\n const touch = e.changedTouches[0];\n if (!touch) return;\n\n const deltaX = touch.clientX - touchStartX;\n const deltaY = touch.clientY - touchStartY;\n\n // Only trigger swipe if horizontal movement is dominant\n if (Math.abs(deltaX) > Math.abs(deltaY) && Math.abs(deltaX) > SWIPE_THRESHOLD) {\n if (deltaX > 0) {\n prev();\n } else {\n next();\n }\n }\n };\n\n // Click on backdrop closes lightbox\n const handleBackdropClick = (e: MouseEvent) => {\n if (e.target === dialogRef) {\n close();\n }\n };\n\n // The browser cancels the dialog itself, as on the Android back gesture;\n // closing here still returns focus and tells the owner.\n const handleCancel = (e: Event) => {\n e.preventDefault();\n close();\n };\n\n // Registration and teardown both live in onMount: onCleanup also runs when an\n // SSR render is disposed, where `document` does not exist.\n onMount(() => {\n opener = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n openerRing = ringOnReturn(opener);\n // The native dialog would return focus with a ring of the browser's choosing.\n opener?.blur();\n dialogRef.showModal();\n document.addEventListener(\"keydown\", handleKeyDown);\n onCleanup(() => document.removeEventListener(\"keydown\", handleKeyDown));\n });\n\n return (\n <dialog\n ref={dialogRef}\n class=\"k2b-content-lightbox\"\n onMouseDown={handleBackdropClick}\n onCancel={handleCancel}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n aria-label={messages().imageLightbox}\n >\n {/* Top bar */}\n <div class=\"k2b-content-lightbox__bar\">\n <div class=\"k2b-content-lightbox__meta\">\n <Show when={isMultiple()}>\n <span class=\"k2b-content-lightbox__counter\" aria-live=\"polite\">\n {index() + 1} / {props.images.length}\n </span>\n </Show>\n <Show when={current()?.alt}>\n <div class=\"k2b-content-lightbox__caption\">\n <div class=\"k2b-content-lightbox__caption-text\">{current()?.alt}</div>\n </div>\n </Show>\n </div>\n\n <div class=\"k2b-content-lightbox__actions\">\n <Show when={current()?.downloadUrl}>\n <a href={current()!.downloadUrl} download=\"\" class=\"k2b-content-lightbox__button\" aria-label={messages().downloadImage}>\n <i class=\"ti ti-download\" aria-hidden=\"true\" />\n <span class=\"k2b-content-lightbox__button-label\">{messages().download}</span>\n </a>\n </Show>\n <button type=\"button\" onClick={close} class=\"k2b-content-lightbox__button\" aria-label={messages().closeLightbox}>\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n <span class=\"k2b-content-lightbox__button-label\">{messages().close}</span>\n </button>\n </div>\n </div>\n\n <div class=\"k2b-content-lightbox__stage\">\n <Show when={current()}>\n {(image) => <img src={image().src} alt={image().alt ?? \"\"} class=\"k2b-content-lightbox__image\" draggable={false} />}\n </Show>\n </div>\n\n <Show when={isMultiple()}>\n <button\n type=\"button\"\n onClick={prev}\n class=\"k2b-content-lightbox__nav\"\n data-direction=\"previous\"\n aria-label={messages().previousImage}\n >\n <i class=\"ti ti-chevron-left\" aria-hidden=\"true\" />\n </button>\n <button type=\"button\" onClick={next} class=\"k2b-content-lightbox__nav\" data-direction=\"next\" aria-label={messages().nextImage}>\n <i class=\"ti ti-chevron-right\" aria-hidden=\"true\" />\n </button>\n </Show>\n\n <Show when={isMultiple() && props.images.length <= 10}>\n <div class=\"k2b-content-lightbox__dots\" role=\"group\" aria-label={messages().imageNavigation}>\n <For each={props.images}>\n {(_, i) => (\n <button\n type=\"button\"\n onClick={() => setIndex(i())}\n class=\"k2b-content-lightbox__dot\"\n aria-current={index() === i() ? \"true\" : undefined}\n aria-label={messages().goToImage({ index: i() + 1 })}\n />\n )}\n </For>\n </div>\n </Show>\n </dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA,SAAS,YAAY,EAAE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AAC,CAAC,OAAI,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE;IAAA;IAAA;MAAA,4DACc,QAAQ,CAAC,CAAC,CAAC,eAAe,4CACxF,GAAG;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,MAAM;QAAA;QAAA,UACpB,CAAC,CAAC,EAAE,CAAC,mDAKY,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,YAAG,SAAS,wDACtC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;UAAE,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG;QAAE,CAAC,CAAC;MAEvD;IAAA;EAAA;AAMb","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":[],"sources":["content/Lightbox.tsx"],"sourcesContent":["import { createEffect, createSignal, For, onCleanup, onMount, Show } from \"solid-js\";\nimport { returnFocus, ringOnReturn } from \"../internal/focus-return\";\nimport { useUiMessages } from \"../intl/messages\";\n\n/** One more thing to do with the shown image, beside Download: a short label, its icon class, and what it does. */\nexport type LightboxAction = {\n label: string;\n icon: string;\n onClick: () => void;\n};\n\nexport type LightboxImage = {\n src: string;\n alt?: string;\n downloadUrl?: string;\n /** Actions for this image, shown before Download in the same style. */\n actions?: readonly LightboxAction[];\n};\n\ntype LightboxProps = {\n images: LightboxImage[];\n initialIndex?: number;\n onClose: () => void;\n};\n\n/**\n * Minimal, accessible lightbox using native <dialog>.\n * Supports keyboard navigation, touch swipe gestures, and screen readers.\n */\nexport default function Lightbox(props: LightboxProps) {\n const messages = useUiMessages();\n const clampIndex = (value: number, images = props.images): number =>\n images.length === 0 ? 0 : Math.max(0, Math.min(value, images.length - 1));\n const [index, setIndex] = createSignal(clampIndex(props.initialIndex ?? 0));\n let dialogRef!: HTMLDialogElement;\n let opener: HTMLElement | null = null;\n let openerRing = true;\n\n createEffect(\n (previous: { images: LightboxImage[]; initialIndex: number | undefined }) => {\n const images = props.images;\n const initialIndex = props.initialIndex;\n setIndex((currentIndex) => {\n if (initialIndex !== previous.initialIndex) return clampIndex(initialIndex ?? 0, images);\n const previousImage = previous.images[currentIndex];\n const retained = previousImage ? images.findIndex((image) => image === previousImage || image.src === previousImage.src) : -1;\n return retained >= 0 ? retained : clampIndex(currentIndex, images);\n });\n return { images, initialIndex };\n },\n { images: props.images, initialIndex: props.initialIndex },\n );\n\n // Touch gesture tracking\n let touchStartX = 0;\n let touchStartY = 0;\n const SWIPE_THRESHOLD = 50;\n\n const current = () => props.images[index()];\n const isMultiple = () => props.images.length > 1;\n const prev = () => {\n if (!isMultiple()) return;\n setIndex((i) => (i - 1 + props.images.length) % props.images.length);\n };\n const next = () => {\n if (!isMultiple()) return;\n setIndex((i) => (i + 1) % props.images.length);\n };\n\n const close = () => {\n dialogRef.close();\n returnFocus(opener, openerRing);\n props.onClose();\n };\n\n // A key belongs to the Lightbox while focus is inside it, or on the page with no other dialog open. A dialog opened\n // from one of its actions keeps its own keys: Escape closes that dialog, and arrows stay in its fields.\n const ownsKey = (target: EventTarget | null) =>\n target instanceof Node &&\n (dialogRef.contains(target) ||\n (target === document.body && Array.from(document.querySelectorAll(\"dialog[open]\")).every((dialog) => dialog === dialogRef)));\n\n // Keyboard navigation\n const handleKeyDown = (e: KeyboardEvent) => {\n if (!ownsKey(e.target)) return;\n switch (e.key) {\n case \"Escape\":\n // Handled here, so WebKit does not light the returned focus for this key.\n e.preventDefault();\n close();\n break;\n case \"ArrowLeft\":\n prev();\n break;\n case \"ArrowRight\":\n next();\n break;\n }\n };\n\n // Touch handlers for swipe gestures\n const handleTouchStart = (e: TouchEvent) => {\n const touch = e.touches[0];\n if (touch) {\n touchStartX = touch.clientX;\n touchStartY = touch.clientY;\n }\n };\n\n const handleTouchEnd = (e: TouchEvent) => {\n const touch = e.changedTouches[0];\n if (!touch) return;\n\n const deltaX = touch.clientX - touchStartX;\n const deltaY = touch.clientY - touchStartY;\n\n // Only trigger swipe if horizontal movement is dominant\n if (Math.abs(deltaX) > Math.abs(deltaY) && Math.abs(deltaX) > SWIPE_THRESHOLD) {\n if (deltaX > 0) {\n prev();\n } else {\n next();\n }\n }\n };\n\n // Click on backdrop closes lightbox\n const handleBackdropClick = (e: MouseEvent) => {\n if (e.target === dialogRef) {\n close();\n }\n };\n\n // The browser cancels the dialog itself, as on the Android back gesture;\n // closing here still returns focus and tells the owner.\n const handleCancel = (e: Event) => {\n e.preventDefault();\n close();\n };\n\n // Registration and teardown both live in onMount: onCleanup also runs when an\n // SSR render is disposed, where `document` does not exist.\n onMount(() => {\n opener = document.activeElement instanceof HTMLElement ? document.activeElement : null;\n openerRing = ringOnReturn(opener);\n // The native dialog would return focus with a ring of the browser's choosing.\n opener?.blur();\n dialogRef.showModal();\n document.addEventListener(\"keydown\", handleKeyDown);\n onCleanup(() => document.removeEventListener(\"keydown\", handleKeyDown));\n });\n\n return (\n <dialog\n ref={dialogRef}\n class=\"k2b-content-lightbox\"\n onMouseDown={handleBackdropClick}\n onCancel={handleCancel}\n onTouchStart={handleTouchStart}\n onTouchEnd={handleTouchEnd}\n aria-label={messages().imageLightbox}\n >\n {/* Top bar */}\n <div class=\"k2b-content-lightbox__bar\">\n <div class=\"k2b-content-lightbox__meta\">\n <Show when={isMultiple()}>\n <span class=\"k2b-content-lightbox__counter\" aria-live=\"polite\">\n {index() + 1} / {props.images.length}\n </span>\n </Show>\n <Show when={current()?.alt}>\n <div class=\"k2b-content-lightbox__caption\">\n <div class=\"k2b-content-lightbox__caption-text\">{current()?.alt}</div>\n </div>\n </Show>\n </div>\n\n <div class=\"k2b-content-lightbox__actions\">\n <For each={current()?.actions ?? []}>\n {(action) => (\n <button type=\"button\" onClick={() => action.onClick()} class=\"k2b-content-lightbox__button\" aria-label={action.label}>\n <i class={action.icon} aria-hidden=\"true\" />\n <span class=\"k2b-content-lightbox__button-label\">{action.label}</span>\n </button>\n )}\n </For>\n <Show when={current()?.downloadUrl}>\n <a href={current()!.downloadUrl} download=\"\" class=\"k2b-content-lightbox__button\" aria-label={messages().downloadImage}>\n <i class=\"ti ti-download\" aria-hidden=\"true\" />\n <span class=\"k2b-content-lightbox__button-label\">{messages().download}</span>\n </a>\n </Show>\n <button type=\"button\" onClick={close} class=\"k2b-content-lightbox__button\" aria-label={messages().closeLightbox}>\n <i class=\"ti ti-x\" aria-hidden=\"true\" />\n <span class=\"k2b-content-lightbox__button-label\">{messages().close}</span>\n </button>\n </div>\n </div>\n\n <div class=\"k2b-content-lightbox__stage\">\n <Show when={current()}>\n {(image) => <img src={image().src} alt={image().alt ?? \"\"} class=\"k2b-content-lightbox__image\" draggable={false} />}\n </Show>\n </div>\n\n <Show when={isMultiple()}>\n <button\n type=\"button\"\n onClick={prev}\n class=\"k2b-content-lightbox__nav\"\n data-direction=\"previous\"\n aria-label={messages().previousImage}\n >\n <i class=\"ti ti-chevron-left\" aria-hidden=\"true\" />\n </button>\n <button type=\"button\" onClick={next} class=\"k2b-content-lightbox__nav\" data-direction=\"next\" aria-label={messages().nextImage}>\n <i class=\"ti ti-chevron-right\" aria-hidden=\"true\" />\n </button>\n </Show>\n\n <Show when={isMultiple() && props.images.length <= 10}>\n <div class=\"k2b-content-lightbox__dots\" role=\"group\" aria-label={messages().imageNavigation}>\n <For each={props.images}>\n {(_, i) => (\n <button\n type=\"button\"\n onClick={() => setIndex(i())}\n class=\"k2b-content-lightbox__dot\"\n aria-current={index() === i() ? \"true\" : undefined}\n aria-label={messages().goToImage({ index: i() + 1 })}\n />\n )}\n </For>\n </div>\n </Show>\n </dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,SAAS,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,QAAQ,UAAU;AACpF,SAAS,WAAW,EAAE,YAAY,QAAQ,0BAA0B;AACpE,SAAS,aAAa,QAAQ,kBAAkB;;AAEhD;;AAqBA;AACA;AACA;AACA;AACA,eAAe,SAAS,QAAQ,CAAC,KAAoB,EAAE;EACrD,MAAM,QAAQ,GAAG,aAAa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,CAAC,CAAC,GAAG,iDAAO,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,EAAE;EAA0D,gCAItH,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,UAAU,CAAC,CAAC;IAAA;IAAA;MAAA,6DAMR,QAAQ,CAAC,CAAC,CAAC,aAAa,uEAImE,QAAQ,CAAC,CAAC,CAAC,SAAS;IAAA;EAAA,gCAK9H,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,yBAAU,CAAC,CAAC,OAAI,KAAK,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE;IAAA;IAAA;MAAA,4DACc,QAAQ,CAAC,CAAC,CAAC,eAAe,4CACxF,GAAG;QAAA,IAAC,IAAI;UAAA,OAAE,KAAK,CAAC,MAAM;QAAA;QAAA,UACpB,CAAC,CAAC,EAAE,CAAC,mDAKY,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,MAAM,YAAG,SAAS,wDACtC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;UAAE,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG;QAAE,CAAC,CAAC;MAEvD;IAAA;EAAA;AAMb","ignoreList":[]}
|
|
@@ -30,7 +30,7 @@ var _tmpl$ = ["<span", " style=\"", "\">", "</span>"],
|
|
|
30
30
|
_tmpl$22 = ["<div class=\"k2b-message-row__marker\"><i class=\"ti ti-pencil\" aria-hidden=\"true\"></i><span class=\"k2b-message-row__edited\">", "</span></div>"],
|
|
31
31
|
_tmpl$23 = ["<div class=\"k2b-message-row__media\" role=\"group\"", " style=\"", "\">", "</div>"],
|
|
32
32
|
_tmpl$24 = ["<div class=\"k2b-message-row__files\">", "</div>"],
|
|
33
|
-
_tmpl$25 = ["<div class=\"k2b-message-row__slot\">", "</div>"],
|
|
33
|
+
_tmpl$25 = ["<div class=\"k2b-message-row__slot\" data-gesture-ignore>", "</div>"],
|
|
34
34
|
_tmpl$26 = ["<div class=\"k2b-message-row__line\">", "</div>"],
|
|
35
35
|
_tmpl$27 = ["<div class=\"k2b-message-row__footer\">", "", "</div>"],
|
|
36
36
|
_tmpl$28 = ["<div class=\"k2b-message-row__actions\" role=\"group\"", ">", "</div>"],
|
|
@@ -252,7 +252,7 @@ const renderMessage = (text, locale, messages, edited) => {
|
|
|
252
252
|
renderer.code = token => {
|
|
253
253
|
const language = token.lang?.match(/^\S{1,24}/)?.[0];
|
|
254
254
|
const block = renderCode(token).replace(/^<pre>/, '<pre tabindex="0">');
|
|
255
|
-
return '<div class="k2b-message-row__code"><div class="k2b-message-row__code-bar">' + `<span class="k2b-message-row__code-label">${escapeHtml(language ?? messages.code)}</span>` + '<button type="button" class="k2b-message-row__copy">' + `<span class="k2b-message-row__copy-idle"><i class="ti ti-copy" aria-hidden="true"></i>${escapeHtml(messages.copy)}</span>` + `<span class="k2b-message-row__copy-done"><i class="ti ti-check" aria-hidden="true"></i>${escapeHtml(messages.copied)}</span>` + `</button></div>${block}</div>`;
|
|
255
|
+
return '<div class="k2b-message-row__code" data-gesture-ignore><div class="k2b-message-row__code-bar">' + `<span class="k2b-message-row__code-label">${escapeHtml(language ?? messages.code)}</span>` + '<button type="button" class="k2b-message-row__copy">' + `<span class="k2b-message-row__copy-idle"><i class="ti ti-copy" aria-hidden="true"></i>${escapeHtml(messages.copy)}</span>` + `<span class="k2b-message-row__copy-done"><i class="ti ti-check" aria-hidden="true"></i>${escapeHtml(messages.copied)}</span>` + `</button></div>${block}</div>`;
|
|
256
256
|
};
|
|
257
257
|
const marked = createSafeMarked(locale).setOptions({
|
|
258
258
|
breaks: true,
|
|
@@ -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 { 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 = (text: string, locale: string, messages: UiMessages, edited: boolean): { 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\"><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(messages.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 locale = useLocale();\n const textId = `k2b-message-${createUniqueId()}`;\n const [expanded, setExpanded] = createSignal(false);\n const rendered = createMemo(() => renderMessage(props.text, locale(), messages(), 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\">{messages().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\" ? [messages().messageVideo, item.duration].filter(Boolean).join(\" \") : \"\",\n more > 0 ? messages().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 messages().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>{messages().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 {messages().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() ? messages().messageShowLess : messages().messageShowMore}\n </Button>\n <Show when={props.edited}>\n <span class=\"k2b-message-row__edited\">{messages().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\">{messages().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={messages().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\">{props.linkPreview}</div>\n </Show>\n <Show when={content() && props.card}>\n <div class=\"k2b-message-row__slot\">{props.card}</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\">{messages().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 {messages().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={messages().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={messages().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>{messages().sending}</span>\n </Show>\n <Show when={props.status === \"failed\"}>\n <i class=\"ti ti-alert-circle\" aria-hidden=\"true\" />\n <span>{messages().messageNotSent}</span>\n <Show when={props.onRetry}>\n {(retry) => (\n <Button variant=\"text\" size=\"xs\" onClick={() => retry()()}>\n {messages().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\">{messages().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 {messages().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={messages().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,QAA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AAA;MAAA;IAAA;EAAA,gCAOZ,IAAI;IAAA,IAAC,IAAI;MAAA,OAAE,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC;IAAA;IAAA;MAAA,6DACqB,QAAQ,CAAC,CAAC,CAAC,cAAc,4CACrF,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":[]}
|
|
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 { 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 = (text: string, locale: string, messages: UiMessages, edited: boolean): { 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(messages.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 locale = useLocale();\n const textId = `k2b-message-${createUniqueId()}`;\n const [expanded, setExpanded] = createSignal(false);\n const rendered = createMemo(() => renderMessage(props.text, locale(), messages(), 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\">{messages().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\" ? [messages().messageVideo, item.duration].filter(Boolean).join(\" \") : \"\",\n more > 0 ? messages().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 messages().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>{messages().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 {messages().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() ? messages().messageShowLess : messages().messageShowMore}\n </Button>\n <Show when={props.edited}>\n <span class=\"k2b-message-row__edited\">{messages().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\">{messages().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={messages().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\">{messages().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 {messages().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={messages().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={messages().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>{messages().sending}</span>\n </Show>\n <Show when={props.status === \"failed\"}>\n <i class=\"ti ti-alert-circle\" aria-hidden=\"true\" />\n <span>{messages().messageNotSent}</span>\n <Show when={props.onRetry}>\n {(retry) => (\n <Button variant=\"text\" size=\"xs\" onClick={() => retry()()}>\n {messages().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\">{messages().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 {messages().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={messages().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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