diff --git a/libs/components/editor-blocks/src/blocks/page/PageView.tsx b/libs/components/editor-blocks/src/blocks/page/PageView.tsx index 685bd05826..5aca7e6460 100644 --- a/libs/components/editor-blocks/src/blocks/page/PageView.tsx +++ b/libs/components/editor-blocks/src/blocks/page/PageView.tsx @@ -86,7 +86,7 @@ export const PageView: FC = ({ block, editor }) => { alwaysShowPlaceholder ref={textRef} className={'title'} - supportMarkdown={true} + supportMarkdown={false} handleEnter={onTextEnter} placeholder={'Untitled'} block={block} diff --git a/libs/components/editor-plugins/src/menu/command-menu/Menu.tsx b/libs/components/editor-plugins/src/menu/command-menu/Menu.tsx index 78b6ef5ddd..b6d174e513 100644 --- a/libs/components/editor-plugins/src/menu/command-menu/Menu.tsx +++ b/libs/components/editor-plugins/src/menu/command-menu/Menu.tsx @@ -82,6 +82,11 @@ export const CommandMenu = ({ editor, hooks, style }: CommandMenuProps) => { const checkIfShowCommandMenu = useCallback( async (event: React.KeyboardEvent) => { const { type, anchorNode } = editor.selection.currentSelectInfo; + // console.log(await editor.getBlockById(anchorNode.id)); + const activeBlock = await editor.getBlockById(anchorNode.id); + if (activeBlock.type === Protocol.Block.Type.page) { + return; + } if (event.key === '/' && type === 'Range') { if (anchorNode) { const text = editor.blockHelper.getBlockTextBeforeSelection( diff --git a/libs/components/editor-plugins/src/menu/inline-menu/Container.tsx b/libs/components/editor-plugins/src/menu/inline-menu/Container.tsx index 27807b6186..f515f81141 100644 --- a/libs/components/editor-plugins/src/menu/inline-menu/Container.tsx +++ b/libs/components/editor-plugins/src/menu/inline-menu/Container.tsx @@ -1,4 +1,5 @@ import { useState, useEffect } from 'react'; +import { Protocol } from '@toeverything/datasource/db-service'; import { MuiClickAwayListener as ClickAwayListener, MuiGrow as Grow, @@ -22,8 +23,14 @@ export const InlineMenuContainer = ({ editor }: InlineMenuContainerProps) => { useEffect(() => { // const unsubscribe = editor.selection.onSelectionChange(info => { - const unsubscribe = editor.selection.onSelectEnd(info => { + const unsubscribe = editor.selection.onSelectEnd(async info => { const { type, browserSelection, anchorNode } = info; + if (anchorNode) { + const activeBlock = await editor.getBlockById(anchorNode.id); + if (activeBlock.type === Protocol.Block.Type.page) { + return; + } + } if ( type === 'None' || !anchorNode ||