botframework-webchat-fluent-theme 4.18.1-main.20250505.5e12798 → 4.18.1-main.20250528.43d5b5c
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.d.mts +5 -4
- package/dist/botframework-webchat-fluent-theme.d.ts +5 -4
- package/dist/botframework-webchat-fluent-theme.development.css.map +1 -1
- package/dist/botframework-webchat-fluent-theme.development.js +8 -8
- 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 +8 -8
- package/dist/botframework-webchat-fluent-theme.production.min.js.map +1 -1
- package/package.json +7 -11
- package/src/components/theme/Theme.module.css +26 -29
- package/src/private/FluentThemeProvider.tsx +41 -27
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.20250528.43d5b5c",
|
|
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",
|
|
@@ -61,10 +61,6 @@
|
|
|
61
61
|
"@types/react": [
|
|
62
62
|
"16",
|
|
63
63
|
"react@16.8.6 is our baseline"
|
|
64
|
-
],
|
|
65
|
-
"valibot": [
|
|
66
|
-
"0",
|
|
67
|
-
"valibot@0 until they finalize @1"
|
|
68
64
|
]
|
|
69
65
|
},
|
|
70
66
|
"devDependencies": {
|
|
@@ -72,20 +68,20 @@
|
|
|
72
68
|
"@types/math-random": "^1.0.2",
|
|
73
69
|
"@types/node": "^22.13.4",
|
|
74
70
|
"@types/react": "^16.14.62",
|
|
75
|
-
"botframework-webchat-base": "4.18.1-main.
|
|
76
|
-
"botframework-webchat-styles": "4.18.1-main.
|
|
71
|
+
"botframework-webchat-base": "4.18.1-main.20250528.43d5b5c",
|
|
72
|
+
"botframework-webchat-styles": "4.18.1-main.20250528.43d5b5c",
|
|
77
73
|
"tsup": "^8.3.6",
|
|
78
74
|
"typescript": "^5.7.3"
|
|
79
75
|
},
|
|
80
76
|
"dependencies": {
|
|
81
|
-
"botframework-webchat-api": "4.18.1-main.
|
|
82
|
-
"botframework-webchat-component": "4.18.1-main.
|
|
83
|
-
"botframework-webchat-core": "4.18.1-main.
|
|
77
|
+
"botframework-webchat-api": "4.18.1-main.20250528.43d5b5c",
|
|
78
|
+
"botframework-webchat-component": "4.18.1-main.20250528.43d5b5c",
|
|
79
|
+
"botframework-webchat-core": "4.18.1-main.20250528.43d5b5c",
|
|
84
80
|
"classnames": "2.5.1",
|
|
85
81
|
"inject-meta-tag": "0.0.1",
|
|
86
82
|
"math-random": "2.0.1",
|
|
87
83
|
"use-ref-from": "0.1.0",
|
|
88
|
-
"valibot": "
|
|
84
|
+
"valibot": "1.1.0"
|
|
89
85
|
},
|
|
90
86
|
"peerDependencies": {
|
|
91
87
|
"react": ">= 16.8.6"
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
:global {
|
|
2
|
-
/* biome-ignore format: do not print each class on the new line */
|
|
3
|
-
.a, .b, .c, .d, .e, .f, .g, .h, .i, .j, .k, .l, .m, .n, .o, .p, .q, .r, .s, .t, .v, .w, .u, .x, .y, .z,
|
|
4
|
-
.A, .B, .C, .D, .E, .F, .G, .H, .I, .J, .K, .L, .M, .N, .O, .P, .Q, .R, .S, .T, .V, .W, .U, .X, .Y, .Z {
|
|
5
|
-
/* esbuild considers empty global classes as used and removes them due to lack of rules */
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
|
|
9
1
|
:global(.webchat-fluent).theme {
|
|
10
2
|
display: contents;
|
|
11
3
|
|
|
@@ -603,13 +595,15 @@
|
|
|
603
595
|
|
|
604
596
|
/* Feedback button */
|
|
605
597
|
:global(.webchat-fluent).theme :global(.webchat__thumb-button) {
|
|
606
|
-
|
|
598
|
+
:global(.webchat__thumb-button__image) {
|
|
599
|
+
color: var(--webchat-colorNeutralForeground1);
|
|
600
|
+
}
|
|
607
601
|
|
|
608
|
-
&:focus-visible {
|
|
602
|
+
&:has(:global(.webchat__thumb-button__input):focus-visible) {
|
|
609
603
|
outline: var(--webchat-strokeWidthThick) solid var(--webchat-colorStrokeFocus2);
|
|
610
604
|
}
|
|
611
605
|
|
|
612
|
-
|
|
606
|
+
&:has(:global(.webchat__thumb-button__input)[aria-disabled='true']) :global(.webchat__thumb-button__image) {
|
|
613
607
|
color: var(--webchat-colorNeutralForegroundDisabled);
|
|
614
608
|
}
|
|
615
609
|
}
|
|
@@ -630,25 +624,28 @@
|
|
|
630
624
|
}
|
|
631
625
|
|
|
632
626
|
/* Feedback Form */
|
|
627
|
+
/* TODO: Need review */
|
|
633
628
|
:global(.webchat-fluent).theme :global(.webchat__feedback-form) {
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
:global(.webchat__feedback-form__body) {
|
|
637
|
-
font-family: var(--webchat-fontFamilyBase);
|
|
629
|
+
:global(.webchat__feedback-form__form-header) {
|
|
638
630
|
color: var(--webchat-colorNeutralForeground1);
|
|
631
|
+
font-family: var(--webchat-fontFamilyBase);
|
|
639
632
|
font-size: var(--webchat-fontSizeBase300);
|
|
640
633
|
font-weight: var(--webchat-fontWeightRegular);
|
|
641
634
|
line-height: var(--webchat-lineHeightBase300);
|
|
642
635
|
}
|
|
643
|
-
|
|
644
|
-
:global(.webchat__feedback-
|
|
645
|
-
|
|
636
|
+
|
|
637
|
+
:global(.webchat__feedback-form__form) {
|
|
638
|
+
gap: var(--webchat-spacingVerticalXS);
|
|
639
|
+
}
|
|
640
|
+
|
|
641
|
+
:global(.webchat__feedback-form__form-footer) {
|
|
646
642
|
color: var(--webchat-colorNeutralForeground1);
|
|
643
|
+
font-family: var(--webchat-fontFamilyBase);
|
|
647
644
|
font-size: var(--webchat-fontSizeBase100);
|
|
648
645
|
font-weight: var(--webchat-fontWeightRegular);
|
|
649
646
|
line-height: var(--webchat-lineHeightBase200);
|
|
650
647
|
}
|
|
651
|
-
|
|
648
|
+
|
|
652
649
|
:global(.webchat__feedback-form__submit-button) {
|
|
653
650
|
background-color: var(--webchat-colorBrandBackground);
|
|
654
651
|
border: var(--webchat-strokeWidthThin) solid var(--webchat-colorBrandBackground);
|
|
@@ -659,23 +656,23 @@
|
|
|
659
656
|
font-size: var(--webchat-fontSizeBase300);
|
|
660
657
|
padding: var(--webchat-spacingVerticalNone) var(--webchat-spacingHorizontalS);
|
|
661
658
|
transition: background-color var(--webchat-durationNormal) var(--webchat-curveDecelerateMid);
|
|
662
|
-
|
|
659
|
+
|
|
663
660
|
&:hover {
|
|
664
661
|
background-color: var(--webchat-colorBrandBackgroundHover);
|
|
665
662
|
border: var(--webchat-strokeWidthThin) solid var(--webchat-colorBrandBackgroundHover);
|
|
666
663
|
}
|
|
667
|
-
|
|
664
|
+
|
|
668
665
|
&:focus-visible {
|
|
669
666
|
outline: var(--webchat-strokeWidthThick) solid var(--webchat-colorStrokeFocus2);
|
|
670
667
|
outline-offset: calc(var(--webchat-strokeWidthThin) * -1);
|
|
671
668
|
}
|
|
672
|
-
|
|
669
|
+
|
|
673
670
|
&:active {
|
|
674
671
|
background-color: var(--webchat-colorBrandBackgroundPressed);
|
|
675
672
|
border: var(--webchat-strokeWidthThin) solid var(--webchat-colorBrandBackgroundPressed);
|
|
676
673
|
}
|
|
677
674
|
}
|
|
678
|
-
|
|
675
|
+
|
|
679
676
|
:global(.webchat__feedback-form__cancel-button) {
|
|
680
677
|
background-color: var(--webchat-colorNeutralBackground1);
|
|
681
678
|
border: var(--webchat-strokeWidthThin) solid var(--webchat-colorNeutralStroke1);
|
|
@@ -686,23 +683,23 @@
|
|
|
686
683
|
font-size: var(--webchat-fontSizeBase300);
|
|
687
684
|
padding: var(--webchat-spacingVerticalNone) var(--webchat-spacingHorizontalS);
|
|
688
685
|
transition: background-color var(--webchat-durationNormal) var(--webchat-curveDecelerateMid);
|
|
689
|
-
|
|
686
|
+
|
|
690
687
|
&:hover {
|
|
691
688
|
background-color: var(--webchat-colorNeutralBackground1Hover);
|
|
692
689
|
border: var(--webchat-strokeWidthThin) solid var(--webchat-colorNeutralStroke1Hover);
|
|
693
690
|
}
|
|
694
|
-
|
|
691
|
+
|
|
695
692
|
&:focus-visible {
|
|
696
693
|
outline: var(--webchat-strokeWidthThick) solid var(--webchat-colorStrokeFocus2);
|
|
697
694
|
outline-offset: calc(var(--webchat-strokeWidthThin) * -1);
|
|
698
695
|
}
|
|
699
|
-
|
|
696
|
+
|
|
700
697
|
&:active {
|
|
701
698
|
background-color: var(--webchat-colorNeutralBackground1Pressed);
|
|
702
699
|
border: var(--webchat-strokeWidthThin) solid var(--webchat-colorNeutralStroke1Pressed);
|
|
703
700
|
}
|
|
704
701
|
}
|
|
705
|
-
|
|
702
|
+
|
|
706
703
|
:global(.webchat__feedback-form-text-area) {
|
|
707
704
|
background-color: var(--webchat-colorNeutralBackground1);
|
|
708
705
|
border-radius: var(--webchat-borderRadiusMedium);
|
|
@@ -726,5 +723,5 @@
|
|
|
726
723
|
clip-path: inset(calc(100% - var(--webchat-strokeWidthThicker)) 0 0 0);
|
|
727
724
|
transition: clip-path var(--webchat-durationNormal) var(--webchat-curveDecelerateMid);
|
|
728
725
|
}
|
|
729
|
-
}
|
|
730
|
-
}
|
|
726
|
+
}
|
|
727
|
+
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { type ActivityMiddleware, type StyleOptions, type TypingIndicatorMiddleware } from 'botframework-webchat-api';
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
DecoratorComposer,
|
|
4
|
+
DecoratorMiddleware,
|
|
5
|
+
type DecoratorMiddlewareInit,
|
|
6
|
+
type DecoratorMiddlewareTypes
|
|
7
|
+
} from 'botframework-webchat-api/decorator';
|
|
3
8
|
import { Components } from 'botframework-webchat-component';
|
|
4
9
|
import { WebChatDecorator } from 'botframework-webchat-component/decorator';
|
|
5
10
|
import React, { memo, type ReactNode } from 'react';
|
|
@@ -18,7 +23,10 @@ import VariantComposer, { VariantList } from './VariantComposer';
|
|
|
18
23
|
|
|
19
24
|
const { ThemeProvider } = Components;
|
|
20
25
|
|
|
21
|
-
type
|
|
26
|
+
type FluentThemeProviderProps = Readonly<{
|
|
27
|
+
children?: ReactNode | undefined;
|
|
28
|
+
variant?: VariantList | undefined;
|
|
29
|
+
}>;
|
|
22
30
|
|
|
23
31
|
const activityMiddleware: readonly ActivityMiddleware[] = Object.freeze([
|
|
24
32
|
() =>
|
|
@@ -45,11 +53,14 @@ const activityMiddleware: readonly ActivityMiddleware[] = Object.freeze([
|
|
|
45
53
|
|
|
46
54
|
const sendBoxMiddleware = [() => () => () => PrimarySendBox];
|
|
47
55
|
|
|
48
|
-
const decoratorMiddleware: DecoratorMiddleware[] = [
|
|
49
|
-
init =>
|
|
56
|
+
const decoratorMiddleware: readonly DecoratorMiddleware[] = Object.freeze([
|
|
57
|
+
(init: DecoratorMiddlewareInit) =>
|
|
50
58
|
init === 'activity border' &&
|
|
51
|
-
(next => request =>
|
|
52
|
-
|
|
59
|
+
((next => request =>
|
|
60
|
+
request.livestreamingState === 'preparing'
|
|
61
|
+
? ActivityLoader
|
|
62
|
+
: next(request)) satisfies DecoratorMiddlewareTypes['activity border'])
|
|
63
|
+
]);
|
|
53
64
|
|
|
54
65
|
const styles = createStyles();
|
|
55
66
|
|
|
@@ -64,26 +75,29 @@ const typingIndicatorMiddleware = Object.freeze([
|
|
|
64
75
|
args[0].visible ? <SlidingDotsTypingIndicator /> : next(...args)
|
|
65
76
|
] satisfies TypingIndicatorMiddleware[]);
|
|
66
77
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<
|
|
70
|
-
<
|
|
71
|
-
<
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<
|
|
80
|
-
<
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
78
|
+
function FluentThemeProvider({ children, variant = 'fluent' }: FluentThemeProviderProps) {
|
|
79
|
+
return (
|
|
80
|
+
<VariantComposer variant={variant}>
|
|
81
|
+
<WebChatTheme>
|
|
82
|
+
<TelephoneKeypadProvider>
|
|
83
|
+
<ThemeProvider
|
|
84
|
+
activityMiddleware={activityMiddleware}
|
|
85
|
+
sendBoxMiddleware={sendBoxMiddleware}
|
|
86
|
+
styleOptions={fluentStyleOptions}
|
|
87
|
+
styles={styles}
|
|
88
|
+
typingIndicatorMiddleware={typingIndicatorMiddleware}
|
|
89
|
+
>
|
|
90
|
+
<AssetComposer>
|
|
91
|
+
<WebChatDecorator>
|
|
92
|
+
<DecoratorComposer middleware={decoratorMiddleware}>{children}</DecoratorComposer>
|
|
93
|
+
</WebChatDecorator>
|
|
94
|
+
</AssetComposer>
|
|
95
|
+
</ThemeProvider>
|
|
96
|
+
</TelephoneKeypadProvider>
|
|
97
|
+
</WebChatTheme>
|
|
98
|
+
</VariantComposer>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
88
101
|
|
|
89
102
|
export default memo(FluentThemeProvider);
|
|
103
|
+
export { type FluentThemeProviderProps };
|