@progress/kendo-react-editor 6.1.1-dev.202311151536 → 7.0.0-develop.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{dist/es/Editor.d.ts → Editor.d.ts} +5 -1
- package/{dist/npm/EditorProps.d.ts → EditorProps.d.ts} +4 -1
- package/LICENSE.md +1 -1
- package/{dist/es/config → config}/defaultStyles.d.ts +4 -0
- package/config/pasteSettings.d.ts +10 -0
- package/config/schema.d.ts +5 -0
- package/{dist/es/config → config}/shortcuts.d.ts +10 -6
- package/{dist/es/config → config}/toolsSettings.d.ts +4 -1
- package/{dist/npm/dialogs → dialogs}/EditorDialogProps.d.ts +4 -1
- package/{dist/npm/dialogs → dialogs}/FindReplace.d.ts +5 -1
- package/{dist/npm/dialogs/main.d.ts → dialogs/index.d.ts} +4 -0
- package/{dist/npm/dialogs → dialogs}/insertImage.d.ts +5 -1
- package/{dist/es/dialogs → dialogs}/insertLink.d.ts +5 -1
- package/{dist/npm/dialogs → dialogs}/viewHtml.d.ts +5 -1
- package/dist/cdn/js/kendo-react-editor.js +226 -1
- package/{dist/es/main.d.ts → index.d.ts} +10 -6
- package/index.js +226 -0
- package/index.mjs +4133 -0
- package/{dist/npm/messages → messages}/index.d.ts +4 -0
- package/package-metadata.d.ts +9 -0
- package/package.json +37 -52
- package/{dist/es/tools → tools}/ToolProps.d.ts +4 -1
- package/tools/align.d.ts +11 -0
- package/{dist/es/tools → tools}/applyColor.d.ts +4 -0
- package/{dist/npm/tools → tools}/cleanFormatting.d.ts +4 -0
- package/{dist/npm/tools → tools}/findReplace.d.ts +5 -1
- package/{dist/npm/tools → tools}/fontStyle.d.ts +4 -0
- package/{dist/es/tools → tools}/formatBlock.d.ts +4 -0
- package/{dist/npm/tools → tools}/history.d.ts +4 -0
- package/{dist/npm/tools → tools}/indent.d.ts +4 -0
- package/{dist/npm/tools/main.d.ts → tools/index.d.ts} +6 -2
- package/{dist/es/tools → tools}/inlineFormat.d.ts +4 -0
- package/tools/insertImage.d.ts +17 -0
- package/{dist/npm/tools → tools}/insertLink.d.ts +4 -0
- package/tools/insertTable/index.d.ts +7 -0
- package/{dist/npm/tools → tools}/insertTable/popup.d.ts +5 -1
- package/{dist/npm/tools → tools}/insertTable/popupGrid.d.ts +6 -2
- package/{dist/es/tools → tools}/insertTable/tool.d.ts +4 -0
- package/tools/lists-styled.d.ts +8 -0
- package/{dist/es/tools → tools}/lists.d.ts +4 -0
- package/{dist/es/tools → tools}/outdent.d.ts +4 -0
- package/{dist/npm/tools → tools}/pdf.d.ts +4 -0
- package/{dist/npm/tools → tools}/print.d.ts +4 -0
- package/{dist/npm/tools → tools}/proseMirrorTool.d.ts +4 -0
- package/{dist/npm/tools → tools}/selectAll.d.ts +4 -0
- package/{dist/npm/tools → tools}/table-wizard/cellPropsUtils.d.ts +4 -0
- package/{dist/npm/tools → tools}/table-wizard/tableCellProperties.d.ts +5 -1
- package/tools/table-wizard/tableProperties.d.ts +15 -0
- package/{dist/es/tools → tools}/table-wizard/tablePropsUtils.d.ts +5 -1
- package/{dist/es/tools → tools}/table-wizard/utils.d.ts +4 -0
- package/{dist/npm/tools → tools}/tableEdit.d.ts +4 -0
- package/{dist/npm/tools → tools}/unlink.d.ts +4 -0
- package/{dist/npm/tools → tools}/utils.d.ts +4 -0
- package/{dist/es/tools → tools}/viewHtml.d.ts +4 -0
- package/utils/browser-detection.d.ts +8 -0
- package/utils/controlled-value.d.ts +9 -0
- package/{dist/npm/utils → utils}/index.d.ts +4 -0
- package/utils/props-key.d.ts +9 -0
- package/about.md +0 -3
- package/dist/es/Editor.js +0 -441
- package/dist/es/EditorProps.d.ts +0 -197
- package/dist/es/EditorProps.js +0 -1
- package/dist/es/config/defaultStyles.js +0 -12
- package/dist/es/config/pasteSettings.d.ts +0 -6
- package/dist/es/config/pasteSettings.js +0 -1
- package/dist/es/config/schema.d.ts +0 -1
- package/dist/es/config/schema.js +0 -1
- package/dist/es/config/shortcuts.js +0 -34
- package/dist/es/config/toolsSettings.js +0 -522
- package/dist/es/dialogs/EditorDialogProps.d.ts +0 -27
- package/dist/es/dialogs/EditorDialogProps.js +0 -1
- package/dist/es/dialogs/FindReplace.d.ts +0 -71
- package/dist/es/dialogs/FindReplace.js +0 -248
- package/dist/es/dialogs/insertImage.d.ts +0 -28
- package/dist/es/dialogs/insertImage.js +0 -119
- package/dist/es/dialogs/insertLink.js +0 -94
- package/dist/es/dialogs/main.d.ts +0 -49
- package/dist/es/dialogs/main.js +0 -69
- package/dist/es/dialogs/viewHtml.d.ts +0 -25
- package/dist/es/dialogs/viewHtml.js +0 -79
- package/dist/es/main.js +0 -201
- package/dist/es/messages/index.d.ts +0 -334
- package/dist/es/messages/index.js +0 -989
- package/dist/es/package-metadata.d.ts +0 -5
- package/dist/es/package-metadata.js +0 -11
- package/dist/es/tools/ToolProps.js +0 -1
- package/dist/es/tools/align.d.ts +0 -7
- package/dist/es/tools/align.js +0 -70
- package/dist/es/tools/applyColor.js +0 -34
- package/dist/es/tools/cleanFormatting.d.ts +0 -16
- package/dist/es/tools/cleanFormatting.js +0 -50
- package/dist/es/tools/findReplace.d.ts +0 -29
- package/dist/es/tools/findReplace.js +0 -76
- package/dist/es/tools/fontStyle.d.ts +0 -28
- package/dist/es/tools/fontStyle.js +0 -91
- package/dist/es/tools/formatBlock.js +0 -89
- package/dist/es/tools/history.d.ts +0 -26
- package/dist/es/tools/history.js +0 -16
- package/dist/es/tools/indent.d.ts +0 -17
- package/dist/es/tools/indent.js +0 -90
- package/dist/es/tools/inlineFormat.js +0 -75
- package/dist/es/tools/insertImage.d.ts +0 -13
- package/dist/es/tools/insertImage.js +0 -78
- package/dist/es/tools/insertLink.d.ts +0 -24
- package/dist/es/tools/insertLink.js +0 -85
- package/dist/es/tools/insertTable/index.d.ts +0 -3
- package/dist/es/tools/insertTable/index.js +0 -3
- package/dist/es/tools/insertTable/popup.d.ts +0 -93
- package/dist/es/tools/insertTable/popup.js +0 -102
- package/dist/es/tools/insertTable/popupGrid.d.ts +0 -31
- package/dist/es/tools/insertTable/popupGrid.js +0 -54
- package/dist/es/tools/insertTable/tool.js +0 -106
- package/dist/es/tools/lists-styled.d.ts +0 -5
- package/dist/es/tools/lists-styled.js +0 -80
- package/dist/es/tools/lists.js +0 -84
- package/dist/es/tools/main.d.ts +0 -714
- package/dist/es/tools/main.js +0 -740
- package/dist/es/tools/outdent.js +0 -85
- package/dist/es/tools/pdf.d.ts +0 -25
- package/dist/es/tools/pdf.js +0 -44
- package/dist/es/tools/print.d.ts +0 -16
- package/dist/es/tools/print.js +0 -48
- package/dist/es/tools/proseMirrorTool.d.ts +0 -12
- package/dist/es/tools/proseMirrorTool.js +0 -67
- package/dist/es/tools/selectAll.d.ts +0 -16
- package/dist/es/tools/selectAll.js +0 -45
- package/dist/es/tools/table-wizard/cellPropsUtils.d.ts +0 -36
- package/dist/es/tools/table-wizard/cellPropsUtils.js +0 -203
- package/dist/es/tools/table-wizard/tableCellProperties.d.ts +0 -20
- package/dist/es/tools/table-wizard/tableCellProperties.js +0 -247
- package/dist/es/tools/table-wizard/tableProperties.d.ts +0 -11
- package/dist/es/tools/table-wizard/tableProperties.js +0 -294
- package/dist/es/tools/table-wizard/tablePropsUtils.js +0 -498
- package/dist/es/tools/table-wizard/utils.js +0 -144
- package/dist/es/tools/tableEdit.d.ts +0 -98
- package/dist/es/tools/tableEdit.js +0 -90
- package/dist/es/tools/unlink.d.ts +0 -17
- package/dist/es/tools/unlink.js +0 -77
- package/dist/es/tools/utils.d.ts +0 -50
- package/dist/es/tools/utils.js +0 -72
- package/dist/es/tools/viewHtml.js +0 -79
- package/dist/es/utils/browser-detection.d.ts +0 -4
- package/dist/es/utils/browser-detection.js +0 -5
- package/dist/es/utils/controlled-value.d.ts +0 -5
- package/dist/es/utils/controlled-value.js +0 -31
- package/dist/es/utils/index.d.ts +0 -363
- package/dist/es/utils/index.js +0 -431
- package/dist/es/utils/props-key.d.ts +0 -5
- package/dist/es/utils/props-key.js +0 -5
- package/dist/npm/Editor.d.ts +0 -118
- package/dist/npm/Editor.js +0 -444
- package/dist/npm/EditorProps.js +0 -2
- package/dist/npm/config/defaultStyles.d.ts +0 -12
- package/dist/npm/config/defaultStyles.js +0 -15
- package/dist/npm/config/pasteSettings.d.ts +0 -6
- package/dist/npm/config/pasteSettings.js +0 -2
- package/dist/npm/config/schema.d.ts +0 -1
- package/dist/npm/config/schema.js +0 -6
- package/dist/npm/config/shortcuts.d.ts +0 -24
- package/dist/npm/config/shortcuts.js +0 -38
- package/dist/npm/config/toolsSettings.d.ts +0 -490
- package/dist/npm/config/toolsSettings.js +0 -525
- package/dist/npm/dialogs/EditorDialogProps.js +0 -2
- package/dist/npm/dialogs/FindReplace.js +0 -251
- package/dist/npm/dialogs/insertImage.js +0 -122
- package/dist/npm/dialogs/insertLink.d.ts +0 -26
- package/dist/npm/dialogs/insertLink.js +0 -97
- package/dist/npm/dialogs/main.js +0 -72
- package/dist/npm/dialogs/viewHtml.js +0 -82
- package/dist/npm/main.d.ts +0 -176
- package/dist/npm/main.js +0 -189
- package/dist/npm/messages/index.js +0 -992
- package/dist/npm/package-metadata.d.ts +0 -5
- package/dist/npm/package-metadata.js +0 -14
- package/dist/npm/tools/ToolProps.d.ts +0 -38
- package/dist/npm/tools/ToolProps.js +0 -2
- package/dist/npm/tools/align.d.ts +0 -7
- package/dist/npm/tools/align.js +0 -74
- package/dist/npm/tools/applyColor.d.ts +0 -12
- package/dist/npm/tools/applyColor.js +0 -38
- package/dist/npm/tools/cleanFormatting.js +0 -54
- package/dist/npm/tools/findReplace.js +0 -79
- package/dist/npm/tools/fontStyle.js +0 -94
- package/dist/npm/tools/formatBlock.d.ts +0 -18
- package/dist/npm/tools/formatBlock.js +0 -92
- package/dist/npm/tools/history.js +0 -19
- package/dist/npm/tools/indent.js +0 -93
- package/dist/npm/tools/inlineFormat.d.ts +0 -47
- package/dist/npm/tools/inlineFormat.js +0 -78
- package/dist/npm/tools/insertImage.d.ts +0 -13
- package/dist/npm/tools/insertImage.js +0 -82
- package/dist/npm/tools/insertLink.js +0 -88
- package/dist/npm/tools/insertTable/index.d.ts +0 -3
- package/dist/npm/tools/insertTable/index.js +0 -7
- package/dist/npm/tools/insertTable/popup.js +0 -105
- package/dist/npm/tools/insertTable/popupGrid.js +0 -56
- package/dist/npm/tools/insertTable/tool.d.ts +0 -24
- package/dist/npm/tools/insertTable/tool.js +0 -109
- package/dist/npm/tools/lists-styled.d.ts +0 -5
- package/dist/npm/tools/lists-styled.js +0 -84
- package/dist/npm/tools/lists.d.ts +0 -27
- package/dist/npm/tools/lists.js +0 -87
- package/dist/npm/tools/main.js +0 -743
- package/dist/npm/tools/outdent.d.ts +0 -17
- package/dist/npm/tools/outdent.js +0 -88
- package/dist/npm/tools/pdf.js +0 -48
- package/dist/npm/tools/print.js +0 -52
- package/dist/npm/tools/proseMirrorTool.js +0 -71
- package/dist/npm/tools/selectAll.js +0 -49
- package/dist/npm/tools/table-wizard/cellPropsUtils.js +0 -208
- package/dist/npm/tools/table-wizard/tableCellProperties.js +0 -253
- package/dist/npm/tools/table-wizard/tableProperties.d.ts +0 -11
- package/dist/npm/tools/table-wizard/tableProperties.js +0 -298
- package/dist/npm/tools/table-wizard/tablePropsUtils.d.ts +0 -52
- package/dist/npm/tools/table-wizard/tablePropsUtils.js +0 -504
- package/dist/npm/tools/table-wizard/utils.d.ts +0 -39
- package/dist/npm/tools/table-wizard/utils.js +0 -153
- package/dist/npm/tools/tableEdit.js +0 -95
- package/dist/npm/tools/unlink.js +0 -80
- package/dist/npm/tools/utils.js +0 -82
- package/dist/npm/tools/viewHtml.d.ts +0 -24
- package/dist/npm/tools/viewHtml.js +0 -82
- package/dist/npm/utils/browser-detection.d.ts +0 -4
- package/dist/npm/utils/browser-detection.js +0 -8
- package/dist/npm/utils/controlled-value.d.ts +0 -5
- package/dist/npm/utils/controlled-value.js +0 -35
- package/dist/npm/utils/index.js +0 -434
- package/dist/npm/utils/props-key.d.ts +0 -5
- package/dist/npm/utils/props-key.js +0 -8
- package/dist/systemjs/kendo-react-editor.js +0 -1
- package/e2e-next/editor.basic.tests.ts +0 -24
package/index.mjs
ADDED
|
@@ -0,0 +1,4133 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2023 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
import * as l from "react";
|
|
6
|
+
import * as R from "prop-types";
|
|
7
|
+
import { Button as T, ToolbarSeparator as Ca, ButtonGroup as wa, Toolbar as xa, toolbarButtons as Pa, SplitButton as Sa } from "@progress/kendo-react-buttons";
|
|
8
|
+
import { IconWrap as Ue, validatePackage as Ia, shouldShowValidationUI as Na, classNames as X, WatermarkOverlay as Ra } from "@progress/kendo-react-common";
|
|
9
|
+
import { indentRules as al, bold as Aa, italic as Ta, underline as La, strikethrough as Ea, subscript as Da, superscript as Ba, link as rt, alignLeftRules as Ma, alignRightRules as Ha, alignCenterRules as za, alignJustifyRules as Fa, alignRemoveRules as Wa, outdentRules as Ka, applyLink as sl, getMark as lt, insertNode as xt, NodeSelection as il, PluginKey as Oe, trimWhitespace as st, setHtml as cl, indentHtml as dl, getHtml as pl, TextSelection as Be, find as $a, replace as Va, replaceAll as Ua, findAll as Oa, selectedLineTextOnly as _a, textHighlightKey as ja, chainCommands as ml, exitCode as ul, toggleInlineFormat as Me, undo as Pt, redo as _e, undoInputRule as gl, splitListItem as hl, goToNextCell as it, imageResizeKey as Ga, marks as fl, nodes as bl, alignBlocks as kl, applyInlineStyle as St, canIndentAsListItem as vl, canInsert as It, canOutdentAsListItem as yl, convertMsLists as qa, parseContent as Cl, createTable as wl, formatBlockElements as xl, getBlockFormats as Pl, getInlineStyles as Sl, hasMark as Nt, hasNode as ze, indentBlocks as Rt, isAligned as Il, isIndented as At, removeComments as Ja, removeTag as Qa, pasteCleanup as Xa, sanitizeClassAttr as Ya, sanitizeStyleAttr as Za, removeAttribute as es, sanitize as ts, replaceImageSourcesFromRtf as ls, textHighlight as os, imageResizing as ns, tableResizing as rs, toggleList as je, AllSelection as Nl, Plugin as Ve, spacesFix as as, caretColor as ss, history as Rl, dropCursor as Al, gapCursor as Tl, tableEditing as Ll, cspFix as is, Schema as El, EditorState as Dl, keymap as ct, baseKeymap as Bl, EditorView as Ml, sinkListItem as Hl, liftListItem as zl, addRowBefore as Fl, addRowAfter as Tt, addColumnBefore as Wl, addColumnAfter as Lt, deleteTable as Kl, mergeCells as $l, splitCell as Vl, deleteColumn as Ul, selectionCell as Et, deleteRow as Ol, removeLink as cs, selectAll as _l, cleanFormatting as ds, listStyle as Ft, TableMap as Le, htmlToFragment as jl, pmDocToFragment as ps, fragmentToHtml as ms, Selection as Gl, CellSelection as Dt, SelectionRange as us, Transaction as gs, Decoration as hs, DecorationSet as fs, Node as bs, ResolvedPos as ks, NodeRange as vs, Fragment as ys, Slice as Cs, ReplaceError as ws, Mark as xs, NodeType as Ps, MarkType as Ss, ContentMatch as Is, DOMParser as Ns, DOMSerializer as Rs, Transform as As, Step as Ts, StepResult as Ls, joinPoint as Es, canJoin as Ds, canSplit as Bs, insertPoint as Ms, dropPoint as Hs, liftTarget as zs, findWrapping as Fs, StepMap as Ws, MapResult as Ks, Mapping as $s, AddMarkStep as Vs, RemoveMarkStep as Us, ReplaceStep as Os, ReplaceAroundStep as _s, replaceStep as js, deleteSelection as Gs, joinBackward as qs, selectNodeBackward as Js, joinForward as Qs, selectNodeForward as Xs, joinUp as Ys, joinDown as Zs, lift as ei, newlineInCode as ti, createParagraphNear as li, liftEmptyBlock as oi, splitBlock as ni, splitBlockKeepMarks as ri, selectParentNode as ai, wrapIn as si, setBlockType as ii, toggleMark as ci, autoJoin as di, pcBaseKeymap as pi, macBaseKeymap as mi, undoDepth as ui, redoDepth as gi, InputRule as hi, inputRules as fi, emDash as bi, ellipsis as ki, openDoubleQuote as vi, closeDoubleQuote as yi, openSingleQuote as Ci, closeSingleQuote as wi, smartQuotes as xi, wrappingInputRule as Pi, textblockTypeInputRule as Si, keydownHandler as Ii, orderedList as Ni, bulletList as Ri, listItem as Ai, addListNodes as Ti, wrapInList as Li, fixTables as Ei, fixTablesKey as Di, cellAround as Bi, isInTable as Mi, moveCellForward as Hi, inSameTable as zi, findCell as Fi, colCount as Wi, nextCell as Ki, removeColSpan as $i, addColSpan as Vi, columnIsHeader as Ui, tableNodes as Oi, tableNodeTypes as _i, tableEditingKey as ji, columnResizing as Gi, columnResizingPluginKey as qi, updateColumnsOnResize as Ji, selectedRect as Qi, addColumn as Xi, rowIsHeader as Yi, addRow as Zi, splitCellWithType as ec, setCellAttr as tc, toggleHeader as lc, toggleHeaderRow as oc, toggleHeaderColumn as nc, toggleHeaderCell as rc } from "@progress/kendo-editor-common";
|
|
10
|
+
import { getHtml as Jp, marks as Qp, nodes as Xp, parseContent as Yp } from "@progress/kendo-editor-common";
|
|
11
|
+
import { boldIcon as ac, italicIcon as sc, underlineIcon as ic, strikethroughIcon as cc, subscriptIcon as dc, supscriptIcon as pc, linkIcon as mc, fileAddIcon as uc, tableAddIcon as gc, tableRowInsertAboveIcon as hc, tableRowInsertBelowIcon as fc, tableColumnInsertLeftIcon as bc, tableColumnInsertRightIcon as kc, tableRowDeleteIcon as vc, tableColumnDeleteIcon as yc, tableDeleteIcon as Cc, cellsMergeIcon as wc, cellSplitHorizontallyIcon as xc, printIcon as Pc, selectAllIcon as Sc, filePdfIcon as Ic, clearCssIcon as Nc, imageIcon as Rc, codeIcon as Ac, binocularsIcon as Tc, unlinkIcon as Lc, undoIcon as Ec, redoIcon as Dc, foregroundColorIcon as Bc, dropletIcon as Mc, alignLeftIcon as Hc, alignRightIcon as zc, alignCenterIcon as Fc, alignJustifyIcon as Wc, alignRemoveIcon as Kc, indentIcon as $c, outdentIcon as Vc, listOrderedIcon as dt, listUnorderedIcon as pt, chevronLeftIcon as Uc, chevronRightIcon as Oc, tableCellPropertiesIcon as _c, tableAlignTopLeftIcon as jc, tableAlignTopCenterIcon as Gc, tableAlignTopRightIcon as qc, tableAlignMiddleLeftIcon as ql, tableAlignMiddleCenterIcon as Jl, tableAlignMiddleRightIcon as Ql, tableAlignBottomLeftIcon as Jc, tableAlignBottomCenterIcon as Qc, tableAlignBottomRightIcon as Xc, tableAlignRemoveIcon as Xl, textWrapIcon as Yc, parameterStringIcon as Zc, tablePropertiesIcon as ed, tablePositionStartIcon as td, tablePositionCenterIcon as ld, tablePositionEndIcon as od, positionTopIcon as nd, positionBottomIcon as rd, listUnorderedOutlineIcon as ad, listUnorderedSquareIcon as sd, listRomanUpperIcon as id, listRomanLowerIcon as cd, listLatinBigIcon as dd, listLatinSmallIcon as pd } from "@progress/kendo-svg-icons";
|
|
12
|
+
import { Window as De, WindowActionsBar as We } from "@progress/kendo-react-dialogs";
|
|
13
|
+
import { Input as re, Checkbox as Ie, TextArea as md, ColorPicker as Fe, NumericTextBox as z, TextBox as He, InputPrefix as Yl } from "@progress/kendo-react-inputs";
|
|
14
|
+
import { Form as Ge, FormElement as qe, FieldWrapper as ee } from "@progress/kendo-react-form";
|
|
15
|
+
import { provideLocalizationService as D, registerForLocalization as B, useLocalization as te } from "@progress/kendo-react-intl";
|
|
16
|
+
import { TabStrip as Zl, TabStripTab as Je } from "@progress/kendo-react-layout";
|
|
17
|
+
import { Popup as ud } from "@progress/kendo-react-popup";
|
|
18
|
+
import { DropDownList as Q, AutoComplete as Qe } from "@progress/kendo-react-dropdowns";
|
|
19
|
+
import { savePDF as gd } from "@progress/kendo-react-pdf";
|
|
20
|
+
const hd = `
|
|
21
|
+
html, body {
|
|
22
|
+
margin: 0;
|
|
23
|
+
height: 100%;
|
|
24
|
+
padding: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
html {
|
|
28
|
+
min-height: 100%;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
body {
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
position: relative;
|
|
34
|
+
word-wrap: break-word;
|
|
35
|
+
padding: 8px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
body > .k-content {
|
|
39
|
+
outline: 0;
|
|
40
|
+
height: 100%;
|
|
41
|
+
white-space: pre-wrap;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.k-content > p {
|
|
45
|
+
margin: 0 0 1em;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.k-content table {
|
|
49
|
+
white-space: pre-wrap;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.k-content .k-text-selected, .k-content::selection {
|
|
53
|
+
color: HighlightText;
|
|
54
|
+
background-color: Highlight;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.k-content .k-text-highlighted {
|
|
58
|
+
background-color: #bbdefb;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.k-content .ProseMirror-selectednode {
|
|
62
|
+
outline: 2px solid #8cf;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.ProseMirror-hideselection *::selection { background: transparent; }
|
|
66
|
+
.ProseMirror-hideselection *::-moz-selection { background: transparent; }
|
|
67
|
+
.ProseMirror-hideselection { caret-color: transparent; }
|
|
68
|
+
|
|
69
|
+
.ProseMirror-gapcursor {
|
|
70
|
+
display: none;
|
|
71
|
+
pointer-events: none;
|
|
72
|
+
position: absolute;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.ProseMirror-gapcursor:after {
|
|
76
|
+
content: "";
|
|
77
|
+
display: block;
|
|
78
|
+
position: absolute;
|
|
79
|
+
top: -2px;
|
|
80
|
+
width: 20px;
|
|
81
|
+
border-top: 1px solid black;
|
|
82
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
@keyframes ProseMirror-cursor-blink {
|
|
86
|
+
to {
|
|
87
|
+
visibility: hidden;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
|
92
|
+
display: block;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.k-editor-resize-handles-wrapper {
|
|
96
|
+
position: absolute;
|
|
97
|
+
visibility: hidden;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.k-editor-resize-handle {
|
|
101
|
+
position: absolute;
|
|
102
|
+
visibility: visible;
|
|
103
|
+
background-color: #fff;
|
|
104
|
+
border: 1px solid #000;
|
|
105
|
+
z-index: 100;
|
|
106
|
+
width: 5px;
|
|
107
|
+
height: 5px;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.k-editor-resize-handle.northwest {
|
|
111
|
+
top: 0;
|
|
112
|
+
left: 0;
|
|
113
|
+
transform: translate(-50%, -50%);
|
|
114
|
+
cursor: nw-resize;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.k-editor-resize-handle.north {
|
|
118
|
+
top: 0;
|
|
119
|
+
left: 50%;
|
|
120
|
+
transform: translate(-50%, -50%);
|
|
121
|
+
cursor: n-resize;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.k-editor-resize-handle.northeast {
|
|
125
|
+
top: 0;
|
|
126
|
+
right: 0;
|
|
127
|
+
transform: translate(50%, -50%);
|
|
128
|
+
cursor: ne-resize;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.k-editor-resize-handle.southwest {
|
|
132
|
+
left: 0;
|
|
133
|
+
bottom: 0;
|
|
134
|
+
transform: translate(-50%, 50%);
|
|
135
|
+
cursor: sw-resize;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.k-editor-resize-handle.south {
|
|
139
|
+
bottom: 0;
|
|
140
|
+
left: 50%;
|
|
141
|
+
transform: translate(-50%, 50%);
|
|
142
|
+
cursor: s-resize;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.k-editor-resize-handle.southeast {
|
|
146
|
+
right: 0;
|
|
147
|
+
bottom: 0;
|
|
148
|
+
transform: translate(50%, 50%);
|
|
149
|
+
cursor: se-resize;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.k-editor-resize-handle.west {
|
|
153
|
+
top: 50%;
|
|
154
|
+
left: 0;
|
|
155
|
+
transform: translate(-50%, -50%);
|
|
156
|
+
cursor: w-resize;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.k-editor-resize-handle.east {
|
|
160
|
+
top: 50%;
|
|
161
|
+
right: 0;
|
|
162
|
+
transform: translate(50%, -50%);
|
|
163
|
+
cursor: e-resize;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.k-editor-resize-wrap-element {
|
|
167
|
+
display: inline-block;
|
|
168
|
+
position: relative;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.ProseMirror .row-resize-handle {
|
|
172
|
+
position: absolute;
|
|
173
|
+
right: 0; left: 0; bottom: 0;
|
|
174
|
+
transform: translate(0, 50%);
|
|
175
|
+
height: 4px;
|
|
176
|
+
z-index: 20;
|
|
177
|
+
background-color: #adf;
|
|
178
|
+
pointer-events: none;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.ProseMirror .column-resize-handle {
|
|
182
|
+
position: absolute;
|
|
183
|
+
right: -2px; top: 0; bottom: 0;
|
|
184
|
+
width: 4px;
|
|
185
|
+
z-index: 20;
|
|
186
|
+
background-color: #adf;
|
|
187
|
+
pointer-events: none;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.ProseMirror.resize-cursor {
|
|
191
|
+
cursor: ew-resize;
|
|
192
|
+
cursor: col-resize;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.ProseMirror.resize-cursor-vertical {
|
|
196
|
+
cursor: sn-resize;
|
|
197
|
+
cursor: row-resize;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.k-editor-resize-wrap-element table td p,
|
|
201
|
+
.k-editor-resize-wrap-element table th p {
|
|
202
|
+
margin: 0 auto;
|
|
203
|
+
}
|
|
204
|
+
`, fd = `
|
|
205
|
+
.ProseMirror .tableWrapper {
|
|
206
|
+
overflow-x: auto;
|
|
207
|
+
margin: 1em 0;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.ProseMirror table {
|
|
211
|
+
margin: 0;
|
|
212
|
+
border-collapse: collapse;
|
|
213
|
+
table-layout: fixed;
|
|
214
|
+
width: 100%;
|
|
215
|
+
overflow: hidden;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.ProseMirror td, .ProseMirror th {
|
|
219
|
+
min-width: 1em;
|
|
220
|
+
border: 1px solid #ddd;
|
|
221
|
+
padding: 3px 5px;
|
|
222
|
+
vertical-align: top;
|
|
223
|
+
box-sizing: border-box;
|
|
224
|
+
position: relative;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.ProseMirror th {
|
|
228
|
+
font-weight: bold;
|
|
229
|
+
text-align: left;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/* Give selected cells a blue overlay */
|
|
233
|
+
.ProseMirror .selectedCell:after {
|
|
234
|
+
z-index: 2;
|
|
235
|
+
position: absolute;
|
|
236
|
+
content: "";
|
|
237
|
+
left: 0; right: 0; top: 0; bottom: 0;
|
|
238
|
+
background: rgba(200, 200, 255, 0.4);
|
|
239
|
+
pointer-events: none;
|
|
240
|
+
}
|
|
241
|
+
`, bd = "body { direction: rtl }", eo = "editor.bold", to = "editor.italic", lo = "editor.underline", oo = "editor.strikethrough", no = "editor.subscript", ro = "editor.superscript", ao = "editor.hyperlink", so = "editor.insertFile", io = "editor.print", co = "editor.selectAll", po = "editor.cleanFormatting", mo = "editor.pdf", uo = "editor.foregroundColor", go = "editor.backgroundColor", ho = "editor.createTable", fo = "editor.insertTableHint", bo = "editor.addRowBefore", ko = "editor.addRowAfter", vo = "editor.addColumnBefore", yo = "editor.addColumnAfter", Co = "editor.deleteRow", wo = "editor.deleteColumn", xo = "editor.deleteTable", Po = "editor.mergeCells", So = "editor.splitCell", Io = "editor.hyperlink-dialog-title", No = "editor.hyperlink-dialog-content-address", Ro = "editor.hyperlink-dialog-content-title", Ao = "editor.hyperlink-dialog-content-newwindow", To = "editor.hyperlink-dialog-cancel", Lo = "editor.hyperlink-dialog-insert", Eo = "editor.insertfile-dialog-title", Do = "editor.insertfile-dialog-content-address", Bo = "editor.insertfile-dialog-content-title", Mo = "editor.insertfile-dialog-cancel", Ho = "editor.insertfile-dialog-insert", zo = "editor.image", Fo = "editor.image-dialog-title", Wo = "editor.image-address", Ko = "editor.image-title", $o = "editor.image-altText", Vo = "editor.image-width", Uo = "editor.image-height", Oo = "editor.image-cancel", _o = "editor.image-insert", jo = "editor.viewHtml", Go = "editor.viewHtml-dialog-title", qo = "editor.viewHtml-cancel", Jo = "editor.viewHtml-update", Qo = "editor.unlink", Xo = "editor.undo", Yo = "editor.redo", Zo = "editor.fontSize", en = "editor.fontName", tn = "editor.format", ln = "editor.alignLeft", on = "editor.alignRight", nn = "editor.alignCenter", rn = "editor.alignJustify", an = "editor.indent", sn = "editor.outdent", cn = "editor.orderedList", dn = "editor.bulletList", pn = "editor.findReplace-tool-title", mn = "editor.findReplace-dialog-title", un = "editor.findReplace-tab-find", gn = "editor.findReplace-tab-replace", hn = "editor.findReplace-findWhat", fn = "editor.findReplace-replaceWith", bn = "editor.findReplace-replace", kn = "editor.findReplace-replaceAll", vn = "editor.findReplace-matchCase", yn = "editor.findReplace-matchWord", Cn = "editor.findReplace-matchCyclic", wn = "editor.findReplace-useRegExp", xn = "editor.findReplace-prevMatch", Pn = "editor.findReplace-nextMatch", Sn = "editor.findReplace-matches", In = "editor.iframeTitle", Nn = "editorTools.foreColorLabel", Rn = "editorTools.backColorLabel", An = "editor.cellProperties", Tn = "editor.cellPropertiesLeftTop", Ln = "editor.cellPropertiesCenterTop", En = "editor.cellPropertiesRightTop", Dn = "editor.cellPropertiesLeftMiddle", Bn = "editor.cellPropertiesCenterMiddle", Mn = "editor.cellPropertiesRightMiddle", Hn = "editor.cellPropertiesLeftBottom", zn = "editor.cellPropertiesCenterBottom", Fn = "editor.cellPropertiesRightBottom", Wn = "editor.cellPropertiesNoAlignment", Kn = "editor.cellPropertiesWrap", $n = "editor.cellPropertiesFitToCell", Vn = "editor.cellPropertiesApplyToAllCells", Un = "editor.cellPropertiesWidth", On = "editor.cellPropertiesApplyToColumn", _n = "editor.cellPropertiesHeight", jn = "editor.cellPropertiesApplyToRow", Gn = "editor.cellPropertiesAlignment", qn = "editor.cellPropertiesTextControl", Jn = "editor.cellPropertiesCellPadding", Qn = "editor.cellPropertiesBackground", Xn = "editor.cellPropertiesBorderWidth", Yn = "editor.cellPropertiesBorderColor", Zn = "editor.cellPropertiesBorderStyle", er = "editor.cellPropertiesId", tr = "editor.cellPropertiesCssClass", lr = "editor.cellPropertiesSave", or = "editor.cellPropertiesCancel", nr = "editor.tableProperties", rr = "editor.tablePropertiesAlignLeft", ar = "editor.tablePropertiesAlignCenter", sr = "editor.tablePropertiesAlignRight", ir = "editor.tablePropertiesNoAlignment", cr = "editor.tablePropertiesLeft", dr = "editor.tablePropertiesCenter", pr = "editor.tablePropertiesRight", mr = "editor.tablePropertiesTop", ur = "editor.tablePropertiesBottom", gr = "editor.tablePropertiesNone", hr = "editor.tablePropertiesUsingScopeAttribute", fr = "editor.tablePropertiesUsingIdAttributes", br = "editor.tablePropertiesRows", kr = "editor.tablePropertiesColumns", vr = "editor.tablePropertiesWidth", yr = "editor.tablePropertiesHeight", Cr = "editor.tablePropertiesPosition", wr = "editor.tablePropertiesAlignment", xr = "editor.tablePropertiesCellSpacing", Pr = "editor.tablePropertiesCellPadding", Sr = "editor.tablePropertiesTableBackground", Ir = "editor.tablePropertiesBorderWidth", Nr = "editor.tablePropertiesBorderColor", Rr = "editor.tablePropertiesBorderStyle", Ar = "editor.tablePropertiesCollapseBorders", Tr = "editor.tablePropertiesID", Lr = "editor.tablePropertiesCssClass", Er = "editor.tablePropertiesAccessibility", Dr = "editor.tablePropertiesCaption", Br = "editor.tablePropertiesCaptionPosition", Mr = "editor.tablePropertiesCaptionAlignment", Hr = "editor.tablePropertiesHeaderRows", zr = "editor.tablePropertiesHeaderCols", Fr = "editor.tablePropertiesAssociateHeaders", Wr = "editor.tablePropertiesGeneral", Kr = "editor.tablePropertiesAdvanced", $r = "editor.tablePropertiesSave", Vr = "editor.tablePropertiesCancel", Ur = "editor.borderStyleNone", Or = "editor.borderStyleSolid", _r = "editor.borderStyleDotted", jr = "editor.borderStyleDashed", Gr = "editor.borderStyleDouble", qr = "editor.borderStyleGroove", Jr = "editor.borderStyleRidge", Qr = "editor.borderStyleInset", Xr = "editor.borderStyleOutset", Yr = "editor.borderStyleInitial", Zr = "editor.borderStyleInherit", ea = "editor.borderStyleHidden", ta = "editor.sizeAuto", u = {
|
|
242
|
+
[eo]: "Bold",
|
|
243
|
+
[to]: "Italic",
|
|
244
|
+
[lo]: "Underline",
|
|
245
|
+
[oo]: "Strikethrough",
|
|
246
|
+
[no]: "Subscript",
|
|
247
|
+
[ro]: "Superscript",
|
|
248
|
+
[Qo]: "Remove hyperlink",
|
|
249
|
+
[Xo]: "Undo",
|
|
250
|
+
[Yo]: "Redo",
|
|
251
|
+
[Zo]: "Font Size",
|
|
252
|
+
[en]: "Font Name",
|
|
253
|
+
[tn]: "Format",
|
|
254
|
+
[ln]: "Align text left",
|
|
255
|
+
[on]: "Align text right",
|
|
256
|
+
[nn]: "Center text",
|
|
257
|
+
[rn]: "Justify",
|
|
258
|
+
[an]: "Indent",
|
|
259
|
+
[sn]: "Outdent",
|
|
260
|
+
[cn]: "Insert ordered list",
|
|
261
|
+
[dn]: "Insert unordered list",
|
|
262
|
+
[io]: "Print",
|
|
263
|
+
[co]: "Select All",
|
|
264
|
+
[po]: "Clean formatting",
|
|
265
|
+
[mo]: "Export as PDF",
|
|
266
|
+
[uo]: "Color",
|
|
267
|
+
[go]: "Background color",
|
|
268
|
+
// Tables
|
|
269
|
+
[ho]: "Create a table",
|
|
270
|
+
[fo]: "Create a {0} x {1} table",
|
|
271
|
+
[bo]: "Add row above",
|
|
272
|
+
[ko]: "Add row below",
|
|
273
|
+
[vo]: "Add column on the left",
|
|
274
|
+
[yo]: "Add column on the right",
|
|
275
|
+
[Co]: "Delete row",
|
|
276
|
+
[wo]: "Delete column",
|
|
277
|
+
[xo]: "Delete table",
|
|
278
|
+
[Po]: "Merge cells",
|
|
279
|
+
[So]: "Split cell",
|
|
280
|
+
// Insert Link
|
|
281
|
+
[ao]: "Insert hyperlink",
|
|
282
|
+
[Io]: "Insert hyperlink",
|
|
283
|
+
[No]: "Web address",
|
|
284
|
+
[Ro]: "Title",
|
|
285
|
+
[Ao]: "Open link in new window",
|
|
286
|
+
[To]: "Cancel",
|
|
287
|
+
[Lo]: "Insert",
|
|
288
|
+
// Insert File
|
|
289
|
+
[so]: "Insert file",
|
|
290
|
+
[Eo]: "Insert file",
|
|
291
|
+
[Do]: "Web address",
|
|
292
|
+
[Bo]: "Title",
|
|
293
|
+
[Mo]: "Cancel",
|
|
294
|
+
[Ho]: "Insert",
|
|
295
|
+
// Insert Image
|
|
296
|
+
[zo]: "Insert image",
|
|
297
|
+
[Fo]: "Insert image",
|
|
298
|
+
[Wo]: "Web address",
|
|
299
|
+
[Ko]: "Title",
|
|
300
|
+
[$o]: "Alternate text",
|
|
301
|
+
[Vo]: "Width (px)",
|
|
302
|
+
[Uo]: "Height (px)",
|
|
303
|
+
[Oo]: "Cancel",
|
|
304
|
+
[_o]: "Insert",
|
|
305
|
+
// View HTML
|
|
306
|
+
[jo]: "View HTML",
|
|
307
|
+
[Go]: "View HTML",
|
|
308
|
+
[qo]: "Cancel",
|
|
309
|
+
[Jo]: "Update",
|
|
310
|
+
// Find and Replace
|
|
311
|
+
[pn]: "Find and Replace",
|
|
312
|
+
[mn]: "Find and Replace",
|
|
313
|
+
[un]: "Find",
|
|
314
|
+
[gn]: "Replace",
|
|
315
|
+
[hn]: "Find What:",
|
|
316
|
+
[fn]: "Replace With",
|
|
317
|
+
[bn]: "Replace",
|
|
318
|
+
[kn]: "Replace All",
|
|
319
|
+
[vn]: "Match Case",
|
|
320
|
+
[yn]: "Match whole word only",
|
|
321
|
+
[Cn]: "Match cyclic (Wrap around)",
|
|
322
|
+
[wn]: "Regular Expression",
|
|
323
|
+
[xn]: "Prev",
|
|
324
|
+
[Pn]: "Next",
|
|
325
|
+
[Sn]: "{0} of {1} matches",
|
|
326
|
+
[In]: "Editable area. Press Alt + F10 for toolbar.",
|
|
327
|
+
[Nn]: "Fore Color",
|
|
328
|
+
[Rn]: "Back Color",
|
|
329
|
+
[An]: "Cell properties",
|
|
330
|
+
[Tn]: "Left Top",
|
|
331
|
+
[Ln]: "Center Top",
|
|
332
|
+
[En]: "Right Top",
|
|
333
|
+
[Dn]: "Left Middle",
|
|
334
|
+
[Bn]: "Center Middle",
|
|
335
|
+
[Mn]: "Right Middle",
|
|
336
|
+
[Hn]: "Left Bottom",
|
|
337
|
+
[zn]: "Center Bottom",
|
|
338
|
+
[Fn]: "Right Bottom",
|
|
339
|
+
[Wn]: "No Alignment",
|
|
340
|
+
[Kn]: "Wrap",
|
|
341
|
+
[$n]: "Fit to cell",
|
|
342
|
+
[Vn]: "Apply to all cells",
|
|
343
|
+
[Un]: "Width",
|
|
344
|
+
[On]: "apply to column",
|
|
345
|
+
[_n]: "Height",
|
|
346
|
+
[jn]: "apply to row",
|
|
347
|
+
[Gn]: "Alignment",
|
|
348
|
+
[qn]: "Text control",
|
|
349
|
+
[Jn]: "Cell padding",
|
|
350
|
+
[Qn]: "Background",
|
|
351
|
+
[Xn]: "Border width",
|
|
352
|
+
[Yn]: "Border color",
|
|
353
|
+
[Zn]: "Border style",
|
|
354
|
+
[er]: "ID",
|
|
355
|
+
[tr]: "CSS class",
|
|
356
|
+
[lr]: "Save",
|
|
357
|
+
[or]: "Cancel",
|
|
358
|
+
[nr]: "Table properties",
|
|
359
|
+
[rr]: "Align Left",
|
|
360
|
+
[ar]: "Align Center",
|
|
361
|
+
[sr]: "Align Right",
|
|
362
|
+
[ir]: "No Alignment",
|
|
363
|
+
[cr]: "Left",
|
|
364
|
+
[dr]: "Center",
|
|
365
|
+
[pr]: "Right",
|
|
366
|
+
[mr]: "Top",
|
|
367
|
+
[ur]: "Bottom",
|
|
368
|
+
[gr]: "None",
|
|
369
|
+
[hr]: "Using 'scope' attribute",
|
|
370
|
+
[fr]: "Using 'id' attributes",
|
|
371
|
+
[br]: "Rows",
|
|
372
|
+
[kr]: "Columns",
|
|
373
|
+
[vr]: "Width",
|
|
374
|
+
[yr]: "Height",
|
|
375
|
+
[Cr]: "Position",
|
|
376
|
+
[wr]: "Alignment",
|
|
377
|
+
[xr]: "Cell spacing",
|
|
378
|
+
[Pr]: "Cell padding",
|
|
379
|
+
[Sr]: "Table background",
|
|
380
|
+
[Ir]: "Border width",
|
|
381
|
+
[Nr]: "Border color",
|
|
382
|
+
[Rr]: "Border style",
|
|
383
|
+
[Ar]: "Collapse borders",
|
|
384
|
+
[Tr]: "ID",
|
|
385
|
+
[Lr]: "CSS class",
|
|
386
|
+
[Er]: "Accessibility",
|
|
387
|
+
[Dr]: "Caption",
|
|
388
|
+
[Br]: "Position",
|
|
389
|
+
[Mr]: "Alignment",
|
|
390
|
+
[Hr]: "Header rows",
|
|
391
|
+
[zr]: "Header cols",
|
|
392
|
+
[Fr]: "Associate headers",
|
|
393
|
+
[Wr]: "General",
|
|
394
|
+
[Kr]: "Advanced",
|
|
395
|
+
[$r]: "Save",
|
|
396
|
+
[Vr]: "Cancel",
|
|
397
|
+
[Ur]: "None",
|
|
398
|
+
[Or]: "Solid",
|
|
399
|
+
[_r]: "Dotted",
|
|
400
|
+
[jr]: "Dashed",
|
|
401
|
+
[Gr]: "Double",
|
|
402
|
+
[qr]: "Groove",
|
|
403
|
+
[Jr]: "Ridge",
|
|
404
|
+
[Qr]: "Inset",
|
|
405
|
+
[Xr]: "Outset",
|
|
406
|
+
[Yr]: "Initial",
|
|
407
|
+
[Zr]: "Inherit",
|
|
408
|
+
[ea]: "Hidden",
|
|
409
|
+
[ta]: "Auto"
|
|
410
|
+
}, s = {
|
|
411
|
+
bold: eo,
|
|
412
|
+
italic: to,
|
|
413
|
+
underline: lo,
|
|
414
|
+
strikethrough: oo,
|
|
415
|
+
subscript: no,
|
|
416
|
+
superscript: ro,
|
|
417
|
+
unlink: Qo,
|
|
418
|
+
undo: Xo,
|
|
419
|
+
redo: Yo,
|
|
420
|
+
fontSize: Zo,
|
|
421
|
+
fontName: en,
|
|
422
|
+
format: tn,
|
|
423
|
+
alignLeft: ln,
|
|
424
|
+
alignRight: on,
|
|
425
|
+
alignCenter: nn,
|
|
426
|
+
alignJustify: rn,
|
|
427
|
+
indent: an,
|
|
428
|
+
outdent: sn,
|
|
429
|
+
orderedList: cn,
|
|
430
|
+
bulletList: dn,
|
|
431
|
+
print: io,
|
|
432
|
+
selectAll: co,
|
|
433
|
+
cleanFormatting: po,
|
|
434
|
+
pdf: mo,
|
|
435
|
+
foregroundColor: uo,
|
|
436
|
+
backgroundColor: go,
|
|
437
|
+
createTable: ho,
|
|
438
|
+
createTableHint: fo,
|
|
439
|
+
addRowBefore: bo,
|
|
440
|
+
addRowAfter: ko,
|
|
441
|
+
addColumnBefore: vo,
|
|
442
|
+
addColumnAfter: yo,
|
|
443
|
+
deleteRow: Co,
|
|
444
|
+
deleteColumn: wo,
|
|
445
|
+
deleteTable: xo,
|
|
446
|
+
mergeCells: Po,
|
|
447
|
+
splitCell: So,
|
|
448
|
+
insertHyperlink: ao,
|
|
449
|
+
insertHyperlinkDialogTitle: Io,
|
|
450
|
+
insertHyperlinkAddress: No,
|
|
451
|
+
insertHyperlinkTitle: Ro,
|
|
452
|
+
insertHyperlinkNewWindow: Ao,
|
|
453
|
+
insertHyperlinkCancel: To,
|
|
454
|
+
insertHyperlinkInsert: Lo,
|
|
455
|
+
insertFile: so,
|
|
456
|
+
insertFileDialogTitle: Eo,
|
|
457
|
+
insertFileAddress: Do,
|
|
458
|
+
insertFileTitle: Bo,
|
|
459
|
+
insertFileCancel: Mo,
|
|
460
|
+
insertFileInsert: Ho,
|
|
461
|
+
insertImage: zo,
|
|
462
|
+
insertImageDialogTitle: Fo,
|
|
463
|
+
insertImageAddress: Wo,
|
|
464
|
+
insertImageTitle: Ko,
|
|
465
|
+
insertImageAltText: $o,
|
|
466
|
+
insertImageWidth: Vo,
|
|
467
|
+
insertImageHeight: Uo,
|
|
468
|
+
insertImageCancel: Oo,
|
|
469
|
+
insertImageInsert: _o,
|
|
470
|
+
viewHtml: jo,
|
|
471
|
+
viewHtmlDialogTitle: Go,
|
|
472
|
+
viewHtmlCancel: qo,
|
|
473
|
+
viewHtmlUpdate: Jo,
|
|
474
|
+
findReplaceToolTitle: pn,
|
|
475
|
+
findReplaceDialogTitle: mn,
|
|
476
|
+
findReplaceTabFind: un,
|
|
477
|
+
findReplaceTabReplace: gn,
|
|
478
|
+
findReplaceFindWhat: hn,
|
|
479
|
+
findReplaceReplaceWith: fn,
|
|
480
|
+
findReplaceReplace: bn,
|
|
481
|
+
findReplaceReplaceAll: kn,
|
|
482
|
+
findReplaceMatchCase: vn,
|
|
483
|
+
findReplaceMatchWord: yn,
|
|
484
|
+
findReplaceMatchCyclic: Cn,
|
|
485
|
+
findReplaceUseRegExp: wn,
|
|
486
|
+
findReplacePrevMatch: xn,
|
|
487
|
+
findReplaceNextMatch: Pn,
|
|
488
|
+
findReplaceMatches: Sn,
|
|
489
|
+
iframeTitle: In,
|
|
490
|
+
foreColorLabel: Nn,
|
|
491
|
+
backColorLabel: Rn,
|
|
492
|
+
cellProperties: An,
|
|
493
|
+
cellPropertiesLeftTop: Tn,
|
|
494
|
+
cellPropertiesCenterTop: Ln,
|
|
495
|
+
cellPropertiesRightTop: En,
|
|
496
|
+
cellPropertiesLeftMiddle: Dn,
|
|
497
|
+
cellPropertiesCenterMiddle: Bn,
|
|
498
|
+
cellPropertiesRightMiddle: Mn,
|
|
499
|
+
cellPropertiesLeftBottom: Hn,
|
|
500
|
+
cellPropertiesCenterBottom: zn,
|
|
501
|
+
cellPropertiesRightBottom: Fn,
|
|
502
|
+
cellPropertiesNoAlignment: Wn,
|
|
503
|
+
cellPropertiesWrap: Kn,
|
|
504
|
+
cellPropertiesFitToCell: $n,
|
|
505
|
+
cellPropertiesApplyToAllCells: Vn,
|
|
506
|
+
cellPropertiesWidth: Un,
|
|
507
|
+
cellPropertiesApplyToColumn: On,
|
|
508
|
+
cellPropertiesHeight: _n,
|
|
509
|
+
cellPropertiesApplyToRow: jn,
|
|
510
|
+
cellPropertiesAlignment: Gn,
|
|
511
|
+
cellPropertiesTextControl: qn,
|
|
512
|
+
cellPropertiesCellPadding: Jn,
|
|
513
|
+
cellPropertiesBackground: Qn,
|
|
514
|
+
cellPropertiesBorderWidth: Xn,
|
|
515
|
+
cellPropertiesBorderColor: Yn,
|
|
516
|
+
cellPropertiesBorderStyle: Zn,
|
|
517
|
+
cellPropertiesId: er,
|
|
518
|
+
cellPropertiesCssClass: tr,
|
|
519
|
+
cellPropertiesSave: lr,
|
|
520
|
+
cellPropertiesCancel: or,
|
|
521
|
+
tableProperties: nr,
|
|
522
|
+
tablePropertiesAlignLeft: rr,
|
|
523
|
+
tablePropertiesAlignCenter: ar,
|
|
524
|
+
tablePropertiesAlignRight: sr,
|
|
525
|
+
tablePropertiesNoAlignment: ir,
|
|
526
|
+
tablePropertiesLeft: cr,
|
|
527
|
+
tablePropertiesCenter: dr,
|
|
528
|
+
tablePropertiesRight: pr,
|
|
529
|
+
tablePropertiesTop: mr,
|
|
530
|
+
tablePropertiesBottom: ur,
|
|
531
|
+
tablePropertiesNone: gr,
|
|
532
|
+
tablePropertiesUsingScopeAttribute: hr,
|
|
533
|
+
tablePropertiesUsingIdAttributes: fr,
|
|
534
|
+
tablePropertiesRows: br,
|
|
535
|
+
tablePropertiesColumns: kr,
|
|
536
|
+
tablePropertiesWidth: vr,
|
|
537
|
+
tablePropertiesHeight: yr,
|
|
538
|
+
tablePropertiesPosition: Cr,
|
|
539
|
+
tablePropertiesAlignment: wr,
|
|
540
|
+
tablePropertiesCellSpacing: xr,
|
|
541
|
+
tablePropertiesCellPadding: Pr,
|
|
542
|
+
tablePropertiesTableBackground: Sr,
|
|
543
|
+
tablePropertiesBorderWidth: Ir,
|
|
544
|
+
tablePropertiesBorderColor: Nr,
|
|
545
|
+
tablePropertiesBorderStyle: Rr,
|
|
546
|
+
tablePropertiesCollapseBorders: Ar,
|
|
547
|
+
tablePropertiesId: Tr,
|
|
548
|
+
tablePropertiesCssClass: Lr,
|
|
549
|
+
tablePropertiesAccessibility: Er,
|
|
550
|
+
tablePropertiesCaption: Dr,
|
|
551
|
+
tablePropertiesCaptionPosition: Br,
|
|
552
|
+
tablePropertiesCaptionAlignment: Mr,
|
|
553
|
+
tablePropertiesHeaderRows: Hr,
|
|
554
|
+
tablePropertiesHeaderCols: zr,
|
|
555
|
+
tablePropertiesAssociateHeaders: Fr,
|
|
556
|
+
tablePropertiesGeneral: Wr,
|
|
557
|
+
tablePropertiesAdvanced: Kr,
|
|
558
|
+
tablePropertiesSave: $r,
|
|
559
|
+
tablePropertiesCancel: Vr,
|
|
560
|
+
borderStyleNone: Ur,
|
|
561
|
+
borderStyleSolid: Or,
|
|
562
|
+
borderStyleDotted: _r,
|
|
563
|
+
borderStyleDashed: jr,
|
|
564
|
+
borderStyleDouble: Gr,
|
|
565
|
+
borderStyleGroove: qr,
|
|
566
|
+
borderStyleRidge: Jr,
|
|
567
|
+
borderStyleInset: Qr,
|
|
568
|
+
borderStyleOutset: Xr,
|
|
569
|
+
borderStyleInitial: Yr,
|
|
570
|
+
borderStyleInherit: Zr,
|
|
571
|
+
borderStyleHidden: ea,
|
|
572
|
+
sizeAuto: ta
|
|
573
|
+
}, Se = { ...al.listsTypes };
|
|
574
|
+
var P;
|
|
575
|
+
((t) => {
|
|
576
|
+
const e = {
|
|
577
|
+
type: "button"
|
|
578
|
+
};
|
|
579
|
+
t.bold = {
|
|
580
|
+
...Aa,
|
|
581
|
+
props: {
|
|
582
|
+
icon: "bold",
|
|
583
|
+
svgIcon: ac,
|
|
584
|
+
...e
|
|
585
|
+
},
|
|
586
|
+
messages: {
|
|
587
|
+
title: s.bold
|
|
588
|
+
},
|
|
589
|
+
commandName: "Bold"
|
|
590
|
+
}, t.italic = {
|
|
591
|
+
...Ta,
|
|
592
|
+
props: {
|
|
593
|
+
icon: "italic",
|
|
594
|
+
svgIcon: sc,
|
|
595
|
+
...e
|
|
596
|
+
},
|
|
597
|
+
messages: {
|
|
598
|
+
title: s.italic
|
|
599
|
+
},
|
|
600
|
+
commandName: "Italic"
|
|
601
|
+
}, t.underline = {
|
|
602
|
+
...La,
|
|
603
|
+
props: {
|
|
604
|
+
icon: "underline",
|
|
605
|
+
svgIcon: ic,
|
|
606
|
+
...e
|
|
607
|
+
},
|
|
608
|
+
messages: {
|
|
609
|
+
title: s.underline
|
|
610
|
+
},
|
|
611
|
+
commandName: "Underline"
|
|
612
|
+
}, t.strikethrough = {
|
|
613
|
+
...Ea,
|
|
614
|
+
props: {
|
|
615
|
+
icon: "strikethrough",
|
|
616
|
+
svgIcon: cc,
|
|
617
|
+
...e
|
|
618
|
+
},
|
|
619
|
+
messages: {
|
|
620
|
+
title: s.strikethrough
|
|
621
|
+
},
|
|
622
|
+
commandName: "Strikethrough"
|
|
623
|
+
}, t.subscript = {
|
|
624
|
+
...Da,
|
|
625
|
+
props: {
|
|
626
|
+
icon: "subscript",
|
|
627
|
+
svgIcon: dc,
|
|
628
|
+
...e
|
|
629
|
+
},
|
|
630
|
+
messages: {
|
|
631
|
+
title: s.subscript
|
|
632
|
+
},
|
|
633
|
+
commandName: "Subscript"
|
|
634
|
+
}, t.superscript = {
|
|
635
|
+
...Ba,
|
|
636
|
+
props: {
|
|
637
|
+
icon: "supscript",
|
|
638
|
+
svgIcon: pc,
|
|
639
|
+
...e
|
|
640
|
+
},
|
|
641
|
+
messages: {
|
|
642
|
+
title: s.superscript
|
|
643
|
+
},
|
|
644
|
+
commandName: "Superscript"
|
|
645
|
+
}, t.link = {
|
|
646
|
+
...rt,
|
|
647
|
+
props: {
|
|
648
|
+
icon: "link",
|
|
649
|
+
svgIcon: mc,
|
|
650
|
+
...e
|
|
651
|
+
},
|
|
652
|
+
messages: {
|
|
653
|
+
insertHyperlink: s.insertHyperlink,
|
|
654
|
+
insertHyperlinkDialogTitle: s.insertHyperlinkDialogTitle,
|
|
655
|
+
insertHyperlinkAddress: s.insertHyperlinkAddress,
|
|
656
|
+
insertHyperlinkTitle: s.insertHyperlinkTitle,
|
|
657
|
+
insertHyperlinkNewWindow: s.insertHyperlinkNewWindow,
|
|
658
|
+
insertHyperlinkCancel: s.insertHyperlinkCancel,
|
|
659
|
+
insertHyperlinkInsert: s.insertHyperlinkInsert
|
|
660
|
+
},
|
|
661
|
+
commandName: "Link"
|
|
662
|
+
}, t.insertFile = {
|
|
663
|
+
...rt,
|
|
664
|
+
props: {
|
|
665
|
+
icon: "file-add",
|
|
666
|
+
svgIcon: uc,
|
|
667
|
+
...e
|
|
668
|
+
},
|
|
669
|
+
messages: {
|
|
670
|
+
insertHyperlink: s.insertFile,
|
|
671
|
+
insertHyperlinkDialogTitle: s.insertFileDialogTitle,
|
|
672
|
+
insertHyperlinkAddress: s.insertFileAddress,
|
|
673
|
+
insertHyperlinkTitle: s.insertFileTitle,
|
|
674
|
+
insertHyperlinkNewWindow: "",
|
|
675
|
+
insertHyperlinkCancel: s.insertFileCancel,
|
|
676
|
+
insertHyperlinkInsert: s.insertFileInsert
|
|
677
|
+
},
|
|
678
|
+
commandName: "InsertFile",
|
|
679
|
+
linkTarget: !1
|
|
680
|
+
}, t.insertTable = {
|
|
681
|
+
props: {
|
|
682
|
+
icon: "table-add",
|
|
683
|
+
svgIcon: gc,
|
|
684
|
+
...e
|
|
685
|
+
},
|
|
686
|
+
messages: {
|
|
687
|
+
createTable: s.createTable,
|
|
688
|
+
createTableHint: s.createTableHint
|
|
689
|
+
},
|
|
690
|
+
commandName: "InsertTable"
|
|
691
|
+
}, t.addRowBefore = {
|
|
692
|
+
props: {
|
|
693
|
+
icon: "table-row-insert-above",
|
|
694
|
+
svgIcon: hc,
|
|
695
|
+
...e
|
|
696
|
+
},
|
|
697
|
+
messages: {
|
|
698
|
+
title: s.addRowBefore
|
|
699
|
+
},
|
|
700
|
+
commandName: "AddRowBefore"
|
|
701
|
+
}, t.addRowAfter = {
|
|
702
|
+
props: {
|
|
703
|
+
icon: "table-row-insert-below",
|
|
704
|
+
svgIcon: fc,
|
|
705
|
+
...e
|
|
706
|
+
},
|
|
707
|
+
messages: {
|
|
708
|
+
title: s.addRowAfter
|
|
709
|
+
},
|
|
710
|
+
commandName: "AddRowAfter"
|
|
711
|
+
}, t.addColumnBefore = {
|
|
712
|
+
props: {
|
|
713
|
+
icon: "table-column-insert-left",
|
|
714
|
+
svgIcon: bc,
|
|
715
|
+
...e
|
|
716
|
+
},
|
|
717
|
+
messages: {
|
|
718
|
+
title: s.addColumnBefore
|
|
719
|
+
},
|
|
720
|
+
commandName: "AddColumnBefore"
|
|
721
|
+
}, t.addColumnAfter = {
|
|
722
|
+
props: {
|
|
723
|
+
icon: "table-column-insert-right",
|
|
724
|
+
svgIcon: kc,
|
|
725
|
+
...e
|
|
726
|
+
},
|
|
727
|
+
messages: {
|
|
728
|
+
title: s.addColumnAfter
|
|
729
|
+
},
|
|
730
|
+
commandName: "AddColumnAfter"
|
|
731
|
+
}, t.deleteRow = {
|
|
732
|
+
props: {
|
|
733
|
+
icon: "table-row-delete",
|
|
734
|
+
svgIcon: vc,
|
|
735
|
+
...e
|
|
736
|
+
},
|
|
737
|
+
messages: {
|
|
738
|
+
title: s.deleteRow
|
|
739
|
+
},
|
|
740
|
+
commandName: "DeleteRow"
|
|
741
|
+
}, t.deleteColumn = {
|
|
742
|
+
props: {
|
|
743
|
+
icon: "table-column-delete",
|
|
744
|
+
svgIcon: yc,
|
|
745
|
+
...e
|
|
746
|
+
},
|
|
747
|
+
messages: {
|
|
748
|
+
title: s.deleteColumn
|
|
749
|
+
},
|
|
750
|
+
commandName: "DeleteColumn"
|
|
751
|
+
}, t.deleteTable = {
|
|
752
|
+
props: {
|
|
753
|
+
icon: "table-delete",
|
|
754
|
+
svgIcon: Cc,
|
|
755
|
+
...e
|
|
756
|
+
},
|
|
757
|
+
messages: {
|
|
758
|
+
title: s.deleteTable
|
|
759
|
+
},
|
|
760
|
+
commandName: "DeleteTable"
|
|
761
|
+
}, t.mergeCells = {
|
|
762
|
+
props: {
|
|
763
|
+
icon: "cells-merge",
|
|
764
|
+
svgIcon: wc,
|
|
765
|
+
...e
|
|
766
|
+
},
|
|
767
|
+
messages: {
|
|
768
|
+
title: s.mergeCells
|
|
769
|
+
},
|
|
770
|
+
commandName: "MergeCells"
|
|
771
|
+
}, t.splitCell = {
|
|
772
|
+
props: {
|
|
773
|
+
icon: "cell-split-horizontally",
|
|
774
|
+
svgIcon: xc,
|
|
775
|
+
...e
|
|
776
|
+
},
|
|
777
|
+
messages: {
|
|
778
|
+
title: s.splitCell
|
|
779
|
+
},
|
|
780
|
+
commandName: "SplitCell"
|
|
781
|
+
}, t.print = {
|
|
782
|
+
props: {
|
|
783
|
+
icon: "print",
|
|
784
|
+
svgIcon: Pc,
|
|
785
|
+
...e
|
|
786
|
+
},
|
|
787
|
+
messages: {
|
|
788
|
+
title: s.print
|
|
789
|
+
}
|
|
790
|
+
}, t.selectAll = {
|
|
791
|
+
props: {
|
|
792
|
+
icon: "select-all",
|
|
793
|
+
svgIcon: Sc,
|
|
794
|
+
...e
|
|
795
|
+
},
|
|
796
|
+
messages: {
|
|
797
|
+
title: s.selectAll
|
|
798
|
+
}
|
|
799
|
+
}, t.pdf = {
|
|
800
|
+
props: {
|
|
801
|
+
icon: "file-pdf",
|
|
802
|
+
svgIcon: Ic,
|
|
803
|
+
...e
|
|
804
|
+
},
|
|
805
|
+
messages: {
|
|
806
|
+
title: s.pdf
|
|
807
|
+
}
|
|
808
|
+
}, t.savePdfOptions = {
|
|
809
|
+
fileName: "editor.pdf",
|
|
810
|
+
paperSize: "A4",
|
|
811
|
+
margin: "1cm"
|
|
812
|
+
}, t.cleanFormatting = {
|
|
813
|
+
props: {
|
|
814
|
+
icon: "clear-css",
|
|
815
|
+
svgIcon: Nc,
|
|
816
|
+
...e
|
|
817
|
+
},
|
|
818
|
+
messages: {
|
|
819
|
+
title: s.cleanFormatting
|
|
820
|
+
},
|
|
821
|
+
commandName: "CleanFormatting"
|
|
822
|
+
}, t.image = {
|
|
823
|
+
node: "image",
|
|
824
|
+
props: {
|
|
825
|
+
icon: "image",
|
|
826
|
+
svgIcon: Rc,
|
|
827
|
+
...e
|
|
828
|
+
},
|
|
829
|
+
messages: {
|
|
830
|
+
insertImage: s.insertImage,
|
|
831
|
+
insertImageDialogTitle: s.insertImageDialogTitle,
|
|
832
|
+
insertImageAddress: s.insertImageAddress,
|
|
833
|
+
insertImageTitle: s.insertImageTitle,
|
|
834
|
+
insertImageAltText: s.insertImageAltText,
|
|
835
|
+
insertImageWidth: s.insertImageWidth,
|
|
836
|
+
insertImageHeight: s.insertImageHeight,
|
|
837
|
+
insertImageCancel: s.insertImageCancel,
|
|
838
|
+
insertImageInsert: s.insertImageInsert
|
|
839
|
+
},
|
|
840
|
+
commandName: "InsertImage"
|
|
841
|
+
}, t.viewHtml = {
|
|
842
|
+
props: {
|
|
843
|
+
icon: "code",
|
|
844
|
+
svgIcon: Ac,
|
|
845
|
+
...e
|
|
846
|
+
},
|
|
847
|
+
messages: {
|
|
848
|
+
viewHtml: s.viewHtml,
|
|
849
|
+
viewHtmlDialogTitle: s.viewHtmlDialogTitle,
|
|
850
|
+
viewHtmlCancel: s.viewHtmlCancel,
|
|
851
|
+
viewHtmlUpdate: s.viewHtmlUpdate
|
|
852
|
+
},
|
|
853
|
+
commandName: "SetContent"
|
|
854
|
+
}, t.findAndReplace = {
|
|
855
|
+
props: {
|
|
856
|
+
icon: "find",
|
|
857
|
+
svgIcon: Tc,
|
|
858
|
+
...e
|
|
859
|
+
},
|
|
860
|
+
messages: {
|
|
861
|
+
findReplaceToolTitle: s.findReplaceToolTitle,
|
|
862
|
+
findReplaceDialogTitle: s.findReplaceDialogTitle,
|
|
863
|
+
findReplaceTabFind: s.findReplaceTabFind,
|
|
864
|
+
findReplaceTabReplace: s.findReplaceTabReplace,
|
|
865
|
+
findReplaceFindWhat: s.findReplaceFindWhat,
|
|
866
|
+
findReplaceReplaceWith: s.findReplaceReplaceWith,
|
|
867
|
+
findReplaceReplace: s.findReplaceReplace,
|
|
868
|
+
findReplaceReplaceAll: s.findReplaceReplaceAll,
|
|
869
|
+
findReplaceMatchCase: s.findReplaceMatchCase,
|
|
870
|
+
findReplaceMatchWord: s.findReplaceMatchWord,
|
|
871
|
+
findReplaceMatchCyclic: s.findReplaceMatchCyclic,
|
|
872
|
+
findReplaceUseRegExp: s.findReplaceUseRegExp,
|
|
873
|
+
findReplacePrevMatch: s.findReplacePrevMatch,
|
|
874
|
+
findReplaceNextMatch: s.findReplaceNextMatch,
|
|
875
|
+
findReplaceMatches: s.findReplaceMatches
|
|
876
|
+
}
|
|
877
|
+
}, t.unlink = {
|
|
878
|
+
...rt,
|
|
879
|
+
props: {
|
|
880
|
+
icon: "unlink",
|
|
881
|
+
svgIcon: Lc,
|
|
882
|
+
...e
|
|
883
|
+
},
|
|
884
|
+
messages: {
|
|
885
|
+
title: s.unlink
|
|
886
|
+
},
|
|
887
|
+
commandName: "Unlink"
|
|
888
|
+
}, t.undo = {
|
|
889
|
+
props: {
|
|
890
|
+
icon: "undo",
|
|
891
|
+
svgIcon: Ec,
|
|
892
|
+
...e
|
|
893
|
+
},
|
|
894
|
+
messages: {
|
|
895
|
+
title: s.undo
|
|
896
|
+
},
|
|
897
|
+
commandName: "Undo"
|
|
898
|
+
}, t.redo = {
|
|
899
|
+
props: {
|
|
900
|
+
icon: "redo",
|
|
901
|
+
svgIcon: Dc,
|
|
902
|
+
...e
|
|
903
|
+
},
|
|
904
|
+
messages: {
|
|
905
|
+
title: s.redo
|
|
906
|
+
},
|
|
907
|
+
commandName: "Redo"
|
|
908
|
+
}, t.fontSize = {
|
|
909
|
+
style: "font-size",
|
|
910
|
+
defaultItem: { text: u[s.fontSize], value: "", localizationKey: s.fontSize },
|
|
911
|
+
items: [
|
|
912
|
+
{ text: "1 (8pt)", value: "xx-small" },
|
|
913
|
+
{ text: "2 (10pt)", value: "x-small" },
|
|
914
|
+
{ text: "3 (12pt)", value: "small" },
|
|
915
|
+
{ text: "4 (14pt)", value: "medium" },
|
|
916
|
+
{ text: "5 (18pt)", value: "large" },
|
|
917
|
+
{ text: "6 (24pt)", value: "x-large" },
|
|
918
|
+
{ text: "7 (36pt)", value: "xx-large" }
|
|
919
|
+
],
|
|
920
|
+
commandName: "FontSize"
|
|
921
|
+
}, t.fontName = {
|
|
922
|
+
style: "font-family",
|
|
923
|
+
defaultItem: { text: u[s.fontName], value: "", localizationKey: s.fontName },
|
|
924
|
+
items: [
|
|
925
|
+
{
|
|
926
|
+
text: "Arial",
|
|
927
|
+
value: "Arial, Helvetica, sans-serif",
|
|
928
|
+
style: { fontFamily: "Arial, Helvetica, sans-serif" }
|
|
929
|
+
},
|
|
930
|
+
{
|
|
931
|
+
text: "Courier New",
|
|
932
|
+
value: "'Courier New', Courier, monospace",
|
|
933
|
+
style: { fontFamily: "'Courier New', Courier, monospace" }
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
text: "Georgia",
|
|
937
|
+
value: "Georgia, serif",
|
|
938
|
+
style: { fontFamily: "Georgia, serif" }
|
|
939
|
+
},
|
|
940
|
+
{
|
|
941
|
+
text: "Impact",
|
|
942
|
+
value: "Impact, Charcoal, sans-serif",
|
|
943
|
+
style: { fontFamily: "Impact, Charcoal, sans-serif" }
|
|
944
|
+
},
|
|
945
|
+
{
|
|
946
|
+
text: "Lucida Console",
|
|
947
|
+
value: "'Lucida Console', Monaco, monospace",
|
|
948
|
+
style: { fontFamily: "'Lucida Console', Monaco, monospace" }
|
|
949
|
+
},
|
|
950
|
+
{
|
|
951
|
+
text: "Tahoma",
|
|
952
|
+
value: "Tahoma, Geneva, sans-serif",
|
|
953
|
+
style: { fontFamily: "Tahoma, Geneva, sans-serif" }
|
|
954
|
+
},
|
|
955
|
+
{
|
|
956
|
+
text: "Times New Roman",
|
|
957
|
+
value: "'Times New Roman', Times,serif",
|
|
958
|
+
style: { fontFamily: "'Times New Roman', Times,serif" }
|
|
959
|
+
},
|
|
960
|
+
{
|
|
961
|
+
text: "Trebuchet MS",
|
|
962
|
+
value: "'Trebuchet MS', Helvetica, sans-serif",
|
|
963
|
+
style: { fontFamily: "'Trebuchet MS', Helvetica, sans-serif" }
|
|
964
|
+
},
|
|
965
|
+
{
|
|
966
|
+
text: "Verdana",
|
|
967
|
+
value: "Verdana, Geneva, sans-serif",
|
|
968
|
+
style: { fontFamily: "Verdana, Geneva, sans-serif" }
|
|
969
|
+
}
|
|
970
|
+
],
|
|
971
|
+
commandName: "FontName"
|
|
972
|
+
}, t.formatBlock = {
|
|
973
|
+
defaultItem: { text: u[s.format], value: "", localizationKey: s.format },
|
|
974
|
+
items: [
|
|
975
|
+
{ text: "Paragraph", value: "p", style: { display: "block", marginLeft: 0 } },
|
|
976
|
+
{ text: "Heading 1", value: "h1", style: { display: "block", fontSize: "2em", marginLeft: 0, fontWeight: "bold" } },
|
|
977
|
+
{ text: "Heading 2", value: "h2", style: { display: "block", fontSize: "1.5em", marginLeft: 0, fontWeight: "bold" } },
|
|
978
|
+
{ text: "Heading 3", value: "h3", style: { display: "block", fontSize: "1.17em", marginLeft: 0, fontWeight: "bold" } },
|
|
979
|
+
{ text: "Heading 4", value: "h4", style: { display: "block", fontSize: "1em", marginLeft: 0, fontWeight: "bold" } },
|
|
980
|
+
{ text: "Heading 5", value: "h5", style: { display: "block", fontSize: "0.83em", marginLeft: 0, fontWeight: "bold" } },
|
|
981
|
+
{ text: "Heading 6", value: "h6", style: { display: "block", fontSize: "0.67em", marginLeft: 0, fontWeight: "bold" } }
|
|
982
|
+
],
|
|
983
|
+
commandName: "FormatBlock"
|
|
984
|
+
}, t.foreColor = {
|
|
985
|
+
style: "color",
|
|
986
|
+
colorPickerProps: {
|
|
987
|
+
icon: "foreground-color",
|
|
988
|
+
svgIcon: Bc,
|
|
989
|
+
view: "palette",
|
|
990
|
+
title: s.foregroundColor,
|
|
991
|
+
ariaLabel: s.foreColorLabel
|
|
992
|
+
},
|
|
993
|
+
commandName: "ForeColor"
|
|
994
|
+
}, t.backColor = {
|
|
995
|
+
style: "background-color",
|
|
996
|
+
colorPickerProps: {
|
|
997
|
+
icon: "droplet",
|
|
998
|
+
svgIcon: Mc,
|
|
999
|
+
view: "palette",
|
|
1000
|
+
title: s.backgroundColor,
|
|
1001
|
+
ariaLabel: s.backColorLabel
|
|
1002
|
+
},
|
|
1003
|
+
commandName: "BackColor"
|
|
1004
|
+
}, t.alignLeft = {
|
|
1005
|
+
actions: [...Ma],
|
|
1006
|
+
props: {
|
|
1007
|
+
icon: "align-left",
|
|
1008
|
+
svgIcon: Hc,
|
|
1009
|
+
...e
|
|
1010
|
+
},
|
|
1011
|
+
messages: {
|
|
1012
|
+
title: s.alignLeft
|
|
1013
|
+
},
|
|
1014
|
+
commandName: "AlignLeft"
|
|
1015
|
+
}, t.alignRight = {
|
|
1016
|
+
actions: [...Ha],
|
|
1017
|
+
props: {
|
|
1018
|
+
icon: "align-right",
|
|
1019
|
+
svgIcon: zc,
|
|
1020
|
+
...e
|
|
1021
|
+
},
|
|
1022
|
+
messages: {
|
|
1023
|
+
title: s.alignRight
|
|
1024
|
+
},
|
|
1025
|
+
commandName: "AlignRight"
|
|
1026
|
+
}, t.alignCenter = {
|
|
1027
|
+
actions: [...za],
|
|
1028
|
+
props: {
|
|
1029
|
+
icon: "align-center",
|
|
1030
|
+
svgIcon: Fc,
|
|
1031
|
+
...e
|
|
1032
|
+
},
|
|
1033
|
+
messages: {
|
|
1034
|
+
title: s.alignCenter
|
|
1035
|
+
},
|
|
1036
|
+
commandName: "AlignCenter"
|
|
1037
|
+
}, t.alignJustify = {
|
|
1038
|
+
actions: [...Fa],
|
|
1039
|
+
props: {
|
|
1040
|
+
icon: "align-justify",
|
|
1041
|
+
svgIcon: Wc,
|
|
1042
|
+
...e
|
|
1043
|
+
},
|
|
1044
|
+
messages: {
|
|
1045
|
+
title: s.alignJustify
|
|
1046
|
+
},
|
|
1047
|
+
commandName: "AlignJustify"
|
|
1048
|
+
}, t.alignRemove = {
|
|
1049
|
+
actions: [...Wa],
|
|
1050
|
+
props: {
|
|
1051
|
+
icon: "align-remove",
|
|
1052
|
+
svgIcon: Kc,
|
|
1053
|
+
...e
|
|
1054
|
+
},
|
|
1055
|
+
messages: {},
|
|
1056
|
+
commandName: "AlignRemove"
|
|
1057
|
+
}, t.indent = {
|
|
1058
|
+
actions: al.nodes,
|
|
1059
|
+
listsTypes: Se,
|
|
1060
|
+
props: {
|
|
1061
|
+
icon: "indent",
|
|
1062
|
+
svgIcon: $c,
|
|
1063
|
+
...e
|
|
1064
|
+
},
|
|
1065
|
+
messages: {
|
|
1066
|
+
title: s.indent
|
|
1067
|
+
},
|
|
1068
|
+
commandName: "Indent"
|
|
1069
|
+
}, t.outdent = {
|
|
1070
|
+
actions: Ka.nodes,
|
|
1071
|
+
listsTypes: Se,
|
|
1072
|
+
props: {
|
|
1073
|
+
icon: "outdent",
|
|
1074
|
+
svgIcon: Vc,
|
|
1075
|
+
...e
|
|
1076
|
+
},
|
|
1077
|
+
messages: {
|
|
1078
|
+
title: s.outdent
|
|
1079
|
+
},
|
|
1080
|
+
commandName: "Outdent"
|
|
1081
|
+
}, t.orderedList = {
|
|
1082
|
+
listType: Se.orderedList,
|
|
1083
|
+
props: {
|
|
1084
|
+
icon: "list-ordered",
|
|
1085
|
+
svgIcon: dt,
|
|
1086
|
+
...e
|
|
1087
|
+
},
|
|
1088
|
+
messages: {
|
|
1089
|
+
title: s.orderedList
|
|
1090
|
+
},
|
|
1091
|
+
commandName: "OrderedList",
|
|
1092
|
+
types: { ...Se }
|
|
1093
|
+
}, t.bulletList = {
|
|
1094
|
+
listType: Se.bulletList,
|
|
1095
|
+
props: {
|
|
1096
|
+
icon: "list-unordered",
|
|
1097
|
+
svgIcon: pt,
|
|
1098
|
+
...e
|
|
1099
|
+
},
|
|
1100
|
+
messages: {
|
|
1101
|
+
title: s.bulletList
|
|
1102
|
+
},
|
|
1103
|
+
commandName: "UnorderedList",
|
|
1104
|
+
types: { ...Se }
|
|
1105
|
+
};
|
|
1106
|
+
})(P || (P = {}));
|
|
1107
|
+
let la = class extends l.Component {
|
|
1108
|
+
constructor() {
|
|
1109
|
+
super(...arguments), this.href = null, this.title = null, this.target = null, this.onClose = () => {
|
|
1110
|
+
this.props.view.focus(), this.props.onClose();
|
|
1111
|
+
}, this.onInsert = () => {
|
|
1112
|
+
const e = this.props.view, o = this.props.settings.mark, r = {
|
|
1113
|
+
href: this.href ? this.href.value : void 0,
|
|
1114
|
+
title: this.title ? this.title.value : void 0,
|
|
1115
|
+
target: this.target && this.target.element && this.target.element.checked ? "_blank" : void 0
|
|
1116
|
+
};
|
|
1117
|
+
sl({ mark: o, attrs: r }, this.props.settings.commandName)(e.state, e.dispatch), this.onClose();
|
|
1118
|
+
};
|
|
1119
|
+
}
|
|
1120
|
+
/**
|
|
1121
|
+
* @hidden
|
|
1122
|
+
*/
|
|
1123
|
+
render() {
|
|
1124
|
+
const { view: e, settings: o, dir: r, render: n } = this.props, a = D(this), {
|
|
1125
|
+
insertHyperlinkDialogTitle: i,
|
|
1126
|
+
insertHyperlinkAddress: c,
|
|
1127
|
+
insertHyperlinkTitle: d,
|
|
1128
|
+
insertHyperlinkNewWindow: p,
|
|
1129
|
+
insertHyperlinkCancel: m,
|
|
1130
|
+
insertHyperlinkInsert: g
|
|
1131
|
+
} = o.messages, k = e ? lt(e.state, e.state.schema.marks[o.mark]) : !1, h = /* @__PURE__ */ l.createElement(
|
|
1132
|
+
Ge,
|
|
1133
|
+
{
|
|
1134
|
+
render: () => /* @__PURE__ */ l.createElement(qe, { horizontal: !0 }, /* @__PURE__ */ l.createElement(ee, null, /* @__PURE__ */ l.createElement("label", { htmlFor: "k-editor-link-url", className: "k-form-label" }, a.toLanguageString(c, u[c])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
1135
|
+
re,
|
|
1136
|
+
{
|
|
1137
|
+
type: "text",
|
|
1138
|
+
id: "k-editor-link-url",
|
|
1139
|
+
ref: (w) => this.href = w,
|
|
1140
|
+
defaultValue: k && k.attrs.href || void 0,
|
|
1141
|
+
autoFocus: !0
|
|
1142
|
+
}
|
|
1143
|
+
))), /* @__PURE__ */ l.createElement(ee, null, /* @__PURE__ */ l.createElement("label", { htmlFor: "k-editor-link-text", className: "k-form-label" }, a.toLanguageString(d, u[d])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
1144
|
+
re,
|
|
1145
|
+
{
|
|
1146
|
+
type: "text",
|
|
1147
|
+
id: "k-editor-link-text",
|
|
1148
|
+
ref: (w) => this.title = w,
|
|
1149
|
+
defaultValue: k && k.attrs.title || void 0
|
|
1150
|
+
}
|
|
1151
|
+
))), o.linkTarget !== !1 && /* @__PURE__ */ l.createElement(ee, null, /* @__PURE__ */ l.createElement("label", { htmlFor: "k-editor-link-target", className: "k-checkbox-label" }, /* @__PURE__ */ l.createElement(
|
|
1152
|
+
Ie,
|
|
1153
|
+
{
|
|
1154
|
+
id: "k-editor-link-target",
|
|
1155
|
+
ref: (w) => this.target = w,
|
|
1156
|
+
defaultChecked: k && !!k.attrs.target || void 0
|
|
1157
|
+
}
|
|
1158
|
+
), a.toLanguageString(p, u[p]))))
|
|
1159
|
+
}
|
|
1160
|
+
), f = [
|
|
1161
|
+
/* @__PURE__ */ l.createElement(T, { onClick: this.onClose, dir: r, key: "cancel" }, a.toLanguageString(m, u[m])),
|
|
1162
|
+
/* @__PURE__ */ l.createElement(T, { onClick: this.onInsert, themeColor: "primary", dir: r, key: "insert" }, a.toLanguageString(g, u[g]))
|
|
1163
|
+
], y = /* @__PURE__ */ l.createElement(
|
|
1164
|
+
De,
|
|
1165
|
+
{
|
|
1166
|
+
initialWidth: 450,
|
|
1167
|
+
initialHeight: 250,
|
|
1168
|
+
className: "k-editor-window",
|
|
1169
|
+
title: a.toLanguageString(i, u[i]),
|
|
1170
|
+
onClose: this.onClose,
|
|
1171
|
+
style: r === "rtl" ? { textAlign: "right" } : void 0,
|
|
1172
|
+
modal: !0,
|
|
1173
|
+
minimizeButton: () => null,
|
|
1174
|
+
maximizeButton: () => null,
|
|
1175
|
+
resizable: !1
|
|
1176
|
+
},
|
|
1177
|
+
h,
|
|
1178
|
+
/* @__PURE__ */ l.createElement(We, null, ...f)
|
|
1179
|
+
);
|
|
1180
|
+
return n ? n(y, { content: h, actionButtons: f }) : y;
|
|
1181
|
+
}
|
|
1182
|
+
};
|
|
1183
|
+
B(la);
|
|
1184
|
+
let oa = class extends l.Component {
|
|
1185
|
+
constructor() {
|
|
1186
|
+
super(...arguments), this.src = null, this.altText = null, this.title = null, this.width = null, this.height = null, this.onClose = () => {
|
|
1187
|
+
this.props.view.focus(), this.props.onClose();
|
|
1188
|
+
}, this.onInsert = () => {
|
|
1189
|
+
const { view: e, settings: o } = this.props, n = e.state.schema.nodes[o.node], a = {
|
|
1190
|
+
src: this.src ? this.src.value : null,
|
|
1191
|
+
title: this.title ? this.title.value : null,
|
|
1192
|
+
alt: this.altText ? this.altText.value : null,
|
|
1193
|
+
width: this.width ? this.width.value : null,
|
|
1194
|
+
height: this.height ? this.height.value : null
|
|
1195
|
+
}, i = Object.keys(a).filter((d) => a[d] !== null && a[d] !== "").reduce((d, p) => Object.assign(d, { [p]: a[p] }), {}), c = n.createAndFill(i);
|
|
1196
|
+
c && xt(c, !0)(e.state, (p) => e.dispatch(p.setMeta("commandName", o.commandName).setMeta("args", i))), this.onClose();
|
|
1197
|
+
};
|
|
1198
|
+
}
|
|
1199
|
+
/**
|
|
1200
|
+
* @hidden
|
|
1201
|
+
*/
|
|
1202
|
+
render() {
|
|
1203
|
+
const { view: e, settings: o, dir: r, render: n } = this.props, {
|
|
1204
|
+
insertImageDialogTitle: a,
|
|
1205
|
+
insertImageAddress: i,
|
|
1206
|
+
insertImageTitle: c,
|
|
1207
|
+
insertImageAltText: d,
|
|
1208
|
+
insertImageWidth: p,
|
|
1209
|
+
insertImageHeight: m,
|
|
1210
|
+
insertImageCancel: g,
|
|
1211
|
+
insertImageInsert: k
|
|
1212
|
+
} = o.messages, h = D(this), f = e && e.state;
|
|
1213
|
+
let y = {};
|
|
1214
|
+
f && f.selection instanceof il && f.selection.node.type === f.schema.nodes[o.node] && (y = f.selection.node.attrs);
|
|
1215
|
+
const w = /* @__PURE__ */ l.createElement(
|
|
1216
|
+
Ge,
|
|
1217
|
+
{
|
|
1218
|
+
render: () => /* @__PURE__ */ l.createElement(qe, { horizontal: !0 }, /* @__PURE__ */ l.createElement(ee, null, /* @__PURE__ */ l.createElement("label", { htmlFor: "k-editor-image-url", className: "k-form-label" }, h.toLanguageString(i, u[i])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
1219
|
+
re,
|
|
1220
|
+
{
|
|
1221
|
+
type: "text",
|
|
1222
|
+
id: "k-editor-image-url",
|
|
1223
|
+
defaultValue: y.src,
|
|
1224
|
+
ref: (L) => this.src = L,
|
|
1225
|
+
autoFocus: !0
|
|
1226
|
+
}
|
|
1227
|
+
))), /* @__PURE__ */ l.createElement(ee, null, /* @__PURE__ */ l.createElement("label", { htmlFor: "k-editor-image-url", className: "k-form-label" }, h.toLanguageString(d, u[d])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
1228
|
+
re,
|
|
1229
|
+
{
|
|
1230
|
+
type: "text",
|
|
1231
|
+
id: "k-editor-image-alt",
|
|
1232
|
+
defaultValue: y.alt,
|
|
1233
|
+
ref: (L) => this.altText = L
|
|
1234
|
+
}
|
|
1235
|
+
))), /* @__PURE__ */ l.createElement(ee, null, /* @__PURE__ */ l.createElement("label", { htmlFor: "k-editor-image-title", className: "k-form-label" }, h.toLanguageString(c, u[c])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
1236
|
+
re,
|
|
1237
|
+
{
|
|
1238
|
+
type: "text",
|
|
1239
|
+
id: "k-editor-image-title",
|
|
1240
|
+
defaultValue: y.title,
|
|
1241
|
+
ref: (L) => this.title = L
|
|
1242
|
+
}
|
|
1243
|
+
))), /* @__PURE__ */ l.createElement(ee, null, /* @__PURE__ */ l.createElement("label", { htmlFor: "k-editor-image-width", className: "k-form-label" }, h.toLanguageString(p, u[p])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
1244
|
+
re,
|
|
1245
|
+
{
|
|
1246
|
+
type: "text",
|
|
1247
|
+
id: "k-editor-image-width",
|
|
1248
|
+
defaultValue: y.width,
|
|
1249
|
+
ref: (L) => this.width = L
|
|
1250
|
+
}
|
|
1251
|
+
))), /* @__PURE__ */ l.createElement(ee, null, /* @__PURE__ */ l.createElement("label", { htmlFor: "k-editor-image-height", className: "k-form-label" }, h.toLanguageString(m, u[m])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
1252
|
+
re,
|
|
1253
|
+
{
|
|
1254
|
+
id: "k-editor-image-height",
|
|
1255
|
+
defaultValue: y.height,
|
|
1256
|
+
ref: (L) => this.height = L
|
|
1257
|
+
}
|
|
1258
|
+
))))
|
|
1259
|
+
}
|
|
1260
|
+
), S = [/* @__PURE__ */ l.createElement(T, { onClick: this.onClose, dir: r, key: "cancel" }, h.toLanguageString(g, u[g])), /* @__PURE__ */ l.createElement(T, { onClick: this.onInsert, themeColor: "primary", dir: r, key: "insert" }, h.toLanguageString(k, u[k]))], I = /* @__PURE__ */ l.createElement(
|
|
1261
|
+
De,
|
|
1262
|
+
{
|
|
1263
|
+
initialWidth: 500,
|
|
1264
|
+
initialHeight: 350,
|
|
1265
|
+
className: "k-editor-window",
|
|
1266
|
+
title: h.toLanguageString(a, u[a]),
|
|
1267
|
+
onClose: this.onClose,
|
|
1268
|
+
key: "dialog",
|
|
1269
|
+
style: r === "rtl" ? { textAlign: "right" } : void 0,
|
|
1270
|
+
modal: !0,
|
|
1271
|
+
minimizeButton: () => null,
|
|
1272
|
+
maximizeButton: () => null,
|
|
1273
|
+
resizable: !1
|
|
1274
|
+
},
|
|
1275
|
+
w,
|
|
1276
|
+
/* @__PURE__ */ l.createElement(We, null, ...S)
|
|
1277
|
+
);
|
|
1278
|
+
return n ? n(I, { content: w, actionButtons: S }) : I;
|
|
1279
|
+
}
|
|
1280
|
+
};
|
|
1281
|
+
B(oa);
|
|
1282
|
+
const Xe = new Oe("editor-props");
|
|
1283
|
+
let na = class extends l.Component {
|
|
1284
|
+
constructor() {
|
|
1285
|
+
super(...arguments), this.htmlArea = null, this.textAreaRef = (e) => {
|
|
1286
|
+
this.htmlArea = e;
|
|
1287
|
+
const o = e && e.element.current;
|
|
1288
|
+
o && (o.style.resize = "none");
|
|
1289
|
+
}, this.onUpdate = () => {
|
|
1290
|
+
const { view: e, settings: o } = this.props, r = st(this.htmlArea && this.htmlArea.value || ""), { preserveWhitespace: n } = Xe.getState(e.state);
|
|
1291
|
+
cl(r, o.commandName, { preserveWhitespace: n })(e.state, e.dispatch), this.onClose();
|
|
1292
|
+
}, this.onClose = () => {
|
|
1293
|
+
this.props.view.focus(), this.props.onClose();
|
|
1294
|
+
};
|
|
1295
|
+
}
|
|
1296
|
+
/**
|
|
1297
|
+
* @hidden
|
|
1298
|
+
*/
|
|
1299
|
+
render() {
|
|
1300
|
+
const { view: e, settings: o, dir: r, render: n } = this.props, a = D(this), { viewHtmlDialogTitle: i, viewHtmlCancel: c, viewHtmlUpdate: d } = o.messages, p = /* @__PURE__ */ l.createElement(
|
|
1301
|
+
md,
|
|
1302
|
+
{
|
|
1303
|
+
className: "k-editor-textarea",
|
|
1304
|
+
defaultValue: dl(pl(e.state)),
|
|
1305
|
+
autoFocus: !0,
|
|
1306
|
+
autoSize: !1,
|
|
1307
|
+
ref: this.textAreaRef
|
|
1308
|
+
}
|
|
1309
|
+
), m = [
|
|
1310
|
+
/* @__PURE__ */ l.createElement(T, { onClick: this.onClose, dir: r, key: "cancel" }, a.toLanguageString(c, u[c])),
|
|
1311
|
+
/* @__PURE__ */ l.createElement(T, { onClick: this.onUpdate, themeColor: "primary", dir: r, key: "update" }, a.toLanguageString(d, u[d]))
|
|
1312
|
+
], g = /* @__PURE__ */ l.createElement(
|
|
1313
|
+
De,
|
|
1314
|
+
{
|
|
1315
|
+
className: "k-editor-window",
|
|
1316
|
+
title: a.toLanguageString(i, u[i]),
|
|
1317
|
+
onClose: this.onClose,
|
|
1318
|
+
key: "dialog",
|
|
1319
|
+
style: r === "rtl" ? { textAlign: "right" } : void 0,
|
|
1320
|
+
modal: !0,
|
|
1321
|
+
minimizeButton: () => null,
|
|
1322
|
+
maximizeButton: () => null,
|
|
1323
|
+
resizable: !0,
|
|
1324
|
+
initialHeight: 400,
|
|
1325
|
+
initialWidth: 500
|
|
1326
|
+
},
|
|
1327
|
+
p,
|
|
1328
|
+
/* @__PURE__ */ l.createElement(We, null, ...m)
|
|
1329
|
+
);
|
|
1330
|
+
return n ? n(g, { content: p, actionButtons: m }) : g;
|
|
1331
|
+
}
|
|
1332
|
+
};
|
|
1333
|
+
B(na);
|
|
1334
|
+
const M = {
|
|
1335
|
+
onMouseDown: (t) => t.preventDefault(),
|
|
1336
|
+
onPointerDown: (t) => t.preventDefault()
|
|
1337
|
+
}, ra = {
|
|
1338
|
+
userSelect: "none"
|
|
1339
|
+
}, aa = function(t, ...e) {
|
|
1340
|
+
return e.forEach((o, r) => {
|
|
1341
|
+
t = t.replace("{" + r + "}", String(o));
|
|
1342
|
+
}), t;
|
|
1343
|
+
}, sa = (t, e) => e.dataItem.style ? l.cloneElement(t, t.props, /* @__PURE__ */ l.createElement("span", { style: e.dataItem.style }, t.props.children)) : t, me = ["px", "em", "%"], F = { animate: { openDuration: 150, closeDuration: 150 } }, Ye = [
|
|
1344
|
+
{ textKey: s.borderStyleNone, text: u[s.borderStyleNone], value: "none" },
|
|
1345
|
+
{ textKey: s.borderStyleSolid, text: u[s.borderStyleSolid], value: "solid" },
|
|
1346
|
+
{ textKey: s.borderStyleDotted, text: u[s.borderStyleDotted], value: "dotted" },
|
|
1347
|
+
{ textKey: s.borderStyleDashed, text: u[s.borderStyleDashed], value: "dashed" },
|
|
1348
|
+
{ textKey: s.borderStyleDouble, text: u[s.borderStyleDouble], value: "double" },
|
|
1349
|
+
{ textKey: s.borderStyleGroove, text: u[s.borderStyleGroove], value: "groove" },
|
|
1350
|
+
{ textKey: s.borderStyleRidge, text: u[s.borderStyleRidge], value: "ridge" },
|
|
1351
|
+
{ textKey: s.borderStyleInset, text: u[s.borderStyleInset], value: "inset" },
|
|
1352
|
+
{ textKey: s.borderStyleOutset, text: u[s.borderStyleOutset], value: "outset" },
|
|
1353
|
+
{ textKey: s.borderStyleInitial, text: u[s.borderStyleInitial], value: "initial" },
|
|
1354
|
+
{ textKey: s.borderStyleInherit, text: u[s.borderStyleInherit], value: "inherit" },
|
|
1355
|
+
{ textKey: s.borderStyleHidden, text: u[s.borderStyleHidden], value: "hidden" }
|
|
1356
|
+
];
|
|
1357
|
+
function V(t, e) {
|
|
1358
|
+
for (let o = t.depth; o > 0; o--) {
|
|
1359
|
+
let r = t.node(o);
|
|
1360
|
+
if (e(r))
|
|
1361
|
+
return { node: r, depth: o };
|
|
1362
|
+
}
|
|
1363
|
+
return null;
|
|
1364
|
+
}
|
|
1365
|
+
const kd = 13, vd = 27, yd = P.findAndReplace;
|
|
1366
|
+
let Bt = class extends l.Component {
|
|
1367
|
+
constructor(e) {
|
|
1368
|
+
super(e), this.onTabSelect = (o) => {
|
|
1369
|
+
this.setState({ selectedTab: o.selected });
|
|
1370
|
+
}, this.onClose = () => {
|
|
1371
|
+
const o = this.props.view, r = o.state, n = r.tr.setSelection(Be.create(r.doc, r.selection.from, r.selection.to));
|
|
1372
|
+
o.updateState(r.apply(n)), o.focus(), this.props.onClose.call(void 0);
|
|
1373
|
+
}, this.matchesMessage = (o) => {
|
|
1374
|
+
const r = this.state.matches, n = this.state.nextMatch;
|
|
1375
|
+
let a = 0, i = 0;
|
|
1376
|
+
if (r && n) {
|
|
1377
|
+
const c = r.findIndex((d) => d.eq(n));
|
|
1378
|
+
a = c === -1 ? r.length : c + 1, i = r.length;
|
|
1379
|
+
}
|
|
1380
|
+
return aa(o, a, i);
|
|
1381
|
+
}, this.onFindNext = () => {
|
|
1382
|
+
this.onFind();
|
|
1383
|
+
}, this.onFindPrev = () => {
|
|
1384
|
+
this.onFind(!0);
|
|
1385
|
+
}, this.onFind = (o = !1) => {
|
|
1386
|
+
const r = this.props.view, { searchText: n, matchCase: a, matchCyclic: i, matchWord: c, useRegExp: d } = this.state, p = { text: n, matchWord: c, matchCase: a, useRegExp: d, backward: o, matchCyclic: i }, m = $a(r.state, p);
|
|
1387
|
+
if (m) {
|
|
1388
|
+
const g = r.state.tr.setSelection(m);
|
|
1389
|
+
g.scrollIntoView(), r.updateState(r.state.apply(g)), this.setState({ nextMatch: m });
|
|
1390
|
+
}
|
|
1391
|
+
}, this.onReplace = () => {
|
|
1392
|
+
const o = this.props.view, r = o.state.selection, { replaceText: n } = this.state;
|
|
1393
|
+
if (!r.empty) {
|
|
1394
|
+
const a = r.from, i = a + n.length, c = Va(r, n, o.state.tr);
|
|
1395
|
+
c.setSelection(Be.create(c.doc, a, i)), c.scrollIntoView(), o.dispatch(c), this.setNextState({});
|
|
1396
|
+
}
|
|
1397
|
+
}, this.onReplaceAll = () => {
|
|
1398
|
+
const o = this.props.view, { searchText: r, replaceText: n, matchCase: a, matchWord: i, useRegExp: c } = this.state, d = { text: r, matchWord: i, matchCase: a, useRegExp: c }, p = Ua(o.state, n, d);
|
|
1399
|
+
p && o.dispatch(p), this.setNextState({});
|
|
1400
|
+
}, this.onKeyDown = (o) => {
|
|
1401
|
+
o.keyCode === kd ? this.onFindNext() : o.keyCode === vd && this.onClose();
|
|
1402
|
+
}, this.onMatchCaseChecked = (o) => this.setNextState({ matchCase: o.value }), this.onMatchWordChecked = (o) => this.setNextState({ matchWord: o.value }), this.onMatchCyclicChecked = (o) => this.setNextState({ matchCyclic: o.value }), this.onUseRegExpChecked = (o) => this.setNextState({ useRegExp: o.value }), this.onSearchChange = (o) => this.setNextState({ searchText: o.target.value }), this.onReplaceChange = (o) => this.setNextState({ replaceText: o.target.value }), this.setNextState = (o) => {
|
|
1403
|
+
const r = { ...this.state, ...o, matches: void 0, nextMatch: void 0 }, n = this.props.view;
|
|
1404
|
+
if (r.searchText) {
|
|
1405
|
+
const { searchText: a, matchWord: i, matchCase: c, useRegExp: d, matchCyclic: p } = r, m = { text: a, matchWord: i, matchCase: c, useRegExp: d }, g = n.state.selection, k = Oa(n.state.doc, m);
|
|
1406
|
+
let h = !this.state.searchText && k[0] || k.find((f) => f.from >= g.from) || p && k[0] || void 0;
|
|
1407
|
+
this.setState({
|
|
1408
|
+
...r,
|
|
1409
|
+
matches: k,
|
|
1410
|
+
nextMatch: h
|
|
1411
|
+
});
|
|
1412
|
+
} else
|
|
1413
|
+
this.setState(r);
|
|
1414
|
+
}, this.state = {
|
|
1415
|
+
selectedTab: 0,
|
|
1416
|
+
searchText: _a(e.view.state),
|
|
1417
|
+
replaceText: "",
|
|
1418
|
+
matchCase: !1,
|
|
1419
|
+
matchWord: !1,
|
|
1420
|
+
matchCyclic: !1,
|
|
1421
|
+
useRegExp: !1
|
|
1422
|
+
};
|
|
1423
|
+
}
|
|
1424
|
+
get settings() {
|
|
1425
|
+
return this.props.settings || yd;
|
|
1426
|
+
}
|
|
1427
|
+
/**
|
|
1428
|
+
* @hidden
|
|
1429
|
+
*/
|
|
1430
|
+
componentDidUpdate(e, o) {
|
|
1431
|
+
const r = this.props.view, { matches: n = [], nextMatch: a } = this.state;
|
|
1432
|
+
if (o.nextMatch !== a) {
|
|
1433
|
+
const i = r.state, c = i.tr, d = [];
|
|
1434
|
+
n.forEach((p) => {
|
|
1435
|
+
d.push({
|
|
1436
|
+
from: p.from,
|
|
1437
|
+
to: p.to,
|
|
1438
|
+
attrs: {
|
|
1439
|
+
class: a && p.eq(a) ? "k-text-selected" : "k-text-highlighted"
|
|
1440
|
+
}
|
|
1441
|
+
});
|
|
1442
|
+
}), c.setMeta(ja, d), c.setSelection(a || Be.create(i.doc, i.selection.from)), r.dispatch(c);
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
/**
|
|
1446
|
+
* @hidden
|
|
1447
|
+
*/
|
|
1448
|
+
render() {
|
|
1449
|
+
const e = D(this), {
|
|
1450
|
+
findReplaceDialogTitle: o,
|
|
1451
|
+
findReplaceTabFind: r,
|
|
1452
|
+
findReplaceTabReplace: n,
|
|
1453
|
+
findReplaceFindWhat: a,
|
|
1454
|
+
findReplaceReplaceWith: i,
|
|
1455
|
+
findReplaceReplace: c,
|
|
1456
|
+
findReplaceReplaceAll: d,
|
|
1457
|
+
findReplaceMatchCase: p,
|
|
1458
|
+
findReplaceMatchWord: m,
|
|
1459
|
+
findReplaceMatchCyclic: g,
|
|
1460
|
+
findReplaceUseRegExp: k,
|
|
1461
|
+
findReplacePrevMatch: h,
|
|
1462
|
+
findReplaceNextMatch: f,
|
|
1463
|
+
findReplaceMatches: y
|
|
1464
|
+
} = this.settings.messages, { matchCase: w, matchWord: S, matchCyclic: I, useRegExp: L, searchText: E, replaceText: W, nextMatch: U } = this.state, K = /* @__PURE__ */ l.createElement("div", { className: "k-search-options" }, /* @__PURE__ */ l.createElement("span", null, /* @__PURE__ */ l.createElement(Ie, { id: "match-case", checked: w, onChange: this.onMatchCaseChecked }), /* @__PURE__ */ l.createElement("label", { htmlFor: "match-case", className: "k-checkbox-label" }, e.toLanguageString(p, u[p]))), /* @__PURE__ */ l.createElement("span", null, /* @__PURE__ */ l.createElement(Ie, { id: "match-whole", checked: S, onChange: this.onMatchWordChecked }), /* @__PURE__ */ l.createElement("label", { htmlFor: "match-whole", className: "k-checkbox-label" }, e.toLanguageString(m, u[m]))), /* @__PURE__ */ l.createElement("span", null, /* @__PURE__ */ l.createElement(Ie, { id: "match-cyclic", checked: I, onChange: this.onMatchCyclicChecked }), /* @__PURE__ */ l.createElement("label", { htmlFor: "match-cyclic", className: "k-checkbox-label" }, e.toLanguageString(g, u[g]))), /* @__PURE__ */ l.createElement("span", null, /* @__PURE__ */ l.createElement(Ie, { id: "regular-expression", checked: L, onChange: this.onUseRegExpChecked }), /* @__PURE__ */ l.createElement("label", { htmlFor: "regular-expression", className: "k-checkbox-label" }, e.toLanguageString(k, u[k])))), O = /* @__PURE__ */ l.createElement("div", { className: "k-matches-container" }, /* @__PURE__ */ l.createElement(
|
|
1465
|
+
T,
|
|
1466
|
+
{
|
|
1467
|
+
fillMode: "flat",
|
|
1468
|
+
themeColor: "primary",
|
|
1469
|
+
onClick: this.onFindPrev
|
|
1470
|
+
},
|
|
1471
|
+
/* @__PURE__ */ l.createElement(Ue, { name: "chevron-left", icon: Uc }),
|
|
1472
|
+
e.toLanguageString(h, u[h])
|
|
1473
|
+
), /* @__PURE__ */ l.createElement("span", null, this.matchesMessage(e.toLanguageString(y, u[y]))), /* @__PURE__ */ l.createElement(
|
|
1474
|
+
T,
|
|
1475
|
+
{
|
|
1476
|
+
fillMode: "flat",
|
|
1477
|
+
themeColor: "primary",
|
|
1478
|
+
onClick: this.onFindNext
|
|
1479
|
+
},
|
|
1480
|
+
e.toLanguageString(f, u[f]),
|
|
1481
|
+
/* @__PURE__ */ l.createElement(Ue, { name: "chevron-right", icon: Oc })
|
|
1482
|
+
)), $ = /* @__PURE__ */ l.createElement(
|
|
1483
|
+
Ge,
|
|
1484
|
+
{
|
|
1485
|
+
render: () => /* @__PURE__ */ l.createElement(qe, { horizontal: !0 }, /* @__PURE__ */ l.createElement(ee, null, /* @__PURE__ */ l.createElement("label", { htmlFor: "findWhat", className: "k-form-label" }, e.toLanguageString(a, u[a])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
1486
|
+
re,
|
|
1487
|
+
{
|
|
1488
|
+
id: "findWhat",
|
|
1489
|
+
type: "text",
|
|
1490
|
+
value: E,
|
|
1491
|
+
onChange: this.onSearchChange,
|
|
1492
|
+
onFocus: this.onSearchChange,
|
|
1493
|
+
onKeyDown: this.onKeyDown,
|
|
1494
|
+
autoFocus: !0
|
|
1495
|
+
}
|
|
1496
|
+
))))
|
|
1497
|
+
}
|
|
1498
|
+
), _ = /* @__PURE__ */ l.createElement(
|
|
1499
|
+
Ge,
|
|
1500
|
+
{
|
|
1501
|
+
render: () => /* @__PURE__ */ l.createElement(qe, { horizontal: !0 }, /* @__PURE__ */ l.createElement(ee, null, /* @__PURE__ */ l.createElement("label", { htmlFor: "replaceWith", className: "k-form-label" }, e.toLanguageString(i, u[i])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
1502
|
+
re,
|
|
1503
|
+
{
|
|
1504
|
+
id: "replaceWith",
|
|
1505
|
+
type: "text",
|
|
1506
|
+
value: W,
|
|
1507
|
+
onChange: this.onReplaceChange
|
|
1508
|
+
}
|
|
1509
|
+
))))
|
|
1510
|
+
}
|
|
1511
|
+
);
|
|
1512
|
+
return /* @__PURE__ */ l.createElement(
|
|
1513
|
+
De,
|
|
1514
|
+
{
|
|
1515
|
+
title: e.toLanguageString(o, u[o]),
|
|
1516
|
+
onClose: this.onClose,
|
|
1517
|
+
style: { width: "auto", height: "auto", userSelect: "none" },
|
|
1518
|
+
resizable: !1,
|
|
1519
|
+
minimizeButton: () => null,
|
|
1520
|
+
maximizeButton: () => null
|
|
1521
|
+
},
|
|
1522
|
+
/* @__PURE__ */ l.createElement(
|
|
1523
|
+
Zl,
|
|
1524
|
+
{
|
|
1525
|
+
selected: this.state.selectedTab,
|
|
1526
|
+
className: "k-editor-find-replace",
|
|
1527
|
+
onSelect: this.onTabSelect,
|
|
1528
|
+
animation: !1
|
|
1529
|
+
},
|
|
1530
|
+
/* @__PURE__ */ l.createElement(
|
|
1531
|
+
Je,
|
|
1532
|
+
{
|
|
1533
|
+
title: e.toLanguageString(r, u[r])
|
|
1534
|
+
},
|
|
1535
|
+
$,
|
|
1536
|
+
K,
|
|
1537
|
+
O
|
|
1538
|
+
),
|
|
1539
|
+
/* @__PURE__ */ l.createElement(
|
|
1540
|
+
Je,
|
|
1541
|
+
{
|
|
1542
|
+
title: e.toLanguageString(n, u[n])
|
|
1543
|
+
},
|
|
1544
|
+
$,
|
|
1545
|
+
_,
|
|
1546
|
+
/* @__PURE__ */ l.createElement("div", { className: "k-actions k-hstack k-justify-content-end" }, /* @__PURE__ */ l.createElement(T, { disabled: !U, onClick: this.onReplace }, e.toLanguageString(c, u[c])), /* @__PURE__ */ l.createElement(T, { disabled: !U, onClick: this.onReplaceAll }, e.toLanguageString(d, u[d]))),
|
|
1547
|
+
K,
|
|
1548
|
+
O
|
|
1549
|
+
)
|
|
1550
|
+
)
|
|
1551
|
+
);
|
|
1552
|
+
}
|
|
1553
|
+
};
|
|
1554
|
+
B(Bt);
|
|
1555
|
+
var Ee;
|
|
1556
|
+
((t) => {
|
|
1557
|
+
class e extends la {
|
|
1558
|
+
}
|
|
1559
|
+
t.InsertLinkDialog = e;
|
|
1560
|
+
class o extends oa {
|
|
1561
|
+
}
|
|
1562
|
+
t.InsertImageDialog = o;
|
|
1563
|
+
class r extends na {
|
|
1564
|
+
}
|
|
1565
|
+
t.ViewHtmlDialog = r;
|
|
1566
|
+
class n extends Bt {
|
|
1567
|
+
}
|
|
1568
|
+
t.FindAndReplaceDialog = n;
|
|
1569
|
+
})(Ee || (Ee = {}));
|
|
1570
|
+
const { bold: Cd, underline: wd, italic: xd } = P, Wt = typeof navigator < "u" ? /Mac/.test(navigator.platform) : !1, Pd = (t) => {
|
|
1571
|
+
const e = ml(ul, (a, i) => {
|
|
1572
|
+
const c = t && t.types && t.types.hardBreak || "hard_break", d = a.schema.nodes[c];
|
|
1573
|
+
return i && i(a.tr.replaceSelectionWith(d.create()).scrollIntoView()), !0;
|
|
1574
|
+
}), o = t && t.types && t.types.listItem || "list_item", r = t && t.toolsSettings || {};
|
|
1575
|
+
return {
|
|
1576
|
+
"Mod-b": (a, i) => Me(r.bold || Cd)(a, i),
|
|
1577
|
+
"Mod-i": (a, i) => Me(r.italic || xd)(a, i),
|
|
1578
|
+
"Mod-u": (a, i) => Me(r.underline || wd)(a, i),
|
|
1579
|
+
"Mod-z": Pt,
|
|
1580
|
+
"Shift-Mod-z": _e,
|
|
1581
|
+
...Wt ? {} : { "Mod-y": _e },
|
|
1582
|
+
Backspace: gl,
|
|
1583
|
+
"Mod-Enter": e,
|
|
1584
|
+
"Shift-Enter": e,
|
|
1585
|
+
...Wt ? { "Ctrl-Enter": e } : {},
|
|
1586
|
+
Enter: (a, i) => hl(a.schema.nodes[o])(a, i),
|
|
1587
|
+
Tab: it(1),
|
|
1588
|
+
"Shift-Tab": it(-1)
|
|
1589
|
+
};
|
|
1590
|
+
};
|
|
1591
|
+
var Te;
|
|
1592
|
+
((t) => {
|
|
1593
|
+
function e(v, x, N) {
|
|
1594
|
+
return !!kl(x, N)(v.state, v.dispatch);
|
|
1595
|
+
}
|
|
1596
|
+
t.alignBlocks = e;
|
|
1597
|
+
function o(v, x, N) {
|
|
1598
|
+
return St(x, N)(v.state, v.dispatch);
|
|
1599
|
+
}
|
|
1600
|
+
t.applyInlineStyle = o;
|
|
1601
|
+
function r(v, x, N) {
|
|
1602
|
+
return sl(x, N)(v.state, v.dispatch);
|
|
1603
|
+
}
|
|
1604
|
+
t.applyLink = r;
|
|
1605
|
+
function n(v, x) {
|
|
1606
|
+
return vl(v, x);
|
|
1607
|
+
}
|
|
1608
|
+
t.canIndentList = n;
|
|
1609
|
+
function a(v, x) {
|
|
1610
|
+
return It(v, x);
|
|
1611
|
+
}
|
|
1612
|
+
t.canInsert = a;
|
|
1613
|
+
function i(v, x) {
|
|
1614
|
+
return yl(v, { listsTypes: x, nodes: [] });
|
|
1615
|
+
}
|
|
1616
|
+
t.canOutdentList = i;
|
|
1617
|
+
function c(v) {
|
|
1618
|
+
return qa(v);
|
|
1619
|
+
}
|
|
1620
|
+
t.convertMsLists = c;
|
|
1621
|
+
function d(v, x, N) {
|
|
1622
|
+
return Cl(st(x), v, N !== void 0 ? N : { preserveWhitespace: "full" });
|
|
1623
|
+
}
|
|
1624
|
+
t.createDocument = d;
|
|
1625
|
+
function p(v, x, N) {
|
|
1626
|
+
return wl(v, x, N);
|
|
1627
|
+
}
|
|
1628
|
+
t.createTable = p;
|
|
1629
|
+
function m(v, x, N) {
|
|
1630
|
+
return xl(x, N)(v.state, v.dispatch);
|
|
1631
|
+
}
|
|
1632
|
+
t.formatBlockElements = m;
|
|
1633
|
+
function g(v) {
|
|
1634
|
+
return Pl(v);
|
|
1635
|
+
}
|
|
1636
|
+
t.getBlockFormats = g;
|
|
1637
|
+
function k(v) {
|
|
1638
|
+
return pl(v);
|
|
1639
|
+
}
|
|
1640
|
+
t.getHtml = k;
|
|
1641
|
+
function h(v, x) {
|
|
1642
|
+
return Sl(v, x);
|
|
1643
|
+
}
|
|
1644
|
+
t.getInlineStyles = h;
|
|
1645
|
+
function f(v, x) {
|
|
1646
|
+
return lt(v, x);
|
|
1647
|
+
}
|
|
1648
|
+
t.getMark = f;
|
|
1649
|
+
function y(v, x) {
|
|
1650
|
+
return Nt(v, x);
|
|
1651
|
+
}
|
|
1652
|
+
t.hasMark = y;
|
|
1653
|
+
function w(v, x) {
|
|
1654
|
+
return ze(v, x);
|
|
1655
|
+
}
|
|
1656
|
+
t.hasNode = w;
|
|
1657
|
+
function S(v, x, N, H) {
|
|
1658
|
+
return !!Rt(x, N, H)(v.state, v.dispatch);
|
|
1659
|
+
}
|
|
1660
|
+
t.indentBlocks = S;
|
|
1661
|
+
function I(v) {
|
|
1662
|
+
return dl(v);
|
|
1663
|
+
}
|
|
1664
|
+
t.indentHtml = I;
|
|
1665
|
+
function L(v, x, N) {
|
|
1666
|
+
xt(x, N)(v.state, v.dispatch);
|
|
1667
|
+
}
|
|
1668
|
+
t.insertNode = L;
|
|
1669
|
+
function E(v, x) {
|
|
1670
|
+
return Il(v, x);
|
|
1671
|
+
}
|
|
1672
|
+
t.isAligned = E;
|
|
1673
|
+
function W(v, x, N) {
|
|
1674
|
+
return At(v, x, N);
|
|
1675
|
+
}
|
|
1676
|
+
t.isIndented = W;
|
|
1677
|
+
function U(v) {
|
|
1678
|
+
return Ja(v);
|
|
1679
|
+
}
|
|
1680
|
+
t.removeComments = U;
|
|
1681
|
+
function K(v, x) {
|
|
1682
|
+
return Qa(v, x);
|
|
1683
|
+
}
|
|
1684
|
+
t.removeTag = K;
|
|
1685
|
+
function O(v, x) {
|
|
1686
|
+
return Xa(v, x);
|
|
1687
|
+
}
|
|
1688
|
+
t.pasteCleanup = O;
|
|
1689
|
+
function $(v) {
|
|
1690
|
+
Ya(v);
|
|
1691
|
+
}
|
|
1692
|
+
t.sanitizeClassAttr = $;
|
|
1693
|
+
function _(v) {
|
|
1694
|
+
Za(v);
|
|
1695
|
+
}
|
|
1696
|
+
t.sanitizeStyleAttr = _;
|
|
1697
|
+
function j(v) {
|
|
1698
|
+
es(v);
|
|
1699
|
+
}
|
|
1700
|
+
t.removeAttribute = j;
|
|
1701
|
+
function le(v) {
|
|
1702
|
+
return ts(v);
|
|
1703
|
+
}
|
|
1704
|
+
t.sanitize = le;
|
|
1705
|
+
function Y(v, x) {
|
|
1706
|
+
return ls(v, x);
|
|
1707
|
+
}
|
|
1708
|
+
t.replaceImageSourcesFromRtf = Y;
|
|
1709
|
+
function ue(v) {
|
|
1710
|
+
return os(v);
|
|
1711
|
+
}
|
|
1712
|
+
t.textHighlight = ue;
|
|
1713
|
+
function ge(v) {
|
|
1714
|
+
return ns(v);
|
|
1715
|
+
}
|
|
1716
|
+
t.imageResizing = ge;
|
|
1717
|
+
function oe() {
|
|
1718
|
+
return rs();
|
|
1719
|
+
}
|
|
1720
|
+
t.tableResizing = oe;
|
|
1721
|
+
function he(v, x, N, H) {
|
|
1722
|
+
const Z = st(x);
|
|
1723
|
+
cl(Z, N, H)(v.state, v.dispatch);
|
|
1724
|
+
}
|
|
1725
|
+
t.setHtml = he;
|
|
1726
|
+
function C(v, x, N, H) {
|
|
1727
|
+
return Me(x, N, H)(v.state, v.dispatch);
|
|
1728
|
+
}
|
|
1729
|
+
t.toggleInlineFormat = C;
|
|
1730
|
+
function G(v, x, N) {
|
|
1731
|
+
return je(v.state, v.dispatch, v, x, N);
|
|
1732
|
+
}
|
|
1733
|
+
t.toggleList = G;
|
|
1734
|
+
function ne(v) {
|
|
1735
|
+
return Pd(v);
|
|
1736
|
+
}
|
|
1737
|
+
t.getShortcuts = ne, t.propsKey = Xe, t.imageResizeKey = Ga, t.marks = { ...fl }, t.nodes = { ...bl };
|
|
1738
|
+
})(Te || (Te = {}));
|
|
1739
|
+
const Ke = (t, e) => {
|
|
1740
|
+
const o = e.tr || t.state.tr.setSelection(new Nl(t.state.doc)).replaceSelectionWith(e.doc || Te.createDocument(t.state.schema, e.html || "")).setMeta("commandName", "setHTML");
|
|
1741
|
+
t.updateState(t.state.apply(o));
|
|
1742
|
+
}, Sd = (t, e, o, r, n) => {
|
|
1743
|
+
typeof e == "string" ? r && e === n ? Ke(t, { tr: r }) : e !== o && Ke(t, { html: e }) : r && e.eq(r.doc) ? Ke(t, { tr: r }) : t.state.doc.eq(e) || Ke(t, { doc: e });
|
|
1744
|
+
}, Kt = typeof window < "u" && /Firefox/.test(window.navigator.userAgent), $t = {
|
|
1745
|
+
name: "@progress/kendo-react-editor",
|
|
1746
|
+
productName: "KendoReact",
|
|
1747
|
+
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
1748
|
+
publishDate: 1700494242,
|
|
1749
|
+
version: "",
|
|
1750
|
+
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
1751
|
+
}, { link: Vt, bold: Id, italic: Nd, underline: Rd } = P;
|
|
1752
|
+
class ia extends l.Component {
|
|
1753
|
+
constructor(e) {
|
|
1754
|
+
super(e), this.state = {
|
|
1755
|
+
view: void 0,
|
|
1756
|
+
linkDialog: !1
|
|
1757
|
+
}, this._element = null, this._contentElement = null, this.iframe = null, this.trOnChange = null, this.htmlOnChange = null, this.showLicenseWatermark = !1, this.focus = () => {
|
|
1758
|
+
this.view && this.view.focus();
|
|
1759
|
+
}, this.renderDialog = (o, r, n) => this.state[n] && /* @__PURE__ */ l.createElement(
|
|
1760
|
+
o,
|
|
1761
|
+
{
|
|
1762
|
+
view: this.view,
|
|
1763
|
+
settings: r,
|
|
1764
|
+
dir: this.props.dir,
|
|
1765
|
+
onClose: () => this.setState({ [n]: !1 })
|
|
1766
|
+
}
|
|
1767
|
+
), this.renderTool = (o, r) => {
|
|
1768
|
+
const n = /* @__PURE__ */ l.createElement(
|
|
1769
|
+
o,
|
|
1770
|
+
{
|
|
1771
|
+
view: this.view,
|
|
1772
|
+
dir: this.props.dir,
|
|
1773
|
+
key: r
|
|
1774
|
+
}
|
|
1775
|
+
);
|
|
1776
|
+
return n.type === Ca ? /* @__PURE__ */ l.createElement(o, { key: r }) : n;
|
|
1777
|
+
}, this.updateTools = (o, r) => {
|
|
1778
|
+
this.setState({ view: o });
|
|
1779
|
+
}, this.filterTransaction = (o, r) => {
|
|
1780
|
+
const n = { target: this, transaction: o, state: r };
|
|
1781
|
+
return (this.props.onExecute && this.props.onExecute.call(void 0, n)) !== !1;
|
|
1782
|
+
}, this.onPasteHtml = (o) => {
|
|
1783
|
+
if (this.props.onPasteHtml && this.pasteEvent) {
|
|
1784
|
+
const r = {
|
|
1785
|
+
target: this,
|
|
1786
|
+
pastedHtml: o,
|
|
1787
|
+
nativeEvent: this.pasteEvent
|
|
1788
|
+
}, n = this.props.onPasteHtml.call(void 0, r);
|
|
1789
|
+
if (this.pasteEvent = void 0, typeof n == "string")
|
|
1790
|
+
return n;
|
|
1791
|
+
}
|
|
1792
|
+
return o;
|
|
1793
|
+
}, this.dispatchTransaction = (o) => {
|
|
1794
|
+
const r = o.docChanged;
|
|
1795
|
+
if (this.props.onChange && r) {
|
|
1796
|
+
this.trOnChange = o;
|
|
1797
|
+
const n = o.doc, a = o.doc.type.schema, i = {
|
|
1798
|
+
target: this,
|
|
1799
|
+
value: n,
|
|
1800
|
+
html: "",
|
|
1801
|
+
transaction: o,
|
|
1802
|
+
schema: a
|
|
1803
|
+
};
|
|
1804
|
+
Object.defineProperty(i, "html", {
|
|
1805
|
+
get: () => (this.htmlOnChange = Te.getHtml({ doc: n, schema: a }), this.htmlOnChange)
|
|
1806
|
+
}), this.props.onChange.call(void 0, i);
|
|
1807
|
+
}
|
|
1808
|
+
this.view && (this.props.value === void 0 || !r) && this.view.updateState(this.view.state.apply(o));
|
|
1809
|
+
}, this.onFocus = (o, r) => {
|
|
1810
|
+
if (this.props.onFocus) {
|
|
1811
|
+
const n = {
|
|
1812
|
+
target: this,
|
|
1813
|
+
nativeEvent: r
|
|
1814
|
+
};
|
|
1815
|
+
this.props.onFocus.call(void 0, n);
|
|
1816
|
+
}
|
|
1817
|
+
return !1;
|
|
1818
|
+
}, this.onBlur = (o, r) => {
|
|
1819
|
+
if (this.props.onBlur) {
|
|
1820
|
+
const n = {
|
|
1821
|
+
target: this,
|
|
1822
|
+
nativeEvent: r
|
|
1823
|
+
};
|
|
1824
|
+
this.props.onBlur.call(void 0, n);
|
|
1825
|
+
}
|
|
1826
|
+
return !1;
|
|
1827
|
+
}, this.onPaste = (o, r) => (this.props.onPasteHtml && (this.pasteEvent = r), !1), Ia($t), this.showLicenseWatermark = Na($t);
|
|
1828
|
+
}
|
|
1829
|
+
/**
|
|
1830
|
+
* The value of the Editor.
|
|
1831
|
+
*/
|
|
1832
|
+
get value() {
|
|
1833
|
+
return this.trOnChange !== null ? this.trOnChange.doc : this.props.value !== void 0 ? this.props.value : this.view ? this.view.state.doc : this.props.defaultContent || "";
|
|
1834
|
+
}
|
|
1835
|
+
/**
|
|
1836
|
+
* Returns the DOM element of the Editor.
|
|
1837
|
+
*/
|
|
1838
|
+
get element() {
|
|
1839
|
+
return this._element;
|
|
1840
|
+
}
|
|
1841
|
+
/**
|
|
1842
|
+
* Returns the content-editable DOM element of the Editor.
|
|
1843
|
+
*/
|
|
1844
|
+
get contentElement() {
|
|
1845
|
+
return this._contentElement;
|
|
1846
|
+
}
|
|
1847
|
+
/**
|
|
1848
|
+
* Returns the `view` object of the Editor.
|
|
1849
|
+
*/
|
|
1850
|
+
get view() {
|
|
1851
|
+
return this._view;
|
|
1852
|
+
}
|
|
1853
|
+
/**
|
|
1854
|
+
* @hidden
|
|
1855
|
+
*/
|
|
1856
|
+
componentDidMount() {
|
|
1857
|
+
(!this.iframe || !Kt) && this.initialize();
|
|
1858
|
+
}
|
|
1859
|
+
/**
|
|
1860
|
+
* @hidden
|
|
1861
|
+
*/
|
|
1862
|
+
componentDidUpdate(e) {
|
|
1863
|
+
const { value: o } = this.props, r = this.view;
|
|
1864
|
+
o === void 0 || !r || (Sd(r, o, e.value, this.trOnChange, this.htmlOnChange), this.trOnChange = null, this.htmlOnChange = null);
|
|
1865
|
+
}
|
|
1866
|
+
/**
|
|
1867
|
+
* @hidden
|
|
1868
|
+
*/
|
|
1869
|
+
componentWillUnmount() {
|
|
1870
|
+
this.view && this.view.destroy(), this._view = void 0;
|
|
1871
|
+
const e = this.iframe && this.iframe.contentWindow;
|
|
1872
|
+
if (e) {
|
|
1873
|
+
this._contentElement && this._contentElement.parentNode && this._contentElement.parentNode.removeChild(this._contentElement);
|
|
1874
|
+
const o = e.document.head;
|
|
1875
|
+
for (; o && o.firstChild; )
|
|
1876
|
+
o.removeChild(o.firstChild);
|
|
1877
|
+
}
|
|
1878
|
+
}
|
|
1879
|
+
/**
|
|
1880
|
+
* @hidden
|
|
1881
|
+
*/
|
|
1882
|
+
render() {
|
|
1883
|
+
const {
|
|
1884
|
+
tools: e = [],
|
|
1885
|
+
defaultEditMode: o = "iframe",
|
|
1886
|
+
preserveWhitespace: r = "full",
|
|
1887
|
+
style: n,
|
|
1888
|
+
className: a
|
|
1889
|
+
} = this.props, i = D(this);
|
|
1890
|
+
if (this.view) {
|
|
1891
|
+
const p = Xe.getState(this.view.state);
|
|
1892
|
+
p.preserveWhitespace = r;
|
|
1893
|
+
}
|
|
1894
|
+
let c = this.props.contentStyle;
|
|
1895
|
+
c === void 0 && (n || {}).height === void 0 && (c = { height: "300px" });
|
|
1896
|
+
const d = e.map((p, m) => Array.isArray(p) ? /* @__PURE__ */ l.createElement(wa, { key: m }, p.map(this.renderTool, m)) : this.renderTool(p, m));
|
|
1897
|
+
return /* @__PURE__ */ l.createElement(
|
|
1898
|
+
"div",
|
|
1899
|
+
{
|
|
1900
|
+
ref: (p) => this._element = p,
|
|
1901
|
+
className: X("k-editor", a, { "k-editor-resizable": this.props.resizable }),
|
|
1902
|
+
dir: this.props.dir,
|
|
1903
|
+
style: n
|
|
1904
|
+
},
|
|
1905
|
+
d.length > 0 && /* @__PURE__ */ l.createElement(xa, { className: "k-editor-toolbar", keyboardNavigation: this.props.keyboardNavigation }, d),
|
|
1906
|
+
o === "iframe" ? /* @__PURE__ */ l.createElement("div", { className: "k-editor-content" }, /* @__PURE__ */ l.createElement(
|
|
1907
|
+
"iframe",
|
|
1908
|
+
{
|
|
1909
|
+
onLoad: Kt ? () => {
|
|
1910
|
+
this.initialize();
|
|
1911
|
+
} : void 0,
|
|
1912
|
+
ref: (p) => this.iframe = p,
|
|
1913
|
+
frameBorder: "0",
|
|
1914
|
+
title: i.toLanguageString(s.iframeTitle, u[s.iframeTitle]),
|
|
1915
|
+
style: c,
|
|
1916
|
+
className: "k-iframe"
|
|
1917
|
+
}
|
|
1918
|
+
)) : /* @__PURE__ */ l.createElement(
|
|
1919
|
+
"div",
|
|
1920
|
+
{
|
|
1921
|
+
style: c,
|
|
1922
|
+
className: "k-editor-content"
|
|
1923
|
+
},
|
|
1924
|
+
/* @__PURE__ */ l.createElement(
|
|
1925
|
+
"div",
|
|
1926
|
+
{
|
|
1927
|
+
ref: (p) => this._contentElement = p,
|
|
1928
|
+
suppressContentEditableWarning: !0,
|
|
1929
|
+
role: "textbox",
|
|
1930
|
+
"aria-labelledby": this.props.ariaLabelledBy,
|
|
1931
|
+
"aria-describedby": this.props.ariaDescribedBy,
|
|
1932
|
+
"aria-label": this.props.ariaLabel
|
|
1933
|
+
}
|
|
1934
|
+
)
|
|
1935
|
+
),
|
|
1936
|
+
this.renderDialog(Ee.InsertLinkDialog, Vt, "linkDialog"),
|
|
1937
|
+
this.showLicenseWatermark && /* @__PURE__ */ l.createElement(Ra, null)
|
|
1938
|
+
);
|
|
1939
|
+
}
|
|
1940
|
+
initialize() {
|
|
1941
|
+
const e = this.iframe && this.iframe.contentWindow;
|
|
1942
|
+
if (e) {
|
|
1943
|
+
const h = e.document;
|
|
1944
|
+
[hd, fd, this.props.dir === "rtl" ? bd : void 0].forEach((y) => {
|
|
1945
|
+
if (y) {
|
|
1946
|
+
const w = h.createElement("style");
|
|
1947
|
+
w.appendChild(h.createTextNode(y)), h.head.appendChild(w);
|
|
1948
|
+
}
|
|
1949
|
+
});
|
|
1950
|
+
const f = h.createElement("meta");
|
|
1951
|
+
f.setAttribute("charset", "utf-8"), h.head.appendChild(f), this._contentElement = h.createElement("div"), h.body.appendChild(this._contentElement), this._contentElement.classList.add("k-content");
|
|
1952
|
+
}
|
|
1953
|
+
const o = this._contentElement;
|
|
1954
|
+
if (!o)
|
|
1955
|
+
return;
|
|
1956
|
+
const { preserveWhitespace: r = "full" } = this.props;
|
|
1957
|
+
let n = [
|
|
1958
|
+
// https://prosemirror.net/docs/ref/#state.PluginSpec
|
|
1959
|
+
new Ve({
|
|
1960
|
+
view: () => ({ update: this.updateTools }),
|
|
1961
|
+
key: new Oe("toolbar-tools-update-plugin")
|
|
1962
|
+
}),
|
|
1963
|
+
new Ve({
|
|
1964
|
+
filterTransaction: this.filterTransaction,
|
|
1965
|
+
key: new Oe("onExecute-event-plugin")
|
|
1966
|
+
}),
|
|
1967
|
+
new Ve({
|
|
1968
|
+
key: Xe,
|
|
1969
|
+
state: {
|
|
1970
|
+
init: () => ({ preserveWhitespace: r }),
|
|
1971
|
+
apply: (h, f) => f
|
|
1972
|
+
}
|
|
1973
|
+
}),
|
|
1974
|
+
as(),
|
|
1975
|
+
ss(),
|
|
1976
|
+
Rl(),
|
|
1977
|
+
Al(),
|
|
1978
|
+
Tl(),
|
|
1979
|
+
Ll(),
|
|
1980
|
+
is()
|
|
1981
|
+
], a = {
|
|
1982
|
+
...Te.getShortcuts({
|
|
1983
|
+
types: { listItem: "list_item", hardBreak: "hard_break" },
|
|
1984
|
+
toolsSettings: { bold: Id, italic: Nd, underline: Rd }
|
|
1985
|
+
}),
|
|
1986
|
+
"Mod-k": () => {
|
|
1987
|
+
const { linkDialog: h } = this.state, f = this.view;
|
|
1988
|
+
if (f) {
|
|
1989
|
+
const y = f.state, w = y.selection.empty, S = lt(y, y.schema.marks[Vt.mark]);
|
|
1990
|
+
!h && !(w && !S) && this.setState({ linkDialog: !0 });
|
|
1991
|
+
}
|
|
1992
|
+
return !h;
|
|
1993
|
+
},
|
|
1994
|
+
"Alt-F10": () => {
|
|
1995
|
+
var f;
|
|
1996
|
+
const h = (f = this.element) == null ? void 0 : f.querySelector(".k-toolbar");
|
|
1997
|
+
if (h) {
|
|
1998
|
+
const y = h.querySelector(Pa.join(","));
|
|
1999
|
+
if (y)
|
|
2000
|
+
return y.focus(), !0;
|
|
2001
|
+
}
|
|
2002
|
+
return !1;
|
|
2003
|
+
}
|
|
2004
|
+
};
|
|
2005
|
+
const { defaultContent: i = "", value: c, onMount: d } = this.props, p = c && typeof c != "string" ? c : Te.createDocument(new El({ nodes: bl, marks: fl }), c || i, { preserveWhitespace: r }), m = {
|
|
2006
|
+
state: Dl.create({
|
|
2007
|
+
plugins: [...n, ct(a), ct(Bl)],
|
|
2008
|
+
doc: p
|
|
2009
|
+
}),
|
|
2010
|
+
transformPastedHTML: this.onPasteHtml,
|
|
2011
|
+
dispatchTransaction: this.dispatchTransaction,
|
|
2012
|
+
handleDOMEvents: {
|
|
2013
|
+
focus: this.onFocus,
|
|
2014
|
+
blur: this.onBlur,
|
|
2015
|
+
paste: this.onPaste
|
|
2016
|
+
},
|
|
2017
|
+
handleDrop: (h, f, y, w) => {
|
|
2018
|
+
let S = !1;
|
|
2019
|
+
return y.content.nodesBetween(0, y.content.size, (I) => {
|
|
2020
|
+
S = S || I.type.name === "table_caption_external";
|
|
2021
|
+
}), S;
|
|
2022
|
+
}
|
|
2023
|
+
}, g = { plugins: n, shortcuts: a, target: this, viewProps: m, dom: o }, k = this._view = d && d.call(void 0, g) || new Ml({ mount: o }, m);
|
|
2024
|
+
this.setState({
|
|
2025
|
+
view: k
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
2028
|
+
}
|
|
2029
|
+
ia.propTypes = {
|
|
2030
|
+
defaultContent: R.string,
|
|
2031
|
+
value: R.oneOfType([R.object, R.string]),
|
|
2032
|
+
defaultEditMode: R.oneOf(["iframe", "div"]),
|
|
2033
|
+
contentStyle: R.object,
|
|
2034
|
+
dir: R.string,
|
|
2035
|
+
className: R.string,
|
|
2036
|
+
ariaDescribedBy: R.string,
|
|
2037
|
+
ariaLabelledBy: R.string,
|
|
2038
|
+
ariaLabel: R.string,
|
|
2039
|
+
style: R.object,
|
|
2040
|
+
tools: R.arrayOf(R.any),
|
|
2041
|
+
keyboardNavigation: R.bool,
|
|
2042
|
+
resizable: R.bool,
|
|
2043
|
+
preserveWhitespace: R.oneOf([!0, !1, "full"]),
|
|
2044
|
+
onMount: R.func,
|
|
2045
|
+
onFocus: R.func,
|
|
2046
|
+
onBlur: R.func,
|
|
2047
|
+
onChange: R.func,
|
|
2048
|
+
onPasteHtml: R.func,
|
|
2049
|
+
onExecute: R.func
|
|
2050
|
+
};
|
|
2051
|
+
B(ia);
|
|
2052
|
+
const Ad = "k-ct-cell k-disabled", Td = "k-selected";
|
|
2053
|
+
class Ld extends l.Component {
|
|
2054
|
+
constructor() {
|
|
2055
|
+
super(...arguments), this.state = { row: -1, col: -1 };
|
|
2056
|
+
}
|
|
2057
|
+
renderCell(e, o, r) {
|
|
2058
|
+
const n = Math.floor(e / this.props.columns), a = e % this.props.columns, i = a <= r && n <= o;
|
|
2059
|
+
return /* @__PURE__ */ l.createElement(
|
|
2060
|
+
"span",
|
|
2061
|
+
{
|
|
2062
|
+
className: Ad + (i ? ` ${Td}` : ""),
|
|
2063
|
+
onMouseEnter: () => this.setState({ row: n, col: a }),
|
|
2064
|
+
onClick: () => this.props.onCellClick.call(void 0, n, a),
|
|
2065
|
+
key: e
|
|
2066
|
+
}
|
|
2067
|
+
);
|
|
2068
|
+
}
|
|
2069
|
+
render() {
|
|
2070
|
+
const e = [], o = this.props.columns * this.props.rows, { row: r, col: n } = this.state, { onDown: a } = this.props;
|
|
2071
|
+
let i = this.props.createTableMessage;
|
|
2072
|
+
n > -1 && (i = aa(this.props.createTableHintMessage, r + 1, n + 1));
|
|
2073
|
+
for (let c = 0; c < o; c++)
|
|
2074
|
+
e.push(this.renderCell(c, r, n));
|
|
2075
|
+
return [/* @__PURE__ */ l.createElement(
|
|
2076
|
+
"div",
|
|
2077
|
+
{
|
|
2078
|
+
onMouseLeave: () => this.setState({ row: -1, col: -1 }),
|
|
2079
|
+
key: "cells",
|
|
2080
|
+
style: { borderColor: "inherit" },
|
|
2081
|
+
onPointerDown: a,
|
|
2082
|
+
onMouseDown: a
|
|
2083
|
+
},
|
|
2084
|
+
e
|
|
2085
|
+
), /* @__PURE__ */ l.createElement(
|
|
2086
|
+
"div",
|
|
2087
|
+
{
|
|
2088
|
+
className: "k-status",
|
|
2089
|
+
key: "status",
|
|
2090
|
+
onPointerDown: a,
|
|
2091
|
+
onMouseDown: a
|
|
2092
|
+
},
|
|
2093
|
+
i
|
|
2094
|
+
)];
|
|
2095
|
+
}
|
|
2096
|
+
}
|
|
2097
|
+
var Ze;
|
|
2098
|
+
((t) => {
|
|
2099
|
+
const e = class extends l.Component {
|
|
2100
|
+
constructor() {
|
|
2101
|
+
super(...arguments), this.pointerdown = !1, this.onWindowDown = (r) => {
|
|
2102
|
+
const { anchor: n } = this.props;
|
|
2103
|
+
n && (n === r.target || n.firstElementChild === r.target) || (this.props.show && !this.pointerdown && this.props.onClose(), this.pointerdown = !1);
|
|
2104
|
+
}, this.onPointerDown = () => this.pointerdown = !0;
|
|
2105
|
+
}
|
|
2106
|
+
/**
|
|
2107
|
+
* @hidden
|
|
2108
|
+
*/
|
|
2109
|
+
componentDidUpdate(r) {
|
|
2110
|
+
r.show && this.props.show && this.props.onClose();
|
|
2111
|
+
}
|
|
2112
|
+
/**
|
|
2113
|
+
* @hidden
|
|
2114
|
+
*/
|
|
2115
|
+
componentDidMount() {
|
|
2116
|
+
window.addEventListener("mousedown", this.onWindowDown), window.addEventListener("pointerdown", this.onWindowDown);
|
|
2117
|
+
}
|
|
2118
|
+
/**
|
|
2119
|
+
* @hidden
|
|
2120
|
+
*/
|
|
2121
|
+
componentWillUnmount() {
|
|
2122
|
+
window.removeEventListener("mousedown", this.onWindowDown), window.removeEventListener("pointerdown", this.onWindowDown);
|
|
2123
|
+
}
|
|
2124
|
+
/**
|
|
2125
|
+
* @hidden
|
|
2126
|
+
*/
|
|
2127
|
+
render() {
|
|
2128
|
+
const {
|
|
2129
|
+
show: r,
|
|
2130
|
+
anchor: n,
|
|
2131
|
+
dir: a,
|
|
2132
|
+
rows: i = e.defaultProps.rows,
|
|
2133
|
+
columns: c = e.defaultProps.columns
|
|
2134
|
+
} = this.props, d = a === "rtl" ? "right" : "left";
|
|
2135
|
+
return /* @__PURE__ */ l.createElement(
|
|
2136
|
+
ud,
|
|
2137
|
+
{
|
|
2138
|
+
anchor: n,
|
|
2139
|
+
anchorAlign: { horizontal: d, vertical: "bottom" },
|
|
2140
|
+
popupAlign: { horizontal: d, vertical: "top" },
|
|
2141
|
+
popupClass: "k-ct-popup k-group k-reset k-state-border-up",
|
|
2142
|
+
show: r,
|
|
2143
|
+
style: a === "rtl" ? { direction: "rtl" } : void 0
|
|
2144
|
+
},
|
|
2145
|
+
/* @__PURE__ */ l.createElement(
|
|
2146
|
+
Ld,
|
|
2147
|
+
{
|
|
2148
|
+
rows: i,
|
|
2149
|
+
columns: c,
|
|
2150
|
+
createTableMessage: this.props.createTableMessage,
|
|
2151
|
+
createTableHintMessage: this.props.createTableHintMessage,
|
|
2152
|
+
onCellClick: this.props.onTableInsert,
|
|
2153
|
+
onDown: this.onPointerDown
|
|
2154
|
+
}
|
|
2155
|
+
)
|
|
2156
|
+
);
|
|
2157
|
+
}
|
|
2158
|
+
};
|
|
2159
|
+
let o = e;
|
|
2160
|
+
o.propTypes = {
|
|
2161
|
+
show: R.bool.isRequired,
|
|
2162
|
+
createTableMessage: R.string.isRequired,
|
|
2163
|
+
createTableHintMessage: R.string.isRequired,
|
|
2164
|
+
onClose: R.func.isRequired,
|
|
2165
|
+
onTableInsert: R.func.isRequired,
|
|
2166
|
+
anchor: R.any,
|
|
2167
|
+
rows: R.number,
|
|
2168
|
+
columns: R.number,
|
|
2169
|
+
dir: R.string
|
|
2170
|
+
}, o.defaultProps = {
|
|
2171
|
+
rows: 6,
|
|
2172
|
+
columns: 8
|
|
2173
|
+
}, t.InsertTablePopup = o;
|
|
2174
|
+
})(Ze || (Ze = {}));
|
|
2175
|
+
var mt;
|
|
2176
|
+
((t) => {
|
|
2177
|
+
t.createInsertTableTool = (e) => {
|
|
2178
|
+
const o = class extends l.Component {
|
|
2179
|
+
constructor() {
|
|
2180
|
+
super(...arguments), this.state = {
|
|
2181
|
+
openedPopup: !1
|
|
2182
|
+
}, this.button = null, this.togglePopup = () => {
|
|
2183
|
+
this.setState({
|
|
2184
|
+
openedPopup: !this.state.openedPopup
|
|
2185
|
+
});
|
|
2186
|
+
}, this.closePopup = () => {
|
|
2187
|
+
this.state.openedPopup && this.togglePopup();
|
|
2188
|
+
}, this.onTableInsert = (n, a) => {
|
|
2189
|
+
const { view: i } = this.props;
|
|
2190
|
+
if (!i)
|
|
2191
|
+
return;
|
|
2192
|
+
const { table: c, table_row: d, table_cell: p } = i.state.schema.nodes, m = wl({ table: c, table_row: d, table_cell: p }, n, a);
|
|
2193
|
+
m && xt(m, !0)(i.state, i.dispatch), i.focus(), this.closePopup();
|
|
2194
|
+
};
|
|
2195
|
+
}
|
|
2196
|
+
render() {
|
|
2197
|
+
const { view: n, render: a, ...i } = this.props, c = n && n.state, d = D(this), { createTable: p, createTableHint: m } = e.messages, g = d.toLanguageString(p, u[p]), k = d.toLanguageString(m, u[m]), h = !!(!c || !It(c, c.schema.nodes.table) || V(c.selection.$from, (y) => y.type.name === "table_caption_external")), f = [/* @__PURE__ */ l.createElement(
|
|
2198
|
+
T,
|
|
2199
|
+
{
|
|
2200
|
+
onClick: h ? void 0 : this.togglePopup,
|
|
2201
|
+
"aria-disabled": h ? !0 : void 0,
|
|
2202
|
+
ref: (y) => this.button = y && y.element,
|
|
2203
|
+
key: "InsertTable",
|
|
2204
|
+
...M,
|
|
2205
|
+
title: g,
|
|
2206
|
+
...e.props,
|
|
2207
|
+
...i,
|
|
2208
|
+
className: X(i.className, e.props.className, { "k-disabled": h })
|
|
2209
|
+
}
|
|
2210
|
+
), n && !h && /* @__PURE__ */ l.createElement(
|
|
2211
|
+
Ze.InsertTablePopup,
|
|
2212
|
+
{
|
|
2213
|
+
key: "insertTablePopup",
|
|
2214
|
+
createTableMessage: g,
|
|
2215
|
+
createTableHintMessage: k,
|
|
2216
|
+
dir: i.dir,
|
|
2217
|
+
anchor: this.button,
|
|
2218
|
+
show: this.state.openedPopup,
|
|
2219
|
+
onClose: this.closePopup,
|
|
2220
|
+
onTableInsert: this.onTableInsert
|
|
2221
|
+
}
|
|
2222
|
+
) || null];
|
|
2223
|
+
return a ? a.call(void 0, f, { view: n }) : f;
|
|
2224
|
+
}
|
|
2225
|
+
};
|
|
2226
|
+
return B(o), o;
|
|
2227
|
+
};
|
|
2228
|
+
})(mt || (mt = {}));
|
|
2229
|
+
const { alignRemove: Ut } = P, Ed = (t) => {
|
|
2230
|
+
const e = class extends l.Component {
|
|
2231
|
+
render() {
|
|
2232
|
+
const { view: r, render: n, ...a } = this.props, i = r && r.state, c = !!i && Il(i, t.actions), d = c ? Ut.actions : t.actions, p = c ? Ut.commandName : t.commandName, m = D(this), g = t.messages.title, k = /* @__PURE__ */ l.createElement(
|
|
2233
|
+
T,
|
|
2234
|
+
{
|
|
2235
|
+
onClick: () => r && kl(d, p)(r.state, r.dispatch),
|
|
2236
|
+
selected: c,
|
|
2237
|
+
togglable: !0,
|
|
2238
|
+
...M,
|
|
2239
|
+
title: m.toLanguageString(g, u[g]),
|
|
2240
|
+
...t.props,
|
|
2241
|
+
...a
|
|
2242
|
+
}
|
|
2243
|
+
);
|
|
2244
|
+
return n ? n.call(void 0, k, { view: r }) : k;
|
|
2245
|
+
}
|
|
2246
|
+
};
|
|
2247
|
+
return B(e), e;
|
|
2248
|
+
};
|
|
2249
|
+
var ut;
|
|
2250
|
+
((t) => {
|
|
2251
|
+
t.createStyleDropDownList = (e) => {
|
|
2252
|
+
const o = class extends l.Component {
|
|
2253
|
+
constructor() {
|
|
2254
|
+
super(...arguments), this.onChange = (n) => {
|
|
2255
|
+
const a = n.target.value, { view: i } = this.props, { style: c } = e;
|
|
2256
|
+
if (i) {
|
|
2257
|
+
St({ style: c, value: a.value }, e.commandName)(i.state, i.dispatch);
|
|
2258
|
+
const { syntheticEvent: d } = n;
|
|
2259
|
+
d && d.type === "click" && i.focus();
|
|
2260
|
+
}
|
|
2261
|
+
};
|
|
2262
|
+
}
|
|
2263
|
+
render() {
|
|
2264
|
+
const { style: n } = e, { view: a, render: i, data: c, defaultItem: d, ...p } = this.props, m = c || e.items;
|
|
2265
|
+
let g = d || e.defaultItem;
|
|
2266
|
+
const k = a ? Sl(a.state, { name: n, value: /^.+$/ }) : [], h = D(this);
|
|
2267
|
+
g && g.localizationKey && (g = { ...g }, g.text = g.localizationKey ? h.toLanguageString(
|
|
2268
|
+
g.localizationKey,
|
|
2269
|
+
u[g.localizationKey]
|
|
2270
|
+
) : g.text);
|
|
2271
|
+
const f = new Set(k).size === 1 ? k[0] : null, y = /* @__PURE__ */ l.createElement(
|
|
2272
|
+
Q,
|
|
2273
|
+
{
|
|
2274
|
+
value: f && m.find((w) => w.value === f),
|
|
2275
|
+
data: m,
|
|
2276
|
+
defaultItem: g,
|
|
2277
|
+
itemRender: sa,
|
|
2278
|
+
textField: "text",
|
|
2279
|
+
dataItemKey: "value",
|
|
2280
|
+
onChange: this.onChange,
|
|
2281
|
+
style: ra,
|
|
2282
|
+
leftRightKeysNavigation: !1,
|
|
2283
|
+
title: g.text,
|
|
2284
|
+
...p
|
|
2285
|
+
}
|
|
2286
|
+
);
|
|
2287
|
+
return i ? i.call(void 0, y, { view: a }) : y;
|
|
2288
|
+
}
|
|
2289
|
+
};
|
|
2290
|
+
return B(o), o;
|
|
2291
|
+
};
|
|
2292
|
+
})(ut || (ut = {}));
|
|
2293
|
+
const Ot = (t) => {
|
|
2294
|
+
const { view: e, style: o, colorPickerProps: r, commandName: n } = t, a = r.title, i = r.ariaLabel, { view: c = "palette" } = r, d = te(), p = l.useCallback(
|
|
2295
|
+
(m) => {
|
|
2296
|
+
e && (St({ style: o, value: m.value }, n)(e.state, e.dispatch), c === "palette" && e.focus());
|
|
2297
|
+
},
|
|
2298
|
+
[e, o, c, n]
|
|
2299
|
+
);
|
|
2300
|
+
return /* @__PURE__ */ l.createElement(
|
|
2301
|
+
Fe,
|
|
2302
|
+
{
|
|
2303
|
+
onChange: p,
|
|
2304
|
+
onActiveColorClick: p,
|
|
2305
|
+
...r,
|
|
2306
|
+
title: a && d.toLanguageString(a, u[a]),
|
|
2307
|
+
ariaLabel: i && d.toLanguageString(i, u[i])
|
|
2308
|
+
}
|
|
2309
|
+
);
|
|
2310
|
+
};
|
|
2311
|
+
var gt;
|
|
2312
|
+
((t) => {
|
|
2313
|
+
t.createFormatBlockDropDownList = (e) => {
|
|
2314
|
+
const o = class extends l.Component {
|
|
2315
|
+
constructor() {
|
|
2316
|
+
super(...arguments), this.onChange = (n) => {
|
|
2317
|
+
const a = n.target.value, { view: i } = this.props;
|
|
2318
|
+
if (i && xl(a.value, e.commandName)(i.state, i.dispatch)) {
|
|
2319
|
+
const { syntheticEvent: c } = n;
|
|
2320
|
+
c && c.type === "click" && i.focus();
|
|
2321
|
+
}
|
|
2322
|
+
};
|
|
2323
|
+
}
|
|
2324
|
+
render() {
|
|
2325
|
+
const { view: n, render: a, data: i, defaultItem: c, ...d } = this.props, p = i || e.items;
|
|
2326
|
+
let m = c || e.defaultItem;
|
|
2327
|
+
const g = n && n.state, k = g ? Pl(g) : [], h = D(this);
|
|
2328
|
+
m && m.localizationKey && (m = { ...m }, m.text = m.localizationKey ? h.toLanguageString(
|
|
2329
|
+
m.localizationKey,
|
|
2330
|
+
u[m.localizationKey]
|
|
2331
|
+
) : m.text);
|
|
2332
|
+
const f = new Set(k).size === 1 ? k[0] : null, y = /* @__PURE__ */ l.createElement(
|
|
2333
|
+
Q,
|
|
2334
|
+
{
|
|
2335
|
+
value: f && p.find((w) => w.value === f),
|
|
2336
|
+
onChange: this.onChange,
|
|
2337
|
+
itemRender: sa,
|
|
2338
|
+
data: p,
|
|
2339
|
+
defaultItem: m,
|
|
2340
|
+
textField: "text",
|
|
2341
|
+
dataItemKey: "value",
|
|
2342
|
+
style: ra,
|
|
2343
|
+
leftRightKeysNavigation: !1,
|
|
2344
|
+
title: m.text,
|
|
2345
|
+
...d
|
|
2346
|
+
}
|
|
2347
|
+
);
|
|
2348
|
+
return a ? a.call(void 0, y, { view: n }) : y;
|
|
2349
|
+
}
|
|
2350
|
+
};
|
|
2351
|
+
return B(o), o;
|
|
2352
|
+
};
|
|
2353
|
+
})(gt || (gt = {}));
|
|
2354
|
+
const q = (t, e) => {
|
|
2355
|
+
const o = class extends l.Component {
|
|
2356
|
+
render() {
|
|
2357
|
+
const { view: n, render: a, ...i } = this.props, c = D(this), d = t.messages.title, p = n && n.state, m = p ? !e(p) : !1, g = /* @__PURE__ */ l.createElement(
|
|
2358
|
+
T,
|
|
2359
|
+
{
|
|
2360
|
+
onClick: m ? void 0 : () => n && e(n.state, (k) => n.dispatch(k.setMeta("commandName", t.commandName))),
|
|
2361
|
+
"aria-disabled": m ? !0 : void 0,
|
|
2362
|
+
...M,
|
|
2363
|
+
title: c.toLanguageString(d, u[d]),
|
|
2364
|
+
...t.props,
|
|
2365
|
+
...i,
|
|
2366
|
+
className: X(i.className, t.props.className, { "k-disabled": m })
|
|
2367
|
+
}
|
|
2368
|
+
);
|
|
2369
|
+
return a ? a.call(void 0, g, { view: n }) : g;
|
|
2370
|
+
}
|
|
2371
|
+
};
|
|
2372
|
+
return B(o), o;
|
|
2373
|
+
};
|
|
2374
|
+
var et;
|
|
2375
|
+
((t) => {
|
|
2376
|
+
t.createUndoTool = (e) => q(e, Pt), t.createRedoTool = (e) => q(e, _e);
|
|
2377
|
+
})(et || (et = {}));
|
|
2378
|
+
var ht;
|
|
2379
|
+
((t) => {
|
|
2380
|
+
t.createIndentTool = (e) => {
|
|
2381
|
+
const o = class extends l.Component {
|
|
2382
|
+
render() {
|
|
2383
|
+
const { view: n, render: a, ...i } = this.props, c = i.dir, d = n && n.state, p = d && d.schema.nodes, m = p && p[e.listsTypes.listItem], g = e.actions, k = !!d && !!m && (At(d, g, c) || g.some((L) => p && p[L.node] && ze(d, p[L.node]))) && !ze(d, m), h = !!d && vl(d, m), f = k || h, y = D(this), w = e.messages.title, S = !f, I = /* @__PURE__ */ l.createElement(
|
|
2384
|
+
T,
|
|
2385
|
+
{
|
|
2386
|
+
onClick: S ? void 0 : () => {
|
|
2387
|
+
n && h && m ? Hl(m)(n.state, n.dispatch) : n && k && Rt(g, e.commandName, c)(n.state, n.dispatch);
|
|
2388
|
+
},
|
|
2389
|
+
"aria-disabled": S ? !0 : void 0,
|
|
2390
|
+
title: y.toLanguageString(w, u[w]),
|
|
2391
|
+
...M,
|
|
2392
|
+
...e.props,
|
|
2393
|
+
...i,
|
|
2394
|
+
className: X(i.className, e.props.className, { "k-disabled": S })
|
|
2395
|
+
}
|
|
2396
|
+
);
|
|
2397
|
+
return a ? a.call(void 0, I, { view: n }) : I;
|
|
2398
|
+
}
|
|
2399
|
+
};
|
|
2400
|
+
return B(o), o;
|
|
2401
|
+
};
|
|
2402
|
+
})(ht || (ht = {}));
|
|
2403
|
+
var ft;
|
|
2404
|
+
((t) => {
|
|
2405
|
+
t.createInlineFormatTool = (e) => {
|
|
2406
|
+
const o = class extends l.Component {
|
|
2407
|
+
render() {
|
|
2408
|
+
const { view: n, render: a, ...i } = this.props, c = n && n.state, { mark: d, altMarks: p, altStyle: m } = e, g = { mark: d, altMarks: p, altStyle: m }, k = D(this), h = e.messages.title, f = /* @__PURE__ */ l.createElement(
|
|
2409
|
+
T,
|
|
2410
|
+
{
|
|
2411
|
+
onClick: () => n && Me(
|
|
2412
|
+
g,
|
|
2413
|
+
c && c.tr.setMeta("commandName", e.commandName)
|
|
2414
|
+
)(n.state, n.dispatch),
|
|
2415
|
+
selected: !!c && Nt(c, g),
|
|
2416
|
+
togglable: !0,
|
|
2417
|
+
...M,
|
|
2418
|
+
title: k.toLanguageString(h, u[h]),
|
|
2419
|
+
...e.props,
|
|
2420
|
+
...i
|
|
2421
|
+
}
|
|
2422
|
+
);
|
|
2423
|
+
return a ? a.call(void 0, f, { view: n }) : f;
|
|
2424
|
+
}
|
|
2425
|
+
};
|
|
2426
|
+
return B(o), o;
|
|
2427
|
+
};
|
|
2428
|
+
})(ft || (ft = {}));
|
|
2429
|
+
const Dd = (t) => {
|
|
2430
|
+
const e = class extends l.Component {
|
|
2431
|
+
constructor() {
|
|
2432
|
+
super(...arguments), this.state = {
|
|
2433
|
+
openedDialog: !1
|
|
2434
|
+
}, this.toggleDialog = () => {
|
|
2435
|
+
this.setState({
|
|
2436
|
+
openedDialog: !this.state.openedDialog
|
|
2437
|
+
});
|
|
2438
|
+
};
|
|
2439
|
+
}
|
|
2440
|
+
render() {
|
|
2441
|
+
const { view: r, render: n, ...a } = this.props, i = r && r.state, c = i ? i.schema.nodes[t.node] : void 0, d = D(this), { insertImage: p } = t.messages, m = !c || !i || !It(i, c), g = [/* @__PURE__ */ l.createElement(
|
|
2442
|
+
T,
|
|
2443
|
+
{
|
|
2444
|
+
onClick: m ? void 0 : this.toggleDialog,
|
|
2445
|
+
"aria-disabled": m ? !0 : void 0,
|
|
2446
|
+
key: "insertImage",
|
|
2447
|
+
...M,
|
|
2448
|
+
title: d.toLanguageString(p, u[p]),
|
|
2449
|
+
...t.props,
|
|
2450
|
+
...a,
|
|
2451
|
+
className: X(a.className, t.props.className, { "k-disabled": m })
|
|
2452
|
+
}
|
|
2453
|
+
), this.state.openedDialog && r && /* @__PURE__ */ l.createElement(
|
|
2454
|
+
Ee.InsertImageDialog,
|
|
2455
|
+
{
|
|
2456
|
+
key: "insertImageDialog",
|
|
2457
|
+
view: r,
|
|
2458
|
+
settings: t,
|
|
2459
|
+
dir: a.dir,
|
|
2460
|
+
onClose: this.toggleDialog
|
|
2461
|
+
}
|
|
2462
|
+
) || null];
|
|
2463
|
+
return n ? n.call(void 0, g, { view: r }) : g;
|
|
2464
|
+
}
|
|
2465
|
+
};
|
|
2466
|
+
return B(e), e;
|
|
2467
|
+
};
|
|
2468
|
+
var bt;
|
|
2469
|
+
((t) => {
|
|
2470
|
+
t.createLinkTool = (e) => {
|
|
2471
|
+
const o = class extends l.Component {
|
|
2472
|
+
constructor() {
|
|
2473
|
+
super(...arguments), this.state = {
|
|
2474
|
+
openedDialog: !1
|
|
2475
|
+
}, this.toggleDialog = () => {
|
|
2476
|
+
this.setState({
|
|
2477
|
+
openedDialog: !this.state.openedDialog
|
|
2478
|
+
});
|
|
2479
|
+
};
|
|
2480
|
+
}
|
|
2481
|
+
render() {
|
|
2482
|
+
const { view: n, render: a, ...i } = this.props, c = n && n.state, d = c ? c.selection.empty : !0, p = c && lt(c, c.schema.marks[e.mark]), m = D(this), { insertHyperlink: g } = e.messages, k = d && !p, h = [/* @__PURE__ */ l.createElement(
|
|
2483
|
+
T,
|
|
2484
|
+
{
|
|
2485
|
+
onClick: k ? void 0 : this.toggleDialog,
|
|
2486
|
+
"aria-disabled": k ? !0 : void 0,
|
|
2487
|
+
key: "link",
|
|
2488
|
+
...M,
|
|
2489
|
+
title: m.toLanguageString(g, u[g]),
|
|
2490
|
+
...e.props,
|
|
2491
|
+
...i,
|
|
2492
|
+
className: X(i.className, e.props.className, { "k-disabled": k })
|
|
2493
|
+
}
|
|
2494
|
+
), this.state.openedDialog && n && /* @__PURE__ */ l.createElement(
|
|
2495
|
+
Ee.InsertLinkDialog,
|
|
2496
|
+
{
|
|
2497
|
+
key: "insertLinkDialog",
|
|
2498
|
+
settings: e,
|
|
2499
|
+
dir: i.dir,
|
|
2500
|
+
view: n,
|
|
2501
|
+
onClose: this.toggleDialog
|
|
2502
|
+
}
|
|
2503
|
+
) || null];
|
|
2504
|
+
return a ? a.call(void 0, h, { view: n }) : h;
|
|
2505
|
+
}
|
|
2506
|
+
};
|
|
2507
|
+
return B(o), o;
|
|
2508
|
+
};
|
|
2509
|
+
})(bt || (bt = {}));
|
|
2510
|
+
var kt;
|
|
2511
|
+
((t) => {
|
|
2512
|
+
t.createListTool = (e) => {
|
|
2513
|
+
const o = class extends l.Component {
|
|
2514
|
+
render() {
|
|
2515
|
+
const { view: n, render: a, ...i } = this.props;
|
|
2516
|
+
let c = !1;
|
|
2517
|
+
const d = D(this), p = e.messages.title, m = e.types, g = e.listType;
|
|
2518
|
+
if (n) {
|
|
2519
|
+
const h = n.state, f = h.schema.nodes, y = ze(h, f[m.orderedList]), w = ze(h, f[m.bulletList]);
|
|
2520
|
+
g === m.orderedList ? c = y && !w : c = !y && w;
|
|
2521
|
+
}
|
|
2522
|
+
const k = /* @__PURE__ */ l.createElement(
|
|
2523
|
+
T,
|
|
2524
|
+
{
|
|
2525
|
+
onClick: () => n && je(n.state, n.dispatch, n, { listType: g, ...m }, e.commandName),
|
|
2526
|
+
togglable: !0,
|
|
2527
|
+
selected: c,
|
|
2528
|
+
title: d.toLanguageString(p, u[p]),
|
|
2529
|
+
...M,
|
|
2530
|
+
...e.props,
|
|
2531
|
+
...i
|
|
2532
|
+
}
|
|
2533
|
+
);
|
|
2534
|
+
return a ? a.call(void 0, k, { view: n }) : k;
|
|
2535
|
+
}
|
|
2536
|
+
};
|
|
2537
|
+
return B(o), o;
|
|
2538
|
+
};
|
|
2539
|
+
})(kt || (kt = {}));
|
|
2540
|
+
var vt;
|
|
2541
|
+
((t) => {
|
|
2542
|
+
t.createOutdentTool = (e) => {
|
|
2543
|
+
const o = class extends l.Component {
|
|
2544
|
+
render() {
|
|
2545
|
+
const { view: n, render: a, ...i } = this.props, c = n && n.state, d = i.dir, p = !!c && At(c, e.actions, d), m = c && c.schema.nodes[e.listsTypes.listItem], g = !!c && yl(c, { nodes: e.actions, listsTypes: e.listsTypes }), k = p || g, h = D(this), f = e.messages.title, y = !k, w = /* @__PURE__ */ l.createElement(
|
|
2546
|
+
T,
|
|
2547
|
+
{
|
|
2548
|
+
onClick: y ? void 0 : () => {
|
|
2549
|
+
n && g && m ? zl(m)(n.state, n.dispatch) : n && p && Rt(e.actions, e.commandName, d)(n.state, n.dispatch);
|
|
2550
|
+
},
|
|
2551
|
+
"aria-disabled": y ? !0 : void 0,
|
|
2552
|
+
title: h.toLanguageString(f, u[f]),
|
|
2553
|
+
...M,
|
|
2554
|
+
...e.props,
|
|
2555
|
+
...i,
|
|
2556
|
+
className: X(i.className, e.props.className, { "k-disabled": y })
|
|
2557
|
+
}
|
|
2558
|
+
);
|
|
2559
|
+
return a ? a.call(void 0, w, { view: n }) : w;
|
|
2560
|
+
}
|
|
2561
|
+
};
|
|
2562
|
+
return B(o), o;
|
|
2563
|
+
};
|
|
2564
|
+
})(vt || (vt = {}));
|
|
2565
|
+
const ca = (t, e) => {
|
|
2566
|
+
const o = Ul(t, e);
|
|
2567
|
+
if (o && !e) {
|
|
2568
|
+
const r = Et(t), n = r && r.node(r.depth);
|
|
2569
|
+
if (n && n.content.childCount === 1)
|
|
2570
|
+
return !1;
|
|
2571
|
+
}
|
|
2572
|
+
return o;
|
|
2573
|
+
}, da = (t, e) => {
|
|
2574
|
+
const o = Ol(t, e);
|
|
2575
|
+
if (o && !e) {
|
|
2576
|
+
const r = Et(t), n = r && r.node(r.depth - 1);
|
|
2577
|
+
if (n && n.content.childCount === 1)
|
|
2578
|
+
return !1;
|
|
2579
|
+
}
|
|
2580
|
+
return o;
|
|
2581
|
+
};
|
|
2582
|
+
var J;
|
|
2583
|
+
((t) => {
|
|
2584
|
+
t.createAddRowBeforeTool = (e) => q(e, Fl), t.createAddRowAfterTool = (e) => q(e, Tt), t.createAddColumnBeforeTool = (e) => q(e, Wl), t.createAddColumnAfterTool = (e) => q(e, Lt), t.createDeleteRowTool = (e) => q(e, da), t.createDeleteColumnTool = (e) => q(e, ca), t.createDeleteTableTool = (e) => q(e, Kl), t.createMergeCellsTool = (e) => q(e, $l), t.createSplitCellTool = (e) => q(e, Vl);
|
|
2585
|
+
})(J || (J = {}));
|
|
2586
|
+
var yt;
|
|
2587
|
+
((t) => {
|
|
2588
|
+
t.createUnlinkTool = (e) => {
|
|
2589
|
+
const o = class extends l.Component {
|
|
2590
|
+
render() {
|
|
2591
|
+
const { view: n, render: a, ...i } = this.props, c = { mark: e.mark }, d = n ? Nt(n.state, c) : !1, p = D(this), m = e.messages.title, g = !d, k = /* @__PURE__ */ l.createElement(
|
|
2592
|
+
T,
|
|
2593
|
+
{
|
|
2594
|
+
onClick: g ? void 0 : () => n && cs(c, n.state.tr.setMeta("commandName", e.commandName))(n.state, n.dispatch),
|
|
2595
|
+
"aria-disabled": g ? !0 : void 0,
|
|
2596
|
+
...M,
|
|
2597
|
+
title: p.toLanguageString(m, u[m]),
|
|
2598
|
+
...e.props,
|
|
2599
|
+
...i,
|
|
2600
|
+
className: X(i.className, e.props.className, { "k-disabled": g })
|
|
2601
|
+
}
|
|
2602
|
+
);
|
|
2603
|
+
return a ? a.call(void 0, k, { view: n }) : k;
|
|
2604
|
+
}
|
|
2605
|
+
};
|
|
2606
|
+
return B(o), o;
|
|
2607
|
+
};
|
|
2608
|
+
})(yt || (yt = {}));
|
|
2609
|
+
var Ct;
|
|
2610
|
+
((t) => {
|
|
2611
|
+
t.createViewHtmlTool = (e) => {
|
|
2612
|
+
const o = class extends l.Component {
|
|
2613
|
+
constructor() {
|
|
2614
|
+
super(...arguments), this.state = {
|
|
2615
|
+
openedDialog: !1
|
|
2616
|
+
}, this.toggleDialog = () => {
|
|
2617
|
+
this.setState({
|
|
2618
|
+
openedDialog: !this.state.openedDialog
|
|
2619
|
+
});
|
|
2620
|
+
};
|
|
2621
|
+
}
|
|
2622
|
+
render() {
|
|
2623
|
+
const { view: n, render: a, ...i } = this.props, c = D(this), d = e.messages.viewHtml, p = [/* @__PURE__ */ l.createElement(
|
|
2624
|
+
T,
|
|
2625
|
+
{
|
|
2626
|
+
onClick: this.toggleDialog,
|
|
2627
|
+
key: "viewHtml",
|
|
2628
|
+
...M,
|
|
2629
|
+
title: c.toLanguageString(d, u[d]),
|
|
2630
|
+
...e.props,
|
|
2631
|
+
...i
|
|
2632
|
+
}
|
|
2633
|
+
), this.state.openedDialog && n && /* @__PURE__ */ l.createElement(
|
|
2634
|
+
Ee.ViewHtmlDialog,
|
|
2635
|
+
{
|
|
2636
|
+
key: "viewHtmlDialog",
|
|
2637
|
+
view: n,
|
|
2638
|
+
settings: e,
|
|
2639
|
+
dir: i.dir,
|
|
2640
|
+
onClose: this.toggleDialog
|
|
2641
|
+
}
|
|
2642
|
+
) || null];
|
|
2643
|
+
return a ? a.call(void 0, p, { view: n }) : p;
|
|
2644
|
+
}
|
|
2645
|
+
};
|
|
2646
|
+
return B(o), o;
|
|
2647
|
+
};
|
|
2648
|
+
})(Ct || (Ct = {}));
|
|
2649
|
+
const { print: Bd } = P, Md = (t) => {
|
|
2650
|
+
const { view: e, render: o, settings: r = Bd, ...n } = t, a = e && e.dom, i = a && a.ownerDocument, c = i && i.defaultView, d = r.messages.title, p = !c || c === window, m = l.useCallback(
|
|
2651
|
+
() => {
|
|
2652
|
+
c && c.print();
|
|
2653
|
+
},
|
|
2654
|
+
[c]
|
|
2655
|
+
), g = /* @__PURE__ */ l.createElement(
|
|
2656
|
+
T,
|
|
2657
|
+
{
|
|
2658
|
+
onClick: p ? void 0 : m,
|
|
2659
|
+
"aria-disabled": p ? !0 : void 0,
|
|
2660
|
+
title: te().toLanguageString(d, u[d]),
|
|
2661
|
+
...M,
|
|
2662
|
+
...r.props,
|
|
2663
|
+
...n,
|
|
2664
|
+
className: X(n.className, r.props.className, { "k-disabled": p })
|
|
2665
|
+
}
|
|
2666
|
+
);
|
|
2667
|
+
return o ? o.call(void 0, g, { view: e }) : g;
|
|
2668
|
+
}, { pdf: Hd, savePdfOptions: zd } = P, Fd = (t) => {
|
|
2669
|
+
const { view: e, render: o, settings: r = Hd, savePdfOptions: n, savePdfCallback: a, ...i } = t, c = r.messages.title, d = l.useCallback(
|
|
2670
|
+
() => {
|
|
2671
|
+
e && gd(e.dom, { ...zd, ...n || {} }, a);
|
|
2672
|
+
},
|
|
2673
|
+
[e, n, a]
|
|
2674
|
+
), p = /* @__PURE__ */ l.createElement(
|
|
2675
|
+
T,
|
|
2676
|
+
{
|
|
2677
|
+
onClick: d,
|
|
2678
|
+
title: te().toLanguageString(c, u[c]),
|
|
2679
|
+
...M,
|
|
2680
|
+
...r.props,
|
|
2681
|
+
...i
|
|
2682
|
+
}
|
|
2683
|
+
);
|
|
2684
|
+
return o ? o.call(void 0, p, { view: e }) : p;
|
|
2685
|
+
}, { selectAll: Wd } = P, Kd = (t) => {
|
|
2686
|
+
const { view: e, render: o, settings: r = Wd, ...n } = t, a = r.messages.title, i = l.useCallback(
|
|
2687
|
+
() => {
|
|
2688
|
+
e && (_l(e.state, e.dispatch), e.focus());
|
|
2689
|
+
},
|
|
2690
|
+
[e]
|
|
2691
|
+
), c = /* @__PURE__ */ l.createElement(
|
|
2692
|
+
T,
|
|
2693
|
+
{
|
|
2694
|
+
onClick: i,
|
|
2695
|
+
title: te().toLanguageString(a, u[a]),
|
|
2696
|
+
...M,
|
|
2697
|
+
...r.props,
|
|
2698
|
+
...n
|
|
2699
|
+
}
|
|
2700
|
+
);
|
|
2701
|
+
return o ? o.call(void 0, c, { view: e }) : c;
|
|
2702
|
+
}, { cleanFormatting: $d } = P, _t = ds(), Vd = (t) => {
|
|
2703
|
+
const { view: e, render: o, settings: r = $d, ...n } = t, a = r.messages.title, i = !e || !_t(e.state), c = l.useCallback(
|
|
2704
|
+
() => {
|
|
2705
|
+
e && _t(e.state, (p) => {
|
|
2706
|
+
p.setMeta("commandName", r.commandName), e.dispatch(p);
|
|
2707
|
+
});
|
|
2708
|
+
},
|
|
2709
|
+
[e]
|
|
2710
|
+
), d = /* @__PURE__ */ l.createElement(
|
|
2711
|
+
T,
|
|
2712
|
+
{
|
|
2713
|
+
onClick: i ? void 0 : c,
|
|
2714
|
+
"aria-disabled": i ? !0 : void 0,
|
|
2715
|
+
title: te().toLanguageString(a, u[a]),
|
|
2716
|
+
...M,
|
|
2717
|
+
...r.props,
|
|
2718
|
+
...n,
|
|
2719
|
+
className: X(t.className, r.props.className, { "k-disabled": i })
|
|
2720
|
+
}
|
|
2721
|
+
);
|
|
2722
|
+
return o ? o.call(void 0, d, { view: e }) : d;
|
|
2723
|
+
}, jt = P.findAndReplace;
|
|
2724
|
+
let pa = class extends l.Component {
|
|
2725
|
+
constructor() {
|
|
2726
|
+
super(...arguments), this.state = { showDialog: !1 }, this.onClose = () => this.setState({ showDialog: !1 }), this.onOpen = () => this.setState({ showDialog: !0 });
|
|
2727
|
+
}
|
|
2728
|
+
/**
|
|
2729
|
+
* @hidden
|
|
2730
|
+
*/
|
|
2731
|
+
render() {
|
|
2732
|
+
const { view: e, ...o } = this.props, { props: r } = jt, n = D(this), a = jt.messages.findReplaceToolTitle, i = !e;
|
|
2733
|
+
return [/* @__PURE__ */ l.createElement(
|
|
2734
|
+
T,
|
|
2735
|
+
{
|
|
2736
|
+
onClick: i ? void 0 : this.onOpen,
|
|
2737
|
+
"aria-disabled": i ? !0 : void 0,
|
|
2738
|
+
...M,
|
|
2739
|
+
title: n.toLanguageString(a, u[a]),
|
|
2740
|
+
key: "tool",
|
|
2741
|
+
...r,
|
|
2742
|
+
...o,
|
|
2743
|
+
className: X(o.className, r.className, { "k-disabled": i })
|
|
2744
|
+
}
|
|
2745
|
+
), this.state.showDialog && e && /* @__PURE__ */ l.createElement(
|
|
2746
|
+
Bt,
|
|
2747
|
+
{
|
|
2748
|
+
view: e,
|
|
2749
|
+
onClose: this.onClose,
|
|
2750
|
+
dir: o.dir,
|
|
2751
|
+
key: "dialog"
|
|
2752
|
+
}
|
|
2753
|
+
)];
|
|
2754
|
+
}
|
|
2755
|
+
};
|
|
2756
|
+
B(pa);
|
|
2757
|
+
const Gt = (t, e) => {
|
|
2758
|
+
let { from: o, to: r } = t.selection, n = null;
|
|
2759
|
+
return t.doc.nodesBetween(o, r, (a) => (n = n || (a.type === e ? a : null), !n)), n;
|
|
2760
|
+
}, qt = (t) => {
|
|
2761
|
+
let e = !1;
|
|
2762
|
+
const o = t.view, r = Se, n = t.listType, a = te();
|
|
2763
|
+
let i = [...t.items || []], c, d;
|
|
2764
|
+
if (o) {
|
|
2765
|
+
const g = o.state, k = g && g.schema.nodes;
|
|
2766
|
+
c = k && Gt(g, k[r.orderedList]), d = k && Gt(g, k[r.bulletList]), e = !!(n === r.orderedList ? c && !d : !c && d);
|
|
2767
|
+
}
|
|
2768
|
+
const p = (g) => {
|
|
2769
|
+
o && (je(o.state, o.dispatch, o, { listType: n, ...r, listAttrs: {} }, "InsertList"), o.focus());
|
|
2770
|
+
}, m = (g) => {
|
|
2771
|
+
if (o) {
|
|
2772
|
+
const k = g.item.style ? { style: "list-style-type: " + g.item.style + ";" } : {}, h = c || d;
|
|
2773
|
+
if (h && Ft(h.attrs) !== g.item.style) {
|
|
2774
|
+
const f = o.state.selection.$head.posAtIndex(0, -2) - 1;
|
|
2775
|
+
o.dispatch(o.state.tr.setNodeMarkup(f, o.state.schema.nodes[n], k));
|
|
2776
|
+
} else
|
|
2777
|
+
je(o.state, o.dispatch, o, { listType: n, ...r, listAttrs: k }, "InsertList");
|
|
2778
|
+
o.focus();
|
|
2779
|
+
}
|
|
2780
|
+
};
|
|
2781
|
+
if (e && (c || d)) {
|
|
2782
|
+
const g = Ft((c || d).attrs);
|
|
2783
|
+
i = i.map((k, h) => ({ ...k, selected: g ? k.style === g : h === 0 }));
|
|
2784
|
+
}
|
|
2785
|
+
return /* @__PURE__ */ l.createElement("span", { onMouseDown: (g) => {
|
|
2786
|
+
g.preventDefault();
|
|
2787
|
+
} }, /* @__PURE__ */ l.createElement(
|
|
2788
|
+
Sa,
|
|
2789
|
+
{
|
|
2790
|
+
textField: "text",
|
|
2791
|
+
items: i,
|
|
2792
|
+
icon: t.icon,
|
|
2793
|
+
svgIcon: t.svgIcon,
|
|
2794
|
+
onButtonClick: p,
|
|
2795
|
+
onItemClick: m,
|
|
2796
|
+
buttonClass: e ? "k-selected" : void 0,
|
|
2797
|
+
title: t.title !== void 0 ? t.title : a.toLanguageString(t.titleKey, u[t.titleKey])
|
|
2798
|
+
}
|
|
2799
|
+
));
|
|
2800
|
+
}, Ud = /[\D]+$/, Mt = (t) => {
|
|
2801
|
+
const e = t.match(Ud);
|
|
2802
|
+
return e ? e[0] : "";
|
|
2803
|
+
}, at = (t, e) => {
|
|
2804
|
+
var r;
|
|
2805
|
+
const o = ae(((r = t.attrs) == null ? void 0 : r.style) || "")[e] || "";
|
|
2806
|
+
return {
|
|
2807
|
+
[e]: parseFloat(o) || null,
|
|
2808
|
+
[e + "Unit"]: Mt(o)
|
|
2809
|
+
};
|
|
2810
|
+
}, ae = (t) => (t || "").split(/\s*;\s*/).filter(Boolean).map((o) => {
|
|
2811
|
+
const r = o.split(/\s*:\s*/);
|
|
2812
|
+
return { [r[0]]: r[1] };
|
|
2813
|
+
}).reduce((o, r) => ({ ...o, ...r }), {}), Od = (t, e) => {
|
|
2814
|
+
const o = e.style, r = e.value, n = e.newValue;
|
|
2815
|
+
if (!t)
|
|
2816
|
+
return { changed: !1, style: null };
|
|
2817
|
+
const a = t.split(/\s*;\s*/).filter((c) => !!c), i = a.filter((c) => {
|
|
2818
|
+
const d = c.split(/\s*:\s*/);
|
|
2819
|
+
return !(d[0].toLowerCase() === o && r.test(d[1]));
|
|
2820
|
+
});
|
|
2821
|
+
return n && i.push(`${o}: ${n}`), {
|
|
2822
|
+
style: i.join("; ") + (i.length ? ";" : ""),
|
|
2823
|
+
changed: !!n || i.length !== a.length
|
|
2824
|
+
};
|
|
2825
|
+
}, _d = /^.+$/;
|
|
2826
|
+
function A(t, e, o) {
|
|
2827
|
+
let r;
|
|
2828
|
+
if (new RegExp("[^-]?" + e + ":").test(t.style || "")) {
|
|
2829
|
+
const { style: n } = Od(
|
|
2830
|
+
t.style || "",
|
|
2831
|
+
{ style: e, value: _d, newValue: o }
|
|
2832
|
+
);
|
|
2833
|
+
r = { ...t, style: n };
|
|
2834
|
+
} else if (t.style) {
|
|
2835
|
+
const n = ae(t.style);
|
|
2836
|
+
n[e] = o, r = {
|
|
2837
|
+
...t,
|
|
2838
|
+
style: Object.keys(n).filter((a) => !!n[a]).reduce((a, i) => a + i + ": " + n[i] + "; ", "").trim()
|
|
2839
|
+
};
|
|
2840
|
+
} else
|
|
2841
|
+
o ? r = { ...t, style: e + ": " + o + ";" } : r = { ...t };
|
|
2842
|
+
return r;
|
|
2843
|
+
}
|
|
2844
|
+
const jd = (t) => {
|
|
2845
|
+
const { doc: e, selection: o } = t, r = [];
|
|
2846
|
+
return o.ranges.forEach((n) => {
|
|
2847
|
+
const a = n.$from.pos, i = n.$to.pos;
|
|
2848
|
+
e.nodesBetween(a, i, (c, d, p, m) => {
|
|
2849
|
+
(c.type.name === "table_cell" || c.type.name === "table_header") && r.push({ node: c, pos: d });
|
|
2850
|
+
});
|
|
2851
|
+
}), r;
|
|
2852
|
+
}, ot = (t) => {
|
|
2853
|
+
const e = V(t.selection.$from, (r) => r.type.name === "table"), o = V(t.selection.$to, (r) => r.type.name === "table");
|
|
2854
|
+
return e && o && e.depth === o.depth && e.node.eq(o.node) ? jd(t).filter(({ pos: n }) => {
|
|
2855
|
+
const a = V(t.doc.resolve(n), (i) => i.type.name === "table");
|
|
2856
|
+
return a && a.depth === e.depth && e.node.eq(a.node);
|
|
2857
|
+
}) : [];
|
|
2858
|
+
}, ma = (t) => {
|
|
2859
|
+
const e = [];
|
|
2860
|
+
if (ot(t).length) {
|
|
2861
|
+
const o = t.selection.$from, r = V(o, (d) => d.type.spec.tableRole === "table");
|
|
2862
|
+
if (r === null)
|
|
2863
|
+
return e;
|
|
2864
|
+
const n = o.start(r.depth), a = r.node, i = Le.get(a), c = t.doc;
|
|
2865
|
+
i.map.forEach((d) => {
|
|
2866
|
+
const p = d + n;
|
|
2867
|
+
e.push({ pos: p, node: c.nodeAt(p) });
|
|
2868
|
+
});
|
|
2869
|
+
}
|
|
2870
|
+
return e;
|
|
2871
|
+
}, Ne = "k-colgroup-data", Gd = (t, e, o) => {
|
|
2872
|
+
const r = {
|
|
2873
|
+
cellWidth: null,
|
|
2874
|
+
widthUnit: ""
|
|
2875
|
+
}, n = e.node, a = o.start(e.depth);
|
|
2876
|
+
if (!n.attrs[Ne])
|
|
2877
|
+
return r;
|
|
2878
|
+
const i = /* @__PURE__ */ new Set();
|
|
2879
|
+
let c = "";
|
|
2880
|
+
const d = jl(n.attrs[Ne]).firstChild;
|
|
2881
|
+
return t.forEach((p) => {
|
|
2882
|
+
const m = n.resolve(p.pos - a), g = m.parent, k = m.index();
|
|
2883
|
+
let h = 0;
|
|
2884
|
+
for (let y = 0; y <= k; y++)
|
|
2885
|
+
h += g.child(y).attrs.colspan;
|
|
2886
|
+
let f = d.children[h - 1];
|
|
2887
|
+
f && (c = f.style.width, i.add(c));
|
|
2888
|
+
}), i.size === 1 && c && (r.cellWidth = parseFloat(c) || null, r.widthUnit = Mt(c)), r;
|
|
2889
|
+
}, qd = (t, e, o) => {
|
|
2890
|
+
const r = {
|
|
2891
|
+
cellHeight: null,
|
|
2892
|
+
heightUnit: ""
|
|
2893
|
+
}, n = e.node, a = o.start(e.depth), i = /* @__PURE__ */ new Set();
|
|
2894
|
+
let c = "";
|
|
2895
|
+
return t.forEach((d) => {
|
|
2896
|
+
var g;
|
|
2897
|
+
const m = n.resolve(d.pos - a).parent;
|
|
2898
|
+
c = ae(((g = m.attrs) == null ? void 0 : g.style) || "").height || "", i.add(c);
|
|
2899
|
+
}), i.size === 1 && c && (r.cellHeight = parseFloat(c) || null, r.heightUnit = Mt(c)), r;
|
|
2900
|
+
}, pe = (t, e) => {
|
|
2901
|
+
const o = /* @__PURE__ */ new Set();
|
|
2902
|
+
let r = "";
|
|
2903
|
+
return t.forEach((n) => {
|
|
2904
|
+
var a;
|
|
2905
|
+
r = ae(((a = n.node.attrs) == null ? void 0 : a.style) || "")[e] || "", o.add(r);
|
|
2906
|
+
}), o.size === 1 && r ? r : "";
|
|
2907
|
+
}, Jt = (t, e) => {
|
|
2908
|
+
const o = /* @__PURE__ */ new Set();
|
|
2909
|
+
let r = "";
|
|
2910
|
+
return t.forEach((n) => {
|
|
2911
|
+
r = (n.node.attrs || {})[e] || "", o.add(r);
|
|
2912
|
+
}), o.size === 1 && r ? r : "";
|
|
2913
|
+
}, Qt = {
|
|
2914
|
+
applyToAll: !1,
|
|
2915
|
+
cellWidth: null,
|
|
2916
|
+
widthUnit: "",
|
|
2917
|
+
cellHeight: null,
|
|
2918
|
+
heightUnit: "",
|
|
2919
|
+
alignment: { x: "", y: "" },
|
|
2920
|
+
textControl: "",
|
|
2921
|
+
backgroundColor: void 0,
|
|
2922
|
+
cellPadding: null,
|
|
2923
|
+
borderWidth: null,
|
|
2924
|
+
borderColor: void 0,
|
|
2925
|
+
borderStyle: null,
|
|
2926
|
+
id: "",
|
|
2927
|
+
className: ""
|
|
2928
|
+
}, Jd = (t) => {
|
|
2929
|
+
const e = ot(t), o = t.selection.$from, r = e.length ? V(o, (n) => n.type.spec.tableRole === "table") : null;
|
|
2930
|
+
return r ? {
|
|
2931
|
+
...Qt,
|
|
2932
|
+
...Gd(e, r, o),
|
|
2933
|
+
...qd(e, r, o),
|
|
2934
|
+
alignment: { x: pe(e, "text-align"), y: pe(e, "vertical-align") },
|
|
2935
|
+
textControl: pe(e, "white-space"),
|
|
2936
|
+
backgroundColor: pe(e, "background-color") || void 0,
|
|
2937
|
+
cellPadding: parseFloat(pe(e, "padding")) || null,
|
|
2938
|
+
borderWidth: parseFloat(pe(e, "border-width")) || null,
|
|
2939
|
+
borderColor: pe(e, "border-color") || void 0,
|
|
2940
|
+
borderStyle: pe(e, "border-style") || null,
|
|
2941
|
+
id: Jt(e, "id"),
|
|
2942
|
+
className: Jt(e, "class")
|
|
2943
|
+
} : Qt;
|
|
2944
|
+
}, Qd = (t, e, o) => {
|
|
2945
|
+
const r = t.doc.resolve(e), n = r.parent, a = r.index();
|
|
2946
|
+
let i = 0;
|
|
2947
|
+
for (let g = 0; g <= a; g++)
|
|
2948
|
+
i += n.child(g).attrs.colspan;
|
|
2949
|
+
const c = r.node(r.depth - 1), d = r.posAtIndex(0, r.depth - 1) - 1;
|
|
2950
|
+
let p = c.attrs, m;
|
|
2951
|
+
if (p && p[Ne]) {
|
|
2952
|
+
const g = jl(p[Ne]).firstChild;
|
|
2953
|
+
m = g.children[i - 1], m.style.width = o, p = { ...p, [Ne]: g.outerHTML }, t.setNodeMarkup(d, null, p);
|
|
2954
|
+
} else {
|
|
2955
|
+
let g = 0;
|
|
2956
|
+
for (let f = 0; f < n.childCount; f++)
|
|
2957
|
+
g += n.child(f).attrs.colspan;
|
|
2958
|
+
const k = document.createElement("colgroup"), h = new Array(g);
|
|
2959
|
+
for (let f = 0; f < g; f++)
|
|
2960
|
+
h[f] = document.createElement("col"), k.appendChild(h[f]);
|
|
2961
|
+
m = h[a], m.style.width = o, p = {
|
|
2962
|
+
...p,
|
|
2963
|
+
[Ne]: "<colgroup>" + h.reduce((f, y) => f + y.outerHTML, "") + "</colgroup>"
|
|
2964
|
+
}, t.setNodeMarkup(d, null, p);
|
|
2965
|
+
}
|
|
2966
|
+
}, Xd = (t, e, o) => {
|
|
2967
|
+
let r = t.doc.resolve(e), n = r.parent;
|
|
2968
|
+
const a = r.posAtIndex(0) - 1;
|
|
2969
|
+
t.setNodeMarkup(a, null, A(n.attrs, "height", o));
|
|
2970
|
+
}, Yd = (t, e, o) => {
|
|
2971
|
+
o.forEach(({ node: r, pos: n }) => {
|
|
2972
|
+
let a = { ...r.attrs };
|
|
2973
|
+
a = A(a, "border-color", e.borderColor || ""), a = A(a, "border-style", e.borderStyle || ""), a = A(a, "border-width", typeof e.borderWidth == "number" ? e.borderWidth + "px" : ""), a = A(a, "padding", typeof e.cellPadding == "number" ? e.cellPadding + "px" : ""), a = A(a, "background-color", e.backgroundColor || ""), a = A(a, "text-align", e.alignment.x || ""), a = A(a, "vertical-align", e.alignment.y || ""), a = A(a, "white-space", e.textControl || ""), a.id = e.id || null, a.class = e.className || null, t.setNodeMarkup(n, null, a), typeof e.cellWidth == "number" && Qd(t, n, e.cellWidth + (e.widthUnit || "px")), typeof e.cellHeight == "number" && Xd(t, n, e.cellHeight + (e.heightUnit || "px"));
|
|
2974
|
+
});
|
|
2975
|
+
}, Zd = (t, e) => {
|
|
2976
|
+
const o = t.tr, r = e.applyToAll ? ma(t) : ot(t);
|
|
2977
|
+
return Yd(o, e, r), o;
|
|
2978
|
+
}, ep = (t) => {
|
|
2979
|
+
const { view: e, ...o } = t, [r, n] = l.useState(!1), a = te(), i = !!(e && V(e.state.selection.$from, (m) => m.type.spec.tableRole === "table")), c = l.useCallback(() => {
|
|
2980
|
+
n(!0);
|
|
2981
|
+
}, []), d = l.useCallback(() => {
|
|
2982
|
+
n(!1), e == null || e.focus();
|
|
2983
|
+
}, [e]), p = l.useCallback((m) => {
|
|
2984
|
+
if (e && m) {
|
|
2985
|
+
const g = Zd(e.state, m);
|
|
2986
|
+
g.docChanged && e.dispatch(g);
|
|
2987
|
+
}
|
|
2988
|
+
d();
|
|
2989
|
+
}, [e, d]);
|
|
2990
|
+
return /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(
|
|
2991
|
+
T,
|
|
2992
|
+
{
|
|
2993
|
+
type: "button",
|
|
2994
|
+
title: a.toLanguageString(s.cellProperties, u[s.cellProperties]),
|
|
2995
|
+
icon: "table-cell-properties",
|
|
2996
|
+
svgIcon: _c,
|
|
2997
|
+
onClick: c,
|
|
2998
|
+
disabled: !i,
|
|
2999
|
+
...M,
|
|
3000
|
+
...o
|
|
3001
|
+
}
|
|
3002
|
+
), r && e && /* @__PURE__ */ l.createElement(tp, { view: e, onCancel: d, onSave: p }));
|
|
3003
|
+
}, Xt = [
|
|
3004
|
+
{
|
|
3005
|
+
textKey: s.cellPropertiesLeftTop,
|
|
3006
|
+
text: u[s.cellPropertiesLeftTop],
|
|
3007
|
+
icon: "table-align-top-left",
|
|
3008
|
+
svgIcon: jc,
|
|
3009
|
+
value: { x: "left", y: "top" }
|
|
3010
|
+
},
|
|
3011
|
+
{
|
|
3012
|
+
textKey: s.cellPropertiesCenterTop,
|
|
3013
|
+
text: u[s.cellPropertiesCenterTop],
|
|
3014
|
+
icon: "table-align-top-center",
|
|
3015
|
+
svgIcon: Gc,
|
|
3016
|
+
value: { x: "center", y: "top" }
|
|
3017
|
+
},
|
|
3018
|
+
{
|
|
3019
|
+
textKey: s.cellPropertiesRightTop,
|
|
3020
|
+
text: u[s.cellPropertiesRightTop],
|
|
3021
|
+
icon: "table-align-top-right",
|
|
3022
|
+
svgIcon: qc,
|
|
3023
|
+
value: { x: "right", y: "top" }
|
|
3024
|
+
},
|
|
3025
|
+
{
|
|
3026
|
+
textKey: s.cellPropertiesLeftMiddle,
|
|
3027
|
+
text: u[s.cellPropertiesLeftMiddle],
|
|
3028
|
+
icon: "table-align-middle-left",
|
|
3029
|
+
svgIcon: ql,
|
|
3030
|
+
value: { x: "left", y: "middle" }
|
|
3031
|
+
},
|
|
3032
|
+
{
|
|
3033
|
+
textKey: s.cellPropertiesCenterMiddle,
|
|
3034
|
+
text: u[s.cellPropertiesCenterMiddle],
|
|
3035
|
+
icon: "table-align-middle-center",
|
|
3036
|
+
svgIcon: Jl,
|
|
3037
|
+
value: { x: "center", y: "middle" }
|
|
3038
|
+
},
|
|
3039
|
+
{
|
|
3040
|
+
textKey: s.cellPropertiesRightMiddle,
|
|
3041
|
+
text: u[s.cellPropertiesRightMiddle],
|
|
3042
|
+
icon: "table-align-middle-right",
|
|
3043
|
+
svgIcon: Ql,
|
|
3044
|
+
value: { x: "right", y: "middle" }
|
|
3045
|
+
},
|
|
3046
|
+
{
|
|
3047
|
+
textKey: s.cellPropertiesLeftBottom,
|
|
3048
|
+
text: u[s.cellPropertiesLeftBottom],
|
|
3049
|
+
icon: "table-align-bottom-left",
|
|
3050
|
+
svgIcon: Jc,
|
|
3051
|
+
value: { x: "left", y: "bottom" }
|
|
3052
|
+
},
|
|
3053
|
+
{
|
|
3054
|
+
textKey: s.cellPropertiesCenterBottom,
|
|
3055
|
+
text: u[s.cellPropertiesCenterBottom],
|
|
3056
|
+
icon: "table-align-bottom-center",
|
|
3057
|
+
svgIcon: Qc,
|
|
3058
|
+
value: { x: "center", y: "bottom" }
|
|
3059
|
+
},
|
|
3060
|
+
{
|
|
3061
|
+
textKey: s.cellPropertiesRightBottom,
|
|
3062
|
+
text: u[s.cellPropertiesRightBottom],
|
|
3063
|
+
icon: "table-align-bottom-right",
|
|
3064
|
+
svgIcon: Xc,
|
|
3065
|
+
value: { x: "right", y: "bottom" }
|
|
3066
|
+
},
|
|
3067
|
+
{
|
|
3068
|
+
textKey: s.cellPropertiesNoAlignment,
|
|
3069
|
+
text: u[s.cellPropertiesNoAlignment],
|
|
3070
|
+
icon: "align-remove",
|
|
3071
|
+
svgIcon: Xl,
|
|
3072
|
+
value: { x: "", y: "" }
|
|
3073
|
+
}
|
|
3074
|
+
], Yt = [
|
|
3075
|
+
{
|
|
3076
|
+
textKey: s.cellPropertiesWrap,
|
|
3077
|
+
text: u[s.cellPropertiesWrap],
|
|
3078
|
+
value: "",
|
|
3079
|
+
icon: "text-wrap",
|
|
3080
|
+
svgIcon: Yc
|
|
3081
|
+
},
|
|
3082
|
+
{
|
|
3083
|
+
textKey: s.cellPropertiesFitToCell,
|
|
3084
|
+
text: u[s.cellPropertiesFitToCell],
|
|
3085
|
+
value: "nowrap",
|
|
3086
|
+
icon: "parameter-string",
|
|
3087
|
+
svgIcon: Zc
|
|
3088
|
+
}
|
|
3089
|
+
], Re = (t, e) => e ? /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(Yl, null, /* @__PURE__ */ l.createElement(Ue, { icon: e.svgIcon, name: e.icon })), t) : t, Ae = (t, e) => {
|
|
3090
|
+
const o = /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(Yl, null, /* @__PURE__ */ l.createElement(Ue, { icon: e.dataItem.svgIcon, name: e.dataItem.icon })), t.props.children);
|
|
3091
|
+
return l.cloneElement(t, t.props, o);
|
|
3092
|
+
}, tp = (t) => {
|
|
3093
|
+
const e = l.useMemo(() => Jd(t.view.state), [t.view]), o = te(), r = l.useRef(null), n = e.applyToAll, a = l.useRef(null), i = e.cellWidth, c = l.useRef(null);
|
|
3094
|
+
e.widthUnit && !me.includes(e.widthUnit) && me.push(e.widthUnit);
|
|
3095
|
+
const d = e.widthUnit || "", p = l.useRef(null), m = e.cellHeight, g = l.useRef(null);
|
|
3096
|
+
e.heightUnit && !me.includes(e.heightUnit) && me.push(e.heightUnit);
|
|
3097
|
+
const k = e.heightUnit || "", h = l.useRef(null), f = Xt.find((C) => C.value.x !== void 0 && e.alignment && C.value.x === e.alignment.x && C.value.y === e.alignment.y) || null, y = l.useRef(null), w = Yt.find((C) => C.value === e.textControl), S = l.useRef(null), I = e.backgroundColor, L = l.useRef(null), E = e.cellPadding, W = l.useRef(null), U = e.borderWidth, K = l.useRef(null), O = e.borderColor, $ = l.useRef(null), _ = Ye.find((C) => C.value === e.borderStyle), j = l.useRef(null), le = e.id, Y = l.useRef(null), ue = e.className, ge = l.useCallback(() => {
|
|
3098
|
+
var G, ne, v, x, N, H, Z, se, ie, ce, de, fe, be, ke, ve, ye, Ce, we, xe, Pe;
|
|
3099
|
+
const C = {
|
|
3100
|
+
applyToAll: !!((ne = (G = r.current) == null ? void 0 : G.element) != null && ne.checked),
|
|
3101
|
+
cellWidth: ((v = a.current) == null ? void 0 : v.value) || null,
|
|
3102
|
+
widthUnit: ((x = c.current) == null ? void 0 : x.value) || "",
|
|
3103
|
+
cellHeight: ((N = p.current) == null ? void 0 : N.value) || null,
|
|
3104
|
+
heightUnit: ((H = g.current) == null ? void 0 : H.value) || "",
|
|
3105
|
+
alignment: (se = (Z = h.current) == null ? void 0 : Z.value) == null ? void 0 : se.value,
|
|
3106
|
+
textControl: (ce = (ie = y.current) == null ? void 0 : ie.value) == null ? void 0 : ce.value,
|
|
3107
|
+
backgroundColor: (de = S.current) == null ? void 0 : de.value,
|
|
3108
|
+
cellPadding: typeof ((fe = L.current) == null ? void 0 : fe.value) == "number" ? (be = L.current) == null ? void 0 : be.value : null,
|
|
3109
|
+
borderWidth: typeof ((ke = W.current) == null ? void 0 : ke.value) == "number" ? (ve = W.current) == null ? void 0 : ve.value : null,
|
|
3110
|
+
borderColor: (ye = K.current) == null ? void 0 : ye.value,
|
|
3111
|
+
borderStyle: ((we = (Ce = $.current) == null ? void 0 : Ce.value) == null ? void 0 : we.value) || null,
|
|
3112
|
+
id: String(((xe = j.current) == null ? void 0 : xe.value) || ""),
|
|
3113
|
+
className: String(((Pe = Y.current) == null ? void 0 : Pe.value) || "")
|
|
3114
|
+
};
|
|
3115
|
+
t.onSave.call(void 0, C);
|
|
3116
|
+
}, [t.onSave]), oe = /* @__PURE__ */ l.createElement("div", { className: "k-form k-form-md" }, /* @__PURE__ */ l.createElement("fieldset", { className: "k-form-fieldset" }, /* @__PURE__ */ l.createElement("div", { className: "k-form-layout k-d-grid k-grid-cols-4 k-gap-x-4" }, /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-full" }, /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement("span", { className: "k-checkbox-wrap" }, /* @__PURE__ */ l.createElement(Ie, { ref: r, defaultChecked: n })), /* @__PURE__ */ l.createElement(
|
|
3117
|
+
"label",
|
|
3118
|
+
{
|
|
3119
|
+
className: "k-checkbox-label"
|
|
3120
|
+
},
|
|
3121
|
+
o.toLanguageString(s.cellPropertiesApplyToAllCells, u[s.cellPropertiesApplyToAllCells])
|
|
3122
|
+
))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-1" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.cellPropertiesWidth, u[s.cellPropertiesWidth])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3123
|
+
z,
|
|
3124
|
+
{
|
|
3125
|
+
ref: a,
|
|
3126
|
+
defaultValue: i,
|
|
3127
|
+
min: 0,
|
|
3128
|
+
placeholder: o.toLanguageString(s.sizeAuto, u[s.sizeAuto])
|
|
3129
|
+
}
|
|
3130
|
+
), /* @__PURE__ */ l.createElement("div", { className: "k-form-hint" }, o.toLanguageString(s.cellPropertiesApplyToColumn, u[s.cellPropertiesApplyToColumn])))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-1" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, " "), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(Qe, { ref: c, defaultValue: d, data: me, popupSettings: F }))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-1" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.cellPropertiesHeight, u[s.cellPropertiesHeight])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3131
|
+
z,
|
|
3132
|
+
{
|
|
3133
|
+
ref: p,
|
|
3134
|
+
defaultValue: m,
|
|
3135
|
+
min: 0,
|
|
3136
|
+
placeholder: o.toLanguageString(s.sizeAuto, u[s.sizeAuto])
|
|
3137
|
+
}
|
|
3138
|
+
), /* @__PURE__ */ l.createElement("div", { className: "k-form-hint" }, o.toLanguageString(s.cellPropertiesApplyToRow, u[s.cellPropertiesApplyToRow])))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-1" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, " "), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(Qe, { ref: g, defaultValue: k, data: me, popupSettings: F }))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-2" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.cellPropertiesAlignment, u[s.cellPropertiesAlignment])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3139
|
+
Q,
|
|
3140
|
+
{
|
|
3141
|
+
ref: h,
|
|
3142
|
+
defaultValue: f,
|
|
3143
|
+
data: Xt.map((C) => ({ ...C, text: o.toLanguageString(C.textKey, C.text) })),
|
|
3144
|
+
textField: "text",
|
|
3145
|
+
dataItemKey: "text",
|
|
3146
|
+
popupSettings: F,
|
|
3147
|
+
valueRender: Re,
|
|
3148
|
+
itemRender: Ae
|
|
3149
|
+
}
|
|
3150
|
+
))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-2" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.cellPropertiesTextControl, u[s.cellPropertiesTextControl])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3151
|
+
Q,
|
|
3152
|
+
{
|
|
3153
|
+
ref: y,
|
|
3154
|
+
defaultValue: w,
|
|
3155
|
+
data: Yt.map((C) => ({ ...C, text: o.toLanguageString(C.textKey, C.text) })),
|
|
3156
|
+
textField: "text",
|
|
3157
|
+
dataItemKey: "value",
|
|
3158
|
+
popupSettings: F,
|
|
3159
|
+
valueRender: Re,
|
|
3160
|
+
itemRender: Ae
|
|
3161
|
+
}
|
|
3162
|
+
))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-2" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.cellPropertiesCellPadding, u[s.cellPropertiesCellPadding])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(z, { ref: L, defaultValue: E, min: 0 }))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-2" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.cellPropertiesBackground, u[s.cellPropertiesBackground])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(Fe, { ref: S, defaultValue: I }))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-1" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.cellPropertiesBorderWidth, u[s.cellPropertiesBorderWidth])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(z, { ref: W, defaultValue: U, min: 0 }))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-1" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.cellPropertiesBorderColor, u[s.cellPropertiesBorderColor])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(Fe, { ref: K, defaultValue: O }))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-2" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.cellPropertiesBorderStyle, u[s.cellPropertiesBorderStyle])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3163
|
+
Q,
|
|
3164
|
+
{
|
|
3165
|
+
ref: $,
|
|
3166
|
+
defaultValue: _,
|
|
3167
|
+
popupSettings: F,
|
|
3168
|
+
data: Ye,
|
|
3169
|
+
textField: "text",
|
|
3170
|
+
dataItemKey: "value"
|
|
3171
|
+
}
|
|
3172
|
+
))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-full" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.cellPropertiesId, u[s.cellPropertiesId])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(He, { ref: j, defaultValue: le }))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-full" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.cellPropertiesCssClass, u[s.cellPropertiesCssClass])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(He, { ref: Y, defaultValue: ue })))))), he = [/* @__PURE__ */ l.createElement(T, { themeColor: "primary", key: "save", onClick: ge }, o.toLanguageString(s.cellPropertiesSave, u[s.cellPropertiesSave])), /* @__PURE__ */ l.createElement(T, { onClick: t.onCancel, key: "cancel" }, o.toLanguageString(s.cellPropertiesCancel, u[s.cellPropertiesCancel]))];
|
|
3173
|
+
return /* @__PURE__ */ l.createElement(
|
|
3174
|
+
De,
|
|
3175
|
+
{
|
|
3176
|
+
className: "k-editor-window k-editor-table-wizard-window",
|
|
3177
|
+
title: o.toLanguageString(s.cellProperties, u[s.cellProperties]),
|
|
3178
|
+
onClose: t.onCancel,
|
|
3179
|
+
key: "dialog",
|
|
3180
|
+
style: { userSelect: "none" },
|
|
3181
|
+
width: 408,
|
|
3182
|
+
height: 587,
|
|
3183
|
+
modal: !0,
|
|
3184
|
+
minimizeButton: () => null,
|
|
3185
|
+
maximizeButton: () => null,
|
|
3186
|
+
resizable: !1
|
|
3187
|
+
},
|
|
3188
|
+
oe,
|
|
3189
|
+
/* @__PURE__ */ l.createElement(We, { layout: "start" }, ...he)
|
|
3190
|
+
);
|
|
3191
|
+
}, wt = {
|
|
3192
|
+
rows: 0,
|
|
3193
|
+
columns: 0,
|
|
3194
|
+
width: null,
|
|
3195
|
+
widthUnit: "",
|
|
3196
|
+
height: null,
|
|
3197
|
+
heightUnit: "",
|
|
3198
|
+
position: null,
|
|
3199
|
+
textAlign: "",
|
|
3200
|
+
cellPadding: null,
|
|
3201
|
+
cellSpacing: null,
|
|
3202
|
+
backgroundColor: void 0,
|
|
3203
|
+
borderWidth: null,
|
|
3204
|
+
borderColor: void 0,
|
|
3205
|
+
borderStyle: null,
|
|
3206
|
+
collapseBorders: !1,
|
|
3207
|
+
id: "",
|
|
3208
|
+
className: "",
|
|
3209
|
+
caption: "",
|
|
3210
|
+
captionAlignment: null,
|
|
3211
|
+
captionPosition: null,
|
|
3212
|
+
headerRows: 0,
|
|
3213
|
+
headerColumns: 0,
|
|
3214
|
+
associateHeaders: "none"
|
|
3215
|
+
}, tt = {
|
|
3216
|
+
left: { "margin-left": "", "margin-right": "auto" },
|
|
3217
|
+
center: { "margin-left": "auto", "margin-right": "auto" },
|
|
3218
|
+
right: { "margin-left": "auto", "margin-right": "" },
|
|
3219
|
+
"": {}
|
|
3220
|
+
}, ua = (t) => {
|
|
3221
|
+
const e = [];
|
|
3222
|
+
for (let o = 0; o < t.height; o++) {
|
|
3223
|
+
const r = o * t.width, n = r + t.width;
|
|
3224
|
+
e.push(t.map.slice(r, n));
|
|
3225
|
+
}
|
|
3226
|
+
return e;
|
|
3227
|
+
}, lp = (t, e) => {
|
|
3228
|
+
let o = 0, r = 0;
|
|
3229
|
+
const n = ua(e);
|
|
3230
|
+
n.forEach((a) => {
|
|
3231
|
+
let i = !0;
|
|
3232
|
+
a.forEach((c) => {
|
|
3233
|
+
const d = t.nodeAt(c);
|
|
3234
|
+
d && d.type.name !== "table_header" && (i = !1);
|
|
3235
|
+
}), i && o++;
|
|
3236
|
+
});
|
|
3237
|
+
for (let a = 0; a < e.width; a++) {
|
|
3238
|
+
let i = !0;
|
|
3239
|
+
for (let c = 0; c < e.height; c++) {
|
|
3240
|
+
const d = n[c] && n[c][a], p = typeof d == "number" && t.nodeAt(d);
|
|
3241
|
+
p && p.type.name !== "table_header" && (i = !1);
|
|
3242
|
+
}
|
|
3243
|
+
i && r++;
|
|
3244
|
+
}
|
|
3245
|
+
return { rows: o, columns: r };
|
|
3246
|
+
}, op = (t) => {
|
|
3247
|
+
const e = /* @__PURE__ */ new Set();
|
|
3248
|
+
return t.content.forEach((o) => {
|
|
3249
|
+
o.content.forEach((r) => {
|
|
3250
|
+
e.add(ae(r.attrs.style).padding || "");
|
|
3251
|
+
});
|
|
3252
|
+
}), e.size === 1 ? Array.from(e)[0] : "";
|
|
3253
|
+
}, np = (t) => {
|
|
3254
|
+
let e = !0, o = !0;
|
|
3255
|
+
return t.content.forEach((r) => {
|
|
3256
|
+
r.content.forEach((n) => {
|
|
3257
|
+
let a = n.type.name === "table_header", i = n.type.name === "table_cell";
|
|
3258
|
+
a && !n.attrs.scope && (e = !1), (a && !n.attrs.id || i && !n.attrs.headers) && (o = !1);
|
|
3259
|
+
});
|
|
3260
|
+
}), e ? "scope" : o ? "id" : "none";
|
|
3261
|
+
}, rp = (t) => {
|
|
3262
|
+
var h, f, y;
|
|
3263
|
+
const e = ot(t), o = t.selection.$from, r = e.length ? V(o, (w) => w.type.spec.tableRole === "table") : null;
|
|
3264
|
+
if (!r)
|
|
3265
|
+
return wt;
|
|
3266
|
+
const n = V(o, (w) => w.type.name === "table_wrapper");
|
|
3267
|
+
let a = "", i = {}, c = {};
|
|
3268
|
+
n && (c = ae(n.node.attrs.style), n.node.content.forEach((w) => {
|
|
3269
|
+
if (w.type.name === "table_caption_external") {
|
|
3270
|
+
const S = ps(w);
|
|
3271
|
+
a = ms(S), a = a === "<img>" ? "" : a, i = ae(w.attrs.style);
|
|
3272
|
+
}
|
|
3273
|
+
}));
|
|
3274
|
+
const d = ae(((h = r.node.attrs) == null ? void 0 : h.style) || ""), p = Le.get(r.node), m = c["margin-left"] === "auto" && c["margin-right"] === "auto" ? "center" : c["margin-right"] === "auto" ? "left" : c["margin-left"] === "auto" ? "right" : null, g = lp(r.node, p), k = op(r.node);
|
|
3275
|
+
return {
|
|
3276
|
+
...wt,
|
|
3277
|
+
columns: p.width,
|
|
3278
|
+
rows: p.height,
|
|
3279
|
+
...at(r.node, "width"),
|
|
3280
|
+
...n && /%/.test(c.width || "") ? at(n.node, "width") : {},
|
|
3281
|
+
...at(r.node, "height"),
|
|
3282
|
+
textAlign: d["text-align"] || "",
|
|
3283
|
+
position: m || null,
|
|
3284
|
+
cellPadding: k ? parseFloat(k) : null,
|
|
3285
|
+
cellSpacing: d["border-spacing"] ? parseFloat(d["border-spacing"]) : null,
|
|
3286
|
+
backgroundColor: d["background-color"],
|
|
3287
|
+
borderWidth: d["border-width"] ? parseFloat(d["border-width"]) : null,
|
|
3288
|
+
borderColor: d["border-color"],
|
|
3289
|
+
borderStyle: d["border-style"] || null,
|
|
3290
|
+
collapseBorders: d["border-collapse"] === "collapse",
|
|
3291
|
+
caption: a || void 0,
|
|
3292
|
+
captionAlignment: i["text-align"] || "",
|
|
3293
|
+
captionPosition: i["caption-side"] || null,
|
|
3294
|
+
headerRows: g.rows,
|
|
3295
|
+
headerColumns: g.columns,
|
|
3296
|
+
associateHeaders: g.rows || g.columns ? np(r.node) : "none",
|
|
3297
|
+
id: ((f = r.node.attrs) == null ? void 0 : f.id) || "",
|
|
3298
|
+
className: ((y = r.node.attrs) == null ? void 0 : y.class) || ""
|
|
3299
|
+
};
|
|
3300
|
+
}, ga = (t) => {
|
|
3301
|
+
const o = t.lastChild.lastChild;
|
|
3302
|
+
return { node: o, pos: t.content.size - o.nodeSize };
|
|
3303
|
+
}, Zt = (t, e, o, r, n) => {
|
|
3304
|
+
const a = ga(o), i = e + a.pos;
|
|
3305
|
+
if (!t.doc.nodeAt(i))
|
|
3306
|
+
return t;
|
|
3307
|
+
const d = t.doc.resolve(i), p = new Dt(d, d), m = t.tr.setSelection(p);
|
|
3308
|
+
let g = t.apply(m);
|
|
3309
|
+
for (let k = 0; k < r; k++)
|
|
3310
|
+
n(g, (h) => {
|
|
3311
|
+
g = g.apply(h);
|
|
3312
|
+
});
|
|
3313
|
+
return g;
|
|
3314
|
+
}, el = (t, e, o, r) => {
|
|
3315
|
+
let n = t;
|
|
3316
|
+
for (let a = 0; a < o; a++) {
|
|
3317
|
+
const i = n.doc.nodeAt(e);
|
|
3318
|
+
if (i) {
|
|
3319
|
+
const c = ga(i), d = e + c.pos, p = n.doc.resolve(d), m = new Dt(p, p), g = n.tr.setSelection(m);
|
|
3320
|
+
n = n.apply(g), r(n, (k) => {
|
|
3321
|
+
n = n.apply(k);
|
|
3322
|
+
});
|
|
3323
|
+
}
|
|
3324
|
+
}
|
|
3325
|
+
return n;
|
|
3326
|
+
}, ap = (t, e, o, r) => {
|
|
3327
|
+
let n = t, a = n.doc.nodeAt(e);
|
|
3328
|
+
if (!a)
|
|
3329
|
+
return n;
|
|
3330
|
+
let i = Le.get(a);
|
|
3331
|
+
return i.width === r && i.height === o || (r > i.width ? n = Zt(n, e, a, r - i.width, Lt) : r < i.width && (n = el(n, e, i.width - r, ca)), a = n.doc.nodeAt(e), !a) || (i = Le.get(a), o > i.height ? n = Zt(n, e, a, o - i.height, Tt) : o < i.height && (n = el(n, e, i.height - o, da))), n;
|
|
3332
|
+
}, sp = (t, e, o) => {
|
|
3333
|
+
const r = t.doc.nodeAt(o);
|
|
3334
|
+
if (!r)
|
|
3335
|
+
return t;
|
|
3336
|
+
let n = { ...r.attrs };
|
|
3337
|
+
const a = e.width !== null && (e.widthUnit !== "%" || !e.caption && !e.position);
|
|
3338
|
+
n = A(n, "width", a ? e.width + e.widthUnit : ""), n = A(n, "height", e.height !== null ? e.height + e.heightUnit : ""), n = A(n, "text-align", e.textAlign || ""), n = A(n, "background-color", e.backgroundColor || ""), n = A(n, "border-width", e.borderWidth ? e.borderWidth + "px" : ""), n = A(n, "border-style", e.borderStyle || ""), n = A(n, "border-color", e.borderColor || ""), n = A(n, "border-spacing", e.cellSpacing !== null ? e.cellSpacing + "px" : ""), e.cellSpacing !== null ? n = A(n, "border-collapse", "unset") : n = A(n, "border-collapse", e.collapseBorders ? "collapse" : "");
|
|
3339
|
+
const i = tt[e.position || ""] || {};
|
|
3340
|
+
Object.keys(i).forEach((d) => {
|
|
3341
|
+
n = A(n, d, i[d]);
|
|
3342
|
+
}), n.id = e.id || null, n.class = e.className || null;
|
|
3343
|
+
const c = t.tr.setNodeMarkup(o, null, n);
|
|
3344
|
+
return t = t.apply(c), t;
|
|
3345
|
+
}, tl = (t, e, o, r, n) => {
|
|
3346
|
+
if (e.type.name !== r.name || Object.keys(n).length > 0) {
|
|
3347
|
+
const a = t.tr.setNodeMarkup(o, r, { ...e.attrs, ...n });
|
|
3348
|
+
return t.apply(a);
|
|
3349
|
+
}
|
|
3350
|
+
return t;
|
|
3351
|
+
}, ip = (t, e) => {
|
|
3352
|
+
/^cell-[0-9]+-[0-9]+$/.test(t.attrs.id || "") && (e.id = null);
|
|
3353
|
+
}, cp = (t, e, o) => {
|
|
3354
|
+
const r = t.doc.nodeAt(o), n = r && Le.get(r);
|
|
3355
|
+
if (!r || !n)
|
|
3356
|
+
return t;
|
|
3357
|
+
const a = ua(n);
|
|
3358
|
+
let i = t;
|
|
3359
|
+
const { table_header: c, table_cell: d } = t.schema.nodes, p = String((/* @__PURE__ */ new Date()).getTime()), m = [], g = (h, f) => {
|
|
3360
|
+
const y = `cell-${h}${f}-${p}`;
|
|
3361
|
+
return m[h] || m.push([]), m[h][f] || m[h].push([]), m[h][f] = y, y;
|
|
3362
|
+
}, k = (h, f, y, w) => {
|
|
3363
|
+
const S = [];
|
|
3364
|
+
if (w)
|
|
3365
|
+
for (let I = 0; I < h; I++)
|
|
3366
|
+
m[I] && m[I][f] && S.push(m[I][f]);
|
|
3367
|
+
if (y)
|
|
3368
|
+
for (let I = 0; I < f; I++)
|
|
3369
|
+
m[h] && m[h][I] && S.push(m[h][I]);
|
|
3370
|
+
return S.join(" ");
|
|
3371
|
+
};
|
|
3372
|
+
return a.forEach((h, f) => {
|
|
3373
|
+
h.forEach((y, w) => {
|
|
3374
|
+
const S = r.nodeAt(y);
|
|
3375
|
+
if (S) {
|
|
3376
|
+
const I = w < e.headerColumns, L = f < e.headerRows, E = { ...S.attrs };
|
|
3377
|
+
ip(S, E), E.headers = null, E.scope = null, L || I ? (e.associateHeaders === "scope" && (E.scope = L ? "col" : "row"), e.associateHeaders === "id" && (E.id = g(f, w), (w > 0 || f > 0) && (E.headers = k(f, w, I, L) || null)), i = tl(i, S, o + y + 1, c, E)) : (e.associateHeaders === "id" && (E.headers = k(f, w, e.headerColumns > 0, e.headerRows > 0) || null), i = tl(i, S, o + y + 1, d, E));
|
|
3378
|
+
}
|
|
3379
|
+
});
|
|
3380
|
+
}), i;
|
|
3381
|
+
}, dp = (t, e, o, r) => {
|
|
3382
|
+
let n = { ...e.attrs };
|
|
3383
|
+
return n = A(n, "margin-left", ""), n = A(n, "margin-right", ""), Object.keys(r || {}).forEach((a) => {
|
|
3384
|
+
n = A(n, a, (r || {})[a] || "");
|
|
3385
|
+
}), t.apply(t.tr.setNodeMarkup(o, null, n));
|
|
3386
|
+
}, ha = (t, e) => Cl("<p>" + t + "</p>", e).content.firstChild.content, fa = (t, e) => {
|
|
3387
|
+
if (!t.caption)
|
|
3388
|
+
return;
|
|
3389
|
+
let o = { caption: "", style: "display: table-caption" };
|
|
3390
|
+
t.captionAlignment && (o = A(o, "text-align", t.captionAlignment)), t.captionPosition && (o = A(o, "caption-side", t.captionPosition));
|
|
3391
|
+
const r = ha(t.caption, e);
|
|
3392
|
+
return r && e.nodes.table_caption_external.createAndFill(o, r) || void 0;
|
|
3393
|
+
}, ba = (t) => t.firstChild && t.firstChild.type.name === "table_caption_external", pp = (t, e, o, r) => {
|
|
3394
|
+
let n = t, a;
|
|
3395
|
+
const i = o + 2, c = o + 1, d = n.schema;
|
|
3396
|
+
if (ba(e))
|
|
3397
|
+
if (a = e.firstChild, r.caption) {
|
|
3398
|
+
const p = ha(r.caption, d);
|
|
3399
|
+
if (n = n.apply(
|
|
3400
|
+
n.tr.replaceWith(i, i + a.content.size, p)
|
|
3401
|
+
), a = n.doc.nodeAt(c), a) {
|
|
3402
|
+
let m = { ...a.attrs };
|
|
3403
|
+
m = A(m, "text-align", r.captionAlignment || ""), m = A(m, "caption-side", r.captionPosition || ""), n = n.apply(n.tr.setNodeAttribute(c, "style", m.style));
|
|
3404
|
+
}
|
|
3405
|
+
} else
|
|
3406
|
+
n = n.apply(n.tr.deleteRange(i, i + a.content.size));
|
|
3407
|
+
else
|
|
3408
|
+
a = fa(r, d), a && (n = n.apply(n.tr.replaceWith(c, c, a)));
|
|
3409
|
+
return n;
|
|
3410
|
+
}, mp = (t, e, o, r, n) => {
|
|
3411
|
+
let a = {
|
|
3412
|
+
state: t,
|
|
3413
|
+
pos: o
|
|
3414
|
+
};
|
|
3415
|
+
if (!r && (e.position || e.caption)) {
|
|
3416
|
+
let c = { table: "", style: "display: table" };
|
|
3417
|
+
const d = [], p = e.position, m = p && tt[p];
|
|
3418
|
+
m && Object.keys(m).forEach((f) => {
|
|
3419
|
+
c = A(c, f, m[f] || "");
|
|
3420
|
+
}), typeof e.width == "number" && e.widthUnit === "%" && (c = A(c, "width", e.width + e.widthUnit));
|
|
3421
|
+
const g = fa(e, t.schema);
|
|
3422
|
+
g && d.push(g);
|
|
3423
|
+
const k = t.doc.nodeAt(o);
|
|
3424
|
+
d.push(k);
|
|
3425
|
+
const h = t.schema.nodes.table_wrapper.createAndFill(c, d);
|
|
3426
|
+
if (h) {
|
|
3427
|
+
const f = t.tr.replaceWith(o, o + k.content.size, h);
|
|
3428
|
+
t = t.apply(f), a = { state: t, pos: o };
|
|
3429
|
+
}
|
|
3430
|
+
} else
|
|
3431
|
+
r && (e.position || e.caption || !e.caption && ba(r.node)) ? (t = dp(t, r.node, n, e.position && tt[e.position]), t = pp(t, r.node, n, e), a = { state: t, pos: n }) : r && !(e.position || e.caption) ? a = { state: t, node: r.node, pos: t.selection.$from.start(r.depth) - 1 } : a = { state: t, pos: o };
|
|
3432
|
+
const i = r && a.state.doc.nodeAt(n);
|
|
3433
|
+
if (i) {
|
|
3434
|
+
let c;
|
|
3435
|
+
typeof e.width == "number" && e.widthUnit === "%" ? c = A(i.attrs, "width", e.width + e.widthUnit) : e.widthUnit !== "%" && /%/.test(ae(i.attrs.style || "").width || "") && (c = A(i.attrs, "width", "")), c && (a.state = a.state.apply(a.state.tr.setNodeMarkup(n, null, c)));
|
|
3436
|
+
}
|
|
3437
|
+
return a;
|
|
3438
|
+
}, up = (t, e) => {
|
|
3439
|
+
const o = t.selection.$from;
|
|
3440
|
+
let r = V(o, (w) => w.type.spec.tableRole === "table");
|
|
3441
|
+
if (!r)
|
|
3442
|
+
return;
|
|
3443
|
+
const n = o.start(r.depth) - 1;
|
|
3444
|
+
let a = ap(t, n, e.rows, e.columns);
|
|
3445
|
+
if (!a)
|
|
3446
|
+
return;
|
|
3447
|
+
const i = a.tr;
|
|
3448
|
+
ma(a).forEach((w) => {
|
|
3449
|
+
let S = { ...w.node.attrs };
|
|
3450
|
+
S = A(S, "padding", typeof e.cellPadding == "number" ? e.cellPadding + "px" : ""), i.setNodeMarkup(w.pos, null, S);
|
|
3451
|
+
}), a = a.apply(i), a = sp(a, e, n), a = cp(a, e, n);
|
|
3452
|
+
const c = V(o, (w) => w.type.name === "table_wrapper"), d = o.start((c == null ? void 0 : c.depth) || 0) - 1;
|
|
3453
|
+
let p = mp(a, e, n, c, d);
|
|
3454
|
+
a = p.state;
|
|
3455
|
+
const m = p.pos, g = a.doc.nodeAt(p.pos);
|
|
3456
|
+
if (!g)
|
|
3457
|
+
return;
|
|
3458
|
+
const k = m + (c || r).node.content.size, h = t.tr.replaceWith(m, k, g), f = Gl.atEnd(g), y = Be.create(h.doc, m + f.to + 1);
|
|
3459
|
+
return h.setSelection(y), h;
|
|
3460
|
+
}, gp = (t) => {
|
|
3461
|
+
const { view: e, ...o } = t, r = te(), [n, a] = l.useState(!1), i = !!(e && V(e.state.selection.$from, (m) => m.type.spec.tableRole === "table")), c = l.useCallback(() => {
|
|
3462
|
+
a(!0);
|
|
3463
|
+
}, []), d = l.useCallback(() => {
|
|
3464
|
+
a(!1), e == null || e.focus();
|
|
3465
|
+
}, [e]), p = l.useCallback((m) => {
|
|
3466
|
+
if (e && m) {
|
|
3467
|
+
const g = up(e.state, m);
|
|
3468
|
+
g && e.dispatch(g);
|
|
3469
|
+
}
|
|
3470
|
+
d();
|
|
3471
|
+
}, [e, d]);
|
|
3472
|
+
return /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(
|
|
3473
|
+
T,
|
|
3474
|
+
{
|
|
3475
|
+
type: "button",
|
|
3476
|
+
title: r.toLanguageString(s.tableProperties, u[s.tableProperties]),
|
|
3477
|
+
icon: "table-properties",
|
|
3478
|
+
svgIcon: ed,
|
|
3479
|
+
onClick: c,
|
|
3480
|
+
disabled: !i,
|
|
3481
|
+
...M,
|
|
3482
|
+
...o
|
|
3483
|
+
}
|
|
3484
|
+
), n && /* @__PURE__ */ l.createElement(hp, { onClose: d, onSave: p, view: e }));
|
|
3485
|
+
}, $e = [
|
|
3486
|
+
{
|
|
3487
|
+
textKey: s.tablePropertiesAlignLeft,
|
|
3488
|
+
text: u[s.tablePropertiesAlignLeft],
|
|
3489
|
+
value: "left",
|
|
3490
|
+
icon: "table-align-middle-left",
|
|
3491
|
+
svgIcon: ql
|
|
3492
|
+
},
|
|
3493
|
+
{
|
|
3494
|
+
textKey: s.tablePropertiesAlignCenter,
|
|
3495
|
+
text: u[s.tablePropertiesAlignCenter],
|
|
3496
|
+
value: "center",
|
|
3497
|
+
icon: "table-align-middle-center",
|
|
3498
|
+
svgIcon: Jl
|
|
3499
|
+
},
|
|
3500
|
+
{
|
|
3501
|
+
textKey: s.tablePropertiesAlignRight,
|
|
3502
|
+
text: u[s.tablePropertiesAlignRight],
|
|
3503
|
+
value: "right",
|
|
3504
|
+
icon: "table-align-middle-right",
|
|
3505
|
+
svgIcon: Ql
|
|
3506
|
+
},
|
|
3507
|
+
{
|
|
3508
|
+
textKey: s.tablePropertiesNoAlignment,
|
|
3509
|
+
text: u[s.tablePropertiesNoAlignment],
|
|
3510
|
+
value: "",
|
|
3511
|
+
icon: "align-remove",
|
|
3512
|
+
svgIcon: Xl
|
|
3513
|
+
}
|
|
3514
|
+
], ll = [{
|
|
3515
|
+
textKey: s.tablePropertiesLeft,
|
|
3516
|
+
text: u[s.tablePropertiesLeft],
|
|
3517
|
+
value: "left",
|
|
3518
|
+
style: {},
|
|
3519
|
+
icon: "table-position-left",
|
|
3520
|
+
svgIcon: td
|
|
3521
|
+
}, {
|
|
3522
|
+
textKey: s.tablePropertiesCenter,
|
|
3523
|
+
text: u[s.tablePropertiesCenter],
|
|
3524
|
+
value: "center",
|
|
3525
|
+
style: {},
|
|
3526
|
+
icon: "table-position-center",
|
|
3527
|
+
svgIcon: ld
|
|
3528
|
+
}, {
|
|
3529
|
+
textKey: s.tablePropertiesRight,
|
|
3530
|
+
text: u[s.tablePropertiesRight],
|
|
3531
|
+
value: "right",
|
|
3532
|
+
style: {},
|
|
3533
|
+
icon: "table-position-right",
|
|
3534
|
+
svgIcon: od
|
|
3535
|
+
}].map((t) => ({ ...t, style: tt[t.value] })), ol = [{
|
|
3536
|
+
textKey: s.tablePropertiesTop,
|
|
3537
|
+
text: u[s.tablePropertiesTop],
|
|
3538
|
+
value: "top",
|
|
3539
|
+
icon: "position-top",
|
|
3540
|
+
svgIcon: nd
|
|
3541
|
+
}, {
|
|
3542
|
+
textKey: s.tablePropertiesBottom,
|
|
3543
|
+
text: u[s.tablePropertiesBottom],
|
|
3544
|
+
value: "bottom",
|
|
3545
|
+
icon: "position-bottom",
|
|
3546
|
+
svgIcon: rd
|
|
3547
|
+
}], nl = [
|
|
3548
|
+
{ textKey: s.tablePropertiesNone, text: u[s.tablePropertiesNone], value: "none" },
|
|
3549
|
+
{ textKey: s.tablePropertiesUsingScopeAttribute, text: u[s.tablePropertiesUsingScopeAttribute], value: "scope" },
|
|
3550
|
+
{ textKey: s.tablePropertiesUsingIdAttributes, text: u[s.tablePropertiesUsingIdAttributes], value: "id" }
|
|
3551
|
+
], hp = (t) => {
|
|
3552
|
+
const e = l.useMemo(() => {
|
|
3553
|
+
const C = t.view && t.view.state;
|
|
3554
|
+
return C ? rp(C) : wt;
|
|
3555
|
+
}, [t.view]), o = te(), [r, n] = l.useState(0), a = l.useCallback((C) => {
|
|
3556
|
+
n(C.selected);
|
|
3557
|
+
}, []), i = l.useRef(null), c = l.useRef(null), d = l.useRef(null), p = l.useRef(null), m = l.useRef(null), g = l.useRef(null), k = l.useRef(null), h = l.useRef(null), f = l.useRef(null), y = l.useRef(null), w = l.useRef(null), S = l.useRef(null), I = l.useRef(null), L = l.useRef(null), E = l.useRef(null), W = l.useRef(null), U = l.useRef(null), K = l.useRef(null), O = l.useRef(null), $ = l.useRef(null), _ = l.useRef(null), j = l.useRef(null), le = l.useRef(null), Y = l.useCallback(() => {
|
|
3558
|
+
var G, ne, v, x, N, H, Z, se, ie, ce, de, fe, be, ke, ve, ye, Ce, we, xe, Pe;
|
|
3559
|
+
const C = {
|
|
3560
|
+
rows: ((G = i.current) == null ? void 0 : G.value) || 0,
|
|
3561
|
+
columns: ((ne = c.current) == null ? void 0 : ne.value) || 0,
|
|
3562
|
+
width: d.current ? d.current.value : null,
|
|
3563
|
+
height: p.current ? p.current.value : null,
|
|
3564
|
+
cellSpacing: m.current ? m.current.value : null,
|
|
3565
|
+
cellPadding: g.current ? g.current.value : null,
|
|
3566
|
+
borderWidth: k.current ? k.current.value : null,
|
|
3567
|
+
widthUnit: ((v = h.current) == null ? void 0 : v.value) || "",
|
|
3568
|
+
heightUnit: ((x = f.current) == null ? void 0 : x.value) || "",
|
|
3569
|
+
position: ((H = (N = y.current) == null ? void 0 : N.value) == null ? void 0 : H.value) || null,
|
|
3570
|
+
textAlign: (Z = w.current) != null && Z.value ? w.current.value.value : null,
|
|
3571
|
+
borderStyle: (se = S.current) != null && se.value ? S.current.value.value : null,
|
|
3572
|
+
backgroundColor: (ie = I.current) == null ? void 0 : ie.value,
|
|
3573
|
+
borderColor: (ce = L.current) == null ? void 0 : ce.value,
|
|
3574
|
+
collapseBorders: !!((fe = (de = E.current) == null ? void 0 : de.element) != null && fe.checked),
|
|
3575
|
+
id: String(((be = W.current) == null ? void 0 : be.value) || ""),
|
|
3576
|
+
className: String(((ke = U.current) == null ? void 0 : ke.value) || ""),
|
|
3577
|
+
caption: String(((ve = K.current) == null ? void 0 : ve.value) || ""),
|
|
3578
|
+
headerRows: ((ye = O.current) == null ? void 0 : ye.value) || 0,
|
|
3579
|
+
headerColumns: ((Ce = $.current) == null ? void 0 : Ce.value) || 0,
|
|
3580
|
+
captionAlignment: (we = _.current) != null && we.value ? _.current.value.value : null,
|
|
3581
|
+
captionPosition: (xe = j.current) != null && xe.value ? j.current.value.value : null,
|
|
3582
|
+
associateHeaders: (Pe = le.current) != null && Pe.value ? le.current.value.value : "none"
|
|
3583
|
+
};
|
|
3584
|
+
t.onSave.call(void 0, C);
|
|
3585
|
+
}, [t.onSave]), ue = /* @__PURE__ */ l.createElement("div", { className: "k-form k-form-md" }, /* @__PURE__ */ l.createElement("fieldset", { className: "k-form-fieldset" }, /* @__PURE__ */ l.createElement("div", { className: "k-form-layout k-d-grid k-grid-cols-4 k-gap-x-4" }, /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-2" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesRows, u[s.tablePropertiesRows])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(z, { ref: i, defaultValue: e.rows, min: 1 }))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-2" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesColumns, u[s.tablePropertiesColumns])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(z, { ref: c, defaultValue: e.columns, min: 1 }))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-1" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesWidth, u[s.tablePropertiesWidth])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3586
|
+
z,
|
|
3587
|
+
{
|
|
3588
|
+
ref: d,
|
|
3589
|
+
defaultValue: e.width,
|
|
3590
|
+
min: 0,
|
|
3591
|
+
placeholder: o.toLanguageString(s.sizeAuto, u[s.sizeAuto])
|
|
3592
|
+
}
|
|
3593
|
+
))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-1" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, " "), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3594
|
+
Qe,
|
|
3595
|
+
{
|
|
3596
|
+
ref: h,
|
|
3597
|
+
defaultValue: e.widthUnit,
|
|
3598
|
+
data: me,
|
|
3599
|
+
popupSettings: F
|
|
3600
|
+
}
|
|
3601
|
+
))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-1" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesHeight, u[s.tablePropertiesHeight])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3602
|
+
z,
|
|
3603
|
+
{
|
|
3604
|
+
ref: p,
|
|
3605
|
+
defaultValue: e.height,
|
|
3606
|
+
min: 0,
|
|
3607
|
+
placeholder: o.toLanguageString(s.sizeAuto, u[s.sizeAuto])
|
|
3608
|
+
}
|
|
3609
|
+
))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-1" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, " "), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3610
|
+
Qe,
|
|
3611
|
+
{
|
|
3612
|
+
ref: f,
|
|
3613
|
+
defaultValue: e.heightUnit,
|
|
3614
|
+
data: me.filter((C) => C !== "%"),
|
|
3615
|
+
popupSettings: F
|
|
3616
|
+
}
|
|
3617
|
+
))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-2" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesPosition, u[s.tablePropertiesPosition])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3618
|
+
Q,
|
|
3619
|
+
{
|
|
3620
|
+
ref: y,
|
|
3621
|
+
defaultValue: ll.find((C) => C.value === e.position),
|
|
3622
|
+
popupSettings: F,
|
|
3623
|
+
data: ll.map((C) => ({ ...C, text: o.toLanguageString(C.textKey, C.text) })),
|
|
3624
|
+
textField: "text",
|
|
3625
|
+
dataItemKey: "value",
|
|
3626
|
+
valueRender: Re,
|
|
3627
|
+
itemRender: Ae
|
|
3628
|
+
}
|
|
3629
|
+
))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-2" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesAlignment, u[s.tablePropertiesAlignment])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3630
|
+
Q,
|
|
3631
|
+
{
|
|
3632
|
+
ref: w,
|
|
3633
|
+
defaultValue: $e.find((C) => C.value === e.textAlign),
|
|
3634
|
+
data: $e.map((C) => ({ ...C, text: o.toLanguageString(C.textKey, C.text) })),
|
|
3635
|
+
textField: "text",
|
|
3636
|
+
dataItemKey: "value",
|
|
3637
|
+
popupSettings: F,
|
|
3638
|
+
valueRender: Re,
|
|
3639
|
+
itemRender: Ae
|
|
3640
|
+
}
|
|
3641
|
+
))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-2" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesCellSpacing, u[s.tablePropertiesCellSpacing])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3642
|
+
z,
|
|
3643
|
+
{
|
|
3644
|
+
ref: m,
|
|
3645
|
+
defaultValue: e.cellSpacing,
|
|
3646
|
+
placeholder: o.toLanguageString(s.sizeAuto, u[s.sizeAuto]),
|
|
3647
|
+
min: 0
|
|
3648
|
+
}
|
|
3649
|
+
))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-2" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesCellPadding, u[s.tablePropertiesCellPadding])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3650
|
+
z,
|
|
3651
|
+
{
|
|
3652
|
+
ref: g,
|
|
3653
|
+
defaultValue: e.cellPadding,
|
|
3654
|
+
placeholder: o.toLanguageString(s.sizeAuto, u[s.sizeAuto]),
|
|
3655
|
+
min: 0
|
|
3656
|
+
}
|
|
3657
|
+
))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-full" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesTableBackground, u[s.tablePropertiesTableBackground])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(Fe, { ref: I, defaultValue: e.backgroundColor }))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-1" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesBorderWidth, u[s.tablePropertiesBorderWidth])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(z, { ref: k, defaultValue: e.borderWidth, min: 0 }))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-1" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesBorderColor, u[s.tablePropertiesBorderColor])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(Fe, { ref: L, defaultValue: e.borderColor }))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-2" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesBorderStyle, u[s.tablePropertiesBorderStyle])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3658
|
+
Q,
|
|
3659
|
+
{
|
|
3660
|
+
ref: S,
|
|
3661
|
+
defaultValue: Ye.find((C) => C.value === e.borderStyle),
|
|
3662
|
+
popupSettings: F,
|
|
3663
|
+
data: Ye.map((C) => ({ ...C, text: o.toLanguageString(C.textKey, C.text) })),
|
|
3664
|
+
textField: "text",
|
|
3665
|
+
dataItemKey: "value"
|
|
3666
|
+
}
|
|
3667
|
+
))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-full" }, /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3668
|
+
Ie,
|
|
3669
|
+
{
|
|
3670
|
+
ref: E,
|
|
3671
|
+
className: "k-checkbox-wrap",
|
|
3672
|
+
label: o.toLanguageString(s.tablePropertiesCollapseBorders, u[s.tablePropertiesCollapseBorders]),
|
|
3673
|
+
defaultChecked: e.collapseBorders
|
|
3674
|
+
}
|
|
3675
|
+
)))))), ge = /* @__PURE__ */ l.createElement("div", { className: "k-form k-form-md" }, /* @__PURE__ */ l.createElement("fieldset", { className: "k-form-fieldset" }, /* @__PURE__ */ l.createElement("div", { className: "k-form-layout k-d-grid" }, /* @__PURE__ */ l.createElement("div", { className: "k-form-field" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesId, u[s.tablePropertiesId])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(He, { ref: W, defaultValue: e.id }))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesCssClass, u[s.tablePropertiesCssClass])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(He, { ref: U, defaultValue: e.className }))), /* @__PURE__ */ l.createElement("fieldset", { className: "k-form-fieldset" }, /* @__PURE__ */ l.createElement("legend", { className: "k-form-legend" }, o.toLanguageString(s.tablePropertiesAccessibility, u[s.tablePropertiesAccessibility])), /* @__PURE__ */ l.createElement("div", { className: "k-d-grid k-grid-cols-4 k-gap-x-4" }, /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-full" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesCaption, u[s.tablePropertiesCaption])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(He, { ref: K, defaultValue: e.caption }))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-2" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesCaptionPosition, u[s.tablePropertiesCaptionPosition])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3676
|
+
Q,
|
|
3677
|
+
{
|
|
3678
|
+
ref: j,
|
|
3679
|
+
defaultValue: ol.find((C) => C.value === e.captionPosition),
|
|
3680
|
+
data: ol.map((C) => ({ ...C, text: o.toLanguageString(C.textKey, C.text) })),
|
|
3681
|
+
popupSettings: F,
|
|
3682
|
+
textField: "text",
|
|
3683
|
+
dataItemKey: "value",
|
|
3684
|
+
valueRender: Re,
|
|
3685
|
+
itemRender: Ae
|
|
3686
|
+
}
|
|
3687
|
+
))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-2" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesCaptionAlignment, u[s.tablePropertiesCaptionAlignment])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3688
|
+
Q,
|
|
3689
|
+
{
|
|
3690
|
+
ref: _,
|
|
3691
|
+
defaultValue: $e.find((C) => C.value === e.captionAlignment),
|
|
3692
|
+
data: $e.map((C) => ({ ...C, text: o.toLanguageString(C.textKey, C.text) })),
|
|
3693
|
+
popupSettings: F,
|
|
3694
|
+
textField: "text",
|
|
3695
|
+
dataItemKey: "value",
|
|
3696
|
+
valueRender: Re,
|
|
3697
|
+
itemRender: Ae
|
|
3698
|
+
}
|
|
3699
|
+
))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-1" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesHeaderRows, u[s.tablePropertiesHeaderRows])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(z, { ref: O, defaultValue: e.headerRows, min: 0 }))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-1" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesHeaderCols, u[s.tablePropertiesHeaderCols])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(z, { ref: $, defaultValue: e.headerColumns, min: 0 }))), /* @__PURE__ */ l.createElement("div", { className: "k-form-field k-col-span-2" }, /* @__PURE__ */ l.createElement("label", { className: "k-label k-form-label" }, o.toLanguageString(s.tablePropertiesAssociateHeaders, u[s.tablePropertiesAssociateHeaders])), /* @__PURE__ */ l.createElement("div", { className: "k-form-field-wrap" }, /* @__PURE__ */ l.createElement(
|
|
3700
|
+
Q,
|
|
3701
|
+
{
|
|
3702
|
+
ref: le,
|
|
3703
|
+
defaultValue: nl.find((C) => C.value === e.associateHeaders),
|
|
3704
|
+
data: nl.map((C) => ({ ...C, text: o.toLanguageString(C.textKey, C.text) })),
|
|
3705
|
+
popupSettings: F,
|
|
3706
|
+
textField: "text",
|
|
3707
|
+
dataItemKey: "value"
|
|
3708
|
+
}
|
|
3709
|
+
)))))))), oe = /* @__PURE__ */ l.createElement(Zl, { selected: r, onSelect: a, animation: !1, keepTabsMounted: !0 }, /* @__PURE__ */ l.createElement(Je, { title: o.toLanguageString(s.tablePropertiesGeneral, u[s.tablePropertiesGeneral]) }, ue), /* @__PURE__ */ l.createElement(Je, { title: o.toLanguageString(s.tablePropertiesAdvanced, u[s.tablePropertiesAdvanced]) }, ge)), he = [/* @__PURE__ */ l.createElement(T, { themeColor: "primary", key: "save", onClick: Y }, o.toLanguageString(s.tablePropertiesSave, u[s.tablePropertiesSave])), /* @__PURE__ */ l.createElement(T, { onClick: t.onClose, key: "cancel" }, o.toLanguageString(s.tablePropertiesCancel, u[s.tablePropertiesCancel]))];
|
|
3710
|
+
return /* @__PURE__ */ l.createElement(
|
|
3711
|
+
De,
|
|
3712
|
+
{
|
|
3713
|
+
className: "k-editor-window k-editor-table-wizard-window",
|
|
3714
|
+
title: o.toLanguageString(s.tableProperties, u[s.tableProperties]),
|
|
3715
|
+
onClose: t.onClose,
|
|
3716
|
+
key: "dialog",
|
|
3717
|
+
style: { userSelect: "none" },
|
|
3718
|
+
width: 480,
|
|
3719
|
+
height: 630,
|
|
3720
|
+
modal: !0,
|
|
3721
|
+
minimizeButton: () => null,
|
|
3722
|
+
maximizeButton: () => null,
|
|
3723
|
+
resizable: !1
|
|
3724
|
+
},
|
|
3725
|
+
oe,
|
|
3726
|
+
/* @__PURE__ */ l.createElement(We, { layout: "start" }, ...he)
|
|
3727
|
+
);
|
|
3728
|
+
};
|
|
3729
|
+
var rl;
|
|
3730
|
+
((t) => {
|
|
3731
|
+
function e(b) {
|
|
3732
|
+
return Ed(b);
|
|
3733
|
+
}
|
|
3734
|
+
t.createAlignTool = e;
|
|
3735
|
+
class o extends e(P.alignLeft) {
|
|
3736
|
+
}
|
|
3737
|
+
t.AlignLeft = o;
|
|
3738
|
+
class r extends e(P.alignRight) {
|
|
3739
|
+
}
|
|
3740
|
+
t.AlignRight = r;
|
|
3741
|
+
class n extends e(P.alignCenter) {
|
|
3742
|
+
}
|
|
3743
|
+
t.AlignCenter = n;
|
|
3744
|
+
class a extends e(P.alignJustify) {
|
|
3745
|
+
}
|
|
3746
|
+
t.AlignJustify = a;
|
|
3747
|
+
function i(b) {
|
|
3748
|
+
return mt.createInsertTableTool(b);
|
|
3749
|
+
}
|
|
3750
|
+
t.createInsertTableTool = i;
|
|
3751
|
+
class c extends i(P.insertTable) {
|
|
3752
|
+
}
|
|
3753
|
+
t.InsertTable = c;
|
|
3754
|
+
class d extends Ze.InsertTablePopup {
|
|
3755
|
+
}
|
|
3756
|
+
t.InsertTablePopup = d;
|
|
3757
|
+
function p(b) {
|
|
3758
|
+
return ut.createStyleDropDownList(b);
|
|
3759
|
+
}
|
|
3760
|
+
t.createStyleDropDownList = p;
|
|
3761
|
+
class m extends p(P.fontSize) {
|
|
3762
|
+
}
|
|
3763
|
+
t.FontSize = m;
|
|
3764
|
+
class g extends p(P.fontName) {
|
|
3765
|
+
}
|
|
3766
|
+
t.FontName = g, t.ForeColor = (b) => /* @__PURE__ */ l.createElement(Ot, { ...P.foreColor, ...b }), t.BackColor = (b) => /* @__PURE__ */ l.createElement(Ot, { ...P.backColor, ...b });
|
|
3767
|
+
function k(b) {
|
|
3768
|
+
return gt.createFormatBlockDropDownList(b);
|
|
3769
|
+
}
|
|
3770
|
+
t.createFormatBlockDropDownList = k;
|
|
3771
|
+
class h extends k(P.formatBlock) {
|
|
3772
|
+
}
|
|
3773
|
+
t.FormatBlock = h;
|
|
3774
|
+
function f(b) {
|
|
3775
|
+
return et.createUndoTool(b);
|
|
3776
|
+
}
|
|
3777
|
+
t.createUndoTool = f;
|
|
3778
|
+
function y(b) {
|
|
3779
|
+
return et.createRedoTool(b);
|
|
3780
|
+
}
|
|
3781
|
+
t.createRedoTool = y;
|
|
3782
|
+
class w extends f(P.undo) {
|
|
3783
|
+
}
|
|
3784
|
+
t.Undo = w;
|
|
3785
|
+
class S extends y(P.redo) {
|
|
3786
|
+
}
|
|
3787
|
+
t.Redo = S;
|
|
3788
|
+
function I(b) {
|
|
3789
|
+
return ht.createIndentTool(b);
|
|
3790
|
+
}
|
|
3791
|
+
t.createIndentTool = I;
|
|
3792
|
+
class L extends I(P.indent) {
|
|
3793
|
+
}
|
|
3794
|
+
t.Indent = L;
|
|
3795
|
+
function E(b) {
|
|
3796
|
+
return ft.createInlineFormatTool(b);
|
|
3797
|
+
}
|
|
3798
|
+
t.createInlineFormatTool = E;
|
|
3799
|
+
class W extends E(P.bold) {
|
|
3800
|
+
}
|
|
3801
|
+
t.Bold = W;
|
|
3802
|
+
class U extends E(P.italic) {
|
|
3803
|
+
}
|
|
3804
|
+
t.Italic = U;
|
|
3805
|
+
class K extends E(P.underline) {
|
|
3806
|
+
}
|
|
3807
|
+
t.Underline = K;
|
|
3808
|
+
class O extends E(P.strikethrough) {
|
|
3809
|
+
}
|
|
3810
|
+
t.Strikethrough = O;
|
|
3811
|
+
class $ extends E(P.subscript) {
|
|
3812
|
+
}
|
|
3813
|
+
t.Subscript = $;
|
|
3814
|
+
class _ extends E(P.superscript) {
|
|
3815
|
+
}
|
|
3816
|
+
t.Superscript = _;
|
|
3817
|
+
function j(b) {
|
|
3818
|
+
return Dd(b);
|
|
3819
|
+
}
|
|
3820
|
+
t.createInsertImageTool = j;
|
|
3821
|
+
class le extends j(P.image) {
|
|
3822
|
+
}
|
|
3823
|
+
t.InsertImage = le;
|
|
3824
|
+
function Y(b) {
|
|
3825
|
+
return bt.createLinkTool(b);
|
|
3826
|
+
}
|
|
3827
|
+
t.createLinkTool = Y;
|
|
3828
|
+
class ue extends Y(P.link) {
|
|
3829
|
+
}
|
|
3830
|
+
t.Link = ue;
|
|
3831
|
+
class ge extends Y(P.insertFile) {
|
|
3832
|
+
}
|
|
3833
|
+
t.InsertFile = ge;
|
|
3834
|
+
function oe(b) {
|
|
3835
|
+
return kt.createListTool(b);
|
|
3836
|
+
}
|
|
3837
|
+
t.createListTool = oe;
|
|
3838
|
+
class he extends oe(P.orderedList) {
|
|
3839
|
+
}
|
|
3840
|
+
t.OrderedList = he;
|
|
3841
|
+
class C extends oe(P.bulletList) {
|
|
3842
|
+
}
|
|
3843
|
+
t.UnorderedList = C, t.BulletedList = (b) => {
|
|
3844
|
+
const nt = [
|
|
3845
|
+
{ icon: "list-unordered", svgIcon: pt, text: "Disc", style: "disc" },
|
|
3846
|
+
{ icon: "list-unordered-outline", svgIcon: ad, text: "Circle", style: "circle" },
|
|
3847
|
+
{ icon: "list-unordered-square", svgIcon: sd, text: "Square", style: "square" }
|
|
3848
|
+
];
|
|
3849
|
+
return /* @__PURE__ */ l.createElement(
|
|
3850
|
+
qt,
|
|
3851
|
+
{
|
|
3852
|
+
listType: P.bulletList.listType,
|
|
3853
|
+
items: nt,
|
|
3854
|
+
icon: "list-unordered",
|
|
3855
|
+
svgIcon: pt,
|
|
3856
|
+
titleKey: P.bulletList.messages.title,
|
|
3857
|
+
...b
|
|
3858
|
+
}
|
|
3859
|
+
);
|
|
3860
|
+
}, t.NumberedList = (b) => {
|
|
3861
|
+
const nt = [
|
|
3862
|
+
{ icon: "list-ordered", svgIcon: dt, text: "Decimal" },
|
|
3863
|
+
// { icon: 'list-leading-zero', text: 'Decimal with leading zero', styleType: 'decimal-leading-zero' },
|
|
3864
|
+
{ icon: "list-roman-upper", svgIcon: id, text: "Upper roman", style: "upper-roman" },
|
|
3865
|
+
{ icon: "list-roman-lower", svgIcon: cd, text: "Lower roman", style: "lower-roman" },
|
|
3866
|
+
{ icon: "list-latin-big", svgIcon: dd, text: "Upper latin", style: "upper-latin" },
|
|
3867
|
+
{ icon: "list-latin-small", svgIcon: pd, text: "Lower latin", style: "lower-latin" }
|
|
3868
|
+
];
|
|
3869
|
+
return /* @__PURE__ */ l.createElement(
|
|
3870
|
+
qt,
|
|
3871
|
+
{
|
|
3872
|
+
listType: P.orderedList.listType,
|
|
3873
|
+
items: nt,
|
|
3874
|
+
icon: "list-ordered",
|
|
3875
|
+
svgIcon: dt,
|
|
3876
|
+
titleKey: P.orderedList.messages.title,
|
|
3877
|
+
...b
|
|
3878
|
+
}
|
|
3879
|
+
);
|
|
3880
|
+
}, t.TableCellProperties = ep, t.TableProperties = gp;
|
|
3881
|
+
function G(b) {
|
|
3882
|
+
return vt.createOutdentTool(b);
|
|
3883
|
+
}
|
|
3884
|
+
t.createOutdentTool = G;
|
|
3885
|
+
class ne extends G(P.outdent) {
|
|
3886
|
+
}
|
|
3887
|
+
t.Outdent = ne, t.Print = (b) => /* @__PURE__ */ l.createElement(Md, { ...b }), t.Pdf = (b) => /* @__PURE__ */ l.createElement(Fd, { ...b }), t.SelectAll = (b) => /* @__PURE__ */ l.createElement(Kd, { ...b }), t.CleanFormatting = (b) => /* @__PURE__ */ l.createElement(Vd, { ...b });
|
|
3888
|
+
function v(b) {
|
|
3889
|
+
return J.createAddRowBeforeTool(b);
|
|
3890
|
+
}
|
|
3891
|
+
t.createAddRowBeforeTool = v;
|
|
3892
|
+
function x(b) {
|
|
3893
|
+
return J.createAddRowAfterTool(b);
|
|
3894
|
+
}
|
|
3895
|
+
t.createAddRowAfterTool = x;
|
|
3896
|
+
function N(b) {
|
|
3897
|
+
return J.createAddColumnBeforeTool(b);
|
|
3898
|
+
}
|
|
3899
|
+
t.createAddColumnBeforeTool = N;
|
|
3900
|
+
function H(b) {
|
|
3901
|
+
return J.createAddColumnAfterTool(b);
|
|
3902
|
+
}
|
|
3903
|
+
t.createAddColumnAfterTool = H;
|
|
3904
|
+
function Z(b) {
|
|
3905
|
+
return J.createDeleteRowTool(b);
|
|
3906
|
+
}
|
|
3907
|
+
t.createDeleteRowTool = Z;
|
|
3908
|
+
function se(b) {
|
|
3909
|
+
return J.createDeleteColumnTool(b);
|
|
3910
|
+
}
|
|
3911
|
+
t.createDeleteColumnTool = se;
|
|
3912
|
+
function ie(b) {
|
|
3913
|
+
return J.createDeleteTableTool(b);
|
|
3914
|
+
}
|
|
3915
|
+
t.createDeleteTableTool = ie;
|
|
3916
|
+
function ce(b) {
|
|
3917
|
+
return J.createMergeCellsTool(b);
|
|
3918
|
+
}
|
|
3919
|
+
t.createMergeCellsTool = ce;
|
|
3920
|
+
function de(b) {
|
|
3921
|
+
return J.createSplitCellTool(b);
|
|
3922
|
+
}
|
|
3923
|
+
t.createSplitCellTool = de;
|
|
3924
|
+
class fe extends v(P.addRowBefore) {
|
|
3925
|
+
}
|
|
3926
|
+
t.AddRowBefore = fe;
|
|
3927
|
+
class be extends x(P.addRowAfter) {
|
|
3928
|
+
}
|
|
3929
|
+
t.AddRowAfter = be;
|
|
3930
|
+
class ke extends N(P.addColumnBefore) {
|
|
3931
|
+
}
|
|
3932
|
+
t.AddColumnBefore = ke;
|
|
3933
|
+
class ve extends H(P.addColumnAfter) {
|
|
3934
|
+
}
|
|
3935
|
+
t.AddColumnAfter = ve;
|
|
3936
|
+
class ye extends Z(P.deleteRow) {
|
|
3937
|
+
}
|
|
3938
|
+
t.DeleteRow = ye;
|
|
3939
|
+
class Ce extends se(P.deleteColumn) {
|
|
3940
|
+
}
|
|
3941
|
+
t.DeleteColumn = Ce;
|
|
3942
|
+
class we extends ie(P.deleteTable) {
|
|
3943
|
+
}
|
|
3944
|
+
t.DeleteTable = we;
|
|
3945
|
+
class xe extends ce(P.mergeCells) {
|
|
3946
|
+
}
|
|
3947
|
+
t.MergeCells = xe;
|
|
3948
|
+
class Pe extends de(P.splitCell) {
|
|
3949
|
+
}
|
|
3950
|
+
t.SplitCell = Pe;
|
|
3951
|
+
function Ht(b) {
|
|
3952
|
+
return yt.createUnlinkTool(b);
|
|
3953
|
+
}
|
|
3954
|
+
t.createUnlinkTool = Ht;
|
|
3955
|
+
class ka extends Ht(P.unlink) {
|
|
3956
|
+
}
|
|
3957
|
+
t.Unlink = ka;
|
|
3958
|
+
function zt(b) {
|
|
3959
|
+
return Ct.createViewHtmlTool(b);
|
|
3960
|
+
}
|
|
3961
|
+
t.createViewHtmlTool = zt;
|
|
3962
|
+
class va extends zt(P.viewHtml) {
|
|
3963
|
+
}
|
|
3964
|
+
t.ViewHtml = va;
|
|
3965
|
+
class ya extends pa {
|
|
3966
|
+
}
|
|
3967
|
+
t.FindAndReplace = ya;
|
|
3968
|
+
})(rl || (rl = {}));
|
|
3969
|
+
const jp = {
|
|
3970
|
+
// prosemirror-state
|
|
3971
|
+
Selection: Gl,
|
|
3972
|
+
SelectionRange: us,
|
|
3973
|
+
TextSelection: Be,
|
|
3974
|
+
NodeSelection: il,
|
|
3975
|
+
AllSelection: Nl,
|
|
3976
|
+
EditorState: Dl,
|
|
3977
|
+
Plugin: Ve,
|
|
3978
|
+
PluginKey: Oe,
|
|
3979
|
+
Transaction: gs,
|
|
3980
|
+
// prosemirror-view
|
|
3981
|
+
Decoration: hs,
|
|
3982
|
+
DecorationSet: fs,
|
|
3983
|
+
EditorView: Ml,
|
|
3984
|
+
// prosemirror-model
|
|
3985
|
+
Node: bs,
|
|
3986
|
+
ResolvedPos: ks,
|
|
3987
|
+
NodeRange: vs,
|
|
3988
|
+
Fragment: ys,
|
|
3989
|
+
Slice: Cs,
|
|
3990
|
+
ReplaceError: ws,
|
|
3991
|
+
Mark: xs,
|
|
3992
|
+
Schema: El,
|
|
3993
|
+
NodeType: Ps,
|
|
3994
|
+
MarkType: Ss,
|
|
3995
|
+
ContentMatch: Is,
|
|
3996
|
+
DOMParser: Ns,
|
|
3997
|
+
DOMSerializer: Rs,
|
|
3998
|
+
// prosemirror-transform
|
|
3999
|
+
Transform: As,
|
|
4000
|
+
Step: Ts,
|
|
4001
|
+
StepResult: Ls,
|
|
4002
|
+
joinPoint: Es,
|
|
4003
|
+
canJoin: Ds,
|
|
4004
|
+
canSplit: Bs,
|
|
4005
|
+
insertPoint: Ms,
|
|
4006
|
+
dropPoint: Hs,
|
|
4007
|
+
liftTarget: zs,
|
|
4008
|
+
findWrapping: Fs,
|
|
4009
|
+
StepMap: Ws,
|
|
4010
|
+
MapResult: Ks,
|
|
4011
|
+
Mapping: $s,
|
|
4012
|
+
AddMarkStep: Vs,
|
|
4013
|
+
RemoveMarkStep: Us,
|
|
4014
|
+
ReplaceStep: Os,
|
|
4015
|
+
ReplaceAroundStep: _s,
|
|
4016
|
+
replaceStep: js,
|
|
4017
|
+
// prosemirror-commands
|
|
4018
|
+
deleteSelection: Gs,
|
|
4019
|
+
joinBackward: qs,
|
|
4020
|
+
selectNodeBackward: Js,
|
|
4021
|
+
joinForward: Qs,
|
|
4022
|
+
selectNodeForward: Xs,
|
|
4023
|
+
joinUp: Ys,
|
|
4024
|
+
joinDown: Zs,
|
|
4025
|
+
lift: ei,
|
|
4026
|
+
newlineInCode: ti,
|
|
4027
|
+
exitCode: ul,
|
|
4028
|
+
createParagraphNear: li,
|
|
4029
|
+
liftEmptyBlock: oi,
|
|
4030
|
+
splitBlock: ni,
|
|
4031
|
+
splitBlockKeepMarks: ri,
|
|
4032
|
+
selectParentNode: ai,
|
|
4033
|
+
selectAll: _l,
|
|
4034
|
+
wrapIn: si,
|
|
4035
|
+
setBlockType: ii,
|
|
4036
|
+
toggleMark: ci,
|
|
4037
|
+
autoJoin: di,
|
|
4038
|
+
chainCommands: ml,
|
|
4039
|
+
pcBaseKeymap: pi,
|
|
4040
|
+
macBaseKeymap: mi,
|
|
4041
|
+
baseKeymap: Bl,
|
|
4042
|
+
// prosemirror-history
|
|
4043
|
+
history: Rl,
|
|
4044
|
+
undo: Pt,
|
|
4045
|
+
redo: _e,
|
|
4046
|
+
undoDepth: ui,
|
|
4047
|
+
redoDepth: gi,
|
|
4048
|
+
// prosemirror-inputrules
|
|
4049
|
+
InputRule: hi,
|
|
4050
|
+
inputRules: fi,
|
|
4051
|
+
undoInputRule: gl,
|
|
4052
|
+
emDash: bi,
|
|
4053
|
+
ellipsis: ki,
|
|
4054
|
+
openDoubleQuote: vi,
|
|
4055
|
+
closeDoubleQuote: yi,
|
|
4056
|
+
openSingleQuote: Ci,
|
|
4057
|
+
closeSingleQuote: wi,
|
|
4058
|
+
smartQuotes: xi,
|
|
4059
|
+
wrappingInputRule: Pi,
|
|
4060
|
+
textblockTypeInputRule: Si,
|
|
4061
|
+
// prosemirror-keymap
|
|
4062
|
+
keymap: ct,
|
|
4063
|
+
keydownHandler: Ii,
|
|
4064
|
+
// prosemirror-schema-list
|
|
4065
|
+
orderedList: Ni,
|
|
4066
|
+
bulletList: Ri,
|
|
4067
|
+
listItem: Ai,
|
|
4068
|
+
addListNodes: Ti,
|
|
4069
|
+
wrapInList: Li,
|
|
4070
|
+
splitListItem: hl,
|
|
4071
|
+
liftListItem: zl,
|
|
4072
|
+
sinkListItem: Hl,
|
|
4073
|
+
// prosemirror-dropcursor
|
|
4074
|
+
dropCursor: Al,
|
|
4075
|
+
// prosemirror-gapcursor
|
|
4076
|
+
gapCursor: Tl,
|
|
4077
|
+
// prosemirror-tables
|
|
4078
|
+
tableEditing: Ll,
|
|
4079
|
+
fixTables: Ei,
|
|
4080
|
+
fixTablesKey: Di,
|
|
4081
|
+
cellAround: Bi,
|
|
4082
|
+
isInTable: Mi,
|
|
4083
|
+
selectionCell: Et,
|
|
4084
|
+
moveCellForward: Hi,
|
|
4085
|
+
inSameTable: zi,
|
|
4086
|
+
findCell: Fi,
|
|
4087
|
+
colCount: Wi,
|
|
4088
|
+
nextCell: Ki,
|
|
4089
|
+
removeColSpan: $i,
|
|
4090
|
+
addColSpan: Vi,
|
|
4091
|
+
columnIsHeader: Ui,
|
|
4092
|
+
tableNodes: Oi,
|
|
4093
|
+
tableNodeTypes: _i,
|
|
4094
|
+
CellSelection: Dt,
|
|
4095
|
+
TableMap: Le,
|
|
4096
|
+
tableEditingKey: ji,
|
|
4097
|
+
columnResizing: Gi,
|
|
4098
|
+
columnResizingPluginKey: qi,
|
|
4099
|
+
updateColumnsOnResize: Ji,
|
|
4100
|
+
selectedRect: Qi,
|
|
4101
|
+
addColumn: Xi,
|
|
4102
|
+
addColumnBefore: Wl,
|
|
4103
|
+
addColumnAfter: Lt,
|
|
4104
|
+
deleteColumn: Ul,
|
|
4105
|
+
rowIsHeader: Yi,
|
|
4106
|
+
addRow: Zi,
|
|
4107
|
+
addRowBefore: Fl,
|
|
4108
|
+
addRowAfter: Tt,
|
|
4109
|
+
deleteRow: Ol,
|
|
4110
|
+
mergeCells: $l,
|
|
4111
|
+
splitCell: Vl,
|
|
4112
|
+
splitCellWithType: ec,
|
|
4113
|
+
setCellAttr: tc,
|
|
4114
|
+
toggleHeader: lc,
|
|
4115
|
+
toggleHeaderRow: oc,
|
|
4116
|
+
toggleHeaderColumn: nc,
|
|
4117
|
+
toggleHeaderCell: rc,
|
|
4118
|
+
goToNextCell: it,
|
|
4119
|
+
deleteTable: Kl
|
|
4120
|
+
};
|
|
4121
|
+
export {
|
|
4122
|
+
ia as Editor,
|
|
4123
|
+
Ee as EditorDialogs,
|
|
4124
|
+
rl as EditorTools,
|
|
4125
|
+
P as EditorToolsSettings,
|
|
4126
|
+
Te as EditorUtils,
|
|
4127
|
+
jp as ProseMirror,
|
|
4128
|
+
Xe as editorPropsKey,
|
|
4129
|
+
Jp as getHtml,
|
|
4130
|
+
Qp as marks,
|
|
4131
|
+
Xp as nodes,
|
|
4132
|
+
Yp as parseContent
|
|
4133
|
+
};
|