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