There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.
TypeScript appcrdteditorelectronknowledge-basemarkdownmironotesnotionnotion-alternativerustrust-langrust-languagetabletableviewwhiteboardwikiworkspace
feature: add a left menu option to add a below block (#232)
Simon Li2560c7b07404
diff --git a/libs/components/editor-plugins/src/menu/left-menu/LeftMenu.tsx b/libs/components/editor-plugins/src/menu/left-menu/LeftMenu.tsxindex 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: <TurnIntoIcon />,},+ {+ title: 'Add A Below Block',+ icon: <AddViewIcon />,+ 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: <UngroupIcon />,