diff --git a/libs/components/editor-plugins/src/menu/left-menu/LeftMenu.tsx b/libs/components/editor-plugins/src/menu/left-menu/LeftMenu.tsx index 38db125aca..043b9a77c6 100644 --- a/libs/components/editor-plugins/src/menu/left-menu/LeftMenu.tsx +++ b/libs/components/editor-plugins/src/menu/left-menu/LeftMenu.tsx @@ -1,8 +1,10 @@ import { useMemo } from 'react'; import { Virgo, PluginHooks } from '@toeverything/framework/virgo'; import { Cascader, CascaderItemProps } from '@toeverything/components/ui'; +import { Protocol } from '@toeverything/datasource/db-service'; import { TurnIntoMenu } from './TurnIntoMenu'; import { + AddViewIcon, DeleteCashBinIcon, TurnIntoIcon, UngroupIcon, @@ -45,6 +47,24 @@ export function LeftMenu(props: LeftMenuProps) { ), icon: , }, + { + title: 'Add A Below Block', + icon: , + callback: async () => { + const block = await editor.getBlockById(blockId); + const belowType = [ + Protocol.Block.Type.numbered, + Protocol.Block.Type.bullet, + Protocol.Block.Type.todo, + ].some(type => type === block.type) + ? block.type + : Protocol.Block.Type.text; + editor.commands.blockCommands.createNextBlock( + blockId, + belowType + ); + }, + }, { title: 'Divide Here As A New Group', icon: ,