@@ -4,16 +4,16 @@ import { hooks } from 'botframework-webchat-api';
44import { getOrgSchemaMessage , type WebChatActivity } from 'botframework-webchat-core' ;
55import React , { memo , useCallback , useMemo , useState , type MouseEventHandler } from 'react' ;
66import {
7- any ,
87 array ,
8+ custom ,
99 minLength ,
1010 object ,
1111 optional ,
1212 parse ,
1313 pipe ,
1414 readonly ,
15+ safeParse ,
1516 string ,
16- transform ,
1717 type InferOutput
1818} from 'valibot' ;
1919
@@ -22,19 +22,19 @@ import StackedLayoutRoot from '../../../../../Activity/StackedLayoutRoot';
2222import StackedLayoutStatus from '../../../../../Activity/StackedLayoutStatus' ;
2323import useActivityElementMapRef from '../../../../../providers/ChatHistoryDOM/useActivityElementRef' ;
2424import useActiveDescendantId from '../../../../../providers/TranscriptFocus/useActiveDescendantId' ;
25- import useGetGroupDescendantIdByActivityKey from '../../../../../providers/TranscriptFocus/useGetGroupDescendantIdByActivityKey' ;
2625import useFocusByGroupKey from '../../../../../providers/TranscriptFocus/useFocusByGroupKey' ;
26+ import useGetGroupDescendantIdByActivityKey from '../../../../../providers/TranscriptFocus/useGetGroupDescendantIdByActivityKey' ;
2727import FocusTrap from '../../../../../Transcript/FocusTrap' ;
2828import useRenderActivityProps from '../../../../../Transcript/hooks/useRenderActivityProps' ;
2929import {
3030 TranscriptActivityList ,
3131 TranscriptFocusContent ,
32- TranscriptFocusContentOverlay ,
3332 TranscriptFocusContentActiveDescendant ,
33+ TranscriptFocusContentOverlay ,
3434 TranscriptFocusIndicator
3535} from '../../../../../Transcript/TranscriptFocus' ;
36- import isZeroOrPositive from '../../../../../Utils/isZeroOrPositive' ;
3736import { android } from '../../../../../Utils/detectBrowser' ;
37+ import isZeroOrPositive from '../../../../../Utils/isZeroOrPositive' ;
3838import CollapsibleGrouping from '../CollapsibleGrouping' ;
3939import usePartGroupingLogicalGroup from './usePartGroupingLogicalGroup' ;
4040
@@ -45,12 +45,7 @@ const { useAvatarForBot, useStyleOptions, useGetKeyByActivity } = hooks;
4545const partGroupingActivityPropsSchema = pipe (
4646 object ( {
4747 activities : pipe (
48- array (
49- pipe (
50- any ( ) ,
51- transform ( value => value as WebChatActivity )
52- )
53- ) ,
48+ array ( pipe ( custom < Readonly < WebChatActivity > > ( value => safeParse ( object ( { } ) , value ) . success ) ) ) ,
5449 minLength ( 1 , 'botframework-webchat: "activities" must have at least 1 activity' ) ,
5550 readonly ( )
5651 ) ,
@@ -63,11 +58,7 @@ type PartGroupingActivityProps = InferOutput<typeof partGroupingActivityPropsSch
6358
6459const partGroupingFocusableActivityPropsSchema = pipe (
6560 object ( {
66- activity : pipe (
67- any ( ) ,
68- transform ( value => value as WebChatActivity ) ,
69- readonly ( )
70- ) ,
61+ activity : pipe ( custom < Readonly < WebChatActivity > > ( value => safeParse ( object ( { } ) , value ) . success ) ) ,
7162 children : optional ( reactNode ( ) ) ,
7263 className : optional ( string ( ) ) ,
7364 groupKey : string ( )
0 commit comments