diff --git a/__tests__/__image_snapshots__/chrome-docker/adaptive-cards-js-inputs-card-with-custom-style-options-and-submit-action-1-snap.png b/__tests__/__image_snapshots__/chrome-docker/adaptive-cards-js-inputs-card-with-custom-style-options-and-submit-action-1-snap.png index f4b516755f..8f316175b6 100644 Binary files a/__tests__/__image_snapshots__/chrome-docker/adaptive-cards-js-inputs-card-with-custom-style-options-and-submit-action-1-snap.png and b/__tests__/__image_snapshots__/chrome-docker/adaptive-cards-js-inputs-card-with-custom-style-options-and-submit-action-1-snap.png differ diff --git a/__tests__/__image_snapshots__/chrome-docker/suggested-actions-js-should-show-response-from-bot-and-no-text-from-user-on-messageback-1-snap.png b/__tests__/__image_snapshots__/chrome-docker/suggested-actions-js-should-show-response-from-bot-and-no-text-from-user-on-messageback-1-snap.png index 4eb9803f50..ce9f4bbbdb 100644 Binary files a/__tests__/__image_snapshots__/chrome-docker/suggested-actions-js-should-show-response-from-bot-and-no-text-from-user-on-messageback-1-snap.png and b/__tests__/__image_snapshots__/chrome-docker/suggested-actions-js-should-show-response-from-bot-and-no-text-from-user-on-messageback-1-snap.png differ diff --git a/__tests__/__image_snapshots__/chrome-docker/suggested-actions-js-should-show-response-from-bot-and-text-from-user-on-messageback-1-snap.png b/__tests__/__image_snapshots__/chrome-docker/suggested-actions-js-should-show-response-from-bot-and-text-from-user-on-messageback-1-snap.png index 4eb9803f50..ce9f4bbbdb 100644 Binary files a/__tests__/__image_snapshots__/chrome-docker/suggested-actions-js-should-show-response-from-bot-and-text-from-user-on-messageback-1-snap.png and b/__tests__/__image_snapshots__/chrome-docker/suggested-actions-js-should-show-response-from-bot-and-text-from-user-on-messageback-1-snap.png differ diff --git a/__tests__/__image_snapshots__/chrome-docker/suggested-actions-js-should-show-response-from-bot-and-text-from-user-on-postback-1-snap.png b/__tests__/__image_snapshots__/chrome-docker/suggested-actions-js-should-show-response-from-bot-and-text-from-user-on-postback-1-snap.png index c896054011..4791756dfe 100644 Binary files a/__tests__/__image_snapshots__/chrome-docker/suggested-actions-js-should-show-response-from-bot-and-text-from-user-on-postback-1-snap.png and b/__tests__/__image_snapshots__/chrome-docker/suggested-actions-js-should-show-response-from-bot-and-text-from-user-on-postback-1-snap.png differ diff --git a/__tests__/__image_snapshots__/chrome-docker/use-send-message-back-js-calling-send-message-back-should-send-a-message-back-activity-1-snap.png b/__tests__/__image_snapshots__/chrome-docker/use-send-message-back-js-calling-send-message-back-should-send-a-message-back-activity-1-snap.png index baf6c94d9d..7f329710e2 100644 Binary files a/__tests__/__image_snapshots__/chrome-docker/use-send-message-back-js-calling-send-message-back-should-send-a-message-back-activity-1-snap.png and b/__tests__/__image_snapshots__/chrome-docker/use-send-message-back-js-calling-send-message-back-should-send-a-message-back-activity-1-snap.png differ diff --git a/__tests__/__image_snapshots__/chrome-docker/use-send-post-back-js-calling-send-post-back-should-send-a-post-back-activity-1-snap.png b/__tests__/__image_snapshots__/chrome-docker/use-send-post-back-js-calling-send-post-back-should-send-a-post-back-activity-1-snap.png index fd5dbae7d2..d4beeaff42 100644 Binary files a/__tests__/__image_snapshots__/chrome-docker/use-send-post-back-js-calling-send-post-back-should-send-a-post-back-activity-1-snap.png and b/__tests__/__image_snapshots__/chrome-docker/use-send-post-back-js-calling-send-post-back-should-send-a-post-back-activity-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/accessibility-adaptive-card-disabled-inputs-js-accessibility-requirement-disabling-adaptive-card-with-inputs-field-3-snap.png b/__tests__/__image_snapshots__/html/accessibility-adaptive-card-disabled-inputs-js-accessibility-requirement-disabling-adaptive-card-with-inputs-field-3-snap.png index cd8c995540..bc41a8e020 100644 Binary files a/__tests__/__image_snapshots__/html/accessibility-adaptive-card-disabled-inputs-js-accessibility-requirement-disabling-adaptive-card-with-inputs-field-3-snap.png and b/__tests__/__image_snapshots__/html/accessibility-adaptive-card-disabled-inputs-js-accessibility-requirement-disabling-adaptive-card-with-inputs-field-3-snap.png differ diff --git a/__tests__/__image_snapshots__/html/auto-scroll-with-suggested-actions-submit-adaptive-cards-js-auto-scroll-with-suggested-actions-shown-should-stick-to-bottom-if-submitting-an-adaptive-card-1-snap.png b/__tests__/__image_snapshots__/html/auto-scroll-with-suggested-actions-submit-adaptive-cards-js-auto-scroll-with-suggested-actions-shown-should-stick-to-bottom-if-submitting-an-adaptive-card-1-snap.png index b4750133b3..b5c98da8b4 100644 Binary files a/__tests__/__image_snapshots__/html/auto-scroll-with-suggested-actions-submit-adaptive-cards-js-auto-scroll-with-suggested-actions-shown-should-stick-to-bottom-if-submitting-an-adaptive-card-1-snap.png and b/__tests__/__image_snapshots__/html/auto-scroll-with-suggested-actions-submit-adaptive-cards-js-auto-scroll-with-suggested-actions-shown-should-stick-to-bottom-if-submitting-an-adaptive-card-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/conversation-start-properties-no-locale-is-sent-js-conversation-start-properties-with-no-locale-is-sent-should-get-hello-and-welcome-message-1-snap.png b/__tests__/__image_snapshots__/html/conversation-start-properties-no-locale-is-sent-js-conversation-start-properties-with-no-locale-is-sent-should-get-hello-and-welcome-message-1-snap.png index 08fab39653..7fa10b9ecc 100644 Binary files a/__tests__/__image_snapshots__/html/conversation-start-properties-no-locale-is-sent-js-conversation-start-properties-with-no-locale-is-sent-should-get-hello-and-welcome-message-1-snap.png and b/__tests__/__image_snapshots__/html/conversation-start-properties-no-locale-is-sent-js-conversation-start-properties-with-no-locale-is-sent-should-get-hello-and-welcome-message-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/conversation-start-properties-send-en-us-js-conversation-start-properties-with-locale-of-en-us-should-get-hello-and-welcome-message-1-snap.png b/__tests__/__image_snapshots__/html/conversation-start-properties-send-en-us-js-conversation-start-properties-with-locale-of-en-us-should-get-hello-and-welcome-message-1-snap.png index c5db3d8a7b..49bf8d439d 100644 Binary files a/__tests__/__image_snapshots__/html/conversation-start-properties-send-en-us-js-conversation-start-properties-with-locale-of-en-us-should-get-hello-and-welcome-message-1-snap.png and b/__tests__/__image_snapshots__/html/conversation-start-properties-send-en-us-js-conversation-start-properties-with-locale-of-en-us-should-get-hello-and-welcome-message-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/conversation-start-properties-send-invalid-type-js-conversation-start-properties-with-locale-of-invalid-type-should-get-hello-and-welcome-message-1-snap.png b/__tests__/__image_snapshots__/html/conversation-start-properties-send-invalid-type-js-conversation-start-properties-with-locale-of-invalid-type-should-get-hello-and-welcome-message-1-snap.png index 08fab39653..3946b7fa4c 100644 Binary files a/__tests__/__image_snapshots__/html/conversation-start-properties-send-invalid-type-js-conversation-start-properties-with-locale-of-invalid-type-should-get-hello-and-welcome-message-1-snap.png and b/__tests__/__image_snapshots__/html/conversation-start-properties-send-invalid-type-js-conversation-start-properties-with-locale-of-invalid-type-should-get-hello-and-welcome-message-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/conversation-start-properties-send-non-existing-js-conversation-start-properties-with-non-existing-locale-should-get-hello-and-welcome-message-1-snap.png b/__tests__/__image_snapshots__/html/conversation-start-properties-send-non-existing-js-conversation-start-properties-with-non-existing-locale-should-get-hello-and-welcome-message-1-snap.png index ba498b9d83..c1bcaa23e6 100644 Binary files a/__tests__/__image_snapshots__/html/conversation-start-properties-send-non-existing-js-conversation-start-properties-with-non-existing-locale-should-get-hello-and-welcome-message-1-snap.png and b/__tests__/__image_snapshots__/html/conversation-start-properties-send-non-existing-js-conversation-start-properties-with-non-existing-locale-should-get-hello-and-welcome-message-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/conversation-start-properties-send-non-iso-format-js-conversation-start-properties-with-non-iso-format-locale-should-get-hello-and-welcome-message-1-snap.png b/__tests__/__image_snapshots__/html/conversation-start-properties-send-non-iso-format-js-conversation-start-properties-with-non-iso-format-locale-should-get-hello-and-welcome-message-1-snap.png index 011c44612c..a349081671 100644 Binary files a/__tests__/__image_snapshots__/html/conversation-start-properties-send-non-iso-format-js-conversation-start-properties-with-non-iso-format-locale-should-get-hello-and-welcome-message-1-snap.png and b/__tests__/__image_snapshots__/html/conversation-start-properties-send-non-iso-format-js-conversation-start-properties-with-non-iso-format-locale-should-get-hello-and-welcome-message-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/conversation-start-properties-send-zh-cn-js-conversation-start-properties-with-locale-of-zh-cn-should-get-hello-and-welcome-in-simplified-chinese-1-snap.png b/__tests__/__image_snapshots__/html/conversation-start-properties-send-zh-cn-js-conversation-start-properties-with-locale-of-zh-cn-should-get-hello-and-welcome-in-simplified-chinese-1-snap.png index 8725bc4f88..9452bbc02c 100644 Binary files a/__tests__/__image_snapshots__/html/conversation-start-properties-send-zh-cn-js-conversation-start-properties-with-locale-of-zh-cn-should-get-hello-and-welcome-in-simplified-chinese-1-snap.png and b/__tests__/__image_snapshots__/html/conversation-start-properties-send-zh-cn-js-conversation-start-properties-with-locale-of-zh-cn-should-get-hello-and-welcome-in-simplified-chinese-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/hero-card-actions-js-hero-card-actions-message-back-display-text-text-value-1-snap.png b/__tests__/__image_snapshots__/html/hero-card-actions-js-hero-card-actions-message-back-display-text-text-value-1-snap.png index 5cfca9b408..fe59e26853 100644 Binary files a/__tests__/__image_snapshots__/html/hero-card-actions-js-hero-card-actions-message-back-display-text-text-value-1-snap.png and b/__tests__/__image_snapshots__/html/hero-card-actions-js-hero-card-actions-message-back-display-text-text-value-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/hero-card-actions-js-hero-card-actions-message-back-value-1-snap.png b/__tests__/__image_snapshots__/html/hero-card-actions-js-hero-card-actions-message-back-value-1-snap.png index 9f72cb2f5a..eedfd52e69 100644 Binary files a/__tests__/__image_snapshots__/html/hero-card-actions-js-hero-card-actions-message-back-value-1-snap.png and b/__tests__/__image_snapshots__/html/hero-card-actions-js-hero-card-actions-message-back-value-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/hero-card-actions-js-hero-card-actions-post-back-json-1-snap.png b/__tests__/__image_snapshots__/html/hero-card-actions-js-hero-card-actions-post-back-json-1-snap.png index 3ed3fe2627..65fb5358ef 100644 Binary files a/__tests__/__image_snapshots__/html/hero-card-actions-js-hero-card-actions-post-back-json-1-snap.png and b/__tests__/__image_snapshots__/html/hero-card-actions-js-hero-card-actions-post-back-json-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/transcript-activity-grouping-js-transcript-with-activity-grouping-test-43-1-snap.png b/__tests__/__image_snapshots__/html/transcript-activity-grouping-js-transcript-with-activity-grouping-test-43-1-snap.png index 33d7cc98c0..8636c79bd2 100644 Binary files a/__tests__/__image_snapshots__/html/transcript-activity-grouping-js-transcript-with-activity-grouping-test-43-1-snap.png and b/__tests__/__image_snapshots__/html/transcript-activity-grouping-js-transcript-with-activity-grouping-test-43-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/transcript-activity-grouping-js-transcript-with-activity-grouping-test-44-1-snap.png b/__tests__/__image_snapshots__/html/transcript-activity-grouping-js-transcript-with-activity-grouping-test-44-1-snap.png index a9e5301cff..8580a882ce 100644 Binary files a/__tests__/__image_snapshots__/html/transcript-activity-grouping-js-transcript-with-activity-grouping-test-44-1-snap.png and b/__tests__/__image_snapshots__/html/transcript-activity-grouping-js-transcript-with-activity-grouping-test-44-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/transcript-activity-grouping-js-transcript-with-activity-grouping-test-45-1-snap.png b/__tests__/__image_snapshots__/html/transcript-activity-grouping-js-transcript-with-activity-grouping-test-45-1-snap.png index 362aa5f706..85a0d75034 100644 Binary files a/__tests__/__image_snapshots__/html/transcript-activity-grouping-js-transcript-with-activity-grouping-test-45-1-snap.png and b/__tests__/__image_snapshots__/html/transcript-activity-grouping-js-transcript-with-activity-grouping-test-45-1-snap.png differ diff --git a/__tests__/__image_snapshots__/html/transcript-activity-grouping-js-transcript-with-activity-grouping-test-46-1-snap.png b/__tests__/__image_snapshots__/html/transcript-activity-grouping-js-transcript-with-activity-grouping-test-46-1-snap.png index 398ee40de4..eeaf34ff06 100644 Binary files a/__tests__/__image_snapshots__/html/transcript-activity-grouping-js-transcript-with-activity-grouping-test-46-1-snap.png and b/__tests__/__image_snapshots__/html/transcript-activity-grouping-js-transcript-with-activity-grouping-test-46-1-snap.png differ diff --git a/__tests__/html/activityGrouping.disableAbsoluteTimestamp.html b/__tests__/html/activityGrouping.disableAbsoluteTimestamp.html deleted file mode 100644 index bb4fb833b0..0000000000 --- a/__tests__/html/activityGrouping.disableAbsoluteTimestamp.html +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - - - - - - - -
- - - - diff --git a/__tests__/html/transcript.activityGrouping.html b/__tests__/html/transcript.activityGrouping.html index 0b8dba37e1..56837f1246 100644 --- a/__tests__/html/transcript.activityGrouping.html +++ b/__tests__/html/transcript.activityGrouping.html @@ -36,14 +36,13 @@ } } = window; - run = fn => fn(); run(async function () { const params = new URLSearchParams(location.hash.replace(/^#/u, '')); const height = params.get('ch'); const width = params.get('cw'); - // await host.windowSize(width, height, document.getElementById('webchat')); + await host.windowSize(width, height, document.getElementById('webchat')); const TestHarness = () => { const { activityMiddleware, directLine, rtl, styleOptions, wide } = useContext(ActivityGroupingContext); @@ -76,11 +75,11 @@ document.getElementById('webchat') ); - // await pageConditions.uiConnected(); - // await pageConditions.allImagesLoaded(); - // await pageConditions.scrollToBottomCompleted(); + await pageConditions.uiConnected(); + await pageConditions.allImagesLoaded(); + await pageConditions.scrollToBottomCompleted(); - // await host.snapshot(); + await host.snapshot(); }); diff --git a/__tests__/html2/activity/viewCodeButton.html.snap-2.png b/__tests__/html2/activity/viewCodeButton.html.snap-2.png index 6df4e075a8..89ce10046a 100644 Binary files a/__tests__/html2/activity/viewCodeButton.html.snap-2.png and b/__tests__/html2/activity/viewCodeButton.html.snap-2.png differ diff --git a/__tests__/html2/markdown/codeBlock/layout.html b/__tests__/html2/markdown/codeBlock/layout.html index 6c971eeef9..56ff32f18f 100644 --- a/__tests__/html2/markdown/codeBlock/layout.html +++ b/__tests__/html2/markdown/codeBlock/layout.html @@ -41,7 +41,7 @@ const params = new URLSearchParams(location.search); renderWebChat({ - directLine, + directLine, store, styleOptions: { codeBlockTheme: params.get('code-block-theme') ?? 'github-light-default' 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 74c8b9e28d..66a50854a7 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 a1441959d9..a05fe49b8b 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 5882e07037..cd79436373 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 b645246666..2af049d855 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/behavior.denied.html.snap-1.png b/__tests__/html2/markdown/codeBlockCopyButton/behavior.denied.html.snap-1.png index 9a818693db..1e49618316 100644 Binary files a/__tests__/html2/markdown/codeBlockCopyButton/behavior.denied.html.snap-1.png and b/__tests__/html2/markdown/codeBlockCopyButton/behavior.denied.html.snap-1.png differ diff --git a/__tests__/html2/markdown/codeBlockCopyButton/behavior.denied.html.snap-2.png b/__tests__/html2/markdown/codeBlockCopyButton/behavior.denied.html.snap-2.png index fe7f114623..86ab7f2f86 100644 Binary files a/__tests__/html2/markdown/codeBlockCopyButton/behavior.denied.html.snap-2.png and b/__tests__/html2/markdown/codeBlockCopyButton/behavior.denied.html.snap-2.png differ diff --git a/__tests__/html2/markdown/codeBlockCopyButton/behavior.denied.html.snap-3.png b/__tests__/html2/markdown/codeBlockCopyButton/behavior.denied.html.snap-3.png index 0460ce789e..b155916acc 100644 Binary files a/__tests__/html2/markdown/codeBlockCopyButton/behavior.denied.html.snap-3.png and b/__tests__/html2/markdown/codeBlockCopyButton/behavior.denied.html.snap-3.png differ diff --git a/__tests__/html2/markdown/codeBlockCopyButton/behavior.highlighted.html.snap-1.png b/__tests__/html2/markdown/codeBlockCopyButton/behavior.highlighted.html.snap-1.png index ee21be3ada..d7355b3a90 100644 Binary files a/__tests__/html2/markdown/codeBlockCopyButton/behavior.highlighted.html.snap-1.png and b/__tests__/html2/markdown/codeBlockCopyButton/behavior.highlighted.html.snap-1.png differ diff --git a/__tests__/html2/markdown/codeBlockCopyButton/behavior.highlighted.html.snap-2.png b/__tests__/html2/markdown/codeBlockCopyButton/behavior.highlighted.html.snap-2.png index e7af4d3e2b..774e7f7469 100644 Binary files a/__tests__/html2/markdown/codeBlockCopyButton/behavior.highlighted.html.snap-2.png and b/__tests__/html2/markdown/codeBlockCopyButton/behavior.highlighted.html.snap-2.png differ diff --git a/__tests__/html2/markdown/codeBlockCopyButton/behavior.highlighted.html.snap-3.png b/__tests__/html2/markdown/codeBlockCopyButton/behavior.highlighted.html.snap-3.png index d5f0c6bdcc..6c1cd08fed 100644 Binary files a/__tests__/html2/markdown/codeBlockCopyButton/behavior.highlighted.html.snap-3.png and b/__tests__/html2/markdown/codeBlockCopyButton/behavior.highlighted.html.snap-3.png differ diff --git a/__tests__/html2/markdown/codeBlockCopyButton/behavior.html.snap-1.png b/__tests__/html2/markdown/codeBlockCopyButton/behavior.html.snap-1.png index 9a818693db..1e49618316 100644 Binary files a/__tests__/html2/markdown/codeBlockCopyButton/behavior.html.snap-1.png and b/__tests__/html2/markdown/codeBlockCopyButton/behavior.html.snap-1.png differ diff --git a/__tests__/html2/markdown/codeBlockCopyButton/behavior.html.snap-2.png b/__tests__/html2/markdown/codeBlockCopyButton/behavior.html.snap-2.png index 92f56c9105..f2219e50f2 100644 Binary files a/__tests__/html2/markdown/codeBlockCopyButton/behavior.html.snap-2.png and b/__tests__/html2/markdown/codeBlockCopyButton/behavior.html.snap-2.png differ diff --git a/__tests__/html2/markdown/codeBlockCopyButton/behavior.html.snap-3.png b/__tests__/html2/markdown/codeBlockCopyButton/behavior.html.snap-3.png index 065afff296..dc18ad9fe4 100644 Binary files a/__tests__/html2/markdown/codeBlockCopyButton/behavior.html.snap-3.png and b/__tests__/html2/markdown/codeBlockCopyButton/behavior.html.snap-3.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 755822344a..0a2b9226d9 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/markdown/codeBlockCopyButton/layout.html.snap-1.png b/__tests__/html2/markdown/codeBlockCopyButton/layout.html.snap-1.png index b55880ce58..a1d3d9bec7 100644 Binary files a/__tests__/html2/markdown/codeBlockCopyButton/layout.html.snap-1.png and b/__tests__/html2/markdown/codeBlockCopyButton/layout.html.snap-1.png differ diff --git a/packages/component/src/Styles/CustomPropertyNames.ts b/packages/component/src/Styles/CustomPropertyNames.ts index 897d69e8f2..22ba7e9323 100644 --- a/packages/component/src/Styles/CustomPropertyNames.ts +++ b/packages/component/src/Styles/CustomPropertyNames.ts @@ -1,9 +1,11 @@ const CustomPropertyNames = Object.freeze({ // Make sure key names does not have JavaScript forbidden names. + BackgroundCodeBlock: '--webchat__background--code-block', BorderAnimationColor1: '--webchat__border-animation--color-1', BorderAnimationColor2: '--webchat__border-animation--color-2', BorderAnimationColor3: '--webchat__border-animation--color-3', ColorAccent: '--webchat__color--accent', + ColorCodeBlock: '--webchat__color--code-block', ColorSubtle: '--webchat__color--subtle', ColorTimestamp: '--webchat__color--timestamp', FontPrimary: '--webchat__font--primary', @@ -11,16 +13,13 @@ const CustomPropertyNames = Object.freeze({ IconURLExternalLink: '--webchat__icon-url--external-link', MaxHeightImageBubble: '--webchat__max-height--image-bubble', MaxWidthAttachmentBubble: '--webchat__max-width--attachment-bubble', - MinWidthAttachmentBubble: '--webchat__min-width--attachment-bubble', MaxWidthMessageBubble: '--webchat__max-width--message-bubble', - MinWidthMessageBubble: '--webchat__min-width--message-bubble', MinHeightBubble: '--webchat__min-height--bubble', MinHeightImageBubble: '--webchat__min-height--image-bubble', + MinWidthAttachmentBubble: '--webchat__min-width--attachment-bubble', + MinWidthMessageBubble: '--webchat__min-width--message-bubble', PaddingRegular: '--webchat__padding--regular', SizeAvatar: '--webchat__size--avatar' -}); - -// This is for type-checking only to make sure the CSS custom property names is `--webchat__${string}`. -const _TypeChecking: Readonly> = CustomPropertyNames; +}) satisfies Readonly>; export default CustomPropertyNames; diff --git a/packages/component/src/Styles/StyleSet/CodeBlock.ts b/packages/component/src/Styles/StyleSet/CodeBlock.ts index 64fd5d6eb9..4bea57a366 100644 --- a/packages/component/src/Styles/StyleSet/CodeBlock.ts +++ b/packages/component/src/Styles/StyleSet/CodeBlock.ts @@ -1,21 +1,25 @@ +import CustomPropertyNames from '../CustomPropertyNames'; + export default function createCodeBlockStyle() { return { '&.webchat__code-block': { - margin: '16px 0', + background: `var(${CustomPropertyNames.BackgroundCodeBlock}, inherit)`, + border: '1px solid #d1d1d1', + borderRadius: '4px', + color: `var(${CustomPropertyNames.ColorCodeBlock}, currentColor)`, display: 'block', + margin: '16px 0', overflow: 'hidden', padding: '4px', - borderRadius: '4px', - border: '1px solid #d1d1d1', ':has(> .github-dark-default)': { - backgroundColor: 'var(--webchat__code-block--background, #0d1117)', - color: 'var(--webchat__code-block--color, #e6edf3)' + background: `var(${CustomPropertyNames.BackgroundCodeBlock}, #0d1117)`, + color: `var(${CustomPropertyNames.ColorCodeBlock}, #e6edf3)` }, ':has(> .github-light-default)': { - backgroundColor: 'var(--webchat__code-block--background, inherit)', - color: 'var(--webchat__code-block--color, currentColor)' + background: `var(${CustomPropertyNames.BackgroundCodeBlock}, #ffffff)`, + color: `var(${CustomPropertyNames.ColorCodeBlock}, #1f2328)` }, ':has(.webchat__code-block__body:focus-visible):focus-within': { diff --git a/packages/component/src/Styles/StyleSet/RenderMarkdown.ts b/packages/component/src/Styles/StyleSet/RenderMarkdown.ts index 9268bf6663..3ba43386ce 100644 --- a/packages/component/src/Styles/StyleSet/RenderMarkdown.ts +++ b/packages/component/src/Styles/StyleSet/RenderMarkdown.ts @@ -91,10 +91,6 @@ export default function createMarkdownStyle() { '& :is([data-math-type=block], [data-math-type=inline]) > span': { display: 'contents' - }, - - '& .webchat__render-markdown__code-block': { - whiteSpace: 'pre-wrap' } } }; diff --git a/packages/component/src/Styles/StyleSet/ViewCodeDialog.ts b/packages/component/src/Styles/StyleSet/ViewCodeDialog.ts index c3ac078932..eb5e271958 100644 --- a/packages/component/src/Styles/StyleSet/ViewCodeDialog.ts +++ b/packages/component/src/Styles/StyleSet/ViewCodeDialog.ts @@ -45,7 +45,6 @@ export default function createViewCodeDialogStyle() { '& .webchat__view-code-dialog__body': { border: 'none', borderRadius: 0, - display: 'flex', overflow: 'auto', height: '100%', diff --git a/packages/fluent-theme/src/components/theme/Theme.module.css b/packages/fluent-theme/src/components/theme/Theme.module.css index a181465254..4425f010d3 100644 --- a/packages/fluent-theme/src/components/theme/Theme.module.css +++ b/packages/fluent-theme/src/components/theme/Theme.module.css @@ -443,20 +443,20 @@ } &:global(:has(> .github-dark-default)) { + --webchat__background--code-block: var(--codeBlockBackground, var(--webchat-colorGrey8)); --webchat__code-block__copy-button--background: var( --codeBlockCopyButtonBackgroundPressed, var(--webchat-colorGrey14) ); - --webchat__code-block__copy-button--color: var(--codeBlockCopyButtonColor, var(--webchat__code-block--color)); - --webchat__code-block--background: var(--codeBlockBackground, var(--webchat-colorGrey8)); - --webchat__code-block--color: var(--codeBlockColor, var(--webchat-colorGrey98)); + --webchat__code-block__copy-button--color: var(--codeBlockCopyButtonForeground, var(--webchat__color--code-block)); + --webchat__color--code-block: var(--codeBlockForeground, var(--webchat-colorGrey98)); } &:global(:has(> .github-light-default)) { + --webchat__background--code-block: var(--codeBlockBackground, var(--webchat-colorGrey98)); --webchat__code-block__copy-button--background: var(--codeBlockBackgroundPressed, var(--webchat-colorGrey92)); - --webchat__code-block__copy-button--color: var(--codeBlockCopyButtonColor, var(--webchat__code-block--color)); - --webchat__code-block--background: var(--codeBlockBackground, var(--webchat-colorGrey98)); - --webchat__code-block--color: var(--codeBlockColor, var(--webchat-colorGrey8)); + --webchat__code-block__copy-button--color: var(--codeBlockCopyButtonForeground, var(--webchat__color--code-block)); + --webchat__color--code-block: var(--codeBlockForeground, var(--webchat-colorGrey8)); } } @@ -482,7 +482,6 @@ --webchat__code-block__copy-button--background: var(--webchat-colorNeutralBackground3); margin-block-start: var(--webchat-spacingVerticalS); - opacity: 1; position: absolute; right: 32px; top: 0;