diff --git a/CHANGELOG.md b/CHANGELOG.md
index 80d8b8132f..4d5d3ecc06 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,12 @@ Legends:
## [Unreleased]
+### Added
+
+- Rich cards: added fill-in of `replyToId` for "IM back", "post back", and "message back" card actions, in PR [#5871](https://github.com/microsoft/BotFramework-WebChat/pull/5871), by [@compulim](https://github.com/compulim)
+- `hooks/useSendMessage`: added `replyToId`, in PR [#5871](https://github.com/microsoft/BotFramework-WebChat/pull/5871), by [@compulim](https://github.com/compulim)
+- `hooks/useSendMessageBack`: added `replyToId`, in PR [#5871](https://github.com/microsoft/BotFramework-WebChat/pull/5871), by [@compulim](https://github.com/compulim)
+
## [4.19.2] - 2026-10-08
### Added
@@ -30,7 +36,7 @@ Legends:
- ~~Refer to [this test](./__tests__/html2/adaptiveCard/signInAction.html) for the reference payload~~
- ~~Note: this implementation is based on observation of how Microsoft Teams behave and could deviate from their official implementation~~
- Obsoleted in favor of PR [#5862](https://github.com/microsoft/BotFramework-WebChat/pull/5862)
-- Added card action `webchat:callURL` and [Adaptive Card action `Action.OpenUrlDialog`](https://adaptivecards.microsoft.com/?topic=Action.OpenUrlDialog)
+- Added card action `webchat:callURL` and [Adaptive Card action `Action.OpenUrlDialog`](https://adaptivecards.microsoft.com/?topic=Action.OpenUrlDialog), in PR [#5862](https://github.com/microsoft/BotFramework-WebChat/pull/5862) and PR [#5863](https://github.com/microsoft/BotFramework-WebChat/pull/5863), by [@compulim](https://github.com/compulim)
- The card action is designed to host popup for authentication and authorization (call-and-return pattern), it can optionally send a postback message to the bot
- Open in popup, in PR [#5862](https://github.com/microsoft/BotFramework-WebChat/pull/5862), by [@compulim](https://github.com/compulim)
- Added `styleOptions.callURLActionPopupWindowHeight/Width` for sizing the popup window
diff --git a/__tests__/html2/avatar/layout.default.oneSide.html b/__tests__/html2/avatar/layout.default.oneSide.html
index 32f5800652..6e041c26d0 100644
--- a/__tests__/html2/avatar/layout.default.oneSide.html
+++ b/__tests__/html2/avatar/layout.default.oneSide.html
@@ -49,6 +49,7 @@
await pageObjects.sendMessageViaSendBox('normal');
await pageConditions.numActivitiesShown(2);
+ await pageConditions.allOutgoingActivitiesSent();
await host.snapshot('local', { skipCheckAccessibility: true });
diff --git a/__tests__/html2/hooks/usePerformCardAction.replyToId.html b/__tests__/html2/hooks/usePerformCardAction.replyToId.html
new file mode 100644
index 0000000000..a44733a852
--- /dev/null
+++ b/__tests__/html2/hooks/usePerformCardAction.replyToId.html
@@ -0,0 +1,71 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/__tests__/html2/hooks/useSendPostBack.replyToId.html b/__tests__/html2/hooks/useSendPostBack.replyToId.html
new file mode 100644
index 0000000000..af3ed68e47
--- /dev/null
+++ b/__tests__/html2/hooks/useSendPostBack.replyToId.html
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/__tests__/html2/hooks/useSendPostBack.replyToId.html.snap-1.png b/__tests__/html2/hooks/useSendPostBack.replyToId.html.snap-1.png
new file mode 100644
index 0000000000..21152c76d8
Binary files /dev/null and b/__tests__/html2/hooks/useSendPostBack.replyToId.html.snap-1.png differ
diff --git a/__tests__/html2/hooks/useSendPostBack.text.html b/__tests__/html2/hooks/useSendPostBack.text.html
new file mode 100644
index 0000000000..724f50e2f0
--- /dev/null
+++ b/__tests__/html2/hooks/useSendPostBack.text.html
@@ -0,0 +1,85 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/__tests__/html2/hooks/useSendPostBack.text.html.snap-1.png b/__tests__/html2/hooks/useSendPostBack.text.html.snap-1.png
new file mode 100644
index 0000000000..aa4f11d4d9
Binary files /dev/null and b/__tests__/html2/hooks/useSendPostBack.text.html.snap-1.png differ
diff --git a/__tests__/html2/replyToId/cardAction/adaptiveCard.html b/__tests__/html2/replyToId/cardAction/adaptiveCard.html
new file mode 100644
index 0000000000..8540f05034
--- /dev/null
+++ b/__tests__/html2/replyToId/cardAction/adaptiveCard.html
@@ -0,0 +1,111 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/__tests__/html2/replyToId/cardAction/adaptiveCard.html.snap-1.png b/__tests__/html2/replyToId/cardAction/adaptiveCard.html.snap-1.png
new file mode 100644
index 0000000000..002d722631
Binary files /dev/null and b/__tests__/html2/replyToId/cardAction/adaptiveCard.html.snap-1.png differ
diff --git a/__tests__/html2/replyToId/cardAction/animationCard.html b/__tests__/html2/replyToId/cardAction/animationCard.html
new file mode 100644
index 0000000000..ba3af6ba54
--- /dev/null
+++ b/__tests__/html2/replyToId/cardAction/animationCard.html
@@ -0,0 +1,107 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/__tests__/html2/replyToId/cardAction/animationCard.html.snap-1.png b/__tests__/html2/replyToId/cardAction/animationCard.html.snap-1.png
new file mode 100644
index 0000000000..2eccfe34c8
Binary files /dev/null and b/__tests__/html2/replyToId/cardAction/animationCard.html.snap-1.png differ
diff --git a/__tests__/html2/replyToId/cardAction/audioCard.html b/__tests__/html2/replyToId/cardAction/audioCard.html
new file mode 100644
index 0000000000..073c57ccfe
--- /dev/null
+++ b/__tests__/html2/replyToId/cardAction/audioCard.html
@@ -0,0 +1,102 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/__tests__/html2/replyToId/cardAction/audioCard.html.snap-1.png b/__tests__/html2/replyToId/cardAction/audioCard.html.snap-1.png
new file mode 100644
index 0000000000..821ed47962
Binary files /dev/null and b/__tests__/html2/replyToId/cardAction/audioCard.html.snap-1.png differ
diff --git a/__tests__/html2/replyToId/cardAction/heroCard.html b/__tests__/html2/replyToId/cardAction/heroCard.html
new file mode 100644
index 0000000000..01ef1c7f1d
--- /dev/null
+++ b/__tests__/html2/replyToId/cardAction/heroCard.html
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/__tests__/html2/replyToId/cardAction/heroCard.html.snap-1.png b/__tests__/html2/replyToId/cardAction/heroCard.html.snap-1.png
new file mode 100644
index 0000000000..664ac91b3a
Binary files /dev/null and b/__tests__/html2/replyToId/cardAction/heroCard.html.snap-1.png differ
diff --git a/__tests__/html2/replyToId/cardAction/imBack.html b/__tests__/html2/replyToId/cardAction/imBack.html
new file mode 100644
index 0000000000..e83da1c8ee
--- /dev/null
+++ b/__tests__/html2/replyToId/cardAction/imBack.html
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/__tests__/html2/replyToId/cardAction/imBack.html.snap-1.png b/__tests__/html2/replyToId/cardAction/imBack.html.snap-1.png
new file mode 100644
index 0000000000..aae5e034ca
Binary files /dev/null and b/__tests__/html2/replyToId/cardAction/imBack.html.snap-1.png differ
diff --git a/__tests__/html2/replyToId/cardAction/messageBack.html b/__tests__/html2/replyToId/cardAction/messageBack.html
new file mode 100644
index 0000000000..83f88dac98
--- /dev/null
+++ b/__tests__/html2/replyToId/cardAction/messageBack.html
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/__tests__/html2/replyToId/cardAction/messageBack.html.snap-1.png b/__tests__/html2/replyToId/cardAction/messageBack.html.snap-1.png
new file mode 100644
index 0000000000..23a3493f4c
Binary files /dev/null and b/__tests__/html2/replyToId/cardAction/messageBack.html.snap-1.png differ
diff --git a/__tests__/html2/replyToId/cardAction/oauthCard.html b/__tests__/html2/replyToId/cardAction/oauthCard.html
new file mode 100644
index 0000000000..5f3063743c
--- /dev/null
+++ b/__tests__/html2/replyToId/cardAction/oauthCard.html
@@ -0,0 +1,96 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/__tests__/html2/replyToId/cardAction/oauthCard.html.snap-1.png b/__tests__/html2/replyToId/cardAction/oauthCard.html.snap-1.png
new file mode 100644
index 0000000000..664ac91b3a
Binary files /dev/null and b/__tests__/html2/replyToId/cardAction/oauthCard.html.snap-1.png differ
diff --git a/__tests__/html2/replyToId/cardAction/receiptCard.html b/__tests__/html2/replyToId/cardAction/receiptCard.html
new file mode 100644
index 0000000000..153df80fa9
--- /dev/null
+++ b/__tests__/html2/replyToId/cardAction/receiptCard.html
@@ -0,0 +1,108 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/__tests__/html2/replyToId/cardAction/receiptCard.html.snap-1.png b/__tests__/html2/replyToId/cardAction/receiptCard.html.snap-1.png
new file mode 100644
index 0000000000..41e232ad9a
Binary files /dev/null and b/__tests__/html2/replyToId/cardAction/receiptCard.html.snap-1.png differ
diff --git a/__tests__/html2/replyToId/cardAction/signInCard.html b/__tests__/html2/replyToId/cardAction/signInCard.html
new file mode 100644
index 0000000000..ad1598d699
--- /dev/null
+++ b/__tests__/html2/replyToId/cardAction/signInCard.html
@@ -0,0 +1,94 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/__tests__/html2/replyToId/cardAction/signInCard.html.snap-1.png b/__tests__/html2/replyToId/cardAction/signInCard.html.snap-1.png
new file mode 100644
index 0000000000..664ac91b3a
Binary files /dev/null and b/__tests__/html2/replyToId/cardAction/signInCard.html.snap-1.png differ
diff --git a/__tests__/html2/replyToId/cardAction/thumbnailCard.html b/__tests__/html2/replyToId/cardAction/thumbnailCard.html
new file mode 100644
index 0000000000..b3e04b2339
--- /dev/null
+++ b/__tests__/html2/replyToId/cardAction/thumbnailCard.html
@@ -0,0 +1,100 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/__tests__/html2/replyToId/cardAction/thumbnailCard.html.snap-1.png b/__tests__/html2/replyToId/cardAction/thumbnailCard.html.snap-1.png
new file mode 100644
index 0000000000..431c9aa19b
Binary files /dev/null and b/__tests__/html2/replyToId/cardAction/thumbnailCard.html.snap-1.png differ
diff --git a/__tests__/html2/replyToId/cardAction/videoCard.html b/__tests__/html2/replyToId/cardAction/videoCard.html
new file mode 100644
index 0000000000..cb858ce115
--- /dev/null
+++ b/__tests__/html2/replyToId/cardAction/videoCard.html
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/__tests__/html2/replyToId/cardAction/videoCard.html.snap-1.png b/__tests__/html2/replyToId/cardAction/videoCard.html.snap-1.png
new file mode 100644
index 0000000000..1e4b26d796
Binary files /dev/null and b/__tests__/html2/replyToId/cardAction/videoCard.html.snap-1.png differ
diff --git a/docs/API.md b/docs/API.md
index 121486ea04..7712e5209c 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -9,18 +9,18 @@ There are several properties that you might pass into your Web Chat React Compon
| `adaptiveCardHostConfig` | Pass in a custom Adaptive Cards host config. Be sure to verify your Host Config with the version of Adaptive Cards that is being used. See [Custom Host config](https://github.com/microsoft/BotFramework-WebChat/issues/2034#issuecomment-501818238) for more information. |
| `attachmentMiddleware` | A chain of middleware that allows the developer to add their own custom HTML Elements on attachments. The signature is the following: `options => next => card => next(card)`. |
| `attachmentRenderer` | The "flattened" version of `attachmentMiddleware`. |
-| `cardActionMiddleware` | A chain of middleware that allows the developer to modify card actions, like Adaptive Cards or suggested actions. The middleware signature is the following: `cardActionMiddleware: () => next => ({ cardAction, getSignInUrl }) => next(cardAction)` |
+| `cardActionMiddleware` | A chain of middleware that allows the developer to modify card actions, like Adaptive Cards or suggested actions. The middleware signature is the following: `cardActionMiddleware: () => next => request => next(request)`, where `request` contains `{ cardAction, getSignInUrl, replyToId, target }`. |
| `createDirectLine` | A factory method for instantiating the Direct Line object. Azure Government users should use `createDirectLine({ domain: 'https://directline.botframework.azure.us/v3/directline', token });` to change the endpoint. The full list of parameters are: `conversationId`, `domain`, `fetch`, `pollingInterval`, `secret`, `streamUrl`, `token`, `watermark` `webSocket`. |
| `createStore` | A chain of middleware that allows the developer to modify the store actions. The middleware signature is the following: `createStore: ({}, ({ dispatch }) => next => action => next(cardAction)` |
| `directLine` | Specify the DirectLine object with DirectLine token. We strongly recommend using the token API for authentication instead of providing the app with your secret. To learn more about why, see the [authentication documentation](https://docs.microsoft.com/en-us/azure/bot-service/rest-api/bot-framework-rest-direct-line-3-0-authentication?view=azure-bot-service-4.0) or [connecting client app to bot](#how-to-connect-client-app-to-bot) |
| `disabled` | Disable the UI (i.e. for presentation mode) of Web Chat. |
-| `grammars` | Specify a grammar list for Speech (Cognitive Services Speech Services). |
+| `grammars` | Specify a grammar list for Speech (Cognitive Services Speech Services). |
| `groupTimeStamp` | Change default settings for timestamp groupings. |
| `locale` | Indicate the default language of Web Chat. Four letter codes (such as `en-US`) are strongly recommended. |
| `renderMarkdown` | Change the default Markdown renderer object. |
| `sendTypingIndicator` | Display a typing signal from the user to the bot to indicate that the user is not idling. |
| `store` | Specify a custom store, e.g. for adding programmatic activity to the bot. |
-| `styleOptions` | Object that stores customization values for your styling of Web Chat. For the complete list of (frequently updated) default style options, please see the [defaultStyleOptions.ts](https://github.com/microsoft/BotFramework-WebChat/blob/main/packages/api/src/defaultStyleOptions.ts) and [adaptiveCards/defaultStyleOptions.ts](https://github.com/microsoft/BotFramework-WebChat/blob/main/packages/bundle/src/adaptiveCards/defaultStyleOptions.ts) file. |
+| `styleOptions` | Object that stores customization values for your styling of Web Chat. For the complete list of (frequently updated) default style options, please see the [defaultStyleOptions.ts](https://github.com/microsoft/BotFramework-WebChat/blob/main/packages/api/src/defaultStyleOptions.ts) and [adaptiveCards/defaultStyleOptions.ts](https://github.com/microsoft/BotFramework-WebChat/blob/main/packages/bundle/src/adaptiveCards/defaultStyleOptions.ts) file. |
| `styleSet` | The non-recommended way of overriding styles. |
| `userID` | Specify a userID. There are two ways to specify the `userID`: in props, or in the token when generating the token call (`createDirectLine()`). If both methods are used to specify the userID, the token userID property will be used, and a `console.warn` will appear during runtime. If the `userID` is provided via props but is prefixed with `'dl'`, e.g. `'dl_1234'`, the value will be thrown and a new `ID` generated. If `userID` is not specified, it will default to a random user ID. Multiple users sharing the same user ID is not recommended; their user state will be shared, which creates a security risk when authenticating. |
| `username` | Specify a username. |
diff --git a/docs/HOOKS.md b/docs/HOOKS.md
index 0c9a96068c..6cf95462fc 100644
--- a/docs/HOOKS.md
+++ b/docs/HOOKS.md
@@ -958,16 +958,17 @@ To stop observing scroll positions, pass a falsy value to the `observer` argumen
## `usePerformCardAction`
-```js
-usePerformCardAction(): ({
- displayText: string,
- text: string,
- type: string,
- value: string
-}) => void
+```ts
+usePerformCardAction(): (
+ cardAction: DirectLineCardAction,
+ event?: { readonly target: EventTarget } | undefined,
+ init?: { readonly replyToId?: string | undefined } | undefined
+) => void
```
+> New in 4.19.2: `init.replyToId` is added.
+
When called, this function will perform the card action based on its `type`. The card action will be performed by `cardActionMiddleware`.
List of supported card action types can be found in this [Direct Line Activity card action schema](https://github.com/microsoft/botframework-sdk/blob/main/specs/botframework-activity/botframework-activity.md#type-1).
@@ -1311,11 +1312,13 @@ When called, this function will send a `messageBack` activity to the bot.
```js
-useSendPostBack(): (value: any) => void
+useSendPostBack(): (value: any, init?: { replyToId?: string | undefined } | undefined) => void
```
-When called, this function will send a `postBack` activity to the bot.
+> New in 4.19.2: Added `init.replyToId` argument.
+
+When called, this function will send a `postBack` activity to the bot with optionally `replyToId`.
## `useSendTimeoutForActivity`
diff --git a/packages/api/src/hooks/middleware/createDefaultCardActionMiddleware.ts b/packages/api/src/hooks/middleware/createDefaultCardActionMiddleware.ts
index d2b50fde2f..23f8a85e2d 100644
--- a/packages/api/src/hooks/middleware/createDefaultCardActionMiddleware.ts
+++ b/packages/api/src/hooks/middleware/createDefaultCardActionMiddleware.ts
@@ -19,7 +19,7 @@ export default function createDefaultCardActionMiddleware(): CardActionMiddlewar
case 'imBack':
if (typeof value === 'string') {
// TODO: [P4] Instead of calling dispatch, we should move to dispatchers instead for completeness
- dispatch(sendMessage(value, 'imBack'));
+ dispatch(sendMessage(value, 'imBack', { replyToId }));
} else {
throw new Error('cannot send "imBack" with a non-string value');
}
@@ -27,7 +27,7 @@ export default function createDefaultCardActionMiddleware(): CardActionMiddlewar
break;
case 'messageBack':
- dispatch(sendMessageBack(value, cardAction.text, cardAction.displayText));
+ dispatch(sendMessageBack(value, cardAction.text, cardAction.displayText, { replyToId }));
break;
diff --git a/packages/api/src/hooks/useSendMessage.ts b/packages/api/src/hooks/useSendMessage.ts
index 8473026285..a89461301a 100644
--- a/packages/api/src/hooks/useSendMessage.ts
+++ b/packages/api/src/hooks/useSendMessage.ts
@@ -4,24 +4,36 @@ import { useCallback } from 'react';
import useWebChatAPIContext from './internal/useWebChatAPIContext';
import useTrackEvent from './useTrackEvent';
-export default function useSendMessage(): (
- text?: string,
- method?: string,
- init?: { attachments?: readonly SendBoxAttachment[] | undefined; channelData?: any }
+type UseSendMessageInit = {
+ readonly attachments?: readonly SendBoxAttachment[] | undefined;
+ readonly channelData?: any;
+ readonly replyToId?: string | undefined;
+};
+
+function useSendMessage(): (
+ text?: string | undefined,
+ method?: string | undefined,
+ init?: UseSendMessageInit | undefined
) => void {
const { sendMessage } = useWebChatAPIContext();
const trackEvent = useTrackEvent();
return useCallback(
- (text, method, { attachments, channelData } = {}) => {
+ (text, method, { attachments, channelData, replyToId } = {}) => {
trackEvent('sendMessage', {
numAttachments: attachments?.length || 0,
- // eslint-disable-next-line no-magic-numbers
- sumSizeInKB: Math.round(attachments?.reduce((total, { blob: { size } }) => total + size, 0) / 1024)
+ sumSizeInKB: Math.round(
+ attachments?.reduce((total, { blob: { size } }) => total + size, 0) /
+ // eslint-disable-next-line no-magic-numbers
+ 1024
+ )
});
- sendMessage(text, method, { attachments, channelData });
+ sendMessage(text, method, { attachments, channelData, replyToId });
},
[sendMessage, trackEvent]
);
}
+
+export default useSendMessage;
+export { type UseSendMessageInit };
diff --git a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardAttachment.tsx b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardAttachment.tsx
index 3a670ebd83..7eb4bf5816 100644
--- a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardAttachment.tsx
+++ b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardAttachment.tsx
@@ -27,7 +27,7 @@ function AdaptiveCardAttachment(props: AdaptiveCardAttachmentProps) {
replyToId
} = validateProps(adaptiveCardAttachmentPropsSchema, props);
- return ;
+ return !!content && ;
}
export default memo(AdaptiveCardAttachment);
diff --git a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.tsx b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.tsx
index 4888cea5dc..9e46e9a3e8 100644
--- a/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.tsx
+++ b/packages/bundle/src/adaptiveCards/Attachment/AdaptiveCardRenderer.tsx
@@ -28,7 +28,7 @@ import useActiveElementModEffect from './AdaptiveCardHacks/useActiveElementModEf
import useDisabledModEffect from './AdaptiveCardHacks/useDisabledModEffect';
import usePersistValuesModEffect from './AdaptiveCardHacks/usePersistValuesModEffect';
import useRoleModEffect from './AdaptiveCardHacks/useRoleModEffect';
-import { directLineCardActionSchema } from './private/directLineSchema';
+import { directLineHeadlessCardActionSchema } from './private/directLineCardActionSchema';
import renderAdaptiveCard from './private/renderAdaptiveCard';
import styles from './AdaptiveCardRenderer.module.css';
@@ -41,7 +41,7 @@ const adaptiveCardRendererPropsSchema = pipe(
adaptiveCard: any(),
disabled: optional(boolean()),
replyToId: optional(string()),
- tapAction: optional(directLineCardActionSchema)
+ tapAction: optional(directLineHeadlessCardActionSchema)
}),
readonly()
);
diff --git a/packages/bundle/src/adaptiveCards/Attachment/AnimationCardAttachment.js b/packages/bundle/src/adaptiveCards/Attachment/AnimationCardAttachment.js
deleted file mode 100644
index 8de9f38d5e..0000000000
--- a/packages/bundle/src/adaptiveCards/Attachment/AnimationCardAttachment.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import PropTypes from 'prop-types';
-import React from 'react';
-
-import AnimationCardContent from './AnimationCardContent';
-
-const AnimationCardAttachment = ({ attachment: { content }, disabled }) => (
-
-);
-
-AnimationCardAttachment.defaultProps = {
- disabled: undefined
-};
-
-AnimationCardAttachment.propTypes = {
- attachment: PropTypes.shape({
- content: PropTypes.shape({
- media: PropTypes.arrayOf(
- PropTypes.shape({
- profile: PropTypes.string,
- url: PropTypes.string.isRequired
- })
- ).isRequired
- }).isRequired
- }).isRequired,
- disabled: PropTypes.bool
-};
-
-export default AnimationCardAttachment;
diff --git a/packages/bundle/src/adaptiveCards/Attachment/AnimationCardAttachment.tsx b/packages/bundle/src/adaptiveCards/Attachment/AnimationCardAttachment.tsx
new file mode 100644
index 0000000000..fd48d689ed
--- /dev/null
+++ b/packages/bundle/src/adaptiveCards/Attachment/AnimationCardAttachment.tsx
@@ -0,0 +1,38 @@
+import { validateProps } from '@msinternal/botframework-webchat-react-valibot';
+import React, { memo } from 'react';
+import { boolean, literal, object, optional, pipe, readonly, string, type InferInput } from 'valibot';
+
+import AnimationCardContent from './AnimationCardContent';
+import { directLineMediaCardSchema } from './private/directLineSchema';
+
+const animationCardAttachmentPropsSchema = pipe(
+ object({
+ attachment: pipe(
+ object({
+ content: optional(directLineMediaCardSchema),
+ contentType: literal('application/vnd.microsoft.card.animation')
+ }),
+ readonly()
+ ),
+ disabled: optional(boolean()),
+ replyToId: optional(string())
+ }),
+ readonly()
+);
+
+type AnimationCardAttachmentProps = InferInput;
+
+const AnimationCardAttachment = memo((props: AnimationCardAttachmentProps) => {
+ const {
+ attachment: { content },
+ disabled,
+ replyToId
+ } = validateProps(animationCardAttachmentPropsSchema, props);
+
+ return !!content && ;
+});
+
+AnimationCardAttachment.displayName = 'AnimationCardAttachment';
+
+export default AnimationCardAttachment;
+export { animationCardAttachmentPropsSchema, type AnimationCardAttachmentProps };
diff --git a/packages/bundle/src/adaptiveCards/Attachment/AnimationCardContent.tsx b/packages/bundle/src/adaptiveCards/Attachment/AnimationCardContent.tsx
index 6a738306da..1a149a5a43 100644
--- a/packages/bundle/src/adaptiveCards/Attachment/AnimationCardContent.tsx
+++ b/packages/bundle/src/adaptiveCards/Attachment/AnimationCardContent.tsx
@@ -1,31 +1,34 @@
/* eslint react/no-array-index-key: "off" */
-import { validateProps } from '@msinternal/botframework-webchat-react-valibot';
+import { validateProps, type InferReactProps } from '@msinternal/botframework-webchat-react-valibot';
import { useStyles } from '@msinternal/botframework-webchat-styles/react';
import { Components } from 'botframework-webchat-component';
import React, { memo } from 'react';
-import { boolean, object, optional, pipe, readonly, string, type InferInput } from 'valibot';
+import { boolean, object, optional, pipe, readonly, string } from 'valibot';
+import styles from './AnimationCardContent.module.css';
import CommonCard from './CommonCard';
import { directLineMediaCardSchema } from './private/directLineSchema';
-import styles from './AnimationCardContent.module.css';
-
const { ImageContent, VideoContent } = Components;
const animationCardContentPropsSchema = pipe(
object({
actionPerformedClassName: optional(string()),
content: directLineMediaCardSchema,
- disabled: optional(boolean())
+ disabled: optional(boolean()),
+ replyToId: optional(string())
}),
readonly()
);
-type AnimationCardContentProps = InferInput;
+type AnimationCardContentProps = InferReactProps;
function AnimationCardContent(props: AnimationCardContentProps) {
- const { actionPerformedClassName, content, disabled } = validateProps(animationCardContentPropsSchema, props);
+ const { actionPerformedClassName, content, disabled, replyToId } = validateProps(
+ animationCardContentPropsSchema,
+ props
+ );
const { media = [] } = content;
const classNames = useStyles(styles);
@@ -35,14 +38,25 @@ function AnimationCardContent(props: AnimationCardContentProps) {