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

@ -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.",