feat(mobile): get content in markdown api

This commit is contained in:
EYHN
2024-11-19 14:36:52 +08:00
parent 442c86011a
commit b28b555d80
7 changed files with 74 additions and 8 deletions

View File

@@ -66,6 +66,7 @@ export function configureWorkspaceModule(framework: Framework) {
.service(WorkspaceRepositoryService, [
[WorkspaceFlavourProvider],
WorkspaceProfileService,
WorkspaceListService,
])
.scope(WorkspaceScope)
.service(WorkspaceService)

View File

@@ -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

View File

@@ -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;
}