mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-25 10:22:55 +08:00
feat(mobile): get content in markdown api
This commit is contained in:
@@ -66,6 +66,7 @@ export function configureWorkspaceModule(framework: Framework) {
|
||||
.service(WorkspaceRepositoryService, [
|
||||
[WorkspaceFlavourProvider],
|
||||
WorkspaceProfileService,
|
||||
WorkspaceListService,
|
||||
])
|
||||
.scope(WorkspaceScope)
|
||||
.service(WorkspaceService)
|
||||
|
||||
@@ -11,6 +11,7 @@ import type {
|
||||
WorkspaceFlavourProvider,
|
||||
} from '../providers/flavour';
|
||||
import { WorkspaceScope } from '../scopes/workspace';
|
||||
import type { WorkspaceListService } from './list';
|
||||
import type { WorkspaceProfileService } from './profile';
|
||||
import { WorkspaceService } from './workspace';
|
||||
|
||||
@@ -19,7 +20,8 @@ const logger = new DebugLogger('affine:workspace-repository');
|
||||
export class WorkspaceRepositoryService extends Service {
|
||||
constructor(
|
||||
private readonly providers: WorkspaceFlavourProvider[],
|
||||
private readonly profileRepo: WorkspaceProfileService
|
||||
private readonly profileRepo: WorkspaceProfileService,
|
||||
private readonly workspacesListService: WorkspaceListService
|
||||
) {
|
||||
super();
|
||||
}
|
||||
@@ -77,6 +79,12 @@ export class WorkspaceRepositoryService extends Service {
|
||||
};
|
||||
};
|
||||
|
||||
openByWorkspaceId = (workspaceId: string) => {
|
||||
const workspaceMetadata =
|
||||
this.workspacesListService.list.workspace$(workspaceId).value;
|
||||
return workspaceMetadata && this.open({ metadata: workspaceMetadata });
|
||||
};
|
||||
|
||||
instantiate(
|
||||
openOptions: WorkspaceOpenOptions,
|
||||
customProvider?: WorkspaceEngineProvider
|
||||
|
||||
@@ -41,6 +41,10 @@ export class WorkspacesService extends Service {
|
||||
return this.workspaceRepo.open;
|
||||
}
|
||||
|
||||
get openByWorkspaceId() {
|
||||
return this.workspaceRepo.openByWorkspaceId;
|
||||
}
|
||||
|
||||
get create() {
|
||||
return this.workspaceFactory.create;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user