11import { validateProps } from '@msinternal/botframework-webchat-react-valibot' ;
22import { type WebChatActivity } from 'botframework-webchat-core' ;
33import React , { memo , useMemo } from 'react' ;
4- import { any , boolean , custom , object , pipe , readonly , safeParse , type InferInput } from 'valibot' ;
4+ import { any , custom , object , pipe , readonly , safeParse , type InferInput } from 'valibot' ;
55
66import templatePolymiddleware , {
77 type InferHandler ,
@@ -28,7 +28,6 @@ const {
2828 {
2929 readonly [ __INTERNAL_DO_NOT_USE__avatarPolymiddlewareRequestStyleOptionsSymbol ] : any ;
3030 readonly activity : WebChatActivity ;
31- readonly fromUser : boolean ;
3231 } ,
3332 { readonly children ?: never }
3433> ( 'avatar' ) ;
@@ -44,8 +43,7 @@ type AvatarPolymiddlewareProviderProps = InferProviderProps<typeof AvatarPolymid
4443const avatarPolymiddlewareProxyPropsSchema = pipe (
4544 object ( {
4645 [ __INTERNAL_DO_NOT_USE__avatarPolymiddlewareRequestStyleOptionsSymbol ] : any ( ) ,
47- activity : custom < Readonly < WebChatActivity > > ( value => safeParse ( object ( { } ) , value ) . success ) ,
48- fromUser : boolean ( )
46+ activity : custom < Readonly < WebChatActivity > > ( value => safeParse ( object ( { } ) , value ) . success )
4947 } ) ,
5048 readonly ( )
5149) ;
@@ -54,20 +52,16 @@ type AvatarPolymiddlewareProxyProps = Readonly<InferInput<typeof avatarPolymiddl
5452
5553// A friendlier version than the organic <Proxy>.
5654const AvatarPolymiddlewareProxy = memo ( function AvatarPolymiddlewareProxy ( props : AvatarPolymiddlewareProxyProps ) {
57- const {
58- [ __INTERNAL_DO_NOT_USE__avatarPolymiddlewareRequestStyleOptionsSymbol ] : styleOptions ,
59- activity,
60- fromUser
61- } = validateProps ( avatarPolymiddlewareProxyPropsSchema , props ) ;
55+ const { [ __INTERNAL_DO_NOT_USE__avatarPolymiddlewareRequestStyleOptionsSymbol ] : styleOptions , activity } =
56+ validateProps ( avatarPolymiddlewareProxyPropsSchema , props ) ;
6257
6358 const request = useMemo (
6459 ( ) =>
6560 Object . freeze ( {
6661 [ __INTERNAL_DO_NOT_USE__avatarPolymiddlewareRequestStyleOptionsSymbol ] : styleOptions ,
67- activity,
68- fromUser
62+ activity
6963 } ) ,
70- [ activity , fromUser , styleOptions ]
64+ [ activity , styleOptions ]
7165 ) ;
7266
7367 return < Proxy request = { request } /> ;
0 commit comments