@dxos/react-ui-thread 0.9.1-main.c7dcc2e112 → 0.9.1-staging.ee54ba693a

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/Thread/Thread.tsx", "../../../src/command.ts", "../../../src/context.ts", "../../../src/Message/Message.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, {\n type ComponentPropsWithRef,\n type ReactNode,\n forwardRef,\n type PropsWithChildren,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { Obj } from '@dxos/echo';\nimport {\n type ComposableProps,\n Icon,\n IconButton,\n ScrollArea,\n type ThemedClassName,\n composable,\n composableProps,\n useThemeContext,\n useTranslation,\n} from '@dxos/react-ui';\nimport { Mosaic, type MosaicTileProps } from '@dxos/react-ui-mosaic';\nimport { type Message as MessageType } from '@dxos/types';\nimport { type Extension, createBasicExtensions, createThemeExtensions, listener } from '@dxos/ui-editor';\nimport { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/ui-theme';\n\nimport { command } from '../command';\nimport { ThreadContextProvider, useThreadContext } from '../context';\nimport { Message } from '../Message';\nimport { translationKey } from '../translations';\nimport { type MessageMetadata, type ThreadContextValue } from '../types';\n\nconst getMessageId = (message: MessageType.Message) => Obj.getURI(message);\n\n//\n// Root\n//\n\nexport type ThreadRootProps = PropsWithChildren<\n Omit<ThreadContextValue, 'components'> & Partial<Pick<ThreadContextValue, 'components'>>\n>;\n\n/**\n * Headless root of a thread. Provides message-tile context (metadata resolver,\n * injected renderers, callbacks) and the Mosaic root that `Thread.Messages`\n * renders its virtual stack within. Renders no DOM of its own — wrap the visible\n * thread chrome in `Thread.Content`.\n */\nconst ThreadRoot = ({\n children,\n getMetadata,\n components,\n identityDid,\n editable,\n onMessageDelete,\n onAcceptProposal,\n}: ThreadRootProps) => {\n // Composer focus handler registered by Thread.Textbox; invoked by Thread.Header's caret.\n const composerFocus = useRef<(() => void) | undefined>(undefined);\n\n const registerComposerFocus = useCallback((focus: (() => void) | undefined) => {\n composerFocus.current = focus;\n }, []);\n\n const focusComposer = useCallback(() => composerFocus.current?.(), []);\n\n return (\n <ThreadContextProvider\n getMetadata={getMetadata}\n components={components ?? {}}\n identityDid={identityDid}\n editable={editable}\n registerComposerFocus={registerComposerFocus}\n focusComposer={focusComposer}\n onMessageDelete={onMessageDelete}\n onAcceptProposal={onAcceptProposal}\n >\n <Mosaic.Root>{children}</Mosaic.Root>\n </ThreadContextProvider>\n );\n};\n\nThreadRoot.displayName = 'Thread.Root';\n\n//\n// Content\n//\n\ntype ThreadContentExtra = {\n id?: string;\n current?: boolean | string;\n} & Pick<ComponentPropsWithRef<'div'>, 'onClickCapture' | 'onFocusCapture'>;\n\nexport type ThreadContentProps = ComposableProps<ThreadContentExtra>;\n\n/** Visible thread container (the attention surface that hosts header / messages / composer). */\nconst ThreadContent = composable<HTMLDivElement, ThreadContentExtra>(\n ({ children, current, id, ...props }, forwardedRef) => {\n return (\n <div\n {...composableProps(props, {\n role: 'group',\n classNames: [\n 'flex flex-col bg-[var(--surface-bg)] current-related dx-attention-surface [--controls-opacity:0]',\n hoverableFocusedWithinControls,\n ],\n })}\n data-testid='thread'\n id={id}\n aria-current={current ? 'location' : undefined}\n ref={forwardedRef}\n >\n {children}\n </div>\n );\n },\n);\n\nThreadContent.displayName = 'Thread.Content';\n\n//\n// Header\n//\n\nexport type ThreadHeaderProps = Omit<\n ComposableProps<{\n /** Snippet text rendered inside a `<p>` (a string, not a DOM element). */\n title?: string;\n detached?: boolean;\n /** Whether this is the current/selected thread; accents the title. */\n current?: boolean;\n /** Trailing controls rendered in the right column (aligns with message-tile controls). */\n controls?: ReactNode;\n /** Invoked when the caret affordance is activated to select/focus this thread. */\n onSelect?: () => void;\n }>,\n 'children'\n>;\n\n/**\n * Thread header row: caret (rail) · snippet (content) · controls. Owns its own\n * `[rail · 1fr · controls]` grid so the trailing controls align with message-tile\n * controls (which use the same template) — no grid is leaked in from the caller.\n */\nconst ThreadHeader = composable<HTMLDivElement, ThreadHeaderProps>(\n ({ title, detached, current, controls, onSelect, ...props }, forwardedRef) => {\n const { t } = useTranslation(translationKey);\n const { focusComposer } = useThreadContext('Thread.Header');\n const handleSelect = useCallback(() => {\n onSelect?.();\n focusComposer();\n }, [onSelect, focusComposer]);\n\n return (\n <div\n {...composableProps(props, {\n classNames: [\n 'grid grid-cols-[var(--dx-rail-size)_1fr_min-content] items-center',\n hoverableControls,\n hoverableFocusedWithinControls,\n ],\n })}\n ref={forwardedRef}\n >\n <div className='flex items-center justify-center'>\n <IconButton\n iconOnly\n variant='ghost'\n density='sm'\n icon='ph--caret-double-right--regular'\n label={t('select-thread.label')}\n classNames='text-description'\n onClick={handleSelect}\n />\n </div>\n <div className='flex items-center overflow-hidden'>\n <p\n role='heading'\n data-testid='thread.heading'\n className={mx(\n 'me-2 font-medium truncate italic',\n current ? 'text-accent-text' : 'text-description',\n detached && 'line-through decoration-1',\n )}\n >\n {title}\n </p>\n </div>\n {controls}\n </div>\n );\n },\n);\n\nThreadHeader.displayName = 'Thread.Header';\n\n//\n// Messages\n//\n\nconst MessageTileAdapter = ({\n id,\n data,\n location,\n draggable,\n current,\n selected,\n}: MosaicTileProps<MessageType.Message>) => (\n <Mosaic.Tile id={id} data={data} location={location} draggable={draggable} current={current} selected={selected}>\n <Message.Tile message={data} />\n </Mosaic.Tile>\n);\n\nexport type ThreadMessagesProps = ThemedClassName<{\n messages: readonly MessageType.Message[];\n /** Estimated tile height for the virtualizer. */\n estimateSize?: number;\n currentId?: string;\n}>;\n\n/** Virtualized stack of message tiles (via Mosaic), within an internal scroll area. */\nconst ThreadMessages = ({ messages, estimateSize = 80, currentId, classNames }: ThreadMessagesProps) => {\n const [viewport, setViewport] = useState<HTMLElement | null>(null);\n const items = useMemo(() => messages.filter(Boolean), [messages]);\n\n return (\n <Mosaic.Container\n asChild\n orientation='vertical'\n autoScroll={viewport}\n currentId={currentId}\n eventHandler={{ id: 'thread', canDrop: () => false }}\n >\n <ScrollArea.Root classNames={mx('col-span-2', classNames)} orientation='vertical'>\n <ScrollArea.Viewport ref={setViewport}>\n <Mosaic.VirtualStack\n items={items}\n getId={getMessageId}\n Tile={MessageTileAdapter}\n draggable={false}\n getScrollElement={() => viewport}\n estimateSize={() => estimateSize}\n />\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n </Mosaic.Container>\n );\n};\n\nThreadMessages.displayName = 'Thread.Messages';\n\n//\n// Textbox\n//\n\nexport type ThreadTextboxProps = MessageMetadata & {\n placeholder?: string;\n autoFocus?: boolean;\n disabled?: boolean;\n extensions?: Extension;\n /**\n * Called with the composer content on send. Return `true` to accept (the\n * editor is cleared and remounted), `false` to reject.\n */\n onSend?: (text: string) => boolean;\n};\n\n/** Message composer pinned at the foot of a thread. */\nconst ThreadTextbox = ({ placeholder, autoFocus, disabled, extensions, onSend, ...metadata }: ThreadTextboxProps) => {\n const { t } = useTranslation(translationKey);\n const { themeMode } = useThemeContext();\n const { registerComposerFocus } = useThreadContext('Thread.Textbox');\n const composerRef = useRef<{ focus: () => void } | null>(null);\n const messageRef = useRef('');\n const [count, setCount] = useState(0);\n\n // Expose the composer's focus to Thread.Root so the header caret can focus it.\n useEffect(() => {\n registerComposerFocus(() => composerRef.current?.focus());\n return () => registerComposerFocus(undefined);\n }, [registerComposerFocus]);\n\n const editorExtensions = useMemo(\n () =>\n [\n createBasicExtensions({ placeholder: placeholder ?? t('message.placeholder') }),\n createThemeExtensions({ themeMode }),\n listener({ onChange: ({ text }) => (messageRef.current = text) }),\n command,\n extensions,\n ].filter(Boolean) as Extension[],\n [themeMode, placeholder, t, extensions, count],\n );\n\n const handleSend = useCallback(() => {\n const text = messageRef.current;\n if (!text?.length || !onSend) {\n return;\n }\n if (onSend(text)) {\n messageRef.current = '';\n setCount((value) => value + 1);\n }\n }, []);\n\n return (\n <Message.Textbox\n ref={composerRef}\n {...metadata}\n autoFocus={autoFocus}\n disabled={disabled}\n extensions={editorExtensions}\n onSend={handleSend}\n />\n );\n};\n\nThreadTextbox.displayName = 'Thread.Textbox';\n\n//\n// Status\n//\n\nexport type ThreadStatusProps = ThemedClassName<PropsWithChildren> & {\n activity?: boolean;\n};\n\nconst ThreadStatus = forwardRef<HTMLDivElement, ThreadStatusProps>(\n ({ activity, classNames, children, ...props }, forwardedRef) => {\n const { t } = useTranslation(translationKey);\n return (\n <div\n {...props}\n className={mx(\n 'col-start-2 grid grid-cols-[min-content_1fr_max-content] pb-2 pe-2 text-xs text-description',\n classNames,\n )}\n ref={forwardedRef}\n >\n <Icon\n icon='ph--spinner--bold'\n classNames='w-6 h-4 invisible data-[visible=show]:visible animate-spin-slow'\n data-visible={activity ? 'show' : 'hide'}\n />\n <span className='truncate min-w-0' aria-live='polite'>\n {activity ? children : null}\n </span>\n <span className={mx('text-end', hoverableControlItem)}>{t('enter-to-send.message')}</span>\n </div>\n );\n },\n);\n\nThreadStatus.displayName = 'Thread.Status';\n\n//\n// Thread\n//\n\nexport const Thread = {\n Root: ThreadRoot,\n Content: ThreadContent,\n Header: ThreadHeader,\n Messages: ThreadMessages,\n Textbox: ThreadTextbox,\n Status: ThreadStatus,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { HighlightStyle, StreamLanguage, syntaxHighlighting } from '@codemirror/language';\nimport { type Extension } from '@codemirror/state';\nimport { EditorView } from '@codemirror/view';\n\nimport { tags } from '@dxos/ui-editor';\nimport { mx } from '@dxos/ui-theme';\n\n/**\n * Highlights leading slash-commands (e.g. `/resolve`) and `@mention` tags\n * (e.g. `@Kai`, anywhere) in the message composer.\n * https://github.com/codemirror/stream-parser/blob/main/test/test-stream-parser.ts\n */\nconst parser = StreamLanguage.define<{ count: number }>({\n startState: () => ({ count: 0 }),\n token: (stream, state) => {\n state.count++;\n if (stream.eatSpace()) {\n return null;\n }\n // Leading slash-command (first token only).\n if (state.count === 1 && stream.match(/^\\/\\w+/)) {\n return 'tagName';\n }\n // @mention (anywhere).\n if (stream.match(/^@\\w+/)) {\n return 'labelName';\n }\n stream.next();\n return null;\n },\n});\n\nconst styles = HighlightStyle.define([\n {\n tag: tags.tagName,\n class: mx('dx-tag dx-tag--indigo'),\n },\n {\n tag: tags.labelName,\n class: mx('dx-tag dx-tag--blue'),\n },\n]);\n\n// Center the inline `.dx-tag` pills on the text line. `.dx-tag` is `inline-block`\n// with vertical padding, so on a CodeMirror line it baseline-aligns and rides\n// high; overriding `vertical-align` recentres it (cf. the `cm-reference-pill`\n// precedent in `@dxos/react-ui-chat`).\nconst theme = EditorView.theme({\n '.dx-tag': {\n verticalAlign: 'bottom',\n },\n});\n\nexport const command: Extension = [parser, syntaxHighlighting(styles), theme];\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\n\nimport { type ThreadContextValue } from './types';\n\n/**\n * Context provided by `Thread.Root` and consumed by its parts. Extends the\n * consumer-facing {@link ThreadContextValue} with internal coordination (e.g.\n * focusing the composer from the header's select affordance).\n */\nexport type ThreadContext = ThreadContextValue & {\n /** Register the composer's focus handler (set by `Thread.Textbox`). */\n registerComposerFocus: (focus: (() => void) | undefined) => void;\n /** Focus the thread composer (used by `Thread.Header`'s select affordance). */\n focusComposer: () => void;\n};\n\nexport const [ThreadContextProvider, useThreadContext] = createContext<ThreadContext>('Thread');\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { EditorView } from '@codemirror/view';\nimport { formatDistanceToNow } from 'date-fns/formatDistanceToNow';\nimport React, {\n type ComponentPropsWithRef,\n type ComponentPropsWithoutRef,\n type ReactNode,\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\n\nimport { Obj, Ref } from '@dxos/echo';\nimport {\n Avatar,\n IconButton,\n type ThemedClassName,\n useOnTransition,\n useThemeContext,\n useTranslation,\n} from '@dxos/react-ui';\nimport { type UseTextEditorProps, useTextEditor } from '@dxos/react-ui-editor';\nimport { type ContentBlock, type Message as MessageType } from '@dxos/types';\nimport { createBasicExtensions, createThemeExtensions, keymap, listener } from '@dxos/ui-editor';\nimport { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/ui-theme';\nimport { hexToEmoji, hexToHue, isTruthy } from '@dxos/util';\n\nimport { command } from '../command';\nimport { useThreadContext } from '../context';\nimport { translationKey } from '../translations';\nimport { type MessageMetadata } from '../types';\n\nconst avatarSize = 7;\n\nconst buttonGroupClassNames = 'flex flex-row items-center gap-0.5 pe-2';\nconst buttonClassNames = 'p-1! transition-opacity';\n\n//\n// Root\n//\n\nexport type MessageRootProps = ThemedClassName<\n ComponentPropsWithRef<'div'> & MessageMetadata & Partial<{ continues: boolean; controls: ReactNode }>\n>;\n\n// TODO(burdon): Show authorName on tooltip.\nconst MessageRoot = forwardRef<HTMLDivElement, MessageRootProps>(\n (\n {\n authorImgSrc,\n authorId,\n authorName,\n authorAvatarProps,\n continues = true,\n controls,\n children,\n classNames,\n ...rootProps\n },\n forwardedRef,\n ) => {\n // Must wrap the message since Avatar.Label may be used in the content.\n // Columns mirror Thread.Header (avatar/rail · content · controls) so trailing\n // controls align with the thread header's controls.\n return (\n <Avatar.Root>\n <div\n data-testid='thread.message'\n {...rootProps}\n className={mx('grid grid-cols-[var(--dx-rail-size)_1fr_min-content] w-full', classNames)}\n ref={forwardedRef}\n >\n <div className='flex flex-col items-center gap-2 pt-1'>\n <Avatar.Content\n size={avatarSize}\n hue={authorAvatarProps?.hue || hexToHue(authorId ?? '0')}\n fallback={authorAvatarProps?.emoji || hexToEmoji(authorId ?? '0')}\n {...(authorImgSrc && { imgSrc: authorImgSrc })}\n />\n {continues && <div className='w-px grow bg-separator' />}\n </div>\n <div className='py-1 min-w-0'>{children}</div>\n {controls && <div className='self-start'>{controls}</div>}\n </div>\n </Avatar.Root>\n );\n },\n);\n\nMessageRoot.displayName = 'Message.Root';\n\n//\n// Heading\n//\n\nexport type MessageHeadingProps = ThemedClassName<ComponentPropsWithoutRef<'div'>> &\n Pick<MessageMetadata, 'authorName' | 'timestamp'>;\n\nconst MessageHeading = ({ children, classNames, timestamp, authorName, ...props }: MessageHeadingProps) => {\n return (\n <div {...props} className={mx('flex gap-2 items-start', classNames)}>\n <p className='grow'>\n <MessageAuthorName authorName={authorName} />\n {timestamp && <MessageTime timestamp={timestamp} />}\n </p>\n {children}\n </div>\n );\n};\n\nMessageHeading.displayName = 'Message.Heading';\n\nexport type MessageAuthorNameProps = Pick<MessageMetadata, 'authorName'>;\n\nconst MessageAuthorName = ({ authorName }: MessageAuthorNameProps) => {\n const { t } = useTranslation(translationKey);\n return (\n <Avatar.Label classNames='block truncate text-sm text-subdued'>{authorName ?? t('anonymous.label')}</Avatar.Label>\n );\n};\n\nMessageAuthorName.displayName = 'Message.AuthorName';\n\nexport type MessageTimeProps = Pick<MessageMetadata, 'timestamp'>;\n\nconst MessageTime = ({ timestamp }: MessageTimeProps) => {\n const { dtLocale } = useTranslation(translationKey);\n const dt = timestamp ? new Date(timestamp) : undefined;\n return (\n <time className='block text-subdued text-xs pb-0.5' dateTime={dt?.toISOString()}>\n {dt ? formatDistanceToNow(dt, { locale: dtLocale, addSuffix: true }) : ''}\n </time>\n );\n};\n\nMessageTime.displayName = 'Message.Time';\n\n//\n// Body\n//\n\nexport type MessageBodyProps = {\n /** The message whose content blocks are rendered. */\n message: MessageType.Message;\n /** When true, the local user authored this message. */\n isAuthor?: boolean;\n /** When true, the text block is editable. */\n editing?: boolean;\n /** Persist an edited text block. */\n onSave?: (text: string) => void;\n};\n\n/**\n * Renders a message's content blocks: text (via editor), proposal, and\n * object/reference tiles (delegated to the injected `Object` component).\n */\nconst MessageBody = ({ message, isAuthor, editing, onSave }: MessageBodyProps) => {\n const { components } = useThreadContext('Message.Body');\n const textBlockIndex = message.blocks.findIndex((block) => block._tag === 'text');\n const textBlock = textBlockIndex !== -1 ? (message.blocks[textBlockIndex] as ContentBlock.Text) : undefined;\n const proposalBlock = message.blocks.find((block) => block._tag === 'proposal') as ContentBlock.Proposal | undefined;\n const references = message.blocks\n .filter((block) => block._tag === 'reference')\n .map((block) => (block as ContentBlock.Reference).reference);\n const Object = components.Object;\n\n return (\n <>\n {textBlock && <TextBlock block={textBlock} isAuthor={isAuthor} editing={editing} onSave={onSave} />}\n {proposalBlock && <div className='me-4 italic'>{proposalBlock.text}</div>}\n {Object &&\n Ref.Array.targets(references).map((reference, index) => (\n <Object key={index} subject={reference as Obj.Unknown} />\n ))}\n </>\n );\n};\n\nMessageBody.displayName = 'Message.Body';\n\nconst TextBlock = ({\n block,\n isAuthor,\n editing,\n onSave,\n}: {\n block: ContentBlock.Text;\n isAuthor?: boolean;\n editing?: boolean;\n onSave?: (text: string) => void;\n}) => {\n const { themeMode } = useThemeContext();\n const inMemoryContentRef = useRef(block.text);\n\n const handleDocumentChange = useCallback((next: string) => {\n inMemoryContentRef.current = next;\n }, []);\n\n const saveDocumentChange = useCallback(() => {\n onSave?.(inMemoryContentRef.current);\n }, [onSave]);\n\n useOnTransition(editing, true, false, saveDocumentChange);\n\n const { parentRef, focusAttributes, view } = useTextEditor(\n () => ({\n initialValue: block.text,\n extensions: [\n createBasicExtensions({ readOnly: !isAuthor || !editing }),\n createThemeExtensions({ themeMode }),\n command,\n EditorView.updateListener.of((update) => {\n if (update.docChanged) {\n handleDocumentChange(update.state.doc.toString());\n }\n }),\n ],\n }),\n [block.text, editing, isAuthor, themeMode, handleDocumentChange],\n );\n\n useEffect(() => {\n if (editing) {\n view?.focus();\n }\n }, [editing, view]);\n\n return <div ref={parentRef} className='me-4' {...focusAttributes} />;\n};\n\n//\n// Textbox\n//\n\nexport type MessageTextboxProps = {\n disabled?: boolean;\n onSend?: () => void;\n onClear?: () => void;\n onEditorFocus?: () => void;\n} & MessageMetadata &\n UseTextEditorProps;\n\nconst keyBindings = ({ onSend, onClear }: Pick<MessageTextboxProps, 'onSend' | 'onClear'>) => [\n {\n key: 'Enter',\n run: () => {\n if (onSend) {\n onSend();\n return true;\n }\n return false;\n },\n },\n {\n key: 'Meta+Backspace',\n run: () => {\n if (onClear) {\n onClear();\n return true;\n }\n return false;\n },\n },\n];\n\nexport type MessageTextboxHandle = { focus: () => void };\n\nconst MessageTextbox = forwardRef<MessageTextboxHandle, MessageTextboxProps>(\n (\n {\n id,\n authorId,\n authorName,\n authorImgSrc,\n authorAvatarProps,\n disabled,\n extensions,\n onSend,\n onClear,\n onEditorFocus,\n ...editorProps\n },\n forwardedRef,\n ) => {\n const { parentRef, focusAttributes, view } = useTextEditor(\n () => ({\n id,\n extensions: [\n keymap.of(keyBindings({ onSend, onClear })),\n listener({\n onFocus: ({ focusing }) => {\n if (focusing) {\n onEditorFocus?.();\n }\n },\n }),\n extensions,\n ].filter(isTruthy),\n ...editorProps,\n }),\n [id, extensions],\n );\n\n useImperativeHandle(forwardedRef, () => ({ focus: () => view?.focus() }), [view]);\n\n return (\n <MessageRoot {...{ id, authorId, authorName, authorImgSrc, authorAvatarProps }} continues={false}>\n <div\n ref={parentRef}\n className={mx('py-0.5 me-1 rounded-xs dx-focus-ring', disabled && 'opacity-50')}\n {...focusAttributes}\n />\n </MessageRoot>\n );\n },\n);\n\nMessageTextbox.displayName = 'Message.Textbox';\n\n//\n// Tile\n//\n\nexport type MessageTileProps = {\n message: MessageType.Message;\n classNames?: MessageRootProps['classNames'];\n};\n\n/**\n * Full message tile (frame + heading + controls + body). Reads `Thread.Root`\n * context for metadata resolution, injected renderers, and callbacks. This is\n * the unit rendered by `Thread.Messages`.\n */\nconst MessageTile = ({ message, classNames }: MessageTileProps) => {\n const { t } = useTranslation(translationKey);\n const { getMetadata, identityDid, editable, onMessageDelete, onAcceptProposal } = useThreadContext('Message.Tile');\n const [editing, setEditing] = useState(false);\n\n const metadata = getMetadata(message);\n const isAuthor = !!identityDid && identityDid === metadata.authorId;\n const hasProposal = message.blocks.some((block) => block._tag === 'proposal');\n\n const handleEdit = useCallback(() => setEditing((value) => !value), []);\n const handleDelete = useCallback(() => onMessageDelete?.(message.id), [onMessageDelete, message.id]);\n const handleAcceptProposal = useCallback(() => onAcceptProposal?.(message.id), [onAcceptProposal, message.id]);\n const handleSave = useCallback(\n (text: string) => {\n Obj.update(message, (message) => {\n const block = message.blocks.find((block) => block._tag === 'text');\n if (block && block._tag === 'text') {\n block.text = text;\n }\n });\n },\n [message],\n );\n\n const showEdit = isAuthor && editable;\n const showAccept = hasProposal && !!onAcceptProposal;\n const showDelete = !!onMessageDelete;\n const controls =\n showEdit || showAccept || showDelete ? (\n <div className={buttonGroupClassNames}>\n {showEdit && (\n <IconButton\n data-testid={editing ? 'thread.message.save' : 'thread.message.edit'}\n variant='ghost'\n icon={editing ? 'ph--check--regular' : 'ph--pencil-simple--regular'}\n iconOnly\n label={t(editing ? 'save-message.label' : 'edit-message.label')}\n classNames={[buttonClassNames, hoverableControlItem]}\n onClick={handleEdit}\n />\n )}\n {showAccept && (\n <IconButton\n data-testid='thread.message.accept'\n variant='ghost'\n icon='ph--check--regular'\n iconOnly\n label={t('accept-proposal.label')}\n classNames={[buttonClassNames, hoverableControlItem]}\n onClick={handleAcceptProposal}\n />\n )}\n {showDelete && (\n <IconButton\n data-testid='thread.message.delete'\n variant='ghost'\n icon='ph--x--regular'\n iconOnly\n label={t('delete-message.label')}\n classNames={[buttonClassNames, hoverableControlItem]}\n onClick={handleDelete}\n />\n )}\n </div>\n ) : undefined;\n\n return (\n <MessageRoot\n {...metadata}\n controls={controls}\n classNames={[hoverableControls, hoverableFocusedWithinControls, classNames]}\n >\n <MessageHeading authorName={metadata.authorName} timestamp={metadata.timestamp} />\n <MessageBody message={message} isAuthor={isAuthor} editing={editing} onSave={handleSave} />\n </MessageRoot>\n );\n};\n\nMessageTile.displayName = 'Message.Tile';\n\n//\n// Message\n//\n\nexport const Message = {\n Root: MessageRoot,\n Heading: MessageHeading,\n AuthorName: MessageAuthorName,\n Time: MessageTime,\n Body: MessageBody,\n Textbox: MessageText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;IAEFI,KAAKR;KAEL,gBAAAT,OAAA,cAACgG,MAAAA;IACC9D,MAAK;IACLrB,YAAW;IACXoF,gBAAcF,WAAW,SAAS;MAEpC,gBAAA/F,OAAA,cAACkG,QAAAA;IAAKrE,WAAU;IAAmBsE,aAAU;KAC1CJ,WAAW9G,WAAW,IAAA,GAEzB,gBAAAe,OAAA,cAACkG,QAAAA;IAAKrE,WAAWS,IAAG,YAAY8D,qBAAAA;KAAwB7E,EAAE,uBAAA,CAAA,CAAA;AAGhE,CAAA;AAGFsE,aAAazF,cAAc;AAMpB,IAAMiG,SAAS;EACpBlG,MAAMnB;EACNsH,SAASjG;EACTkG,QAAQrF;EACRsF,UAAU1D;EACV8C,SAASxB;EACTqC,QAAQZ;AACV;",
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React, {\n type ComponentPropsWithRef,\n type PropsWithChildren,\n type ReactNode,\n forwardRef,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\n\nimport { Obj } from '@dxos/echo';\nimport {\n type ComposableProps,\n Icon,\n IconButton,\n ScrollArea,\n type ThemedClassName,\n composable,\n composableProps,\n useThemeContext,\n useTranslation,\n} from '@dxos/react-ui';\nimport { Mosaic, type MosaicTileProps } from '@dxos/react-ui-mosaic';\nimport { type Message as MessageType } from '@dxos/types';\nimport { type Extension, createBasicExtensions, createThemeExtensions, listener } from '@dxos/ui-editor';\nimport { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/ui-theme';\n\nimport { command } from '../command';\nimport { ThreadContextProvider, useThreadContext } from '../context';\nimport { Message } from '../Message';\nimport { translationKey } from '../translations';\nimport { type MessageMetadata, type ThreadContextValue } from '../types';\n\nconst getMessageId = (message: MessageType.Message) => Obj.getURI(message);\n\n//\n// Root\n//\n\nexport type ThreadRootProps = PropsWithChildren<\n Omit<ThreadContextValue, 'components'> & Partial<Pick<ThreadContextValue, 'components'>>\n>;\n\n/**\n * Headless root of a thread. Provides message-tile context (metadata resolver,\n * injected renderers, callbacks) and the Mosaic root that `Thread.Messages`\n * renders its virtual stack within. Renders no DOM of its own — wrap the visible\n * thread chrome in `Thread.Content`.\n */\nconst ThreadRoot = ({\n children,\n getMetadata,\n components,\n identityDid,\n editable,\n onMessageDelete,\n onAcceptProposal,\n}: ThreadRootProps) => {\n // Composer focus handler registered by Thread.Textbox; invoked by Thread.Header's caret.\n const composerFocus = useRef<(() => void) | undefined>(undefined);\n\n const registerComposerFocus = useCallback((focus: (() => void) | undefined) => {\n composerFocus.current = focus;\n }, []);\n\n const focusComposer = useCallback(() => composerFocus.current?.(), []);\n\n return (\n <ThreadContextProvider\n getMetadata={getMetadata}\n components={components ?? {}}\n identityDid={identityDid}\n editable={editable}\n registerComposerFocus={registerComposerFocus}\n focusComposer={focusComposer}\n onMessageDelete={onMessageDelete}\n onAcceptProposal={onAcceptProposal}\n >\n <Mosaic.Root>{children}</Mosaic.Root>\n </ThreadContextProvider>\n );\n};\n\nThreadRoot.displayName = 'Thread.Root';\n\n//\n// Content\n//\n\ntype ThreadContentExtra = {\n id?: string;\n current?: boolean | string;\n} & Pick<ComponentPropsWithRef<'div'>, 'onClickCapture' | 'onFocusCapture'>;\n\nexport type ThreadContentProps = ComposableProps<ThreadContentExtra>;\n\n/** Visible thread container (the attention surface that hosts header / messages / composer). */\nconst ThreadContent = composable<HTMLDivElement, ThreadContentExtra>(\n ({ children, current, id, ...props }, forwardedRef) => {\n return (\n <div\n {...composableProps(props, {\n role: 'group',\n classNames: [\n 'flex flex-col bg-[var(--surface-bg)] current-related dx-attention-surface [--controls-opacity:0]',\n hoverableFocusedWithinControls,\n ],\n })}\n data-testid='thread'\n id={id}\n aria-current={current ? 'location' : undefined}\n ref={forwardedRef}\n >\n {children}\n </div>\n );\n },\n);\n\nThreadContent.displayName = 'Thread.Content';\n\n//\n// Header\n//\n\nexport type ThreadHeaderProps = Omit<\n ComposableProps<{\n /** Snippet text rendered inside a `<p>` (a string, not a DOM element). */\n title?: string;\n detached?: boolean;\n /** Whether this is the current/selected thread; accents the title. */\n current?: boolean;\n /** Trailing controls rendered in the right column (aligns with message-tile controls). */\n controls?: ReactNode;\n /** Invoked when the caret affordance is activated to select/focus this thread. */\n onSelect?: () => void;\n }>,\n 'children'\n>;\n\n/**\n * Thread header row: caret (rail) · snippet (content) · controls. Owns its own\n * `[rail · 1fr · controls]` grid so the trailing controls align with message-tile\n * controls (which use the same template) — no grid is leaked in from the caller.\n */\nconst ThreadHeader = composable<HTMLDivElement, ThreadHeaderProps>(\n ({ title, detached, current, controls, onSelect, ...props }, forwardedRef) => {\n const { t } = useTranslation(translationKey);\n const { focusComposer } = useThreadContext('Thread.Header');\n const handleSelect = useCallback(() => {\n onSelect?.();\n focusComposer();\n }, [onSelect, focusComposer]);\n\n return (\n <div\n {...composableProps(props, {\n classNames: [\n 'grid grid-cols-[var(--dx-rail-size)_1fr_min-content] items-center',\n hoverableControls,\n hoverableFocusedWithinControls,\n ],\n })}\n ref={forwardedRef}\n >\n <div className='flex items-center justify-center'>\n <IconButton\n iconOnly\n variant='ghost'\n density='sm'\n icon='ph--caret-double-right--regular'\n label={t('select-thread.label')}\n classNames='text-description'\n onClick={handleSelect}\n />\n </div>\n <div className='flex items-center overflow-hidden'>\n <p\n role='heading'\n data-testid='thread.heading'\n className={mx(\n 'me-2 font-medium truncate italic',\n current ? 'text-accent-text' : 'text-description',\n detached && 'line-through decoration-1',\n )}\n >\n {title}\n </p>\n </div>\n {controls}\n </div>\n );\n },\n);\n\nThreadHeader.displayName = 'Thread.Header';\n\n//\n// Messages\n//\n\nconst MessageTileAdapter = ({\n id,\n data,\n location,\n draggable,\n current,\n selected,\n}: MosaicTileProps<MessageType.Message>) => (\n <Mosaic.Tile id={id} data={data} location={location} draggable={draggable} current={current} selected={selected}>\n <Message.Tile message={data} />\n </Mosaic.Tile>\n);\n\nexport type ThreadMessagesProps = ThemedClassName<{\n messages: readonly MessageType.Message[];\n /** Estimated tile height for the virtualizer. */\n estimateSize?: number;\n currentId?: string;\n}>;\n\n/** Virtualized stack of message tiles (via Mosaic), within an internal scroll area. */\nconst ThreadMessages = ({ messages, estimateSize = 80, currentId, classNames }: ThreadMessagesProps) => {\n const [viewport, setViewport] = useState<HTMLElement | null>(null);\n const items = useMemo(() => messages.filter(Boolean), [messages]);\n\n return (\n <Mosaic.Container\n asChild\n orientation='vertical'\n autoScroll={viewport}\n currentId={currentId}\n eventHandler={{ id: 'thread', canDrop: () => false }}\n >\n <ScrollArea.Root classNames={mx('col-span-2', classNames)} orientation='vertical'>\n <ScrollArea.Viewport ref={setViewport}>\n <Mosaic.VirtualStack\n items={items}\n getId={getMessageId}\n Tile={MessageTileAdapter}\n draggable={false}\n getScrollElement={() => viewport}\n estimateSize={() => estimateSize}\n />\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n </Mosaic.Container>\n );\n};\n\nThreadMessages.displayName = 'Thread.Messages';\n\n//\n// Textbox\n//\n\nexport type ThreadTextboxProps = MessageMetadata & {\n placeholder?: string;\n autoFocus?: boolean;\n disabled?: boolean;\n extensions?: Extension;\n /**\n * Called with the composer content on send. Return `true` to accept (the\n * editor is cleared and remounted), `false` to reject.\n */\n onSend?: (text: string) => boolean;\n};\n\n/** Message composer pinned at the foot of a thread. */\nconst ThreadTextbox = ({ placeholder, autoFocus, disabled, extensions, onSend, ...metadata }: ThreadTextboxProps) => {\n const { t } = useTranslation(translationKey);\n const { themeMode } = useThemeContext();\n const { registerComposerFocus } = useThreadContext('Thread.Textbox');\n const composerRef = useRef<{ focus: () => void } | null>(null);\n const messageRef = useRef('');\n const [count, setCount] = useState(0);\n\n // Expose the composer's focus to Thread.Root so the header caret can focus it.\n useEffect(() => {\n registerComposerFocus(() => composerRef.current?.focus());\n return () => registerComposerFocus(undefined);\n }, [registerComposerFocus]);\n\n const editorExtensions = useMemo(\n () =>\n [\n createBasicExtensions({ placeholder: placeholder ?? t('message.placeholder') }),\n createThemeExtensions({ themeMode }),\n listener({ onChange: ({ text }) => (messageRef.current = text) }),\n command,\n extensions,\n ].filter(Boolean) as Extension[],\n [themeMode, placeholder, t, extensions, count],\n );\n\n const handleSend = useCallback(() => {\n const text = messageRef.current;\n if (!text?.length || !onSend) {\n return;\n }\n if (onSend(text)) {\n messageRef.current = '';\n setCount((value) => value + 1);\n }\n }, []);\n\n return (\n <Message.Textbox\n ref={composerRef}\n {...metadata}\n autoFocus={autoFocus}\n disabled={disabled}\n extensions={editorExtensions}\n onSend={handleSend}\n />\n );\n};\n\nThreadTextbox.displayName = 'Thread.Textbox';\n\n//\n// Status\n//\n\nexport type ThreadStatusProps = ThemedClassName<PropsWithChildren> & {\n activity?: boolean;\n};\n\nconst ThreadStatus = forwardRef<HTMLDivElement, ThreadStatusProps>(\n ({ activity, classNames, children, ...props }, forwardedRef) => {\n const { t } = useTranslation(translationKey);\n return (\n <div\n {...props}\n className={mx(\n 'col-start-2 grid grid-cols-[min-content_1fr_max-content] pb-2 pe-2 text-xs text-description',\n classNames,\n )}\n ref={forwardedRef}\n >\n <Icon\n icon='ph--spinner--bold'\n classNames='w-6 h-4 invisible data-[visible=show]:visible animate-spin-slow'\n data-visible={activity ? 'show' : 'hide'}\n />\n <span className='truncate min-w-0' aria-live='polite'>\n {activity ? children : null}\n </span>\n <span className={mx('text-end', hoverableControlItem)}>{t('enter-to-send.message')}</span>\n </div>\n );\n },\n);\n\nThreadStatus.displayName = 'Thread.Status';\n\n//\n// Thread\n//\n\nexport const Thread = {\n Root: ThreadRoot,\n Content: ThreadContent,\n Header: ThreadHeader,\n Messages: ThreadMessages,\n Textbox: ThreadTextbox,\n Status: ThreadStatus,\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { HighlightStyle, StreamLanguage, syntaxHighlighting } from '@codemirror/language';\nimport { type Extension } from '@codemirror/state';\nimport { EditorView } from '@codemirror/view';\n\nimport { tags } from '@dxos/ui-editor';\nimport { mx } from '@dxos/ui-theme';\n\n/**\n * Highlights leading slash-commands (e.g. `/resolve`) and `@mention` tags\n * (e.g. `@Kai`, anywhere) in the message composer.\n * https://github.com/codemirror/stream-parser/blob/main/test/test-stream-parser.ts\n */\nconst parser = StreamLanguage.define<{ count: number }>({\n startState: () => ({ count: 0 }),\n token: (stream, state) => {\n state.count++;\n if (stream.eatSpace()) {\n return null;\n }\n // Leading slash-command (first token only).\n if (state.count === 1 && stream.match(/^\\/\\w+/)) {\n return 'tagName';\n }\n // @mention (anywhere).\n if (stream.match(/^@\\w+/)) {\n return 'labelName';\n }\n stream.next();\n return null;\n },\n});\n\nconst styles = HighlightStyle.define([\n {\n tag: tags.tagName,\n class: mx('dx-tag dx-tag--indigo'),\n },\n {\n tag: tags.labelName,\n class: mx('dx-tag dx-tag--blue'),\n },\n]);\n\n// Center the inline `.dx-tag` pills on the text line. `.dx-tag` is `inline-block`\n// with vertical padding, so on a CodeMirror line it baseline-aligns and rides\n// high; overriding `vertical-align` recentres it (cf. the `cm-reference-pill`\n// precedent in `@dxos/react-ui-chat`).\nconst theme = EditorView.theme({\n '.dx-tag': {\n verticalAlign: 'bottom',\n },\n});\n\nexport const command: Extension = [parser, syntaxHighlighting(styles), theme];\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { createContext } from '@radix-ui/react-context';\nimport { type FC, type ReactNode } from 'react';\n\n// Imported so TypeScript can name this type in the emitted .d.ts (ThreadContext → Message).\n// eslint-disable-next-line unused-imports/no-unused-imports\nimport { type Message } from '@dxos/types';\n\nimport { type ThreadContextValue } from './types';\n\n/**\n * Context provided by `Thread.Root` and consumed by its parts. Extends the\n * consumer-facing {@link ThreadContextValue} with internal coordination (e.g.\n * focusing the composer from the header's select affordance).\n */\nexport type ThreadContext = ThreadContextValue & {\n /** Register the composer's focus handler (set by `Thread.Textbox`). */\n registerComposerFocus: (focus: (() => void) | undefined) => void;\n /** Focus the thread composer (used by `Thread.Header`'s select affordance). */\n focusComposer: () => void;\n};\n\nexport const [ThreadContextProvider, useThreadContext]: readonly [\n FC<ThreadContext & { children: ReactNode }>,\n (consumerName: string) => ThreadContext,\n] = createContext<ThreadContext>('Thread');\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { EditorView } from '@codemirror/view';\nimport { formatDistanceToNow } from 'date-fns/formatDistanceToNow';\nimport React, {\n type ComponentPropsWithoutRef,\n type ComponentPropsWithRef,\n type ReactNode,\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useRef,\n useState,\n} from 'react';\n\nimport { Obj, Ref } from '@dxos/echo';\nimport {\n Avatar,\n IconButton,\n type ThemedClassName,\n useOnTransition,\n useThemeContext,\n useTranslation,\n} from '@dxos/react-ui';\nimport { type UseTextEditorProps, useTextEditor } from '@dxos/react-ui-editor';\nimport { type ContentBlock, type Message as MessageType } from '@dxos/types';\nimport { createBasicExtensions, createThemeExtensions, keymap, listener } from '@dxos/ui-editor';\nimport { hoverableControlItem, hoverableControls, hoverableFocusedWithinControls, mx } from '@dxos/ui-theme';\nimport { hexToEmoji, hexToHue, isTruthy } from '@dxos/util';\n\nimport { command } from '../command';\nimport { useThreadContext } from '../context';\nimport { translationKey } from '../translations';\nimport { type MessageMetadata } from '../types';\n\nconst avatarSize = 7;\n\nconst buttonGroupClassNames = 'flex flex-row items-center gap-0.5 pe-2';\nconst buttonClassNames = 'p-1! transition-opacity';\n\n//\n// Root\n//\n\nexport type MessageRootProps = ThemedClassName<\n ComponentPropsWithRef<'div'> & MessageMetadata & Partial<{ continues: boolean; controls: ReactNode }>\n>;\n\n// TODO(burdon): Show authorName on tooltip.\nconst MessageRoot = forwardRef<HTMLDivElement, MessageRootProps>(\n (\n {\n authorImgSrc,\n authorId,\n authorName,\n authorAvatarProps,\n continues = true,\n controls,\n children,\n classNames,\n ...rootProps\n },\n forwardedRef,\n ) => {\n // Must wrap the message since Avatar.Label may be used in the content.\n // Columns mirror Thread.Header (avatar/rail · content · controls) so trailing\n // controls align with the thread header's controls.\n return (\n <Avatar.Root>\n <div\n data-testid='thread.message'\n {...rootProps}\n className={mx('grid grid-cols-[var(--dx-rail-size)_1fr_min-content] w-full', classNames)}\n ref={forwardedRef}\n >\n <div className='flex flex-col items-center gap-2 pt-1'>\n <Avatar.Content\n size={avatarSize}\n hue={authorAvatarProps?.hue || hexToHue(authorId ?? '0')}\n fallback={authorAvatarProps?.emoji || hexToEmoji(authorId ?? '0')}\n {...(authorImgSrc && { imgSrc: authorImgSrc })}\n />\n {continues && <div className='w-px grow bg-separator' />}\n </div>\n <div className='py-1 min-w-0'>{children}</div>\n {controls && <div className='self-start'>{controls}</div>}\n </div>\n </Avatar.Root>\n );\n },\n);\n\nMessageRoot.displayName = 'Message.Root';\n\n//\n// Heading\n//\n\nexport type MessageHeadingProps = ThemedClassName<ComponentPropsWithoutRef<'div'>> &\n Pick<MessageMetadata, 'authorName' | 'timestamp'>;\n\nconst MessageHeading = ({ children, classNames, timestamp, authorName, ...props }: MessageHeadingProps) => {\n return (\n <div {...props} className={mx('flex gap-2 items-start', classNames)}>\n <p className='grow'>\n <MessageAuthorName authorName={authorName} />\n {timestamp && <MessageTime timestamp={timestamp} />}\n </p>\n {children}\n </div>\n );\n};\n\nMessageHeading.displayName = 'Message.Heading';\n\nexport type MessageAuthorNameProps = Pick<MessageMetadata, 'authorName'>;\n\nconst MessageAuthorName = ({ authorName }: MessageAuthorNameProps) => {\n const { t } = useTranslation(translationKey);\n return (\n <Avatar.Label classNames='block truncate text-sm text-subdued'>{authorName ?? t('anonymous.label')}</Avatar.Label>\n );\n};\n\nMessageAuthorName.displayName = 'Message.AuthorName';\n\nexport type MessageTimeProps = Pick<MessageMetadata, 'timestamp'>;\n\nconst MessageTime = ({ timestamp }: MessageTimeProps) => {\n const { dtLocale } = useTranslation(translationKey);\n const dt = timestamp ? new Date(timestamp) : undefined;\n return (\n <time className='block text-subdued text-xs pb-0.5' dateTime={dt?.toISOString()}>\n {dt ? formatDistanceToNow(dt, { locale: dtLocale, addSuffix: true }) : ''}\n </time>\n );\n};\n\nMessageTime.displayName = 'Message.Time';\n\n//\n// Body\n//\n\nexport type MessageBodyProps = {\n /** The message whose content blocks are rendered. */\n message: MessageType.Message;\n /** When true, the local user authored this message. */\n isAuthor?: boolean;\n /** When true, the text block is editable. */\n editing?: boolean;\n /** Persist an edited text block. */\n onSave?: (text: string) => void;\n};\n\n/**\n * Renders a message's content blocks: text (via editor), proposal, and\n * object/reference tiles (delegated to the injected `Object` component).\n */\nconst MessageBody = ({ message, isAuthor, editing, onSave }: MessageBodyProps) => {\n const { components } = useThreadContext('Message.Body');\n const textBlockIndex = message.blocks.findIndex((block) => block._tag === 'text');\n const textBlock = textBlockIndex !== -1 ? (message.blocks[textBlockIndex] as ContentBlock.Text) : undefined;\n const proposalBlock = message.blocks.find((block) => block._tag === 'proposal') as ContentBlock.Proposal | undefined;\n const references = message.blocks\n .filter((block) => block._tag === 'reference')\n .map((block) => (block as ContentBlock.Reference).reference);\n const Object = components.Object;\n\n return (\n <>\n {textBlock && <TextBlock block={textBlock} isAuthor={isAuthor} editing={editing} onSave={onSave} />}\n {proposalBlock && <div className='me-4 italic'>{proposalBlock.text}</div>}\n {Object &&\n Ref.Array.targets(references).map((reference, index) => (\n <Object key={index} subject={reference as Obj.Unknown} />\n ))}\n </>\n );\n};\n\nMessageBody.displayName = 'Message.Body';\n\nconst TextBlock = ({\n block,\n isAuthor,\n editing,\n onSave,\n}: {\n block: ContentBlock.Text;\n isAuthor?: boolean;\n editing?: boolean;\n onSave?: (text: string) => void;\n}) => {\n const { themeMode } = useThemeContext();\n const inMemoryContentRef = useRef(block.text);\n\n const handleDocumentChange = useCallback((next: string) => {\n inMemoryContentRef.current = next;\n }, []);\n\n const saveDocumentChange = useCallback(() => {\n onSave?.(inMemoryContentRef.current);\n }, [onSave]);\n\n useOnTransition(editing, true, false, saveDocumentChange);\n\n const { parentRef, focusAttributes, view } = useTextEditor(\n () => ({\n initialValue: block.text,\n extensions: [\n createBasicExtensions({ readOnly: !isAuthor || !editing }),\n createThemeExtensions({ themeMode }),\n command,\n EditorView.updateListener.of((update) => {\n if (update.docChanged) {\n handleDocumentChange(update.state.doc.toString());\n }\n }),\n ],\n }),\n [block.text, editing, isAuthor, themeMode, handleDocumentChange],\n );\n\n useEffect(() => {\n if (editing) {\n view?.focus();\n }\n }, [editing, view]);\n\n return <div ref={parentRef} className='me-4' {...focusAttributes} />;\n};\n\n//\n// Textbox\n//\n\nexport type MessageTextboxProps = {\n disabled?: boolean;\n onSend?: () => void;\n onClear?: () => void;\n onEditorFocus?: () => void;\n} & MessageMetadata &\n UseTextEditorProps;\n\nconst keyBindings = ({ onSend, onClear }: Pick<MessageTextboxProps, 'onSend' | 'onClear'>) => [\n {\n key: 'Enter',\n run: () => {\n if (onSend) {\n onSend();\n return true;\n }\n return false;\n },\n },\n {\n key: 'Meta+Backspace',\n run: () => {\n if (onClear) {\n onClear();\n return true;\n }\n return false;\n },\n },\n];\n\nexport type MessageTextboxHandle = { focus: () => void };\n\nconst MessageTextbox = forwardRef<MessageTextboxHandle, MessageTextboxProps>(\n (\n {\n id,\n authorId,\n authorName,\n authorImgSrc,\n authorAvatarProps,\n disabled,\n extensions,\n onSend,\n onClear,\n onEditorFocus,\n ...editorProps\n },\n forwardedRef,\n ) => {\n const { parentRef, focusAttributes, view } = useTextEditor(\n () => ({\n id,\n extensions: [\n keymap.of(keyBindings({ onSend, onClear })),\n listener({\n onFocus: ({ focusing }) => {\n if (focusing) {\n onEditorFocus?.();\n }\n },\n }),\n extensions,\n ].filter(isTruthy),\n ...editorProps,\n }),\n [id, extensions],\n );\n\n useImperativeHandle(forwardedRef, () => ({ focus: () => view?.focus() }), [view]);\n\n return (\n <MessageRoot {...{ id, authorId, authorName, authorImgSrc, authorAvatarProps }} continues={false}>\n <div\n ref={parentRef}\n className={mx('py-0.5 me-1 rounded-xs dx-focus-ring', disabled && 'opacity-50')}\n {...focusAttributes}\n />\n </MessageRoot>\n );\n },\n);\n\nMessageTextbox.displayName = 'Message.Textbox';\n\n//\n// Tile\n//\n\nexport type MessageTileProps = {\n message: MessageType.Message;\n classNames?: MessageRootProps['classNames'];\n};\n\n/**\n * Full message tile (frame + heading + controls + body). Reads `Thread.Root`\n * context for metadata resolution, injected renderers, and callbacks. This is\n * the unit rendered by `Thread.Messages`.\n */\nconst MessageTile = ({ message, classNames }: MessageTileProps) => {\n const { t } = useTranslation(translationKey);\n const { getMetadata, identityDid, editable, onMessageDelete, onAcceptProposal } = useThreadContext('Message.Tile');\n const [editing, setEditing] = useState(false);\n\n const metadata = getMetadata(message);\n const isAuthor = !!identityDid && identityDid === metadata.authorId;\n const hasProposal = message.blocks.some((block) => block._tag === 'proposal');\n\n const handleEdit = useCallback(() => setEditing((value) => !value), []);\n const handleDelete = useCallback(() => onMessageDelete?.(message.id), [onMessageDelete, message.id]);\n const handleAcceptProposal = useCallback(() => onAcceptProposal?.(message.id), [onAcceptProposal, message.id]);\n const handleSave = useCallback(\n (text: string) => {\n Obj.update(message, (message) => {\n const block = message.blocks.find((block) => block._tag === 'text');\n if (block && block._tag === 'text') {\n block.text = text;\n }\n });\n },\n [message],\n );\n\n const showEdit = isAuthor && editable;\n const showAccept = hasProposal && !!onAcceptProposal;\n const showDelete = !!onMessageDelete;\n const controls =\n showEdit || showAccept || showDelete ? (\n <div className={buttonGroupClassNames}>\n {showEdit && (\n <IconButton\n data-testid={editing ? 'thread.message.save' : 'thread.message.edit'}\n variant='ghost'\n icon={editing ? 'ph--check--regular' : 'ph--pencil-simple--regular'}\n iconOnly\n label={t(editing ? 'save-message.label' : 'edit-message.label')}\n classNames={[buttonClassNames, hoverableControlItem]}\n onClick={handleEdit}\n />\n )}\n {showAccept && (\n <IconButton\n data-testid='thread.message.accept'\n variant='ghost'\n icon='ph--check--regular'\n iconOnly\n label={t('accept-proposal.label')}\n classNames={[buttonClassNames, hoverableControlItem]}\n onClick={handleAcceptProposal}\n />\n )}\n {showDelete && (\n <IconButton\n data-testid='thread.message.delete'\n variant='ghost'\n icon='ph--x--regular'\n iconOnly\n label={t('delete-message.label')}\n classNames={[buttonClassNames, hoverableControlItem]}\n onClick={handleDelete}\n />\n )}\n </div>\n ) : undefined;\n\n return (\n <MessageRoot\n {...metadata}\n controls={controls}\n classNames={[hoverableControls, hoverableFocusedWithinControls, classNames]}\n >\n <MessageHeading authorName={metadata.authorName} timestamp={metadata.timestamp} />\n <MessageBody message={message} isAuthor={isAuthor} editing={editing} onSave={handleSave} />\n </MessageRoot>\n );\n};\n\nMessageTile.displayName = 'Message.Tile';\n\n//\n// Message\n//\n\nexport const Message = {\n Root: MessageRoot,\n Heading: MessageHeading,\n AuthorName: MessageAuthorName,\n Time: MessageTime,\n Body: MessageBody,\n Textbox: MessageTextbox,\n Tile: MessageTile,\n};\n"],
5
+ "mappings": ";;;;;AAIA,OAAOA,UAILC,cAAAA,aACAC,eAAAA,cACAC,aAAAA,YACAC,SACAC,UAAAA,SACAC,YAAAA,iBACK;AAEP,SAASC,OAAAA,YAAW;AACpB,SAEEC,MACAC,cAAAA,aACAC,YAEAC,YACAC,iBACAC,mBAAAA,kBACAC,kBAAAA,uBACK;AACP,SAASC,cAAoC;AAE7C,SAAyBC,yBAAAA,wBAAuBC,yBAAAA,wBAAuBC,YAAAA,iBAAgB;AACvF,SAASC,wBAAAA,uBAAsBC,qBAAAA,oBAAmBC,kCAAAA,iCAAgCC,MAAAA,WAAU;;;AC3B5F,SAASC,gBAAgBC,gBAAgBC,0BAA0B;AAEnE,SAASC,kBAAkB;AAE3B,SAASC,YAAY;AACrB,SAASC,UAAU;AAOnB,IAAMC,SAASL,eAAeM,OAA0B;EACtDC,YAAY,OAAO;IAAEC,OAAO;EAAE;EAC9BC,OAAO,CAACC,QAAQC,UAAAA;AACdA,UAAMH;AACN,QAAIE,OAAOE,SAAQ,GAAI;AACrB,aAAO;IACT;AAEA,QAAID,MAAMH,UAAU,KAAKE,OAAOG,MAAM,QAAA,GAAW;AAC/C,aAAO;IACT;AAEA,QAAIH,OAAOG,MAAM,OAAA,GAAU;AACzB,aAAO;IACT;AACAH,WAAOI,KAAI;AACX,WAAO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AAEL,SACE,gBAAA3F,OAAA,cAAC6C,QAAQ+C,SAAO;IACd3E,KAAK4D;IACJ,GAAGH;IACJJ;IACAC;IACAC,YAAYU;IACZT,QAAQgB;;AAGd;AAEArB,cAAchE,cAAc;AAU5B,IAAMyF,eAAeC,gBAAAA,YACnB,CAAC,EAAEC,UAAUlF,YAAY5B,UAAU,GAAGuB,MAAAA,GAASC,iBAAAA;AAC7C,QAAM,EAAEc,EAAC,IAAKC,gBAAeC,cAAAA;AAC7B,SACE,gBAAAzB,OAAA,cAACU,OAAAA;IACE,GAAGF;IACJqB,WAAWS,IACT,+FACAzB,UAAAA;IAEFI,KAAKR;KAEL,gBAAAT,OAAA,cAACgG,MAAAA;IACC9D,MAAK;IACLrB,YAAW;IACXoF,gBAAcF,WAAW,SAAS;MAEpC,gBAAA/F,OAAA,cAACkG,QAAAA;IAAKrE,WAAU;IAAmBsE,aAAU;KAC1CJ,WAAW9G,WAAW,IAAA,GAEzB,gBAAAe,OAAA,cAACkG,QAAAA;IAAKrE,WAAWS,IAAG,YAAY8D,qBAAAA;KAAwB7E,EAAE,uBAAA,CAAA,CAAA;AAGhE,CAAA;AAGFsE,aAAazF,cAAc;AAMpB,IAAMiG,SAAS;EACpBlG,MAAMnB;EACNsH,SAASjG;EACTkG,QAAQrF;EACRsF,UAAU1D;EACV8C,SAASxB;EACTqC,QAAQZ;AACV;",
6
6
  "names": ["React", "forwardRef", "useCallback", "useEffect", "useMemo", "useRef", "useState", "Obj", "Icon", "IconButton", "ScrollArea", "composable", "composableProps", "useThemeContext", "useTranslation", "Mosaic", "createBasicExtensions", "createThemeExtensions", "listener", "hoverableControlItem", "hoverableControls", "hoverableFocusedWithinControls", "mx", "HighlightStyle", "StreamLanguage", "syntaxHighlighting", "EditorView", "tags", "mx", "parser", "define", "startState", "count", "token", "stream", "state", "eatSpace", "match", "next", "styles", "tag", "tagName", "class", "labelName", "theme", "verticalAlign", "command", "createContext", "ThreadContextProvider", "useThreadContext", "EditorView", "formatDistanceToNow", "React", "forwardRef", "useCallback", "useEffect", "useImperativeHandle", "useRef", "useState", "Obj", "Ref", "Avatar", "IconButton", "useOnTransition", "useThemeContext", "useTranslation", "useTextEditor", "createBasicExtensions", "createThemeExtensions", "keymap", "listener", "hoverableControlItem", "hoverableControls", "hoverableFocusedWithinControls", "mx", "hexToEmoji", "hexToHue", "isTruthy", "avatarSize", "buttonGroupClassNames", "buttonClassNames", "MessageRoot", "forwardRef", "authorImgSrc", "authorId", "authorName", "authorAvatarProps", "continues", "controls", "children", "classNames", "rootProps", "forwardedRef", "Avatar", "Root", "div", "data-testid", "className", "mx", "ref", "Content", "size", "hue", "hexToHue", "fallback", "emoji", "hexToEmoji", "imgSrc", "displayName", "MessageHeading", "timestamp", "props", "p", "MessageAuthorName", "MessageTime", "t", "useTranslation", "translationKey", "Label", "dtLocale", "dt", "Date", "undefined", "time", "dateTime", "toISOString", "formatDistanceToNow", "locale", "addSuffix", "MessageBody", "message", "isAuthor", "editing", "onSave", "components", "useThreadContext", "textBlockIndex", "blocks", "findIndex", "block", "_tag", "textBlock", "proposalBlock", "find", "references", "filter", "map", "reference", "Object", "TextBlock", "text", "Ref", "Array", "targets", "index", "key", "subject", "themeMode", "useThemeContext", "inMemoryContentRef", "useRef", "handleDocumentChange", "useCallback", "next", "current", "saveDocumentChange", "useOnTransition", "parentRef", "focusAttributes", "view", "useTextEditor", "initialValue", "extensions", "createBasicExtensions", "readOnly", "createThemeExtensions", "command", "EditorView", "updateListener", "of", "update", "docChanged", "state", "doc", "toString", "useEffect", "focus", "keyBindings", "onSend", "onClear", "run", "MessageTextbox", "id", "disabled", "onEditorFocus", "editorProps", "keymap", "listener", "onFocus", "focusing", "isTruthy", "useImperativeHandle", "MessageTile", "getMetadata", "identityDid", "editable", "onMessageDelete", "onAcceptProposal", "setEditing", "useState", "metadata", "hasProposal", "some", "handleEdit", "value", "handleDelete", "handleAcceptProposal", "handleSave", "Obj", "showEdit", "showAccept", "showDelete", "IconButton", "variant", "icon", "iconOnly", "label", "hoverableControlItem", "onClick", "hoverableControls", "hoverableFocusedWithinControls", "Message", "Heading", "AuthorName", "Time", "Body", "Textbox", "Tile", "getMessageId", "message", "Obj", "getURI", "ThreadRoot", "children", "getMetadata", "components", "identityDid", "editable", "onMessageDelete", "onAcceptProposal", "composerFocus", "useRef", "undefined", "registerComposerFocus", "useCallback", "focus", "current", "focusComposer", "React", "ThreadContextProvider", "Mosaic", "Root", "displayName", "ThreadContent", "composable", "id", "props", "forwardedRef", "div", "composableProps", "role", "classNames", "hoverableFocusedWithinControls", "data-testid", "aria-current", "ref", "ThreadHeader", "title", "detached", "controls", "onSelect", "t", "useTranslation", "translationKey", "useThreadContext", "handleSelect", "hoverableControls", "className", "IconButton", "iconOnly", "variant", "density", "icon", "label", "onClick", "p", "mx", "MessageTileAdapter", "data", "location", "draggable", "selected", "Tile", "Message", "ThreadMessages", "messages", "estimateSize", "currentId", "viewport", "setViewport", "useState", "items", "useMemo", "filter", "Boolean", "Container", "asChild", "orientation", "autoScroll", "eventHandler", "canDrop", "ScrollArea", "Viewport", "VirtualStack", "getId", "getScrollElement", "ThreadTextbox", "placeholder", "autoFocus", "disabled", "extensions", "onSend", "metadata", "themeMode", "useThemeContext", "composerRef", "messageRef", "count", "setCount", "useEffect", "editorExtensions", "createBasicExtensions", "createThemeExtensions", "listener", "onChange", "text", "command", "handleSend", "length", "value", "Textbox", "ThreadStatus", "forwardRef", "activity", "Icon", "data-visible", "span", "aria-live", "hoverableControlItem", "Thread", "Content", "Header", "Messages", "Status"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/command.ts":{"bytes":5542,"imports":[{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/context.ts":{"bytes":1631,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true}],"format":"esm"},"src/translations.ts":{"bytes":3046,"imports":[],"format":"esm"},"src/Message/Message.tsx":{"bytes":40849,"imports":[{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"date-fns/formatDistanceToNow","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/command.ts","kind":"import-statement","original":"../command"},{"path":"src/context.ts","kind":"import-statement","original":"../context"},{"path":"src/translations.ts","kind":"import-statement","original":"../translations"}],"format":"esm"},"src/Message/index.ts":{"bytes":685,"imports":[{"path":"src/Message/Message.tsx","kind":"import-statement","original":"./Message"}],"format":"esm"},"src/Thread/Thread.tsx":{"bytes":31930,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/command.ts","kind":"import-statement","original":"../command"},{"path":"src/context.ts","kind":"import-statement","original":"../context"},{"path":"src/Message/index.ts","kind":"import-statement","original":"../Message"},{"path":"src/translations.ts","kind":"import-statement","original":"../translations"}],"format":"esm"},"src/Thread/index.ts":{"bytes":643,"imports":[{"path":"src/Thread/Thread.tsx","kind":"import-statement","original":"./Thread"}],"format":"esm"},"src/index.ts":{"bytes":1539,"imports":[{"path":"src/Thread/index.ts","kind":"import-statement","original":"./Thread"},{"path":"src/Message/index.ts","kind":"import-statement","original":"./Message"},{"path":"src/command.ts","kind":"import-statement","original":"./command"},{"path":"src/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":42741},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-QFRRLZVL.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"date-fns/formatDistanceToNow","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["Message","Thread","command","useThreadContext"],"entryPoint":"src/index.ts","inputs":{"src/Thread/Thread.tsx":{"bytesInOutput":7266},"src/command.ts":{"bytesInOutput":922},"src/context.ts":{"bytesInOutput":130},"src/Message/Message.tsx":{"bytesInOutput":10086},"src/Message/index.ts":{"bytesInOutput":0},"src/Thread/index.ts":{"bytesInOutput":0},"src/index.ts":{"bytesInOutput":0}},"bytes":18677},"dist/lib/browser/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/translations.mjs":{"imports":[{"path":"dist/lib/browser/chunk-QFRRLZVL.mjs","kind":"import-statement"}],"exports":["translationKey","translations"],"entryPoint":"src/translations.ts","inputs":{},"bytes":160},"dist/lib/browser/chunk-QFRRLZVL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1440},"dist/lib/browser/chunk-QFRRLZVL.mjs":{"imports":[],"exports":["translationKey","translations"],"inputs":{"src/translations.ts":{"bytesInOutput":835}},"bytes":948}}}
1
+ {"inputs":{"src/command.ts":{"bytes":5542,"imports":[{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true}],"format":"esm"},"src/context.ts":{"bytes":2115,"imports":[{"path":"@radix-ui/react-context","kind":"import-statement","external":true}],"format":"esm"},"src/translations.ts":{"bytes":3046,"imports":[],"format":"esm"},"src/Message/Message.tsx":{"bytes":40849,"imports":[{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"date-fns/formatDistanceToNow","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/command.ts","kind":"import-statement","original":"../command"},{"path":"src/context.ts","kind":"import-statement","original":"../context"},{"path":"src/translations.ts","kind":"import-statement","original":"../translations"}],"format":"esm"},"src/Message/index.ts":{"bytes":685,"imports":[{"path":"src/Message/Message.tsx","kind":"import-statement","original":"./Message"}],"format":"esm"},"src/Thread/Thread.tsx":{"bytes":31930,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"src/command.ts","kind":"import-statement","original":"../command"},{"path":"src/context.ts","kind":"import-statement","original":"../context"},{"path":"src/Message/index.ts","kind":"import-statement","original":"../Message"},{"path":"src/translations.ts","kind":"import-statement","original":"../translations"}],"format":"esm"},"src/Thread/index.ts":{"bytes":643,"imports":[{"path":"src/Thread/Thread.tsx","kind":"import-statement","original":"./Thread"}],"format":"esm"},"src/index.ts":{"bytes":1539,"imports":[{"path":"src/Thread/index.ts","kind":"import-statement","original":"./Thread"},{"path":"src/Message/index.ts","kind":"import-statement","original":"./Message"},{"path":"src/command.ts","kind":"import-statement","original":"./command"},{"path":"src/context.ts","kind":"import-statement","original":"./context"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":43103},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-QFRRLZVL.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-mosaic","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@codemirror/language","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@radix-ui/react-context","kind":"import-statement","external":true},{"path":"@codemirror/view","kind":"import-statement","external":true},{"path":"date-fns/formatDistanceToNow","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-editor","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["Message","Thread","command","useThreadContext"],"entryPoint":"src/index.ts","inputs":{"src/Thread/Thread.tsx":{"bytesInOutput":7266},"src/command.ts":{"bytesInOutput":922},"src/context.ts":{"bytesInOutput":130},"src/Message/Message.tsx":{"bytesInOutput":10086},"src/Message/index.ts":{"bytesInOutput":0},"src/Thread/index.ts":{"bytesInOutput":0},"src/index.ts":{"bytesInOutput":0}},"bytes":18677},"dist/lib/browser/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/translations.mjs":{"imports":[{"path":"dist/lib/browser/chunk-QFRRLZVL.mjs","kind":"import-statement"}],"exports":["translationKey","translations"],"entryPoint":"src/translations.ts","inputs":{},"bytes":160},"dist/lib/browser/chunk-QFRRLZVL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1440},"dist/lib/browser/chunk-QFRRLZVL.mjs":{"imports":[],"exports":["translationKey","translations"],"inputs":{"src/translations.ts":{"bytesInOutput":835}},"bytes":948}}}
@@ -1,4 +1,4 @@
1
- import React, { type ComponentPropsWithRef, type ComponentPropsWithoutRef, type ReactNode } from 'react';
1
+ import React, { type ComponentPropsWithoutRef, type ComponentPropsWithRef, type ReactNode } from 'react';
2
2
  import { type ThemedClassName } from '@dxos/react-ui';
3
3
  import { type UseTextEditorProps } from '@dxos/react-ui-editor';
4
4
  import { type Message as MessageType } from '@dxos/types';
@@ -1 +1 @@
1
- {"version":3,"file":"Message.d.ts","sourceRoot":"","sources":["../../../../src/Message/Message.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,EACZ,KAAK,qBAAqB,EAC1B,KAAK,wBAAwB,EAC7B,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAGf,OAAO,EAGL,KAAK,eAAe,EAIrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,kBAAkB,EAAiB,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAqB,KAAK,OAAO,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AAQ7E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,IAAI,CAAA;CAAE,CAAC;AA0DzD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC;IAC7B,UAAU,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;CAC7C,CAAC;6BAOmB,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,gBAAgB;;;;AAoF9D,eAAO,MAAM,OAAO;IAClB,IAAI;IACJ,OAAO;oEAjU0E,mBAAmB;;;IAkUpG,UAAU;yBAlT+B,sBAAsB;;;IAmT/D,IAAI;wBAxS8B,gBAAgB;;;IAySlD,IAAI;iDA1QuD,gBAAgB;;;IA2Q3E,OAAO;mBA5LI,OAAO;iBACT,MAAM,IAAI;kBACT,MAAM,IAAI;wBACJ,MAAM,IAAI;;;;;;;;;;;IA0L1B,IAAI;kCA3FwC,gBAAgB;;;CA4F7D,CAAC"}
@@ -1,11 +1,11 @@
1
1
  import { type StoryObj } from '@storybook/react-vite';
2
2
  import React from 'react';
3
- type StoryProps = {
3
+ type StoryArgs = {
4
4
  editable: boolean;
5
5
  };
6
6
  declare const meta: {
7
7
  title: string;
8
- render: ({ editable }: StoryProps) => React.JSX.Element;
8
+ render: ({ editable }: StoryArgs) => React.JSX.Element;
9
9
  decorators: import("@storybook/react").Decorator[];
10
10
  parameters: {
11
11
  layout: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Message.stories.d.ts","sourceRoot":"","sources":["../../../../src/Message/Message.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAkB,MAAM,OAAO,CAAC;AAUvC,KAAK,UAAU,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAC;AAkBxC,QAAA,MAAM,IAAI;;2BAd0B,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBT,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,QAAQ,EAAE,KAItB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAIzB,CAAC"}
1
+ {"version":3,"file":"Message.stories.d.ts","sourceRoot":"","sources":["../../../../src/Message/Message.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAkB,MAAM,OAAO,CAAC;AAUvC,KAAK,SAAS,GAAG;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,CAAC;AAkBvC,QAAA,MAAM,IAAI;;2BAd0B,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;CAsBR,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,QAAQ,EAAE,KAItB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAIzB,CAAC"}
@@ -1,3 +1,3 @@
1
1
  export { Message } from './Message';
2
- export type { MessageRootProps, MessageHeadingProps, MessageAuthorNameProps, MessageTimeProps, MessageBodyProps, MessageTextboxProps, MessageTileProps, } from './Message';
2
+ export type { MessageAuthorNameProps, MessageBodyProps, MessageHeadingProps, MessageRootProps, MessageTextboxProps, MessageTileProps, MessageTimeProps, } from './Message';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Message/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Message/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EACV,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,WAAW,CAAC"}
@@ -1,4 +1,4 @@
1
- import React, { type ComponentPropsWithRef, type ReactNode, type PropsWithChildren } from 'react';
1
+ import React, { type ComponentPropsWithRef, type PropsWithChildren, type ReactNode } from 'react';
2
2
  import { type ComposableProps, type ThemedClassName } from '@dxos/react-ui';
3
3
  import { type Message as MessageType } from '@dxos/types';
4
4
  import { type Extension } from '@dxos/ui-editor';
@@ -1 +1 @@
1
- {"version":3,"file":"Thread.d.ts","sourceRoot":"","sources":["../../../../src/Thread/Thread.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EACZ,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EAEd,KAAK,iBAAiB,EAMvB,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,KAAK,eAAe,EAIpB,KAAK,eAAe,EAKrB,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,OAAO,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,KAAK,SAAS,EAA0D,MAAM,iBAAiB,CAAC;AAOzG,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAQzE,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAC7C,IAAI,CAAC,kBAAkB,EAAE,YAAY,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAC,CACzF,CAAC;4BAQkB,EAClB,QAAQ,EACR,WAAW,EACX,UAAU,EACV,WAAW,EACX,QAAQ,EACR,eAAe,EACf,gBAAgB,EACjB,EAAE,eAAe;;;;AAgClB,KAAK,kBAAkB,GAAG;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,CAAC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O,MAAM,MAAM;IACjB,IAAI;2GAhTH,eAAe;;;IAiThB,OAAO;;;IACP,MAAM;;;IACN,QAAQ;4DA9IsE,mBAAmB;;;IA+IjG,OAAO;gFAhGqF,kBAAkB;;;IAiG9G,MAAM;;;;;mBAzCK,OAAO;;CA0CnB,CAAC"}
@@ -1,3 +1,3 @@
1
1
  export { Thread } from './Thread';
2
- export type { ThreadRootProps, ThreadContentProps, ThreadHeaderProps, ThreadMessagesProps, ThreadTextboxProps, ThreadStatusProps, } from './Thread';
2
+ export type { ThreadContentProps, ThreadHeaderProps, ThreadMessagesProps, ThreadRootProps, ThreadStatusProps, ThreadTextboxProps, } from './Thread';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Thread/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/Thread/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,UAAU,CAAC"}
@@ -1,3 +1,5 @@
1
+ import { type FC, type ReactNode } from 'react';
2
+ import { type Message } from '@dxos/types';
1
3
  import { type ThreadContextValue } from './types';
2
4
  /**
3
5
  * Context provided by `Thread.Root` and consumed by its parts. Extends the
@@ -10,209 +12,8 @@ export type ThreadContext = ThreadContextValue & {
10
12
  /** Focus the thread composer (used by `Thread.Header`'s select affordance). */
11
13
  focusComposer: () => void;
12
14
  };
13
- export declare const ThreadContextProvider: import("react").FC<{
14
- getMetadata: (message: {
15
- readonly id: string;
16
- readonly parentMessage?: string | undefined;
17
- readonly threadId?: string | undefined;
18
- readonly created: string;
19
- readonly sender: {
20
- readonly role?: "assistant" | "tool" | "user" | undefined;
21
- readonly contact?: import("@dxos/echo/internal").Ref<{
22
- readonly fullName?: string | undefined;
23
- readonly preferredName?: string | undefined;
24
- readonly nickname?: string | undefined;
25
- readonly image?: string | undefined;
26
- readonly organization?: import("@dxos/echo/internal").Ref<{
27
- readonly name?: string | undefined;
28
- readonly description?: string | undefined;
29
- readonly status?: "active" | "commit" | "prospect" | "qualified" | "reject" | undefined;
30
- readonly image?: string | undefined;
31
- readonly website?: string | undefined;
32
- } & {
33
- readonly location?: readonly [number, number, (number | undefined)?] | undefined;
34
- } & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown> | undefined;
35
- readonly jobTitle?: string | undefined;
36
- readonly department?: string | undefined;
37
- readonly notes?: string | undefined;
38
- readonly emails?: readonly {
39
- readonly label?: string | undefined;
40
- readonly value: string;
41
- }[] | undefined;
42
- readonly identities?: readonly {
43
- readonly label?: string | undefined;
44
- readonly value: string;
45
- }[] | undefined;
46
- readonly phoneNumbers?: readonly {
47
- readonly label?: string | undefined;
48
- readonly value: string;
49
- }[] | undefined;
50
- readonly addresses?: readonly {
51
- readonly label?: string | undefined;
52
- readonly value: {
53
- readonly street?: string | undefined;
54
- readonly extended?: string | undefined;
55
- readonly locality?: string | undefined;
56
- readonly region?: string | undefined;
57
- readonly postalCode?: string | undefined;
58
- readonly postOfficeBoxNumber?: string | undefined;
59
- readonly country?: string | undefined;
60
- };
61
- }[] | undefined;
62
- readonly urls?: readonly {
63
- readonly label?: string | undefined;
64
- readonly value: string;
65
- }[] | undefined;
66
- readonly birthday?: string | undefined;
67
- readonly fields?: readonly {
68
- readonly category?: string | undefined;
69
- readonly label: string;
70
- readonly value: string;
71
- }[] | undefined;
72
- } & {
73
- readonly location?: readonly [number, number, (number | undefined)?] | undefined;
74
- } & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object> & import("@dxos/echo/Obj").Unknown> | undefined;
75
- readonly identityDid?: string | undefined;
76
- readonly identityKey?: string | undefined;
77
- readonly email?: string | undefined;
78
- readonly name?: string | undefined;
79
- };
80
- readonly blocks: readonly ({
81
- readonly _tag: "anchor";
82
- readonly pending?: boolean | undefined;
83
- readonly objectId: string;
84
- readonly version: unknown;
85
- } | {
86
- readonly _tag: "file";
87
- readonly pending?: boolean | undefined;
88
- readonly url: string;
89
- readonly name?: string | undefined;
90
- readonly mediaType?: string | undefined;
91
- } | {
92
- readonly _tag: "image";
93
- readonly pending?: boolean | undefined;
94
- readonly id?: string | undefined;
95
- readonly source?: {
96
- readonly type: "base64";
97
- readonly mediaType: string;
98
- readonly data: string;
99
- } | {
100
- readonly type: "http";
101
- readonly url: string;
102
- } | undefined;
103
- } | {
104
- readonly _tag: "json";
105
- readonly pending?: boolean | undefined;
106
- readonly disposition?: "cot" | "synthetic" | "user" | "version-pin" | undefined;
107
- readonly data: string;
108
- } | {
109
- readonly _tag: "proposal";
110
- readonly pending?: boolean | undefined;
111
- readonly text: string;
112
- } | {
113
- readonly _tag: "reasoning";
114
- readonly pending?: boolean | undefined;
115
- readonly reasoningText?: string | undefined;
116
- readonly redactedText?: string | undefined;
117
- readonly signature?: string | undefined;
118
- } | {
119
- readonly _tag: "reference";
120
- readonly pending?: boolean | undefined;
121
- readonly reference: import("@dxos/echo/internal").Ref<import("@dxos/echo/Obj").Unknown>;
122
- } | {
123
- readonly _tag: "select";
124
- readonly pending?: boolean | undefined;
125
- readonly options: string[];
126
- } | {
127
- readonly _tag: "status";
128
- readonly pending?: boolean | undefined;
129
- readonly statusText: string;
130
- } | {
131
- readonly _tag: "suggestion";
132
- readonly pending?: boolean | undefined;
133
- readonly text: string;
134
- } | {
135
- readonly _tag: "stats";
136
- readonly pending?: boolean | undefined;
137
- readonly mimeType?: string | undefined;
138
- readonly message?: string | undefined;
139
- readonly model?: string | undefined;
140
- readonly usage?: {
141
- readonly inputTokens?: number | undefined;
142
- readonly outputTokens?: number | undefined;
143
- readonly totalTokens?: number | undefined;
144
- } | undefined;
145
- readonly toolCalls?: number | undefined;
146
- readonly errors?: number | undefined;
147
- readonly duration?: number | undefined;
148
- } | {
149
- readonly _tag: "text";
150
- readonly pending?: boolean | undefined;
151
- readonly mimeType?: string | undefined;
152
- readonly text: string;
153
- readonly disposition?: "cot" | "synthetic" | "user" | "version-pin" | undefined;
154
- } | {
155
- readonly _tag: "summary";
156
- readonly pending?: boolean | undefined;
157
- readonly content: string;
158
- } | {
159
- readonly _tag: "toolkit";
160
- readonly pending?: boolean | undefined;
161
- } | {
162
- readonly _tag: "toolCall";
163
- readonly pending?: boolean | undefined;
164
- readonly toolCallId: string;
165
- readonly name: string;
166
- readonly input: string;
167
- readonly providerExecuted: boolean;
168
- readonly operationKey?: string | undefined;
169
- readonly operationName?: string | undefined;
170
- readonly operationIcon?: string | undefined;
171
- } | {
172
- readonly _tag: "toolResult";
173
- readonly pending?: boolean | undefined;
174
- readonly toolCallId: string;
175
- readonly name: string;
176
- readonly result?: string | {
177
- readonly _tag: "~@dxos/types/ContentBlock.ContentBlockResult";
178
- readonly content: readonly ({
179
- readonly _tag: "file";
180
- readonly pending?: boolean | undefined;
181
- readonly url: string;
182
- readonly name?: string | undefined;
183
- readonly mediaType?: string | undefined;
184
- } | {
185
- readonly _tag: "image";
186
- readonly pending?: boolean | undefined;
187
- readonly id?: string | undefined;
188
- readonly source?: {
189
- readonly type: "base64";
190
- readonly mediaType: string;
191
- readonly data: string;
192
- } | {
193
- readonly type: "http";
194
- readonly url: string;
195
- } | undefined;
196
- } | {
197
- readonly _tag: "text";
198
- readonly pending?: boolean | undefined;
199
- readonly mimeType?: string | undefined;
200
- readonly text: string;
201
- readonly disposition?: "cot" | "synthetic" | "user" | "version-pin" | undefined;
202
- })[];
203
- } | undefined;
204
- readonly error?: string | undefined;
205
- readonly providerExecuted: boolean;
206
- } | {
207
- readonly _tag: "transcript";
208
- readonly pending?: boolean | undefined;
209
- readonly started: string;
210
- readonly text: string;
211
- })[];
212
- readonly properties?: {
213
- readonly [x: string]: any;
214
- } | undefined;
215
- } & import("@dxos/echo/Entity").OfKind<import("@dxos/echo/internal").EntityKind.Object>) => import("./types").MessageMetadata;
15
+ export declare const ThreadContextProvider: FC<{
16
+ getMetadata: (message: Message.Message) => import("./types").MessageMetadata;
216
17
  components: import("./types").ThreadComponents;
217
18
  identityDid?: string;
218
19
  editable?: boolean;
@@ -222,6 +23,6 @@ export declare const ThreadContextProvider: import("react").FC<{
222
23
  /** Focus the thread composer (used by `Thread.Header`'s select affordance). */
223
24
  focusComposer: () => void;
224
25
  } & {
225
- children: React.ReactNode;
26
+ children: ReactNode;
226
27
  }>, useThreadContext: (consumerName: string) => ThreadContext;
227
28
  //# sourceMappingURL=context.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/context.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,kBAAkB,GAAG;IAC/C,uEAAuE;IACvE,qBAAqB,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,KAAK,IAAI,CAAC;IACjE,+EAA+E;IAC/E,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAO,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IANjC,uEAAuE;2BAChD,CAAC,KAAK,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,KAAK,IAAI;IAChE,+EAA+E;mBAChE,MAAM,IAAI;;;IAGU,gBAAgB,yCAA0C,CAAC"}
1
+ {"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/context.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,EAAE,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIhD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,kBAAkB,GAAG;IAC/C,uEAAuE;IACvE,qBAAqB,EAAE,CAAC,KAAK,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,KAAK,IAAI,CAAC;IACjE,+EAA+E;IAC/E,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAO,qBAAqB;;;;;;IANjC,uEAAuE;2BAChD,CAAC,KAAK,EAAE,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,KAAK,IAAI;IAChE,+EAA+E;mBAChE,MAAM,IAAI;;cAIM,SAAS;IADL,gBAAgB,iBAEpC,MAAM,KAAK,aACc,CAAC"}
@@ -1,8 +1,8 @@
1
1
  export { Thread } from './Thread';
2
- export type { ThreadRootProps, ThreadContentProps, ThreadHeaderProps, ThreadMessagesProps, ThreadTextboxProps, ThreadStatusProps, } from './Thread';
2
+ export type { ThreadContentProps, ThreadHeaderProps, ThreadMessagesProps, ThreadRootProps, ThreadStatusProps, ThreadTextboxProps, } from './Thread';
3
3
  export { Message } from './Message';
4
- export type { MessageRootProps, MessageHeadingProps, MessageAuthorNameProps, MessageTimeProps, MessageBodyProps, MessageTextboxProps, MessageTileProps, } from './Message';
4
+ export type { MessageAuthorNameProps, MessageBodyProps, MessageHeadingProps, MessageRootProps, MessageTextboxProps, MessageTileProps, MessageTimeProps, } from './Message';
5
5
  export { command } from './command';
6
6
  export { useThreadContext } from './context';
7
- export type { MessageMetadata, ObjectTileComponent, ThreadComponents, MessageCallbacks, ThreadContextValue, } from './types';
7
+ export type { MessageCallbacks, MessageMetadata, ObjectTileComponent, ThreadComponents, ThreadContextValue, } from './types';
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EACV,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,iBAAiB,GAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EACV,gBAAgB,EAChB,mBAAmB,EACnB,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,EACf,iBAAiB,EACjB,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EACV,sBAAsB,EACtB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,YAAY,EACV,gBAAgB,EAChB,eAAe,EACf,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,SAAS,CAAC"}