Mixins / foldkit-mixins-ui

ChatMessageView

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

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 statusLabel?: string | undefined
  readonly onRetry?: Message | undefined
  readonly retryLabel?: string | undefined
  readonly actions?: ReadonlyArray<ChatMessageAction<Message>> | undefined
  readonly actionsLabel?: string | 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:86

readonly from: ChatMessageFrom

ChatMessageView.content

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

readonly content: Html | string

Plain text, or Html such as rendered Markdown.

ChatMessageView.author

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

readonly author?: string | undefined

ChatMessageView.avatar

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

readonly avatar?: Html | undefined

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

ChatMessageView.time

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

readonly time?: ChatMessageTime | undefined

ChatMessageView.status

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

readonly status?: ChatMessageStatus | undefined

ChatMessageView.statusLabel

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

readonly statusLabel?: string | undefined

The status as shown and read; Sending…, Sent or Not sent when omitted.

ChatMessageView.onRetry

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

readonly onRetry?: Message | undefined

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

ChatMessageView.retryLabel

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

readonly retryLabel?: string | undefined

Default Retry.

ChatMessageView.actions

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

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

ChatMessageView.actionsLabel

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

readonly actionsLabel?: string | undefined

Names the actions as a group; default Message actions.

ChatMessageView.pinActions

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

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:109

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:111

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:113

readonly style?: NamedStyle<typeof ChatMessageSlots> | undefined

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

ChatMessageView.mixins

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

readonly mixins?: MixinList<Message> | undefined

Mixins beside the style.