refactor(editor): extract edgeless legacy slots (#9363)
This commit is contained in:
@@ -76,9 +76,9 @@ export function insertEmbedCard(
|
||||
editing: false,
|
||||
});
|
||||
|
||||
// @ts-expect-error TODO: fix after edgeless refactor
|
||||
edgelessRoot.tools.setEdgelessTool({
|
||||
type: 'default',
|
||||
});
|
||||
gfx.tool.setTool(
|
||||
// @ts-expect-error FIXME: resolve after gfx tool refactor
|
||||
'default'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { EdgelessLegacySlotIdentifier } from '@blocksuite/affine-block-surface';
|
||||
import {
|
||||
blockComponentSymbol,
|
||||
type BlockService,
|
||||
@@ -49,21 +50,22 @@ export function toEdgelessEmbedBlock<
|
||||
return;
|
||||
}
|
||||
|
||||
get edgelessSlots() {
|
||||
return this.std.get(EdgelessLegacySlotIdentifier);
|
||||
}
|
||||
|
||||
override connectedCallback(): void {
|
||||
super.connectedCallback();
|
||||
const rootService = this.rootService;
|
||||
|
||||
this._disposables.add(
|
||||
// @ts-expect-error TODO: fix after edgeless slots are migrated to extension
|
||||
rootService.slots.elementResizeStart.on(() => {
|
||||
this.edgelessSlots.elementResizeStart.on(() => {
|
||||
this._isResizing = true;
|
||||
this._showOverlay = true;
|
||||
})
|
||||
);
|
||||
|
||||
this._disposables.add(
|
||||
// @ts-expect-error TODO: fix after edgeless slots are migrated to extension
|
||||
rootService.slots.elementResizeEnd.on(() => {
|
||||
this.edgelessSlots.elementResizeEnd.on(() => {
|
||||
this._isResizing = false;
|
||||
this._showOverlay =
|
||||
this._isResizing || this._isDragging || !this._isSelected;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type * as SurfaceEffects from '@blocksuite/affine-block-surface/effects';
|
||||
|
||||
import { EmbedFigmaBlockComponent } from './embed-figma-block';
|
||||
import { EmbedEdgelessBlockComponent } from './embed-figma-block/embed-edgeless-figma-block';
|
||||
import type { EmbedFigmaBlockService } from './embed-figma-block/embed-figma-service';
|
||||
@@ -90,6 +92,8 @@ export function effects() {
|
||||
);
|
||||
}
|
||||
|
||||
declare type _GLOBAL = typeof SurfaceEffects;
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
'affine-embed-figma-block': EmbedFigmaBlockComponent;
|
||||
|
||||
@@ -27,6 +27,9 @@
|
||||
},
|
||||
{
|
||||
"path": "../shared"
|
||||
},
|
||||
{
|
||||
"path": "../block-surface"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user