botframework-webchat-fluent-theme 4.18.1-main.20240808.851825d → 4.18.1-main.20240820.2dbeed3

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.
Files changed (34) hide show
  1. package/dist/botframework-webchat-fluent-theme.css.map +1 -1
  2. package/dist/botframework-webchat-fluent-theme.d.mts +2 -1
  3. package/dist/botframework-webchat-fluent-theme.d.ts +2 -1
  4. package/dist/botframework-webchat-fluent-theme.development.css.map +1 -1
  5. package/dist/botframework-webchat-fluent-theme.development.js +11 -1
  6. package/dist/botframework-webchat-fluent-theme.development.js.map +1 -1
  7. package/dist/botframework-webchat-fluent-theme.js +1 -1
  8. package/dist/botframework-webchat-fluent-theme.js.map +1 -1
  9. package/dist/botframework-webchat-fluent-theme.mjs +1 -1
  10. package/dist/botframework-webchat-fluent-theme.mjs.map +1 -1
  11. package/dist/botframework-webchat-fluent-theme.production.min.css.map +1 -1
  12. package/dist/botframework-webchat-fluent-theme.production.min.js +11 -1
  13. package/dist/botframework-webchat-fluent-theme.production.min.js.map +1 -1
  14. package/package.json +4 -4
  15. package/src/components/activity/ActivityDecorator.module.css +306 -0
  16. package/src/components/activity/ActivityDecorator.tsx +26 -0
  17. package/src/components/activity/CopilotMessageHeader.module.css +42 -0
  18. package/src/components/activity/CopilotMessageHeader.tsx +41 -0
  19. package/src/components/activity/index.ts +1 -0
  20. package/src/components/preChatActivity/PreChatMessageActivity.module.css +4 -2
  21. package/src/components/preChatActivity/StarterPromptsCardAction.module.css +20 -15
  22. package/src/components/preChatActivity/StarterPromptsCardAction.tsx +2 -2
  23. package/src/components/preChatActivity/isPreChatMessageActivity.ts +2 -21
  24. package/src/components/sendBox/SendBox.module.css +3 -1
  25. package/src/components/theme/Theme.module.css +293 -17
  26. package/src/components/theme/Theme.tsx +3 -2
  27. package/src/private/FluentThemeProvider.tsx +22 -13
  28. package/src/private/VariantComposer.ts +29 -0
  29. package/src/private/createComposer.tsx +16 -0
  30. package/src/private/useVariants.ts +7 -0
  31. package/src/styles/index.ts +2 -1
  32. package/src/styles/useVariantClassName.ts +16 -0
  33. package/src/components/preChatActivity/private/MonochromeImageMasker.module.css +0 -5
  34. package/src/components/preChatActivity/private/MonochromeImageMasker.tsx +0 -19
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "botframework-webchat-fluent-theme",
3
- "version": "4.18.1-main.20240808.851825d",
3
+ "version": "4.18.1-main.20240820.2dbeed3",
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",
@@ -69,9 +69,9 @@
69
69
  "typescript": "^5.4.5"
70
70
  },
71
71
  "dependencies": {
72
- "botframework-webchat-api": "4.18.1-main.20240808.851825d",
73
- "botframework-webchat-component": "4.18.1-main.20240808.851825d",
74
- "botframework-webchat-core": "4.18.1-main.20240808.851825d",
72
+ "botframework-webchat-api": "4.18.1-main.20240820.2dbeed3",
73
+ "botframework-webchat-component": "4.18.1-main.20240820.2dbeed3",
74
+ "botframework-webchat-core": "4.18.1-main.20240820.2dbeed3",
75
75
  "classnames": "2.5.1",
76
76
  "inject-meta-tag": "0.0.1",
77
77
  "math-random": "2.0.1",
@@ -0,0 +1,306 @@
1
+
2
+ :global(.webchat-fluent) .activity-decorator {
3
+ display: contents;
4
+ font-family: var(--webchat__font--primary);
5
+
6
+ --webchat__bubble--inline-padding: var(--webchat-spacingHorizontalL);
7
+ --webchat__bubble--block-padding: var(--webchat-spacingVerticalM);
8
+ --webchat__bubble--min-height: var(--webchat-bubble-minHeight);
9
+ --webchat__bubble--max-width: var(--webchat-bubble-maxWidth);
10
+
11
+ --webchat-bubble-maxWidth: var(--bubble-maxWidth, 450px);
12
+ --webchat-bubble-minHeight: var(--bubble-minHeight, 36px);
13
+ --webchat-externalLink-mask: var(--externalLink-mask, var(--webchat__icon-url--external-link) center center / 10px 10px);
14
+ --webchat-externalLink-maxWidth: var(--externalLink-maxWidth, 204px);
15
+
16
+ /* Override for stacked layout message which has user message bubble props */
17
+ &:has(:global(.webchat__stacked-layout .webchat__bubble--from-user)) {
18
+ --webchat__bubble--background-color: var(--webchat-colorBrandBackground2);
19
+ --webchat__bubble--block-padding: var(--webchat-spacingVerticalS);
20
+ }
21
+ }
22
+
23
+ /* Decorator fluent variant */
24
+ :global(.webchat-fluent) .activity-decorator.variant-fluent {
25
+ --webchat__bubble--background-color: var(--webchat-colorNeutralBackground1);
26
+ --webchat__bubble--border-radius: var(--webchat-borderRadiusXLarge);
27
+ --webchat__bubble--box-shadow: var(--webchat-shadow4);
28
+ }
29
+
30
+ /* Decorator copilot variant */
31
+ :global(.webchat-fluent) .activity-decorator.variant-copilot {
32
+ --webchat__bubble--border-radius: var(--webchat-borderRadiusXLarge);
33
+
34
+ &:not(:has(:global(.webchat__bubble--from-user))) {
35
+ --webchat__bubble--block-padding: var(--webchat-spacingVerticalS) var(--webchat-spacingVerticalXXS);
36
+ --webchat__bubble--border-radius: var(--webchat-borderRadiusSmall);
37
+ --webchat__bubble--inline-padding: 32px var(--webchat-spacingHorizontalNone);
38
+ }
39
+
40
+ &:not(:has(:global(.webchat__bubble--from-user))) :global(.webchat__stacked-layout__status) {
41
+ display: none;
42
+ }
43
+
44
+ :global(.webchat__activity-status) {
45
+ margin: 0 0 var(--webchat-spacingHorizontalXXS);
46
+ }
47
+
48
+ :global(.webchat__stacked-layout__status) {
49
+ order: -1;
50
+ }
51
+
52
+ /* TODO: remove when we get decorators in and can place header directly to the bubble */
53
+ &:not(:has(:global(.webchat__bubble--from-user))) :global(.webchat__stacked-layout .webchat__bubble .webchat__text-content) {
54
+ padding-block: calc(var(--webchat-spacingVerticalS) + 20px) var(--webchat-spacingVerticalXXS);
55
+ }
56
+
57
+ &:not(:has(:global(.webchat__bubble--from-user))) :global(.webchat__stacked-layout .webchat__bubble) {
58
+ margin-block-start: -24px;
59
+ margin-inline-start: -4px;
60
+ }
61
+ }
62
+
63
+ /* Transcript activity non-empty */
64
+ :global(.webchat-fluent) .activity-decorator :global(.webchat__basic-transcript__activity-body:not(:empty)) {
65
+ padding-block-end: var(--webchat-spacingVerticalXL);
66
+ }
67
+
68
+ /* Stacked layout */
69
+ :global(.webchat-fluent) .activity-decorator :global(.webchat__stacked-layout) {
70
+ display: flex;
71
+ flex-flow: column nowrap;
72
+ }
73
+
74
+ /* Stacked layout which has message bubble */
75
+ :global(.webchat-fluent) .activity-decorator :global(.webchat__stacked-layout .webchat__stacked-layout__content:has(.webchat__bubble)) {
76
+ overflow: visible;
77
+ }
78
+
79
+ /* Message status */
80
+ :global(.webchat-fluent) .activity-decorator :global(.webchat__stacked-layout .webchat__stacked-layout__status) {
81
+ font-size: var(--webchat__font-size--small);
82
+ line-height: var(--webchat__line-height--small);
83
+ }
84
+
85
+ /* Message bubble */
86
+ :global(.webchat-fluent) .activity-decorator :global(.webchat__stacked-layout .webchat__bubble) {
87
+ max-width: var(--webchat__bubble--max-width);
88
+ overflow: visible;
89
+ }
90
+
91
+ /* Message bubble content */
92
+ :global(.webchat-fluent) .activity-decorator :global(.webchat__stacked-layout .webchat__bubble .webchat__bubble__content) {
93
+ background-color: var(--webchat__bubble--background-color);
94
+ border-radius: var(--webchat__bubble--border-radius);
95
+ border-width: 0;
96
+ box-sizing: border-box;
97
+ color: var(--webchat-colorNeutralForeground1);
98
+ min-height: var(--webchat__bubble--min-height);
99
+ }
100
+
101
+ /* Message bubble text content */
102
+ :global(.webchat-fluent) .activity-decorator :global(.webchat__stacked-layout .webchat__bubble .webchat__text-content) {
103
+ font-size: var(--webchat__font-size--medium);
104
+ line-height: var(--webchat__line-height--medium);
105
+ min-height: auto;
106
+ padding-block: var(--webchat__bubble--block-padding);
107
+ padding-inline: var(--webchat__bubble--inline-padding);
108
+ }
109
+
110
+ /* Message bubble content pseudo */
111
+ :global(.webchat-fluent) .activity-decorator :global(.webchat__stacked-layout .webchat__bubble .webchat__bubble__content)::before {
112
+ border-radius: inherit;
113
+ box-shadow: var(--webchat__bubble--box-shadow);
114
+ content: '';
115
+ inset: 0;
116
+ isolation: isolate;
117
+ pointer-events: none;
118
+ position: absolute;
119
+ }
120
+
121
+ /* Markdown links and citation links */
122
+ :global(.webchat-fluent) .activity-decorator :global(.webchat__render-markdown) a[href]:not(:global(.webchat__render-markdown__pure-identifier)) {
123
+ color: var(--webchat-colorBrandForegroundLink);
124
+ text-decoration-color: transparent;
125
+
126
+ &:target {
127
+ color: var(--webchat-colorBrandForegroundLinkSelected);
128
+ }
129
+
130
+ &:hover {
131
+ color: var(--webchat-colorBrandForegroundLinkHover);
132
+ text-decoration: underline 1px currentColor;
133
+ }
134
+
135
+ &:active {
136
+ color: var(--webchat-colorBrandForegroundLinkPressed);
137
+ }
138
+
139
+ &:focus-visible {
140
+ outline: none;
141
+ text-decoration: underline 1px double var(--webchat-colorStrokeFocus2);
142
+ }
143
+
144
+ :global(.webchat__render-markdown__external-link-icon) {
145
+ background: currentColor;
146
+ -webkit-mask: var(--webchat__icon-url--external-link) no-repeat;
147
+ mask: var(--webchat__icon-url--external-link) no-repeat;
148
+ }
149
+ }
150
+
151
+ /* Citation inline references */
152
+ :global(.webchat-fluent) .activity-decorator :global(.webchat__render-markdown) :global(.webchat__render-markdown__citation),
153
+ :global(.webchat-fluent) .activity-decorator :global(.webchat__render-markdown) :global(.webchat__render-markdown__pure-identifier) {
154
+ align-items: center;
155
+ background-color: var(--webchat-colorNeutralBackground3);
156
+ border-radius: var(--webchat-borderRadiusMedium);
157
+ border: var(--webchat-strokeWidthThin) solid var(--webchat-colorNeutralStroke2);
158
+ box-sizing: border-box;
159
+ color: var(--webchat-colorNeutralForeground2);
160
+ display: inline-flex;
161
+ font-size: var(--webchat-fontSizeBase100);
162
+ font-weight: var(--webchat-fontWeightSemibold);
163
+ height: 14px;
164
+ justify-content: center;
165
+ line-height: var(--webchat-lineHeightBase100);
166
+ margin-left: var(--webchat-spacingHorizontalXXS);
167
+ margin-right: var(--webchat-spacingHorizontalXXS);
168
+ min-width: 14px;
169
+ text-decoration: none;
170
+ transition: all var(--webchat-durationNormal) var(--webchat-curveDecelerateMid);
171
+ vertical-align: calc((var(--webchat-lineHeightBase100) - var(--webchat-fontSizeBase100)) / 2);
172
+
173
+ &:hover {
174
+ background-color: var(--webchat-colorBrandBackground2Hover);
175
+ border-color: var(--webchat-colorBrandStroke2Hover);
176
+ color: var(--webchat-colorBrandForeground2Hover);
177
+ cursor: pointer;
178
+ }
179
+
180
+ &:hover:active {
181
+ background-color: var(--webchat-colorBrandBackground2Pressed);
182
+ border-color: var(--webchat-colorBrandStroke2Pressed);
183
+ color: var(--webchat-colorBrandForeground2Pressed);
184
+ }
185
+
186
+ &::before, &::after {
187
+ all: unset;
188
+ }
189
+
190
+ &:has(:global(.webchat__render-markdown__external-link-icon)) {
191
+ padding-inline: 3px;
192
+ }
193
+
194
+ :global(.webchat__render-markdown__external-link-icon) {
195
+ background: currentColor;
196
+ height: 0.7em;
197
+ -webkit-mask: var(--webchat__icon-url--external-link) no-repeat;
198
+ mask: var(--webchat__icon-url--external-link) no-repeat;
199
+ }
200
+ }
201
+
202
+ /* Citation summary chevron */
203
+ :global(.webchat-fluent) .activity-decorator :global(.webchat__link-definitions__header) {
204
+ :global(.webchat__link-definitions__header-text) {
205
+ color: var(--webchat-colorNeutralForeground3);
206
+ }
207
+
208
+ :global(.webchat__link-definitions__header-chevron) {
209
+ fill: var(--webchat-colorNeutralForeground3);
210
+ font-size: var(--webchat__font-size--small);
211
+ width: 1em;
212
+ }
213
+ }
214
+
215
+ /* Citation link definitions */
216
+ :global(.webchat-fluent) .activity-decorator :global(.webchat__link-definitions) {
217
+ --webchat__citation__external-link--mask: var(--webchat-externalLink-mask);
218
+ --webchat__citation__link--max-width: var(--webchat-externalLink-maxWidth);
219
+
220
+ :global(.webchat__link-definitions__list) {
221
+ color: var(--webchat__color--subtle);
222
+ display: flex;
223
+ flex-flow: row wrap;
224
+ gap: var(--webchat-spacingHorizontalS);
225
+ }
226
+
227
+ :global(.webchat__link-definitions__list-item) {
228
+ border-radius: var(--webchat-borderRadiusMedium);
229
+ max-width: var(--webchat__citation__link--max-width);
230
+ }
231
+
232
+ :global(.webchat__link-definitions__list-item-box) {
233
+ background-color: var(--webchat-colorNeutralBackground3);
234
+ border-radius: var(--webchat-borderRadiusMedium);
235
+ border: var(--webchat-strokeWidthThin) solid var(--webchat-colorNeutralStroke2);
236
+ box-sizing: border-box;
237
+ color: currentColor;
238
+ display: inline-flex;
239
+ font-size: var(--webchat__font-size--small);
240
+ height: 24px;
241
+ padding-inline-end: var(--webchat-spacingHorizontalS);
242
+ }
243
+
244
+ :global(.webchat__link-definitions__list-item-body) {
245
+ font-family: inherit;
246
+ gap: var(--webchat-spacingHorizontalSNudge);
247
+ min-width: 0;
248
+ padding: 0;
249
+ }
250
+
251
+ :global(.webchat__link-definitions__badge) {
252
+ align-self: center;
253
+ background-color: transparent;
254
+ border-radius: 0;
255
+ border: none;
256
+ color: currentColor;
257
+ font-size: var(--webchat-fontSizeBase100);
258
+ font-weight: var(--webchat-fontWeightSemibold);
259
+ line-height: var(--webchat-lineHeightBase100);
260
+ margin: 0;
261
+ min-width: 20px;
262
+ padding: 0;
263
+ position: relative;
264
+ text-align: center;
265
+ }
266
+
267
+ :global(.webchat__link-definitions__badge)::after {
268
+ border-right: var(--webchat-strokeWidthThin) solid var(--webchat-colorNeutralStroke2);
269
+ bottom: 0;
270
+ content: '';
271
+ display: block;
272
+ height: 16px;
273
+ position: absolute;
274
+ right: 0;
275
+ top: 0;
276
+ width: 0;
277
+ }
278
+
279
+ :global(.webchat__link-definitions__list-item-main-text) {
280
+ gap: var(--webchat-spacingHorizontalXS);
281
+ }
282
+
283
+ :global(.webchat__link-definitions__list-item-text) {
284
+ color: currentColor;
285
+ text-decoration: none;
286
+ text-overflow: ellipsis;
287
+ }
288
+
289
+ :global(.webchat__link-definitions__list-item-main-text):has(:global(.webchat__link-definitions__open-in-new-window-icon))::before {
290
+ align-self: center;
291
+ background: currentColor;
292
+ color: currentColor;
293
+ content: '';
294
+ flex: none;
295
+ font-size: var(--webchat-fontSizeBase400);
296
+ height: 1em;
297
+ -webkit-mask: var(--webchat__citation__external-link--mask) no-repeat;
298
+ mask: var(--webchat__citation__external-link--mask) no-repeat;
299
+ padding: 0;
300
+ width: 1em;
301
+ }
302
+
303
+ :global(.webchat__link-definitions__open-in-new-window-icon) {
304
+ display: none;
305
+ }
306
+ }
@@ -0,0 +1,26 @@
1
+ import { WebChatActivity } from 'botframework-webchat-component';
2
+ import cx from 'classnames';
3
+ import React, { ReactNode, memo } from 'react';
4
+ import useVariants from '../../private/useVariants';
5
+ import { useStyles, useVariantClassName } from '../../styles';
6
+ import styles from './ActivityDecorator.module.css';
7
+ import CopilotMessageHeader from './CopilotMessageHeader';
8
+
9
+ function ActivityDecorator({ activity, children }: Readonly<{ activity: WebChatActivity; children: ReactNode }>) {
10
+ const classNames = useStyles(styles);
11
+ const variants = useVariants();
12
+ const variantClassName = useVariantClassName(styles);
13
+
14
+ const shouldRenderHeader = variants.includes('copilot') && activity?.from?.role !== 'user' && !!children;
15
+
16
+ return (
17
+ <div className={cx(classNames['activity-decorator'], variantClassName)}>
18
+ {shouldRenderHeader && <CopilotMessageHeader activity={activity} />}
19
+ {children}
20
+ </div>
21
+ );
22
+ }
23
+
24
+ ActivityDecorator.displayName = 'ActivityDecorator';
25
+
26
+ export default memo(ActivityDecorator);
@@ -0,0 +1,42 @@
1
+
2
+ :global(.webchat-fluent) .copilot-message-header {
3
+ align-items: center;
4
+ cursor: default;
5
+ display: flex;
6
+ flex-wrap: nowrap;
7
+ gap: var(--webchat-spacingHorizontalS);
8
+ margin-inline-start: var(--webchat-spacingVerticalMNudge);
9
+ padding-block-start: var(--webchat-spacingVerticalXS);
10
+ /* TODO: remove when moved to the bubble */
11
+ position: relative;
12
+ z-index: 1;
13
+ }
14
+
15
+ :global(.webchat-fluent) .copilot-message-header__avatar {
16
+ aspect-ratio: 1;
17
+ background-color: var(--background-color);
18
+ border-radius: var(--webchat-borderRadiusSmall);
19
+ width: 20px;
20
+ }
21
+
22
+ :global(.webchat-fluent) .copilot-message-header__title {
23
+ font-size: var(--webchat-fontSizeBase300);
24
+ font-weight: var(--webchat-fontWeightSemibold);
25
+ line-height: var(--webchat-lineHeightBase300);
26
+ max-width: 240px;
27
+ overflow: hidden;
28
+ text-overflow: ellipsis;
29
+ text-wrap: nowrap;
30
+ }
31
+
32
+ :global(.webchat-fluent) .copilot-message-header__ai-generated-content {
33
+ align-items: center;
34
+ background-color: var(--webchat-colorNeutralBackground5);
35
+ border-radius: var(--webchat-borderRadiusMedium);
36
+ color: var(--webchat-colorNeutralForeground3);
37
+ display: flex;
38
+ font-size: var(--webchat-fontSizeBase100);
39
+ height: 20px;
40
+ line-height: var(--webchat-lineHeightBase100);
41
+ padding-inline: 4px;
42
+ }
@@ -0,0 +1,41 @@
1
+ import { WebChatActivity, hooks } from 'botframework-webchat-component';
2
+ import React, { memo, useMemo, type CSSProperties } from 'react';
3
+ import { useStyles } from '../../styles';
4
+ import styles from './CopilotMessageHeader.module.css';
5
+
6
+ const { useStyleOptions, useLocalizer } = hooks;
7
+
8
+ function CopilotMessageHeader({ activity }: Readonly<{ activity?: WebChatActivity | undefined }>) {
9
+ const [{ botAvatarImage, botAvatarBackgroundColor }] = useStyleOptions();
10
+ const classNames = useStyles(styles);
11
+ const localize = useLocalizer();
12
+ // TODO: how we determine the activity has ai-generated content
13
+ const isAIGenerated = useMemo(() => !!activity, [activity]);
14
+ const botTitle = activity?.from?.name;
15
+
16
+ const avatarStyle = useMemo(
17
+ () => ({ '--background-color': botAvatarBackgroundColor }) as CSSProperties,
18
+ [botAvatarBackgroundColor]
19
+ );
20
+
21
+ return (
22
+ <div className={classNames['copilot-message-header']}>
23
+ <img
24
+ alt={localize('AVATAR_ALT', botTitle)}
25
+ className={classNames['copilot-message-header__avatar']}
26
+ src={botAvatarImage}
27
+ style={avatarStyle}
28
+ />
29
+ <span className={classNames['copilot-message-header__title']} title={botTitle}>
30
+ {botTitle}
31
+ </span>
32
+ {isAIGenerated && (
33
+ <span className={classNames['copilot-message-header__ai-generated-content']}>
34
+ {localize('ACTIVITY_CONTENT_CAUTION')}
35
+ </span>
36
+ )}
37
+ </div>
38
+ );
39
+ }
40
+
41
+ export default memo(CopilotMessageHeader);
@@ -0,0 +1 @@
1
+ export { default as ActivityDecorator } from './ActivityDecorator';
@@ -1,9 +1,11 @@
1
1
  :global(.webchat-fluent) .pre-chat-message-activity {
2
+ box-sizing: border-box;
2
3
  display: grid;
4
+ gap: var(--webchat-spacingHorizontalXXXL);
3
5
  grid-template-areas: 'body' 'toolbar';
4
6
  grid-template-rows: auto auto;
5
- gap: var(--webchat-spacingHorizontalXXXL);
6
- padding: var(--webchat-spacingHorizontalXXXL);
7
+ padding: var(--webchat-spacingHorizontalXXXL) var(--webchat-spacingHorizontalM);
8
+ position: relative;
7
9
  }
8
10
 
9
11
  :global(.webchat-fluent) .pre-chat-message-activity__body {
@@ -8,30 +8,35 @@
8
8
  cursor: pointer;
9
9
  display: grid;
10
10
  gap: 8px;
11
- grid-template-areas: 'image title' 'image subtitle';
12
- grid-template-columns: 20px 1fr;
11
+ grid-template-areas: 'title' 'subtitle';
12
+ grid-template-columns: 1fr;
13
13
  grid-template-rows: auto 1fr;
14
14
  overflow: hidden;
15
15
  padding: 16px 20px;
16
16
  text-align: left;
17
17
  user-select: none;
18
- }
19
18
 
20
- :global(.webchat-fluent) .pre-chat-message-activity__card-action-box:disabled {
21
- background-color: var(--webchat-colorNeutralBackground1Disabled);
22
- }
19
+ &:has(.pre-chat-message-activity__card-action-image) {
20
+ grid-template-areas: 'image title' 'image subtitle';
21
+ grid-template-columns: 20px 1fr;
22
+ }
23
23
 
24
- :global(.webchat-fluent) .pre-chat-message-activity__card-action-box:hover {
25
- background-color: var(--webchat-colorNeutralGrey94);
26
- }
24
+ &:disabled {
25
+ background-color: var(--webchat-colorNeutralBackgroundDisabled);
26
+ }
27
27
 
28
- :global(.webchat-fluent) .pre-chat-message-activity__card-action-box:active {
29
- background-color: var(--webchat-colorNeutralBackground1Pressed);
30
- }
28
+ &:hover {
29
+ background-color: var(--webchat-colorNeutralBackground1Hover);
30
+ }
31
+
32
+ &:active {
33
+ background-color: var(--webchat-colorNeutralBackground1Pressed);
34
+ }
31
35
 
32
- :global(.webchat-fluent) .pre-chat-message-activity__card-action-box:focus-visible {
33
- outline: solid 2px var(--webchat-colorStrokeFocus2);
34
- outline-offset: -2px;
36
+ &:focus-visible {
37
+ outline: solid 2px var(--webchat-colorStrokeFocus2);
38
+ outline-offset: -2px;
39
+ }
35
40
  }
36
41
 
37
42
  :global(.webchat-fluent) .pre-chat-message-activity__card-action-image {
@@ -1,14 +1,14 @@
1
- import { hooks } from 'botframework-webchat-component';
1
+ import { Components, hooks } from 'botframework-webchat-component';
2
2
  import { type DirectLineCardAction } from 'botframework-webchat-core';
3
3
  import cx from 'classnames';
4
4
  import React, { memo, useCallback, useMemo } from 'react';
5
5
  import { useRefFrom } from 'use-ref-from';
6
6
  import { useStyles } from '../../styles/index.js';
7
7
  import testIds from '../../testIds.js';
8
- import MonochromeImageMasker from './private/MonochromeImageMasker.js';
9
8
  import styles from './StarterPromptsCardAction.module.css';
10
9
 
11
10
  const { useFocus, useRenderMarkdownAsHTML, useSendBoxValue } = hooks;
11
+ const { MonochromeImageMasker } = Components;
12
12
 
13
13
  type Props = Readonly<{
14
14
  className?: string | undefined;
@@ -1,26 +1,7 @@
1
- import type { WebChatActivity } from 'botframework-webchat-core';
2
- import { array, literal, object, safeParse, string, type InferOutput } from 'valibot';
3
-
4
- const messageEntity = object({
5
- '@context': literal('https://schema.org'),
6
- '@id': literal(''), // Must be empty string.
7
- '@type': literal('Message'),
8
- keywords: array(string()),
9
- type: literal('https://schema.org/Message')
10
- });
11
-
12
- type MessageEntity = InferOutput<typeof messageEntity>;
1
+ import { getOrgSchemaMessage, type WebChatActivity } from 'botframework-webchat-core';
13
2
 
14
3
  export default function isPreChatMessageActivity(
15
4
  activity: undefined | WebChatActivity
16
5
  ): activity is WebChatActivity & { type: 'message' } {
17
- if (activity?.type !== 'message') {
18
- return false;
19
- }
20
-
21
- const message = activity.entities?.find(
22
- (entity): entity is MessageEntity => safeParse(messageEntity, entity).success
23
- );
24
-
25
- return !!message?.keywords.includes('PreChatMessage');
6
+ return !!(activity && getOrgSchemaMessage(activity?.entities || [])?.keywords?.includes('PreChatMessage'));
26
7
  }
@@ -1,7 +1,9 @@
1
1
  :global(.webchat-fluent) .sendbox {
2
+ --webchat__sendbox--padding: var(--webchat__padding--sendbox);
3
+
2
4
  color: var(--webchat-colorNeutralForeground1);
3
5
  font-family: var(--webchat-fontFamilyBase);
4
- padding: 0 10px 10px;
6
+ padding: var(--webchat__sendbox--padding);
5
7
  text-rendering: optimizeLegibility;
6
8
 
7
9
  --webchat-sendbox-attachment-area-active: ;