botframework-webchat-fluent-theme 4.18.1-main.20240823.c5330cc → 4.18.1-main.20240831.f4058ce

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 (42) hide show
  1. package/dist/botframework-webchat-fluent-theme.css.map +1 -1
  2. package/dist/botframework-webchat-fluent-theme.development.css.map +1 -1
  3. package/dist/botframework-webchat-fluent-theme.development.js +8 -8
  4. package/dist/botframework-webchat-fluent-theme.development.js.map +1 -1
  5. package/dist/botframework-webchat-fluent-theme.js +1 -1
  6. package/dist/botframework-webchat-fluent-theme.js.map +1 -1
  7. package/dist/botframework-webchat-fluent-theme.mjs +1 -1
  8. package/dist/botframework-webchat-fluent-theme.mjs.map +1 -1
  9. package/dist/botframework-webchat-fluent-theme.production.min.css.map +1 -1
  10. package/dist/botframework-webchat-fluent-theme.production.min.js +8 -8
  11. package/dist/botframework-webchat-fluent-theme.production.min.js.map +1 -1
  12. package/package.json +4 -4
  13. package/src/components/activity/ActivityDecorator.tsx +1 -1
  14. package/src/components/decorator/index.ts +1 -1
  15. package/src/components/decorator/private/BorderFlair.module.css +548 -0
  16. package/src/components/decorator/private/BorderFlair.tsx +17 -0
  17. package/src/components/decorator/private/BorderLoader.module.css +49 -0
  18. package/src/components/decorator/private/BorderLoader.tsx +19 -0
  19. package/src/components/decorator/private/Decorator.tsx +20 -0
  20. package/src/components/linerActivity/index.ts +2 -0
  21. package/src/components/linerActivity/private/LinerActivity.tsx +20 -0
  22. package/src/components/linerActivity/private/LinerMessageActivity.module.css +24 -0
  23. package/src/components/linerActivity/private/isLinerMessageActivity.ts +7 -0
  24. package/src/components/preChatActivity/PreChatMessageActivity.module.css +4 -0
  25. package/src/components/preChatActivity/PreChatMessageActivity.tsx +24 -5
  26. package/src/components/preChatActivity/StarterPromptsCardAction.module.css +26 -2
  27. package/src/components/preChatActivity/StarterPromptsCardAction.tsx +26 -21
  28. package/src/components/preChatActivity/StarterPromptsToolbar.tsx +9 -10
  29. package/src/components/sendBox/ErrorMessage.tsx +15 -4
  30. package/src/components/sendBox/SendBox.tsx +16 -5
  31. package/src/components/sendBox/private/useSubmitError.ts +17 -4
  32. package/src/components/suggestedActions/SuggestedActions.tsx +0 -1
  33. package/src/components/theme/Theme.module.css +11 -0
  34. package/src/external.umd/botframework-webchat-component/internal.ts +1 -0
  35. package/src/private/FluentThemeProvider.tsx +7 -2
  36. package/src/components/decorator/Decorator.module.css +0 -3
  37. package/src/components/decorator/Decorator.tsx +0 -31
  38. package/src/components/decorator/Flair.module.css +0 -4
  39. package/src/components/decorator/Flair.tsx +0 -12
  40. package/src/components/decorator/Loader.module.css +0 -3
  41. package/src/components/decorator/Loader.tsx +0 -17
  42. /package/src/external.umd/{botframework-webchat-component.ts → botframework-webchat-component/index.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "botframework-webchat-fluent-theme",
3
- "version": "4.18.1-main.20240823.c5330cc",
3
+ "version": "4.18.1-main.20240831.f4058ce",
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.20240823.c5330cc",
73
- "botframework-webchat-component": "4.18.1-main.20240823.c5330cc",
74
- "botframework-webchat-core": "4.18.1-main.20240823.c5330cc",
72
+ "botframework-webchat-api": "4.18.1-main.20240831.f4058ce",
73
+ "botframework-webchat-component": "4.18.1-main.20240831.f4058ce",
74
+ "botframework-webchat-core": "4.18.1-main.20240831.f4058ce",
75
75
  "classnames": "2.5.1",
76
76
  "inject-meta-tag": "0.0.1",
77
77
  "math-random": "2.0.1",
@@ -11,7 +11,7 @@ function ActivityDecorator({ activity, children }: Readonly<{ activity: WebChatA
11
11
  const variants = useVariants();
12
12
  const variantClassName = useVariantClassName(styles);
13
13
 
14
- const shouldRenderHeader = variants.includes('copilot') && activity?.from?.role !== 'user' && !!children;
14
+ const shouldRenderHeader = variants.includes('copilot') && activity?.from?.role === 'bot' && !!children;
15
15
 
16
16
  return (
17
17
  <div className={cx(classNames['activity-decorator'], variantClassName)}>
@@ -1 +1 @@
1
- export { default as WebChatDecorator } from './Decorator';
1
+ export { default as FluentThemeDecorator } from './private/Decorator';
@@ -0,0 +1,548 @@
1
+ @property --webchat-decorator-borderFlair-animated-angle {
2
+ inherits: true;
3
+ initial-value: 0;
4
+ syntax: '<number>';
5
+ }
6
+
7
+ @property --webchat-decorator-borderFlair-animated-color1 {
8
+ inherits: true;
9
+ initial-value: transparent;
10
+ syntax: '<color>';
11
+ }
12
+
13
+ @property --webchat-decorator-borderFlair-animated-color2 {
14
+ inherits: true;
15
+ initial-value: transparent;
16
+ syntax: '<color>';
17
+ }
18
+
19
+ @property --webchat-decorator-borderFlair-animated-color3 {
20
+ inherits: true;
21
+ initial-value: transparent;
22
+ syntax: '<color>';
23
+ }
24
+
25
+ @keyframes borderAnimation-angle {
26
+ 0% {
27
+ --webchat-decorator-borderFlair-animated-angle: 0.75;
28
+ }
29
+
30
+ 100% {
31
+ --webchat-decorator-borderFlair-animated-angle: 2.75;
32
+ }
33
+ }
34
+
35
+ @keyframes borderAnimation-color1 {
36
+ 0% {
37
+ --webchat-decorator-borderFlair-animated-color1: var(--webchat-decorator-borderFlair-color1Fade);
38
+ }
39
+
40
+ 33% {
41
+ --webchat-decorator-borderFlair-animated-color1: var(--webchat-decorator-borderFlair-color1);
42
+ }
43
+
44
+ 83% {
45
+ --webchat-decorator-borderFlair-animated-color1: var(--webchat-decorator-borderFlair-color1);
46
+ }
47
+
48
+ 100% {
49
+ --webchat-decorator-borderFlair-animated-color1: var(--webchat-decorator-borderFlair-color1Fade);
50
+ }
51
+ }
52
+
53
+ @keyframes borderAnimation-color2 {
54
+ 0% {
55
+ --webchat-decorator-borderFlair-animated-color2: var(--webchat-decorator-borderFlair-color2Fade);
56
+ }
57
+
58
+ 33% {
59
+ --webchat-decorator-borderFlair-animated-color2: var(--webchat-decorator-borderFlair-color2);
60
+ }
61
+
62
+ 83% {
63
+ --webchat-decorator-borderFlair-animated-color2: var(--webchat-decorator-borderFlair-color2);
64
+ }
65
+
66
+ 100% {
67
+ --webchat-decorator-borderFlair-animated-color2: var(--webchat-decorator-borderFlair-color2Fade);
68
+ }
69
+ }
70
+
71
+ @keyframes borderAnimation-color3 {
72
+ 0% {
73
+ --webchat-decorator-borderFlair-animated-color3: var(--webchat-decorator-borderFlair-color3Fade);
74
+ }
75
+
76
+ 33% {
77
+ --webchat-decorator-borderFlair-animated-color3: var(--webchat-decorator-borderFlair-color3);
78
+ }
79
+
80
+ 83% {
81
+ --webchat-decorator-borderFlair-animated-color3: var(--webchat-decorator-borderFlair-color3);
82
+ }
83
+
84
+ 100% {
85
+ --webchat-decorator-borderFlair-animated-color3: var(--webchat-decorator-borderFlair-color3Fade);
86
+ }
87
+ }
88
+
89
+ :global(.webchat-fluent) .border-flair {
90
+ /* Configurable variables */
91
+ --webchat-decorator-borderFlair-color1: var(--webchat-borderFlair-color1, var(--webchat__border-animation--color-1));
92
+ --webchat-decorator-borderFlair-color2: var(--webchat-borderFlair-color2, var(--webchat__border-animation--color-2));
93
+ --webchat-decorator-borderFlair-color3: var(--webchat-borderFlair-color3, var(--webchat__border-animation--color-3));
94
+ --webchat-decorator-borderFlair-color1Fade: var(--webchat-borderFlair-color1Fade, transparent);
95
+ --webchat-decorator-borderFlair-color2Fade: var(--webchat-borderFlair-color2Fade, transparent);
96
+ --webchat-decorator-borderFlair-color3Fade: var(--webchat-borderFlair-color1Fade, transparent);
97
+ --webchat-decorator-borderFlair-borderSize: var(--webchat-borderFlair-borderSize, 2px);
98
+
99
+ /* Helper variables */
100
+ --webchat-decorator-borderFlair-backgroundSize: calc(100% + (2 * var(--webchat-decorator-borderFlair-borderSize)));
101
+ --webchat-decorator-borderFlair-borderGradient: linear-gradient(calc(var(--webchat-decorator-borderFlair-animated-angle) * 180deg + 45deg),
102
+ var(--webchat-decorator-borderFlair-animated-color1),
103
+ var(--webchat-decorator-borderFlair-animated-color2),
104
+ var(--webchat-decorator-borderFlair-animated-color3));
105
+ --webchat-decorator-borderFlair-borderMask: linear-gradient(hsl(0 0% 100% / 0), hsl(0 0% 100% / 0)) padding-box,
106
+ linear-gradient(hsl(0 0% 100%), hsl(0 0% 100%)) border-box;
107
+
108
+ animation:
109
+ borderAnimation-angle 2000ms linear 0ms forwards,
110
+ borderAnimation-color1 1200ms linear 0ms forwards,
111
+ borderAnimation-color2 1200ms linear 200ms forwards,
112
+ borderAnimation-color3 1200ms linear 400ms forwards;
113
+ background: var(--webchat-decorator-borderFlair-borderGradient) center center / var(--webchat-decorator-borderFlair-backgroundSize) var(--webchat-decorator-borderFlair-backgroundSize);
114
+ border: var(--webchat-decorator-borderFlair-borderSize) solid transparent;
115
+ border-radius: inherit;
116
+ inset: 0;
117
+ isolation: isolate;
118
+ -webkit-mask: var(--webchat-decorator-borderFlair-borderMask);
119
+ -webkit-mask-composite: clear;
120
+ mask: var(--webchat-decorator-borderFlair-borderMask);
121
+ mask-composite: intersect;
122
+ pointer-events: none;
123
+ position: absolute;
124
+ }
125
+
126
+ /* Firefox implementation */
127
+ @supports (-moz-appearance: none) {
128
+ @keyframes borderFlair-animation {
129
+ 0% {
130
+ --webchat-decorator-borderFlair-animated: 0;
131
+ }
132
+
133
+ 1% {
134
+ --webchat-decorator-borderFlair-animated: 0.01;
135
+ }
136
+
137
+ 2% {
138
+ --webchat-decorator-borderFlair-animated: 0.02;
139
+ }
140
+
141
+ 3% {
142
+ --webchat-decorator-borderFlair-animated: 0.03;
143
+ }
144
+
145
+ 4% {
146
+ --webchat-decorator-borderFlair-animated: 0.04;
147
+ }
148
+
149
+ 5% {
150
+ --webchat-decorator-borderFlair-animated: 0.05;
151
+ }
152
+
153
+ 6% {
154
+ --webchat-decorator-borderFlair-animated: 0.06;
155
+ }
156
+
157
+ 7% {
158
+ --webchat-decorator-borderFlair-animated: 0.07;
159
+ }
160
+
161
+ 8% {
162
+ --webchat-decorator-borderFlair-animated: 0.08;
163
+ }
164
+
165
+ 9% {
166
+ --webchat-decorator-borderFlair-animated: 0.09;
167
+ }
168
+
169
+ 10% {
170
+ --webchat-decorator-borderFlair-animated: 0.1;
171
+ }
172
+
173
+ 11% {
174
+ --webchat-decorator-borderFlair-animated: 0.11;
175
+ }
176
+
177
+ 12% {
178
+ --webchat-decorator-borderFlair-animated: 0.12;
179
+ }
180
+
181
+ 13% {
182
+ --webchat-decorator-borderFlair-animated: 0.13;
183
+ }
184
+
185
+ 14% {
186
+ --webchat-decorator-borderFlair-animated: 0.14;
187
+ }
188
+
189
+ 15% {
190
+ --webchat-decorator-borderFlair-animated: 0.15;
191
+ }
192
+
193
+ 16% {
194
+ --webchat-decorator-borderFlair-animated: 0.16;
195
+ }
196
+
197
+ 17% {
198
+ --webchat-decorator-borderFlair-animated: 0.17;
199
+ }
200
+
201
+ 18% {
202
+ --webchat-decorator-borderFlair-animated: 0.18;
203
+ }
204
+
205
+ 19% {
206
+ --webchat-decorator-borderFlair-animated: 0.19;
207
+ }
208
+
209
+ 20% {
210
+ --webchat-decorator-borderFlair-animated: 0.2;
211
+ }
212
+
213
+ 21% {
214
+ --webchat-decorator-borderFlair-animated: 0.21;
215
+ }
216
+
217
+ 22% {
218
+ --webchat-decorator-borderFlair-animated: 0.22;
219
+ }
220
+
221
+ 23% {
222
+ --webchat-decorator-borderFlair-animated: 0.23;
223
+ }
224
+
225
+ 24% {
226
+ --webchat-decorator-borderFlair-animated: 0.24;
227
+ }
228
+
229
+ 25% {
230
+ --webchat-decorator-borderFlair-animated: 0.25;
231
+ }
232
+
233
+ 26% {
234
+ --webchat-decorator-borderFlair-animated: 0.26;
235
+ }
236
+
237
+ 27% {
238
+ --webchat-decorator-borderFlair-animated: 0.27;
239
+ }
240
+
241
+ 28% {
242
+ --webchat-decorator-borderFlair-animated: 0.28;
243
+ }
244
+
245
+ 29% {
246
+ --webchat-decorator-borderFlair-animated: 0.29;
247
+ }
248
+
249
+ 30% {
250
+ --webchat-decorator-borderFlair-animated: 0.3;
251
+ }
252
+
253
+ 31% {
254
+ --webchat-decorator-borderFlair-animated: 0.31;
255
+ }
256
+
257
+ 32% {
258
+ --webchat-decorator-borderFlair-animated: 0.32;
259
+ }
260
+
261
+ 33% {
262
+ --webchat-decorator-borderFlair-animated: 0.33;
263
+ }
264
+
265
+ 34% {
266
+ --webchat-decorator-borderFlair-animated: 0.34;
267
+ }
268
+
269
+ 35% {
270
+ --webchat-decorator-borderFlair-animated: 0.35;
271
+ }
272
+
273
+ 36% {
274
+ --webchat-decorator-borderFlair-animated: 0.36;
275
+ }
276
+
277
+ 37% {
278
+ --webchat-decorator-borderFlair-animated: 0.37;
279
+ }
280
+
281
+ 38% {
282
+ --webchat-decorator-borderFlair-animated: 0.38;
283
+ }
284
+
285
+ 39% {
286
+ --webchat-decorator-borderFlair-animated: 0.39;
287
+ }
288
+
289
+ 40% {
290
+ --webchat-decorator-borderFlair-animated: 0.4;
291
+ }
292
+
293
+ 41% {
294
+ --webchat-decorator-borderFlair-animated: 0.41;
295
+ }
296
+
297
+ 42% {
298
+ --webchat-decorator-borderFlair-animated: 0.42;
299
+ }
300
+
301
+ 43% {
302
+ --webchat-decorator-borderFlair-animated: 0.43;
303
+ }
304
+
305
+ 44% {
306
+ --webchat-decorator-borderFlair-animated: 0.44;
307
+ }
308
+
309
+ 45% {
310
+ --webchat-decorator-borderFlair-animated: 0.45;
311
+ }
312
+
313
+ 46% {
314
+ --webchat-decorator-borderFlair-animated: 0.46;
315
+ }
316
+
317
+ 47% {
318
+ --webchat-decorator-borderFlair-animated: 0.47;
319
+ }
320
+
321
+ 48% {
322
+ --webchat-decorator-borderFlair-animated: 0.48;
323
+ }
324
+
325
+ 49% {
326
+ --webchat-decorator-borderFlair-animated: 0.49;
327
+ }
328
+
329
+ 50% {
330
+ --webchat-decorator-borderFlair-animated: 0.5;
331
+ }
332
+
333
+ 51% {
334
+ --webchat-decorator-borderFlair-animated: 0.51;
335
+ }
336
+
337
+ 52% {
338
+ --webchat-decorator-borderFlair-animated: 0.52;
339
+ }
340
+
341
+ 53% {
342
+ --webchat-decorator-borderFlair-animated: 0.53;
343
+ }
344
+
345
+ 54% {
346
+ --webchat-decorator-borderFlair-animated: 0.54;
347
+ }
348
+
349
+ 55% {
350
+ --webchat-decorator-borderFlair-animated: 0.55;
351
+ }
352
+
353
+ 56% {
354
+ --webchat-decorator-borderFlair-animated: 0.56;
355
+ }
356
+
357
+ 57% {
358
+ --webchat-decorator-borderFlair-animated: 0.57;
359
+ }
360
+
361
+ 58% {
362
+ --webchat-decorator-borderFlair-animated: 0.58;
363
+ }
364
+
365
+ 59% {
366
+ --webchat-decorator-borderFlair-animated: 0.59;
367
+ }
368
+
369
+ 60% {
370
+ --webchat-decorator-borderFlair-animated: 0.6;
371
+ }
372
+
373
+ 61% {
374
+ --webchat-decorator-borderFlair-animated: 0.61;
375
+ }
376
+
377
+ 62% {
378
+ --webchat-decorator-borderFlair-animated: 0.62;
379
+ }
380
+
381
+ 63% {
382
+ --webchat-decorator-borderFlair-animated: 0.63;
383
+ }
384
+
385
+ 64% {
386
+ --webchat-decorator-borderFlair-animated: 0.64;
387
+ }
388
+
389
+ 65% {
390
+ --webchat-decorator-borderFlair-animated: 0.65;
391
+ }
392
+
393
+ 66% {
394
+ --webchat-decorator-borderFlair-animated: 0.66;
395
+ }
396
+
397
+ 67% {
398
+ --webchat-decorator-borderFlair-animated: 0.67;
399
+ }
400
+
401
+ 68% {
402
+ --webchat-decorator-borderFlair-animated: 0.68;
403
+ }
404
+
405
+ 69% {
406
+ --webchat-decorator-borderFlair-animated: 0.69;
407
+ }
408
+
409
+ 70% {
410
+ --webchat-decorator-borderFlair-animated: 0.7;
411
+ }
412
+
413
+ 71% {
414
+ --webchat-decorator-borderFlair-animated: 0.71;
415
+ }
416
+
417
+ 72% {
418
+ --webchat-decorator-borderFlair-animated: 0.72;
419
+ }
420
+
421
+ 73% {
422
+ --webchat-decorator-borderFlair-animated: 0.73;
423
+ }
424
+
425
+ 74% {
426
+ --webchat-decorator-borderFlair-animated: 0.74;
427
+ }
428
+
429
+ 75% {
430
+ --webchat-decorator-borderFlair-animated: 0.75;
431
+ }
432
+
433
+ 76% {
434
+ --webchat-decorator-borderFlair-animated: 0.76;
435
+ }
436
+
437
+ 77% {
438
+ --webchat-decorator-borderFlair-animated: 0.77;
439
+ }
440
+
441
+ 78% {
442
+ --webchat-decorator-borderFlair-animated: 0.78;
443
+ }
444
+
445
+ 79% {
446
+ --webchat-decorator-borderFlair-animated: 0.79;
447
+ }
448
+
449
+ 80% {
450
+ --webchat-decorator-borderFlair-animated: 0.8;
451
+ }
452
+
453
+ 81% {
454
+ --webchat-decorator-borderFlair-animated: 0.81;
455
+ }
456
+
457
+ 82% {
458
+ --webchat-decorator-borderFlair-animated: 0.82;
459
+ }
460
+
461
+ 83% {
462
+ --webchat-decorator-borderFlair-animated: 0.83;
463
+ }
464
+
465
+ 84% {
466
+ --webchat-decorator-borderFlair-animated: 0.84;
467
+ }
468
+
469
+ 85% {
470
+ --webchat-decorator-borderFlair-animated: 0.85;
471
+ }
472
+
473
+ 86% {
474
+ --webchat-decorator-borderFlair-animated: 0.86;
475
+ }
476
+
477
+ 87% {
478
+ --webchat-decorator-borderFlair-animated: 0.87;
479
+ }
480
+
481
+ 88% {
482
+ --webchat-decorator-borderFlair-animated: 0.88;
483
+ }
484
+
485
+ 89% {
486
+ --webchat-decorator-borderFlair-animated: 0.89;
487
+ }
488
+
489
+ 90% {
490
+ --webchat-decorator-borderFlair-animated: 0.9;
491
+ }
492
+
493
+ 91% {
494
+ --webchat-decorator-borderFlair-animated: 0.91;
495
+ }
496
+
497
+ 92% {
498
+ --webchat-decorator-borderFlair-animated: 0.92;
499
+ }
500
+
501
+ 93% {
502
+ --webchat-decorator-borderFlair-animated: 0.93;
503
+ }
504
+
505
+ 94% {
506
+ --webchat-decorator-borderFlair-animated: 0.94;
507
+ }
508
+
509
+ 95% {
510
+ --webchat-decorator-borderFlair-animated: 0.95;
511
+ }
512
+
513
+ 96% {
514
+ --webchat-decorator-borderFlair-animated: 0.96;
515
+ }
516
+
517
+ 97% {
518
+ --webchat-decorator-borderFlair-animated: 0.97;
519
+ }
520
+
521
+ 98% {
522
+ --webchat-decorator-borderFlair-animated: 0.98;
523
+ }
524
+
525
+ 99% {
526
+ --webchat-decorator-borderFlair-animated: 0.99;
527
+ }
528
+
529
+ 100% {
530
+ --webchat-decorator-borderFlair-animated: 1;
531
+ }
532
+ }
533
+
534
+ :global(.webchat-fluent) .border-flair {
535
+ --webchat-decorator-borderFlair-animated-angle: calc(0.75 + 2 * var(--webchat-decorator-borderFlair-animated));
536
+ --webchat-decorator-borderFlair-animated-color1: color-mix(in srgb,
537
+ var(--webchat-decorator-borderFlair-color1) calc((1 - abs(var(--webchat-decorator-borderFlair-animated) * 3 - 1.5)) * 100%),
538
+ var(--webchat-decorator-borderFlair-color1Fade));
539
+ --webchat-decorator-borderFlair-animated-color2: color-mix(in srgb,
540
+ var(--webchat-decorator-borderFlair-color2) calc((1 - abs(var(--webchat-decorator-borderFlair-animated) * 3 - 1.75)) * 100%),
541
+ var(--webchat-decorator-borderFlair-color2Fade));
542
+ --webchat-decorator-borderFlair-animated-color3: color-mix(in srgb,
543
+ var(--webchat-decorator-borderFlair-color3) calc((1 - abs(var(--webchat-decorator-borderFlair-animated) * 3 - 2)) * 100%),
544
+ var(--webchat-decorator-borderFlair-color3Fade));
545
+
546
+ animation: borderFlair-animation 2000ms linear forwards;
547
+ }
548
+ }
@@ -0,0 +1,17 @@
1
+ import React, { Fragment, memo, type ReactNode } from 'react';
2
+
3
+ import { useStyles } from '../../../styles';
4
+ import styles from './BorderFlair.module.css';
5
+
6
+ function BorderFlair({ children }: Readonly<{ children?: ReactNode | undefined }>) {
7
+ const classNames = useStyles(styles);
8
+
9
+ return (
10
+ <Fragment>
11
+ {children}
12
+ <div className={classNames['border-flair']} />
13
+ </Fragment>
14
+ );
15
+ }
16
+
17
+ export default memo(BorderFlair);
@@ -0,0 +1,49 @@
1
+ @keyframes borderAnimation-position {
2
+ 0% {
3
+ left: -33%;
4
+ width: 33%;
5
+ }
6
+
7
+ 100% {
8
+ left: 100%;
9
+ width: 33%;
10
+ }
11
+ }
12
+
13
+ :global(.webchat-fluent) .border-loader {
14
+ border-radius: inherit;
15
+ }
16
+
17
+ :global(.webchat-fluent) .border-loader__track {
18
+ --webchat-decorator-borderLoader-borderSize: var(--webchat-borderLoader-borderSize, 4px);
19
+
20
+ background-color: var(--webchat-colorNeutralBackground6);
21
+ height: var(--webchat-decorator-borderLoader-borderSize);
22
+ position: relative;
23
+ width: 100%;
24
+ }
25
+
26
+
27
+ :global(.webchat-fluent) .border-loader__loader {
28
+ --webchat-decorator-borderLoader-color1: var(--webchat-borderLoader-color1,
29
+ var(--webchat__border-animation--color-1));
30
+ --webchat-decorator-borderLoader-color2: var(--webchat-borderLoader-color2,
31
+ var(--webchat__border-animation--color-2));
32
+ --webchat-decorator-borderLoader-color3: var(--webchat-borderLoader-color3,
33
+ var(--webchat__border-animation--color-3));
34
+ --webchat-decorator-borderLoader-color1Fade: var(--webchat-borderLoader-color1Fade, transparent);
35
+ --webchat-decorator-borderLoader-color3Fade: var(--webchat-borderLoader-color1Fade, transparent);
36
+
37
+ animation: borderAnimation-position 3s linear infinite;
38
+ background: linear-gradient(90deg,
39
+ var(--webchat-decorator-borderLoader-color1Fade) 0%,
40
+ var(--webchat-decorator-borderLoader-color1) 35%,
41
+ var(--webchat-decorator-borderLoader-color2) 70%,
42
+ var(--webchat-decorator-borderLoader-color3) 92%,
43
+ var(--webchat-decorator-borderLoader-color3Fade)) no-repeat;
44
+ height: var(--webchat-decorator-borderLoader-borderSize);
45
+ inset: 0;
46
+ isolation: isolate;
47
+ position: absolute;
48
+ width: 100%;
49
+ }
@@ -0,0 +1,19 @@
1
+ import React, { memo, type ReactNode } from 'react';
2
+
3
+ import { useStyles } from '../../../styles';
4
+ import styles from './BorderLoader.module.css';
5
+
6
+ function BorderLoader({ children }: Readonly<{ children?: ReactNode | undefined }>) {
7
+ const classNames = useStyles(styles);
8
+
9
+ return (
10
+ <div className={classNames['border-loader']}>
11
+ {children}
12
+ <div className={classNames['border-loader__track']}>
13
+ <div className={classNames['border-loader__loader']} />
14
+ </div>
15
+ </div>
16
+ );
17
+ }
18
+
19
+ export default memo(BorderLoader);
@@ -0,0 +1,20 @@
1
+ import { DecoratorComposer, type DecoratorMiddleware } from 'botframework-webchat-api/decorator';
2
+ import React, { memo, type ReactNode } from 'react';
3
+
4
+ import BorderFlair from './BorderFlair';
5
+ import BorderLoader from './BorderLoader';
6
+
7
+ const middleware: DecoratorMiddleware[] = [
8
+ init =>
9
+ init === 'activity border' &&
10
+ (next => request => (request.livestreamingState === 'completing' ? BorderFlair : next(request))),
11
+ init =>
12
+ init === 'activity border' &&
13
+ (next => request => (request.livestreamingState === 'preparing' ? BorderLoader : next(request)))
14
+ ];
15
+
16
+ function FluentThemeDecorator({ children }: Readonly<{ readonly children?: ReactNode | undefined }>) {
17
+ return <DecoratorComposer middleware={middleware}>{children}</DecoratorComposer>;
18
+ }
19
+
20
+ export default memo(FluentThemeDecorator);
@@ -0,0 +1,2 @@
1
+ export { default as isLinerMessageActivity } from './private/isLinerMessageActivity';
2
+ export { default as LinerMessageActivity } from './private/LinerActivity';