Skip to content

Commit df89dbb

Browse files
[Chat] Update the Storybook for the adapter changes for inline image (#4156)
* Storybook changes * Change files * Duplicate change files for beta release
1 parent e875cbc commit df89dbb

3 files changed

+46
-37
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "none",
3+
"area": "improvement",
4+
"workstream": "InlineImage",
5+
"comment": "Update the Storybook for the adapter changes for inline image",
6+
"packageName": "@azure/communication-react",
7+
"email": "[email protected]",
8+
"dependentChangeType": "none"
9+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "none",
3+
"area": "improvement",
4+
"workstream": "InlineImage",
5+
"comment": "Update the Storybook for the adapter changes for inline image",
6+
"packageName": "@azure/communication-react",
7+
"email": "[email protected]",
8+
"dependentChangeType": "none"
9+
}

packages/storybook/stories/Adapters/Adapters.stories.mdx

+28-37
Original file line numberDiff line numberDiff line change
@@ -145,22 +145,23 @@ The ChatAdapter and the ChatComposite are purpose-built to support single chat t
145145

146146
### ChatAdapter
147147

148-
| Method | Details | Signature |
149-
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
150-
| **`fetchInitialData`** | Fetch initial state for the Chat adapter. Performs the minimal fetch necessary for ChatComposite and API methods. | `() => Promise<void>` |
151-
| **`onStateChange`** | Subscribes the handler to stateChanged events. | `(handler: (state: `[`ChatAdapterState`](#chatadapterstate)`) => void) => void` |
152-
| **`offStateChange`** | Unsubscribes the handler to stateChanged events. | `(handler: (state: `[`ChatAdapterState`](#chatadapterstate)`) => void) => void` |
153-
| **`getState`** | Get the current State | `() => `[`ChatAdapterState`](#chatadapterstate) |
154-
| **`dispose`** | Dispose of the Composite | `() => void` |
155-
| **`sendMessage`** | Send a message in the thread. | `(content: string) => Promise<void>` |
156-
| **`sendReadReceipt`** | Send a read receipt for a message. | `(chatMessageId: string) => Promise<void>` |
157-
| **`sendTypingIndicator`** | Send typing indicator in the thread. | `() => Promise<void>` |
158-
| **`removeParticipant`** | Remove a participant in the thread. | `(userId: string) => Promise<void>` |
159-
| **`setTopic`** | Set the topic for the thread. | `(topicName: string) => Promise<void>` |
160-
| **`updateMessage`** | Update a message content. | `(messageId: string, content: string) => Promise<void>` |
161-
| **`deleteMessage`** | Delete a message in the thread. | `(messageId: string) => Promise<void>` |
162-
| **`loadPreviousChatMessages`** | Load more previous messages in the chat thread history. | `(messagesToLoad: number) => Promise<boolean>` |
163-
| **`downloadAttachment`** **(Beta)** | Download a list of attachments. Add your download logic and authentication here as needed. | `(options: { attachmentUrl: string }) => Promise<`AttachmentDownloadResult`(#attachmentdownloadresult-beta)>` |
148+
| Method | Details | Signature |
149+
| ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
150+
| **`fetchInitialData`** | Fetch initial state for the Chat adapter. Performs the minimal fetch necessary for ChatComposite and API methods. | `() => Promise<void>` |
151+
| **`onStateChange`** | Subscribes the handler to stateChanged events. | `(handler: (state: `[`ChatAdapterState`](#chatadapterstate)`) => void) => void` |
152+
| **`offStateChange`** | Unsubscribes the handler to stateChanged events. | `(handler: (state: `[`ChatAdapterState`](#chatadapterstate)`) => void) => void` |
153+
| **`getState`** | Get the current State | `() => `[`ChatAdapterState`](#chatadapterstate) |
154+
| **`dispose`** | Dispose of the Composite | `() => void` |
155+
| **`sendMessage`** | Send a message in the thread. | `(content: string) => Promise<void>` |
156+
| **`sendReadReceipt`** | Send a read receipt for a message. | `(chatMessageId: string) => Promise<void>` |
157+
| **`sendTypingIndicator`** | Send typing indicator in the thread. | `() => Promise<void>` |
158+
| **`removeParticipant`** | Remove a participant in the thread. | `(userId: string) => Promise<void>` |
159+
| **`setTopic`** | Set the topic for the thread. | `(topicName: string) => Promise<void>` |
160+
| **`updateMessage`** | Update a message content. | `(messageId: string, content: string) => Promise<void>` |
161+
| **`deleteMessage`** | Delete a message in the thread. | `(messageId: string) => Promise<void>` |
162+
| **`loadPreviousChatMessages`** | Load more previous messages in the chat thread history. | `(messagesToLoad: number) => Promise<boolean>` |
163+
| **`downloadResourceToCache`** **(Beta)** | Downloads a resource into the cache for the given message. | `(resourceDetails: `[`ResourceDetails`](#resourcedetails-beta)`): Promise<void>` |
164+
| **`removeResourceFromCache`** **(Beta)** | Removes a resource from the cache for the given message. | `(resourceDetails: `[`ResourceDetails`](#resourcedetails-beta)`): Promise<void>` |
164165

165166
### ChatAdapterState
166167

@@ -172,11 +173,13 @@ The ChatAdapter and the ChatComposite are purpose-built to support single chat t
172173
| **`thread`** | [`ChatThreadClientState`](https://learn.microsoft.com/en-us/javascript/api/@azure/communication-react/chatthreadclientstate) |
173174
| **`latestErrors`** | `ChatAdapterErrors` <br /><br />Latest error encountered for each operation performed via the adapter |
174175

175-
### AttachmentDownloadResult (Beta)
176+
### ResourceDetails (Beta)
176177

177-
| Property | Type |
178-
| ------------- | ------------------------------------------------- |
179-
| **`blobUrl`** | `string` <br /><br />Blob url for the attachment. |
178+
| Property | Type |
179+
| ----------------- | ----------------------------------------------------------------------------- |
180+
| **`threadId`** | `string` <br /><br />Thread Id for the resource. |
181+
| **`messageId`** | `string` <br /><br />Message Id for the message that the resource belongs to. |
182+
| **`resourceUrl`** | `string` <br /><br />Download URL for the given resource. |
180183

181184
## Functions
182185

@@ -241,23 +244,11 @@ async function createAzureCommunicationCallAdapter(args: AzureCommunicationChatA
241244
```ts
242245
async function createAzureCommunicationChatAdapterFromClient(
243246
chatClient: StatefulChatClient,
244-
chatThreadClient: ChatThreadClient,
245-
options?: AzureCommunicationChatAdapterOptions
247+
chatThreadClient: ChatThreadClient
246248
);
247249
```
248250

249-
| Property | Type |
250-
| ------------------------ | --------------------------------------------------------------------------------------------------------------------- |
251-
| **`chatClient`** | [`StatefulChatClient`](https://docs.microsoft.com/en-us/javascript/api/@azure/communication-react/statefulchatclient) |
252-
| **`chatThreadClient`** | [`ChatThreadClient`](https://docs.microsoft.com/en-us/javascript/api/@azure/communication-chat/chatthreadclient) |
253-
| **`options`** **(Beta)** | `AzureCommunicationChatAdapterOptions` |
254-
255-
```ts
256-
export type AzureCommunicationChatAdapterOptions = {
257-
credential?: CommunicationTokenCredential;
258-
};
259-
```
260-
261-
| Property | Type |
262-
| ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
263-
| **`credential`** | [`CommunicationTokenCredential`](https://docs.microsoft.com/en-us/javascript/api/@azure/communication-common/communicationtokencredential) <br />_The optional property that contains communication token._ |
251+
| Property | Type |
252+
| ---------------------- | --------------------------------------------------------------------------------------------------------------------- |
253+
| **`chatClient`** | [`StatefulChatClient`](https://docs.microsoft.com/en-us/javascript/api/@azure/communication-react/statefulchatclient) |
254+
| **`chatThreadClient`** | [`ChatThreadClient`](https://docs.microsoft.com/en-us/javascript/api/@azure/communication-chat/chatthreadclient) |

0 commit comments

Comments
 (0)