botframework-webchat-fluent-theme 4.18.1-main.20250505.488ce72 → 4.18.1-main.20250505.5e12798
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 +4 -5
- package/dist/botframework-webchat-fluent-theme.d.ts +4 -5
- package/dist/botframework-webchat-fluent-theme.development.js +4 -4
- 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 +4 -4
- package/dist/botframework-webchat-fluent-theme.production.min.js.map +1 -1
- package/package.json +6 -6
- package/src/private/FluentThemeProvider.tsx +27 -41
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "botframework-webchat-fluent-theme",
|
|
3
|
-
"version": "4.18.1-main.20250505.
|
|
3
|
+
"version": "4.18.1-main.20250505.5e12798",
|
|
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",
|
|
@@ -72,15 +72,15 @@
|
|
|
72
72
|
"@types/math-random": "^1.0.2",
|
|
73
73
|
"@types/node": "^22.13.4",
|
|
74
74
|
"@types/react": "^16.14.62",
|
|
75
|
-
"botframework-webchat-base": "4.18.1-main.20250505.
|
|
76
|
-
"botframework-webchat-styles": "4.18.1-main.20250505.
|
|
75
|
+
"botframework-webchat-base": "4.18.1-main.20250505.5e12798",
|
|
76
|
+
"botframework-webchat-styles": "4.18.1-main.20250505.5e12798",
|
|
77
77
|
"tsup": "^8.3.6",
|
|
78
78
|
"typescript": "^5.7.3"
|
|
79
79
|
},
|
|
80
80
|
"dependencies": {
|
|
81
|
-
"botframework-webchat-api": "4.18.1-main.20250505.
|
|
82
|
-
"botframework-webchat-component": "4.18.1-main.20250505.
|
|
83
|
-
"botframework-webchat-core": "4.18.1-main.20250505.
|
|
81
|
+
"botframework-webchat-api": "4.18.1-main.20250505.5e12798",
|
|
82
|
+
"botframework-webchat-component": "4.18.1-main.20250505.5e12798",
|
|
83
|
+
"botframework-webchat-core": "4.18.1-main.20250505.5e12798",
|
|
84
84
|
"classnames": "2.5.1",
|
|
85
85
|
"inject-meta-tag": "0.0.1",
|
|
86
86
|
"math-random": "2.0.1",
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { type ActivityMiddleware, type StyleOptions, type TypingIndicatorMiddleware } from 'botframework-webchat-api';
|
|
2
|
-
import {
|
|
3
|
-
DecoratorComposer,
|
|
4
|
-
DecoratorMiddleware,
|
|
5
|
-
type DecoratorMiddlewareInit,
|
|
6
|
-
type DecoratorMiddlewareTypes
|
|
7
|
-
} from 'botframework-webchat-api/decorator';
|
|
2
|
+
import { DecoratorComposer, DecoratorMiddleware } from 'botframework-webchat-api/decorator';
|
|
8
3
|
import { Components } from 'botframework-webchat-component';
|
|
9
4
|
import { WebChatDecorator } from 'botframework-webchat-component/decorator';
|
|
10
5
|
import React, { memo, type ReactNode } from 'react';
|
|
@@ -23,10 +18,7 @@ import VariantComposer, { VariantList } from './VariantComposer';
|
|
|
23
18
|
|
|
24
19
|
const { ThemeProvider } = Components;
|
|
25
20
|
|
|
26
|
-
type
|
|
27
|
-
children?: ReactNode | undefined;
|
|
28
|
-
variant?: VariantList | undefined;
|
|
29
|
-
}>;
|
|
21
|
+
type Props = Readonly<{ children?: ReactNode | undefined; variant?: VariantList | undefined }>;
|
|
30
22
|
|
|
31
23
|
const activityMiddleware: readonly ActivityMiddleware[] = Object.freeze([
|
|
32
24
|
() =>
|
|
@@ -53,14 +45,11 @@ const activityMiddleware: readonly ActivityMiddleware[] = Object.freeze([
|
|
|
53
45
|
|
|
54
46
|
const sendBoxMiddleware = [() => () => () => PrimarySendBox];
|
|
55
47
|
|
|
56
|
-
const decoratorMiddleware:
|
|
57
|
-
|
|
48
|
+
const decoratorMiddleware: DecoratorMiddleware[] = [
|
|
49
|
+
init =>
|
|
58
50
|
init === 'activity border' &&
|
|
59
|
-
(
|
|
60
|
-
|
|
61
|
-
? ActivityLoader
|
|
62
|
-
: next(request)) satisfies DecoratorMiddlewareTypes['activity border'])
|
|
63
|
-
]);
|
|
51
|
+
(next => request => (request.livestreamingState === 'preparing' ? ActivityLoader : next(request)))
|
|
52
|
+
];
|
|
64
53
|
|
|
65
54
|
const styles = createStyles();
|
|
66
55
|
|
|
@@ -75,29 +64,26 @@ const typingIndicatorMiddleware = Object.freeze([
|
|
|
75
64
|
args[0].visible ? <SlidingDotsTypingIndicator /> : next(...args)
|
|
76
65
|
] satisfies TypingIndicatorMiddleware[]);
|
|
77
66
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
<
|
|
81
|
-
<
|
|
82
|
-
<
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
>
|
|
90
|
-
<
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
);
|
|
100
|
-
}
|
|
67
|
+
const FluentThemeProvider = ({ children, variant = 'fluent' }: Props) => (
|
|
68
|
+
<VariantComposer variant={variant}>
|
|
69
|
+
<WebChatTheme>
|
|
70
|
+
<TelephoneKeypadProvider>
|
|
71
|
+
<ThemeProvider
|
|
72
|
+
activityMiddleware={activityMiddleware}
|
|
73
|
+
sendBoxMiddleware={sendBoxMiddleware}
|
|
74
|
+
styleOptions={fluentStyleOptions}
|
|
75
|
+
styles={styles}
|
|
76
|
+
typingIndicatorMiddleware={typingIndicatorMiddleware}
|
|
77
|
+
>
|
|
78
|
+
<AssetComposer>
|
|
79
|
+
<WebChatDecorator>
|
|
80
|
+
<DecoratorComposer middleware={decoratorMiddleware}>{children}</DecoratorComposer>
|
|
81
|
+
</WebChatDecorator>
|
|
82
|
+
</AssetComposer>
|
|
83
|
+
</ThemeProvider>
|
|
84
|
+
</TelephoneKeypadProvider>
|
|
85
|
+
</WebChatTheme>
|
|
86
|
+
</VariantComposer>
|
|
87
|
+
);
|
|
101
88
|
|
|
102
89
|
export default memo(FluentThemeProvider);
|
|
103
|
-
export { type FluentThemeProviderProps };
|