UNPKG

@progress/kendo-react-editor

Version:

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

309 lines (308 loc) 8.57 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 { EditorToolsSettings as n } from "../config/toolsSettings.mjs"; import { InsertTableToolNS as xe } from "./insertTable/tool.mjs"; import { InsertTablePopupNS as Se } from "./insertTable/popup.mjs"; import { createAlignTool as Ce } from "./align.mjs"; import { FontStyleToolNS as ye } from "./fontStyle.mjs"; import { ApplyColorTool as B } from "./applyColor.mjs"; import { FormatBlockToolNS as Le } from "./formatBlock.mjs"; import { HistoryToolNS as U } from "./history.mjs"; import { IndentToolNS as we } from "./indent.mjs"; import { InlineFormatToolNS as Te } from "./inlineFormat.mjs"; import { createInsertImageTool as Re } from "./insertImage.mjs"; import { LinkToolNS as be } from "./insertLink.mjs"; import { ListToolNS as De } from "./lists.mjs"; import { OutdentToolNS as ke } from "./outdent.mjs"; import { TableEditNS as l } from "./tableEdit.mjs"; import { UnlinkToolNS as Fe } from "./unlink.mjs"; import { ViewHtmlToolNS as Be } from "./viewHtml.mjs"; import { Print as Ue } from "./print.mjs"; import { Pdf as Ne } from "./pdf.mjs"; import { SelectAll as ve } from "./selectAll.mjs"; import { CleanFormatting as Pe } from "./cleanFormatting.mjs"; import { FindAndReplace as Ke } from "./findReplace.mjs"; import { ListTool as N } from "./lists-styled.mjs"; import { listUnorderedIcon as v, listOrderedIcon as P, listUnorderedOutlineIcon as Oe, listUnorderedSquareIcon as he, listRomanUpperIcon as He, listRomanLowerIcon as Ve, listLatinBigIcon as Me, listLatinSmallIcon as qe } from "@progress/kendo-svg-icons"; import { keys as o } from "../messages/index.mjs"; import { TableCellProperties as ze } from "./table-wizard/tableCellProperties.mjs"; import { TableProperties as Je } from "./table-wizard/tableProperties.mjs"; var K; ((t) => { function c(e) { return Ce(e); } t.createAlignTool = c; class O extends c(n.alignLeft) { } t.AlignLeft = O; class h extends c(n.alignRight) { } t.AlignRight = h; class H extends c(n.alignCenter) { } t.AlignCenter = H; class V extends c(n.alignJustify) { } t.AlignJustify = V; function d(e) { return xe.createInsertTableTool(e); } t.createInsertTableTool = d; class M extends d(n.insertTable) { } t.InsertTable = M; class q extends Se.InsertTablePopup { } t.InsertTablePopup = q; function s(e) { return ye.createStyleDropDownList(e); } t.createStyleDropDownList = s; class z extends s(n.fontSize) { } t.FontSize = z; class J extends s(n.fontName) { } t.FontName = J, t.ForeColor = (e) => /* @__PURE__ */ r.createElement(B, { ...n.foreColor, ...e }), t.BackColor = (e) => /* @__PURE__ */ r.createElement(B, { ...n.backColor, ...e }); function f(e) { return Le.createFormatBlockDropDownList(e); } t.createFormatBlockDropDownList = f; class $ extends f(n.formatBlock) { } t.FormatBlock = $; function p(e) { return U.createUndoTool(e); } t.createUndoTool = p; function I(e) { return U.createRedoTool(e); } t.createRedoTool = I; class j extends p(n.undo) { } t.Undo = j; class G extends I(n.redo) { } t.Redo = G; function g(e) { return we.createIndentTool(e); } t.createIndentTool = g; class Q extends g(n.indent) { } t.Indent = Q; function a(e) { return Te.createInlineFormatTool(e); } t.createInlineFormatTool = a; class W extends a(n.bold) { } t.Bold = W; class X extends a(n.italic) { } t.Italic = X; class Y extends a(n.underline) { } t.Underline = Y; class Z extends a(n.strikethrough) { } t.Strikethrough = Z; class _ extends a(n.subscript) { } t.Subscript = _; class E extends a(n.superscript) { } t.Superscript = E; function A(e) { return Re(e); } t.createInsertImageTool = A; class ee extends A(n.image) { } t.InsertImage = ee; function i(e) { return be.createLinkTool(e); } t.createLinkTool = i; class te extends i(n.link) { } t.Link = te; class ne extends i(n.insertFile) { } t.InsertFile = ne; function m(e) { return De.createListTool(e); } t.createListTool = m; class le extends m(n.orderedList) { } t.OrderedList = le; class re extends m(n.bulletList) { } t.UnorderedList = re, t.BulletedList = (e) => { const u = [ { icon: "list-unordered", svgIcon: v, textKey: o.listStyleDisc, style: "disc" }, { icon: "list-unordered-outline", svgIcon: Oe, textKey: o.listStyleCircle, style: "circle" }, { icon: "list-unordered-square", svgIcon: he, textKey: o.listStyleSquare, style: "square" } ]; return /* @__PURE__ */ r.createElement( N, { listType: n.bulletList.listType, items: u, icon: "list-unordered", svgIcon: v, titleKey: n.bulletList.messages.title, ...e } ); }, t.NumberedList = (e) => { const u = [ { icon: "list-ordered", svgIcon: P, textKey: o.listStyleDecimal }, // { icon: 'list-leading-zero', text: 'Decimal with leading zero', styleType: 'decimal-leading-zero' }, { icon: "list-roman-upper", svgIcon: He, textKey: o.listStyleUpperRoman, style: "upper-roman" }, { icon: "list-roman-lower", svgIcon: Ve, textKey: o.listStyleLowerRoman, style: "lower-roman" }, { icon: "list-latin-big", svgIcon: Me, textKey: o.listStyleUpperLatin, style: "upper-latin" }, { icon: "list-latin-small", svgIcon: qe, textKey: o.listStyleLowerLatin, style: "lower-latin" } ]; return /* @__PURE__ */ r.createElement( N, { listType: n.orderedList.listType, items: u, icon: "list-ordered", svgIcon: P, titleKey: n.orderedList.messages.title, ...e } ); }, t.TableCellProperties = ze, t.TableProperties = Je; function x(e) { return ke.createOutdentTool(e); } t.createOutdentTool = x; class oe extends x(n.outdent) { } t.Outdent = oe, t.Print = (e) => /* @__PURE__ */ r.createElement(Ue, { ...e }), t.Pdf = (e) => /* @__PURE__ */ r.createElement(Ne, { ...e }), t.SelectAll = (e) => /* @__PURE__ */ r.createElement(ve, { ...e }), t.CleanFormatting = (e) => /* @__PURE__ */ r.createElement(Pe, { ...e }); function S(e) { return l.createAddRowBeforeTool(e); } t.createAddRowBeforeTool = S; function C(e) { return l.createAddRowAfterTool(e); } t.createAddRowAfterTool = C; function y(e) { return l.createAddColumnBeforeTool(e); } t.createAddColumnBeforeTool = y; function L(e) { return l.createAddColumnAfterTool(e); } t.createAddColumnAfterTool = L; function w(e) { return l.createDeleteRowTool(e); } t.createDeleteRowTool = w; function T(e) { return l.createDeleteColumnTool(e); } t.createDeleteColumnTool = T; function R(e) { return l.createDeleteTableTool(e); } t.createDeleteTableTool = R; function b(e) { return l.createMergeCellsTool(e); } t.createMergeCellsTool = b; function D(e) { return l.createSplitCellTool(e); } t.createSplitCellTool = D; class ae extends S(n.addRowBefore) { } t.AddRowBefore = ae; class ce extends C(n.addRowAfter) { } t.AddRowAfter = ce; class se extends y(n.addColumnBefore) { } t.AddColumnBefore = se; class ie extends L(n.addColumnAfter) { } t.AddColumnAfter = ie; class me extends w(n.deleteRow) { } t.DeleteRow = me; class ue extends T(n.deleteColumn) { } t.DeleteColumn = ue; class de extends R(n.deleteTable) { } t.DeleteTable = de; class fe extends b(n.mergeCells) { } t.MergeCells = fe; class pe extends D(n.splitCell) { } t.SplitCell = pe; function k(e) { return Fe.createUnlinkTool(e); } t.createUnlinkTool = k; class Ie extends k(n.unlink) { } t.Unlink = Ie; function F(e) { return Be.createViewHtmlTool(e); } t.createViewHtmlTool = F; class ge extends F(n.viewHtml) { } t.ViewHtml = ge; class Ae extends Ke { } t.FindAndReplace = Ae; })(K || (K = {})); export { K as EditorTools };