import { CodeBlockNodeAttr } from "../../CodeBlockSpecs/index.js";
import { disableLineWrapping, enableLineWrapping, isNodeHasLineWrapping, } from "../plugins/codeBlockLineWrappingPlugin.js";
import { isLineNumbersVisible } from "../utils.js";
/** @internal */
export { isLineNumbersVisible } from "../utils.js";
/** @internal */
export const toggleLineNumbers = ({ node, pos, state, dispatch }) => {
    const showLineNumbers = isLineNumbersVisible(node);
    dispatch(state.tr.setNodeAttribute(pos, CodeBlockNodeAttr.ShowLineNumbers, showLineNumbers ? '' : 'true'));
};
/** @internal */
export const toggleLineWrapping = ({ pos, state, dispatch }) => {
    const { tr } = state;
    const hasLineWrapping = isNodeHasLineWrapping(state, pos);
    if (hasLineWrapping)
        disableLineWrapping(tr, pos);
    else
        enableLineWrapping(tr, pos);
    dispatch(tr);
};
//# sourceMappingURL=utils.js.map
