@atlaskit/editor-plugin-type-ahead
Version:
Type-ahead plugin for @atlaskit/editor-core
16 lines • 697 B
JavaScript
import { ACTION, ACTION_SUBJECT, ACTION_SUBJECT_ID, EVENT_TYPE } from '@atlaskit/editor-common/analytics';
export const fireTypeAheadClosedAnalyticsEvent = (api, closeAction, hasQuery, inputMethod, invocationMethod = null) => {
var _api$analytics;
api === null || api === void 0 ? void 0 : (_api$analytics = api.analytics) === null || _api$analytics === void 0 ? void 0 : _api$analytics.actions.fireAnalyticsEvent({
action: ACTION.CLOSED,
actionSubject: ACTION_SUBJECT.TYPEAHEAD,
actionSubjectId: ACTION_SUBJECT_ID.TYPEAHEAD_QUICK_INSERT,
attributes: {
inputMethod,
closeAction,
hasQuery,
invocationMethod
},
eventType: EVENT_TYPE.TRACK
});
};