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/modals": "^7.11.0",
"@mantine/notifications": "^7.11.0", "@mantine/notifications": "^7.11.0",
"@mantine/spotlight": "^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", "@tanstack/react-query": "^5.48.0",
"axios": "^1.7.2", "axios": "^1.7.2",
"clsx": "^2.1.1", "clsx": "^2.1.1",

View File

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

23
pnpm-lock.yaml generated
View File

@ -208,8 +208,8 @@ importers:
specifier: ^7.11.0 specifier: ^7.11.0
version: 7.11.0(@mantine/core@7.11.0(@mantine/hooks@7.11.0(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mantine/hooks@7.11.0(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1) version: 7.11.0(@mantine/core@7.11.0(@mantine/hooks@7.11.0(react@18.3.1))(@types/react@18.3.3)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@mantine/hooks@7.11.0(react@18.3.1))(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@tabler/icons-react': '@tabler/icons-react':
specifier: ^3.7.0 specifier: ^3.14.0
version: 3.7.0(react@18.3.1) version: 3.14.0(react@18.3.1)
'@tanstack/react-query': '@tanstack/react-query':
specifier: ^5.48.0 specifier: ^5.48.0
version: 5.48.0(react@18.3.1) version: 5.48.0(react@18.3.1)
@ -2519,9 +2519,6 @@ packages:
resolution: {integrity: sha512-o4lfCnEeIkfJhGBbLZxTuVWcGuqDCFwg5OrvpgRUBM7vI/vONvKKiB5riVNpO+JqXoH0I42NNeDb0m4V5RREig==} resolution: {integrity: sha512-o4lfCnEeIkfJhGBbLZxTuVWcGuqDCFwg5OrvpgRUBM7vI/vONvKKiB5riVNpO+JqXoH0I42NNeDb0m4V5RREig==}
peerDependencies: peerDependencies:
typescript: '>=4.8.2' typescript: '>=4.8.2'
peerDependenciesMeta:
typescript:
optional: true
'@nestjs/terminus@10.2.3': '@nestjs/terminus@10.2.3':
resolution: {integrity: sha512-iX7gXtAooePcyQqFt57aDke5MzgdkBeYgF5YsFNNFwOiAFdIQEhfv3PR0G+HlH9F6D7nBCDZt9U87Pks/qHijg==} resolution: {integrity: sha512-iX7gXtAooePcyQqFt57aDke5MzgdkBeYgF5YsFNNFwOiAFdIQEhfv3PR0G+HlH9F6D7nBCDZt9U87Pks/qHijg==}
@ -3721,13 +3718,13 @@ packages:
'@swc/types@0.1.7': '@swc/types@0.1.7':
resolution: {integrity: sha512-scHWahbHF0eyj3JsxG9CFJgFdFNaVQCNAimBlT6PzS3n/HptxqREjsm4OH6AN3lYcffZYSPxXW8ua2BEHp0lJQ==} resolution: {integrity: sha512-scHWahbHF0eyj3JsxG9CFJgFdFNaVQCNAimBlT6PzS3n/HptxqREjsm4OH6AN3lYcffZYSPxXW8ua2BEHp0lJQ==}
'@tabler/icons-react@3.7.0': '@tabler/icons-react@3.14.0':
resolution: {integrity: sha512-8AU4oO9pgLhHLOSGAJIsRhsTy7w8D7uKBlR0DIFxaILFA1fe2rC4wrNGYUtIFei82y41OuXz9vMk0Oe+IWT3SA==} resolution: {integrity: sha512-3XdbuyhBNq8aZW0qagR9YL8diACZYSAtaw6VuwcO2l6HzVFPN6N5TDex9WTz/3lf+uktAvOv1kNuuFBjSjN9yw==}
peerDependencies: peerDependencies:
react: '>= 16' react: '>= 16'
'@tabler/icons@3.7.0': '@tabler/icons@3.14.0':
resolution: {integrity: sha512-lJGIZLSWrPO6VygRUbaVvQjWgL2EaiBMD8e6leCYUQ8ZPO4LIzKMq358C8KlhXJcyNiRz1Io3YWoc/DNTcWqSg==} resolution: {integrity: sha512-OakKjK1kuDWKoNwdnHHVMt11kTZAC10iZpN/8o/CSYdeBH7S3v5n8IyqAYynFxLI8yBGTyBvljtvWdmWh57zSg==}
'@tanstack/eslint-plugin-query@5.47.0': '@tanstack/eslint-plugin-query@5.47.0':
resolution: {integrity: sha512-Y56KKu0DoftFkCd3H0xckDbvm38kg9UrGF2CABqMYr7yo94XUZhBYE8R3Gq7N4JxRvPha+lUg37eypECY5u2kA==} resolution: {integrity: sha512-Y56KKu0DoftFkCd3H0xckDbvm38kg9UrGF2CABqMYr7yo94XUZhBYE8R3Gq7N4JxRvPha+lUg37eypECY5u2kA==}
@ -11209,7 +11206,6 @@ snapshots:
comment-json: 4.2.3 comment-json: 4.2.3
jsonc-parser: 3.2.1 jsonc-parser: 3.2.1
pluralize: 8.0.0 pluralize: 8.0.0
optionalDependencies:
typescript: 5.3.3 typescript: 5.3.3
transitivePeerDependencies: transitivePeerDependencies:
- chokidar - chokidar
@ -11221,7 +11217,6 @@ snapshots:
comment-json: 4.2.3 comment-json: 4.2.3
jsonc-parser: 3.2.1 jsonc-parser: 3.2.1
pluralize: 8.0.0 pluralize: 8.0.0
optionalDependencies:
typescript: 5.5.2 typescript: 5.5.2
transitivePeerDependencies: transitivePeerDependencies:
- chokidar - chokidar
@ -12453,12 +12448,12 @@ snapshots:
'@swc/counter': 0.1.3 '@swc/counter': 0.1.3
optional: true optional: true
'@tabler/icons-react@3.7.0(react@18.3.1)': '@tabler/icons-react@3.14.0(react@18.3.1)':
dependencies: dependencies:
'@tabler/icons': 3.7.0 '@tabler/icons': 3.14.0
react: 18.3.1 react: 18.3.1
'@tabler/icons@3.7.0': {} '@tabler/icons@3.14.0': {}
'@tanstack/eslint-plugin-query@5.47.0(eslint@9.5.0)(typescript@5.5.2)': '@tanstack/eslint-plugin-query@5.47.0(eslint@9.5.0)(typescript@5.5.2)':
dependencies: dependencies: