File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
packages/common/infra/src/modules/doc Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 11import type { RootBlockModel } from '@blocksuite/blocks' ;
22
33import { Entity } from '../../../framework' ;
4+ import type { WorkspaceService } from '../../workspace' ;
45import type { DocScope } from '../scopes/doc' ;
56import type { DocsStore } from '../stores/docs' ;
67import type { DocMode } from './record' ;
78
89export class Doc extends Entity {
910 constructor (
1011 public readonly scope : DocScope ,
11- private readonly store : DocsStore
12+ private readonly store : DocsStore ,
13+ private readonly workspaceService : WorkspaceService
1214 ) {
1315 super ( ) ;
1416 }
1517
18+ /**
19+ * for convenience
20+ */
21+ get workspace ( ) {
22+ return this . workspaceService . workspace ;
23+ }
24+
1625 get id ( ) {
1726 return this . scope . props . docId ;
1827 }
Original file line number Diff line number Diff line change @@ -28,6 +28,6 @@ export function configureDocModule(framework: Framework) {
2828 . entity ( DocRecord , [ DocsStore ] )
2929 . entity ( DocRecordList , [ DocsStore ] )
3030 . scope ( DocScope )
31- . entity ( Doc , [ DocScope , DocsStore ] )
31+ . entity ( Doc , [ DocScope , DocsStore , WorkspaceService ] )
3232 . service ( DocService ) ;
3333}
You can’t perform that action at this time.
0 commit comments