Newer
Older
import Tools from '../lib/Tools';
import { injectable } from 'inversify';
// import { icons } from 'wax-prosemirror-components';
import { Fragment } from 'prosemirror-model';
import { v4 as uuidv4 } from 'uuid';
get run() {
return (state, dispatch) => {
const { empty, $from, $to } = state.selection;
let content = Fragment.empty;
if (!empty && $from.sameParent($to) && $from.parent.inlineContent)
content = $from.parent.content.cut(
$from.parentOffset,
const footnote = state.config.schema.nodes.footnote.create(
dispatch(state.tr.replaceSelectionWith(footnote));
};
}
select = (state, activeViewId) => {
if (activeViewId !== 'main') return false;
return true;
};
get enable() {
return state => {