botframework-webchat-fluent-theme 4.18.1-main.20241015.4744d69 → 4.18.1-main.20241104.06bf029

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "botframework-webchat-fluent-theme",
3
- "version": "4.18.1-main.20241015.4744d69",
3
+ "version": "4.18.1-main.20241104.06bf029",
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",
@@ -68,15 +68,15 @@
68
68
  "@types/math-random": "^1.0.2",
69
69
  "@types/node": "^20.12.11",
70
70
  "@types/react": "^16.14.60",
71
- "botframework-webchat-base": "4.18.1-main.20241015.4744d69",
72
- "botframework-webchat-styles": "4.18.1-main.20241015.4744d69",
71
+ "botframework-webchat-base": "4.18.1-main.20241104.06bf029",
72
+ "botframework-webchat-styles": "4.18.1-main.20241104.06bf029",
73
73
  "tsup": "^8.0.2",
74
74
  "typescript": "^5.4.5"
75
75
  },
76
76
  "dependencies": {
77
- "botframework-webchat-api": "4.18.1-main.20241015.4744d69",
78
- "botframework-webchat-component": "4.18.1-main.20241015.4744d69",
79
- "botframework-webchat-core": "4.18.1-main.20241015.4744d69",
77
+ "botframework-webchat-api": "4.18.1-main.20241104.06bf029",
78
+ "botframework-webchat-component": "4.18.1-main.20241104.06bf029",
79
+ "botframework-webchat-core": "4.18.1-main.20241104.06bf029",
80
80
  "classnames": "2.5.1",
81
81
  "inject-meta-tag": "0.0.1",
82
82
  "math-random": "2.0.1",
@@ -88,7 +88,7 @@
88
88
  margin-inline-start: 28px;
89
89
  }
90
90
 
91
- :global(.border-loader):global(.border-loader) {
91
+ :global(.border-loader) {
92
92
  display: flex;
93
93
  flex-flow: column nowrap;
94
94
  gap: var(--webchat-spacingVerticalS);
@@ -96,7 +96,7 @@
96
96
  width: 500px;
97
97
  }
98
98
 
99
- :global(.border-loader__track):global(.border-loader__track) {
99
+ :global(.border-loader__track) {
100
100
  border-radius: inherit;
101
101
  box-sizing: border-box;
102
102
  clip-path: border-box;
@@ -8,11 +8,11 @@
8
8
  place-content: center;
9
9
  place-items: center;
10
10
  position: absolute;
11
+ transition: all var(--webchat-durationNormal) var(--webchat-curveDecelerateMid);
11
12
  }
12
13
 
13
14
  :global(.webchat-fluent) .sendbox__attachment-drop-zone--droppable {
14
- background-color: #e00;
15
- color: White;
15
+ background-color: var(--webchat-colorBrandBackground2Hover);
16
16
  }
17
17
 
18
18
  :global(.webchat-fluent) .sendbox__attachment-drop-zone-icon {
@@ -62,12 +62,19 @@ const DropZone = (props: { readonly onFilesAdded: (files: File[]) => void }) =>
62
62
 
63
63
  const handleDragLeave = () => --entranceCounter <= 0 && setDropZoneState(false);
64
64
 
65
+ const handleDragEnd = () => {
66
+ entranceCounter = 0;
67
+ setDropZoneState(false);
68
+ };
69
+
65
70
  document.addEventListener('dragenter', handleDragEnter, false);
66
71
  document.addEventListener('dragleave', handleDragLeave, false);
72
+ document.addEventListener('dragend', handleDragEnd, false);
67
73
 
68
74
  return () => {
69
75
  document.removeEventListener('dragenter', handleDragEnter);
70
76
  document.removeEventListener('dragleave', handleDragLeave);
77
+ document.removeEventListener('dragend', handleDragEnd);
71
78
  };
72
79
  }, [setDropZoneState]);
73
80
 
@@ -1,3 +1,11 @@
1
+ :global {
2
+ /* biome-ignore format: do not print each class on the new line */
3
+ .a, .b, .c, .d, .e, .f, .g, .h, .i, .j, .k, .l, .m, .n, .o, .p, .q, .r, .s, .t, .v, .w, .u, .x, .y, .z,
4
+ .A, .B, .C, .D, .E, .F, .G, .H, .I, .J, .K, .L, .M, .N, .O, .P, .Q, .R, .S, .T, .V, .W, .U, .X, .Y, .Z {
5
+ /* esbuild considers empty global classes as used and removes them due to lack of rules */
6
+ }
7
+ }
8
+
1
9
  :global(.webchat-fluent).theme {
2
10
  display: contents;
3
11
 
@@ -64,6 +72,10 @@
64
72
  --webchat-colorGray190: var(--colorGray190, #201f1e);
65
73
  --webchat-colorGray200: var(--colorGray200, #1b1a19);
66
74
 
75
+ /* New greys from the link above not exposed by Fluent */
76
+ --webchat-colorGrey8: #141414;
77
+ --webchat-colorGrey98: #fafafa;
78
+
67
79
  /* https://github.com/microsoft/fluentui/blob/master/packages/tokens/src/utils/shadows.ts */
68
80
  --webchat-shadow2: var(--shadow2, 0 0 2px rgba(0, 0, 0, 12%), 0 1px 2px rgba(0, 0, 0, 14%));
69
81
  --webchat-shadow4: var(--shadow4, 0 0 2px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.14));
@@ -107,6 +119,7 @@
107
119
  'Helvetica Neue',
108
120
  sans-serif
109
121
  );
122
+ --webchat-fontFamilyMonospace: var(--fontFamilyMonospace, Consolas, 'Courier New', Courier, monospace);
110
123
  --webchat-fontFamilyNumeric: var(
111
124
  --fontFamilyNumeric,
112
125
  Bahnschrift,
@@ -153,7 +166,7 @@
153
166
 
154
167
  /* https://github.com/microsoft/fluentui/blob/master/packages/tokens/src/global/strokeWidths.ts */
155
168
  --webchat-strokeWidthThin: var(--strokeWidthThin, 1px);
156
- --webchat-strokeWidthThick: var(--strokeWidthThicker, 2px);
169
+ --webchat-strokeWidthThick: var(--strokeWidthThick, 2px);
157
170
  --webchat-strokeWidthThicker: var(--strokeWidthThicker, 3px);
158
171
 
159
172
  /* https://github.com/microsoft/fluentui/blob/master/packages/tokens/src/global/durations.ts */
@@ -209,8 +222,9 @@
209
222
  padding-inline-start: var(--webchat-spacingHorizontalMNudge);
210
223
  }
211
224
 
212
- /* Transcript scrollable */
213
- :global(.webchat-fluent).theme :global(.webchat__basic-transcript .webchat__basic-transcript__scrollable) {
225
+ /* Scrollbars */
226
+ :global(.webchat-fluent).theme :global(.webchat__basic-transcript .webchat__basic-transcript__scrollable),
227
+ :global(.webchat-fluent).theme :global(.webchat__view-code-dialog__code-body) {
214
228
  /* Edge uses -webkit-scrollbar if scrollbar-* is not set */
215
229
  scrollbar-color: unset;
216
230
  scrollbar-width: unset;
@@ -223,6 +237,10 @@
223
237
  visibility: hidden;
224
238
  }
225
239
 
240
+ &::-webkit-scrollbar-corner {
241
+ background: transparent;
242
+ }
243
+
226
244
  &:hover::-webkit-scrollbar {
227
245
  width: var(--webchat-spacingVerticalMNudge);
228
246
  }
@@ -349,7 +367,7 @@
349
367
  }
350
368
 
351
369
  /* TODO: align with original fluent modal styles in WebChat as they don't match v9 anymore */
352
- :global(.webchat__modal-dialog__close-button):focus:not(:active):hover {
370
+ :global(.webchat__modal-dialog__close-button):not(:active):hover {
353
371
  background-color: var(--webchat-colorNeutralBackground3);
354
372
  }
355
373
 
@@ -370,6 +388,125 @@
370
388
  }
371
389
  }
372
390
 
391
+ /* View Code dialog */
392
+ :global(.webchat-fluent).theme :global(.webchat__modal-dialog.webchat__view-code-dialog) {
393
+ :global(.webchat__modal-dialog__close-button-layout) {
394
+ display: flex;
395
+ padding: var(--webchat-spacingVerticalS) var(--webchat-spacingHorizontalS);
396
+ }
397
+
398
+ :global(.webchat__modal-dialog__close-button) {
399
+ align-items: center;
400
+ aspect-ratio: 1;
401
+ display: flex;
402
+ height: var(--webchat-lineHeightBase300);
403
+ justify-content: center;
404
+ padding: 0;
405
+ width: unset;
406
+ }
407
+
408
+ :global(.webchat__view-code-dialog__copy-button) {
409
+ background: transparent;
410
+ border: none;
411
+ color: var(--webchat-colorNeutralForeground1);
412
+ height: 20px;
413
+ margin-block-start: var(--webchat-spacingVerticalS);
414
+ padding: 0;
415
+ position: absolute;
416
+ right: 32px;
417
+ top: 0;
418
+ transition: background-color var(--webchat-durationNormal) var(--webchat-curveDecelerateMid);
419
+ width: 20px;
420
+
421
+ :global(.webchat__code-block-copy-button__icon) {
422
+ background-color: currentColor;
423
+ }
424
+
425
+ &:hover {
426
+ background: var(--webchat-colorNeutralBackground3);
427
+ }
428
+
429
+ &:active {
430
+ background: var(--webchat-colorNeutralBackground3);
431
+ }
432
+
433
+ &:focus {
434
+ outline-color: var(--webchat-colorStrokeFocus2);
435
+ }
436
+ }
437
+
438
+ :global(.webchat__modal-dialog__box) {
439
+ width: fit-content;
440
+ }
441
+
442
+ :global(.webchat__modal-dialog__body) {
443
+ margin: 0;
444
+ padding: var(--webchat-spacingVerticalS) var(--webchat-spacingHorizontalM);
445
+ }
446
+
447
+ :global(.webchat__view-code-dialog__title) {
448
+ font-size: var(--webchat-fontSizeBase300);
449
+ font-weight: var(--webchat-fontWeightSemibold);
450
+ line-height: var(--webchat-lineHeightBase300);
451
+ }
452
+
453
+ :global(.webchat__view-code-dialog__body) {
454
+ display: contents;
455
+ }
456
+
457
+ :global(.webchat__view-code-dialog__code-body) {
458
+ background: var(--webchat__code-block--background);
459
+ font-family: var(--webchat-fontFamilyMonospace);
460
+ font-size: var(--webchat-fontSizeBase300);
461
+ line-height: var(--webchat-fontSizeBase300);
462
+ margin-inline: calc(var(--webchat-spacingHorizontalM) * -1);
463
+ padding-inline: var(--webchat-spacingHorizontalM);
464
+ }
465
+
466
+ :global(.webchat__view-code-dialog__code-body:has(.shiki:focus-visible)):focus-within {
467
+ outline: var(--webchat-strokeWidthThick) solid var(--webchat-colorStrokeFocus2);
468
+ outline-offset: calc(var(--webchat-strokeWidthThick) * -1);
469
+
470
+ :global(.shiki) {
471
+ outline: none;
472
+ }
473
+ }
474
+
475
+ :global(.webchat__view-code-dialog__code-body:has(.shiki.github-light-default)) {
476
+ --webchat__code-block--background: var(--codeBlockBackground, var(--webchat-colorGrey98));
477
+ }
478
+
479
+ :global(.webchat__view-code-dialog__code-body:has(.shiki.github-dark-default)) {
480
+ --webchat__code-block--background: var(--codeBlockBackground, var(--webchat-colorGrey8));
481
+ }
482
+
483
+ :global(.webchat__view-code-dialog__footer) {
484
+ color: var(--webchat-colorNeutralForeground4);
485
+ font-size: var(--webchat-fontSizeBase100);
486
+ line-height: var(--webchat-lineHeightBase100);
487
+ }
488
+
489
+ :global(.webchat__view-code-dialog__link) {
490
+ color: var(--webchat-colorBrandForegroundLink);
491
+ text-decoration-color: transparent;
492
+
493
+ &:target {
494
+ color: var(--webchat-colorBrandForegroundLinkSelected);
495
+ }
496
+ &:hover {
497
+ color: var(--webchat-colorBrandForegroundLinkHover);
498
+ text-decoration: underline 1px currentColor;
499
+ }
500
+ &:active {
501
+ color: var(--webchat-colorBrandForegroundLinkPressed);
502
+ }
503
+ &:focus-visible {
504
+ outline: none;
505
+ text-decoration: underline 1px double var(--webchat-colorStrokeFocus2);
506
+ }
507
+ }
508
+ }
509
+
373
510
  /* Activity button */
374
511
  :global(.webchat-fluent).theme :global(.webchat__activity-button) {
375
512
  background: var(--webchat-colorNeutralBackground1);