mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-02-13 17:10:06 +00:00
add shift in editor hokeys with number
This commit is contained in:
parent
eb07053b30
commit
1752e98ada
src/app/components/editor
|
@ -148,7 +148,7 @@ export function HeadingBlockButton() {
|
|||
<Menu style={{ padding: config.space.S100 }}>
|
||||
<Box gap="100">
|
||||
<TooltipProvider
|
||||
tooltip={<BtnTooltip text="Heading 1" shortCode={`${modKey} + 1`} />}
|
||||
tooltip={<BtnTooltip text="Heading 1" shortCode={`${modKey} + Shift + 1`} />}
|
||||
delay={500}
|
||||
>
|
||||
{(triggerRef) => (
|
||||
|
@ -163,7 +163,7 @@ export function HeadingBlockButton() {
|
|||
)}
|
||||
</TooltipProvider>
|
||||
<TooltipProvider
|
||||
tooltip={<BtnTooltip text="Heading 2" shortCode={`${modKey} + 2`} />}
|
||||
tooltip={<BtnTooltip text="Heading 2" shortCode={`${modKey} + Shift + 2`} />}
|
||||
delay={500}
|
||||
>
|
||||
{(triggerRef) => (
|
||||
|
@ -178,7 +178,7 @@ export function HeadingBlockButton() {
|
|||
)}
|
||||
</TooltipProvider>
|
||||
<TooltipProvider
|
||||
tooltip={<BtnTooltip text="Heading 3" shortCode={`${modKey} + 3`} />}
|
||||
tooltip={<BtnTooltip text="Heading 3" shortCode={`${modKey} + Shift + 3`} />}
|
||||
delay={500}
|
||||
>
|
||||
{(triggerRef) => (
|
||||
|
@ -311,12 +311,12 @@ export function Toolbar() {
|
|||
<BlockButton
|
||||
format={BlockType.OrderedList}
|
||||
icon={Icons.OrderList}
|
||||
tooltip={<BtnTooltip text="Ordered List" shortCode={`${modKey} + 7`} />}
|
||||
tooltip={<BtnTooltip text="Ordered List" shortCode={`${modKey} + Shift + 7`} />}
|
||||
/>
|
||||
<BlockButton
|
||||
format={BlockType.UnorderedList}
|
||||
icon={Icons.UnorderList}
|
||||
tooltip={<BtnTooltip text="Unordered List" shortCode={`${modKey} + 8`} />}
|
||||
tooltip={<BtnTooltip text="Unordered List" shortCode={`${modKey} + Shift + 8`} />}
|
||||
/>
|
||||
<HeadingBlockButton />
|
||||
</Box>
|
||||
|
|
|
@ -15,15 +15,15 @@ export const INLINE_HOTKEYS: Record<string, MarkType> = {
|
|||
const INLINE_KEYS = Object.keys(INLINE_HOTKEYS);
|
||||
|
||||
export const BLOCK_HOTKEYS: Record<string, BlockType> = {
|
||||
'mod+7': BlockType.OrderedList,
|
||||
'mod+8': BlockType.UnorderedList,
|
||||
'mod+shift+7': BlockType.OrderedList,
|
||||
'mod+shift+8': BlockType.UnorderedList,
|
||||
"mod+'": BlockType.BlockQuote,
|
||||
'mod+;': BlockType.CodeBlock,
|
||||
};
|
||||
const BLOCK_KEYS = Object.keys(BLOCK_HOTKEYS);
|
||||
const isHeading1 = isKeyHotkey('mod+1');
|
||||
const isHeading2 = isKeyHotkey('mod+2');
|
||||
const isHeading3 = isKeyHotkey('mod+3');
|
||||
const isHeading1 = isKeyHotkey('mod+shift+1');
|
||||
const isHeading2 = isKeyHotkey('mod+shift+2');
|
||||
const isHeading3 = isKeyHotkey('mod+shift+3');
|
||||
|
||||
/**
|
||||
* @return boolean true if shortcut is toggled.
|
||||
|
|
Loading…
Reference in a new issue