From 73fe63501ced7f9c60184eab8cd03aa36d26af9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20C=C3=A1mera?= <81186472+ncamera@users.noreply.github.com> Date: Fri, 18 Oct 2024 14:15:03 -0300 Subject: [PATCH] `[ch-chat]` Remove unused "accessibleName.chat" translation (#448) --- src/components/chat/readme.md | 28 +++++++++---------- src/components/chat/translations.ts | 1 - .../assets/components/chat/callbacks.ts | 1 - 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/components/chat/readme.md b/src/components/chat/readme.md index 98be82c40..0eba28876 100644 --- a/src/components/chat/readme.md +++ b/src/components/chat/readme.md @@ -11,20 +11,20 @@ TODO: Add description ## Properties -| Property | Attribute | Description | Type | Default | -| --------------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | -| `callbacks` _(required)_ | -- | Specifies the callbacks required in the control. | `{ clear: () => Promise; sendChatToLLM: (chat: ChatMessage[]) => void; stopGeneratingAnswer?: () => Promise; uploadImage: (imageFile: File) => Promise; }` | `undefined` | -| `disabled` | `disabled` | Specifies if all interactions are disabled | `boolean` | `false` | -| `generatingResponse` _(required)_ | `generating-response` | `true` if a response for the assistant is being generated. | `boolean` | `undefined` | -| `hyperlinkToDownloadFile` | -- | Specifies an object containing an HTMLAnchorElement reference. Use this property to render a button to download the code when displaying a code block. | `{ anchor: HTMLAnchorElement; }` | `undefined` | -| `imageUpload` | `image-upload` | Specifies if the control can render a button to load images from the file system. | `boolean` | `false` | -| `isMobile` _(required)_ | `is-mobile` | Specifies if the chat is used in a mobile device. | `boolean` | `undefined` | -| `items` | -- | Specifies the items that the chat will display. | `ChatMessage[]` | `[]` | -| `loadingState` _(required)_ | `loading-state` | Specifies if the chat is waiting for the data to be loaded. | `"all-records-loaded" \| "initial" \| "loading" \| "more-data-to-fetch"` | `undefined` | -| `markdownTheme` | `markdown-theme` | Specifies the theme to be used for rendering the markdown. If `null`, no theme will be applied. | `string` | `"ch-markdown-viewer"` | -| `renderCode` | -- | This property allows us to implement custom rendering for the code blocks. | `(options: MarkdownViewerCodeRenderOptions) => any` | `undefined` | -| `renderItem` | -- | This property allows us to implement custom rendering of chat items. If allow us to implement the render of the cell content. | `(messageModel: ChatMessageByRole<"error" \| "user" \| "assistant">) => any` | `undefined` | -| `translations` _(required)_ | -- | Specifies the literals required in the control. | `{ accessibleName: { chat: string; clearChat: string; copyResponseButton: string; downloadCodeButton: string; imagePicker: string; removeUploadedImage: string; sendButton: string; sendInput: string; stopGeneratingAnswerButton: string; }; placeholder: { sendInput: string; }; text: { copyCodeButton: string; processing: string; sourceFiles: string; }; }` | `undefined` | +| Property | Attribute | Description | Type | Default | +| --------------------------------- | --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- | +| `callbacks` _(required)_ | -- | Specifies the callbacks required in the control. | `{ clear: () => Promise; sendChatToLLM: (chat: ChatMessage[]) => void; stopGeneratingAnswer?: () => Promise; uploadImage: (imageFile: File) => Promise; }` | `undefined` | +| `disabled` | `disabled` | Specifies if all interactions are disabled | `boolean` | `false` | +| `generatingResponse` _(required)_ | `generating-response` | `true` if a response for the assistant is being generated. | `boolean` | `undefined` | +| `hyperlinkToDownloadFile` | -- | Specifies an object containing an HTMLAnchorElement reference. Use this property to render a button to download the code when displaying a code block. | `{ anchor: HTMLAnchorElement; }` | `undefined` | +| `imageUpload` | `image-upload` | Specifies if the control can render a button to load images from the file system. | `boolean` | `false` | +| `isMobile` _(required)_ | `is-mobile` | Specifies if the chat is used in a mobile device. | `boolean` | `undefined` | +| `items` | -- | Specifies the items that the chat will display. | `ChatMessage[]` | `[]` | +| `loadingState` _(required)_ | `loading-state` | Specifies if the chat is waiting for the data to be loaded. | `"all-records-loaded" \| "initial" \| "loading" \| "more-data-to-fetch"` | `undefined` | +| `markdownTheme` | `markdown-theme` | Specifies the theme to be used for rendering the markdown. If `null`, no theme will be applied. | `string` | `"ch-markdown-viewer"` | +| `renderCode` | -- | This property allows us to implement custom rendering for the code blocks. | `(options: MarkdownViewerCodeRenderOptions) => any` | `undefined` | +| `renderItem` | -- | This property allows us to implement custom rendering of chat items. If allow us to implement the render of the cell content. | `(messageModel: ChatMessageByRole<"error" \| "user" \| "assistant">) => any` | `undefined` | +| `translations` _(required)_ | -- | Specifies the literals required in the control. | `{ accessibleName: { clearChat: string; copyResponseButton: string; downloadCodeButton: string; imagePicker: string; removeUploadedImage: string; sendButton: string; sendInput: string; stopGeneratingAnswerButton: string; }; placeholder: { sendInput: string; }; text: { copyCodeButton: string; processing: string; sourceFiles: string; }; }` | `undefined` | ## Methods diff --git a/src/components/chat/translations.ts b/src/components/chat/translations.ts index f0ef149ad..860b9af1e 100644 --- a/src/components/chat/translations.ts +++ b/src/components/chat/translations.ts @@ -1,6 +1,5 @@ export type ChatTranslations = { accessibleName: { - chat: string; clearChat: string; copyResponseButton: string; downloadCodeButton: string; diff --git a/src/showcase/assets/components/chat/callbacks.ts b/src/showcase/assets/components/chat/callbacks.ts index 2d8f9ed45..3d8cca803 100644 --- a/src/showcase/assets/components/chat/callbacks.ts +++ b/src/showcase/assets/components/chat/callbacks.ts @@ -166,7 +166,6 @@ export const chatCallbacks: ChatInternalCallbacks = { export const chatTranslations: ChatTranslations = { accessibleName: { - chat: "Chat", clearChat: "Clear chat", copyResponseButton: "Copy assistant response", downloadCodeButton: "Download code",