[WIKI-768] fix: ordering and grouping of list-related toolbar and slash commands #8104

This commit is contained in:
Vipin Chaudhary 2025-11-13 15:20:07 +05:30 committed by GitHub
parent f4c2d519fc
commit 2a2c4921a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 31 additions and 27 deletions

View file

@ -46,9 +46,12 @@ const ToolbarButton: React.FC<ToolbarButtonProps> = React.memo((props) => {
...item.extraProps, ...item.extraProps,
}) })
} }
className={cn("grid size-7 place-items-center rounded text-custom-text-300 hover:bg-custom-background-80", { className={cn(
"shrink-0 grid size-7 place-items-center rounded text-custom-text-300 hover:bg-custom-background-80",
{
"bg-custom-background-80 text-custom-text-100": isActive, "bg-custom-background-80 text-custom-text-100": isActive,
})} }
)}
> >
<item.icon <item.icon
className={cn("size-4", { className={cn("size-4", {

View file

@ -128,19 +128,19 @@ const BASIC_MARK_ITEMS: ToolbarMenuItem<"bold" | "italic" | "underline" | "strik
]; ];
const LIST_ITEMS: ToolbarMenuItem<"bulleted-list" | "numbered-list" | "to-do-list">[] = [ const LIST_ITEMS: ToolbarMenuItem<"bulleted-list" | "numbered-list" | "to-do-list">[] = [
{
itemKey: "bulleted-list",
renderKey: "bulleted-list",
name: "Bulleted list",
icon: List,
shortcut: ["Cmd", "Shift", "7"],
editors: ["lite", "document"],
},
{ {
itemKey: "numbered-list", itemKey: "numbered-list",
renderKey: "numbered-list", renderKey: "numbered-list",
name: "Numbered list", name: "Numbered list",
icon: ListOrdered, icon: ListOrdered,
shortcut: ["Cmd", "Shift", "7"],
editors: ["lite", "document"],
},
{
itemKey: "bulleted-list",
renderKey: "bulleted-list",
name: "Bulleted list",
icon: List,
shortcut: ["Cmd", "Shift", "8"], shortcut: ["Cmd", "Shift", "8"],
editors: ["lite", "document"], editors: ["lite", "document"],
}, },

View file

@ -119,32 +119,33 @@ export const getSlashCommandFilteredSections =
icon: <Heading6 className="size-3.5" />, icon: <Heading6 className="size-3.5" />,
command: ({ editor, range }) => toggleHeading(editor, 6, range), command: ({ editor, range }) => toggleHeading(editor, 6, range),
}, },
{ {
commandKey: "to-do-list", commandKey: "numbered-list",
key: "to-do-list", key: "numbered-list",
title: "To do", title: "Numbered list",
description: "Track tasks with a to-do list.", description: "Create a numbered list.",
searchTerms: ["todo", "task", "list", "check", "checkbox"], searchTerms: ["ordered"],
icon: <ListTodo className="size-3.5" />, icon: <ListOrdered className="size-3.5" />,
command: ({ editor, range }) => toggleTaskList(editor, range), command: ({ editor, range }) => toggleOrderedList(editor, range),
}, },
{ {
commandKey: "bulleted-list", commandKey: "bulleted-list",
key: "bulleted-list", key: "bulleted-list",
title: "Bullet list", title: "Bulleted list",
description: "Create a simple bullet list.", description: "Create a bulleted list.",
searchTerms: ["unordered", "point"], searchTerms: ["unordered", "point"],
icon: <List className="size-3.5" />, icon: <List className="size-3.5" />,
command: ({ editor, range }) => toggleBulletList(editor, range), command: ({ editor, range }) => toggleBulletList(editor, range),
}, },
{ {
commandKey: "numbered-list", commandKey: "to-do-list",
key: "numbered-list", key: "to-do-list",
title: "Numbered list", title: "To-do list",
description: "Create a list with numbering.", description: "Create a to-do list.",
searchTerms: ["ordered"], searchTerms: ["todo", "task", "list", "check", "checkbox"],
icon: <ListOrdered className="size-3.5" />, icon: <ListTodo className="size-3.5" />,
command: ({ editor, range }) => toggleOrderedList(editor, range), command: ({ editor, range }) => toggleTaskList(editor, range),
}, },
{ {
commandKey: "table", commandKey: "table",