mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
feat: new grid drop logic
This commit is contained in:
@@ -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(),
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user