mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-18 10:36:22 +08:00
fix: rebase glitch
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -13,6 +13,7 @@ export function DragDropWrapper({
|
||||
block,
|
||||
}: DragDropWrapperProps) {
|
||||
const handlerDragOver: React.DragEventHandler<HTMLDivElement> = event => {
|
||||
event.preventDefault();
|
||||
if (block.dom) {
|
||||
editor.getHooks().afterOnNodeDragOver(event, {
|
||||
blockId: block.id,
|
||||
|
||||
@@ -15,7 +15,7 @@ type ScrollController = {
|
||||
};
|
||||
|
||||
export class ScrollManager {
|
||||
private _editor: Block_editor;
|
||||
private _editor: BlockEditor;
|
||||
private _scrollContainer: HTMLElement;
|
||||
private _animationFrame: null | number = null;
|
||||
private _eventName = 'scrolling';
|
||||
|
||||
@@ -143,7 +143,7 @@ export const useRecastView = () => {
|
||||
updateView,
|
||||
renameView,
|
||||
removeView,
|
||||
// TODO reorder API
|
||||
// TODO: reorder API
|
||||
|
||||
withKanbanView,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user