Add list indent/outdent controls on mobile (#5205)

This commit is contained in:
Tom Moor
2023-04-15 08:44:23 -04:00
committed by GitHub
parent 9c063c9f65
commit 2b38368fcd
7 changed files with 42 additions and 90 deletions

View File

@@ -13,6 +13,8 @@ import {
HighlightIcon,
CommentIcon,
ItalicIcon,
OutdentIcon,
IndentIcon,
} from "outline-icons";
import { EditorState } from "prosemirror-state";
import { isInTable } from "prosemirror-tables";
@@ -27,6 +29,7 @@ import { Dictionary } from "~/hooks/useDictionary";
export default function formattingMenuItems(
state: EditorState,
isTemplate: boolean,
isMobile: boolean,
dictionary: Dictionary
): MenuItem[] {
const { schema } = state;
@@ -135,6 +138,18 @@ export default function formattingMenuItems(
active: isNodeActive(schema.nodes.ordered_list),
visible: (allowBlocks || isList) && !isCode,
},
{
name: "outdentList",
tooltip: dictionary.outdent,
icon: <OutdentIcon />,
visible: isList && isMobile,
},
{
name: "indentList",
tooltip: dictionary.indent,
icon: <IndentIcon />,
visible: isList && isMobile,
},
{
name: "separator",
visible: !isCode,