chore(editor): update page block telemetry (#10487)

Close [BS-2711](https://linear.app/affine-design/issue/BS-2711/page-block埋点更新)
This commit is contained in:
L-Sun
2025-02-27 09:58:58 +00:00
parent 1bb5dd0eda
commit b995b4f965
4 changed files with 34 additions and 5 deletions
@@ -69,6 +69,9 @@ const EdgelessNoteToggleButton = ({ note }: { note: NoteBlockModel }) => {
}, [gfx, note]);
const toggle = useCallback(() => {
track.edgeless.pageBlock.headerToolbar.toggle({
type: collapsed ? 'expand' : 'collapse',
});
note.doc.transact(() => {
if (collapsed) {
note.edgeless.collapse = false;
@@ -111,6 +114,7 @@ const ViewInPageButton = () => {
const editor = useService(EditorService).editor;
const viewInPage = useCallback(() => {
track.edgeless.pageBlock.headerToolbar.switchPageMode();
editor.setMode('page');
}, [editor]);
@@ -132,7 +136,7 @@ const InfoButton = ({ note }: { note: NoteBlockModel }) => {
const workspaceDialogService = useService(WorkspaceDialogService);
const onOpenInfoModal = useCallback(() => {
track.doc.editor.pageBlockHeader.openDocInfo();
track.edgeless.pageBlock.headerToolbar.openDocInfo();
workspaceDialogService.open('doc-info', { docId: note.doc.id });
}, [note.doc.id, workspaceDialogService]);
@@ -162,6 +166,7 @@ const LinkButton = ({ note }: { note: NoteBlockModel }) => {
});
const copyLink = useCallback(() => {
track.edgeless.pageBlock.headerToolbar.copyBlockToLink();
onClickCopyLink('edgeless', [note.id]);
}, [note.id, onClickCopyLink]);
+16 -3
View File
@@ -53,7 +53,12 @@ type DocEvents =
| 'editProperty'
| 'editPropertyMeta'
| 'addProperty';
type EditorEvents = 'bold' | 'italic' | 'underline' | 'strikeThrough';
type EditorEvents =
| 'bold'
| 'italic'
| 'underline'
| 'strikeThrough'
| 'foldEdgelessNote';
// END SECTION
// SECTION: setting events
@@ -360,7 +365,6 @@ const PageEvents = {
'openInPeekView',
],
aiActions: ['requestSignIn'],
pageBlockHeader: ['openDocInfo'],
starterBar: ['quickStart', 'openTemplateListMenu'],
},
inlineDocInfo: {
@@ -377,7 +381,16 @@ const PageEvents = {
backlinkPreview: ['navigate'],
},
},
edgeless: {},
edgeless: {
pageBlock: {
headerToolbar: [
'toggle',
'openDocInfo',
'copyBlockToLink',
'switchPageMode',
],
},
},
workspace: {
$: {
$: ['upgradeWorkspace'],