feat: Add copy button to code selection, closes #6499

This commit is contained in:
Tom Moor
2024-02-05 23:45:22 -05:00
parent c9e4a57ee3
commit fbc628e331
2 changed files with 40 additions and 7 deletions

View File

@@ -15,6 +15,7 @@ import {
ItalicIcon,
OutdentIcon,
IndentIcon,
CopyIcon,
} from "outline-icons";
import { EditorState } from "prosemirror-state";
import { isInTable } from "prosemirror-tables";
@@ -171,5 +172,15 @@ export default function formattingMenuItems(
label: isCodeBlock ? dictionary.comment : undefined,
active: isMarkActive(schema.marks.comment),
},
{
name: "separator",
visible: isCode,
},
{
name: "copyToClipboard",
icon: <CopyIcon />,
tooltip: dictionary.copy,
visible: isCode,
},
];
}