Chore: frontend infrastructure upgrade (#16420)

Co-authored-by: NFish <douxc512@gmail.com>
Co-authored-by: zxhlyh <jasonapring2015@outlook.com>
Co-authored-by: twwu <twwu@dify.ai>
Co-authored-by: jZonG <jzongcode@gmail.com>
This commit is contained in:
Joel 2025-03-21 17:41:03 +08:00 • committed by GitHub
commit 7709d9df20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
1435 changed files with 13372 additions and 11612 deletions

View file

@ -105,12 +105,16 @@ export function PortalToFollowElem({
)
}
export const PortalToFollowElemTrigger = React.forwardRef<
HTMLElement,
React.HTMLProps<HTMLElement> & { asChild?: boolean }
>(({ children, asChild = false, ...props }, propRef) => {
export const PortalToFollowElemTrigger = (
{
ref: propRef,
children,
asChild = false,
...props
}: React.HTMLProps<HTMLElement> & { ref?: React.RefObject<HTMLElement>, asChild?: boolean },
) => {
const context = usePortalToFollowElemContext()
const childrenRef = (children as any).ref
const childrenRef = (children as any).props?.ref
const ref = useMergeRefs([context.refs.setReference, propRef, childrenRef])
// `asChild` allows the user to pass any element as the anchor
@ -137,13 +141,18 @@ React.HTMLProps<HTMLElement> & { asChild?: boolean }
{children}
</div>
)
})
}
PortalToFollowElemTrigger.displayName = 'PortalToFollowElemTrigger'
export const PortalToFollowElemContent = React.forwardRef<
HTMLDivElement,
React.HTMLProps<HTMLDivElement>
>(({ style, ...props }, propRef) => {
export const PortalToFollowElemContent = (
{
ref: propRef,
style,
...props
}: React.HTMLProps<HTMLDivElement> & {
ref?: React.RefObject<HTMLDivElement>;
},
) => {
const context = usePortalToFollowElemContext()
const ref = useMergeRefs([context.refs.setFloating, propRef])
@ -164,6 +173,6 @@ export const PortalToFollowElemContent = React.forwardRef<
/>
</FloatingPortal>
)
})
}
PortalToFollowElemContent.displayName = 'PortalToFollowElemContent'