@progress/kendo-react-editor
Version:
React Editor enables users to create rich text content through a WYSIWYG interface. KendoReact Editor package
34 lines (33 loc) • 1.5 kB
JavaScript
/**
* @license
*-------------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the package root for more information
*-------------------------------------------------------------------------------------------
*/
import { chainCommands as u, exitCode as h, toggleInlineFormat as i, undo as p, redo as l, undoInputRule as f, splitListItem as S, goToNextCell as a } from "@progress/kendo-editor-common";
import { EditorToolsSettings as M } from "./toolsSettings.mjs";
const { bold: b, underline: y, italic: I } = M, c = typeof navigator != "undefined" ? /Mac/.test(navigator.platform) : !1, B = (e) => {
const r = u(h, (t, o) => {
const d = e && e.types && e.types.hardBreak || "hard_break", m = t.schema.nodes[d];
return o && o(t.tr.replaceSelectionWith(m.create()).scrollIntoView()), !0;
}), s = e && e.types && e.types.listItem || "list_item", n = e && e.toolsSettings || {};
return {
"Mod-b": (t, o) => i(n.bold || b)(t, o),
"Mod-i": (t, o) => i(n.italic || I)(t, o),
"Mod-u": (t, o) => i(n.underline || y)(t, o),
"Mod-z": p,
"Shift-Mod-z": l,
...c ? {} : { "Mod-y": l },
Backspace: f,
"Mod-Enter": r,
"Shift-Enter": r,
...c ? { "Ctrl-Enter": r } : {},
Enter: (t, o) => S(t.schema.nodes[s])(t, o),
Tab: a(1),
"Shift-Tab": a(-1)
};
};
export {
B as getShortcuts
};