@atlaskit/editor-plugin-metrics
Version:
Metrics plugin for @atlaskit/editor-core
22 lines (20 loc) • 622 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.checkStatusChanged = void 0;
var _types = require("../types");
var checkStatusChanged = exports.checkStatusChanged = function checkStatusChanged(step) {
var slice = step.slice;
var 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: _types.ActionType.UPDATING_STATUS,
extraData: {
statusId: firstChild.attrs.localId
}
} : undefined;
};