feat(core): track template doc events (#9775)

close AF-2076
This commit is contained in:
CatsJuice
2025-01-19 13:13:30 +00:00
parent 7713920b71
commit 93106dae3b
5 changed files with 37 additions and 5 deletions

View File

@@ -102,6 +102,7 @@ function AddPageWithAsk({ className, style }: AddPageButtonProps) {
(e?: MouseEvent) => {
createDoc(e, 'page');
track.$.navigationPanel.$.createDoc();
track.$.sidebar.newDoc.quickStart({ with: 'page' });
},
[createDoc]
);
@@ -109,6 +110,7 @@ function AddPageWithAsk({ className, style }: AddPageButtonProps) {
(e?: MouseEvent) => {
createDoc(e, 'edgeless');
track.$.navigationPanel.$.createDoc();
track.$.sidebar.newDoc.quickStart({ with: 'edgeless' });
},
[createDoc]
);
@@ -117,6 +119,7 @@ function AddPageWithAsk({ className, style }: AddPageButtonProps) {
async (templateId: string) => {
const docId = await docsService.duplicateFromTemplate(templateId);
workbench.openDoc(docId);
track.$.sidebar.newDoc.quickStart({ with: 'template' });
},
[docsService, workbench]
);