UNPKG

@progress/kendo-react-editor

Version:

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

38 lines (37 loc) 1.52 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 r from "react"; import { Button as p } from "@progress/kendo-react-buttons"; import { useLocalization as g } from "@progress/kendo-react-intl"; import { onDownPreventDefault as f } from "./utils.mjs"; import { messages as u } from "../messages/index.mjs"; import { cleanFormatting as b } from "@progress/kendo-editor-common"; import { EditorToolsSettings as N } from "../config/toolsSettings.mjs"; import { classNames as v } from "@progress/kendo-react-common"; const { cleanFormatting: k } = N, c = b(), S = (e) => { const { view: t, render: s, settings: o = k, ...l } = e, m = o.messages.title, a = !t || !c(t.state), d = r.useCallback(() => { t && c(t.state, (i) => { i.setMeta("commandName", o.commandName), t.dispatch(i); }); }, [t]), n = /* @__PURE__ */ r.createElement( p, { onClick: a ? void 0 : d, "aria-disabled": a ? !0 : void 0, title: g().toLanguageString(m, u[m]), ...f, ...o.props, ...l, className: v(e.className, o.props.className, { "k-disabled": a }) } ); return s ? s.call(void 0, n, { view: t }) : n; }; export { S as CleanFormatting };