@progress/kendo-react-editor
Version:
React Editor enables users to create rich text content through a WYSIWYG interface. KendoReact Editor package
49 lines (48 loc) • 2 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 * as u from "react";
import { Button as N } from "@progress/kendo-react-buttons";
import { isIndented as O, canOutdentAsListItem as b, liftListItem as h, indentBlocks as I } from "@progress/kendo-editor-common";
import { onDownPreventDefault as y } from "./utils.mjs";
import { registerForLocalization as k, provideLocalizationService as z } from "@progress/kendo-react-intl";
import { messages as S } from "../messages/index.mjs";
import { classNames as w } from "@progress/kendo-react-common";
var f;
((v) => {
v.createOutdentTool = (t) => {
const n = class extends u.Component {
render() {
const { view: o, render: i, ...s } = this.props, e = o && o.state, r = s.dir, c = !!e && O(e, t.actions, r), l = e && e.schema.nodes[t.listsTypes.listItem], d = !!e && b(e, { nodes: t.actions, listsTypes: t.listsTypes }), T = c || d, L = z(this), m = t.messages.title, a = !T, p = /* @__PURE__ */ u.createElement(
N,
{
onClick: a ? void 0 : () => {
o && d && l ? h(l)(o.state, o.dispatch) : o && c && I(
t.actions,
t.commandName,
r
)(o.state, o.dispatch);
},
"aria-disabled": a ? !0 : void 0,
title: L.toLanguageString(m, S[m]),
...y,
...t.props,
...s,
className: w(s.className, t.props.className, {
"k-disabled": a
})
}
);
return i ? i.call(void 0, p, { view: o }) : p;
}
};
return k(n), n;
};
})(f || (f = {}));
export {
f as OutdentToolNS
};