@k2b/ui 0.35.0 → 0.37.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.
Files changed (87) hide show
  1. package/dist/browser/actions/Dropdown.js +132 -116
  2. package/dist/browser/actions/Dropdown.js.map +1 -1
  3. package/dist/browser/actions/Tabs.js +18 -15
  4. package/dist/browser/actions/Tabs.js.map +1 -1
  5. package/dist/browser/chat/ChatComposer.js +58 -25
  6. package/dist/browser/chat/ChatComposer.js.map +1 -1
  7. package/dist/browser/content/MapView.js +128 -13
  8. package/dist/browser/content/MapView.js.map +1 -1
  9. package/dist/browser/content/MapViewFrame.js +1 -1
  10. package/dist/browser/content/MapViewFrame.js.map +1 -1
  11. package/dist/browser/content/MessageRow.js +164 -152
  12. package/dist/browser/content/MessageRow.js.map +1 -1
  13. package/dist/browser/content/index.js +1 -0
  14. package/dist/browser/content/index.js.map +1 -1
  15. package/dist/browser/content/map-view-glyphs.js +23 -0
  16. package/dist/browser/content/map-view-glyphs.js.map +1 -0
  17. package/dist/browser/content/map-view-live.js +45 -22
  18. package/dist/browser/content/map-view-live.js.map +1 -1
  19. package/dist/browser/content/map-view-snapshot.js +191 -0
  20. package/dist/browser/content/map-view-snapshot.js.map +1 -0
  21. package/dist/browser/content/map-view-types.js.map +1 -1
  22. package/dist/browser/feedback/prompts.js +23 -9
  23. package/dist/browser/feedback/prompts.js.map +1 -1
  24. package/dist/browser/inputs/Combobox.js +164 -82
  25. package/dist/browser/inputs/Combobox.js.map +1 -1
  26. package/dist/browser/inputs/RichSelect.js +86 -67
  27. package/dist/browser/inputs/RichSelect.js.map +1 -1
  28. package/dist/browser/inputs/TextInput.js +1 -1
  29. package/dist/browser/inputs/TextInput.js.map +1 -1
  30. package/dist/browser/internal/keyed-for.js +47 -0
  31. package/dist/browser/internal/keyed-for.js.map +1 -0
  32. package/dist/browser/layout/AppWorkspace.js +73 -70
  33. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  34. package/dist/browser/layout/ScrollArea.js +4 -1
  35. package/dist/browser/layout/ScrollArea.js.map +1 -1
  36. package/dist/browser/text-editor/engine.js +13 -10
  37. package/dist/browser/text-editor/engine.js.map +1 -1
  38. package/dist/ssr/actions/Dropdown.js +101 -85
  39. package/dist/ssr/actions/Dropdown.js.map +1 -1
  40. package/dist/ssr/actions/Tabs.js +12 -9
  41. package/dist/ssr/actions/Tabs.js.map +1 -1
  42. package/dist/ssr/chat/ChatComposer.js +41 -15
  43. package/dist/ssr/chat/ChatComposer.js.map +1 -1
  44. package/dist/ssr/content/MapView.js +128 -13
  45. package/dist/ssr/content/MapView.js.map +1 -1
  46. package/dist/ssr/content/MapViewFrame.js +1 -1
  47. package/dist/ssr/content/MapViewFrame.js.map +1 -1
  48. package/dist/ssr/content/MessageRow.js +9 -2
  49. package/dist/ssr/content/MessageRow.js.map +1 -1
  50. package/dist/ssr/content/index.js +1 -0
  51. package/dist/ssr/content/index.js.map +1 -1
  52. package/dist/ssr/content/map-view-glyphs.js +23 -0
  53. package/dist/ssr/content/map-view-glyphs.js.map +1 -0
  54. package/dist/ssr/content/map-view-snapshot.js +191 -0
  55. package/dist/ssr/content/map-view-snapshot.js.map +1 -0
  56. package/dist/ssr/content/map-view-types.js.map +1 -1
  57. package/dist/ssr/feedback/prompts.js +22 -8
  58. package/dist/ssr/feedback/prompts.js.map +1 -1
  59. package/dist/ssr/inputs/Combobox.js +79 -28
  60. package/dist/ssr/inputs/Combobox.js.map +1 -1
  61. package/dist/ssr/inputs/RichSelect.js +47 -28
  62. package/dist/ssr/inputs/RichSelect.js.map +1 -1
  63. package/dist/ssr/inputs/TextInput.js.map +1 -1
  64. package/dist/ssr/internal/keyed-for.js +47 -0
  65. package/dist/ssr/internal/keyed-for.js.map +1 -0
  66. package/dist/ssr/layout/AppWorkspace.js +1 -1
  67. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  68. package/dist/ssr/layout/ScrollArea.js +4 -1
  69. package/dist/ssr/layout/ScrollArea.js.map +1 -1
  70. package/dist/ssr/text-editor/engine.js +13 -10
  71. package/dist/ssr/text-editor/engine.js.map +1 -1
  72. package/dist/styles.css +1 -1
  73. package/dist/types/content/MapViewFrame.d.ts +1 -1
  74. package/dist/types/content/MessageRow.d.ts +1 -1
  75. package/dist/types/content/index.d.ts +2 -1
  76. package/dist/types/content/map-view-glyphs.d.ts +5 -0
  77. package/dist/types/content/map-view-live.d.ts +1 -1
  78. package/dist/types/content/map-view-snapshot.d.ts +13 -0
  79. package/dist/types/content/map-view-types.d.ts +15 -0
  80. package/dist/types/feedback/prompts.d.ts +5 -0
  81. package/dist/types/inputs/Combobox.d.ts +12 -0
  82. package/dist/types/inputs/TextInput.d.ts +2 -1
  83. package/dist/types/internal/keyed-for.d.ts +13 -0
  84. package/dist/types/layout/AppWorkspace.d.ts +4 -1
  85. package/dist/types/layout/ScrollArea.d.ts +2 -0
  86. package/dist/types/text-editor/engine.d.ts +1 -1
  87. package/package.json +4 -2
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["content/MessageRow.tsx"],"sourcesContent":["import { fileIcons } from \"@k2b/stdlib\";\nimport type { Token, Tokens } from \"marked\";\nimport { createMemo, createSignal, createUniqueId, For, type JSX, onCleanup, Show } from \"solid-js\";\nimport { Button } from \"../actions/Button\";\nimport { copyText } from \"../actions/CopyButton\";\nimport { Dropdown, type DropdownAction } from \"../actions/Dropdown\";\nimport { type GestureKind, GestureMenu, type GestureMenuAction } from \"../actions/GestureMenu\";\nimport { type ChatMessages, useChatMessages } from \"../chat/chat-messages\";\nimport { announce } from \"../feedback/announce\";\nimport { useLocale } from \"../intl/locale\";\nimport { type UiMessages, useUiMessages } from \"../intl/messages\";\nimport { Avatar } from \"../surfaces/Avatar\";\nimport { Kbd } from \"./Kbd\";\nimport { createSafeMarked, createSafeRenderer, escapeHtml } from \"./MarkdownView\";\nimport { ReactionBar, type ReactionBarItem } from \"./ReactionBar\";\n\n/** Messages by the same author within this time continue a group. */\nconst GROUP_WINDOW_MS = 5 * 60_000;\n/**\n * A message collapses to ten lines (`.k2b-message-row__text[data-collapsed]`) when its rendered text takes more lines\n * than this. `renderedLines` counts the fewest lines the text takes at any width, so a collapsed message always hides\n * some of it.\n */\nconst COLLAPSE_LINES = 14;\n/** Visible characters that take at least one line of a message, even at its widest. */\nconst LINE_CHARS = 100;\n/** Lines at the bottom of a collapsed message that fade out, as `.k2b-message-row__text[data-collapsed]` draws them. */\nconst FADE_LINES = 2;\nconst COPIED_MS = 2_000;\n/** Alt+click on these keeps its own meaning, such as downloading a link. */\nconst ALT_CLICK_IGNORE = \"a[href], button, input, textarea, select, summary, label, audio, video, [role='button'], [role='link']\";\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 /** Visible name of the menu entry. */\n label: string;\n /** Icon class, for example `ti ti-arrow-back-up`. */\n icon: string;\n /** One quiet sentence below the label that says what the entry does. */\n description?: string;\n onSelect: () => void;\n disabled?: boolean;\n variant?: \"danger\";\n /** A touch gesture that runs the entry too. Give each gesture to at most one entry. */\n gesture?: GestureKind;\n /**\n * Alt+click (Option+click on Apple devices) on the message runs the entry directly, and the entry shows that\n * shortcut. Give it to at most one entry.\n */\n altClick?: boolean;\n /** A key the application handles for the focused message, such as \"r\"; the entry shows it at its end. */\n shortcut?: string;\n /** In the phone sheet, runs while the tap still counts as the person's gesture, as clipboard writes require. */\n immediate?: boolean;\n};\n\nexport type MessageRowQuote = {\n /** Name of the quoted message's author. */\n author: string;\n /** Plain text of the quoted message. It shows at most two lines. */\n text: string;\n /** Opens the quoted message, for example by scrolling to it. Without it, the quote is not a control. */\n onSelect?: () => void;\n};\n\n/** Reaction labels are read by screen readers and shown in the names hint. */\nexport type MessageRowReaction = ReactionBarItem;\n\nexport type MessageRowThread = {\n /** Number of replies. */\n count: number;\n /** People who replied, most recent first; the bar shows up to three. */\n participants?: readonly MessageRowAuthor[];\n /** Visible time of the last reply, formatted by the caller. */\n lastReply?: string;\n lastReplyDateTime?: string | Date;\n onOpen: () => void;\n};\n\ntype MessageRowAttachmentTarget = {\n /** Opens the attachment, for example in a lightbox. Takes precedence over `href`. */\n onOpen?: () => void;\n /** Opens the attachment in a new tab. Absolute `https` or `http`, or relative. */\n href?: string;\n};\n\nexport type MessageRowMedia = MessageRowAttachmentTarget & {\n kind: \"image\" | \"video\";\n /** The image, or the poster frame of a video. Absolute `https` or `http`, relative, `blob`, or `data:image/`. */\n src: string;\n /** Describes the image or video for people who cannot see it. */\n alt: string;\n /** Stored pixel size. The row reserves the area from it, so nothing moves when the image loads. */\n width: number;\n height: number;\n /** Visible length of a video, for example \"0:42\". */\n duration?: string;\n};\n\nexport type MessageRowFile = MessageRowAttachmentTarget & {\n kind: \"file\";\n name: string;\n /** Second line, for example \"PDF · 412 KB\". */\n detail?: string;\n /** Media type, used with the name to choose the icon. */\n mediaType?: string;\n /** Icon class instead of the one chosen from the name. */\n icon?: string;\n};\n\nexport type MessageRowAttachment = MessageRowMedia | MessageRowFile;\n\n/** Where a message belongs, shown as a small chip under it, for example its thread in a timeline of several. */\nexport type MessageRowOrigin = {\n label: string;\n /** Icon class, for example `ti ti-hash`. */\n icon?: string;\n /** Opens where the message belongs. Without it, the chip is not a control. */\n onSelect?: () => void;\n /** Accessible name of the control when it must say more than the label, such as \"Open thread Updates\". */\n selectLabel?: string;\n};\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 /** Called by \"Discard\" next to \"Retry\" while `status` is `\"failed\"`, so both answers to a failure sit where it shows. */\n onDiscard?: () => void;\n /**\n * The message's menu. A quiet \"…\" beside the bubble opens it while the message is hovered or focused, also from the\n * keyboard; right-click and a long press open the same menu. Showing \"…\" never moves the layout.\n */\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 /** A chip of fixed height under the message that names where it belongs. */\n origin?: MessageRowOrigin;\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 MessageEventRowProps = {\n /** What changed, for example \"Mara set the status to “In review”\". */\n children: JSX.Element;\n /** Icon class of the kind of change; a dot by default. */\n icon?: string;\n /** Where the change belongs, such as its thread, where several threads mix. */\n origin?: MessageRowOrigin;\n /** Opens what the change is about, such as the commented passage; the sentence becomes the link. */\n href?: string;\n /** Visible time, formatted by the caller. */\n time?: string;\n dateTime?: string | Date;\n class?: string;\n};\n\nexport type MessageEventGroupProps = {\n /** What the closed group stands for, for example \"4 changes to Invitation and Light test\". */\n label: string;\n expanded: boolean;\n onToggle: () => void;\n /** Visible time or range, formatted by the caller, for example \"09:50–09:58\". */\n time?: string;\n /** The first event's time. */\n dateTime?: string | Date;\n class?: string;\n};\n\nexport type MessageGroupEntry = {\n /** Stable identity of the author. */\n author: string;\n at: Date | number | string;\n /** System rows never belong to a group. */\n system?: boolean;\n};\n\nconst timestamp = (value: Date | number | string) => (value instanceof Date ? value.getTime() : new Date(value).getTime());\n\n/**\n * Whether a message starts a new group: there is no previous message, either is a system row, the author changes, or\n * more than five minutes passed. Also start a group where you show a separator such as a new day.\n */\nexport const startsMessageGroup = (entry: MessageGroupEntry, previous?: MessageGroupEntry | null): boolean => {\n if (!previous || entry.system || previous.system || entry.author !== previous.author) return true;\n const gap = timestamp(entry.at) - timestamp(previous.at);\n return !(gap >= 0 && gap <= GROUP_WINDOW_MS);\n};\n\n/** Text that wraps: every `LINE_CHARS` visible characters of a line take at least one line. */\nconst wrappedLines = (text: string): number =>\n text.split(\"\\n\").reduce((lines, line) => lines + Math.ceil(line.trim().length / LINE_CHARS), 0);\n\n/** What inline tokens show: a link its label, never its destination. */\nconst inlineText = (tokens: readonly Token[]): string => {\n let text = \"\";\n for (const token of tokens) {\n if (token.type === \"br\") text += \"\\n\";\n else if (\"tokens\" in token && token.tokens) text += inlineText(token.tokens);\n else if (\"text\" in token) text += token.text;\n }\n return text;\n};\n\n/**\n * The fewest lines the rendered tokens take at any width. Code never wraps, so each of its lines is one line, blank\n * ones too, and its bar one more. Link destinations and reference definitions show nothing. Decided from the text\n * alone, so the row has its final height when it mounts.\n */\nconst renderedLines = (tokens: readonly Token[]): number => {\n let lines = 0;\n for (const token of tokens) {\n switch (token.type) {\n case \"code\":\n lines += token.text.split(\"\\n\").length + 1;\n break;\n case \"list\":\n for (const item of token.items) lines += Math.max(1, renderedLines(item.tokens));\n break;\n case \"table\":\n lines += token.rows.length + (token.header.some((cell: Tokens.TableCell) => cell.text.trim()) ? 1 : 0);\n break;\n case \"paragraph\":\n case \"heading\":\n case \"text\":\n lines += wrappedLines(token.tokens ? inlineText(token.tokens) : token.text);\n break;\n case \"hr\":\n lines += 1;\n break;\n case \"space\":\n case \"def\":\n break;\n default:\n if (\"tokens\" in token && token.tokens) lines += renderedLines(token.tokens);\n else if (\"text\" in token) lines += wrappedLines(token.text);\n }\n }\n return lines;\n};\n\n/** Messages link only to absolute URLs; a relative one would lead somewhere else on every page that shows it. */\nconst isAbsoluteUrl = (href: string): boolean => {\n try {\n return new URL(href).protocol !== \"\";\n } catch {\n return false;\n }\n};\n\nconst dateTimeOf = (value: string | Date | undefined): string | undefined => {\n if (value === undefined) return undefined;\n const date = value instanceof Date ? value : new Date(value);\n return Number.isFinite(date.getTime()) ? date.toISOString() : undefined;\n};\n\n/**\n * An attachment URL the row may load or open: absolute with an allowed scheme, or relative to the page. A picture may\n * also be a `blob:` URL or a `data:image/` URL, which an image element shows without running anything.\n */\nconst attachmentUrl = (url: string | undefined, picture = false): string | undefined => {\n if (!url) return undefined;\n if (picture && /^data:image\\//i.test(url)) return url;\n try {\n return (picture ? PICTURE_PROTOCOLS : ATTACHMENT_PROTOCOLS).has(new URL(url, \"https://relative.invalid/\").protocol) ? url : undefined;\n } catch {\n return undefined;\n }\n};\n\n/** The aspect ratio a single image or video reserves, from its stored size. */\nconst mediaRatio = (media: MessageRowMedia): number => {\n const ratio = media.width > 0 && media.height > 0 ? media.width / media.height : 4 / 3;\n return Math.min(MEDIA_RATIO_MAX, Math.max(MEDIA_RATIO_MIN, ratio));\n};\n\n/** The width of a single image or video: its stored width, at most the row's media height tall, never wider than the row. */\nconst mediaWidth = (media: MessageRowMedia): string => {\n const natural = Number.isFinite(media.width) && media.width > 0 ? `${media.width}px, ` : \"\";\n return `min(100%, ${natural}calc(var(--k2b-message-media-height) * ${mediaRatio(media)}))`;\n};\n\n/** Only the `ti-*` glyph of `fileIcons`, which may add colour utilities that `@k2b/ui` does not ship. */\nconst fileIcon = (file: MessageRowFile): string =>\n file.icon ??\n `ti ${fileIcons\n .getFileIcon({ name: file.name, type: \"file\", mimeType: file.mediaType })\n .split(/\\s+/)\n .filter((token) => token.startsWith(\"ti-\"))\n .join(\" \")}`;\n\n/** A link, a button, or neither, depending on what the caller passes. */\nfunction AttachmentTarget(\n props: MessageRowAttachmentTarget & {\n class: string;\n style?: JSX.CSSProperties;\n /** Names a picture; without a link or button around it, the element becomes the image. */\n label?: string;\n children: JSX.Element;\n },\n): JSX.Element {\n return (\n <Show\n when={props.onOpen}\n fallback={\n <Show\n when={attachmentUrl(props.href)}\n fallback={\n <Show\n when={props.label}\n fallback={\n <span class={props.class} style={props.style}>\n {props.children}\n </span>\n }\n >\n {(label) => (\n <span class={props.class} style={props.style} role=\"img\" aria-label={label()}>\n {props.children}\n </span>\n )}\n </Show>\n }\n >\n {(href) => (\n <a class={props.class} style={props.style} href={href()} target=\"_blank\" rel=\"noopener noreferrer\" aria-label={props.label}>\n {props.children}\n </a>\n )}\n </Show>\n }\n >\n {(open) => (\n <button type=\"button\" class={props.class} style={props.style} aria-label={props.label} onClick={() => open()()}>\n {props.children}\n </button>\n )}\n </Show>\n );\n}\n\n/**\n * Renders the safe Markdown of `MarkdownView` with line breaks kept, absolute links only, and a copy control above\n * every code block, and counts the fewest lines it takes. An edited message that does not collapse ends with the marker.\n */\nconst renderMessage = (\n text: string,\n locale: string,\n messages: UiMessages,\n chatMessages: ChatMessages,\n edited: boolean,\n): { html: string; lines: number } => {\n const renderer = createSafeRenderer({ allowImages: false, linkProtocols: LINK_PROTOCOLS, linkTarget: \"_blank\", locale });\n const renderLink = renderer.link.bind(renderer);\n renderer.link = (token: Tokens.Link) => (isAbsoluteUrl(token.href) ? renderLink(token) : renderer.parser.parseInline(token.tokens));\n const renderCode = renderer.code.bind(renderer);\n renderer.code = (token: Tokens.Code) => {\n const language = token.lang?.match(/^\\S{1,24}/)?.[0];\n const block = renderCode(token).replace(/^<pre>/, '<pre tabindex=\"0\">');\n return (\n '<div class=\"k2b-message-row__code\" data-gesture-ignore><div class=\"k2b-message-row__code-bar\">' +\n `<span class=\"k2b-message-row__code-label\">${escapeHtml(language ?? messages.code)}</span>` +\n '<button type=\"button\" class=\"k2b-message-row__copy\">' +\n `<span class=\"k2b-message-row__copy-idle\"><i class=\"ti ti-copy\" aria-hidden=\"true\"></i>${escapeHtml(messages.copy)}</span>` +\n `<span class=\"k2b-message-row__copy-done\"><i class=\"ti ti-check\" aria-hidden=\"true\"></i>${escapeHtml(messages.copied)}</span>` +\n `</button></div>${block}</div>`\n );\n };\n const marked = createSafeMarked(locale).setOptions({ breaks: true, renderer });\n const tokens = marked.lexer(text);\n const html = marked.parser(tokens);\n const lines = renderedLines(tokens);\n // A collapsed message would hide the end of its text, so its marker sits next to \"Show more\" instead.\n if (!edited || lines > COLLAPSE_LINES) return { html, lines };\n // The marker ends the last paragraph, so it takes no line of its own there.\n const marker = `<span class=\"k2b-message-row__edited\">${escapeHtml(chatMessages.messageEdited)}</span>`;\n const end = html.trimEnd();\n return { html: end.endsWith(\"</p>\") ? `${end.slice(0, -4)} ${marker}</p>` : `${html}<p>${marker}</p>`, lines };\n};\n\n/**\n * One message in a conversation with many people: own messages on the right, others on the left with avatar, name,\n * and time at the start of a group. Every part has its final height when the row mounts, so a virtualized list such\n * as `VirtualFeed` keeps its positions.\n */\nexport function MessageRow(props: MessageRowProps): JSX.Element {\n const messages = useUiMessages();\n const chatMessages = useChatMessages();\n const locale = useLocale();\n const textId = `k2b-message-${createUniqueId()}`;\n const [expanded, setExpanded] = createSignal(false);\n const rendered = createMemo(() => renderMessage(props.text, locale(), messages(), chatMessages(), Boolean(props.edited)));\n const collapsible = () => rendered().lines > COLLAPSE_LINES;\n const collapsed = () => collapsible() && !expanded();\n const groupStart = () => props.groupStart ?? true;\n const hasLine = () => props.progress !== undefined || props.status !== undefined || props.receipt !== undefined;\n const reactions = () => (props.deleted ? undefined : props.reactions);\n const hasFooter = () => hasLine() || reactions() !== undefined;\n const writing = () => props.progress !== undefined && !props.deleted && props.text.trim() === \"\";\n const hasBubble = () => props.deleted || writing() || props.text.trim() !== \"\";\n const content = () => !props.deleted;\n const media = createMemo(() =>\n content() ? (props.attachments ?? []).filter((attachment): attachment is MessageRowMedia => attachment.kind !== \"file\") : [],\n );\n const files = createMemo(() =>\n content() ? (props.attachments ?? []).filter((attachment): attachment is MessageRowFile => attachment.kind === \"file\") : [],\n );\n const shownMedia = () => media().slice(0, MEDIA_SHOWN);\n const hiddenMedia = () => media().length - shownMedia().length;\n let text: HTMLDivElement | undefined;\n let copiedTimer: ReturnType<typeof setTimeout> | undefined;\n\n onCleanup(() => clearTimeout(copiedTimer));\n\n const copyCode = (event: MouseEvent) => {\n const button = (event.target as Element | null)?.closest?.<HTMLButtonElement>(\".k2b-message-row__copy\");\n if (!button || !text?.contains(button)) return;\n const code = button.closest(\".k2b-message-row__code\")?.querySelector(\"pre\")?.textContent ?? \"\";\n copyText(code).then(\n () => {\n for (const other of text?.querySelectorAll<HTMLElement>(\".k2b-message-row__copy[data-copied]\") ?? []) delete other.dataset.copied;\n button.dataset.copied = \"\";\n announce(messages().copied);\n clearTimeout(copiedTimer);\n copiedTimer = setTimeout(() => delete button.dataset.copied, COPIED_MS);\n },\n () => {},\n );\n };\n\n // A keyboard user who reaches a link or code block in the hidden or faded part of a collapsed message gets the whole\n // message. The collapsed text clips instead of scrolling, so the browser cannot scroll it to the target instead.\n const revealFocus = (event: FocusEvent) => {\n if (!text || !collapsed() || !(event.target instanceof Element)) return;\n const fade = text.getBoundingClientRect().bottom - FADE_LINES * Number.parseFloat(getComputedStyle(text).lineHeight);\n if (event.target.getBoundingClientRect().bottom > fade) setExpanded(true);\n };\n\n // The same entries serve \"…\", right-click, the keyboard, and a long press. Alt+click and keys show at the entry's end.\n // Each menu gets its own entries: a rendered shortcut is a DOM node and can live in only one menu.\n const entries = () =>\n (props.actions ?? []).map((entry): GestureMenuAction & Pick<Extract<DropdownAction, { action: () => void }>, \"immediate\"> => ({\n label: entry.label,\n icon: entry.icon,\n description: entry.description,\n disabled: entry.disabled,\n variant: entry.variant,\n gesture: entry.gesture,\n immediate: entry.immediate,\n trailing: entry.altClick ? <Kbd keys=\"alt+click\" /> : entry.shortcut ? <Kbd keys={entry.shortcut} /> : undefined,\n action: () => entry.onSelect(),\n }));\n const menuItems = createMemo(entries);\n const gestureItems = createMemo(entries);\n const hasMenu = () => (props.actions?.length ?? 0) > 0;\n\n // Alt+click (Option+click) on the message, not on a link or control inside it, runs the entry that asks for it.\n const altClick = (event: MouseEvent) => {\n if (!event.altKey || event.button !== 0 || event.ctrlKey || event.metaKey || event.shiftKey) return;\n const entry = props.actions?.find((action) => action.altClick && !action.disabled);\n const target = event.target instanceof Element ? event.target : null;\n if (!entry || target?.closest(ALT_CLICK_IGNORE)) return;\n event.preventDefault();\n entry.onSelect();\n };\n\n const more = () => (\n <Dropdown.Root\n items={menuItems()}\n label={chatMessages().messageActions}\n class=\"k2b-message-row__menu-root\"\n position={props.own ? \"bottom-right\" : \"bottom-left\"}\n phone=\"sheet\"\n >\n <Dropdown.Trigger iconOnly variant=\"ghost\" size=\"sm\" label={chatMessages().messageActions} class=\"k2b-message-row__menu\">\n <i class=\"ti ti-dots\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\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 <span class=\"k2b-message-row__quote-author\">\n <span class=\"k2b-sr-only\">{chatMessages().messageReplyTo} </span>\n {value.author}\n </span>\n <span class=\"k2b-message-row__quote-text\">{value.text}</span>\n </>\n );\n\n /** The answered message on a quiet tint at the top of the bubble, or in its place without one. */\n const quoteBlock = () => (\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 );\n\n /** The picture's description, then that it is a video and how long, then how many more the grid hides. */\n const mediaLabel = (item: MessageRowMedia, more: number) =>\n [\n item.alt,\n item.kind === \"video\" ? [chatMessages().messageVideo, item.duration].filter(Boolean).join(\" \") : \"\",\n more > 0 ? chatMessages().messageMoreAttachments({ count: more }) : \"\",\n ]\n .filter(Boolean)\n .join(\", \");\n\n const mediaItem = (item: MessageRowMedia, index: () => number) => {\n const more = () => (index() === shownMedia().length - 1 ? hiddenMedia() : 0);\n return (\n <AttachmentTarget\n class=\"k2b-message-row__media-item\"\n style={media().length === 1 ? { \"aspect-ratio\": String(mediaRatio(item)) } : undefined}\n label={mediaLabel(item, more())}\n onOpen={item.onOpen}\n href={item.href}\n >\n <img\n src={attachmentUrl(item.src, true)}\n alt=\"\"\n width={item.width > 0 ? item.width : undefined}\n height={item.height > 0 ? item.height : undefined}\n loading=\"lazy\"\n decoding=\"async\"\n />\n <Show when={item.kind === \"video\"}>\n <span class=\"k2b-message-row__media-play\" aria-hidden=\"true\">\n <i class=\"ti ti-player-play\" />\n </span>\n <Show when={item.duration}>\n <span class=\"k2b-message-row__media-duration\" aria-hidden=\"true\">\n {item.duration}\n </span>\n </Show>\n </Show>\n <Show when={more() > 0}>\n <span class=\"k2b-message-row__media-more\" aria-hidden=\"true\">\n +{more()}\n </span>\n </Show>\n </AttachmentTarget>\n );\n };\n\n const row = (\n // biome-ignore lint/a11y/noStaticElementInteractions lint/a11y/useKeyWithClickEvents: Alt+click is a pointer shortcut for a menu entry that the keyboard reaches through \"…\".\n <div\n class={props.class ? `k2b-message-row ${props.class}` : \"k2b-message-row\"}\n onClick={altClick}\n data-own={props.own ? \"\" : undefined}\n data-group-start={groupStart() ? \"\" : undefined}\n data-status={props.status}\n data-media={media().length > 0 ? \"\" : undefined}\n >\n <Show when={!props.own}>\n <div class=\"k2b-message-row__gutter\">\n <Show when={groupStart()}>\n <span class=\"k2b-message-row__avatar\" aria-hidden=\"true\">\n <Avatar name={props.author.name} src={props.author.avatar} icon={props.author.icon} size=\"sm\" />\n </span>\n </Show>\n </div>\n </Show>\n <div class=\"k2b-message-row__body\">\n <Show\n when={groupStart()}\n fallback={\n <span class=\"k2b-sr-only\">\n {props.author.name}, {props.time}:{\" \"}\n </span>\n }\n >\n <Show\n when={!props.own}\n fallback={\n <div class=\"k2b-message-row__meta\">\n <span class=\"k2b-sr-only\">{props.author.name}, </span>\n <time class=\"k2b-message-row__time\" datetime={dateTimeOf(props.dateTime)}>\n {props.time}\n </time>\n </div>\n }\n >\n <div class=\"k2b-message-row__meta\">{header()}</div>\n </Show>\n </Show>\n <Show when={content() && props.forwarded}>\n <div class=\"k2b-message-row__marker\">\n <i class=\"ti ti-arrow-forward-up\" aria-hidden=\"true\" />\n <span>{chatMessages().messageForwarded}</span>\n </div>\n </Show>\n <Show when={!hasBubble()}>{quoteBlock()}</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 {quoteBlock()}\n <Show\n when={!props.deleted}\n fallback={\n <span class=\"k2b-message-row__deleted\">\n <i class=\"ti ti-message-off\" aria-hidden=\"true\" />\n {chatMessages().messageDeleted}\n </span>\n }\n >\n <Show\n when={!writing()}\n fallback={\n <span class=\"k2b-message-row__writing\">\n <span class=\"k2b-chat-progress-dots\" aria-hidden=\"true\">\n <span />\n <span />\n <span />\n </span>\n </span>\n }\n >\n {/* biome-ignore lint/a11y/noStaticElementInteractions lint/a11y/useKeyWithClickEvents: the native copy buttons inside the rendered Markdown are the targets; their clicks, including from the keyboard, bubble here. */}\n <div\n ref={text}\n id={textId}\n class=\"k2b-content-markdown k2b-message-row__text\"\n data-heading-scale=\"compact\"\n data-collapsed={collapsed() ? \"\" : undefined}\n onClick={copyCode}\n onFocusIn={revealFocus}\n innerHTML={rendered().html}\n />\n <Show when={collapsible()}>\n <div class=\"k2b-message-row__more-line\">\n <Button\n variant=\"text\"\n size=\"xs\"\n class=\"k2b-message-row__more\"\n aria-expanded={expanded() ? \"true\" : \"false\"}\n aria-controls={textId}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? chatMessages().messageShowLess : chatMessages().messageShowMore}\n </Button>\n <Show when={props.edited}>\n <span class=\"k2b-message-row__edited\">{chatMessages().messageEdited}</span>\n </Show>\n </div>\n </Show>\n </Show>\n </Show>\n <Show when={hasMenu()}>{more()}</Show>\n </div>\n </Show>\n <Show when={hasMenu() && !hasBubble()}>{more()}</Show>\n {/* Without a bubble to end, the edit marker takes the bubble's place. */}\n <Show when={content() && props.edited && !hasBubble()}>\n <div class=\"k2b-message-row__marker\">\n <i class=\"ti ti-pencil\" aria-hidden=\"true\" />\n <span class=\"k2b-message-row__edited\">{chatMessages().messageEdited}</span>\n </div>\n </Show>\n <Show when={media().length > 0}>\n <div\n class=\"k2b-message-row__media\"\n role=\"group\"\n aria-label={chatMessages().attachments}\n data-count={Math.min(media().length, MEDIA_SHOWN)}\n style={media().length === 1 ? { width: mediaWidth(media()[0]!) } : undefined}\n >\n <For each={shownMedia()}>{(item, index) => mediaItem(item, index)}</For>\n </div>\n </Show>\n <Show when={files().length > 0}>\n <div class=\"k2b-message-row__files\">\n <For each={files()}>\n {(file) => (\n <AttachmentTarget class=\"k2b-message-row__file\" onOpen={file.onOpen} href={file.href}>\n <span class=\"k2b-message-row__file-icon\" aria-hidden=\"true\">\n <i class={fileIcon(file)} />\n </span>\n <span class=\"k2b-message-row__file-copy\">\n <span class=\"k2b-message-row__file-name\">{file.name}</span>\n <Show when={file.detail}>\n <span class=\"k2b-message-row__file-detail\">{file.detail}</span>\n </Show>\n </span>\n </AttachmentTarget>\n )}\n </For>\n </div>\n </Show>\n <Show when={content() && props.linkPreview}>\n <div class=\"k2b-message-row__slot\" data-gesture-ignore>\n {props.linkPreview}\n </div>\n </Show>\n <Show when={content() && props.card}>\n <div class=\"k2b-message-row__slot\" data-gesture-ignore>\n {props.card}\n </div>\n </Show>\n <Show when={props.thread}>\n {(thread) => (\n <button type=\"button\" class=\"k2b-message-row__thread\" onClick={() => thread().onOpen()}>\n <Show when={(thread().participants?.length ?? 0) > 0}>\n <span class=\"k2b-message-row__thread-people\" aria-hidden=\"true\">\n <For each={thread().participants?.slice(0, 3)}>\n {(person) => <Avatar name={person.name} src={person.avatar} icon={person.icon} size=\"xs\" />}\n </For>\n </span>\n </Show>\n <span class=\"k2b-message-row__thread-count\">{chatMessages().messageReplies({ count: thread().count })}</span>\n <Show when={thread().lastReply}>\n {(time) => (\n <time class=\"k2b-message-row__thread-time\" datetime={dateTimeOf(thread().lastReplyDateTime)}>\n {chatMessages().messageLastReply({ time: time() })}\n </time>\n )}\n </Show>\n </button>\n )}\n </Show>\n <Show when={props.origin}>{(origin) => <OriginChip origin={origin()} />}</Show>\n <Show when={hasFooter()}>\n <div class=\"k2b-message-row__footer\">\n <Show when={reactions()}>\n {(list) => <ReactionBar reactions={list()} onToggle={props.onToggleReaction} onAdd={props.onAddReaction} />}\n </Show>\n <Show when={hasLine()}>\n <div class=\"k2b-message-row__line\">\n <Show\n when={props.progress}\n fallback={\n <>\n <Show when={props.status === \"pending\"}>\n <i class=\"ti ti-clock\" aria-hidden=\"true\" />\n <span>{chatMessages().sending}</span>\n </Show>\n <Show when={props.status === \"failed\"}>\n <i class=\"ti ti-alert-circle\" aria-hidden=\"true\" />\n <span>{chatMessages().messageNotSent}</span>\n <Show when={props.onRetry}>\n {(retry) => (\n <Button variant=\"text\" size=\"xs\" onClick={() => retry()()}>\n {chatMessages().messageRetry}\n </Button>\n )}\n </Show>\n <Show when={props.onDiscard}>\n {(discard) => (\n <Button variant=\"text\" size=\"xs\" onClick={() => discard()()}>\n {chatMessages().messageDiscard}\n </Button>\n )}\n </Show>\n </Show>\n <Show when={props.status !== \"pending\" && props.status !== \"failed\"}>\n <Show\n when={props.receipt}\n fallback={\n <Show when={props.status === \"sent\"}>\n <i class=\"ti ti-check\" aria-hidden=\"true\" />\n <span class=\"k2b-sr-only\">{chatMessages().messageSent}</span>\n </Show>\n }\n >\n {(receipt) => (\n <>\n <i class=\"ti ti-checks\" aria-hidden=\"true\" />\n <span class=\"k2b-message-row__receipt\">{receipt()}</span>\n </>\n )}\n </Show>\n </Show>\n </>\n }\n >\n {(progress) => (\n <>\n <i class=\"ti ti-loader-2 k2b-spin\" aria-hidden=\"true\" />\n <span class=\"k2b-message-row__line-text\">{progress().status}</span>\n <Show when={progress().onStop}>\n {(stop) => (\n <Button variant=\"text\" size=\"xs\" onClick={() => stop()()}>\n {chatMessages().messageStop}\n </Button>\n )}\n </Show>\n </>\n )}\n </Show>\n </div>\n </Show>\n </div>\n </Show>\n </div>\n </div>\n );\n\n return (\n <Show when={hasMenu()} fallback={row}>\n {/* Out of the tab order: the keyboard reaches the same menu through \"…\", so a message adds no extra stop. */}\n <GestureMenu items={gestureItems()} label={chatMessages().messageMenu({ author: props.author.name, time: props.time })} tabIndex={-1}>\n {row}\n </GestureMenu>\n </Show>\n );\n}\n\n/** Where a row belongs, such as its thread; a control when it opens that place. */\nfunction OriginChip(props: { origin: MessageRowOrigin }): JSX.Element {\n return (\n <Show\n when={props.origin.onSelect}\n fallback={\n <span class=\"k2b-message-row__origin\">\n <Show when={props.origin.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>\n {props.origin.label}\n </span>\n }\n >\n {(select) => (\n <button type=\"button\" class=\"k2b-message-row__origin\" aria-label={props.origin.selectLabel} onClick={() => select()()}>\n <Show when={props.origin.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>\n {props.origin.label}\n </button>\n )}\n </Show>\n );\n}\n\n/**\n * A quiet line for a change to something the conversation is about, such as a task's new status: no bubble, aligned\n * with the messages' text, with its time at the end. It is no message: it never counts as unread.\n */\nexport function MessageEventRow(props: MessageEventRowProps): JSX.Element {\n return (\n <div class={props.class ? `k2b-message-event-row ${props.class}` : \"k2b-message-event-row\"}>\n <i class={props.icon ?? \"ti ti-point\"} aria-hidden=\"true\" />\n <Show when={props.href} fallback={<span class=\"k2b-message-event-row__text\">{props.children}</span>}>\n {(href) => (\n <a class=\"k2b-message-event-row__text k2b-message-event-row__link\" href={href()}>\n {props.children}\n </a>\n )}\n </Show>\n <Show when={props.origin}>{(origin) => <OriginChip origin={origin()} />}</Show>\n <Show when={props.time}>\n <time datetime={dateTimeOf(props.dateTime)}>{props.time}</time>\n </Show>\n </div>\n );\n}\n\n/** Several event lines in a row as one line that opens them, such as \"4 changes to Invitation and Light test\". */\nexport function MessageEventGroup(props: MessageEventGroupProps): JSX.Element {\n return (\n <button\n type=\"button\"\n class={props.class ? `k2b-message-event-row k2b-message-event-group ${props.class}` : \"k2b-message-event-row k2b-message-event-group\"}\n aria-expanded={props.expanded}\n onClick={() => props.onToggle()}\n >\n <i class=\"ti ti-history\" aria-hidden=\"true\" />\n <span class=\"k2b-message-event-row__text\">{props.label}</span>\n <Show when={props.time}>\n <time datetime={dateTimeOf(props.dateTime)}>{props.time}</time>\n </Show>\n <i class={props.expanded ? \"ti ti-chevron-up\" : \"ti ti-chevron-down\"} aria-hidden=\"true\" />\n </button>\n );\n}\n\n/** A quiet, centered line for something that happened in the conversation, such as a person joining. */\nexport function MessageSystemRow(props: MessageSystemRowProps): JSX.Element {\n return (\n <div class={props.class ? `k2b-message-system-row ${props.class}` : \"k2b-message-system-row\"}>\n <Show when={props.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>\n <span>{props.children}</span>\n <Show when={props.time}>\n <time datetime={dateTimeOf(props.dateTime)}>{props.time}</time>\n </Show>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS,QAAQ,aAAa;AAEvC,SAAS,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,GAAG,EAAY,SAAS,EAAE,IAAI,QAAQ,UAAU;AACnG,SAAS,MAAM,QAAQ,mBAAmB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,GAAG,kBAAkB,GAAG,oBAAoB;MAAA;MAAA;MAAA;MAAA;IAAA;MAAA;MAAA;MAAA;IAAA;IAAA;IAAA;EAAA;AAG1E;;AAEA;AACA,OAAO,SAAS,gBAAgB,CAAC,KAA4B,EAAe;EAC1E;IAAA;MAAA;MAAA;MAAA;MAAA;MAAA;IAAA,oCAEK,IAAI;MAAA,IAAC,IAAI;QAAA,OAAE,KAAK,CAAC,IAAI;MAAA;MAAA,UAAI,IAAI;QAAA;QAAA,oCAAe,IAAI,CAAC,CAAC;QAAA;MAAA;IAAuB;IAAA,wBACnE,KAAK,CAAC,QAAQ;IAAA,oCACpB,IAAI;MAAA,IAAC,IAAI;QAAA,OAAE,KAAK,CAAC,IAAI;MAAA;MAAA;QAAA;QAAA,wBACyB,KAAK,CAAC,IAAI;QAAA,mDAAvC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC;QAAA;MAAA;IAAA;IAAA,oCAJlC,KAAK,CAAC,KAAK,GAAG,0BAA0B,KAAK,CAAC,KAAK,EAAE,GAAG,wBAAwB;IAAA;EAAA;AAQhG;AAAC","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["content/MessageRow.tsx"],"sourcesContent":["import { fileIcons } from \"@k2b/stdlib\";\nimport type { Token, Tokens } from \"marked\";\nimport { createMemo, createSignal, createUniqueId, For, type JSX, onCleanup, Show } from \"solid-js\";\nimport { Button } from \"../actions/Button\";\nimport { copyText } from \"../actions/CopyButton\";\nimport { Dropdown, type DropdownAction } from \"../actions/Dropdown\";\nimport { type GestureKind, GestureMenu, type GestureMenuAction } from \"../actions/GestureMenu\";\nimport { type ChatMessages, useChatMessages } from \"../chat/chat-messages\";\nimport { announce } from \"../feedback/announce\";\nimport { useLocale } from \"../intl/locale\";\nimport { type UiMessages, useUiMessages } from \"../intl/messages\";\nimport { Avatar } from \"../surfaces/Avatar\";\nimport { Kbd } from \"./Kbd\";\nimport { createSafeMarked, createSafeRenderer, escapeHtml } from \"./MarkdownView\";\nimport { ReactionBar, type ReactionBarItem } from \"./ReactionBar\";\n\n/** Messages by the same author within this time continue a group. */\nconst GROUP_WINDOW_MS = 5 * 60_000;\n/**\n * A message collapses to ten lines (`.k2b-message-row__text[data-collapsed]`) when its rendered text takes more lines\n * than this. `renderedLines` counts the fewest lines the text takes at any width, so a collapsed message always hides\n * some of it.\n */\nconst COLLAPSE_LINES = 14;\n/** Visible characters that take at least one line of a message, even at its widest. */\nconst LINE_CHARS = 100;\n/** Lines at the bottom of a collapsed message that fade out, as `.k2b-message-row__text[data-collapsed]` draws them. */\nconst FADE_LINES = 2;\nconst COPIED_MS = 2_000;\n/** Alt+click on these keeps its own meaning, such as downloading a link. */\nconst ALT_CLICK_IGNORE = \"a[href], button, input, textarea, select, summary, label, audio, video, [role='button'], [role='link']\";\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 /** Visible name of the menu entry. */\n label: string;\n /** Icon class, for example `ti ti-arrow-back-up`. */\n icon: string;\n /** One quiet sentence below the label that says what the entry does. */\n description?: string;\n onSelect: () => void;\n disabled?: boolean;\n variant?: \"danger\";\n /** A touch gesture that runs the entry too. Give each gesture to at most one entry. */\n gesture?: GestureKind;\n /**\n * Alt+click (Option+click on Apple devices) on the message runs the entry directly, and the entry shows that\n * shortcut. Give it to at most one entry.\n */\n altClick?: boolean;\n /** A key the application handles for the focused message, such as \"r\"; the entry shows it at its end. */\n shortcut?: string;\n /** In the phone sheet, runs while the tap still counts as the person's gesture, as clipboard writes require. */\n immediate?: boolean;\n};\n\nexport type MessageRowQuote = {\n /** Name of the quoted message's author. */\n author: string;\n /** Plain text of the quoted message. It shows at most two lines. */\n text: string;\n /** Opens the quoted message, for example by scrolling to it. Without it, the quote is not a control. */\n onSelect?: () => void;\n};\n\n/** Reaction labels are read by screen readers and shown in the names hint. */\nexport type MessageRowReaction = ReactionBarItem;\n\nexport type MessageRowThread = {\n /** Number of replies. */\n count: number;\n /** People who replied, most recent first; the bar shows up to three. */\n participants?: readonly MessageRowAuthor[];\n /** Visible time of the last reply, formatted by the caller. */\n lastReply?: string;\n lastReplyDateTime?: string | Date;\n onOpen: () => void;\n};\n\ntype MessageRowAttachmentTarget = {\n /** Opens the attachment, for example in a lightbox. Takes precedence over `href`. */\n onOpen?: () => void;\n /** Opens the attachment in a new tab. Absolute `https` or `http`, or relative. */\n href?: string;\n};\n\nexport type MessageRowMedia = MessageRowAttachmentTarget & {\n kind: \"image\" | \"video\";\n /** The image, or the poster frame of a video. Absolute `https` or `http`, relative, `blob`, or `data:image/`. */\n src: string;\n /** Describes the image or video for people who cannot see it. */\n alt: string;\n /** Stored pixel size. The row reserves the area from it, so nothing moves when the image loads. */\n width: number;\n height: number;\n /** Visible length of a video, for example \"0:42\". */\n duration?: string;\n};\n\nexport type MessageRowFile = MessageRowAttachmentTarget & {\n kind: \"file\";\n name: string;\n /** Second line, for example \"PDF · 412 KB\". */\n detail?: string;\n /** Media type, used with the name to choose the icon. */\n mediaType?: string;\n /** Icon class instead of the one chosen from the name. */\n icon?: string;\n};\n\nexport type MessageRowAttachment = MessageRowMedia | MessageRowFile;\n\n/** Where a message belongs, shown as a small chip under it, for example its thread in a timeline of several. */\nexport type MessageRowOrigin = {\n label: string;\n /** Icon class, for example `ti ti-hash`. */\n icon?: string;\n /** Opens where the message belongs. Without it, the chip is not a control. */\n onSelect?: () => void;\n /** Accessible name of the control when it must say more than the label, such as \"Open thread Updates\". */\n selectLabel?: string;\n};\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 (or own-message time) 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 /** Called by \"Discard\" next to \"Retry\" while `status` is `\"failed\"`, so both answers to a failure sit where it shows. */\n onDiscard?: () => void;\n /**\n * The message's menu. A quiet \"…\" beside the bubble opens it while the message is hovered or focused, also from the\n * keyboard; right-click and a long press open the same menu. Showing \"…\" never moves the layout.\n */\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 /** A chip of fixed height under the message that names where it belongs. */\n origin?: MessageRowOrigin;\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 MessageEventRowProps = {\n /** What changed, for example \"Mara set the status to “In review”\". */\n children: JSX.Element;\n /** Icon class of the kind of change; a dot by default. */\n icon?: string;\n /** Where the change belongs, such as its thread, where several threads mix. */\n origin?: MessageRowOrigin;\n /** Opens what the change is about, such as the commented passage; the sentence becomes the link. */\n href?: string;\n /** Visible time, formatted by the caller. */\n time?: string;\n dateTime?: string | Date;\n class?: string;\n};\n\nexport type MessageEventGroupProps = {\n /** What the closed group stands for, for example \"4 changes to Invitation and Light test\". */\n label: string;\n expanded: boolean;\n onToggle: () => void;\n /** Visible time or range, formatted by the caller, for example \"09:50–09:58\". */\n time?: string;\n /** The first event's time. */\n dateTime?: string | Date;\n class?: string;\n};\n\nexport type MessageGroupEntry = {\n /** Stable identity of the author. */\n author: string;\n at: Date | number | string;\n /** System rows never belong to a group. */\n system?: boolean;\n};\n\nconst timestamp = (value: Date | number | string) => (value instanceof Date ? value.getTime() : new Date(value).getTime());\n\n/**\n * Whether a message starts a new group: there is no previous message, either is a system row, the author changes, or\n * more than five minutes passed. Also start a group where you show a separator such as a new day.\n */\nexport const startsMessageGroup = (entry: MessageGroupEntry, previous?: MessageGroupEntry | null): boolean => {\n if (!previous || entry.system || previous.system || entry.author !== previous.author) return true;\n const gap = timestamp(entry.at) - timestamp(previous.at);\n return !(gap >= 0 && gap <= GROUP_WINDOW_MS);\n};\n\n/** Text that wraps: every `LINE_CHARS` visible characters of a line take at least one line. */\nconst wrappedLines = (text: string): number =>\n text.split(\"\\n\").reduce((lines, line) => lines + Math.ceil(line.trim().length / LINE_CHARS), 0);\n\n/** What inline tokens show: a link its label, never its destination. */\nconst inlineText = (tokens: readonly Token[]): string => {\n let text = \"\";\n for (const token of tokens) {\n if (token.type === \"br\") text += \"\\n\";\n else if (\"tokens\" in token && token.tokens) text += inlineText(token.tokens);\n else if (\"text\" in token) text += token.text;\n }\n return text;\n};\n\n/**\n * The fewest lines the rendered tokens take at any width. Code never wraps, so each of its lines is one line, blank\n * ones too, and its bar one more. Link destinations and reference definitions show nothing. Decided from the text\n * alone, so the row has its final height when it mounts.\n */\nconst renderedLines = (tokens: readonly Token[]): number => {\n let lines = 0;\n for (const token of tokens) {\n switch (token.type) {\n case \"code\":\n lines += token.text.split(\"\\n\").length + 1;\n break;\n case \"list\":\n for (const item of token.items) lines += Math.max(1, renderedLines(item.tokens));\n break;\n case \"table\":\n lines += token.rows.length + (token.header.some((cell: Tokens.TableCell) => cell.text.trim()) ? 1 : 0);\n break;\n case \"paragraph\":\n case \"heading\":\n case \"text\":\n lines += wrappedLines(token.tokens ? inlineText(token.tokens) : token.text);\n break;\n case \"hr\":\n lines += 1;\n break;\n case \"space\":\n case \"def\":\n break;\n default:\n if (\"tokens\" in token && token.tokens) lines += renderedLines(token.tokens);\n else if (\"text\" in token) lines += wrappedLines(token.text);\n }\n }\n return lines;\n};\n\n/** Messages link only to absolute URLs; a relative one would lead somewhere else on every page that shows it. */\nconst isAbsoluteUrl = (href: string): boolean => {\n try {\n return new URL(href).protocol !== \"\";\n } catch {\n return false;\n }\n};\n\nconst dateTimeOf = (value: string | Date | undefined): string | undefined => {\n if (value === undefined) return undefined;\n const date = value instanceof Date ? value : new Date(value);\n return Number.isFinite(date.getTime()) ? date.toISOString() : undefined;\n};\n\n/**\n * An attachment URL the row may load or open: absolute with an allowed scheme, or relative to the page. A picture may\n * also be a `blob:` URL or a `data:image/` URL, which an image element shows without running anything.\n */\nconst attachmentUrl = (url: string | undefined, picture = false): string | undefined => {\n if (!url) return undefined;\n if (picture && /^data:image\\//i.test(url)) return url;\n try {\n return (picture ? PICTURE_PROTOCOLS : ATTACHMENT_PROTOCOLS).has(new URL(url, \"https://relative.invalid/\").protocol) ? url : undefined;\n } catch {\n return undefined;\n }\n};\n\n/** The aspect ratio a single image or video reserves, from its stored size. */\nconst mediaRatio = (media: MessageRowMedia): number => {\n const ratio = media.width > 0 && media.height > 0 ? media.width / media.height : 4 / 3;\n return Math.min(MEDIA_RATIO_MAX, Math.max(MEDIA_RATIO_MIN, ratio));\n};\n\n/** The width of a single image or video: its stored width, at most the row's media height tall, never wider than the row. */\nconst mediaWidth = (media: MessageRowMedia): string => {\n const natural = Number.isFinite(media.width) && media.width > 0 ? `${media.width}px, ` : \"\";\n return `min(100%, ${natural}calc(var(--k2b-message-media-height) * ${mediaRatio(media)}))`;\n};\n\n/** Only the `ti-*` glyph of `fileIcons`, which may add colour utilities that `@k2b/ui` does not ship. */\nconst fileIcon = (file: MessageRowFile): string =>\n file.icon ??\n `ti ${fileIcons\n .getFileIcon({ name: file.name, type: \"file\", mimeType: file.mediaType })\n .split(/\\s+/)\n .filter((token) => token.startsWith(\"ti-\"))\n .join(\" \")}`;\n\n/** A link, a button, or neither, depending on what the caller passes. */\nfunction AttachmentTarget(\n props: MessageRowAttachmentTarget & {\n class: string;\n style?: JSX.CSSProperties;\n /** Names a picture; without a link or button around it, the element becomes the image. */\n label?: string;\n children: JSX.Element;\n },\n): JSX.Element {\n return (\n <Show\n when={props.onOpen}\n fallback={\n <Show\n when={attachmentUrl(props.href)}\n fallback={\n <Show\n when={props.label}\n fallback={\n <span class={props.class} style={props.style}>\n {props.children}\n </span>\n }\n >\n {(label) => (\n <span class={props.class} style={props.style} role=\"img\" aria-label={label()}>\n {props.children}\n </span>\n )}\n </Show>\n }\n >\n {(href) => (\n <a class={props.class} style={props.style} href={href()} target=\"_blank\" rel=\"noopener noreferrer\" aria-label={props.label}>\n {props.children}\n </a>\n )}\n </Show>\n }\n >\n {(open) => (\n <button type=\"button\" class={props.class} style={props.style} aria-label={props.label} onClick={() => open()()}>\n {props.children}\n </button>\n )}\n </Show>\n );\n}\n\n/**\n * Renders the safe Markdown of `MarkdownView` with line breaks kept, absolute links only, and a copy control above\n * every code block, and counts the fewest lines it takes. An edited message that does not collapse ends with the marker.\n */\nconst renderMessage = (\n text: string,\n locale: string,\n messages: UiMessages,\n chatMessages: ChatMessages,\n edited: boolean,\n): { html: string; lines: number } => {\n const renderer = createSafeRenderer({ allowImages: false, linkProtocols: LINK_PROTOCOLS, linkTarget: \"_blank\", locale });\n const renderLink = renderer.link.bind(renderer);\n renderer.link = (token: Tokens.Link) => (isAbsoluteUrl(token.href) ? renderLink(token) : renderer.parser.parseInline(token.tokens));\n const renderCode = renderer.code.bind(renderer);\n renderer.code = (token: Tokens.Code) => {\n const language = token.lang?.match(/^\\S{1,24}/)?.[0];\n const block = renderCode(token).replace(/^<pre>/, '<pre tabindex=\"0\">');\n return (\n '<div class=\"k2b-message-row__code\" data-gesture-ignore><div class=\"k2b-message-row__code-bar\">' +\n `<span class=\"k2b-message-row__code-label\">${escapeHtml(language ?? messages.code)}</span>` +\n '<button type=\"button\" class=\"k2b-message-row__copy\">' +\n `<span class=\"k2b-message-row__copy-idle\"><i class=\"ti ti-copy\" aria-hidden=\"true\"></i>${escapeHtml(messages.copy)}</span>` +\n `<span class=\"k2b-message-row__copy-done\"><i class=\"ti ti-check\" aria-hidden=\"true\"></i>${escapeHtml(messages.copied)}</span>` +\n `</button></div>${block}</div>`\n );\n };\n const marked = createSafeMarked(locale).setOptions({ breaks: true, renderer });\n const tokens = marked.lexer(text);\n const html = marked.parser(tokens);\n const lines = renderedLines(tokens);\n // A collapsed message would hide the end of its text, so its marker sits next to \"Show more\" instead.\n if (!edited || lines > COLLAPSE_LINES) return { html, lines };\n // The marker ends the last paragraph, so it takes no line of its own there.\n const marker = `<span class=\"k2b-message-row__edited\">${escapeHtml(chatMessages.messageEdited)}</span>`;\n const end = html.trimEnd();\n return { html: end.endsWith(\"</p>\") ? `${end.slice(0, -4)} ${marker}</p>` : `${html}<p>${marker}</p>`, lines };\n};\n\n/**\n * One message in a conversation with many people: own messages on the right, others on the left with avatar, name,\n * and time at the start of a group. Every part has its final height when the row mounts, so a virtualized list such\n * as `VirtualFeed` keeps its positions.\n */\nexport function MessageRow(props: MessageRowProps): JSX.Element {\n const messages = useUiMessages();\n const chatMessages = useChatMessages();\n const locale = useLocale();\n const textId = `k2b-message-${createUniqueId()}`;\n const [expanded, setExpanded] = createSignal(false);\n const rendered = createMemo(() => renderMessage(props.text, locale(), messages(), chatMessages(), Boolean(props.edited)));\n const collapsible = () => rendered().lines > COLLAPSE_LINES;\n const collapsed = () => collapsible() && !expanded();\n const groupStart = () => props.groupStart ?? true;\n const hasLine = () => props.progress !== undefined || props.status !== undefined || props.receipt !== undefined;\n const reactions = () => (props.deleted ? undefined : props.reactions);\n const hasFooter = () => hasLine() || reactions() !== undefined;\n const writing = () => props.progress !== undefined && !props.deleted && props.text.trim() === \"\";\n const hasBubble = () => props.deleted || writing() || props.text.trim() !== \"\";\n const content = () => !props.deleted;\n const media = createMemo(() =>\n content() ? (props.attachments ?? []).filter((attachment): attachment is MessageRowMedia => attachment.kind !== \"file\") : [],\n );\n const files = createMemo(() =>\n content() ? (props.attachments ?? []).filter((attachment): attachment is MessageRowFile => attachment.kind === \"file\") : [],\n );\n const shownMedia = () => media().slice(0, MEDIA_SHOWN);\n const hiddenMedia = () => media().length - shownMedia().length;\n let text: HTMLDivElement | undefined;\n let copiedTimer: ReturnType<typeof setTimeout> | undefined;\n\n onCleanup(() => clearTimeout(copiedTimer));\n\n const copyCode = (event: MouseEvent) => {\n const button = (event.target as Element | null)?.closest?.<HTMLButtonElement>(\".k2b-message-row__copy\");\n if (!button || !text?.contains(button)) return;\n const code = button.closest(\".k2b-message-row__code\")?.querySelector(\"pre\")?.textContent ?? \"\";\n copyText(code).then(\n () => {\n for (const other of text?.querySelectorAll<HTMLElement>(\".k2b-message-row__copy[data-copied]\") ?? []) delete other.dataset.copied;\n button.dataset.copied = \"\";\n announce(messages().copied);\n clearTimeout(copiedTimer);\n copiedTimer = setTimeout(() => delete button.dataset.copied, COPIED_MS);\n },\n () => {},\n );\n };\n\n // A keyboard user who reaches a link or code block in the hidden or faded part of a collapsed message gets the whole\n // message. The collapsed text clips instead of scrolling, so the browser cannot scroll it to the target instead.\n const revealFocus = (event: FocusEvent) => {\n if (!text || !collapsed() || !(event.target instanceof Element)) return;\n const fade = text.getBoundingClientRect().bottom - FADE_LINES * Number.parseFloat(getComputedStyle(text).lineHeight);\n if (event.target.getBoundingClientRect().bottom > fade) setExpanded(true);\n };\n\n // The same entries serve \"…\", right-click, the keyboard, and a long press. Alt+click and keys show at the entry's end.\n // Each menu gets its own entries: a rendered shortcut is a DOM node and can live in only one menu.\n const entries = () =>\n (props.actions ?? []).map((entry): GestureMenuAction & Pick<Extract<DropdownAction, { action: () => void }>, \"immediate\"> => ({\n label: entry.label,\n icon: entry.icon,\n description: entry.description,\n disabled: entry.disabled,\n variant: entry.variant,\n gesture: entry.gesture,\n immediate: entry.immediate,\n trailing: entry.altClick ? <Kbd keys=\"alt+click\" /> : entry.shortcut ? <Kbd keys={entry.shortcut} /> : undefined,\n action: () => entry.onSelect(),\n }));\n const menuItems = createMemo(entries);\n const gestureItems = createMemo(entries);\n const hasMenu = () => (props.actions?.length ?? 0) > 0;\n\n // Alt+click (Option+click) on the message, not on a link or control inside it, runs the entry that asks for it.\n const altClick = (event: MouseEvent) => {\n if (!event.altKey || event.button !== 0 || event.ctrlKey || event.metaKey || event.shiftKey) return;\n const entry = props.actions?.find((action) => action.altClick && !action.disabled);\n const target = event.target instanceof Element ? event.target : null;\n if (!entry || target?.closest(ALT_CLICK_IGNORE)) return;\n event.preventDefault();\n entry.onSelect();\n };\n\n const more = () => (\n <Dropdown.Root\n items={menuItems()}\n label={chatMessages().messageActions}\n class=\"k2b-message-row__menu-root\"\n position={props.own ? \"bottom-right\" : \"bottom-left\"}\n phone=\"sheet\"\n >\n <Dropdown.Trigger iconOnly variant=\"ghost\" size=\"sm\" label={chatMessages().messageActions} class=\"k2b-message-row__menu\">\n <i class=\"ti ti-dots\" aria-hidden=\"true\" />\n </Dropdown.Trigger>\n </Dropdown.Root>\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 <span class=\"k2b-message-row__quote-author\">\n <span class=\"k2b-sr-only\">{chatMessages().messageReplyTo} </span>\n {value.author}\n </span>\n <span class=\"k2b-message-row__quote-text\">{value.text}</span>\n </>\n );\n\n /** The answered message on a quiet tint at the top of the bubble, or in its place without one. */\n const quoteBlock = () => (\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 );\n\n /** The picture's description, then that it is a video and how long, then how many more the grid hides. */\n const mediaLabel = (item: MessageRowMedia, more: number) =>\n [\n item.alt,\n item.kind === \"video\" ? [chatMessages().messageVideo, item.duration].filter(Boolean).join(\" \") : \"\",\n more > 0 ? chatMessages().messageMoreAttachments({ count: more }) : \"\",\n ]\n .filter(Boolean)\n .join(\", \");\n\n const mediaItem = (item: MessageRowMedia, index: () => number) => {\n const more = () => (index() === shownMedia().length - 1 ? hiddenMedia() : 0);\n return (\n <AttachmentTarget\n class=\"k2b-message-row__media-item\"\n style={media().length === 1 ? { \"aspect-ratio\": String(mediaRatio(item)) } : undefined}\n label={mediaLabel(item, more())}\n onOpen={item.onOpen}\n href={item.href}\n >\n <img\n src={attachmentUrl(item.src, true)}\n alt=\"\"\n width={item.width > 0 ? item.width : undefined}\n height={item.height > 0 ? item.height : undefined}\n loading=\"lazy\"\n decoding=\"async\"\n />\n <Show when={item.kind === \"video\"}>\n <span class=\"k2b-message-row__media-play\" aria-hidden=\"true\">\n <i class=\"ti ti-player-play\" />\n </span>\n <Show when={item.duration}>\n <span class=\"k2b-message-row__media-duration\" aria-hidden=\"true\">\n {item.duration}\n </span>\n </Show>\n </Show>\n <Show when={more() > 0}>\n <span class=\"k2b-message-row__media-more\" aria-hidden=\"true\">\n +{more()}\n </span>\n </Show>\n </AttachmentTarget>\n );\n };\n\n const row = (\n // biome-ignore lint/a11y/noStaticElementInteractions lint/a11y/useKeyWithClickEvents: Alt+click is a pointer shortcut for a menu entry that the keyboard reaches through \"…\".\n <div\n class={props.class ? `k2b-message-row ${props.class}` : \"k2b-message-row\"}\n onClick={altClick}\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 <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 </div>\n }\n >\n <div class=\"k2b-message-row__meta\">{header()}</div>\n </Show>\n </Show>\n <Show when={content() && props.forwarded}>\n <div class=\"k2b-message-row__marker\">\n <i class=\"ti ti-arrow-forward-up\" aria-hidden=\"true\" />\n <span>{chatMessages().messageForwarded}</span>\n </div>\n </Show>\n <Show when={!hasBubble()}>{quoteBlock()}</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 {quoteBlock()}\n <Show\n when={!props.deleted}\n fallback={\n <span class=\"k2b-message-row__deleted\">\n <i class=\"ti ti-message-off\" aria-hidden=\"true\" />\n {chatMessages().messageDeleted}\n </span>\n }\n >\n <Show\n when={!writing()}\n fallback={\n <span class=\"k2b-message-row__writing\">\n <span class=\"k2b-chat-progress-dots\" aria-hidden=\"true\">\n <span />\n <span />\n <span />\n </span>\n </span>\n }\n >\n {/* biome-ignore lint/a11y/noStaticElementInteractions lint/a11y/useKeyWithClickEvents: the native copy buttons inside the rendered Markdown are the targets; their clicks, including from the keyboard, bubble here. */}\n <div\n ref={text}\n id={textId}\n class=\"k2b-content-markdown k2b-message-row__text\"\n data-heading-scale=\"compact\"\n data-collapsed={collapsed() ? \"\" : undefined}\n onClick={copyCode}\n onFocusIn={revealFocus}\n innerHTML={rendered().html}\n />\n <Show when={collapsible()}>\n <div class=\"k2b-message-row__more-line\">\n <Button\n variant=\"text\"\n size=\"xs\"\n class=\"k2b-message-row__more\"\n aria-expanded={expanded() ? \"true\" : \"false\"}\n aria-controls={textId}\n onClick={() => setExpanded((value) => !value)}\n >\n {expanded() ? chatMessages().messageShowLess : chatMessages().messageShowMore}\n </Button>\n <Show when={props.edited}>\n <span class=\"k2b-message-row__edited\">{chatMessages().messageEdited}</span>\n </Show>\n </div>\n </Show>\n </Show>\n </Show>\n <Show when={hasMenu()}>{more()}</Show>\n </div>\n </Show>\n <Show when={hasMenu() && !hasBubble()}>{more()}</Show>\n {/* Without a bubble to end, the edit marker takes the bubble's place. */}\n <Show when={content() && props.edited && !hasBubble()}>\n <div class=\"k2b-message-row__marker\">\n <i class=\"ti ti-pencil\" aria-hidden=\"true\" />\n <span class=\"k2b-message-row__edited\">{chatMessages().messageEdited}</span>\n </div>\n </Show>\n <Show when={media().length > 0}>\n <div\n class=\"k2b-message-row__media\"\n role=\"group\"\n aria-label={chatMessages().attachments}\n data-count={Math.min(media().length, MEDIA_SHOWN)}\n style={media().length === 1 ? { width: mediaWidth(media()[0]!) } : undefined}\n >\n <For each={shownMedia()}>{(item, index) => mediaItem(item, index)}</For>\n </div>\n </Show>\n <Show when={files().length > 0}>\n <div class=\"k2b-message-row__files\">\n <For each={files()}>\n {(file) => (\n <AttachmentTarget class=\"k2b-message-row__file\" onOpen={file.onOpen} href={file.href}>\n <span class=\"k2b-message-row__file-icon\" aria-hidden=\"true\">\n <i class={fileIcon(file)} />\n </span>\n <span class=\"k2b-message-row__file-copy\">\n <span class=\"k2b-message-row__file-name\">{file.name}</span>\n <Show when={file.detail}>\n <span class=\"k2b-message-row__file-detail\">{file.detail}</span>\n </Show>\n </span>\n </AttachmentTarget>\n )}\n </For>\n </div>\n </Show>\n <Show when={content() && props.linkPreview}>\n <div class=\"k2b-message-row__slot\" data-gesture-ignore>\n {props.linkPreview}\n </div>\n </Show>\n <Show when={content() && props.card}>\n <div class=\"k2b-message-row__slot\" data-gesture-ignore>\n {props.card}\n </div>\n </Show>\n <Show when={props.thread}>\n {(thread) => (\n <button type=\"button\" class=\"k2b-message-row__thread\" onClick={() => thread().onOpen()}>\n <Show when={(thread().participants?.length ?? 0) > 0}>\n <span class=\"k2b-message-row__thread-people\" aria-hidden=\"true\">\n <For each={thread().participants?.slice(0, 3)}>\n {(person) => <Avatar name={person.name} src={person.avatar} icon={person.icon} size=\"xs\" />}\n </For>\n </span>\n </Show>\n <span class=\"k2b-message-row__thread-count\">{chatMessages().messageReplies({ count: thread().count })}</span>\n <Show when={thread().lastReply}>\n {(time) => (\n <time class=\"k2b-message-row__thread-time\" datetime={dateTimeOf(thread().lastReplyDateTime)}>\n {chatMessages().messageLastReply({ time: time() })}\n </time>\n )}\n </Show>\n </button>\n )}\n </Show>\n <Show when={props.origin}>{(origin) => <OriginChip origin={origin()} />}</Show>\n <Show when={hasFooter()}>\n <div class=\"k2b-message-row__footer\">\n <Show when={reactions()}>\n {(list) => <ReactionBar reactions={list()} onToggle={props.onToggleReaction} onAdd={props.onAddReaction} />}\n </Show>\n <Show when={hasLine()}>\n <div class=\"k2b-message-row__line\">\n <Show\n when={props.progress}\n fallback={\n <>\n <Show when={props.status === \"pending\"}>\n <i class=\"ti ti-clock\" aria-hidden=\"true\" />\n <span>{chatMessages().sending}</span>\n </Show>\n <Show when={props.status === \"failed\"}>\n <i class=\"ti ti-alert-circle\" aria-hidden=\"true\" />\n <span>{chatMessages().messageNotSent}</span>\n <Show when={props.onRetry}>\n {(retry) => (\n <Button variant=\"text\" size=\"xs\" onClick={() => retry()()}>\n {chatMessages().messageRetry}\n </Button>\n )}\n </Show>\n <Show when={props.onDiscard}>\n {(discard) => (\n <Button variant=\"text\" size=\"xs\" onClick={() => discard()()}>\n {chatMessages().messageDiscard}\n </Button>\n )}\n </Show>\n </Show>\n <Show when={props.status !== \"pending\" && props.status !== \"failed\"}>\n <Show\n when={props.receipt}\n fallback={\n <Show when={props.status === \"sent\"}>\n <i class=\"ti ti-check\" aria-hidden=\"true\" />\n <span class=\"k2b-sr-only\">{chatMessages().messageSent}</span>\n </Show>\n }\n >\n {(receipt) => (\n <>\n <i class=\"ti ti-checks\" aria-hidden=\"true\" />\n <span class=\"k2b-message-row__receipt\">{receipt()}</span>\n </>\n )}\n </Show>\n </Show>\n </>\n }\n >\n {(progress) => (\n <>\n <i class=\"ti ti-loader-2 k2b-spin\" aria-hidden=\"true\" />\n <span class=\"k2b-message-row__line-text\">{progress().status}</span>\n <Show when={progress().onStop}>\n {(stop) => (\n <Button variant=\"text\" size=\"xs\" onClick={() => stop()()}>\n {chatMessages().messageStop}\n </Button>\n )}\n </Show>\n </>\n )}\n </Show>\n </div>\n </Show>\n </div>\n </Show>\n </div>\n </div>\n );\n\n return (\n <Show when={hasMenu()} fallback={row}>\n {/* Out of the tab order: the keyboard reaches the same menu through \"…\", so a message adds no extra stop. */}\n <GestureMenu items={gestureItems()} label={chatMessages().messageMenu({ author: props.author.name, time: props.time })} tabIndex={-1}>\n {row}\n </GestureMenu>\n </Show>\n );\n}\n\n/** Where a row belongs, such as its thread; a control when it opens that place. */\nfunction OriginChip(props: { origin: MessageRowOrigin }): JSX.Element {\n return (\n <Show\n when={props.origin.onSelect}\n fallback={\n <span class=\"k2b-message-row__origin\">\n <Show when={props.origin.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>\n {props.origin.label}\n </span>\n }\n >\n {(select) => (\n <button type=\"button\" class=\"k2b-message-row__origin\" aria-label={props.origin.selectLabel} onClick={() => select()()}>\n <Show when={props.origin.icon}>{(icon) => <i class={icon()} aria-hidden=\"true\" />}</Show>\n {props.origin.label}\n </button>\n )}\n </Show>\n );\n}\n\n/**\n * A quiet line for a change to something the conversation is about, such as a task's new status: no bubble, aligned\n * with the messages' text, with its time at the end. It is no message: it never counts as unread.\n */\nexport function MessageEventRow(props: MessageEventRowProps): JSX.Element {\n return (\n <div class={props.class ? `k2b-message-event-row ${props.class}` : \"k2b-message-event-row\"}>\n <i class={props.icon ?? \"ti ti-point\"} aria-hidden=\"true\" />\n <Show when={props.href} fallback={<span class=\"k2b-message-event-row__text\">{props.children}</span>}>\n {(href) => (\n <a class=\"k2b-message-event-row__text k2b-message-event-row__link\" href={href()}>\n {props.children}\n </a>\n )}\n </Show>\n <Show when={props.origin}>{(origin) => <OriginChip origin={origin()} />}</Show>\n <Show when={props.time}>\n <time datetime={dateTimeOf(props.dateTime)}>{props.time}</time>\n </Show>\n </div>\n );\n}\n\n/** Several event lines in a row as one line that opens them, such as \"4 changes to Invitation and Light test\". */\nexport function MessageEventGroup(props: MessageEventGroupProps): JSX.Element {\n return (\n <button\n type=\"button\"\n class={props.class ? `k2b-message-event-row k2b-message-event-group ${props.class}` : \"k2b-message-event-row k2b-message-event-group\"}\n aria-expanded={props.expanded}\n onClick={() => props.onToggle()}\n >\n <i class=\"ti ti-history\" aria-hidden=\"true\" />\n <span class=\"k2b-message-event-row__text\">{props.label}</span>\n <Show when={props.time}>\n <time datetime={dateTimeOf(props.dateTime)}>{props.time}</time>\n </Show>\n <i class={props.expanded ? \"ti ti-chevron-up\" : \"ti ti-chevron-down\"} aria-hidden=\"true\" />\n </button>\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,SA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QAAA,OAAE,KAAK,CAAC,IAAI;MAAA;MAAA;QAAA;QAAA,wBACyB,KAAK,CAAC,IAAI;QAAA,mDAAvC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC;QAAA;MAAA;IAAA;IAAA;MAAA,YAPrC,KAAK,CAAC,KAAK,GAAG,iDAAiD,KAAK,CAAC,KAAK,EAAE,GAAG,+CAA+C;QAAA,QACtH,KAAK,CAAC,QAAQ;QAAA,QAQnB,KAAK,CAAC,QAAQ,GAAG,kBAAkB,GAAG,oBAAoB;MAAA;MAAA;MAAA;MAAA;IAAA;MAAA;MAAA;MAAA;IAAA;IAAA;IAAA;EAAA;AAG1E;;AAEA;AACA,OAAO,SAAS,gBAAgB,CAAC,KAA4B,EAAe;EAC1E;IAAA;MAAA;MAAA;MAAA;MAAA;MAAA;IAAA,oCAEK,IAAI;MAAA,IAAC,IAAI;QAAA,OAAE,KAAK,CAAC,IAAI;MAAA;MAAA,UAAI,IAAI;QAAA;QAAA,oCAAe,IAAI,CAAC,CAAC;QAAA;MAAA;IAAuB;IAAA,wBACnE,KAAK,CAAC,QAAQ;IAAA,oCACpB,IAAI;MAAA,IAAC,IAAI;QAAA,OAAE,KAAK,CAAC,IAAI;MAAA;MAAA;QAAA;QAAA,wBACyB,KAAK,CAAC,IAAI;QAAA,mDAAvC,UAAU,CAAC,KAAK,CAAC,QAAQ,CAAC;QAAA;MAAA;IAAA;IAAA,oCAJlC,KAAK,CAAC,KAAK,GAAG,0BAA0B,KAAK,CAAC,KAAK,EAAE,GAAG,wBAAwB;IAAA;EAAA;AAQhG;AAAC","ignoreList":[]}
@@ -29,6 +29,7 @@ export { MatchText, matchParts } from "./MatchText";
29
29
  export { MessageEventGroup, MessageEventRow, MessageRow, MessageSystemRow, startsMessageGroup } from "./MessageRow";
30
30
  export { mapPalette } from "./map-palette";
31
31
  export { mapAttribution, mapStyle } from "./map-style";
32
+ export { MAP_SNAPSHOT_MAX_PIXELS, MapSnapshotError } from "./map-view-snapshot";
32
33
  export { MARKDOWN_CALLOUT_CLASSES, MARKDOWN_CALLOUT_ICON_ATTRIBUTES, markdownInfoBlocks, renderMarkdownInfoBlock, scanMarkdownInfoBlock } from "./markdown-info-blocks";
33
34
  export { markdownLinkReference, markdownReferenceIcon, markdownReferenceType, markdownReferenceTypeLabel, markStandaloneLinks, renderMarkdownLink } from "./markdown-links";
34
35
  export { Pagination } from "./Pagination";
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["content/index.ts"],"sourcesContent":["export type {\n CalendarAttendee,\n CalendarCommand,\n CalendarController,\n CalendarCustomView,\n CalendarDayBadge,\n CalendarEvent,\n CalendarEventColor,\n CalendarEventRenderContext,\n CalendarEventTimeChange,\n CalendarExternalDrag,\n CalendarLabels,\n CalendarProps,\n CalendarQuickCreateControls,\n CalendarRange,\n CalendarRecurrence,\n CalendarResource,\n CalendarSelectionControls,\n CalendarView,\n} from \"./Calendar\";\nexport { default as Calendar } from \"./Calendar\";\n\nexport type { ChartKind, ChartLabels, ChartProps, ChartRenderOptions } from \"./Chart\";\nexport { default as Chart } from \"./Chart\";\nexport type { ChartExplorerColumn, ChartExplorerProps, ChartLegendEntry } from \"./ChartExplorer\";\nexport { ChartExplorer } from \"./ChartExplorer\";\nexport type { ChartExplorerControlsProps } from \"./ChartExplorerControls\";\nexport { ChartExplorerControls } from \"./ChartExplorerControls\";\nexport { ChartFilterControls, type ChartFilterControlsProps } from \"./ChartFilterControls\";\nexport { ChartSnapshotView } from \"./ChartSnapshotView\";\nexport type { CodeDisplayLanguage, CodeDisplayProps } from \"./CodeDisplay\";\nexport { default as CodeDisplay } from \"./CodeDisplay\";\nexport { type ChartCursor, createChartCursor } from \"./chart-cursor\";\nexport type {\n ChartExplorerCharts,\n ChartExplorerController,\n ChartExplorerData,\n ChartExplorerOptions,\n ChartExplorerRequest,\n ChartExplorerRow,\n ChartExplorerSnapshot,\n} from \"./chart-explorer\";\nexport { createChartExplorer } from \"./chart-explorer\";\nexport type { ChartDatumRef, ChartSelection, ChartTooltip, ChartTooltipFormatter } from \"./chart-inspection-core\";\nexport type { ChartSnapshot } from \"./chart-snapshot\";\nexport { prepareChartSnapshot } from \"./chart-snapshot\";\nexport type {\n StateTimelineChartOptions,\n StateTimelineDomain,\n StateTimelineInterval,\n StateTimelineRow,\n StateTimelineState,\n} from \"./chart-state-timeline\";\nexport { highlightSql } from \"./code-highlight\";\nexport { type CollectionSelection, createCollectionSelection, type SelectionModifiers } from \"./collection-selection\";\nexport type {\n DataTableColumn,\n DataTableControlsProps,\n DataTableFooter,\n DataTableHeaderProps,\n DataTablePanelFooterProps,\n DataTablePanelProps,\n DataTableProps,\n DataTableRenderCell,\n DataTableRenderHeader,\n DataTableSort,\n} from \"./DataTable\";\nexport { default as DataTable } from \"./DataTable\";\nexport type { DocCodeHighlighter, DocCodeProps, DocConcept, DocNoteVariant, DocRow } from \"./Docs\";\nexport { DocCode, DocConceptGrid, DocInlineCode, DocLead, DocNote, DocPage, DocRows, DocSection } from \"./Docs\";\nexport { FileBrowserPanel, type FileBrowserPanelProps, type FileSource, openFileBrowser } from \"./FileBrowser\";\nexport { FileGrid, type FileGridGroup, type FileGridOpenProps, type FileGridProps, type FileGridSelectableProps } from \"./FileGrid\";\nexport { default as FileTree, type FileTreeActions, type FileTreeEntry, type FileTreeProps } from \"./FileTree\";\nexport { type FileType, FileTypeIcon, type FileTypeIconProps, fileKindLabel, fileTypeOf } from \"./FileTypeIcon\";\nexport {\n canPreviewFile,\n default as FileView,\n type FileViewContent,\n type FileViewFile,\n type FileViewPreviewKind,\n type FileViewProps,\n type FileViewRenderer,\n type FileViewRendererProps,\n formatFileViewSize,\n getFileViewPreviewKind,\n} from \"./FileView\";\nexport type { KbdProps } from \"./Kbd\";\nexport { Kbd } from \"./Kbd\";\nexport type { LabelChipProps } from \"./LabelChip\";\nexport { LabelChip } from \"./LabelChip\";\nexport type { LightboxAction, LightboxImage } from \"./Lightbox\";\nexport { default as Lightbox } from \"./Lightbox\";\nexport type { LogTableEntry } from \"./LogEntriesTable\";\nexport { default as LogEntriesTable } from \"./LogEntriesTable\";\nexport { MapAttribution } from \"./MapAttribution\";\nexport { MapView } from \"./MapView\";\nexport { MapViewFrame } from \"./MapViewFrame\";\nexport { default as MarkdownView, type MarkdownRenderOptions, type MarkdownViewProps, renderSafeMarkdown } from \"./MarkdownView\";\nexport { type MatchRange, MatchText, type MatchTextProps, matchParts } from \"./MatchText\";\nexport type {\n MessageEventGroupProps,\n MessageEventRowProps,\n MessageGroupEntry,\n MessageRowAction,\n MessageRowAttachment,\n MessageRowAuthor,\n MessageRowFile,\n MessageRowMedia,\n MessageRowOrigin,\n MessageRowProgress,\n MessageRowProps,\n MessageRowQuote,\n MessageRowReaction,\n MessageRowStatus,\n MessageRowThread,\n MessageSystemRowProps,\n} from \"./MessageRow\";\nexport { MessageEventGroup, MessageEventRow, MessageRow, MessageSystemRow, startsMessageGroup } from \"./MessageRow\";\nexport { type MapPaletteColors, type MapTheme, mapPalette } from \"./map-palette\";\nexport { type MapStyleOptions, mapAttribution, mapStyle } from \"./map-style\";\nexport type {\n MapViewArea,\n MapViewFit,\n MapViewFrameProps,\n MapViewLine,\n MapViewLineTone,\n MapViewMarker,\n MapViewOwnLocation,\n MapViewPoint,\n MapViewProps,\n MapViewStyle,\n MapViewStyleSource,\n MapViewTone,\n} from \"./map-view-types\";\nexport {\n MARKDOWN_CALLOUT_CLASSES,\n MARKDOWN_CALLOUT_ICON_ATTRIBUTES,\n type MarkdownInfoBlock,\n type MarkdownInfoBlockRenderInput,\n type MarkdownInfoBlockType,\n markdownInfoBlocks,\n renderMarkdownInfoBlock,\n scanMarkdownInfoBlock,\n} from \"./markdown-info-blocks\";\nexport {\n type MarkdownLinkInput,\n type MarkdownReference,\n type MarkdownReferenceKind,\n type MarkdownReferenceType,\n markdownLinkReference,\n markdownReferenceIcon,\n markdownReferenceType,\n markdownReferenceTypeLabel,\n markStandaloneLinks,\n renderMarkdownLink,\n} from \"./markdown-links\";\nexport { Pagination, type PaginationProps } from \"./Pagination\";\nexport type { PdfPreviewProps, PdfPreviewRequest } from \"./PdfPreview\";\nexport { default as PdfPreview } from \"./PdfPreview\";\nexport type { RangeOption, RangePickerProps } from \"./RangePicker\";\nexport { default as RangePicker } from \"./RangePicker\";\nexport { ReactionBar, type ReactionBarItem, type ReactionBarProps } from \"./ReactionBar\";\nexport type {\n ReferenceChipObjectProps,\n ReferenceChipPersonProps,\n ReferenceChipProps,\n ReferenceChipTimeProps,\n} from \"./ReferenceChip\";\nexport { REFERENCE_CHIP_MAX_CHARACTERS, ReferenceChip, truncateMiddle } from \"./ReferenceChip\";\nexport type { StepsProps } from \"./Steps\";\nexport { Steps } from \"./Steps\";\nexport type { StructuredDataPreviewMode, StructuredDataPreviewProps, StructuredDataValue } from \"./StructuredDataPreview\";\nexport { default as StructuredDataPreview, isStructuredDataValue } from \"./StructuredDataPreview\";\nexport type { TimelineColor, TimelineController, TimelineItem, TimelineProps } from \"./Timeline\";\nexport { default as Timeline } from \"./Timeline\";\nexport { VideoPlayer, type VideoPlayerProps } from \"./VideoPlayer\";\nexport type { VirtualFeedController, VirtualFeedProps, VirtualFeedScrollOptions } from \"./VirtualFeed\";\nexport { VirtualFeed } from \"./VirtualFeed\";\nexport type { ZoomPanAction, ZoomPanFullscreen, ZoomPanViewportProps } from \"./ZoomPanViewport\";\nexport { ZoomPanViewport } from \"./ZoomPanViewport\";\n"],"mappings":"AAoBA,SAAS,OAAO,IAAI,QAAQ,QAAQ,YAAY;AAGhD,SAAS,OAAO,IAAI,KAAK,QAAQ,SAAS;AAE1C,SAAS,aAAa,QAAQ,iBAAiB;AAE/C,SAAS,qBAAqB,QAAQ,yBAAyB;AAC/D,SAAS,mBAAmB,QAAuC,uBAAuB;AAC1F,SAAS,iBAAiB,QAAQ,qBAAqB;AAEvD,SAAS,OAAO,IAAI,WAAW,QAAQ,eAAe;AACtD,SAA2B,iBAAiB,QAAQ,gBAAgB;AAUpE,SAAS,mBAAmB,QAAQ,kBA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BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,QACb,kBAAkB;AACzB,SAAS,UAAU,QAA8B,cAAc;AAE/D,SAAS,OAAO,IAAI,UAAU,QAAQ,cAAc;AAEpD,SAAS,OAAO,IAAI,WAAW,QAAQ,eAAe;AACtD,SAAS,WAAW,QAAqD,eAAe;AAOxF,SAAS,6BAA6B,EAAE,aAAa,EAAE,cAAc,QAAQ,iBAAiB;AAE9F,SAAS,KAAK,QAAQ,SAAS;AAE/B,SAAS,OAAO,IAAI,qBAAqB,EAAE,qBAAqB,QAAQ,yBAAyB;AAEjG,SAAS,OAAO,IAAI,QAAQ,QAAQ,YAAY;AAChD,SAAS,WAAW,QAA+B,eAAe;AAElE,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,eAAe,QAAQ,mBAAmB","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["content/index.ts"],"sourcesContent":["export type {\n CalendarAttendee,\n CalendarCommand,\n CalendarController,\n CalendarCustomView,\n CalendarDayBadge,\n CalendarEvent,\n CalendarEventColor,\n CalendarEventRenderContext,\n CalendarEventTimeChange,\n CalendarExternalDrag,\n CalendarLabels,\n CalendarProps,\n CalendarQuickCreateControls,\n CalendarRange,\n CalendarRecurrence,\n CalendarResource,\n CalendarSelectionControls,\n CalendarView,\n} from \"./Calendar\";\nexport { default as Calendar } from \"./Calendar\";\n\nexport type { ChartKind, ChartLabels, ChartProps, ChartRenderOptions } from \"./Chart\";\nexport { default as Chart } from \"./Chart\";\nexport type { ChartExplorerColumn, ChartExplorerProps, ChartLegendEntry } from \"./ChartExplorer\";\nexport { ChartExplorer } from \"./ChartExplorer\";\nexport type { ChartExplorerControlsProps } from \"./ChartExplorerControls\";\nexport { ChartExplorerControls } from \"./ChartExplorerControls\";\nexport { ChartFilterControls, type ChartFilterControlsProps } from \"./ChartFilterControls\";\nexport { ChartSnapshotView } from \"./ChartSnapshotView\";\nexport type { CodeDisplayLanguage, CodeDisplayProps } from \"./CodeDisplay\";\nexport { default as CodeDisplay } from \"./CodeDisplay\";\nexport { type ChartCursor, createChartCursor } from \"./chart-cursor\";\nexport type {\n ChartExplorerCharts,\n ChartExplorerController,\n ChartExplorerData,\n ChartExplorerOptions,\n ChartExplorerRequest,\n ChartExplorerRow,\n ChartExplorerSnapshot,\n} from \"./chart-explorer\";\nexport { createChartExplorer } from \"./chart-explorer\";\nexport type { ChartDatumRef, ChartSelection, ChartTooltip, ChartTooltipFormatter } from \"./chart-inspection-core\";\nexport type { ChartSnapshot } from \"./chart-snapshot\";\nexport { prepareChartSnapshot } from \"./chart-snapshot\";\nexport type {\n StateTimelineChartOptions,\n StateTimelineDomain,\n StateTimelineInterval,\n StateTimelineRow,\n StateTimelineState,\n} from \"./chart-state-timeline\";\nexport { highlightSql } from \"./code-highlight\";\nexport { type CollectionSelection, createCollectionSelection, type SelectionModifiers } from \"./collection-selection\";\nexport type {\n DataTableColumn,\n DataTableControlsProps,\n DataTableFooter,\n DataTableHeaderProps,\n DataTablePanelFooterProps,\n DataTablePanelProps,\n DataTableProps,\n DataTableRenderCell,\n DataTableRenderHeader,\n DataTableSort,\n} from \"./DataTable\";\nexport { default as DataTable } from \"./DataTable\";\nexport type { DocCodeHighlighter, DocCodeProps, DocConcept, DocNoteVariant, DocRow } from \"./Docs\";\nexport { DocCode, DocConceptGrid, DocInlineCode, DocLead, DocNote, DocPage, DocRows, DocSection } from \"./Docs\";\nexport { FileBrowserPanel, type FileBrowserPanelProps, type FileSource, openFileBrowser } from \"./FileBrowser\";\nexport { FileGrid, type FileGridGroup, type FileGridOpenProps, type FileGridProps, type FileGridSelectableProps } from \"./FileGrid\";\nexport { default as FileTree, type FileTreeActions, type FileTreeEntry, type FileTreeProps } from \"./FileTree\";\nexport { type FileType, FileTypeIcon, type FileTypeIconProps, fileKindLabel, fileTypeOf } from \"./FileTypeIcon\";\nexport {\n canPreviewFile,\n default as FileView,\n type FileViewContent,\n type FileViewFile,\n type FileViewPreviewKind,\n type FileViewProps,\n type FileViewRenderer,\n type FileViewRendererProps,\n formatFileViewSize,\n getFileViewPreviewKind,\n} from \"./FileView\";\nexport type { KbdProps } from \"./Kbd\";\nexport { Kbd } from \"./Kbd\";\nexport type { LabelChipProps } from \"./LabelChip\";\nexport { LabelChip } from \"./LabelChip\";\nexport type { LightboxAction, LightboxImage } from \"./Lightbox\";\nexport { default as Lightbox } from \"./Lightbox\";\nexport type { LogTableEntry } from \"./LogEntriesTable\";\nexport { default as LogEntriesTable } from \"./LogEntriesTable\";\nexport { MapAttribution } from \"./MapAttribution\";\nexport { MapView } from \"./MapView\";\nexport { MapViewFrame } from \"./MapViewFrame\";\nexport { default as MarkdownView, type MarkdownRenderOptions, type MarkdownViewProps, renderSafeMarkdown } from \"./MarkdownView\";\nexport { type MatchRange, MatchText, type MatchTextProps, matchParts } from \"./MatchText\";\nexport type {\n MessageEventGroupProps,\n MessageEventRowProps,\n MessageGroupEntry,\n MessageRowAction,\n MessageRowAttachment,\n MessageRowAuthor,\n MessageRowFile,\n MessageRowMedia,\n MessageRowOrigin,\n MessageRowProgress,\n MessageRowProps,\n MessageRowQuote,\n MessageRowReaction,\n MessageRowStatus,\n MessageRowThread,\n MessageSystemRowProps,\n} from \"./MessageRow\";\nexport { MessageEventGroup, MessageEventRow, MessageRow, MessageSystemRow, startsMessageGroup } from \"./MessageRow\";\nexport { type MapPaletteColors, type MapTheme, mapPalette } from \"./map-palette\";\nexport { type MapStyleOptions, mapAttribution, mapStyle } from \"./map-style\";\nexport { MAP_SNAPSHOT_MAX_PIXELS, MapSnapshotError, type MapSnapshotErrorCode } from \"./map-view-snapshot\";\nexport type {\n MapViewArea,\n MapViewFit,\n MapViewFrameProps,\n MapViewHandle,\n MapViewLine,\n MapViewLineTone,\n MapViewMarker,\n MapViewOwnLocation,\n MapViewPoint,\n MapViewProps,\n MapViewSnapshot,\n MapViewSnapshotOptions,\n MapViewStyle,\n MapViewStyleSource,\n MapViewTone,\n} from \"./map-view-types\";\nexport {\n MARKDOWN_CALLOUT_CLASSES,\n MARKDOWN_CALLOUT_ICON_ATTRIBUTES,\n type MarkdownInfoBlock,\n type MarkdownInfoBlockRenderInput,\n type MarkdownInfoBlockType,\n markdownInfoBlocks,\n renderMarkdownInfoBlock,\n scanMarkdownInfoBlock,\n} from \"./markdown-info-blocks\";\nexport {\n type MarkdownLinkInput,\n type MarkdownReference,\n type MarkdownReferenceKind,\n type MarkdownReferenceType,\n markdownLinkReference,\n markdownReferenceIcon,\n markdownReferenceType,\n markdownReferenceTypeLabel,\n markStandaloneLinks,\n renderMarkdownLink,\n} from \"./markdown-links\";\nexport { Pagination, type PaginationProps } from \"./Pagination\";\nexport type { PdfPreviewProps, PdfPreviewRequest } from \"./PdfPreview\";\nexport { default as PdfPreview } from \"./PdfPreview\";\nexport type { RangeOption, RangePickerProps } from \"./RangePicker\";\nexport { default as RangePicker } from \"./RangePicker\";\nexport { ReactionBar, type ReactionBarItem, type ReactionBarProps } from \"./ReactionBar\";\nexport type {\n ReferenceChipObjectProps,\n ReferenceChipPersonProps,\n ReferenceChipProps,\n ReferenceChipTimeProps,\n} from \"./ReferenceChip\";\nexport { REFERENCE_CHIP_MAX_CHARACTERS, ReferenceChip, truncateMiddle } from \"./ReferenceChip\";\nexport type { StepsProps } from \"./Steps\";\nexport { Steps } from \"./Steps\";\nexport type { StructuredDataPreviewMode, StructuredDataPreviewProps, StructuredDataValue } from \"./StructuredDataPreview\";\nexport { default as StructuredDataPreview, isStructuredDataValue } from \"./StructuredDataPreview\";\nexport type { TimelineColor, TimelineController, TimelineItem, TimelineProps } from \"./Timeline\";\nexport { default as Timeline } from \"./Timeline\";\nexport { VideoPlayer, type VideoPlayerProps } from \"./VideoPlayer\";\nexport type { VirtualFeedController, VirtualFeedProps, VirtualFeedScrollOptions } from \"./VirtualFeed\";\nexport { VirtualFeed } from \"./VirtualFeed\";\nexport type { ZoomPanAction, ZoomPanFullscreen, ZoomPanViewportProps } from \"./ZoomPanViewport\";\nexport { ZoomPanViewport } from \"./ZoomP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AAgB;AAChI,SAA0B,SAAS,EAAuB,UAAU,QAAQ,aAAa;AAmBzF,SAAS,iBAAiB,EAAE,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAE,kBAAkB,QAAQ,cAAc;AACnH,SAA+C,UAAU,QAAQ,eAAe;AAChF,SAA+B,cAAc,EAAE,QAAQ,QAAQ,aAAa;AAC5E,SAAS,uBAAuB,EAAE,gBAAgB,QAAmC,qBAAqB;AAkB1G,SACE,wBAAwB,EACxB,gCAAgC,EAIhC,kBAAkB,EAClB,uBAAuB,EACvB,qBAAqB,QAChB,wBAAwB;AAC/B,SAKE,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,mBAAmB,EACnB,kBAAkB,QACb,kBAAkB;AACzB,SAAS,UAAU,QAA8B,cAAc;AAE/D,SAAS,OAAO,IAAI,UAAU,QAAQ,cAAc;AAEpD,SAAS,OAAO,IAAI,WAAW,QAAQ,eAAe;AACtD,SAAS,WAAW,QAAqD,eAAe;AAOxF,SAAS,6BAA6B,EAAE,aAAa,EAAE,cAAc,QAAQ,iBAAiB;AAE9F,SAAS,KAAK,QAAQ,SAAS;AAE/B,SAAS,OAAO,IAAI,qBAAqB,EAAE,qBAAqB,QAAQ,yBAAyB;AAEjG,SAAS,OAAO,IAAI,QAAQ,QAAQ,YAAY;AAChD,SAAS,WAAW,QAA+B,eAAe;AAElE,SAAS,WAAW,QAAQ,eAAe;AAE3C,SAAS,eAAe,QAAQ,mBAAmB","ignoreList":[]}
@@ -0,0 +1,23 @@
1
+ import { PbfReader } from "pbf";
2
+ const readGlyph = (tag, glyph, pbf) => {
3
+ if (tag === 1) glyph.id = pbf.readVarint();else if (tag === 2) glyph.bitmap = pbf.readBytes();else if (tag === 3) glyph.width = pbf.readVarint();else if (tag === 4) glyph.height = pbf.readVarint();else if (tag === 5) glyph.left = pbf.readSVarint();else if (tag === 6) glyph.top = pbf.readSVarint();else if (tag === 7) glyph.advance = pbf.readVarint();
4
+ };
5
+
6
+ /**
7
+ * Validate the glyphs MapLibre will decode before it can silently substitute local fonts.
8
+ * Uses the same PBF reader and 3px bitmap border as MapLibre 6, without allocating glyph images.
9
+ */
10
+ export function validateMapGlyphs(data) {
11
+ let count = 0;
12
+ new PbfReader(data).readFields((tag, _unused, pbf) => {
13
+ if (tag !== 1) return;
14
+ pbf.readMessage((tag, _unused, pbf) => {
15
+ if (tag !== 3) return;
16
+ const glyph = pbf.readMessage(readGlyph, {});
17
+ if (glyph.id === undefined || !Number.isInteger(glyph.id) || glyph.id < 0 || glyph.id > 0x10ffff || glyph.width === undefined || glyph.height === undefined || glyph.left === undefined || glyph.top === undefined || glyph.advance === undefined || !glyph.bitmap && (glyph.width !== 0 || glyph.height !== 0) || glyph.bitmap !== undefined && glyph.bitmap.byteLength !== (glyph.width + 6) * (glyph.height + 6)) throw new Error("Invalid map glyph data");
18
+ count++;
19
+ }, null);
20
+ }, null);
21
+ if (!count) throw new Error("Missing map glyph data");
22
+ }
23
+ //# sourceMappingURL=map-view-glyphs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["content/map-view-glyphs.ts"],"sourcesContent":["import { PbfReader } from \"pbf\";\n\ntype Glyph = { id?: number; bitmap?: Uint8Array; width?: number; height?: number; left?: number; top?: number; advance?: number };\nconst readGlyph = (tag: number, glyph: Glyph, pbf: PbfReader) => {\n if (tag === 1) glyph.id = pbf.readVarint();\n else if (tag === 2) glyph.bitmap = pbf.readBytes();\n else if (tag === 3) glyph.width = pbf.readVarint();\n else if (tag === 4) glyph.height = pbf.readVarint();\n else if (tag === 5) glyph.left = pbf.readSVarint();\n else if (tag === 6) glyph.top = pbf.readSVarint();\n else if (tag === 7) glyph.advance = pbf.readVarint();\n};\n\n/**\n * Validate the glyphs MapLibre will decode before it can silently substitute local fonts.\n * Uses the same PBF reader and 3px bitmap border as MapLibre 6, without allocating glyph images.\n */\nexport function validateMapGlyphs(data: ArrayBuffer): void {\n let count = 0;\n new PbfReader(data).readFields((tag, _unused, pbf) => {\n if (tag !== 1) return;\n pbf.readMessage((tag, _unused, pbf) => {\n if (tag !== 3) return;\n const glyph = pbf.readMessage<Glyph>(readGlyph, {});\n if (\n glyph.id === undefined ||\n !Number.isInteger(glyph.id) ||\n glyph.id < 0 ||\n glyph.id > 0x10ffff ||\n glyph.width === undefined ||\n glyph.height === undefined ||\n glyph.left === undefined ||\n glyph.top === undefined ||\n glyph.advance === undefined ||\n (!glyph.bitmap && (glyph.width !== 0 || glyph.height !== 0)) ||\n (glyph.bitmap !== undefined && glyph.bitmap.byteLength !== (glyph.width + 6) * (glyph.height + 6))\n )\n throw new Error(\"Invalid map glyph data\");\n count++;\n }, null);\n }, null);\n if (!count) throw new Error(\"Missing map glyph data\");\n}\n"],"mappings":"AAAA,SAAS,SAAS,QAAQ,KAAK;AAG/B,MAAM,SAAS,GAAG,CAAC,GAAW,EAAE,KAAY,EAAE,GAAc,KAAK;EAC/D,IAAI,GAAG,KAAK,CAAC,EAAE,KAAK,CAAC,EAAE,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,KACtC,IAAI,GAAG,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC,KAC9C,IAAI,GAAG,KAAK,CAAC,EAAE,KAAK,CAAC,KAAK,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,KAC9C,IAAI,GAAG,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,KAC/C,IAAI,GAAG,KAAK,CAAC,EAAE,KAAK,CAAC,IAAI,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,KAC9C,IAAI,GAAG,KAAK,CAAC,EAAE,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,KAC7C,IAAI,GAAG,KAAK,CAAC,EAAE,KAAK,CAAC,OAAO,GAAG,GAAG,CAAC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AAK,CAAC,wBAAwB,CAAC;AACvD","ignoreList":[]}
@@ -2,40 +2,63 @@
2
2
  import { addProtocol, LngLat, Map, removeProtocol, setWorkerUrl } from "maplibre-gl";
3
3
  // The build points this at a copy named map-view-worker.js, because @k2b/ssr serves only .js files.
4
4
  import workerUrl from "./map-view-worker.js" with { type: "file" };
5
- export function createMap(options, onResourceError) {
5
+ import { validateMapGlyphs } from "./map-view-glyphs";
6
+ let resourceProtocolId = 0;
7
+ export function createMap(options, resourceFailed) {
6
8
  setWorkerUrl(new URL(workerUrl, import.meta.url).href);
7
- // MapLibre catches glyph fetch failures and silently renders a fallback font. Use its
8
- // public protocol hook so the host can retain geometry and offer a visible retry.
9
- const protocol = `k2b-glyph-${crypto.randomUUID()}`;
10
- addProtocol(protocol, async (params, controller) => {
9
+ // MapLibre 6 substitutes local glyphs on failure and treats HTTP 404 tiles as empty.
10
+ // A map error listener cannot observe either failure. Use its public protocol hook to keep failure explicit,
11
+ // without a second request, global fetch patch, provider URL, or cross-map shared state.
12
+ const protocol = `k2b-map-resource-${++resourceProtocolId}`;
13
+ const lifetime = new AbortController();
14
+ addProtocol(protocol, async (request, cancellation) => {
15
+ const signal = AbortSignal.any([lifetime.signal, cancellation.signal]);
11
16
  try {
12
- const url = new URL(params.url).searchParams.get("url");
13
- if (!url) throw new Error("Map glyph unavailable");
14
- const response = await fetch(url, {
15
- headers: params.headers,
16
- credentials: params.credentials ?? "same-origin",
17
- signal: controller.signal
17
+ const path = request.url.slice(protocol.length + 3);
18
+ const separator = path.indexOf("/");
19
+ const glyph = path.slice(0, separator) === "Glyphs";
20
+ const response = await fetch(decodeURIComponent(path.slice(separator + 1)), {
21
+ method: request.method,
22
+ headers: request.headers,
23
+ body: request.body,
24
+ credentials: request.credentials ?? "same-origin",
25
+ cache: request.cache,
26
+ referrerPolicy: request.referrerPolicy,
27
+ signal
18
28
  });
19
- if (!response.ok) throw new Error("Map glyph unavailable");
29
+ if (!response.ok) {
30
+ void response.body?.cancel().catch(() => {});
31
+ throw new Error("Map resource failed");
32
+ }
33
+ const data = await response.arrayBuffer();
34
+ signal.throwIfAborted();
35
+ if (glyph) validateMapGlyphs(data);
20
36
  return {
21
- data: await response.arrayBuffer()
37
+ data,
38
+ cacheControl: response.headers.get("cache-control") ?? undefined,
39
+ expires: response.headers.get("expires") ?? undefined,
40
+ etag: response.headers.get("etag") ?? undefined
22
41
  };
23
42
  } catch {
24
- if (!controller.signal.aborted) onResourceError();
25
- throw new Error("Map glyph unavailable");
43
+ if (!signal.aborted) resourceFailed();
44
+ throw new Error("Map resource failed");
26
45
  }
27
46
  });
47
+ const clean = () => {
48
+ lifetime.abort();
49
+ removeProtocol(protocol);
50
+ };
28
51
  let map;
29
52
  try {
30
53
  map = new Map({
31
54
  ...options,
32
- async transformRequest(url, type) {
55
+ transformRequest: async (url, type) => {
33
56
  const request = (await options.transformRequest?.(url, type)) ?? {
34
57
  url
35
58
  };
36
- return type === "Glyphs" ? {
59
+ return type === "Glyphs" || type === "Tile" ? {
37
60
  ...request,
38
- url: `${protocol}://glyph?url=${encodeURIComponent(new URL(request.url, document.baseURI).href)}`
61
+ url: `${protocol}://${type}/${encodeURIComponent(new URL(request.url, location.href).href)}`
39
62
  } : request;
40
63
  },
41
64
  // MapLibre would move a wide or polar fit to keep the poles out of view; the server frame cannot know that rule,
@@ -45,11 +68,11 @@ export function createMap(options, onResourceError) {
45
68
  zoom: Math.max(options.minZoom ?? -2, Math.min(options.maxZoom ?? 22, zoom))
46
69
  })
47
70
  });
48
- } catch (cause) {
49
- removeProtocol(protocol);
50
- throw cause;
71
+ } catch (error) {
72
+ clean();
73
+ throw error;
51
74
  }
52
- map.on("remove", () => removeProtocol(protocol));
75
+ map.on("remove", clean);
53
76
  map.touchZoomRotate.disableRotation();
54
77
  map.keyboard.disableRotation();
55
78
  // The shared overlay projects a flat, north-up Mercator plane even if a style requests a globe.
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["content/map-view-live.ts"],"sourcesContent":["/// <reference path=\"./maplibre-worker.d.ts\" />\nimport { addProtocol, LngLat, Map, type MapOptions, removeProtocol, setWorkerUrl } from \"maplibre-gl\";\n// The build points this at a copy named map-view-worker.js, because @k2b/ssr serves only .js files.\nimport workerUrl from \"maplibre-gl/dist/maplibre-gl-worker.mjs\" with { type: \"file\" };\n\nexport function createMap(options: MapOptions, onResourceError: () => void): Map {\n setWorkerUrl(new URL(workerUrl, import.meta.url).href);\n // MapLibre catches glyph fetch failures and silently renders a fallback font. Use its\n // public protocol hook so the host can retain geometry and offer a visible retry.\n const protocol = `k2b-glyph-${crypto.randomUUID()}`;\n addProtocol(protocol, async (params, controller) => {\n try {\n const url = new URL(params.url).searchParams.get(\"url\");\n if (!url) throw new Error(\"Map glyph unavailable\");\n const response = await fetch(url, {\n headers: params.headers,\n credentials: params.credentials ?? \"same-origin\",\n signal: controller.signal,\n });\n if (!response.ok) throw new Error(\"Map glyph unavailable\");\n return { data: await response.arrayBuffer() };\n } catch {\n if (!controller.signal.aborted) onResourceError();\n throw new Error(\"Map glyph unavailable\");\n }\n });\n let map: Map;\n try {\n map = new Map({\n ...options,\n async transformRequest(url, type) {\n const request = (await options.transformRequest?.(url, type)) ?? { url };\n return type === \"Glyphs\"\n ? { ...request, url: `${protocol}://glyph?url=${encodeURIComponent(new URL(request.url, document.baseURI).href)}` }\n : request;\n },\n // MapLibre would move a wide or polar fit to keep the poles out of view; the server frame cannot know that rule,\n // so the camera stays where fitCamera puts it and only latitude and zoom keep their ordinary limits.\n transformConstrain: (center, zoom) => ({\n center: new LngLat(center.lng, Math.max(-85.051129, Math.min(85.051129, center.lat))),\n zoom: Math.max(options.minZoom ?? -2, Math.min(options.maxZoom ?? 22, zoom)),\n }),\n });\n } catch (cause) {\n removeProtocol(protocol);\n throw cause;\n }\n map.on(\"remove\", () => removeProtocol(protocol));\n map.touchZoomRotate.disableRotation();\n map.keyboard.disableRotation();\n // The shared overlay projects a flat, north-up Mercator plane even if a style requests a globe.\n // Terrain would lift features off that plane, so a style's terrain is switched off as well.\n map.on(\"style.load\", () => {\n map.setProjection({ type: \"mercator\" });\n if (map.getTerrain()) map.setTerrain(null);\n });\n return map;\n}\n"],"mappings":"AAAA;AACA,SAAS,WAAW,EAAE,MAAM,EAAE,GAAG,EAAmB,cAAc,EAAE,YAAY,QAAQ,aAAa;AACrG;AACA,OAAO,SAAS,MAAM,yCAAyC,QAAQ,IAAI,EAAE,MAAM;AAEnF,OAAO,SAAS,SAAS,CAAC,OAAmB,EAAE,eAA2B,EAAO;EAC/E,YAAY,CAAC,IAAI,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;EACtD;EACA;EACA,MAAM,QAAQ,GAAG,aAAa,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE;EACnD,WAAW,CAAC,QAAQ,EAAE,OAAO,MAAM,EAAE,UAAU,KAAK;IAClD,IAAI;MACF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC;MACvD,IAAI,CAAC,GAAG,EAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC;MAClD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;QAChC,OAAO,EAAE,MAAM,CAAC,OAAO;QACvB,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,aAAa;QAChD,MAAM,EAAE,UAAU,CAAC;MACrB,CAAC,CAAC;MACF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC;MAC1D,OAAO;QAAE,IAAI,EAAE,MAAM,QAAQ,CAAC,WAAW,CAAC;MAAE,CAAC;IAC/C,CAAC,CAAC,MAAM;MACN,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,OAAO,EAAE,eAAe,CAAC,CAAC;MACjD,MAAM,IAAI,KAAK,CAAC,uBAAuB,C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Y,EAAE,MAAM;IACzB,GAAG,CAAC,aAAa,CAAC;MAAE,IAAI,EAAE;IAAW,CAAC,CAAC;IACvC,IAAI,GAAG,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;EAC5C,CAAC,CAAC;EACF,OAAO,GAAG;AACZ","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["content/map-view-live.ts"],"sourcesContent":["/// <reference path=\"./maplibre-worker.d.ts\" />\nimport { addProtocol, LngLat, Map, type MapOptions, removeProtocol, setWorkerUrl } from \"maplibre-gl\";\n// The build points this at a copy named map-view-worker.js, because @k2b/ssr serves only .js files.\nimport workerUrl from \"maplibre-gl/dist/maplibre-gl-worker.mjs\" with { type: \"file\" };\n\nimport { validateMapGlyphs } from \"./map-view-glyphs\";\n\nlet resourceProtocolId = 0;\n\nexport function createMap(options: MapOptions, resourceFailed: () => void): Map {\n setWorkerUrl(new URL(workerUrl, import.meta.url).href);\n // MapLibre 6 substitutes local glyphs on failure and treats HTTP 404 tiles as empty.\n // A map error listener cannot observe either failure. Use its public protocol hook to keep failure explicit,\n // without a second request, global fetch patch, provider URL, or cross-map shared state.\n const protocol = `k2b-map-resource-${++resourceProtocolId}`;\n const lifetime = new AbortController();\n addProtocol(protocol, async (request, cancellation) => {\n const signal = AbortSignal.any([lifetime.signal, cancellation.signal]);\n try {\n const path = request.url.slice(protocol.length + 3);\n const separator = path.indexOf(\"/\");\n const glyph = path.slice(0, separator) === \"Glyphs\";\n const response = await fetch(decodeURIComponent(path.slice(separator + 1)), {\n method: request.method,\n headers: request.headers,\n body: request.body,\n credentials: request.credentials ?? \"same-origin\",\n cache: request.cache,\n referrerPolicy: request.referrerPolicy,\n signal,\n });\n if (!response.ok) {\n void response.body?.cancel().catch(() => {});\n throw new Error(\"Map resource failed\");\n }\n const data = await response.arrayBuffer();\n signal.throwIfAborted();\n if (glyph) validateMapGlyphs(data);\n return {\n data,\n cacheControl: response.headers.get(\"cache-control\") ?? undefined,\n expires: response.headers.get(\"expires\") ?? undefined,\n etag: response.headers.get(\"etag\") ?? undefined,\n };\n } catch {\n if (!signal.aborted) resourceFailed();\n throw new Error(\"Map resource failed\");\n }\n });\n const clean = () => {\n lifetime.abort();\n removeProtocol(protocol);\n };\n let map: Map;\n try {\n map = new Map({\n ...options,\n transformRequest: async (url, type) => {\n const request = (await options.transformRequest?.(url, type)) ?? { url };\n return type === \"Glyphs\" || type === \"Tile\"\n ? { ...request, url: `${protocol}://${type}/${encodeURIComponent(new URL(request.url, location.href).href)}` }\n : request;\n },\n // MapLibre would move a wide or polar fit to keep the poles out of view; the server frame cannot know that rule,\n // so the camera stays where fitCamera puts it and only latitude and zoom keep their ordinary limits.\n transformConstrain: (center, zoom) => ({\n center: new LngLat(center.lng, Math.max(-85.051129, Math.min(85.051129, center.lat))),\n zoom: Math.max(options.minZoom ?? -2, Math.min(options.maxZoom ?? 22, zoom)),\n }),\n });\n } catch (error) {\n clean();\n throw error;\n }\n map.on(\"remove\", clean);\n map.touchZoomRotate.disableRotation();\n map.keyboard.disableRotation();\n // The shared overlay projects a flat, north-up Mercator plane even if a style requests a globe.\n // Terrain would lift features off that plane, so a style's terrain is switched off as well.\n map.on(\"style.load\", () => {\n map.setProjection({ type: \"mercator\" });\n if (map.getTerrain()) map.setTerrain(null);\n });\n return map;\n}\n"],"mappings":"AAAA;AACA,SAAS,WAAW,EAAE,MAAM,EAAE,GAAG,EAAmB,cAAc,EAAE,YAAY,QAAQ,aAAa;AACrG;AACA,OAAO,SAAS,MAAM,yCAAyC,QAAQ,IAAI,EAAE,MAAM;AAEnF,SAAS,iBAAiB,QAAQ,mBAAmB;AAErD,IAAI,kBAAkB,GAAG,CAAC;AAE1B,OAAO,SAAS,SAAS,CAAC,OAAmB,EAAE,cAA0B,EAAO;EAC9E,YAAY,CAAC,IAAI,GAAG,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC;EACtD;EACA;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