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
@@ -9,6 +9,8 @@ import { css, html, nothing } from 'lit';
import { state } from 'lit/decorators.js';
import { literal, unsafeStatic } from 'lit/static-html.js';
import { PresentTool } from '../present-tool';
export const EDGELESS_NAVIGATOR_BLACK_BACKGROUND_WIDGET =
'edgeless-navigator-black-background';
export class EdgelessNavigatorBlackBackgroundWidget extends WidgetComponent<RootBlockModel> {
@@ -59,7 +61,7 @@ export class EdgelessNavigatorBlackBackgroundWidget extends WidgetComponent<Root
this.show =
blackBackground &&
this.gfx.tool.currentToolOption$.peek().type === 'frameNavigator';
this.gfx.tool.currentToolOption$.peek().toolType === PresentTool;
}
})
);
@@ -3,9 +3,10 @@ import {
QuickToolMixin,
} from '@blocksuite/affine-widget-edgeless-toolbar';
import { PresentationIcon } from '@blocksuite/icons/lit';
import type { GfxToolsFullOptionValue } from '@blocksuite/std/gfx';
import { css, html, LitElement } from 'lit';
import { PresentTool } from '../present-tool';
export class EdgelessPresentButton extends QuickToolMixin(
EdgelessToolbarToolMixin(LitElement)
) {
@@ -19,7 +20,7 @@ export class EdgelessPresentButton extends QuickToolMixin(
}
`;
override type: GfxToolsFullOptionValue['type'] = 'frameNavigator';
override type = PresentTool;
override render() {
return html`<edgeless-tool-icon-button
@@ -29,9 +30,7 @@ export class EdgelessPresentButton extends QuickToolMixin(
.iconContainerPadding=${6}
.iconSize=${'24px'}
@click=${() => {
this.setEdgelessTool({
type: 'frameNavigator',
});
this.setEdgelessTool(PresentTool);
}}
>
${PresentationIcon()}