fix: rebase glitch

This commit is contained in:
DarkSky
2022-08-01 02:15:25 +08:00
parent 36d8c0493d
commit d7a5809861
10 changed files with 34 additions and 40 deletions

View File

@@ -11,6 +11,7 @@ import {
type ReturnUnobserve,
} from '@toeverything/datasource/db-service';
import { addNewGroup } from './recast-block';
import { useIsOnDrag } from './hooks';
interface RenderRootProps {
editor: BlockEditor;
@@ -133,6 +134,8 @@ export const RenderRoot: FC<PropsWithChildren<RenderRootProps>> = ({
};
const onDragOver = (event: React.DragEvent<Element>) => {
event.dataTransfer.dropEffect = 'move';
event.preventDefault();
editor.dragDropManager.handlerEditorDragOver(event);
if (editor.dragDropManager.isEnabled()) {
editor.getHooks().onRootNodeDragOver(event);
@@ -140,6 +143,7 @@ export const RenderRoot: FC<PropsWithChildren<RenderRootProps>> = ({
};
const onDragOverCapture = (event: React.DragEvent<Element>) => {
event.preventDefault();
if (editor.dragDropManager.isEnabled()) {
editor.getHooks().onRootNodeDragOver(event);
}
@@ -177,6 +181,7 @@ export const RenderRoot: FC<PropsWithChildren<RenderRootProps>> = ({
onDragOverCapture={onDragOverCapture}
onDragEnd={onDragEnd}
onDrop={onDrop}
isOnDrag={isOnDrag}
>
<Content style={{ maxWidth: pageWidth + 'px' }}>
{children}