Chat

A anatomia completa do chat: painel, thread, mensagens, compositor, envio, sugestões e indicador de digitação. Os anexos ficam acima do campo como pequenos cartões que se podem remover.

Disponível em
  • Angular: disponível
  • Vue: disponível
  • React: disponível
  • React Native: ainda não disponível

Uso

Ask about this meeting

Answers use the planning meeting transcript
What did Ada and Leo decide about the onboarding checklist?
They agreed to cut the checklist from twelve steps to five and to ship the shorter version behind a feature flag first. Leo owns the rollout.
Planning meetingmeetings.example.com/planning

Importação

ts
import {
  SoneChatAttachmentComponent,
  SoneChatComposerComponent,
  SoneChatComposerInputDirective,
  SoneChatComposerSubmitComponent,
  SoneChatComposerToolsDirective,
  SoneChatMessageComponent,
  SoneChatMessageContentDirective,
  SoneChatPaneActionsDirective,
  SoneChatPaneDescriptionDirective,
  SoneChatPaneDirective,
  SoneChatPaneHeaderDirective,
  SoneChatPaneHeadingDirective,
  SoneChatPaneTitleDirective,
  SoneChatThreadComponent,
  SoneSuggestionChipsComponent,
  SoneTypingIndicatorComponent,
} from "@surface-one/angular/chat";

Referência da API

SoneChatAttachmentComponentComponente

`<sone-chat-attachment>` — a linked or uploaded item in the composer: a grey card with a mark (the projected content: a favicon, a file icon, a `<sone-mark>`), the `title` and its `url` (or a size), and — when `removable` — a small round remove button (“Remove {title}”) that emits `remove`. Put it inside `<sone-chat-composer>`, which lines attachments up above the field.

Seletor
sone-chat-attachment
Inputs
NomeTipo Padrão
title

What it is: a page title, a file name.

string""
url

Where it is (or its size), under the title.

string | nullnull
removable

Shows the remove button.

booleanfalse
Outputs
NomeTipo
remove

The remove button was pressed.

void

SoneChatComposerComponentComponente

Seletor
sone-chat-composer
Inputs
NomeTipo Padrão
layoutChatComposerLayout"inline"
Outputs
NomeTipo
submittedvoid

SoneChatComposerInputDirectiveDiretiva

Seletor
textarea[soneChatComposerInput]
Outputs
NomeTipo
draftInputstring

SoneChatComposerSubmitComponentComponente

Seletor
sone-chat-composer-submit
Inputs
NomeTipo Padrão
pendingbooleanfalse
disabledbooleanfalse

SoneChatComposerToolsDirectiveDiretiva

Seletor
[soneChatComposerTools]

SoneChatMessageComponentComponente

Seletor
sone-chat-message
Inputs
NomeTipo Padrão
fromobrigatórioChatMessageFrom—
variantBubbleVariant | nullnull

SoneChatMessageContentDirectiveDiretiva

Seletor
[soneChatMessageContent]
Inputs
NomeTipo Padrão
labelstring | undefinedundefined

SoneChatPaneActionsDirectiveDiretiva

Seletor
[soneChatPaneActions]

SoneChatPaneDescriptionDirectiveDiretiva

Seletor
[soneChatPaneDescription]

SoneChatPaneDirectiveDiretiva

Seletor
[soneChatPane]
Inputs
NomeTipo Padrão
barebooleanfalse

SoneChatPaneHeaderDirectiveDiretiva

Seletor
[soneChatPaneHeader]

SoneChatPaneHeadingDirectiveDiretiva

Seletor
[soneChatPaneHeading]

SoneChatPaneTitleDirectiveDiretiva

Seletor
[soneChatPaneTitle]

SoneChatThreadComponentComponente

Seletor
sone-chat-thread
Inputs
NomeTipo Padrão
label—$localize`Conversation`

SoneSuggestionChipsComponentComponente

Seletor
sone-suggestion-chips
Inputs
NomeTipo Padrão
suggestionsreadonly string[][]
disabledbooleanfalse
label—$localize`Suggested questions`
Outputs
NomeTipo
pickedstring

SoneTypingIndicatorComponentComponente

Seletor
sone-typing-indicator
Inputs
NomeTipo Padrão
label—$localize`Thinking`