mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-02 01:49:51 +08:00
refactor(editor): move connector overlay to connector package (#11944)
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { createIdentifier } from '@blocksuite/global/di';
|
||||
import type { ExtensionType } from '@blocksuite/store';
|
||||
|
||||
import type { SurfaceBlockModel } from '../surface-model';
|
||||
|
||||
export type SurfaceMiddleware = (surface: SurfaceBlockModel) => () => void;
|
||||
|
||||
export const surfaceMiddlewareIdentifier = createIdentifier<{
|
||||
middleware: SurfaceMiddleware;
|
||||
}>('surface-middleware');
|
||||
|
||||
export function surfaceMiddlewareExtension(
|
||||
id: string,
|
||||
middleware: SurfaceMiddleware
|
||||
): ExtensionType {
|
||||
return {
|
||||
setup: di => {
|
||||
di.addImpl(surfaceMiddlewareIdentifier(id), {
|
||||
middleware,
|
||||
});
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user