@progress/kendo-react-editor
Version:
React Editor enables users to create rich text content through a WYSIWYG interface. KendoReact Editor package
60 lines (59 loc) • 1.95 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 t from "react";
import { Button as p } from "@progress/kendo-react-buttons";
import { onDownPreventDefault as c } from "./utils.mjs";
import { EditorDialogs as d } from "../dialogs/index.mjs";
import { registerForLocalization as D, provideLocalizationService as u } from "@progress/kendo-react-intl";
import { messages as h } from "../messages/index.mjs";
var n;
((m) => {
m.createViewHtmlTool = (o) => {
const i = class extends t.Component {
constructor() {
super(...arguments), this.state = {
openedDialog: !1
}, this.toggleDialog = () => {
this.setState({
openedDialog: !this.state.openedDialog
});
};
}
render() {
const { view: e, render: r, ...l } = this.props, g = u(this), a = o.messages.viewHtml, s = [
/* @__PURE__ */ t.createElement(
p,
{
onClick: this.toggleDialog,
key: "viewHtml",
...c,
title: g.toLanguageString(a, h[a]),
...o.props,
...l
}
),
this.state.openedDialog && e && /* @__PURE__ */ t.createElement(
d.ViewHtmlDialog,
{
key: "viewHtmlDialog",
view: e,
settings: o,
dir: l.dir,
onClose: this.toggleDialog
}
) || null
];
return r ? r.call(void 0, s, { view: e }) : s;
}
};
return D(i), i;
};
})(n || (n = {}));
export {
n as ViewHtmlToolNS
};