diff --git a/CHANGELOG.md b/CHANGELOG.md index c34aabfa68..f920c41957 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -299,6 +299,7 @@ Notes: web developers are advised to use [`~` (tilde range)](https://github.com/ - Updated file-based import with `.js` extension and removed the file extension from build config, by [@compulim](https://github.com/compulim), in PR [#5516](https://github.com/microsoft/BotFramework-WebChat/pull/5516) - Fixed [#5518](https://github.com/microsoft/BotFramework-WebChat/issues/5518). Minimal bundled build should work properly, in PR [#5507](https://github.com/microsoft/BotFramework-WebChat/pull/5507), by [@compulim](https://github.com/compulim) - Fixed [#5520](https://github.com/microsoft/BotFramework-WebChat/issues/5520). Version information should be injected when installed via npm, in PR [#5521](https://github.com/microsoft/BotFramework-WebChat/pull/5521), by [@compulim](https://github.com/compulim) +- Fixed placing focus on the code block content, so it is possible to scroll code via keyboard, in PR [#5575](https://github.com/microsoft/BotFramework-WebChat/pull/5575), by [@OEvgeny](https://github.com/OEvgeny) ### Removed diff --git a/__tests__/__image_snapshots__/html/default-adaptive-cards-js-markdown-render-html-when-unset-should-render-sanitized-html-in-adaptive-cards-1-snap.png b/__tests__/__image_snapshots__/html/default-adaptive-cards-js-markdown-render-html-when-unset-should-render-sanitized-html-in-adaptive-cards-1-snap.png index d6b384b57f..8f7580cd9a 100644 Binary files a/__tests__/__image_snapshots__/html/default-adaptive-cards-js-markdown-render-html-when-unset-should-render-sanitized-html-in-adaptive-cards-1-snap.png and b/__tests__/__image_snapshots__/html/default-adaptive-cards-js-markdown-render-html-when-unset-should-render-sanitized-html-in-adaptive-cards-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/default-message-activity-js-markdown-render-html-when-unset-should-render-sanitized-html-in-message-activity-1-snap.png b/__tests__/__image_snapshots__/html/default-message-activity-js-markdown-render-html-when-unset-should-render-sanitized-html-in-message-activity-1-snap.png index 04d15e4851..dd395c38ac 100644 Binary files a/__tests__/__image_snapshots__/html/default-message-activity-js-markdown-render-html-when-unset-should-render-sanitized-html-in-message-activity-1-snap.png and b/__tests__/__image_snapshots__/html/default-message-activity-js-markdown-render-html-when-unset-should-render-sanitized-html-in-message-activity-1-snap.png differ diff --git a/__tests__/html2/activity/collapsible.copilot.dark.html.snap-4.png b/__tests__/html2/activity/collapsible.copilot.dark.html.snap-4.png index 3f1fed0ab4..912a46ee4c 100644 Binary files a/__tests__/html2/activity/collapsible.copilot.dark.html.snap-4.png and b/__tests__/html2/activity/collapsible.copilot.dark.html.snap-4.png differ diff --git a/__tests__/html2/activity/collapsible.copilot.dark.html.snap-5.png b/__tests__/html2/activity/collapsible.copilot.dark.html.snap-5.png index 5684ddc62f..4ebcd9d163 100644 Binary files a/__tests__/html2/activity/collapsible.copilot.dark.html.snap-5.png and b/__tests__/html2/activity/collapsible.copilot.dark.html.snap-5.png differ diff --git a/__tests__/html2/activity/collapsible.copilot.dark.html.snap-6.png b/__tests__/html2/activity/collapsible.copilot.dark.html.snap-6.png index 984e38de14..bb801cef79 100644 Binary files a/__tests__/html2/activity/collapsible.copilot.dark.html.snap-6.png and b/__tests__/html2/activity/collapsible.copilot.dark.html.snap-6.png differ diff --git a/__tests__/html2/activity/collapsible.copilot.dark.html.snap-7.png b/__tests__/html2/activity/collapsible.copilot.dark.html.snap-7.png index 7590c2cfeb..dc1faed9f3 100644 Binary files a/__tests__/html2/activity/collapsible.copilot.dark.html.snap-7.png and b/__tests__/html2/activity/collapsible.copilot.dark.html.snap-7.png differ diff --git a/__tests__/html2/activity/collapsible.copilot.dark.html.snap-8.png b/__tests__/html2/activity/collapsible.copilot.dark.html.snap-8.png index 539efdf876..1c7027d657 100644 Binary files a/__tests__/html2/activity/collapsible.copilot.dark.html.snap-8.png and b/__tests__/html2/activity/collapsible.copilot.dark.html.snap-8.png differ diff --git a/__tests__/html2/activity/collapsible.copilot.html.snap-4.png b/__tests__/html2/activity/collapsible.copilot.html.snap-4.png index f6fb85a366..5baa45e5d6 100644 Binary files a/__tests__/html2/activity/collapsible.copilot.html.snap-4.png and b/__tests__/html2/activity/collapsible.copilot.html.snap-4.png differ diff --git a/__tests__/html2/activity/collapsible.copilot.html.snap-5.png b/__tests__/html2/activity/collapsible.copilot.html.snap-5.png index d226aad8e5..01b271beb2 100644 Binary files a/__tests__/html2/activity/collapsible.copilot.html.snap-5.png and b/__tests__/html2/activity/collapsible.copilot.html.snap-5.png differ diff --git a/__tests__/html2/activity/collapsible.copilot.html.snap-6.png b/__tests__/html2/activity/collapsible.copilot.html.snap-6.png index ed9cd6444a..c88e1abb70 100644 Binary files a/__tests__/html2/activity/collapsible.copilot.html.snap-6.png and b/__tests__/html2/activity/collapsible.copilot.html.snap-6.png differ diff --git a/__tests__/html2/activity/collapsible.copilot.html.snap-7.png b/__tests__/html2/activity/collapsible.copilot.html.snap-7.png index 9f55894785..3e8ee3b8c5 100644 Binary files a/__tests__/html2/activity/collapsible.copilot.html.snap-7.png and b/__tests__/html2/activity/collapsible.copilot.html.snap-7.png differ diff --git a/__tests__/html2/activity/collapsible.copilot.html.snap-8.png b/__tests__/html2/activity/collapsible.copilot.html.snap-8.png index 0781f6df80..1537d20baf 100644 Binary files a/__tests__/html2/activity/collapsible.copilot.html.snap-8.png and b/__tests__/html2/activity/collapsible.copilot.html.snap-8.png differ diff --git a/__tests__/html2/activity/collapsible.fluent.dark.html.snap-4.png b/__tests__/html2/activity/collapsible.fluent.dark.html.snap-4.png index 900112b8d1..d49471f2ba 100644 Binary files a/__tests__/html2/activity/collapsible.fluent.dark.html.snap-4.png and b/__tests__/html2/activity/collapsible.fluent.dark.html.snap-4.png differ diff --git a/__tests__/html2/activity/collapsible.fluent.dark.html.snap-5.png b/__tests__/html2/activity/collapsible.fluent.dark.html.snap-5.png index 757d823b9d..8da8c331b5 100644 Binary files a/__tests__/html2/activity/collapsible.fluent.dark.html.snap-5.png and b/__tests__/html2/activity/collapsible.fluent.dark.html.snap-5.png differ diff --git a/__tests__/html2/activity/collapsible.fluent.dark.html.snap-6.png b/__tests__/html2/activity/collapsible.fluent.dark.html.snap-6.png index dff4fcfc9b..62722e1377 100644 Binary files a/__tests__/html2/activity/collapsible.fluent.dark.html.snap-6.png and b/__tests__/html2/activity/collapsible.fluent.dark.html.snap-6.png differ diff --git a/__tests__/html2/activity/collapsible.fluent.dark.html.snap-7.png b/__tests__/html2/activity/collapsible.fluent.dark.html.snap-7.png index ebf4e95ca1..f7797243a8 100644 Binary files a/__tests__/html2/activity/collapsible.fluent.dark.html.snap-7.png and b/__tests__/html2/activity/collapsible.fluent.dark.html.snap-7.png differ diff --git a/__tests__/html2/activity/collapsible.fluent.dark.html.snap-8.png b/__tests__/html2/activity/collapsible.fluent.dark.html.snap-8.png index f711dd1f88..eb6ed11d47 100644 Binary files a/__tests__/html2/activity/collapsible.fluent.dark.html.snap-8.png and b/__tests__/html2/activity/collapsible.fluent.dark.html.snap-8.png differ diff --git a/__tests__/html2/activity/collapsible.fluent.html.snap-4.png b/__tests__/html2/activity/collapsible.fluent.html.snap-4.png index 864aa5e9b1..70fdc11b03 100644 Binary files a/__tests__/html2/activity/collapsible.fluent.html.snap-4.png and b/__tests__/html2/activity/collapsible.fluent.html.snap-4.png differ diff --git a/__tests__/html2/activity/collapsible.fluent.html.snap-5.png b/__tests__/html2/activity/collapsible.fluent.html.snap-5.png index d5cc4809cc..70b8eb15ac 100644 Binary files a/__tests__/html2/activity/collapsible.fluent.html.snap-5.png and b/__tests__/html2/activity/collapsible.fluent.html.snap-5.png differ diff --git a/__tests__/html2/activity/collapsible.fluent.html.snap-6.png b/__tests__/html2/activity/collapsible.fluent.html.snap-6.png index e576f463d1..167db55f86 100644 Binary files a/__tests__/html2/activity/collapsible.fluent.html.snap-6.png and b/__tests__/html2/activity/collapsible.fluent.html.snap-6.png differ diff --git a/__tests__/html2/activity/collapsible.fluent.html.snap-7.png b/__tests__/html2/activity/collapsible.fluent.html.snap-7.png index eba3c34ad0..f3bcdacf0a 100644 Binary files a/__tests__/html2/activity/collapsible.fluent.html.snap-7.png and b/__tests__/html2/activity/collapsible.fluent.html.snap-7.png differ diff --git a/__tests__/html2/activity/collapsible.fluent.html.snap-8.png b/__tests__/html2/activity/collapsible.fluent.html.snap-8.png index 9866f1da20..ca4e7cad67 100644 Binary files a/__tests__/html2/activity/collapsible.fluent.html.snap-8.png and b/__tests__/html2/activity/collapsible.fluent.html.snap-8.png differ diff --git a/__tests__/html2/activity/viewCodeButton.scroll.html b/__tests__/html2/activity/viewCodeButton.scroll.html new file mode 100644 index 0000000000..8ee6e6e9e8 --- /dev/null +++ b/__tests__/html2/activity/viewCodeButton.scroll.html @@ -0,0 +1,148 @@ + + +
+ + + + + + + + + + + + + diff --git a/__tests__/html2/activity/viewCodeButton.scroll.html.snap-1.png b/__tests__/html2/activity/viewCodeButton.scroll.html.snap-1.png new file mode 100644 index 0000000000..cfb5065679 Binary files /dev/null and b/__tests__/html2/activity/viewCodeButton.scroll.html.snap-1.png differ diff --git a/__tests__/html2/activity/viewCodeButton.scroll.html.snap-2.png b/__tests__/html2/activity/viewCodeButton.scroll.html.snap-2.png new file mode 100644 index 0000000000..f99463bcac Binary files /dev/null and b/__tests__/html2/activity/viewCodeButton.scroll.html.snap-2.png differ diff --git a/__tests__/html2/activity/viewCodeButton.scroll.html.snap-3.png b/__tests__/html2/activity/viewCodeButton.scroll.html.snap-3.png new file mode 100644 index 0000000000..6334d2c5a5 Binary files /dev/null and b/__tests__/html2/activity/viewCodeButton.scroll.html.snap-3.png differ diff --git a/__tests__/html2/markdown/codeBlockCopyButton/adaptiveCards/behavior.html.snap-1.png b/__tests__/html2/markdown/codeBlockCopyButton/adaptiveCards/behavior.html.snap-1.png index 2e96fa533f..fe060cc77d 100644 Binary files a/__tests__/html2/markdown/codeBlockCopyButton/adaptiveCards/behavior.html.snap-1.png and b/__tests__/html2/markdown/codeBlockCopyButton/adaptiveCards/behavior.html.snap-1.png differ diff --git a/__tests__/html2/markdown/codeBlockCopyButton/adaptiveCards/behavior.html.snap-2.png b/__tests__/html2/markdown/codeBlockCopyButton/adaptiveCards/behavior.html.snap-2.png index cce0c5693d..f4471563c8 100644 Binary files a/__tests__/html2/markdown/codeBlockCopyButton/adaptiveCards/behavior.html.snap-2.png and b/__tests__/html2/markdown/codeBlockCopyButton/adaptiveCards/behavior.html.snap-2.png differ diff --git a/__tests__/html2/markdown/codeBlockCopyButton/adaptiveCards/behavior.html.snap-3.png b/__tests__/html2/markdown/codeBlockCopyButton/adaptiveCards/behavior.html.snap-3.png index 59c8545cd2..2e355fc577 100644 Binary files a/__tests__/html2/markdown/codeBlockCopyButton/adaptiveCards/behavior.html.snap-3.png and b/__tests__/html2/markdown/codeBlockCopyButton/adaptiveCards/behavior.html.snap-3.png differ diff --git a/__tests__/html2/markdown/codeBlockCopyButton/adaptiveCards/layout.html.snap-1.png b/__tests__/html2/markdown/codeBlockCopyButton/adaptiveCards/layout.html.snap-1.png index 12df84876f..234311c24a 100644 Binary files a/__tests__/html2/markdown/codeBlockCopyButton/adaptiveCards/layout.html.snap-1.png and b/__tests__/html2/markdown/codeBlockCopyButton/adaptiveCards/layout.html.snap-1.png differ diff --git a/__tests__/html2/markdown/codeBlockCopyButton/fluent/layout.html.snap-1.png b/__tests__/html2/markdown/codeBlockCopyButton/fluent/layout.html.snap-1.png index 17cdddaeb1..122065c160 100644 Binary files a/__tests__/html2/markdown/codeBlockCopyButton/fluent/layout.html.snap-1.png and b/__tests__/html2/markdown/codeBlockCopyButton/fluent/layout.html.snap-1.png differ diff --git a/__tests__/html2/part-grouping/copilot.dark.html.snap-10.png b/__tests__/html2/part-grouping/copilot.dark.html.snap-10.png index 51b23ba045..99758ef55a 100644 Binary files a/__tests__/html2/part-grouping/copilot.dark.html.snap-10.png and b/__tests__/html2/part-grouping/copilot.dark.html.snap-10.png differ diff --git a/__tests__/html2/part-grouping/copilot.dark.html.snap-8.png b/__tests__/html2/part-grouping/copilot.dark.html.snap-8.png index 137f248704..f2434537a2 100644 Binary files a/__tests__/html2/part-grouping/copilot.dark.html.snap-8.png and b/__tests__/html2/part-grouping/copilot.dark.html.snap-8.png differ diff --git a/__tests__/html2/part-grouping/copilot.dark.html.snap-9.png b/__tests__/html2/part-grouping/copilot.dark.html.snap-9.png index 673377e70f..8167506166 100644 Binary files a/__tests__/html2/part-grouping/copilot.dark.html.snap-9.png and b/__tests__/html2/part-grouping/copilot.dark.html.snap-9.png differ diff --git a/__tests__/html2/part-grouping/copilot.html.snap-10.png b/__tests__/html2/part-grouping/copilot.html.snap-10.png index 6e8d8c9c15..8a170ac928 100644 Binary files a/__tests__/html2/part-grouping/copilot.html.snap-10.png and b/__tests__/html2/part-grouping/copilot.html.snap-10.png differ diff --git a/__tests__/html2/part-grouping/copilot.html.snap-8.png b/__tests__/html2/part-grouping/copilot.html.snap-8.png index fbbbf18026..96bf5a7be0 100644 Binary files a/__tests__/html2/part-grouping/copilot.html.snap-8.png and b/__tests__/html2/part-grouping/copilot.html.snap-8.png differ diff --git a/__tests__/html2/part-grouping/copilot.html.snap-9.png b/__tests__/html2/part-grouping/copilot.html.snap-9.png index 6d6f865ba1..f64fee0f22 100644 Binary files a/__tests__/html2/part-grouping/copilot.html.snap-9.png and b/__tests__/html2/part-grouping/copilot.html.snap-9.png differ diff --git a/__tests__/html2/part-grouping/fluent.dark.html.snap-10.png b/__tests__/html2/part-grouping/fluent.dark.html.snap-10.png index a4f291274f..ef0ff6e4b0 100644 Binary files a/__tests__/html2/part-grouping/fluent.dark.html.snap-10.png and b/__tests__/html2/part-grouping/fluent.dark.html.snap-10.png differ diff --git a/__tests__/html2/part-grouping/fluent.dark.html.snap-8.png b/__tests__/html2/part-grouping/fluent.dark.html.snap-8.png index 6e45fc8b6d..bc29d48361 100644 Binary files a/__tests__/html2/part-grouping/fluent.dark.html.snap-8.png and b/__tests__/html2/part-grouping/fluent.dark.html.snap-8.png differ diff --git a/__tests__/html2/part-grouping/fluent.dark.html.snap-9.png b/__tests__/html2/part-grouping/fluent.dark.html.snap-9.png index d430a74fa5..af63cf6b16 100644 Binary files a/__tests__/html2/part-grouping/fluent.dark.html.snap-9.png and b/__tests__/html2/part-grouping/fluent.dark.html.snap-9.png differ diff --git a/__tests__/html2/part-grouping/fluent.html.snap-10.png b/__tests__/html2/part-grouping/fluent.html.snap-10.png index eeb8ed5acd..0e2e2f2556 100644 Binary files a/__tests__/html2/part-grouping/fluent.html.snap-10.png and b/__tests__/html2/part-grouping/fluent.html.snap-10.png differ diff --git a/__tests__/html2/part-grouping/fluent.html.snap-8.png b/__tests__/html2/part-grouping/fluent.html.snap-8.png index 4f38605605..4ac18f28be 100644 Binary files a/__tests__/html2/part-grouping/fluent.html.snap-8.png and b/__tests__/html2/part-grouping/fluent.html.snap-8.png differ diff --git a/__tests__/html2/part-grouping/fluent.html.snap-9.png b/__tests__/html2/part-grouping/fluent.html.snap-9.png index 01cea55105..b41604d559 100644 Binary files a/__tests__/html2/part-grouping/fluent.html.snap-9.png and b/__tests__/html2/part-grouping/fluent.html.snap-9.png differ diff --git a/packages/component/src/Activity/CodeBlockContent.module.css b/packages/component/src/Activity/CodeBlockContent.module.css index 0bffc60124..eb3da714c3 100644 --- a/packages/component/src/Activity/CodeBlockContent.module.css +++ b/packages/component/src/Activity/CodeBlockContent.module.css @@ -29,7 +29,7 @@ } } -:global(.webchat) .code-block-content__code-block { +:global(.webchat) .code-block-content .code-block-content__code-block { border: none; margin: 0; max-height: 360px; diff --git a/packages/component/src/Attachment/Text/private/ActivityViewCodeButton.tsx b/packages/component/src/Attachment/Text/private/ActivityViewCodeButton.tsx index 9468a266b0..7395db4154 100644 --- a/packages/component/src/Attachment/Text/private/ActivityViewCodeButton.tsx +++ b/packages/component/src/Attachment/Text/private/ActivityViewCodeButton.tsx @@ -1,6 +1,7 @@ import { validateProps } from '@msinternal/botframework-webchat-react-valibot'; +import { useStyles } from '@msinternal/botframework-webchat-styles/react'; import { hooks } from 'botframework-webchat-api'; -import classNames from 'classnames'; +import cx from 'classnames'; import React, { memo, useCallback } from 'react'; import { boolean, object, optional, pipe, readonly, string, type InferInput } from 'valibot'; @@ -10,6 +11,8 @@ import LocalizedString from '../../../Utils/LocalizedString'; import ActivityButton from './ActivityButton'; import CodeContent from './CodeContent'; +import styles from './ViewCodeDialog.module.css'; + const { useLocalizer } = hooks; const activityViewCodeButtonPropsSchema = pipe( @@ -27,8 +30,9 @@ type ActivityViewCodeButtonProps = InferInput{code}