feat: new grid drop logic

This commit is contained in:
SaikaSakura committed 2022-08-09 18:44:14 +08:00
1 parent 73d7d4e1a8
commit 4522e0a56c
4 files changed
+52 -22

No files matched your search

@@ -18,6 +18,7 @@ import {
menuItemsMap,
} from './config';
import { QueryResult } from '../../search';
import { getBlockIdByNode } from '@toeverything/utils';
export type CommandMenuProps = {
editor: Virgo;
@@ -105,16 +105,17 @@ export class LeftMenuPlugin extends BasePlugin {
new Point(event.clientX, event.clientY)
);
if (block == null || ignoreBlockTypes.includes(block.type)) return;
const direction = await this.editor.dragDropManager.checkBlockDragTypes(
event,
block.dom,
block.id
);
const { direction, block: targetBlock } =
await this.editor.dragDropManager.checkBlockDragTypes(
event,
block.dom,
block.id
);
this._lineInfo.next({
direction,
blockInfo: {
block,
rect: block.dom.getBoundingClientRect(),
block: targetBlock,
rect: targetBlock.dom.getBoundingClientRect(),
},
});
};