mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 19:57:52 +01:00
common: fix insert paragraph keybinding
Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -222,7 +222,7 @@ export const tiptapKeys = {
|
|||||||
type: "tiptap"
|
type: "tiptap"
|
||||||
},
|
},
|
||||||
insertParagraph: {
|
insertParagraph: {
|
||||||
keys: "Mod-Shift-0",
|
keys: "Mod-Alt-0",
|
||||||
description: "Insert paragraph",
|
description: "Insert paragraph",
|
||||||
category: "Editor",
|
category: "Editor",
|
||||||
type: "tiptap"
|
type: "tiptap"
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import {
|
|||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { CodeBlock } from "../../extensions/code-block/index.js";
|
import { CodeBlock } from "../../extensions/code-block/index.js";
|
||||||
import { strings } from "@notesnook/intl";
|
import { strings } from "@notesnook/intl";
|
||||||
|
import { keybindings } from "@notesnook/common";
|
||||||
|
|
||||||
const defaultLevels = [1, 2, 3, 4, 5, 6] as const;
|
const defaultLevels = [1, 2, 3, 4, 5, 6] as const;
|
||||||
|
|
||||||
@@ -70,7 +71,7 @@ function toMenuItems(
|
|||||||
key: `heading-${level}`,
|
key: `heading-${level}`,
|
||||||
title: toolbarLocation === "bottom" ? `H${level}` : strings.heading(level),
|
title: toolbarLocation === "bottom" ? `H${level}` : strings.heading(level),
|
||||||
isChecked: level === currentHeadingLevel,
|
isChecked: level === currentHeadingLevel,
|
||||||
modifier: `Mod-Alt-${level}`,
|
modifier: keybindings[`insertHeading${level}`].keys,
|
||||||
onClick: () =>
|
onClick: () =>
|
||||||
editor
|
editor
|
||||||
?.chain()
|
?.chain()
|
||||||
@@ -84,7 +85,7 @@ function toMenuItems(
|
|||||||
type: "button",
|
type: "button",
|
||||||
title: strings.paragraph(),
|
title: strings.paragraph(),
|
||||||
isChecked: !currentHeadingLevel,
|
isChecked: !currentHeadingLevel,
|
||||||
modifier: `Mod-Alt-0`,
|
modifier: keybindings.insertParagraph.keys,
|
||||||
onClick: () => editor.chain().focus().setParagraph().run()
|
onClick: () => editor.chain().focus().setParagraph().run()
|
||||||
};
|
};
|
||||||
return [paragraph, ...menuItems];
|
return [paragraph, ...menuItems];
|
||||||
|
|||||||
Reference in New Issue
Block a user