botframework-webchat-fluent-theme 4.18.1-main.20250804.93043a9 → 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.
Files changed (33) hide show
  1. package/dist/botframework-webchat-fluent-theme.css.map +1 -1
  2. package/dist/botframework-webchat-fluent-theme.d.mts +6 -5
  3. package/dist/botframework-webchat-fluent-theme.d.ts +6 -5
  4. package/dist/botframework-webchat-fluent-theme.development.css.map +1 -1
  5. package/dist/botframework-webchat-fluent-theme.development.js +8 -8
  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 +8 -8
  13. package/dist/botframework-webchat-fluent-theme.production.min.js.map +1 -1
  14. package/package.json +8 -7
  15. package/src/buildInfo.ts +9 -0
  16. package/src/components/activity/ActivityDecorator.module.css +0 -237
  17. package/src/components/activity/ActivityDecorator.tsx +17 -12
  18. package/src/components/activity/ActivityLoader.module.css +1 -1
  19. package/src/components/activity/ActivityLoader.tsx +19 -6
  20. package/src/components/activity/CopilotMessageHeader.tsx +22 -7
  21. package/src/components/activity/PartGroupingDecorator.module.css +480 -0
  22. package/src/components/activity/PartGroupingDecorator.tsx +69 -0
  23. package/src/components/assets/AssetComposer.tsx +2 -0
  24. package/src/components/theme/Theme.module.css +85 -41
  25. package/src/env.d.ts +10 -0
  26. package/src/external.umd/botframework-webchat-api/decorator.ts +2 -0
  27. package/src/external.umd/botframework-webchat-api/index.ts +2 -0
  28. package/src/external.umd/botframework-webchat-component/decorator.ts +2 -0
  29. package/src/external.umd/botframework-webchat-component/internal.ts +2 -0
  30. package/src/external.umd/react.ts +2 -0
  31. package/src/index.ts +6 -11
  32. package/src/private/FluentThemeProvider.tsx +9 -1
  33. package/src/tsconfig.json +8 -12
@@ -165,6 +165,7 @@
165
165
  --webchat-borderRadiusMedium: var(--borderRadiusMedium, 4px);
166
166
  --webchat-borderRadiusLarge: var(--borderRadiusLarge, 6px);
167
167
  --webchat-borderRadiusXLarge: var(--borderRadiusXLarge, 8px);
168
+ --webchat-borderRadius2XLarge: var(--borderRadius2XLarge, 12px);
168
169
 
169
170
  /* https://github.com/microsoft/fluentui/blob/master/packages/tokens/src/global/strokeWidths.ts */
170
171
  --webchat-strokeWidthThin: var(--strokeWidthThin, 1px);
@@ -230,8 +231,8 @@
230
231
  :global(.webchat-fluent).theme :global(.text-area.text-area--scroll),
231
232
  :global(.webchat-fluent).theme :global(.webchat__basic-transcript .webchat__basic-transcript__scrollable),
232
233
  :global(.webchat-fluent).theme :global(.webchat__render-markdown [data-math-type='block']),
233
- :global(.webchat-fluent).theme :global(.webchat__view-code-dialog__body),
234
- :global(.webchat-fluent).theme :global(.webchat__view-code-dialog__code-body) {
234
+ :global(.webchat-fluent).theme :global(.view-code-dialog__body),
235
+ :global(.webchat-fluent).theme :global(.view-code-dialog__code-body) {
235
236
  /* Edge uses -webkit-scrollbar if scrollbar-* is not set */
236
237
  scrollbar-color: unset;
237
238
  scrollbar-width: unset;
@@ -276,6 +277,11 @@
276
277
  }
277
278
  }
278
279
 
280
+ :global(.webchat-fluent).theme.variant-copilot
281
+ :global(.transcript-focus-area) {
282
+ --webchat__transcript--spacing: var(--webchat-spacingVerticalM);
283
+ }
284
+
279
285
  :global(.webchat-fluent).theme.variant-copilot
280
286
  :global(.webchat__basic-transcript .webchat__basic-transcript__scrollable) {
281
287
  scrollbar-gutter: stable;
@@ -283,42 +289,70 @@
283
289
 
284
290
  /* Transcript focus indicator color when in focus-visible state */
285
291
  :global(.webchat-fluent).theme
286
- :global(
287
- .webchat__basic-transcript
288
- .webchat__basic-transcript__terminator:focus-visible
289
- + .webchat__basic-transcript__focus-indicator
290
- ) {
292
+ :global(.transcript-focus-area__root:has(.transcript-focus-area__terminator:focus-visible) + .transcript-focus-area__transcript-indicator) {
291
293
  border-color: var(--webchat-colorStrokeFocus2);
292
294
  }
293
295
 
294
- /* Transcript Activity indicator without focus-visible state */
295
- :global(.webchat-fluent).theme
296
- :global(.webchat__basic-transcript:not(:focus-visible) .webchat__basic-transcript__activity-indicator--focus) {
296
+ /* Transcript Content indicator without focus-visible state */
297
+ :global(.webchat-fluent).theme :global(.transcript-focus-area:not(:focus-visible) .transcript-focus-area__indicator) {
297
298
  /* Hide activity focus when no focus-visible state */
298
299
  display: none;
299
300
  }
300
301
 
301
- /* Transcript Focus indicator when activity focused */
302
+ /* Transcript Focus indicator when content focused */
302
303
  :global(.webchat-fluent).theme
303
- :global(.webchat__basic-transcript:focus-visible:has(.webchat__basic-transcript__activity-indicator--focus)) {
304
- :global(.webchat__basic-transcript__focus-indicator) {
304
+ :global(.transcript-focus-area:focus-visible:has(.transcript-focus-area__content--focused)) {
305
+ :global(.transcript-focus-area__transcript-indicator) {
305
306
  /* Hide transcript focus when an activity is focused */
306
307
  display: none;
307
308
  }
308
309
  }
309
310
 
310
- /* Transcript focused activity */
311
- :global(.webchat-fluent).theme
312
- :global(
313
- .webchat__basic-transcript:focus-visible
314
- .webchat__basic-transcript__activity:has(.webchat__basic-transcript__activity-indicator--focus)
315
- ) {
316
- :global(.webchat__basic-transcript__activity-indicator--focus) {
317
- /* Hide transcript activity focus when the activity is focused */
311
+ /* Transcript focused content */
312
+ :global(.webchat-fluent).theme :global(.transcript-focus-area:focus-visible .transcript-focus-area__content--focused) {
313
+ :global(.transcript-focus-area__indicator) {
314
+ /* Hide transcript activity focus when the content is focused */
315
+ display: none;
316
+ }
317
+
318
+ /* Transcript activity focused directly */
319
+ > :global(.webchat__focus-trap > .webchat__basic-transcript__activity-body .webchat__bubble) {
320
+ display: grid;
321
+ grid-template-areas: 'focused-content';
322
+ position: static;
323
+
324
+ :global(.webchat__bubble__content) {
325
+ grid-area: focused-content;
326
+ }
327
+
328
+ &::after {
329
+ border-radius: var(--webchat__bubble--border-radius);
330
+ content: '';
331
+ grid-area: focused-content;
332
+ outline: var(--webchat-strokeWidthThick) solid var(--webchat-colorStrokeFocus2);
333
+ pointer-events: none;
334
+ }
335
+ }
336
+
337
+ &:has(:global(.collapsible-grouping)) > :global(.transcript-focus-area__content-overlay .transcript-focus-area__indicator) {
338
+ display: none;
339
+ }
340
+
341
+ :global(.collapsible-grouping)::after {
342
+ border-radius: var(--webchat__bubble--border-radius);
343
+ border: none;
344
+ content: '';
345
+ inset: 0;
346
+ isolation: isolate;
347
+ outline: var(--webchat-strokeWidthThick) solid var(--webchat-colorStrokeFocus2);
348
+ pointer-events: none;
349
+ position: absolute;
350
+ }
351
+
352
+ :global(.activity-decorator .webchat__bubble .webchat__bubble__nub-pad) {
318
353
  display: none;
319
354
  }
320
355
 
321
- :global(.webchat__bubble)::after,
322
356
  :global(.pre-chat-message-activity)::after {
323
357
  border-radius: var(--webchat__bubble--border-radius);
324
358
  content: '';
@@ -341,6 +375,13 @@
341
375
  }
342
376
  }
343
377
 
378
+ /* Transcript focused content copilot variant */
379
+ :global(.webchat-fluent).theme.variant-copilot :global(.transcript-focus-area:focus-visible .transcript-focus-area__content--focused) {
380
+ :global(.collapsible-grouping)::after {
381
+ inset: -2px -4px;
382
+ }
383
+ }
384
+
344
385
  /* Transcript filer in copilot variant */
345
386
  :global(.webchat-fluent).theme.variant-copilot :global(.webchat__basic-transcript .webchat__basic-transcript__filler) {
346
387
  /* No filler unless pre-chat activity, see next rule */
@@ -350,7 +391,7 @@
350
391
  /* Transcript with a single pre-chat activity */
351
392
  :global(.webchat-fluent).theme
352
393
  :global(
353
- .webchat__basic-transcript:has(.webchat__basic-transcript__activity:only-child):has(.pre-chat-message-activity)
394
+ .webchat__basic-transcript:has(.part-grouping-decorator:only-child):has(.pre-chat-message-activity)
354
395
  .webchat__basic-transcript__filler
355
396
  ) {
356
397
  /* limit grow to half of the size to center the activity */
@@ -403,7 +444,7 @@
403
444
  }
404
445
 
405
446
  /* Code block */
406
- :global(.webchat-fluent).theme :global(.webchat__code-block) {
447
+ :global(.webchat-fluent).theme :global(.code-block) {
407
448
  border: none;
408
449
  font-family: var(--webchat-fontFamilyMonospace);
409
450
  font-size: var(--webchat-fontSizeBase300);
@@ -411,7 +452,7 @@
411
452
  --webchat__code-block__copy-button--color: var(--webchat-colorNeutralForeground1);
412
453
  --webchat__code-block__copy-button--background: var(--webchat-colorNeutralBackground3);
413
454
 
414
- :global(.webchat__code-block-copy-button) {
455
+ :global(.code-block-copy-button) {
415
456
  background: transparent;
416
457
  border: none;
417
458
  color: var(--webchat__code-block__copy-button--color);
@@ -421,7 +462,7 @@
421
462
  width: 20px;
422
463
  transition: background-color var(--webchat-durationNormal) var(--webchat-curveDecelerateMid);
423
464
 
424
- :global(.webchat__code-block-copy-button__icon) {
465
+ :global(.code-block-copy-button__icon) {
425
466
  --webchat__component-icon--color: currentColor;
426
467
  }
427
468
 
@@ -441,16 +482,21 @@
441
482
  }
442
483
  }
443
484
 
444
- &:global(:has(.webchat__code-block__body:focus-visible)):focus-within {
485
+ &:global(:has(.code-block__body:focus-visible)):focus-within {
445
486
  outline: var(--webchat-strokeWidthThick) solid var(--webchat-colorStrokeFocus2);
446
487
  outline-offset: calc(var(--webchat-strokeWidthThick) * -1);
447
488
 
448
- :global(.webchat__code-block__body) {
489
+ :global(.code-block__body) {
449
490
  outline: none;
450
491
  }
451
492
  }
452
493
 
453
- &:global(:has(> .webchat__code-block__theme--github-dark-default)) {
494
+ :global(.code-block__body) {
495
+ /* TODO: what is the right value? The value below matches "normal" for contents display */
496
+ line-height: 1.435;
497
+ }
498
+
499
+ &:global(:has(> .code-block__theme--github-dark-default)) {
454
500
  --webchat__background--code-block: var(--codeBlockBackground, var(--webchat-colorGrey8));
455
501
  --webchat__code-block__copy-button--background: var(
456
502
  --codeBlockCopyButtonBackgroundPressed,
@@ -460,7 +506,7 @@
460
506
  --webchat__color--code-block: var(--codeBlockForeground, var(--webchat-colorGrey98));
461
507
  }
462
508
 
463
- &:global(:has(> .webchat__code-block__theme--github-light-default)) {
509
+ &:global(:has(> .code-block__theme--github-light-default)) {
464
510
  --webchat__background--code-block: var(--codeBlockBackground, var(--webchat-colorGrey98));
465
511
  --webchat__code-block__copy-button--background: var(--codeBlockBackgroundPressed, var(--webchat-colorGrey92));
466
512
  --webchat__code-block__copy-button--color: var(--codeBlockCopyButtonForeground, var(--webchat__color--code-block));
@@ -485,7 +531,7 @@
485
531
  width: unset;
486
532
  }
487
533
 
488
- :global(.webchat__code-block-copy-button) {
534
+ :global(.code-block-copy-button) {
489
535
  --webchat__code-block__copy-button--color: var(--webchat-colorNeutralForeground1);
490
536
  --webchat__code-block__copy-button--background: var(--webchat-colorNeutralBackground3);
491
537
 
@@ -504,20 +550,25 @@
504
550
  padding: var(--webchat-spacingVerticalS) var(--webchat-spacingHorizontalM);
505
551
  }
506
552
 
507
- :global(.webchat__view-code-dialog__title) {
553
+ :global(.view-code-dialog__title) {
508
554
  font-size: var(--webchat-fontSizeBase300);
509
555
  font-weight: var(--webchat-fontWeightSemibold);
510
556
  line-height: var(--webchat-lineHeightBase300);
511
557
  }
512
558
 
513
- :global(.webchat__view-code-dialog__body) {
559
+ :global(.view-code-dialog__body) {
514
560
  font-family: var(--webchat-fontFamilyMonospace);
515
561
  font-size: var(--webchat-fontSizeBase300);
516
562
  margin: 0 calc(var(--webchat-spacingHorizontalM) * -1);
517
563
  padding: 0 var(--webchat-spacingHorizontalM);
518
564
  }
519
565
 
520
- :global(.webchat__view-code-dialog__footer) {
566
+ :global(.code-block__body) {
567
+ /* TODO: what is the right value? The value below matches "normal" for block display */
568
+ line-height: normal;
569
+ }
570
+
571
+ :global(.view-code-dialog__footer) {
521
572
  color: var(--webchat-colorNeutralForeground4);
522
573
  font-size: var(--webchat-fontSizeBase100);
523
574
  line-height: var(--webchat-lineHeightBase100);
@@ -596,13 +647,6 @@
596
647
  }
597
648
  }
598
649
 
599
- /* Monochrome image masker */
600
- :global(.webchat-fluent).theme :global(.webchat__monochrome-image-masker) {
601
- background-color: currentColor;
602
- height: 1em;
603
- width: 1em;
604
- }
605
-
606
650
  /* Feedback button */
607
651
  :global(.webchat-fluent).theme :global(.webchat__thumb-button) {
608
652
  :global(.webchat__thumb-button__image) {
package/src/env.d.ts CHANGED
@@ -1 +1,11 @@
1
1
  /// <reference types="@msinternal/botframework-webchat-styles/env" />
2
+
3
+ // For adding things to `globalThis`, TypeScript need `var`, not `const` or `let`.
4
+ /* eslint-disable no-var */
5
+ declare global {
6
+ var WEB_CHAT_BUILD_INFO_BUILD_TOOL: string | undefined;
7
+ var WEB_CHAT_BUILD_INFO_MODULE_FORMAT: string | undefined;
8
+ var WEB_CHAT_BUILD_INFO_VERSION: string | undefined;
9
+ }
10
+
11
+ export {};
@@ -1 +1,3 @@
1
+ /// <reference types="node" />
2
+
1
3
  module.exports = (globalThis as any).WebChat.decorator;
@@ -1,3 +1,5 @@
1
+ /// <reference types="node" />
2
+
1
3
  module.exports = {
2
4
  hooks: (globalThis as any).WebChat.hooks
3
5
  };
@@ -1 +1,3 @@
1
+ /// <reference types="node" />
2
+
1
3
  module.exports = (globalThis as any).WebChat.decorator;
@@ -1 +1,3 @@
1
+ /// <reference types="node" />
2
+
1
3
  module.exports = (globalThis as any).WebChat.internal;
@@ -1 +1,3 @@
1
+ /// <reference types="node" />
2
+
1
3
  module.exports = (globalThis as any).React;
package/src/index.ts CHANGED
@@ -1,18 +1,13 @@
1
- import { injectMetaTag } from 'inject-meta-tag';
2
-
3
1
  import { SendBox as FluentSendBox } from './components/sendBox/index';
4
2
  import FluentThemeProvider from './private/FluentThemeProvider';
5
3
  import testIds from './testIds';
6
4
 
7
- const buildTool = process.env['build_tool'];
8
- const moduleFormat = process.env['module_format'];
9
- const version = process.env['npm_package_version'];
5
+ export { FluentSendBox, FluentThemeProvider, testIds };
10
6
 
11
- const buildInfo = { buildTool, moduleFormat, version };
7
+ // #region Build info
8
+ import buildInfo from './buildInfo';
12
9
 
13
- injectMetaTag(
14
- 'botframework-webchat:fluent-theme',
15
- `version=${process.env['npm_package_version']}; build-tool=${process.env['build_tool']}; module-format=${process.env['module_format']}`
16
- );
10
+ const { object: buildInfoObject, version } = buildInfo;
17
11
 
18
- export { FluentThemeProvider, FluentSendBox, buildInfo, testIds };
12
+ export { buildInfoObject as buildInfo, version };
13
+ // #endregion
@@ -2,15 +2,17 @@
2
2
  import { type ActivityMiddleware, type StyleOptions, type TypingIndicatorMiddleware } from 'botframework-webchat-api';
3
3
  import {
4
4
  createActivityBorderMiddleware,
5
+ createActivityGroupingMiddleware,
5
6
  DecoratorComposer,
6
7
  type DecoratorMiddleware
7
8
  } from 'botframework-webchat-api/decorator';
8
- import { WebChatDecorator } from 'botframework-webchat-component/decorator';
9
9
  import { Components } from 'botframework-webchat-component';
10
+ import { WebChatDecorator } from 'botframework-webchat-component/decorator';
10
11
  import React, { memo, type ReactNode } from 'react';
11
12
 
12
13
  import { ActivityDecorator } from '../components/activity';
13
14
  import ActivityLoader from '../components/activity/ActivityLoader';
15
+ import PartGroupDecorator from '../components/activity/PartGroupingDecorator';
14
16
  import AssetComposer from '../components/assets/AssetComposer';
15
17
  import { isLinerMessageActivity, LinerMessageActivity } from '../components/linerActivity';
16
18
  import { isPreChatMessageActivity, PreChatMessageActivity } from '../components/preChatActivity';
@@ -54,6 +56,12 @@ const activityMiddleware: readonly ActivityMiddleware[] = Object.freeze([
54
56
  const sendBoxMiddleware = [() => () => () => PrimarySendBox];
55
57
 
56
58
  const decoratorMiddleware: readonly DecoratorMiddleware[] = Object.freeze([
59
+ createActivityGroupingMiddleware(next => request => {
60
+ if (request.groupingName === 'part') {
61
+ return PartGroupDecorator;
62
+ }
63
+ return next(request);
64
+ }),
57
65
  createActivityBorderMiddleware(function FluentBorderLoader({ request, Next, ...props }) {
58
66
  return (
59
67
  <ActivityLoader showLoader={props.showLoader ?? request.livestreamingState === 'preparing'}>
package/src/tsconfig.json CHANGED
@@ -1,14 +1,10 @@
1
1
  {
2
- "compilerOptions": {
3
- "allowSyntheticDefaultImports": true,
4
- "checkJs": false,
5
- "jsx": "react",
6
- "moduleResolution": "Bundler",
7
- "skipLibCheck": true,
8
- "target": "ESNext"
9
- },
10
- "extends": [
11
- "@tsconfig/strictest/tsconfig.json",
12
- "@msinternal/botframework-webchat-styles/tsconfig.json"
13
- ]
2
+ "compilerOptions": {
3
+ "allowSyntheticDefaultImports": true,
4
+ "checkJs": false
5
+ },
6
+ "extends": [
7
+ "@msinternal/botframework-webchat-tsconfig/current",
8
+ "@msinternal/botframework-webchat-tsconfig/features/cssModules"
9
+ ]
14
10
  }