fix(sidepanel-js): expose Agent Studio types in SidepanelProps (#2906)
This commit is contained in:
parent
d3d707d875
commit
4710d0ca77
3 changed files with 17 additions and 4 deletions
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue