@atlaskit/editor-common
Version:
A package that contains common classes and components for editor and renderer
19 lines • 726 B
JavaScript
import { ACTION_SUBJECT, EVENT_TYPE } from '../../analytics';
import { createDispatch } from '../../event-dispatcher';
import { analyticsEventKey } from '../../utils';
export var sendMBEAnalyticsEvent = function sendMBEAnalyticsEvent(action, node, eventDispatcher) {
var analyticsDispatch = createDispatch(eventDispatcher);
analyticsDispatch(analyticsEventKey, {
payload: {
action: action,
actionSubject: ACTION_SUBJECT.MULTI_BODIED_EXTENSION,
eventType: EVENT_TYPE.TRACK,
attributes: {
extensionType: node.attrs.extensionType,
extensionKey: node.attrs.extensionKey,
localId: node.attrs.localId,
currentFramesCount: node.content.childCount
}
}
});
};