feat(editor): add sidebar service (#9761)

This commit is contained in:
L-Sun
2025-01-17 11:29:20 +00:00
parent 779029148e
commit ad814a0f4f
4 changed files with 40 additions and 0 deletions

View File

@@ -13,5 +13,6 @@ export * from './open-doc-config';
export * from './page-viewport-service';
export * from './parse-url-service';
export * from './quick-search-service';
export * from './sidebar-service';
export * from './telemetry-service';
export * from './theme-service';

View File

@@ -0,0 +1,18 @@
import { createIdentifier } from '@blocksuite/global/di';
import type { ExtensionType } from '@blocksuite/store';
export interface SidebarService {
open: (tabId?: string) => void;
close: () => void;
getTabIds: () => string[];
}
export const SidebarExtensionIdentifier = createIdentifier<SidebarService>(
'AffineSidebarExtension'
);
export const SidebarExtension = (service: SidebarService): ExtensionType => ({
setup: di => {
di.addImpl(SidebarExtensionIdentifier, () => service);
},
});