mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-31 17:19:56 +08:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user