@progress/kendo-react-editor 7.2.4-develop.2 → 7.2.4-develop.4

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