feat: Link feature add search function
This commit is contained in:
@@ -181,12 +181,12 @@ const common_handler_for_inline_menu: ClickItemHandler = ({
|
|||||||
});
|
});
|
||||||
break;
|
break;
|
||||||
case inlineMenuNamesKeys.link:
|
case inlineMenuNamesKeys.link:
|
||||||
// add_link({
|
add_link({
|
||||||
// editor,
|
editor,
|
||||||
// blockId: anchorNodeId,
|
blockId: anchorNodeId,
|
||||||
// });
|
});
|
||||||
editor.plugins.emit('showAddLink');
|
// editor.plugins.emit('showAddLink');
|
||||||
setShow(false);
|
// setShow(false);
|
||||||
break;
|
break;
|
||||||
case inlineMenuNamesKeys.code:
|
case inlineMenuNamesKeys.code:
|
||||||
toggle_text_format({
|
toggle_text_format({
|
||||||
|
|||||||
@@ -128,18 +128,15 @@ export const LinkMenu = ({ editor, hooks }: LinkMenuProps) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const showDoubleLink = () => {
|
const showLinkMenu = () => {
|
||||||
const { anchorNode } = editor.selection.currentSelectInfo;
|
const { anchorNode } = editor.selection.currentSelectInfo;
|
||||||
resetState('', anchorNode.id);
|
resetState('', anchorNode.id);
|
||||||
};
|
};
|
||||||
editor.plugins.observe('showAddLink', showDoubleLink);
|
editor.plugins.observe('showAddLink', showLinkMenu);
|
||||||
return () => editor.plugins.unobserve('showAddLink', showDoubleLink);
|
return () => editor.plugins.unobserve('showAddLink', showLinkMenu);
|
||||||
}, [editor, resetState]);
|
}, [editor, resetState]);
|
||||||
|
|
||||||
const handleSelected = async (id: string) => {
|
const handleSelected = async (id: string) => {};
|
||||||
if (curBlockId) {
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleFilterChange = useCallback(
|
const handleFilterChange = useCallback(
|
||||||
async (e: ChangeEvent<HTMLInputElement>) => {
|
async (e: ChangeEvent<HTMLInputElement>) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user