11import { reactNode } from '@msinternal/botframework-webchat-react-valibot' ;
2+ import { useStyles } from '@msinternal/botframework-webchat-styles/react' ;
23import { hooks } from 'botframework-webchat-api' ;
34import { getOrgSchemaMessage , type WebChatActivity } from 'botframework-webchat-core' ;
45import React , { memo , useCallback , useMemo , useState , type MouseEventHandler } from 'react' ;
@@ -37,6 +38,8 @@ import isZeroOrPositive from '../../../../../Utils/isZeroOrPositive';
3738import { android } from '../../../../../Utils/detectBrowser' ;
3839import TranscriptActivityList from '../../../../../Transcript/TranscriptFocus/TranscriptActivityList' ;
3940
41+ import styles from './PartGroupingActivity.module.css' ;
42+
4043const { useAvatarForBot, useStyleOptions, useGetKeyByActivity } = hooks ;
4144
4245const partGroupingActivityPropsSchema = pipe (
@@ -65,8 +68,9 @@ const partGroupingFocusableActivityPropsSchema = pipe(
6568 transform ( value => value as WebChatActivity ) ,
6669 readonly ( )
6770 ) ,
68- groupKey : string ( ) ,
69- children : optional ( reactNode ( ) )
71+ children : optional ( reactNode ( ) ) ,
72+ className : optional ( string ( ) ) ,
73+ groupKey : string ( )
7074 } ) ,
7175 readonly ( )
7276) ;
@@ -75,7 +79,7 @@ type FocusablePartGroupingActivityProps = InferOutput<typeof partGroupingFocusab
7579
7680function FocusablePartGroupingActivity ( props : FocusablePartGroupingActivityProps ) {
7781 const [ activeDescendantId ] = useActiveDescendantId ( ) ;
78- const { activity, children, groupKey } = parse ( partGroupingFocusableActivityPropsSchema , props ) ;
82+ const { activity, children, className , groupKey } = parse ( partGroupingFocusableActivityPropsSchema , props ) ;
7983
8084 const getGroupDescendantIdByActivityKey = useGetGroupDescendantIdByActivityKey ( ) ;
8185 const focusByGroupKey = useFocusByGroupKey ( ) ;
@@ -114,6 +118,7 @@ function FocusablePartGroupingActivity(props: FocusablePartGroupingActivityProps
114118
115119 return (
116120 < TranscriptFocusContent
121+ className = { className }
117122 focused = { isActiveDescendant }
118123 onMouseDownCapture = { handleMouseDownCapture }
119124 ref = { groupCallbackRef }
@@ -134,6 +139,7 @@ function FocusablePartGroupingActivity(props: FocusablePartGroupingActivityProps
134139}
135140
136141function PartGroupingActivity ( props : PartGroupingActivityProps ) {
142+ const classNames = useStyles ( styles ) ;
137143 const { activities, children } = parse ( partGroupingActivityPropsSchema , props ) ;
138144 const getKeyByActivity = useGetKeyByActivity ( ) ;
139145 const [ isGroupOpen , setIsGroupOpen ] = useState ( true ) ;
@@ -175,7 +181,11 @@ function PartGroupingActivity(props: PartGroupingActivityProps) {
175181 const topAlignedCallout = isZeroOrPositive ( bubbleNubOffset ) ;
176182
177183 return (
178- < FocusablePartGroupingActivity activity = { firstActivity } groupKey = { groupKey } >
184+ < FocusablePartGroupingActivity
185+ activity = { firstActivity }
186+ className = { classNames [ 'part-grouping-activity' ] }
187+ groupKey = { groupKey }
188+ >
179189 < StackedLayoutRoot
180190 hideAvatar = { hasAvatar && ! showAvatar }
181191 isGroup = { true }
@@ -184,7 +194,9 @@ function PartGroupingActivity(props: PartGroupingActivityProps) {
184194 >
185195 < StackedLayoutMain avatar = { showAvatar && renderAvatar && renderAvatar ( ) } >
186196 < CollapsibleGrouping isOpen = { isGroupOpen } onToggle = { setIsGroupOpen } title = { currentMessage ?. abstract || '' } >
187- < TranscriptActivityList > { children } </ TranscriptActivityList >
197+ < TranscriptActivityList className = { classNames [ 'part-grouping-activity__activities' ] } >
198+ { children }
199+ </ TranscriptActivityList >
188200 </ CollapsibleGrouping >
189201 </ StackedLayoutMain >
190202 { renderActivityStatus && < StackedLayoutStatus > { renderActivityStatus ( { hideTimestamp } ) } </ StackedLayoutStatus > }
0 commit comments