botframework-webchat-fluent-theme 4.18.1-main.20250803.6044b59 → 4.18.1-main.20250912.cbaf98f
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 +6 -5
- package/dist/botframework-webchat-fluent-theme.d.ts +6 -5
- 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 +8 -7
- package/src/buildInfo.ts +9 -0
- package/src/components/activity/ActivityDecorator.module.css +0 -237
- package/src/components/activity/ActivityDecorator.tsx +17 -12
- package/src/components/activity/ActivityLoader.module.css +1 -1
- package/src/components/activity/ActivityLoader.tsx +19 -6
- package/src/components/activity/CopilotMessageHeader.tsx +22 -7
- package/src/components/activity/PartGroupingDecorator.module.css +480 -0
- package/src/components/activity/PartGroupingDecorator.tsx +69 -0
- package/src/components/assets/AssetComposer.tsx +2 -0
- package/src/components/theme/Theme.module.css +85 -41
- package/src/env.d.ts +10 -0
- package/src/external.umd/botframework-webchat-api/decorator.ts +2 -0
- package/src/external.umd/botframework-webchat-api/index.ts +2 -0
- package/src/external.umd/botframework-webchat-component/decorator.ts +2 -0
- package/src/external.umd/botframework-webchat-component/internal.ts +2 -0
- package/src/external.umd/react.ts +2 -0
- package/src/index.ts +6 -11
- package/src/private/FluentThemeProvider.tsx +9 -1
- package/src/tsconfig.json +8 -12
|
@@ -0,0 +1,480 @@
|
|
|
1
|
+
:global(.webchat-fluent) .part-grouping-decorator {
|
|
2
|
+
font-family: var(--webchat-fontFamilyBase);
|
|
3
|
+
min-width: 0;
|
|
4
|
+
|
|
5
|
+
--webchat__bubble--inline-padding: var(--webchat-spacingHorizontalL);
|
|
6
|
+
--webchat__bubble--block-padding: var(--webchat-spacingVerticalM);
|
|
7
|
+
--webchat__bubble--min-height: var(--webchat-bubble-minHeight);
|
|
8
|
+
--webchat__bubble--max-width: var(--webchat-bubble-maxWidth);
|
|
9
|
+
--webchat__bubble--min-width: var(--webchat-bubble-minWidth);
|
|
10
|
+
|
|
11
|
+
--webchat__bubble--border-radius: var(--webchat-borderRadiusXLarge);
|
|
12
|
+
|
|
13
|
+
--webchat-bubble-maxWidth: var(--bubble-maxWidth, max(450px, 75%));
|
|
14
|
+
--webchat-bubble-minWidth: var(--bubble-minWidth, auto);
|
|
15
|
+
--webchat-bubble-minHeight: var(--bubble-minHeight, 36px);
|
|
16
|
+
--webchat-externalLink-mask: var(
|
|
17
|
+
--externalLink-mask,
|
|
18
|
+
var(--webchat__icon-url--external-link) center center /
|
|
19
|
+
10px 10px
|
|
20
|
+
);
|
|
21
|
+
--webchat-externalLink-maxWidth: var(--externalLink-maxWidth, 204px);
|
|
22
|
+
|
|
23
|
+
/* User bubble property overrides */
|
|
24
|
+
&.part-grouping-decorator--from-user {
|
|
25
|
+
--webchat__bubble--background-color: var(--webchat-colorBrandBackground2);
|
|
26
|
+
--webchat__bubble--block-padding: var(--webchat-spacingVerticalS);
|
|
27
|
+
--webchat__bubble--min-width: auto;
|
|
28
|
+
}
|
|
29
|
+
&.part-grouping-decorator--from-bot {
|
|
30
|
+
--webchat__bubble--background-color: var(--webchat-colorNeutralBackground1);
|
|
31
|
+
--webchat__bubble--block-padding: var(--webchat-spacingVerticalM);
|
|
32
|
+
--webchat__bubble--min-width: var(--webchat-bubble-minWidth);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/* Variant property overrides */
|
|
36
|
+
&.variant-fluent {
|
|
37
|
+
--webchat__bubble--box-shadow: var(--webchat-shadow4);
|
|
38
|
+
}
|
|
39
|
+
&.variant-fluent.part-grouping-decorator--group {
|
|
40
|
+
--webchat__bubble--min-height: 20px;
|
|
41
|
+
}
|
|
42
|
+
&.variant-copilot.part-grouping-decorator--from-bot {
|
|
43
|
+
--webchat__bubble--background-color: transparent;
|
|
44
|
+
--webchat__bubble--border-radius: var(--webchat-borderRadius2XLarge);
|
|
45
|
+
--webchat__bubble--block-padding: 0;
|
|
46
|
+
--webchat__bubble--inline-padding: 0;
|
|
47
|
+
--webchat__bubble--max-width: 100%;
|
|
48
|
+
--webchat__bubble--min-height: 20px;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/* Part grouping decorator */
|
|
53
|
+
:global(.webchat-fluent) .part-grouping-decorator {
|
|
54
|
+
/* Part grouping decorator header */
|
|
55
|
+
.part-grouping-decorator__header {
|
|
56
|
+
padding-block: var(--webchat-spacingVerticalS);
|
|
57
|
+
}
|
|
58
|
+
/* Hide duplicate bot headers */
|
|
59
|
+
&.part-grouping-decorator--from-bot:has(.part-grouping-decorator__header) + .part-grouping-decorator--from-bot:has(.part-grouping-decorator__header) .part-grouping-decorator__header {
|
|
60
|
+
display: none;
|
|
61
|
+
}
|
|
62
|
+
/* #region Collapsible grouping */
|
|
63
|
+
:global(.stacked-layout .collapsible-grouping__header) {
|
|
64
|
+
justify-content: flex-start;
|
|
65
|
+
min-width: 0;
|
|
66
|
+
padding: var(--webchat-spacingVerticalNone) var(--webchat-spacingHorizontalNone);
|
|
67
|
+
place-self: start;
|
|
68
|
+
position: relative;
|
|
69
|
+
|
|
70
|
+
:global(.webchat__activity-button) {
|
|
71
|
+
background: transparent;
|
|
72
|
+
border: none;
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
font-size: var(--webchat-fontSizeBase300);
|
|
75
|
+
padding: var(--webchat-spacingVerticalXXS) var(--webchat-spacingHorizontalXS);
|
|
76
|
+
|
|
77
|
+
&::after {
|
|
78
|
+
content: '';
|
|
79
|
+
cursor: pointer;
|
|
80
|
+
display: block;
|
|
81
|
+
inset: 0;
|
|
82
|
+
position: absolute;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:global(.webchat__activity-button__text) {
|
|
87
|
+
font-size: 0;
|
|
88
|
+
height: 0;
|
|
89
|
+
overflow: clip;
|
|
90
|
+
position: absolute;
|
|
91
|
+
width: 0;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
:global(.stacked-layout .collapsible-grouping__content .part-grouping-activity__activities) {
|
|
96
|
+
gap: var(--webchat-spacingVerticalS);
|
|
97
|
+
padding: var(--webchat-spacingVerticalL) var(--webchat-spacingHorizontalL);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
:global(.stacked-layout .collapsible-grouping) {
|
|
101
|
+
display: grid;
|
|
102
|
+
|
|
103
|
+
&:global(.collapsible-grouping--open) {
|
|
104
|
+
gap: var(--webchat-spacingVerticalM);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
:global(.collapsible-grouping__content .stacked-layout .stacked-layout__title),
|
|
109
|
+
:global(.collapsible-grouping__title) {
|
|
110
|
+
color: var(--webchat-colorNeutralForeground2);
|
|
111
|
+
font-size: var(--webchat-fontSizeBase300);
|
|
112
|
+
font-weight: var(--webchat-fontWeightSemibold);
|
|
113
|
+
line-height: var(--webchat-lineHeightBase300);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
:global(.collapsible-grouping) {
|
|
117
|
+
border: none;
|
|
118
|
+
max-width: 100%;
|
|
119
|
+
|
|
120
|
+
:global(.collapsible-grouping__header) {
|
|
121
|
+
border: none;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
:global(.stacked-layout__message-status) {
|
|
125
|
+
color: var(--webchat-colorNeutralForeground2);
|
|
126
|
+
font-size: var(--webchat-fontSizeBase400);
|
|
127
|
+
margin-block: var(--webchat__bubble--block-padding);
|
|
128
|
+
margin-inline-start: var(--webchat__bubble--block-padding);
|
|
129
|
+
|
|
130
|
+
:global(.component-icon) {
|
|
131
|
+
height: 19px;
|
|
132
|
+
width: 19px;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
:global(.stacked-layout .activity-loader) {
|
|
137
|
+
display: none;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
:global(.activity-decorator .webchat__bubble .webchat__bubble__content) {
|
|
141
|
+
box-sizing: content-box;
|
|
142
|
+
gap: var(--webchat-spacingVerticalXS);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/* #endregion */
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/* Part grouping decorator overrides */
|
|
149
|
+
:global(.webchat-fluent) .part-grouping-decorator {
|
|
150
|
+
/* Stacked layout */
|
|
151
|
+
:global(.stacked-layout) {
|
|
152
|
+
display: flex;
|
|
153
|
+
flex-flow: column nowrap;
|
|
154
|
+
margin-inline: var(--webchat-spacingHorizontalMNudge);
|
|
155
|
+
|
|
156
|
+
:global(.stacked-layout) {
|
|
157
|
+
margin-inline: var(--webchat-spacingHorizontalNone);
|
|
158
|
+
position: static;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
:global(.stacked-layout__main .stacked-layout__title) {
|
|
162
|
+
color: var(--webchat-colorNeutralForeground4);
|
|
163
|
+
font-size: var(--webchat-fontSizeBase400);
|
|
164
|
+
line-height: var(--webchat-lineHeightBase400);
|
|
165
|
+
margin: var(--webchat__bubble--block-padding) var(--webchat__bubble--inline-padding);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
:global(.stacked-layout__attachment-row) {
|
|
169
|
+
margin-block-start: var(--webchat-spacingVerticalMNudge);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
&:global(.stacked-layout--no-message .stacked-layout__attachment-row) {
|
|
173
|
+
margin-block-start: 0;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
&.part-grouping-decorator--group :global(.stacked-layout .stacked-layout__main .stacked-layout__title),
|
|
178
|
+
&.part-grouping-decorator--group :global(.stacked-layout .stacked-layout__main .collapsible-content__summary) {
|
|
179
|
+
margin: var(--webchat-spacingVerticalXS) var(--webchat__bubble--inline-padding);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
&.part-grouping-decorator--group :global(.stacked-layout .stacked-layout__main .stacked-layout__message-status) {
|
|
183
|
+
margin-block: var(--webchat-spacingVerticalXS);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/* Stacked layout which has message bubble */
|
|
187
|
+
:global(.stacked-layout .stacked-layout__content:has(.webchat__bubble)) {
|
|
188
|
+
max-width: 100%;
|
|
189
|
+
overflow: visible;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/* Message status */
|
|
193
|
+
:global(.stacked-layout .stacked-layout__status) {
|
|
194
|
+
font-size: var(--webchat__font-size--small);
|
|
195
|
+
line-height: var(--webchat__line-height--small);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/* Message bubble */
|
|
199
|
+
:global(.stacked-layout .webchat__bubble) {
|
|
200
|
+
max-width: min(var(--webchat__bubble--max-width), 100%);
|
|
201
|
+
min-width: var(--webchat__bubble--min-width);
|
|
202
|
+
overflow: visible;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
/* Ensure activity loader doesn't have bubble and shadow */
|
|
206
|
+
:global(.stacked-layout .webchat__bubble):has(:global(.activity-loader)) :global(.webchat__bubble__content) {
|
|
207
|
+
background: unset;
|
|
208
|
+
box-shadow: unset;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
/* Message bubble content */
|
|
213
|
+
:global(.stacked-layout .webchat__bubble .webchat__bubble__content) {
|
|
214
|
+
background-color: var(--webchat__bubble--background-color);
|
|
215
|
+
border-radius: var(--webchat__bubble--border-radius);
|
|
216
|
+
border-width: 0;
|
|
217
|
+
box-shadow: var(--webchat__bubble--box-shadow);
|
|
218
|
+
box-sizing: border-box;
|
|
219
|
+
color: var(--webchat-colorNeutralForeground1);
|
|
220
|
+
max-width: 100%;
|
|
221
|
+
min-height: var(--webchat__bubble--min-height);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* Message bubble content in group */
|
|
225
|
+
&.part-grouping-decorator--group :global(.stacked-layout .webchat__bubble .webchat__bubble__content) {
|
|
226
|
+
background-color: unset;
|
|
227
|
+
box-shadow: unset;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/* Message bubble text content */
|
|
231
|
+
:global(.stacked-layout .webchat__bubble .webchat__text-content) {
|
|
232
|
+
font-size: var(--webchat__font-size--medium);
|
|
233
|
+
line-height: var(--webchat__line-height--medium);
|
|
234
|
+
min-height: auto;
|
|
235
|
+
padding-block: var(--webchat__bubble--block-padding);
|
|
236
|
+
padding-inline: var(--webchat__bubble--inline-padding);
|
|
237
|
+
|
|
238
|
+
&:empty {
|
|
239
|
+
padding-block-end: 0;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
+ :global(.webchat__text-content) {
|
|
243
|
+
margin-top: calc(var(--webchat__bubble--block-padding) * -1);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
&.part-grouping-decorator--group :global(.stacked-layout .webchat__bubble .webchat__text-content) {
|
|
248
|
+
padding-block: var(--webchat-spacingVerticalXS);
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* Message bubble code block content */
|
|
253
|
+
:global(.webchat-fluent) .part-grouping-decorator {
|
|
254
|
+
:global(.stacked-layout .webchat__bubble .code-block-content) {
|
|
255
|
+
border-radius: var(--webchat-borderRadiusXLarge);
|
|
256
|
+
border: var(--webchat-strokeWidthThin) solid var(--webchat-colorNeutralStroke1);
|
|
257
|
+
font-size: var(--webchat-fontSizeBase300);
|
|
258
|
+
font-weight: var(--webchat-fontWeightRegular);
|
|
259
|
+
margin-block: 0;
|
|
260
|
+
margin-inline: var(--webchat__bubble--inline-padding);
|
|
261
|
+
|
|
262
|
+
:global(.code-block-content__header) {
|
|
263
|
+
padding: var(--webchat-spacingVerticalM) var(--webchat-spacingHorizontalL);
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
:global(.code-block-content__code-block) {
|
|
267
|
+
padding-block: var(--webchat-spacingVerticalM);
|
|
268
|
+
padding-inline: var(--webchat-spacingHorizontalL) var(--webchat-spacingHorizontalS);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
:global(.code-block-copy-button) {
|
|
272
|
+
--webchat__code-block__copy-button--color: var(--webchat-colorNeutralForeground1);
|
|
273
|
+
--webchat__code-block__copy-button--background: var(--webchat-colorNeutralBackground3);
|
|
274
|
+
|
|
275
|
+
margin-block-start: var(--webchat-spacingVerticalM);
|
|
276
|
+
margin-inline-end: var(--webchat-spacingHorizontalL);
|
|
277
|
+
position: absolute;
|
|
278
|
+
right: 0;
|
|
279
|
+
top: 0;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
&.part-grouping-decorator--group :global(.stacked-layout .webchat__bubble .code-block-content) {
|
|
283
|
+
margin-inline-end: var(--webchat-spacingHorizontalNone);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/* Message bubble collapsible content */
|
|
288
|
+
:global(.webchat-fluent) .part-grouping-decorator {
|
|
289
|
+
:global(.stacked-layout .webchat__bubble .collapsible-content) {
|
|
290
|
+
:global(.collapsible-content__summary) {
|
|
291
|
+
&:focus-visible {
|
|
292
|
+
border-radius: var(--webchat-borderRadiusSmall);
|
|
293
|
+
outline-offset: 4px;
|
|
294
|
+
outline: var(--webchat-strokeWidthThick) solid var(--webchat-colorStrokeFocus2);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
:global(.collapsible-content__content) {
|
|
299
|
+
margin-block: var(--webchat-spacingVerticalNone) var(--webchat__bubble--block-padding);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
:global(.collapsible-content__content .stacked-layout__attachment-list) {
|
|
303
|
+
gap: var(--webchat-spacingVerticalS);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
:global(.collapsible-content__content .stacked-layout__attachment-row) {
|
|
307
|
+
margin: 0;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
:global(.collapsible-content__content .stacked-layout__attachment-row .webchat__text-content) {
|
|
311
|
+
padding-block: 0;
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
&.part-grouping-decorator--group :global(.stacked-layout .webchat__bubble .collapsible-content .collapsible-content__content) {
|
|
316
|
+
margin-block: var(--webchat__bubble--block-padding) var(--webchat-spacingVerticalNone);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/* Decorator Fluent variant */
|
|
321
|
+
:global(.webchat-fluent) .part-grouping-decorator.variant-fluent {
|
|
322
|
+
&.part-grouping-decorator--group :global(.collapsible-grouping) {
|
|
323
|
+
anchor-name: --webchat-flair;
|
|
324
|
+
border-radius: var(--webchat__bubble--border-radius);
|
|
325
|
+
max-width: min(var(--webchat__bubble--max-width), 100%);
|
|
326
|
+
padding-block: var(--webchat__bubble--block-padding);
|
|
327
|
+
padding-inline: var(--webchat__bubble--inline-padding);
|
|
328
|
+
position: relative;
|
|
329
|
+
transition: background-color var(--webchat-durationNormal) var(--webchat-curveDecelerateMid),
|
|
330
|
+
box-shadow var(--webchat-durationNormal) var(--webchat-curveDecelerateMid);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
&.part-grouping-decorator--group:has(:global(.collapsible-grouping--open)) :global(.collapsible-grouping) {
|
|
334
|
+
background-color: var(--webchat__bubble--background-color);
|
|
335
|
+
box-shadow: var(--webchat__bubble--box-shadow);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
&.part-grouping-decorator--group :global(.webchat__bubble) {
|
|
339
|
+
position: static;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
&.part-grouping-decorator--group :global(.border-flair) {
|
|
343
|
+
border-radius: var(--webchat__bubble--border-radius);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
:global(.stacked-layout .transcript-focus-area__activity-list) {
|
|
347
|
+
padding: var(--webchat-spacingVerticalNone) var(--webchat-spacingHorizontalNone);
|
|
348
|
+
gap: var(--webchat-spacingVerticalXS);
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
:global(.stacked-layout .stacked-layout__message-status) {
|
|
352
|
+
margin-inline-end: calc(var(--webchat-spacingHorizontalS) * -1);
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
:global(.stacked-layout .webchat__bubble .webchat__bubble__content) {
|
|
356
|
+
box-sizing: border-box;
|
|
357
|
+
color: var(--webchat-colorNeutralForeground1);
|
|
358
|
+
max-width: 100%;
|
|
359
|
+
min-height: var(--webchat__bubble--min-height);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
&.part-grouping-decorator--group :global(.webchat__bubble .webchat__bubble__content) {
|
|
363
|
+
margin-block: calc(var(--webchat-spacingVerticalS) * -1);
|
|
364
|
+
padding-block: var(--webchat-spacingVerticalS);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
&:where(:not(.part-grouping-decorator--group).part-grouping-decorator--from-bot) :global(.webchat__bubble .webchat__bubble__content) {
|
|
368
|
+
background-color: var(--webchat__bubble--background-color);
|
|
369
|
+
border-radius: var(--webchat__bubble--border-radius);
|
|
370
|
+
box-shadow: var(--webchat__bubble--box-shadow);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/* Decorator Copilot variant */
|
|
375
|
+
:global(.webchat-fluent) .part-grouping-decorator.variant-copilot {
|
|
376
|
+
padding-inline-start: var(--webchat-spacingHorizontalMNudge);
|
|
377
|
+
position: relative;
|
|
378
|
+
|
|
379
|
+
:global(.webchat__activity-status) {
|
|
380
|
+
margin: 0 0 var(--webchat-spacingHorizontalXXS);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
:global(.stacked-layout__status) {
|
|
384
|
+
order: -1;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
&:has(:global(.webchat__bubble--from-user)) :global(.webchat__bubble) {
|
|
388
|
+
margin-block-end: var(--webchat-spacingVerticalM);
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
&:has(:global(.webchat__bubble.webchat__bubble--from-user)),
|
|
392
|
+
&:has(:global(.pre-chat-message-activity)),
|
|
393
|
+
&:has(:global(.liner-message-activity)) {
|
|
394
|
+
padding-inline-start: var(--webchat-spacingHorizontalNone);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
/* Hide generated badge as it is in the copilot header */
|
|
398
|
+
:global(.webchat__bubble .webchat__text-content .webchat__text-content__generated-badge) {
|
|
399
|
+
display: none;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
:global(.stacked-layout:has(.collapsible-grouping)) {
|
|
403
|
+
margin-inline: var(--webchat-spacingHorizontalNone);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
:global(.collapsible-grouping) {
|
|
407
|
+
margin-inline-end: var(--webchat-spacingHorizontalXXL);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
:global(.collapsible-grouping__content) {
|
|
411
|
+
anchor-name: --webchat-flair;
|
|
412
|
+
background: var(--webchat-colorNeutralBackground1);
|
|
413
|
+
border-radius: var(--webchat-borderRadius2XLarge);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
:global(.stacked-layout .stacked-layout__message-status) {
|
|
417
|
+
margin-inline-end: var(--webchat-spacingHorizontalS);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
:global(.border-flair) {
|
|
421
|
+
border-radius: var(--webchat-borderRadius2XLarge);
|
|
422
|
+
inset: anchor(top) anchor(right) anchor(bottom) anchor(left);
|
|
423
|
+
position-anchor: --webchat-flair;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
:global(.stacked-layout .transcript-focus-area__activity-list) {
|
|
427
|
+
gap: var(--webchat-spacingVerticalL);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
&.part-grouping-decorator--from-bot {
|
|
431
|
+
margin-inline-end: var(--webchat-spacingHorizontalXXL);
|
|
432
|
+
|
|
433
|
+
:global(.stacked-layout) {
|
|
434
|
+
margin: 0;
|
|
435
|
+
position: static;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
:global(.webchat__bubble) {
|
|
439
|
+
position: static;
|
|
440
|
+
width: var(--webchat__bubble--max-width);
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
:global(.webchat__bubble__content) {
|
|
444
|
+
margin-block: calc(var(--webchat-spacingVerticalS) * -1);
|
|
445
|
+
margin-inline: calc(var(--webchat-spacingHorizontalS) * -1);
|
|
446
|
+
padding-block: var(--webchat-spacingVerticalS);
|
|
447
|
+
padding-inline: var(--webchat-spacingHorizontalS);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
&:not(.part-grouping-decorator--group) :global(.webchat__bubble__content) {
|
|
451
|
+
display: flex;
|
|
452
|
+
flex-direction: column;
|
|
453
|
+
gap: var(--webchat-spacingVerticalS);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
:global(.webchat__bubble .collapsible-content .collapsible-content__content .stacked-layout__attachment-list) {
|
|
457
|
+
margin-block-start: var(--webchat-spacingVerticalS);
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
:global(.webchat__bubble .collapsible-content .collapsible-content__content .stacked-layout__attachment) {
|
|
461
|
+
max-width: var(--webchat__bubble--max-width);
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
:global(.stacked-layout__status) {
|
|
465
|
+
display: none;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
&:not(.part-grouping-decorator--group) :global(.webchat__bubble:not(.webchat__bubble--from-user) .webchat__bubble__content) {
|
|
470
|
+
anchor-name: --webchat-flair;
|
|
471
|
+
max-width: unset;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
:global(.webchat__bubble:not(.webchat__bubble--from-user)::after) {
|
|
475
|
+
margin-block: var(--webchat-spacingVerticalXS);
|
|
476
|
+
outline-offset: 5px;
|
|
477
|
+
|
|
478
|
+
--webchat__bubble--border-radius: calc(var(--webchat-borderRadius2XLarge) - 8px);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { reactNode, validateProps } from '@msinternal/botframework-webchat-react-valibot';
|
|
2
|
+
import { PartGrouping } from 'botframework-webchat-component/internal';
|
|
3
|
+
import { getOrgSchemaMessage, type WebChatActivity } from 'botframework-webchat-core';
|
|
4
|
+
import cx from 'classnames';
|
|
5
|
+
import React, { memo, useMemo, type ReactNode } from 'react';
|
|
6
|
+
import { array, custom, object, optional, pipe, readonly, safeParse } from 'valibot';
|
|
7
|
+
|
|
8
|
+
import useVariants from '../../private/useVariants';
|
|
9
|
+
import { useStyles, useVariantClassName } from '../../styles';
|
|
10
|
+
import CopilotMessageHeader from './CopilotMessageHeader';
|
|
11
|
+
|
|
12
|
+
import styles from './PartGroupingDecorator.module.css';
|
|
13
|
+
|
|
14
|
+
const partGroupingDecoratorPropsSchema = pipe(
|
|
15
|
+
object({
|
|
16
|
+
activities: pipe(array(custom<WebChatActivity>(value => safeParse(object({}), value).success)), readonly()),
|
|
17
|
+
children: optional(reactNode())
|
|
18
|
+
}),
|
|
19
|
+
readonly()
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
// TODO: [P2] InferInput does not add the required readonly, need to have a better way to define props.
|
|
23
|
+
type PartGroupingDecoratorProps = {
|
|
24
|
+
readonly activities: readonly WebChatActivity[];
|
|
25
|
+
readonly children?: ReactNode | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
function PartGroupingDecorator(props: PartGroupingDecoratorProps) {
|
|
29
|
+
const {
|
|
30
|
+
activities: [activity, ...restActivities]
|
|
31
|
+
} = validateProps(partGroupingDecoratorPropsSchema, props);
|
|
32
|
+
|
|
33
|
+
const variants = useVariants();
|
|
34
|
+
const classNames = useStyles(styles);
|
|
35
|
+
const variantClassName = useVariantClassName(styles);
|
|
36
|
+
|
|
37
|
+
const isInGroup = useMemo(
|
|
38
|
+
() =>
|
|
39
|
+
restActivities.length > 0 || !!(activity?.entities && getOrgSchemaMessage(activity.entities)?.isPartOf?.['@id']),
|
|
40
|
+
[activity, restActivities.length]
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
const isFromUser = activity?.from?.role === 'user';
|
|
44
|
+
const isFromBot = activity?.from?.role === 'bot';
|
|
45
|
+
|
|
46
|
+
const shouldRenderHeader = variants.includes('copilot') && activity?.from?.role === 'bot';
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div
|
|
50
|
+
className={cx(
|
|
51
|
+
classNames['part-grouping-decorator'],
|
|
52
|
+
{
|
|
53
|
+
[classNames['part-grouping-decorator--group']]: isInGroup,
|
|
54
|
+
[classNames['part-grouping-decorator--from-user']]: isFromUser,
|
|
55
|
+
[classNames['part-grouping-decorator--from-bot']]: isFromBot
|
|
56
|
+
},
|
|
57
|
+
variantClassName
|
|
58
|
+
)}
|
|
59
|
+
>
|
|
60
|
+
{shouldRenderHeader && (
|
|
61
|
+
<CopilotMessageHeader activity={activity} className={classNames['part-grouping-decorator__header']} />
|
|
62
|
+
)}
|
|
63
|
+
<PartGrouping {...props} />
|
|
64
|
+
</div>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export default memo(PartGroupingDecorator);
|
|
69
|
+
export { type PartGroupingDecoratorProps };
|
|
@@ -15,6 +15,8 @@ const SLIDING_DOTS_SVG_STRING =
|
|
|
15
15
|
|
|
16
16
|
const AssetComposer = memo(({ children }: AssetComposerProps) => {
|
|
17
17
|
const slidingDotsURL = useMemo(
|
|
18
|
+
// Content is hardcoded.
|
|
19
|
+
// eslint-disable-next-line no-restricted-properties
|
|
18
20
|
() => URL.createObjectURL(new Blob([SLIDING_DOTS_SVG_STRING], { type: 'image/svg+xml' })),
|
|
19
21
|
[]
|
|
20
22
|
);
|