add HR divider to slash menu

This commit is contained in:
Philipinho
2024-09-02 01:28:15 +01:00
parent 1141796f24
commit 7e6a71fa2d
3 changed files with 20 additions and 17 deletions

View File

@ -20,7 +20,7 @@
"@mantine/modals": "^7.11.0",
"@mantine/notifications": "^7.11.0",
"@mantine/spotlight": "^7.11.0",
"@tabler/icons-react": "^3.7.0",
"@tabler/icons-react": "^3.14.0",
"@tanstack/react-query": "^5.48.0",
"axios": "^1.7.2",
"clsx": "^2.1.1",

View File

@ -7,7 +7,6 @@ import {
IconH2,
IconH3,
IconInfoCircle,
IconLetterY,
IconList,
IconListNumbers,
IconMath,
@ -17,6 +16,7 @@ import {
IconPhoto,
IconTable,
IconTypography,
IconMenu4
} from "@tabler/icons-react";
import {
CommandProps,
@ -124,12 +124,20 @@ const CommandGroups: SlashMenuGroupedItemsType = {
},
{
title: "Code",
description: "Capture a code snippet.",
description: "Insert code snippet.",
searchTerms: ["codeblock"],
icon: IconCode,
command: ({ editor, range }: CommandProps) =>
editor.chain().focus().deleteRange(range).toggleCodeBlock().run(),
},
{
title: "Divider",
description: "Insert horizontal rule divider",
searchTerms: ["horizontal rule", "hr"],
icon: IconMenu4,
command: ({ editor, range }: CommandProps) =>
editor.chain().focus().deleteRange(range).setHorizontalRule().run(),
},
{
title: "Image",
description: "Upload any image from your device.",