mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-18 06:47:02 +08:00
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`)
43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
import {
|
|
getBlockIndexCommand,
|
|
getBlockSelectionsCommand,
|
|
getNextBlockCommand,
|
|
getPrevBlockCommand,
|
|
getSelectedBlocksCommand,
|
|
} from '@blocksuite/affine-shared/commands';
|
|
import type { BlockCommands } from '@blocksuite/block-std';
|
|
|
|
import { updateBlockType } from './block-type.js';
|
|
import { changeNoteDisplayMode } from './change-note-display-mode.js';
|
|
import { dedentBlock } from './dedent-block.js';
|
|
import { dedentBlockToRoot } from './dedent-block-to-root.js';
|
|
import { dedentBlocks } from './dedent-blocks.js';
|
|
import { dedentBlocksToRoot } from './dedent-blocks-to-root.js';
|
|
import { focusBlockEnd } from './focus-block-end.js';
|
|
import { focusBlockStart } from './focus-block-start.js';
|
|
import { indentBlock } from './indent-block.js';
|
|
import { indentBlocks } from './indent-blocks.js';
|
|
import { selectBlock } from './select-block.js';
|
|
import { selectBlocksBetween } from './select-blocks-between.js';
|
|
|
|
export const commands: BlockCommands = {
|
|
// block
|
|
getBlockIndex: getBlockIndexCommand,
|
|
getPrevBlock: getPrevBlockCommand,
|
|
getNextBlock: getNextBlockCommand,
|
|
getSelectedBlocks: getSelectedBlocksCommand,
|
|
getBlockSelections: getBlockSelectionsCommand,
|
|
selectBlock,
|
|
selectBlocksBetween,
|
|
focusBlockStart,
|
|
focusBlockEnd,
|
|
updateBlockType,
|
|
indentBlock,
|
|
dedentBlock,
|
|
indentBlocks,
|
|
dedentBlocks,
|
|
dedentBlockToRoot,
|
|
dedentBlocksToRoot,
|
|
changeNoteDisplayMode,
|
|
};
|