mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-11 23:26:30 +08:00
merge branch develop into branch feat/doublelink220820
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { containerFlavor } from '@toeverything/datasource/db-service';
|
||||
import { BlockDropPlacement, HookType } from '@toeverything/framework/virgo';
|
||||
import { domToRect, last, Point } from '@toeverything/utils';
|
||||
import { StrictMode } from 'react';
|
||||
@@ -9,7 +10,6 @@ import {
|
||||
LeftMenuDraggable,
|
||||
LineInfoSubject,
|
||||
} from './LeftMenuDraggable';
|
||||
import { ignoreBlockTypes } from './menu-config';
|
||||
const DRAG_THROTTLE_DELAY = 60;
|
||||
export class LeftMenuPlugin extends BasePlugin {
|
||||
private _mousedown?: boolean;
|
||||
@@ -104,7 +104,7 @@ export class LeftMenuPlugin extends BasePlugin {
|
||||
const block = await this.editor.getBlockByPoint(
|
||||
new Point(event.clientX, event.clientY)
|
||||
);
|
||||
if (block == null || ignoreBlockTypes.includes(block.type)) return;
|
||||
if (block == null || containerFlavor.includes(block.type)) return;
|
||||
const { direction, block: targetBlock } =
|
||||
await this.editor.dragDropManager.checkBlockDragTypes(
|
||||
event,
|
||||
@@ -143,7 +143,7 @@ export class LeftMenuPlugin extends BasePlugin {
|
||||
const node = await this.editor.getBlockByPoint(
|
||||
new Point(event.clientX, event.clientY)
|
||||
);
|
||||
if (node == null || ignoreBlockTypes.includes(node.type)) {
|
||||
if (node == null || containerFlavor.includes(node.type)) {
|
||||
return;
|
||||
}
|
||||
if (node.dom) {
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { BlockFlavorKeys, Protocol } from '@toeverything/datasource/db-service';
|
||||
import ShortTextIcon from '@mui/icons-material/ShortText';
|
||||
import TitleIcon from '@mui/icons-material/Title';
|
||||
import FormatListBulletedIcon from '@mui/icons-material/FormatListBulleted';
|
||||
import HorizontalRuleIcon from '@mui/icons-material/HorizontalRule';
|
||||
import ListIcon from '@mui/icons-material/List';
|
||||
import NotificationsNoneIcon from '@mui/icons-material/NotificationsNone';
|
||||
import ShortTextIcon from '@mui/icons-material/ShortText';
|
||||
import TitleIcon from '@mui/icons-material/Title';
|
||||
import {
|
||||
CodeBlockInlineIcon,
|
||||
PagesIcon,
|
||||
} from '@toeverything/components/common';
|
||||
import ListIcon from '@mui/icons-material/List';
|
||||
import { Protocol } from '@toeverything/datasource/db-service';
|
||||
export const MENU_WIDTH = 14;
|
||||
export const pageConvertIconSize = 24;
|
||||
type MenuItem = {
|
||||
@@ -93,12 +93,3 @@ const textTypeBlocks: MenuItem[] = [
|
||||
export const addMenuList = [...textTypeBlocks].filter(v => v);
|
||||
|
||||
export const textConvertMenuList = textTypeBlocks;
|
||||
|
||||
export const ignoreBlockTypes: BlockFlavorKeys[] = [
|
||||
Protocol.Block.Type.workspace,
|
||||
Protocol.Block.Type.page,
|
||||
Protocol.Block.Type.group,
|
||||
Protocol.Block.Type.title,
|
||||
Protocol.Block.Type.grid,
|
||||
Protocol.Block.Type.gridItem,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user