UNPKG

@progress/kendo-react-editor

Version:

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

40 lines (39 loc) 1.53 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 m from "react"; import { Button as f } from "@progress/kendo-react-buttons"; import { onDownPreventDefault as u } from "./utils.mjs"; import { registerForLocalization as v, provideLocalizationService as N } from "@progress/kendo-react-intl"; import { messages as b } from "../messages/index.mjs"; import { classNames as P } from "@progress/kendo-react-common"; const k = (e, r) => { const a = class extends m.Component { render() { const { view: o, render: s, ...i } = this.props, p = N(this), n = e.messages.title, c = o && o.state, t = c ? !r(c) : !1, l = /* @__PURE__ */ m.createElement( f, { onClick: t ? void 0 : () => o && r( o.state, (d) => o.dispatch(d.setMeta("commandName", e.commandName)) ), "aria-disabled": t ? !0 : void 0, ...u, title: p.toLanguageString(n, b[n]), ...e.props, ...i, className: P(i.className, e.props.className, { "k-disabled": t }) } ); return s ? s.call(void 0, l, { view: o }) : l; } }; return v(a), a; }; export { k as createProseMirrorTool };