@progress/kendo-react-editor
Version:
React Editor enables users to create rich text content through a WYSIWYG interface. KendoReact Editor package
46 lines (45 loc) • 1.74 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 l from "react";
import { Button as f } from "@progress/kendo-react-buttons";
import { hasMark as v, removeLink as u } from "@progress/kendo-editor-common";
import { onDownPreventDefault as N } from "./utils.mjs";
import { registerForLocalization as b, provideLocalizationService as h } from "@progress/kendo-react-intl";
import { messages as L } from "../messages/index.mjs";
import { classNames as T } from "@progress/kendo-react-common";
var c;
((p) => {
p.createUnlinkTool = (t) => {
const a = class extends l.Component {
render() {
const { view: o, render: r, ...s } = this.props, n = { mark: t.mark }, d = o ? v(o.state, n) : !1, k = h(this), i = t.messages.title, e = !d, m = /* @__PURE__ */ l.createElement(
f,
{
onClick: e ? void 0 : () => o && u(n, o.state.tr.setMeta("commandName", t.commandName))(
o.state,
o.dispatch
),
"aria-disabled": e ? !0 : void 0,
...N,
title: k.toLanguageString(i, L[i]),
...t.props,
...s,
className: T(s.className, t.props.className, {
"k-disabled": e
})
}
);
return r ? r.call(void 0, m, { view: o }) : m;
}
};
return b(a), a;
};
})(c || (c = {}));
export {
c as UnlinkToolNS
};