botframework-webchat-fluent-theme 4.18.1-main.20250505.5e12798 → 4.18.1-main.20250515.4c7400a
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.d.mts +5 -4
- package/dist/botframework-webchat-fluent-theme.d.ts +5 -4
- 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.mjs +1 -1
- package/dist/botframework-webchat-fluent-theme.mjs.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/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.20250515.4c7400a",
|
|
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.20250515.4c7400a",
|
|
72
|
+
"botframework-webchat-styles": "4.18.1-main.20250515.4c7400a",
|
|
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.20250515.4c7400a",
|
|
78
|
+
"botframework-webchat-component": "4.18.1-main.20250515.4c7400a",
|
|
79
|
+
"botframework-webchat-core": "4.18.1-main.20250515.4c7400a",
|
|
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,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 };
|