Module: @lexical/react/LexicalContextMenuPlugin
Classes
Type Aliases
ContextMenuRenderFn
Ƭ ContextMenuRenderFn<TOption
>: (anchorElementRef
: MutableRefObject
<HTMLElement
| null
>, itemProps
: { options
: TOption
[] ; selectOptionAndCleanUp
: (option
: TOption
) => void
; selectedIndex
: number
| null
; setHighlightedIndex
: (index
: number
) => void
}, menuProps
: { setMenuRef
: (element
: HTMLElement
| null
) => void
}) => ReactPortal
| JSX.Element
| null
Type parameters
Name | Type |
---|---|
TOption | extends MenuOption |
Type declaration
▸ (anchorElementRef
, itemProps
, menuProps
): ReactPortal
| JSX.Element
| null
Parameters
Name | Type |
---|---|
anchorElementRef | MutableRefObject <HTMLElement | null > |
itemProps | Object |
itemProps.options | TOption [] |
itemProps.selectOptionAndCleanUp | (option : TOption ) => void |
itemProps.selectedIndex | number | null |
itemProps.setHighlightedIndex | (index : number ) => void |
menuProps | Object |
menuProps.setMenuRef | (element : HTMLElement | null ) => void |
Returns
ReactPortal
| JSX.Element
| null
Defined in
packages/lexical-react/src/LexicalContextMenuPlugin.tsx:28
LexicalContextMenuPluginProps
Ƭ LexicalContextMenuPluginProps<TOption
>: Object
Type parameters
Name | Type |
---|---|
TOption | extends MenuOption |
Type declaration
Name | Type |
---|---|
anchorClassName? | string |
commandPriority? | CommandListenerPriority |
menuRenderFn | ContextMenuRenderFn <TOption > |
onClose? | () => void |
onOpen? | (resolution : MenuResolution ) => void |
onSelectOption | (option : TOption , textNodeContainingQuery : LexicalNode | null , closeMenu : () => void , matchingString : string ) => void |
onWillOpen? | (event : MouseEvent ) => void |
options | TOption [] |
parent? | HTMLElement |
Defined in
packages/lexical-react/src/LexicalContextMenuPlugin.tsx:41
MenuRenderFn
Ƭ MenuRenderFn<TOption
>: (anchorElementRef
: MutableRefObject
<HTMLElement
| null
>, itemProps
: { options
: TOption
[] ; selectOptionAndCleanUp
: (option
: TOption
) => void
; selectedIndex
: number
| null
; setHighlightedIndex
: (index
: number
) => void
}, matchingString
: string
| null
) => ReactPortal
| JSX.Element
| null
Type parameters
Name | Type |
---|---|
TOption | extends MenuOption |
Type declaration
▸ (anchorElementRef
, itemProps
, matchingString
): ReactPortal
| JSX.Element
| null
Parameters
Name | Type |
---|---|
anchorElementRef | MutableRefObject <HTMLElement | null > |
itemProps | Object |
itemProps.options | TOption [] |
itemProps.selectOptionAndCleanUp | (option : TOption ) => void |
itemProps.selectedIndex | number | null |
itemProps.setHighlightedIndex | (index : number ) => void |
matchingString | string | null |
Returns
ReactPortal
| JSX.Element
| null
Defined in
packages/lexical-react/src/shared/LexicalMenu.ts:67
MenuResolution
Ƭ MenuResolution: Object
Type declaration
Name | Type |
---|---|
getRect | () => DOMRect |
match? | MenuTextMatch |
Defined in
packages/lexical-react/src/shared/LexicalMenu.ts:44
Functions
LexicalContextMenuPlugin
▸ LexicalContextMenuPlugin<TOption
>(«destructured»
): JSX.Element
| null
Type parameters
Name | Type |
---|---|
TOption | extends MenuOption |
Parameters
Name | Type |
---|---|
«destructured» | LexicalContextMenuPluginProps <TOption > |
Returns
JSX.Element
| null