refactor(editor): move focus block commands to blocksuite/shared (#10671)

This commit is contained in:
L-Sun
2025-03-07 03:07:49 +00:00
parent 43ce609cba
commit 98d44d5be5
8 changed files with 13 additions and 10 deletions
@@ -1,5 +1,6 @@
import { focusBlockEnd, focusBlockStart } from '@blocksuite/affine-block-note';
import {
focusBlockEnd,
focusBlockStart,
getNextBlockCommand,
getPrevBlockCommand,
} from '@blocksuite/affine-shared/commands';
@@ -4,8 +4,6 @@ export { dedentBlock } from './dedent-block.js';
export { dedentBlockToRoot } from './dedent-block-to-root.js';
export { dedentBlocks } from './dedent-blocks.js';
export { dedentBlocksToRoot } from './dedent-blocks-to-root.js';
export { focusBlockEnd } from './focus-block-end.js';
export { focusBlockStart } from './focus-block-start.js';
export { indentBlock } from './indent-block.js';
export { indentBlocks } from './indent-blocks.js';
export { selectBlock } from './select-block.js';
@@ -7,6 +7,8 @@ import {
ParagraphBlockModel,
} from '@blocksuite/affine-model';
import {
focusBlockEnd,
focusBlockStart,
getBlockSelectionsCommand,
getNextBlockCommand,
getPrevBlockCommand,
@@ -28,8 +30,6 @@ import type { BaseSelection, BlockModel } from '@blocksuite/store';
import {
dedentBlocks,
dedentBlocksToRoot,
focusBlockEnd,
focusBlockStart,
indentBlocks,
selectBlock,
selectBlocksBetween,
@@ -14,6 +14,8 @@ export {
retainFirstModelCommand,
} from './model-crud/index.js';
export {
focusBlockEnd,
focusBlockStart,
getBlockSelectionsCommand,
getImageSelectionsCommand,
getRangeRects,
@@ -1,8 +1,10 @@
export { getBlockSelectionsCommand } from './get-block-selections.js';
export { getImageSelectionsCommand } from './get-image-selections.js';
export { focusBlockEnd } from './focus-block-end';
export { focusBlockStart } from './focus-block-start';
export { getBlockSelectionsCommand } from './get-block-selections';
export { getImageSelectionsCommand } from './get-image-selections';
export {
getRangeRects,
getSelectionRectsCommand,
type SelectionRect,
} from './get-selection-rects.js';
export { getTextSelectionCommand } from './get-text-selection.js';
} from './get-selection-rects';
export { getTextSelectionCommand } from './get-text-selection';
@@ -1,7 +1,6 @@
import { addSiblingAttachmentBlocks } from '@blocksuite/affine-block-attachment';
import { insertImagesCommand } from '@blocksuite/affine-block-image';
import { insertLatexBlockCommand } from '@blocksuite/affine-block-latex';
import { focusBlockEnd } from '@blocksuite/affine-block-note';
import { getSurfaceBlock } from '@blocksuite/affine-block-surface';
import { insertSurfaceRefBlockCommand } from '@blocksuite/affine-block-surface-ref';
import { insertTableBlockCommand } from '@blocksuite/affine-block-table';
@@ -19,6 +18,7 @@ import type {
ParagraphBlockModel,
} from '@blocksuite/affine-model';
import {
focusBlockEnd,
getSelectedModelsCommand,
getTextSelectionCommand,
} from '@blocksuite/affine-shared/commands';