Mixins / foldkit-mixins-ui

ChatMessageView

interface · packages/mixins-ui/src/chatMessage.ts:135

interface ChatMessageView<Message = never> {
  readonly from: ChatMessageFrom
  readonly content: Html | string
  readonly author?: string | undefined
  readonly avatar?: Html | undefined
  readonly time?: ChatMessageTime | undefined
  readonly status?: ChatMessageStatus | undefined
  readonly words?: Partial<ChatMessageWords> | undefined
  readonly onRetry?: Message | undefined
  readonly reactions?: ReadonlyArray<ChatMessageReaction<Message>> | undefined
  readonly actions?: ReadonlyArray<ChatMessageAction<Message>> | undefined
  readonly pinActions?: boolean | undefined
  readonly streaming?: boolean | undefined
  readonly continued?: boolean | undefined
  readonly style?: NamedStyle<typeof ChatMessageSlots> | undefined
  readonly mixins?: MixinList<Message> | undefined
}

A message in one call: who sent it and when, what it says, where it stands, what it offers, a style for its slots, and mixins beside the style. No upstream component stands behind it.

Members

ChatMessageView.from

property · packages/mixins-ui/src/chatMessage.ts:136

readonly from: ChatMessageFrom

ChatMessageView.content

property · packages/mixins-ui/src/chatMessage.ts:138

readonly content: Html | string

Plain text, or Html such as rendered Markdown.

ChatMessageView.author

property · packages/mixins-ui/src/chatMessage.ts:139

readonly author?: string | undefined

ChatMessageView.avatar

property · packages/mixins-ui/src/chatMessage.ts:141

readonly avatar?: Html | undefined

The sender's picture, such as an Avatar.view.

ChatMessageView.time

property · packages/mixins-ui/src/chatMessage.ts:142

readonly time?: ChatMessageTime | undefined

ChatMessageView.status

property · packages/mixins-ui/src/chatMessage.ts:143

readonly status?: ChatMessageStatus | undefined

ChatMessageView.words

property · packages/mixins-ui/src/chatMessage.ts:145

readonly words?: Partial<ChatMessageWords> | undefined

The status, the retry and the groups' names.

ChatMessageView.onRetry

property · packages/mixins-ui/src/chatMessage.ts:147

readonly onRetry?: Message | undefined

What the retry button beside a failed status sends; a failed message without it draws none.

ChatMessageView.reactions

property · packages/mixins-ui/src/chatMessage.ts:149

readonly reactions?: ReadonlyArray<ChatMessageReaction<Message>> | undefined

Pressable or shown reactions under the bubble, before the footer.

ChatMessageView.actions

property · packages/mixins-ui/src/chatMessage.ts:150

readonly actions?: ReadonlyArray<ChatMessageAction<Message>> | undefined

ChatMessageView.pinActions

property · packages/mixins-ui/src/chatMessage.ts:155

readonly pinActions?: boolean | undefined

Shows the actions at rest, as the latest answer shows its own; others reveal theirs on hover or focus, and always where nothing can hover.

ChatMessageView.streaming

property · packages/mixins-ui/src/chatMessage.ts:157

readonly streaming?: boolean | undefined

The content is still arriving: the root is aria-busy and carries data-streaming.

ChatMessageView.continued

property · packages/mixins-ui/src/chatMessage.ts:159

readonly continued?: boolean | undefined

Follows a message by the same sender: no picture, and a header only a reader meets.

ChatMessageView.style

property · packages/mixins-ui/src/chatMessage.ts:161

readonly style?: NamedStyle<typeof ChatMessageSlots> | undefined

A style of ChatMessageSlots, for the message's look.

ChatMessageView.mixins

property · packages/mixins-ui/src/chatMessage.ts:163

readonly mixins?: MixinList<Message> | undefined

Mixins beside the style.