feat(core): sidebar template doc entrance (#9676)

close AF-2048, AF-2050, AF-2049
This commit is contained in:
CatsJuice
2025-01-15 03:45:10 +00:00
parent 1c90747899
commit 419611f44c
4 changed files with 96 additions and 0 deletions
@@ -102,6 +102,7 @@ export class DocsService extends Service {
options: {
primaryMode?: DocMode;
docProps?: DocProps;
isTemplate?: boolean;
} = {}
) {
const doc = this.store.createBlockSuiteDoc();
@@ -114,6 +115,9 @@ export class DocsService extends Service {
if (options.primaryMode) {
docRecord.setPrimaryMode(options.primaryMode);
}
if (options.isTemplate) {
docRecord.setProperty('isTemplate', true);
}
this.eventBus.emit(DocCreated, docRecord);
return docRecord;
}