@atlaskit/editor-plugin-engagement-platform
Version:
Engagement platform plugin for @atlaskit/editor-core“
14 lines • 488 B
JavaScript
import { engagementPlatformPmPluginKey } from './engagementPlatformPmPluginKey';
export const engagementPlatformPmPluginCommand = command => ({
tr
}) => {
var _tr$getMeta;
const currentMeta = (_tr$getMeta = tr.getMeta(engagementPlatformPmPluginKey)) !== null && _tr$getMeta !== void 0 ? _tr$getMeta : {
commands: []
};
const newMeta = {
...currentMeta,
commands: [...currentMeta.commands, command]
};
return tr.setMeta(engagementPlatformPmPluginKey, newMeta);
};