Chat

Pełna anatomia czatu: panel, wątek, wiadomości, pole redagowania, wysyłanie, sugestie i wskaźnik pisania. Załączniki leżą nad polem jako małe karty, które można usunąć.

Dostępny w
  • Angular: dostępny
  • Vue: dostępny
  • React: dostępny
  • React Native: jeszcze niedostępny

Użycie

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

Import

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

Dokumentacja API

SoneChatAttachmentComponentKomponent

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

Selektor
sone-chat-attachment
Wejścia
NazwaTyp Domyślnie
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
Wyjścia
NazwaTyp
remove

The remove button was pressed.

void

SoneChatComposerComponentKomponent

Selektor
sone-chat-composer
Wejścia
NazwaTyp Domyślnie
layoutChatComposerLayout"inline"
Wyjścia
NazwaTyp
submittedvoid

SoneChatComposerInputDirectiveDyrektywa

Selektor
textarea[soneChatComposerInput]
Wyjścia
NazwaTyp
draftInputstring

SoneChatComposerSubmitComponentKomponent

Selektor
sone-chat-composer-submit
Wejścia
NazwaTyp Domyślnie
pendingbooleanfalse
disabledbooleanfalse

SoneChatComposerToolsDirectiveDyrektywa

Selektor
[soneChatComposerTools]

SoneChatMessageComponentKomponent

Selektor
sone-chat-message
Wejścia
NazwaTyp Domyślnie
fromwymaganeChatMessageFrom—
variantBubbleVariant | nullnull

SoneChatMessageContentDirectiveDyrektywa

Selektor
[soneChatMessageContent]
Wejścia
NazwaTyp Domyślnie
labelstring | undefinedundefined

SoneChatPaneActionsDirectiveDyrektywa

Selektor
[soneChatPaneActions]

SoneChatPaneDescriptionDirectiveDyrektywa

Selektor
[soneChatPaneDescription]

SoneChatPaneDirectiveDyrektywa

Selektor
[soneChatPane]
Wejścia
NazwaTyp Domyślnie
barebooleanfalse

SoneChatPaneHeaderDirectiveDyrektywa

Selektor
[soneChatPaneHeader]

SoneChatPaneHeadingDirectiveDyrektywa

Selektor
[soneChatPaneHeading]

SoneChatPaneTitleDirectiveDyrektywa

Selektor
[soneChatPaneTitle]

SoneChatThreadComponentKomponent

Selektor
sone-chat-thread
Wejścia
NazwaTyp Domyślnie
label—$localize`Conversation`

SoneSuggestionChipsComponentKomponent

Selektor
sone-suggestion-chips
Wejścia
NazwaTyp Domyślnie
suggestionsreadonly string[][]
disabledbooleanfalse
label—$localize`Suggested questions`
Wyjścia
NazwaTyp
pickedstring

SoneTypingIndicatorComponentKomponent

Selektor
sone-typing-indicator
Wejścia
NazwaTyp Domyślnie
label—$localize`Thinking`