-
Notifications
You must be signed in to change notification settings - Fork 2.1k
[lexical-react] Annotate @deprecated to menuRenderFn with NodeContext… #8001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
c8faf7b
09e2956
3c65431
fe42bf8
6f8689b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,6 +55,10 @@ type NodeMenuPluginProps<TOption> = { | |
| nodeKey: NodeKey | null, | ||
| onClose?: () => void, | ||
| onOpen?: (resolution: MenuResolution) => void, | ||
| /** | ||
| * @deprecated Use NodeContextMenuPlugin instead. Here is an example for using NodeContextMenuPlugin: | ||
thatmichael85 marked this conversation as resolved.
Show resolved
Hide resolved
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is also not correct. NodeContextMenuPlugin is a replacement only for ContextMenuPlugin, nothing else. |
||
| * https://github.com/facebook/lexical/blob/main/packages/lexical-playground/src/plugins/ContextMenuPlugin/index.tsx | ||
| */ | ||
| menuRenderFn: MenuRenderFn<TOption>, | ||
| anchorClassName?: string, | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,6 +66,10 @@ export type TypeaheadMenuPluginProps<TOption> = { | |
| matchingString: string, | ||
| ) => void, | ||
| options: Array<TOption>, | ||
| /** | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove this one as well please. |
||
| * @deprecated Use NodeContextMenuPlugin instead. Here is an example for using NodeContextMenuPlugin: | ||
| * https://github.com/facebook/lexical/blob/main/packages/lexical-playground/src/plugins/ContextMenuPlugin/index.tsx | ||
| */ | ||
| menuRenderFn: MenuRenderFn<TOption>, | ||
| triggerFn: TriggerFn, | ||
| onOpen?: (resolution: MenuResolution) => void, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -84,6 +84,10 @@ type LexicalAutoEmbedPluginProps<TEmbedConfig extends EmbedConfig> = { | |
| embedFn: () => void, | ||
| dismissFn: () => void, | ||
| ) => Array<AutoEmbedOption>; | ||
| /** | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Incorrect as well. |
||
| * @deprecated Use NodeContextMenuPlugin instead. Here is an example for using NodeContextMenuPlugin: | ||
| * https://github.com/facebook/lexical/blob/main/packages/lexical-playground/src/plugins/ContextMenuPlugin/index.tsx | ||
| */ | ||
| menuRenderFn: MenuRenderFn<AutoEmbedOption>; | ||
| menuCommandPriority?: CommandListenerPriority; | ||
| }; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,10 @@ export type LexicalContextMenuPluginProps<TOption extends MenuOption> = { | |
| onClose?: () => void; | ||
| onWillOpen?: (event: MouseEvent) => void; | ||
| onOpen?: (resolution: MenuResolution) => void; | ||
| /** | ||
| * @deprecated Use LexicalNodeContextMenuPlugin instead. Here is an example for using NodeContextMenuPlugin: | ||
| * https://github.com/facebook/lexical/blob/main/packages/lexical-playground/src/plugins/ContextMenuPlugin/index.tsx | ||
| */ | ||
| menuRenderFn: ContextMenuRenderFn<TOption>; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Besides marking it as deprecated, is it possible to restore the new API that @ivailop7 introduced so that we only get to this as a workaround for surfaces that are time-consuming to migrate? I see there's still a few playground callsites that are using this property already. |
||
| anchorClassName?: string; | ||
| commandPriority?: CommandListenerPriority; | ||
|
|
@@ -54,7 +58,9 @@ export type LexicalContextMenuPluginProps<TOption extends MenuOption> = { | |
| const PRE_PORTAL_DIV_SIZE = 1; | ||
|
|
||
| /** | ||
| * @deprecated Use LexicalNodeContextMenuPlugin instead. | ||
| * @deprecated Use LexicalNodeContextMenuPlugin instead. It will be removed soon. | ||
| * Here is an example for using NodeContextMenuPlugin: | ||
| * https://github.com/facebook/lexical/blob/main/packages/lexical-playground/src/plugins/ContextMenuPlugin/index.tsx | ||
| */ | ||
| export function LexicalContextMenuPlugin<TOption extends MenuOption>({ | ||
| options, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,10 @@ export type NodeMenuPluginProps<TOption extends MenuOption> = { | |
| nodeKey: NodeKey | null; | ||
| onClose?: () => void; | ||
| onOpen?: (resolution: MenuResolution) => void; | ||
| /** | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not true |
||
| * @deprecated Use NodeContextMenuPlugin instead. Here is an example for using NodeContextMenuPlugin: | ||
| * https://github.com/facebook/lexical/blob/main/packages/lexical-playground/src/plugins/ContextMenuPlugin/index.tsx | ||
| */ | ||
| menuRenderFn: MenuRenderFn<TOption>; | ||
| anchorClassName?: string; | ||
| commandPriority?: CommandListenerPriority; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -202,6 +202,10 @@ export type TypeaheadMenuPluginProps<TOption extends MenuOption> = { | |
| matchingString: string, | ||
| ) => void; | ||
| options: Array<TOption>; | ||
| /** | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please remove this as well. |
||
| * @deprecated Use NodeContextMenuPlugin instead. Here is an example for using NodeContextMenuPlugin: | ||
| * https://github.com/facebook/lexical/blob/main/packages/lexical-playground/src/plugins/ContextMenuPlugin/index.tsx | ||
| */ | ||
| menuRenderFn: MenuRenderFn<TOption>; | ||
| triggerFn: TriggerFn; | ||
| onOpen?: (resolution: MenuResolution) => void; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not correct. NodeContextMenuPlugin is not a replacement for AutoEmbedPlugin