1
0
Fork 0

fix(sidepanel-js): expose Agent Studio types in SidepanelProps (#2906)

This commit is contained in:
Divyansh Singh 2026-07-06 10:21:38 +05:30 committed by GitHub
parent d3d707d875
commit 4710d0ca77
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 4 deletions

View file

@ -27,7 +27,13 @@ function isEditingContent(event: KeyboardEvent): boolean {
const element = event.composedPath()[0] as HTMLElement;
const tagName = element.tagName;
return element.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA' || tagName === 'BUTTON';
return (
element.isContentEditable ||
tagName === 'INPUT' ||
tagName === 'SELECT' ||
tagName === 'TEXTAREA' ||
tagName === 'BUTTON'
);
}
export function useDocSearchKeyboardEvents({

View file

@ -28,7 +28,13 @@ function isEditingContent(event: KeyboardEvent): boolean {
const element = event.composedPath()[0] as HTMLElement;
const tagName = element.tagName;
return element.isContentEditable || tagName === 'INPUT' || tagName === 'SELECT' || tagName === 'TEXTAREA' || tagName === 'BUTTON';
return (
element.isContentEditable ||
tagName === 'INPUT' ||
tagName === 'SELECT' ||
tagName === 'TEXTAREA' ||
tagName === 'BUTTON'
);
}
export function useDocSearchKeyboardEvents({

View file

@ -1,5 +1,5 @@
import type { DocSearchRef, InitialAskAiMessage } from '@docsearch/core';
import type { DocSearchSidepanelProps } from '@docsearch/react/sidepanel';
import type { DocSearchSidepanelProps, SidepanelSearchParameters } from '@docsearch/react/sidepanel';
import { DocSearchSidepanel } from '@docsearch/react/sidepanel';
import { render, createElement, unmountComponentAtNode, createRef } from 'preact/compat';
@ -32,7 +32,8 @@ export interface SidepanelCallbacks {
}
export type SidepanelProps = DocSearchSidepanelProps &
SidepanelCallbacks & {
SidepanelCallbacks &
SidepanelSearchParameters & {
container: HTMLElement | string;
environment?: typeof window;
};