mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 13:25:12 +00:00
@@ -5,6 +5,7 @@ import type { LinkToolbarEvents } from './link.js';
|
|||||||
import type { NoteEvents } from './note.js';
|
import type { NoteEvents } from './note.js';
|
||||||
import type {
|
import type {
|
||||||
AttachmentUploadedEvent,
|
AttachmentUploadedEvent,
|
||||||
|
BlockCreationEvent,
|
||||||
DocCreatedEvent,
|
DocCreatedEvent,
|
||||||
ElementCreationEvent,
|
ElementCreationEvent,
|
||||||
ElementLockEvent,
|
ElementLockEvent,
|
||||||
@@ -24,6 +25,7 @@ export type TelemetryEventMap = OutDatabaseAllEvents &
|
|||||||
EdgelessElementLocked: ElementLockEvent;
|
EdgelessElementLocked: ElementLockEvent;
|
||||||
ExpandedAndCollapsed: MindMapCollapseEvent;
|
ExpandedAndCollapsed: MindMapCollapseEvent;
|
||||||
AttachmentUploadedEvent: AttachmentUploadedEvent;
|
AttachmentUploadedEvent: AttachmentUploadedEvent;
|
||||||
|
BlockCreated: BlockCreationEvent;
|
||||||
};
|
};
|
||||||
|
|
||||||
export interface TelemetryService {
|
export interface TelemetryService {
|
||||||
|
|||||||
@@ -51,6 +51,10 @@ export interface ElementLockEvent extends TelemetryEvent {
|
|||||||
control: 'lock' | 'unlock' | 'group-lock';
|
control: 'lock' | 'unlock' | 'group-lock';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface BlockCreationEvent extends TelemetryEvent {
|
||||||
|
blockType: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface MindMapCollapseEvent extends TelemetryEvent {
|
export interface MindMapCollapseEvent extends TelemetryEvent {
|
||||||
page: 'whiteboard editor';
|
page: 'whiteboard editor';
|
||||||
segment: 'mind map';
|
segment: 'mind map';
|
||||||
|
|||||||
@@ -274,6 +274,15 @@ export const defaultSlashMenuConfig: SlashMenuConfig = {
|
|||||||
place: 'after',
|
place: 'after',
|
||||||
removeEmptyLine: true,
|
removeEmptyLine: true,
|
||||||
})
|
})
|
||||||
|
.pipe(({ insertedTableBlockId }) => {
|
||||||
|
if (insertedTableBlockId) {
|
||||||
|
const telemetry =
|
||||||
|
rootComponent.std.getOptional(TelemetryProvider);
|
||||||
|
telemetry?.track('BlockCreated', {
|
||||||
|
blockType: 'affine:table',
|
||||||
|
});
|
||||||
|
}
|
||||||
|
})
|
||||||
.run();
|
.run();
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -612,8 +621,8 @@ export const defaultSlashMenuConfig: SlashMenuConfig = {
|
|||||||
if (insertedDatabaseBlockId) {
|
if (insertedDatabaseBlockId) {
|
||||||
const telemetry =
|
const telemetry =
|
||||||
rootComponent.std.getOptional(TelemetryProvider);
|
rootComponent.std.getOptional(TelemetryProvider);
|
||||||
telemetry?.track('AddDatabase', {
|
telemetry?.track('BlockCreated', {
|
||||||
blockId: insertedDatabaseBlockId,
|
blockType: 'affine:database',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -675,8 +684,8 @@ export const defaultSlashMenuConfig: SlashMenuConfig = {
|
|||||||
if (insertedDatabaseBlockId) {
|
if (insertedDatabaseBlockId) {
|
||||||
const telemetry =
|
const telemetry =
|
||||||
rootComponent.std.getOptional(TelemetryProvider);
|
rootComponent.std.getOptional(TelemetryProvider);
|
||||||
telemetry?.track('AddDatabase', {
|
telemetry?.track('BlockCreated', {
|
||||||
blockId: insertedDatabaseBlockId,
|
blockType: 'affine:database',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user