refactor(editor): toc dragging with std.dnd (#9883)

Close [BS-2458](https://linear.app/affine-design/issue/BS-2458/toc-dnd重构)

### What Changes
- Refactor toc note card dnd with `std.dnd`
- Extract note display mode change to command `changeNoteDisplayMode`
  - It will reorder notes when the display mode changed from `EdgelessOnly` to page mode visible (a.k.a `DocOnly` or `Both`)
This commit is contained in:
L-Sun
2025-01-24 13:27:17 +00:00
parent 351816b343
commit 829980bace
17 changed files with 689 additions and 687 deletions

View File

@@ -2,6 +2,7 @@ import type { BlockComponent } from '@blocksuite/block-std';
import type { BlockModel } from '@blocksuite/store';
import type { updateBlockType } from './commands/block-type';
import type { changeNoteDisplayMode } from './commands/change-note-display-mode';
import type { dedentBlock } from './commands/dedent-block';
import type { dedentBlockToRoot } from './commands/dedent-block-to-root';
import type { dedentBlocks } from './commands/dedent-blocks';
@@ -40,6 +41,7 @@ declare global {
indentBlock: typeof indentBlock;
updateBlockType: typeof updateBlockType;
dedentBlockToRoot: typeof dedentBlockToRoot;
changeNoteDisplayMode: typeof changeNoteDisplayMode;
}
interface CommandContext {
focusBlock?: BlockComponent | null;