@atlaskit/editor-plugin-metrics
Version:
Metrics plugin for @atlaskit/editor-core
18 lines (17 loc) • 465 B
JavaScript
import { ActionType } from '../types';
export const checkStatusChanged = step => {
const {
slice
} = step;
const firstChild = slice.content.firstChild;
if (!firstChild) {
return undefined;
}
// Get statusId so that we can track whether edits are performed on same status node
return firstChild.type.name === 'status' ? {
type: ActionType.UPDATING_STATUS,
extraData: {
statusId: firstChild.attrs.localId
}
} : undefined;
};