refactor(editor): remove dependency of command global types (#9903)

Closes: [BS-2216](https://linear.app/affine-design/issue/BS-2216/remove-global-types-in-command)
This commit is contained in:
Saul-Mirone
2025-01-27 12:28:46 +00:00
parent 4b549e0484
commit 17bf75e843
170 changed files with 1461 additions and 2124 deletions
@@ -1,3 +1,4 @@
import { getSelectedBlocksCommand } from '@blocksuite/affine-shared/commands';
import type { EditorHost, TextSelection } from '@blocksuite/block-std';
import * as Y from 'yjs';
@@ -100,7 +101,7 @@ export class CommentManager {
} | null {
const [_, ctx] = this._command
.chain()
.getSelectedBlocks({
.pipe(getSelectedBlocksCommand, {
currentTextSelection: selection,
types: ['text'],
})
@@ -1,7 +1,11 @@
import { effects } from '@blocksuite/affine-block-note/effects';
import { ShadowlessElement, SurfaceSelection } from '@blocksuite/block-std';
import type { NoteBlockModel } from '@blocksuite/blocks';
import { matchFlavours, NoteDisplayMode } from '@blocksuite/blocks';
import {
changeNoteDisplayMode,
matchFlavours,
NoteDisplayMode,
} from '@blocksuite/blocks';
import {
Bound,
noop,
@@ -128,7 +132,7 @@ export class OutlinePanelBody extends SignalWatcher(
// when display mode change to page only, we should de-select the note if it is selected in edgeless mode
private _handleDisplayModeChange(e: DisplayModeChangeEvent) {
const { note, newMode } = e.detail;
this.editor.std.command.exec('changeNoteDisplayMode', {
this.editor.std.command.exec(changeNoteDisplayMode, {
noteId: note.id,
mode: newMode,
stopCapture: true,