refactor(editor): remove gfx tool global type (#12116)

Closes: BS-2650
This commit is contained in:
Saul-Mirone
2025-05-04 13:53:26 +00:00
parent f3b5c36cf7
commit 30a2e5b4fb
95 changed files with 664 additions and 521 deletions
@@ -3,7 +3,7 @@ import { getSelectedRect } from '@blocksuite/affine-shared/utils';
import { type IVec, Rect } from '@blocksuite/global/gfx';
import {
GfxControllerIdentifier,
type GfxToolsFullOptionValue,
type ToolOptionWithType,
} from '@blocksuite/std/gfx';
import { effect } from '@preact/signals-core';
@@ -22,10 +22,9 @@ import type { AffineDragHandleWidget } from '../drag-handle.js';
*/
export class EdgelessWatcher {
private readonly _handleEdgelessToolUpdated = (
newTool: GfxToolsFullOptionValue
newTool: ToolOptionWithType
) => {
// @ts-expect-error GfxToolsFullOptionValue is extended in other packages
if (newTool.type === 'default') {
if (newTool.toolType?.toolName === 'default') {
this.updateAnchorElement();
} else {
this.widget.hide();