@progress/kendo-react-editor
Version:
React Editor enables users to create rich text content through a WYSIWYG interface. KendoReact Editor package
47 lines (46 loc) • 1.71 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 f from "react";
import { Button as T } from "@progress/kendo-react-buttons";
import { hasNode as L, toggleList as y } from "@progress/kendo-editor-common";
import { onDownPreventDefault as b } from "./utils.mjs";
import { registerForLocalization as z, provideLocalizationService as N } from "@progress/kendo-react-intl";
import { messages as S } from "../messages/index.mjs";
var u;
((h) => {
h.createListTool = (o) => {
const i = class extends f.Component {
render() {
const { view: t, render: a, ...v } = this.props;
let s = !1;
const g = N(this), l = o.messages.title, e = o.types, n = o.listType;
if (t) {
const r = t.state, m = r.schema.nodes, p = L(r, m[e.orderedList]), d = L(r, m[e.bulletList]);
n === e.orderedList ? s = p && !d : s = !p && d;
}
const c = /* @__PURE__ */ f.createElement(
T,
{
onClick: () => t && y(t.state, t.dispatch, t, { listType: n, ...e }, o.commandName),
togglable: !0,
selected: s,
title: g.toLanguageString(l, S[l]),
...b,
...o.props,
...v
}
);
return a ? a.call(void 0, c, { view: t }) : c;
}
};
return z(i), i;
};
})(u || (u = {}));
export {
u as ListToolNS
};