diff --git a/app/editor/components/BlockMenu.tsx b/app/editor/components/BlockMenu.tsx index 0e697a11b6fc..8f50a0af5570 100644 --- a/app/editor/components/BlockMenu.tsx +++ b/app/editor/components/BlockMenu.tsx @@ -6,10 +6,7 @@ import SuggestionsMenu, { } from "./SuggestionsMenu"; import SuggestionsMenuItem from "./SuggestionsMenuItem"; -type Props = Omit< - SuggestionsMenuProps, - "renderMenuItem" | "items" | "trigger" -> & +type Props = Omit & Required>; function BlockMenu(props: Props) { diff --git a/app/editor/components/EmojiMenu.tsx b/app/editor/components/EmojiMenu.tsx index c2e21bacbffe..0aa7d1acbff8 100644 --- a/app/editor/components/EmojiMenu.tsx +++ b/app/editor/components/EmojiMenu.tsx @@ -17,7 +17,7 @@ type Emoji = { type Props = Omit< SuggestionsMenuProps, - "renderMenuItem" | "items" | "embeds" | "trigger" + "renderMenuItem" | "items" | "embeds" >; const EmojiMenu = (props: Props) => { @@ -48,7 +48,6 @@ const EmojiMenu = (props: Props) => { return ( ( , - "renderMenuItem" | "items" | "embeds" | "trigger" + "renderMenuItem" | "items" | "embeds" >; function MentionMenu({ search, isActive, ...rest }: Props) { @@ -194,7 +194,6 @@ function MentionMenu({ search, isActive, ...rest }: Props) { {...rest} isActive={isActive} filterable={false} - trigger="@" search={search} onSelect={handleSelect} renderMenuItem={(item, _index, options) => ( diff --git a/app/editor/components/PasteMenu.tsx b/app/editor/components/PasteMenu.tsx index b8d4e552c853..883d06c3cafd 100644 --- a/app/editor/components/PasteMenu.tsx +++ b/app/editor/components/PasteMenu.tsx @@ -9,7 +9,7 @@ import SuggestionsMenuItem from "./SuggestionsMenuItem"; type Props = Omit< SuggestionsMenuProps, - "renderMenuItem" | "items" | "embeds" + "renderMenuItem" | "items" | "embeds" | "trigger" > & { pastedText: string; embeds: EmbedDescriptor[]; @@ -48,6 +48,7 @@ const PasteMenu = ({ embeds, ...props }: Props) => { return ( ( { + const { view } = this.editor; + + if (insertNewLine) { + const transaction = view.state.tr.split(view.state.selection.to); + view.dispatch(transaction); + view.focus(); + } + + this.state.open = false; + }); + widget = ({ rtl }: WidgetProps) => { - const { props, view } = this.editor; + const { props } = this.editor; + return ( { - if (insertNewLine) { - const transaction = view.state.tr.split(view.state.selection.to); - view.dispatch(transaction); - view.focus(); - } - - this.state.open = false; - })} + onClose={this.handleClose} uploadFile={props.uploadFile} onFileUploadStart={props.onFileUploadStart} onFileUploadStop={props.onFileUploadStop} diff --git a/app/editor/extensions/EmojiMenu.tsx b/app/editor/extensions/EmojiMenu.tsx index 74de1f09f903..3743990b1fb7 100644 --- a/app/editor/extensions/EmojiMenu.tsx +++ b/app/editor/extensions/EmojiMenu.tsx @@ -33,6 +33,7 @@ export default class EmojiMenuExtension extends Suggestion { widget = ({ rtl }: WidgetProps) => ( { diff --git a/app/editor/extensions/MentionMenu.tsx b/app/editor/extensions/MentionMenu.tsx index 668fc858541d..b8815bf08b89 100644 --- a/app/editor/extensions/MentionMenu.tsx +++ b/app/editor/extensions/MentionMenu.tsx @@ -21,6 +21,7 @@ export default class MentionMenuExtension extends Suggestion { widget = ({ rtl }: WidgetProps) => ( { diff --git a/app/editor/extensions/PasteHandler.tsx b/app/editor/extensions/PasteHandler.tsx index 6409c901ec05..1e2401b417f3 100644 --- a/app/editor/extensions/PasteHandler.tsx +++ b/app/editor/extensions/PasteHandler.tsx @@ -466,7 +466,6 @@ export default class PasteHandler extends Extension { widget = ({ rtl }: WidgetProps) => (