|
|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
import { Command } from '../../..'
|
|
|
|
|
import { KeyMap } from '../../../dataset/enum/KeyMap'
|
|
|
|
|
import { IRegisterShortcut } from '../../../interface/shortcut/Shortcut'
|
|
|
|
|
import { isApple } from '../../../utils/ua'
|
|
|
|
|
|
|
|
|
|
export const richtextKeys: IRegisterShortcut[] = [
|
|
|
|
|
{
|
|
|
|
|
@ -13,50 +14,50 @@ export const richtextKeys: IRegisterShortcut[] = [
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KeyMap.LEFT_BRACKET,
|
|
|
|
|
ctrl: true,
|
|
|
|
|
mod: true,
|
|
|
|
|
callback: (command: Command) => {
|
|
|
|
|
command.executeSizeAdd()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KeyMap.RIGHT_BRACKET,
|
|
|
|
|
ctrl: true,
|
|
|
|
|
mod: true,
|
|
|
|
|
callback: (command: Command) => {
|
|
|
|
|
command.executeSizeMinus()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KeyMap.B,
|
|
|
|
|
ctrl: true,
|
|
|
|
|
mod: true,
|
|
|
|
|
callback: (command: Command) => {
|
|
|
|
|
command.executeBold()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KeyMap.I,
|
|
|
|
|
ctrl: true,
|
|
|
|
|
mod: true,
|
|
|
|
|
callback: (command: Command) => {
|
|
|
|
|
command.executeItalic()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KeyMap.U,
|
|
|
|
|
ctrl: true,
|
|
|
|
|
mod: true,
|
|
|
|
|
callback: (command: Command) => {
|
|
|
|
|
command.executeUnderline()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KeyMap.RIGHT_ANGLE_BRACKET,
|
|
|
|
|
ctrl: true,
|
|
|
|
|
key: isApple ? KeyMap.COMMA : KeyMap.RIGHT_ANGLE_BRACKET,
|
|
|
|
|
mod: true,
|
|
|
|
|
shift: true,
|
|
|
|
|
callback: (command: Command) => {
|
|
|
|
|
command.executeSuperscript()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KeyMap.LEFT_ANGLE_BRACKET,
|
|
|
|
|
ctrl: true,
|
|
|
|
|
key: isApple ? KeyMap.PERIOD : KeyMap.LEFT_ANGLE_BRACKET,
|
|
|
|
|
mod: true,
|
|
|
|
|
shift: true,
|
|
|
|
|
callback: (command: Command) => {
|
|
|
|
|
command.executeSubscript()
|
|
|
|
|
@ -64,28 +65,28 @@ export const richtextKeys: IRegisterShortcut[] = [
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KeyMap.L,
|
|
|
|
|
ctrl: true,
|
|
|
|
|
mod: true,
|
|
|
|
|
callback: (command: Command) => {
|
|
|
|
|
command.executeLeft()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KeyMap.E,
|
|
|
|
|
ctrl: true,
|
|
|
|
|
mod: true,
|
|
|
|
|
callback: (command: Command) => {
|
|
|
|
|
command.executeCenter()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KeyMap.R,
|
|
|
|
|
ctrl: true,
|
|
|
|
|
mod: true,
|
|
|
|
|
callback: (command: Command) => {
|
|
|
|
|
command.executeRight()
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: KeyMap.J,
|
|
|
|
|
ctrl: true,
|
|
|
|
|
mod: true,
|
|
|
|
|
callback: (command: Command) => {
|
|
|
|
|
command.executeAlignment()
|
|
|
|
|
}
|
|
|
|
|
|