diff --git a/CHANGELOG.md b/CHANGELOG.md index 9218d63f54..3cbdef6cc4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/ - Moved from `redux-devtools-extension@2.13.9` to `@redux/devtools-extension@3.3.0`, in PR [#5292](https://github.com/microsoft/BotFramework-WebChat/pull/5292), by [@compulim](https://github.com/compulim) - Enhanced the visual presentation of the Fluent theme copilot variant, in PR [#5293](https://github.com/microsoft/BotFramework-WebChat/pull/5293), by [@OEvgeny](https://github.com/OEvgeny) - Refactored spacing and layout for copilot variant in Fluent theme, improving visual consistency, in PR [#5296](https://github.com/microsoft/BotFramework-WebChat/pull/5296), by [@OEvgeny](https://github.com/OEvgeny) +- Added a content generated badge to AI-generated messages, in PR [#5298](https://github.com/microsoft/BotFramework-WebChat/pull/5298), by [@OEvgeny](https://github.com/OEvgeny) ### Fixed diff --git a/__tests__/__image_snapshots__/html/accessibility-send-box-alert-empty-message-multiline-text-box-enter-js-fluent-theme-applied-accessibility-requirement-when-pressing-enter-on-an-empty-multiline-send-box-should-alert-about-empty-message-3-snap.png b/__tests__/__image_snapshots__/html/accessibility-send-box-alert-empty-message-multiline-text-box-enter-js-fluent-theme-applied-accessibility-requirement-when-pressing-enter-on-an-empty-multiline-send-box-should-alert-about-empty-message-3-snap.png index 1d4e12bebb..dcb75df1e7 100644 Binary files a/__tests__/__image_snapshots__/html/accessibility-send-box-alert-empty-message-multiline-text-box-enter-js-fluent-theme-applied-accessibility-requirement-when-pressing-enter-on-an-empty-multiline-send-box-should-alert-about-empty-message-3-snap.png and b/__tests__/__image_snapshots__/html/accessibility-send-box-alert-empty-message-multiline-text-box-enter-js-fluent-theme-applied-accessibility-requirement-when-pressing-enter-on-an-empty-multiline-send-box-should-alert-about-empty-message-3-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-1-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-1-snap.png new file mode 100644 index 0000000000..e62afb1e01 Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-2-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-2-snap.png new file mode 100644 index 0000000000..899780fb10 Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-2-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-3-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-3-snap.png new file mode 100644 index 0000000000..9f225bc4cd Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-3-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-4-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-4-snap.png new file mode 100644 index 0000000000..cb201bbe00 Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-4-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-5-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-5-snap.png new file mode 100644 index 0000000000..9edf88c05c Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-5-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-6-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-6-snap.png new file mode 100644 index 0000000000..14683d910c Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-6-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-7-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-7-snap.png new file mode 100644 index 0000000000..ed56562952 Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-7-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-8-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-8-snap.png new file mode 100644 index 0000000000..e71687d62e Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-8-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-9-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-9-snap.png new file mode 100644 index 0000000000..88bfe504f5 Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-fluent-right-fluent-9-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-5-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-5-snap.png index 009e188f47..96ccbc55e6 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-5-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-5-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-6-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-6-snap.png index 96ccbc55e6..686719da6d 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-6-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-6-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-7-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-7-snap.png index 7587532c80..96ccbc55e6 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-7-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-7-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-8-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-8-snap.png index 6163bf67b6..3d9a218c5a 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-8-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-8-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-9-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-9-snap.png new file mode 100644 index 0000000000..a3be54756d Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-pre-chat-message-9-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-10-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-10-snap.png index 2500ad8e84..33b6d8eeb7 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-10-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-10-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-11-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-11-snap.png index 6b9fdbc524..d1049903a0 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-11-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-11-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-12-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-12-snap.png index 4a84cb7cf5..bcce7b3ccc 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-12-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-12-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-13-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-13-snap.png index 64967e67dc..be32e6ce19 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-13-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-13-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-14-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-14-snap.png index b23471b237..a68a78b014 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-14-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-14-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-15-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-15-snap.png index 91f012387d..d2286c712f 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-15-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-15-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-16-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-16-snap.png new file mode 100644 index 0000000000..982d9040b6 Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-16-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-17-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-17-snap.png new file mode 100644 index 0000000000..5abe34da5e Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-17-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-5-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-5-snap.png index 4da7a278d2..6058c63d4f 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-5-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-5-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-6-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-6-snap.png index dd06ba23b2..ab31a64467 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-6-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-6-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-7-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-7-snap.png index 68cf87f616..ce038d116e 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-7-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-7-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-8-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-8-snap.png index 16b14ffe82..e250dc9dc2 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-8-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-8-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-9-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-9-snap.png index 9d41c68ae9..e1d5e17350 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-9-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-dark-js-fluent-theme-applied-dark-theme-applied-side-by-side-left-transcript-right-transcript-9-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-1-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-1-snap.png new file mode 100644 index 0000000000..568cde0c64 Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-2-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-2-snap.png new file mode 100644 index 0000000000..b4bca5e70b Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-2-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-3-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-3-snap.png new file mode 100644 index 0000000000..b79b41fa49 Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-3-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-4-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-4-snap.png new file mode 100644 index 0000000000..2d63060b45 Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-4-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-5-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-5-snap.png new file mode 100644 index 0000000000..4951334f12 Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-5-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-6-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-6-snap.png new file mode 100644 index 0000000000..ceadb4a2e5 Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-6-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-7-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-7-snap.png new file mode 100644 index 0000000000..fd022fd213 Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-7-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-8-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-8-snap.png new file mode 100644 index 0000000000..9a9f7957e4 Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-8-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-9-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-9-snap.png new file mode 100644 index 0000000000..7f3207c45d Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-fluent-right-fluent-9-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-5-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-5-snap.png index 1dee3f62f4..20d8a267de 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-5-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-5-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-6-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-6-snap.png index e1597f18e7..483cac8352 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-6-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-6-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-7-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-7-snap.png index 3ab8c223b5..20d8a267de 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-7-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-7-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-8-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-8-snap.png index f933fd88c0..b1cdb3c7f7 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-8-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-8-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-9-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-9-snap.png new file mode 100644 index 0000000000..41e86b7118 Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-pre-chat-message-9-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-10-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-10-snap.png index 5d15963a95..728e085fc4 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-10-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-10-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-11-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-11-snap.png index ebb49c3734..7afd530773 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-11-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-11-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-12-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-12-snap.png index 4fee176f75..1c528c839b 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-12-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-12-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-13-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-13-snap.png index dbcdb799c8..5950142caf 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-13-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-13-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-14-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-14-snap.png index ac17fa94b6..4f6a0f853b 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-14-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-14-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-15-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-15-snap.png index 690b237ff7..c1bf92b54a 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-15-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-15-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-16-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-16-snap.png new file mode 100644 index 0000000000..8e94a78a59 Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-16-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-17-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-17-snap.png new file mode 100644 index 0000000000..75277202d7 Binary files /dev/null and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-17-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-5-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-5-snap.png index 866626da64..3bbd93a445 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-5-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-5-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-6-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-6-snap.png index ea4bfe4501..74cf5dc4be 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-6-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-6-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-7-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-7-snap.png index 88cf535cba..66e5bc5575 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-7-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-7-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-8-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-8-snap.png index 433a6250f3..6c9f74129e 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-8-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-8-snap.png differ diff --git a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-9-snap.png b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-9-snap.png index bd247ab669..71ec736490 100644 Binary files a/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-9-snap.png and b/__tests__/__image_snapshots__/html/side-by-side-wide-js-fluent-theme-applied-side-by-side-left-transcript-right-transcript-9-snap.png differ diff --git a/__tests__/html/fluentTheme/side-by-side.wide.dark.html b/__tests__/html/fluentTheme/side-by-side.wide.dark.html index 23cd757a44..6d0ce2af70 100644 --- a/__tests__/html/fluentTheme/side-by-side.wide.dark.html +++ b/__tests__/html/fluentTheme/side-by-side.wide.dark.html @@ -74,6 +74,7 @@ const timestamp = () => new Date(timestampStart += 100).toISOString(); const [leftTranscriptIndex = 0, rightTranscriptIndex = 1] = new URLSearchParams(location.search).getAll('transcript'); + const [leftVariant = 'fluent', rightVariant = 'copilot'] = new URLSearchParams(location.search).getAll('variant'); const sendBoxIndexes = new URLSearchParams(location.search).getAll('focus'); @@ -97,7 +98,6 @@ { timestamp: timestamp(), from: { role: 'bot' }, - entities: [aiMessageEntity], id: '1.0', text: `Great! Your copilot will maintain a polite, friendly, professional, and fun while assisting team members with onboarding tasks. Are there any topics or tasks this copilot shouldn’t help with or talk about?`, @@ -114,7 +114,6 @@ { timestamp: timestamp(), from: { role: 'bot' }, - entities: [aiMessageEntity], id: '2.0', text: 'Is there a website or datasource that has knowledge that will be necessary for Onboarding Buddy?', type: 'message' @@ -130,7 +129,6 @@ { timestamp: timestamp(), from: { role: 'bot' }, - entities: [aiMessageEntity], id: '3.0', text: `https://sharepoint.contoso.com/team/ has been added as a Knowledge source. You can preview your extension at any time.`, @@ -271,8 +269,9 @@ from: { role: 'bot' }, entities: [aiMessageEntity], id: "1.1", - text: "Welcome to the team! I'd be happy to assist you with your onboarding. Let's start with the essentials. Have you received your welcome package yet?", - type: "message" + text: "Welcome to the team! \n\n I'd be happy to assist you with your onboarding. Let's start with the essentials. Have you received your welcome package yet?", + type: "message", + textFormat: "plain" }, { timestamp: timestamp(), @@ -550,7 +549,7 @@ colorNeutralForeground5: '#424242' }}>
- +
- + { runHTML('fluentTheme/side-by-side.wide.dark?transcript=0&transcript=3')); test('side by side left - transcript, right - streaming', () => runHTML('fluentTheme/side-by-side.wide.dark?transcript=0&transcript=4')); + test('side by side left - fluent, right - fluent', () => + runHTML('fluentTheme/side-by-side.wide.dark?transcript=0&transcript=2&focus=1&variant=fluent&variant=fluent')); }); }); diff --git a/__tests__/html/fluentTheme/side-by-side.wide.html b/__tests__/html/fluentTheme/side-by-side.wide.html index 2ec0aa2f8f..4d7b6dc002 100644 --- a/__tests__/html/fluentTheme/side-by-side.wide.html +++ b/__tests__/html/fluentTheme/side-by-side.wide.html @@ -83,6 +83,7 @@ const timestamp = () => new Date(timestampStart += 100).toISOString(); const [leftTranscriptIndex = 0, rightTranscriptIndex = 1] = new URLSearchParams(location.search).getAll('transcript'); + const [leftVariant = 'fluent', rightVariant = 'copilot'] = new URLSearchParams(location.search).getAll('variant'); const sendBoxIndexes = new URLSearchParams(location.search).getAll('focus'); @@ -106,7 +107,6 @@ { timestamp: timestamp(), from: { role: 'bot' }, - entities: [aiMessageEntity], id: '1.0', text: `Great! Your copilot will maintain a polite, friendly, professional, and fun while assisting team members with onboarding tasks. Are there any topics or tasks this copilot shouldn’t help with or talk about?`, @@ -123,7 +123,6 @@ { timestamp: timestamp(), from: { role: 'bot' }, - entities: [aiMessageEntity], id: '2.0', text: 'Is there a website or datasource that has knowledge that will be necessary for Onboarding Buddy?', type: 'message' @@ -139,7 +138,6 @@ { timestamp: timestamp(), from: { role: 'bot' }, - entities: [aiMessageEntity], id: '3.0', text: `https://sharepoint.contoso.com/team/ has been added as a Knowledge source. You can preview your extension at any time.`, @@ -165,7 +163,6 @@ { timestamp: timestamp(), from: { role: 'bot' }, - entities: [aiMessageEntity], suggestedActions: { actions: [ { @@ -281,8 +278,9 @@ from: { role: 'bot' }, entities: [aiMessageEntity], id: "1.1", - text: "Welcome to the team! I'd be happy to assist you with your onboarding. Let's start with the essentials. Have you received your welcome package yet?", - type: "message" + text: "Welcome to the team! \n\n I'd be happy to assist you with your onboarding. Let's start with the essentials. Have you received your welcome package yet?", + type: "message", + textFormat: "plain" }, { timestamp: timestamp(), @@ -532,7 +530,7 @@ const App = () => <>
- +
- + { runHTML('fluentTheme/side-by-side.wide?transcript=0&transcript=3')); test('side by side left - transcript, right - streaming', () => runHTML('fluentTheme/side-by-side.wide?transcript=0&transcript=4')); + test('side by side left - fluent, right - fluent', () => + runHTML('fluentTheme/side-by-side.wide?transcript=0&transcript=2&focus=1&variant=fluent&variant=fluent')); }); diff --git a/packages/component/src/Attachment/Text/TextContent.tsx b/packages/component/src/Attachment/Text/TextContent.tsx index 183987f921..792ffd58fb 100644 --- a/packages/component/src/Attachment/Text/TextContent.tsx +++ b/packages/component/src/Attachment/Text/TextContent.tsx @@ -1,10 +1,16 @@ -import React, { type FC, memo } from 'react'; +import React, { memo, useMemo } from 'react'; +import classNames from 'classnames'; +import { hooks } from 'botframework-webchat-api'; +import { type WebChatActivity } from 'botframework-webchat-core'; +import isAIGeneratedActivity from './private/isAIGeneratedActivity'; import MarkdownTextContent from './private/MarkdownTextContent'; import PlainTextContent from './private/PlainTextContent'; +import CustomPropertyNames from '../../Styles/CustomPropertyNames'; +import useStyleToEmotionObject from '../../hooks/internal/useStyleToEmotionObject'; import useRenderMarkdownAsHTML from '../../hooks/useRenderMarkdownAsHTML'; -import { type WebChatActivity } from 'botframework-webchat-core'; +const { useLocalizer } = hooks; type Props = Readonly<{ activity: WebChatActivity; @@ -12,19 +18,39 @@ type Props = Readonly<{ text: string; }>; -const TextContent: FC = memo(({ activity, contentType = 'text/plain', text }: Props) => { +const generatedBadgeStyle = { + '&.webchat__text-content__generated-badge': { + color: `var(${CustomPropertyNames.ColorSubtle})`, + fontSize: `var(${CustomPropertyNames.FontSizeSmall})` + } +}; + +const TextContent = memo(({ activity, contentType = 'text/plain', text }: Props) => { const supportMarkdown = !!useRenderMarkdownAsHTML('message activity'); + const localize = useLocalizer(); + const generatedBadgeClassName = useStyleToEmotionObject()(generatedBadgeStyle) + ''; + + const generatedBadge = useMemo( + () => + isAIGeneratedActivity(activity) && ( +
+ {localize('ACTIVITY_CONTENT_CAUTION')} +
+ ), + [activity, generatedBadgeClassName, localize] + ); return text ? ( contentType === 'text/markdown' && supportMarkdown ? ( - + + {generatedBadge} + ) : ( - + {generatedBadge} ) ) : null; }); -TextContent.defaultProps = { contentType: 'text/plain' }; TextContent.displayName = 'TextContent'; export default TextContent; diff --git a/packages/component/src/Attachment/Text/private/MarkdownTextContent.tsx b/packages/component/src/Attachment/Text/private/MarkdownTextContent.tsx index 1e73429684..c3b702cd44 100644 --- a/packages/component/src/Attachment/Text/private/MarkdownTextContent.tsx +++ b/packages/component/src/Attachment/Text/private/MarkdownTextContent.tsx @@ -9,7 +9,7 @@ import { import classNames from 'classnames'; import type { Definition } from 'mdast'; import { fromMarkdown } from 'mdast-util-from-markdown'; -import React, { memo, useCallback, useMemo, type MouseEventHandler } from 'react'; +import React, { memo, useCallback, useMemo, type MouseEventHandler, type ReactNode } from 'react'; import { useRefFrom } from 'use-ref-from'; import { LinkDefinitionItem, LinkDefinitions } from '../../../LinkDefinition/index'; @@ -35,6 +35,7 @@ type Entry = { type Props = Readonly<{ activity: WebChatActivity; + children?: ReactNode | undefined; markdown: string; }>; @@ -42,7 +43,7 @@ function isCitationURL(url: string): boolean { return onErrorResumeNext(() => new URL(url))?.protocol === 'cite:'; } -const MarkdownTextContent = memo(({ activity, markdown }: Props) => { +const MarkdownTextContent = memo(({ activity, children, markdown }: Props) => { const [ { citationModalDialog: citationModalDialogStyleSet, @@ -212,6 +213,7 @@ const MarkdownTextContent = memo(({ activity, markdown }: Props) => { dangerouslySetInnerHTML={dangerouslySetInnerHTML} onClick={handleClick} /> + {children} {!!entries.length && ( accessoryComponentType={messageSensitivityLabelProps && MessageSensitivityLabel} diff --git a/packages/component/src/Attachment/Text/private/PlainTextContent.tsx b/packages/component/src/Attachment/Text/private/PlainTextContent.tsx index feb2790083..e7e674cce7 100644 --- a/packages/component/src/Attachment/Text/private/PlainTextContent.tsx +++ b/packages/component/src/Attachment/Text/private/PlainTextContent.tsx @@ -1,11 +1,11 @@ import classNames from 'classnames'; -import React, { type FC, Fragment, memo } from 'react'; +import React, { Fragment, memo, type ReactNode } from 'react'; import useStyleSet from '../../../hooks/useStyleSet'; -type Props = Readonly<{ text: string }>; +type Props = Readonly<{ children?: ReactNode | undefined; text: string }>; -const PlainTextContent: FC = memo(({ text }: Props) => { +const PlainTextContent = memo(({ children, text }: Props) => { const [{ textContent: textContentStyleSet }] = useStyleSet(); return ( @@ -18,6 +18,13 @@ const PlainTextContent: FC = memo(({ text }: Props) => { {line.trim()}

))} + {children && ( +
+ {children} +
+ )} ); }); diff --git a/packages/component/src/Attachment/Text/private/isAIGeneratedActivity.ts b/packages/component/src/Attachment/Text/private/isAIGeneratedActivity.ts new file mode 100644 index 0000000000..5a43c99ec4 --- /dev/null +++ b/packages/component/src/Attachment/Text/private/isAIGeneratedActivity.ts @@ -0,0 +1,5 @@ +import { getOrgSchemaMessage, type WebChatActivity } from 'botframework-webchat-core'; + +export default function isAIGeneratedActivity(activity: undefined | WebChatActivity) { + return !!(activity && getOrgSchemaMessage(activity?.entities || [])?.keywords?.includes('AIGeneratedContent')); +} diff --git a/packages/fluent-theme/src/components/activity/ActivityDecorator.module.css b/packages/fluent-theme/src/components/activity/ActivityDecorator.module.css index 8c7ad441d9..75e3a9c5e5 100644 --- a/packages/fluent-theme/src/components/activity/ActivityDecorator.module.css +++ b/packages/fluent-theme/src/components/activity/ActivityDecorator.module.css @@ -42,6 +42,11 @@ &:has(:global(.webchat__bubble--from-user)) :global(.webchat__bubble) { margin-block-end: var(--webchat-spacingVerticalM); } + + /* Hide generated badge as it is in the copilot header */ + :global(.webchat__bubble .webchat__text-content .webchat__text-content__generated-badge) { + display: none; + } } /* Decorator copilot variant which has bot message */ @@ -147,6 +152,30 @@ min-height: auto; padding-block: var(--webchat__bubble--block-padding); padding-inline: var(--webchat__bubble--inline-padding); + + &:empty { + padding-block-end: 0; + } + + +:global(.webchat__text-content) { + margin-top: calc(var(--webchat__bubble--block-padding) * -1); + } +} + +/* Message bubble text content generated badge */ +:global(.webchat-fluent) .activity-decorator :global(.webchat__stacked-layout .webchat__bubble .webchat__text-content__generated-badge) { + align-items: center; + align-self: flex-start; + background-color: var(--webchat-colorNeutralBackground5); + border-radius: var(--webchat-borderRadiusMedium); + box-sizing: border-box; + color: var(--webchat-colorNeutralForeground3); + cursor: default; + display: inline-flex; + font-size: var(--webchat-fontSizeBase100); + height: 16px; + line-height: var(--webchat-lineHeightBase100); + padding-inline: var(--webchat-spacingHorizontalXS); } /* Message bubble attachment content */