Chat

L'anatomia completa della chat: pannello, thread, messaggi, compositore, invio, suggerimenti e indicatore di digitazione. Gli allegati stanno sopra il campo come piccole schede che si possono rimuovere.

Disponibile in
  • Angular: disponibile
  • Vue: disponibile
  • React: disponibile
  • React Native: non ancora disponibile

Utilizzo

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

Importazione

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

Riferimento 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.

Selettore
sone-chat-attachment
Input
NomeTipo Predefinito
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
Output
NomeTipo
remove

The remove button was pressed.

void

SoneChatComposerComponentComponente

Selettore
sone-chat-composer
Input
NomeTipo Predefinito
layoutChatComposerLayout"inline"
Output
NomeTipo
submittedvoid

SoneChatComposerInputDirectiveDirettiva

Selettore
textarea[soneChatComposerInput]
Output
NomeTipo
draftInputstring

SoneChatComposerSubmitComponentComponente

Selettore
sone-chat-composer-submit
Input
NomeTipo Predefinito
pendingbooleanfalse
disabledbooleanfalse

SoneChatComposerToolsDirectiveDirettiva

Selettore
[soneChatComposerTools]

SoneChatMessageComponentComponente

Selettore
sone-chat-message
Input
NomeTipo Predefinito
fromobbligatorioChatMessageFrom—
variantBubbleVariant | nullnull

SoneChatMessageContentDirectiveDirettiva

Selettore
[soneChatMessageContent]
Input
NomeTipo Predefinito
labelstring | undefinedundefined

SoneChatPaneActionsDirectiveDirettiva

Selettore
[soneChatPaneActions]

SoneChatPaneDescriptionDirectiveDirettiva

Selettore
[soneChatPaneDescription]

SoneChatPaneDirectiveDirettiva

Selettore
[soneChatPane]
Input
NomeTipo Predefinito
barebooleanfalse

SoneChatPaneHeaderDirectiveDirettiva

Selettore
[soneChatPaneHeader]

SoneChatPaneHeadingDirectiveDirettiva

Selettore
[soneChatPaneHeading]

SoneChatPaneTitleDirectiveDirettiva

Selettore
[soneChatPaneTitle]

SoneChatThreadComponentComponente

Selettore
sone-chat-thread
Input
NomeTipo Predefinito
label—$localize`Conversation`

SoneSuggestionChipsComponentComponente

Selettore
sone-suggestion-chips
Input
NomeTipo Predefinito
suggestionsreadonly string[][]
disabledbooleanfalse
label—$localize`Suggested questions`
Output
NomeTipo
pickedstring

SoneTypingIndicatorComponentComponente

Selettore
sone-typing-indicator
Input
NomeTipo Predefinito
label—$localize`Thinking`