Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/lexical-react/flow/LexicalAutoEmbedPlugin.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ type LexicalAutoEmbedPluginProps<TEmbedConfig> = {
embedFn: () => void,
dismissFn: () => void,
) => Array<AutoEmbedOption>,
/**
* @deprecated Use NodeContextMenuPlugin instead. Here is an example for using NodeContextMenuPlugin:
Copy link
Collaborator

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

* https://github.com/facebook/lexical/blob/main/packages/lexical-playground/src/plugins/ContextMenuPlugin/index.tsx
*/
menuRenderFn: MenuRenderFn<AutoEmbedOption>,
};

Expand Down
4 changes: 4 additions & 0 deletions packages/lexical-react/flow/LexicalNodeMenuPlugin.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Copy link
Collaborator

Choose a reason for hiding this comment

The 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,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ export type TypeaheadMenuPluginProps<TOption> = {
matchingString: string,
) => void,
options: Array<TOption>,
/**
Copy link
Collaborator

Choose a reason for hiding this comment

The 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,
Expand Down
4 changes: 4 additions & 0 deletions packages/lexical-react/src/LexicalAutoEmbedPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ type LexicalAutoEmbedPluginProps<TEmbedConfig extends EmbedConfig> = {
embedFn: () => void,
dismissFn: () => void,
) => Array<AutoEmbedOption>;
/**
Copy link
Collaborator

Choose a reason for hiding this comment

The 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;
};
Expand Down
8 changes: 7 additions & 1 deletion packages/lexical-react/src/LexicalContextMenuPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Copy link
Member

Choose a reason for hiding this comment

The 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;
Expand All @@ -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,
Expand Down
4 changes: 4 additions & 0 deletions packages/lexical-react/src/LexicalNodeMenuPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ export type NodeMenuPluginProps<TOption extends MenuOption> = {
nodeKey: NodeKey | null;
onClose?: () => void;
onOpen?: (resolution: MenuResolution) => void;
/**
Copy link
Collaborator

Choose a reason for hiding this comment

The 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;
Expand Down
4 changes: 4 additions & 0 deletions packages/lexical-react/src/LexicalTypeaheadMenuPlugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,10 @@ export type TypeaheadMenuPluginProps<TOption extends MenuOption> = {
matchingString: string,
) => void;
options: Array<TOption>;
/**
Copy link
Collaborator

Choose a reason for hiding this comment

The 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;
Expand Down