botframework-webchat-fluent-theme 4.18.1-main.20241126.c3857bf → 4.18.1-main.20250114.4df27b8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/botframework-webchat-fluent-theme.css.map +1 -1
- package/dist/botframework-webchat-fluent-theme.development.css.map +1 -1
- package/dist/botframework-webchat-fluent-theme.development.js +6 -6
- package/dist/botframework-webchat-fluent-theme.development.js.map +1 -1
- package/dist/botframework-webchat-fluent-theme.js +1 -1
- package/dist/botframework-webchat-fluent-theme.js.map +1 -1
- package/dist/botframework-webchat-fluent-theme.mjs +1 -1
- package/dist/botframework-webchat-fluent-theme.mjs.map +1 -1
- package/dist/botframework-webchat-fluent-theme.production.min.css.map +1 -1
- package/dist/botframework-webchat-fluent-theme.production.min.js +6 -6
- package/dist/botframework-webchat-fluent-theme.production.min.js.map +1 -1
- package/package.json +6 -6
- package/src/components/theme/Theme.module.css +107 -50
- package/src/private/FluentThemeProvider.tsx +11 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "botframework-webchat-fluent-theme",
|
|
3
|
-
"version": "4.18.1-main.
|
|
3
|
+
"version": "4.18.1-main.20250114.4df27b8",
|
|
4
4
|
"description": "Fluent theme for Bot Framework Web Chat",
|
|
5
5
|
"main": "./dist/botframework-webchat-fluent-theme.js",
|
|
6
6
|
"types": "./dist/botframework-webchat-fluent-theme.d.ts",
|
|
@@ -68,15 +68,15 @@
|
|
|
68
68
|
"@types/math-random": "^1.0.2",
|
|
69
69
|
"@types/node": "^20.12.11",
|
|
70
70
|
"@types/react": "^16.14.60",
|
|
71
|
-
"botframework-webchat-base": "4.18.1-main.
|
|
72
|
-
"botframework-webchat-styles": "4.18.1-main.
|
|
71
|
+
"botframework-webchat-base": "4.18.1-main.20250114.4df27b8",
|
|
72
|
+
"botframework-webchat-styles": "4.18.1-main.20250114.4df27b8",
|
|
73
73
|
"tsup": "^8.0.2",
|
|
74
74
|
"typescript": "^5.4.5"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"botframework-webchat-api": "4.18.1-main.
|
|
78
|
-
"botframework-webchat-component": "4.18.1-main.
|
|
79
|
-
"botframework-webchat-core": "4.18.1-main.
|
|
77
|
+
"botframework-webchat-api": "4.18.1-main.20250114.4df27b8",
|
|
78
|
+
"botframework-webchat-component": "4.18.1-main.20250114.4df27b8",
|
|
79
|
+
"botframework-webchat-core": "4.18.1-main.20250114.4df27b8",
|
|
80
80
|
"classnames": "2.5.1",
|
|
81
81
|
"inject-meta-tag": "0.0.1",
|
|
82
82
|
"math-random": "2.0.1",
|
|
@@ -33,6 +33,9 @@
|
|
|
33
33
|
--webchat-colorNeutralStencil1: var(--colorNeutralStencil1, #e6e6e6); /* #575757 for dark mode */
|
|
34
34
|
--webchat-colorNeutralStencil2: var(--colorNeutralStencil2, #fafafa); /* #333333 for dark mode */
|
|
35
35
|
|
|
36
|
+
--webchat-colorNeutralShadowAmbient: var(--colorNeutralShadowAmbient, rgba(0, 0, 0, 0.12));
|
|
37
|
+
--webchat-colorNeutralShadowKey: var(--colorNeutralShadowKey, rgba(0, 0, 0, 0.14));
|
|
38
|
+
|
|
36
39
|
--webchat-colorTransparentBackground: var(--colorTransparentBackground, rgba(0, 0, 0, 0.4));
|
|
37
40
|
|
|
38
41
|
--webchat-colorNeutralStrokeDisabled: var(--colorNeutralStrokeDisabled, #e0e0e0);
|
|
@@ -74,6 +77,8 @@
|
|
|
74
77
|
|
|
75
78
|
/* New greys from the link above not exposed by Fluent */
|
|
76
79
|
--webchat-colorGrey8: #141414;
|
|
80
|
+
--webchat-colorGrey14: #242424;
|
|
81
|
+
--webchat-colorGrey92: #ebebeb;
|
|
77
82
|
--webchat-colorGrey98: #fafafa;
|
|
78
83
|
|
|
79
84
|
/* https://github.com/microsoft/fluentui/blob/master/packages/tokens/src/utils/shadows.ts */
|
|
@@ -225,7 +230,8 @@
|
|
|
225
230
|
/* Scrollbars */
|
|
226
231
|
:global(.webchat-fluent).theme :global(.webchat__basic-transcript .webchat__basic-transcript__scrollable),
|
|
227
232
|
:global(.webchat-fluent).theme :global(.webchat__view-code-dialog__code-body),
|
|
228
|
-
:global(.webchat-fluent).theme :global(.webchat__render-markdown [data-math-type='block'])
|
|
233
|
+
:global(.webchat-fluent).theme :global(.webchat__render-markdown [data-math-type='block']),
|
|
234
|
+
:global(.webchat-fluent).theme :global(.webchat__view-code-dialog__body) {
|
|
229
235
|
/* Edge uses -webkit-scrollbar if scrollbar-* is not set */
|
|
230
236
|
scrollbar-color: unset;
|
|
231
237
|
scrollbar-width: unset;
|
|
@@ -391,6 +397,72 @@
|
|
|
391
397
|
}
|
|
392
398
|
}
|
|
393
399
|
|
|
400
|
+
/* Code block */
|
|
401
|
+
:global(.webchat-fluent).theme :global(.webchat__code-block) {
|
|
402
|
+
border: none;
|
|
403
|
+
font-family: var(--webchat-fontFamilyMonospace);
|
|
404
|
+
font-size: var(--webchat-fontSizeBase300);
|
|
405
|
+
|
|
406
|
+
--webchat__code-block__copy-button--color: var(--webchat-colorNeutralForeground1);
|
|
407
|
+
--webchat__code-block__copy-button--background: var(--webchat-colorNeutralBackground3);
|
|
408
|
+
|
|
409
|
+
:global(.webchat__code-block-copy-button) {
|
|
410
|
+
background: transparent;
|
|
411
|
+
border: none;
|
|
412
|
+
color: var(--webchat__code-block__copy-button--color);
|
|
413
|
+
height: 20px;
|
|
414
|
+
margin-inline-start: var(--webchat-spacingHorizontalS);
|
|
415
|
+
padding: 0;
|
|
416
|
+
width: 20px;
|
|
417
|
+
transition: background-color var(--webchat-durationNormal) var(--webchat-curveDecelerateMid);
|
|
418
|
+
|
|
419
|
+
:global(.webchat__code-block-copy-button__icon) {
|
|
420
|
+
background-color: currentColor;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
&:hover {
|
|
424
|
+
background: var(--webchat__code-block__copy-button--background);
|
|
425
|
+
color: var(--webchat__code-block__copy-button--color);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
&:active {
|
|
429
|
+
background: var(--webchat__code-block__copy-button--background);
|
|
430
|
+
color: var(--webchat__code-block__copy-button--color);
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
&:focus {
|
|
434
|
+
color: var(--webchat__code-block__copy-button--color);
|
|
435
|
+
outline-color: currentColor;
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
&:global(:has(.webchat__code-block__body:focus-visible)):focus-within {
|
|
440
|
+
outline: var(--webchat-strokeWidthThick) solid var(--webchat-colorStrokeFocus2);
|
|
441
|
+
outline-offset: calc(var(--webchat-strokeWidthThick) * -1);
|
|
442
|
+
|
|
443
|
+
:global(.webchat__code-block__body) {
|
|
444
|
+
outline: none;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
&:global(:has(> .webchat__code-block__theme--github-dark-default)) {
|
|
449
|
+
--webchat__background--code-block: var(--codeBlockBackground, var(--webchat-colorGrey8));
|
|
450
|
+
--webchat__code-block__copy-button--background: var(
|
|
451
|
+
--codeBlockCopyButtonBackgroundPressed,
|
|
452
|
+
var(--webchat-colorGrey14)
|
|
453
|
+
);
|
|
454
|
+
--webchat__code-block__copy-button--color: var(--codeBlockCopyButtonForeground, var(--webchat__color--code-block));
|
|
455
|
+
--webchat__color--code-block: var(--codeBlockForeground, var(--webchat-colorGrey98));
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
&:global(:has(> .webchat__code-block__theme--github-light-default)) {
|
|
459
|
+
--webchat__background--code-block: var(--codeBlockBackground, var(--webchat-colorGrey98));
|
|
460
|
+
--webchat__code-block__copy-button--background: var(--codeBlockBackgroundPressed, var(--webchat-colorGrey92));
|
|
461
|
+
--webchat__code-block__copy-button--color: var(--codeBlockCopyButtonForeground, var(--webchat__color--code-block));
|
|
462
|
+
--webchat__color--code-block: var(--codeBlockForeground, var(--webchat-colorGrey8));
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
394
466
|
/* View Code dialog */
|
|
395
467
|
:global(.webchat-fluent).theme :global(.webchat__modal-dialog.webchat__view-code-dialog) {
|
|
396
468
|
:global(.webchat__modal-dialog__close-button-layout) {
|
|
@@ -408,34 +480,14 @@
|
|
|
408
480
|
width: unset;
|
|
409
481
|
}
|
|
410
482
|
|
|
411
|
-
:global(.
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
height: 20px;
|
|
483
|
+
:global(.webchat__code-block-copy-button) {
|
|
484
|
+
--webchat__code-block__copy-button--color: var(--webchat-colorNeutralForeground1);
|
|
485
|
+
--webchat__code-block__copy-button--background: var(--webchat-colorNeutralBackground3);
|
|
486
|
+
|
|
416
487
|
margin-block-start: var(--webchat-spacingVerticalS);
|
|
417
|
-
padding: 0;
|
|
418
488
|
position: absolute;
|
|
419
489
|
right: 32px;
|
|
420
490
|
top: 0;
|
|
421
|
-
transition: background-color var(--webchat-durationNormal) var(--webchat-curveDecelerateMid);
|
|
422
|
-
width: 20px;
|
|
423
|
-
|
|
424
|
-
:global(.webchat__code-block-copy-button__icon) {
|
|
425
|
-
background-color: currentColor;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
&:hover {
|
|
429
|
-
background: var(--webchat-colorNeutralBackground3);
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
&:active {
|
|
433
|
-
background: var(--webchat-colorNeutralBackground3);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
&:focus {
|
|
437
|
-
outline-color: var(--webchat-colorStrokeFocus2);
|
|
438
|
-
}
|
|
439
491
|
}
|
|
440
492
|
|
|
441
493
|
:global(.webchat__modal-dialog__box) {
|
|
@@ -454,33 +506,10 @@
|
|
|
454
506
|
}
|
|
455
507
|
|
|
456
508
|
:global(.webchat__view-code-dialog__body) {
|
|
457
|
-
display: contents;
|
|
458
|
-
}
|
|
459
|
-
|
|
460
|
-
:global(.webchat__view-code-dialog__code-body) {
|
|
461
|
-
background: var(--webchat__code-block--background);
|
|
462
509
|
font-family: var(--webchat-fontFamilyMonospace);
|
|
463
510
|
font-size: var(--webchat-fontSizeBase300);
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
padding-inline: var(--webchat-spacingHorizontalM);
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
:global(.webchat__view-code-dialog__code-body:has(.shiki:focus-visible)):focus-within {
|
|
470
|
-
outline: var(--webchat-strokeWidthThick) solid var(--webchat-colorStrokeFocus2);
|
|
471
|
-
outline-offset: calc(var(--webchat-strokeWidthThick) * -1);
|
|
472
|
-
|
|
473
|
-
:global(.shiki) {
|
|
474
|
-
outline: none;
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
:global(.webchat__view-code-dialog__code-body:has(.shiki.github-light-default)) {
|
|
479
|
-
--webchat__code-block--background: var(--codeBlockBackground, var(--webchat-colorGrey98));
|
|
480
|
-
}
|
|
481
|
-
|
|
482
|
-
:global(.webchat__view-code-dialog__code-body:has(.shiki.github-dark-default)) {
|
|
483
|
-
--webchat__code-block--background: var(--codeBlockBackground, var(--webchat-colorGrey8));
|
|
511
|
+
margin: 0 calc(var(--webchat-spacingHorizontalM) * -1);
|
|
512
|
+
padding: 0 var(--webchat-spacingHorizontalM);
|
|
484
513
|
}
|
|
485
514
|
|
|
486
515
|
:global(.webchat__view-code-dialog__footer) {
|
|
@@ -564,3 +593,31 @@
|
|
|
564
593
|
:global(.webchat-fluent).theme :global(.webchat__monochrome-image-masker) {
|
|
565
594
|
background-color: var(--webchat-colorNeutralForeground4);
|
|
566
595
|
}
|
|
596
|
+
|
|
597
|
+
/* Feedback button */
|
|
598
|
+
:global(.webchat-fluent).theme :global(.webchat__thumb-button) {
|
|
599
|
+
color: var(--webchat-colorNeutralForeground1);
|
|
600
|
+
|
|
601
|
+
&:focus-visible {
|
|
602
|
+
outline: var(--webchat-strokeWidthThick) solid var(--webchat-colorStrokeFocus2);
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
&[aria-disabled='true'] {
|
|
606
|
+
color: var(--webchat-colorNeutralForegroundDisabled);
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/* Tooltip */
|
|
611
|
+
:global(.webchat-fluent).theme :global(.webchat__tooltip) {
|
|
612
|
+
--webchat__tooltip-background: var(--tooltip-background, var(--webchat-colorNeutralBackground1));
|
|
613
|
+
|
|
614
|
+
color: var(--webchat-colorNeutralForeground1);
|
|
615
|
+
filter: drop-shadow(0 0 2px var(--webchat-colorNeutralShadowAmbient))
|
|
616
|
+
drop-shadow(0 4px 8px var(--webchat-colorNeutralShadowKey));
|
|
617
|
+
font-family: var(--webchat-fontFamilyBase);
|
|
618
|
+
font-size: var(--webchat-fontSizeBase200);
|
|
619
|
+
font-weight: var(--webchat-fontWeightRegular);
|
|
620
|
+
line-height: var(--webchat-lineHeightBase200);
|
|
621
|
+
padding: var(--webchat-spacingVerticalSNudge) var(--webchat-spacingHorizontalM);
|
|
622
|
+
transition: opacity var(--webchat-durationNormal) var(--webchat-curveDecelerateMid);
|
|
623
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ActivityMiddleware, type StyleOptions } from 'botframework-webchat-api';
|
|
2
2
|
import { Components } from 'botframework-webchat-component';
|
|
3
3
|
import { WebChatDecorator } from 'botframework-webchat-component/decorator';
|
|
4
4
|
import React, { memo, type ReactNode } from 'react';
|
|
@@ -43,11 +43,20 @@ const sendBoxMiddleware = [() => () => () => PrimarySendBox];
|
|
|
43
43
|
|
|
44
44
|
const styles = createStyles();
|
|
45
45
|
|
|
46
|
+
const fluentStyleOptions: StyleOptions = Object.freeze({
|
|
47
|
+
feedbackActionsPlacement: 'activity-actions'
|
|
48
|
+
});
|
|
49
|
+
|
|
46
50
|
const FluentThemeProvider = ({ children, variant = 'fluent' }: Props) => (
|
|
47
51
|
<VariantComposer variant={variant}>
|
|
48
52
|
<WebChatTheme>
|
|
49
53
|
<TelephoneKeypadProvider>
|
|
50
|
-
<ThemeProvider
|
|
54
|
+
<ThemeProvider
|
|
55
|
+
activityMiddleware={activityMiddleware}
|
|
56
|
+
sendBoxMiddleware={sendBoxMiddleware}
|
|
57
|
+
styleOptions={fluentStyleOptions}
|
|
58
|
+
styles={styles}
|
|
59
|
+
>
|
|
51
60
|
<WebChatDecorator>{children}</WebChatDecorator>
|
|
52
61
|
</ThemeProvider>
|
|
53
62
|
</TelephoneKeypadProvider>
|