Rebuilding code block menus (#5569)
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { wrapIn, lift } from "prosemirror-commands";
|
||||
import { NodeType } from "prosemirror-model";
|
||||
import { Command } from "prosemirror-state";
|
||||
import { Primitive } from "utility-types";
|
||||
import isNodeActive from "../queries/isNodeActive";
|
||||
|
||||
export default function toggleWrap(
|
||||
type: NodeType,
|
||||
attrs?: Record<string, any>
|
||||
attrs?: Record<string, Primitive>
|
||||
): Command {
|
||||
return (state, dispatch) => {
|
||||
const isActive = isNodeActive(type)(state);
|
||||
|
||||
Reference in New Issue
Block a user