mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Record each completion selection for analytics (#13665)
GitOrigin-RevId: bc8e92ceca51f6365c4311204a35fc85914969b0
This commit is contained in:
+14
-2
@@ -2,7 +2,19 @@ import { EditorView } from '@codemirror/view'
|
||||
import { sendMB } from '../../../../../infrastructure/event-tracking'
|
||||
import { isVisual } from '../../visual/visual'
|
||||
|
||||
export function emitCommandEvent(view: EditorView, command: string) {
|
||||
export function emitCommandEvent(
|
||||
view: EditorView,
|
||||
key: string,
|
||||
command: string
|
||||
) {
|
||||
const mode = isVisual(view) ? 'visual' : 'source'
|
||||
sendMB('codemirror-toolbar-event', { command, mode })
|
||||
sendMB(key, { command, mode })
|
||||
}
|
||||
|
||||
export function emitToolbarEvent(view: EditorView, command: string) {
|
||||
emitCommandEvent(view, 'codemirror-toolbar-event', command)
|
||||
}
|
||||
|
||||
export function emitCompletionEvent(view: EditorView, command: string) {
|
||||
emitCommandEvent(view, 'codemirror-completion-event', command)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user