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
@@ -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,
};