UNPKG

@progress/kendo-react-editor

Version:

React Editor enables users to create rich text content through a WYSIWYG interface. KendoReact Editor package

45 lines (44 loc) 1.99 kB
/** * @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 v from "react"; import { Button as k } from "@progress/kendo-react-buttons"; import { isIndented as z, hasNode as N, canIndentAsListItem as S, sinkListItem as w, indentBlocks as x } from "@progress/kendo-editor-common"; import { onDownPreventDefault as y } from "./utils.mjs"; import { registerForLocalization as B, provideLocalizationService as C } from "@progress/kendo-react-intl"; import { messages as D } from "../messages/index.mjs"; import { classNames as P } from "@progress/kendo-react-common"; var h; ((L) => { L.createIndentTool = (e) => { const c = class extends v.Component { render() { const { view: t, render: d, ...a } = this.props, m = a.dir, o = t && t.state, n = o && o.schema.nodes, s = n && n[e.listsTypes.listItem], i = e.actions, l = !!o && !!s && (z(o, i, m) || i.some((u) => n && n[u.node] && N(o, n[u.node]))) && !N(o, s), p = !!o && S(o, s), b = l || p, T = C(this), I = e.messages.title, r = !b, f = /* @__PURE__ */ v.createElement( k, { onClick: r ? void 0 : () => { t && p && s ? w(s)(t.state, t.dispatch) : t && l && x(i, e.commandName, m)(t.state, t.dispatch); }, "aria-disabled": r ? !0 : void 0, title: T.toLanguageString(I, D[I]), ...y, ...e.props, ...a, className: P(a.className, e.props.className, { "k-disabled": r }) } ); return d ? d.call(void 0, f, { view: t }) : f; } }; return B(c), c; }; })(h || (h = {})); export { h as IndentToolNS };