@progress/kendo-react-editor 7.2.4-develop.3 → 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.
- package/Editor.js +8 -0
- package/Editor.mjs +327 -0
- package/config/defaultStyles.js +229 -0
- package/config/defaultStyles.mjs +235 -0
- package/config/shortcuts.js +8 -0
- package/config/shortcuts.mjs +34 -0
- package/config/toolsSettings.js +8 -0
- package/config/toolsSettings.mjs +549 -0
- package/dialogs/FindReplace.js +8 -0
- package/dialogs/FindReplace.mjs +214 -0
- package/dialogs/index.js +8 -0
- package/dialogs/index.mjs +30 -0
- package/dialogs/insertImage.js +8 -0
- package/dialogs/insertImage.mjs +117 -0
- package/dialogs/insertLink.js +8 -0
- package/dialogs/insertLink.mjs +96 -0
- package/dialogs/viewHtml.js +8 -0
- package/dialogs/viewHtml.mjs +70 -0
- package/dist/cdn/js/kendo-react-editor.js +8 -226
- package/index.d.mts +2943 -5
- package/index.d.ts +2941 -178
- package/index.js +8 -226
- package/index.mjs +165 -4118
- package/messages/index.js +8 -0
- package/messages/index.mjs +345 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +11 -11
- package/tools/align.js +8 -0
- package/tools/align.mjs +38 -0
- package/tools/applyColor.js +8 -0
- package/tools/applyColor.mjs +34 -0
- package/tools/cleanFormatting.js +8 -0
- package/tools/cleanFormatting.mjs +41 -0
- package/tools/findReplace.js +8 -0
- package/tools/findReplace.mjs +53 -0
- package/tools/fontStyle.js +8 -0
- package/tools/fontStyle.mjs +61 -0
- package/tools/formatBlock.js +8 -0
- package/tools/formatBlock.mjs +60 -0
- package/tools/history.js +8 -0
- package/tools/history.mjs +17 -0
- package/tools/indent.js +8 -0
- package/tools/indent.mjs +43 -0
- package/tools/index.js +8 -0
- package/tools/index.mjs +278 -0
- package/tools/inlineFormat.js +8 -0
- package/tools/inlineFormat.mjs +43 -0
- package/tools/insertImage.js +8 -0
- package/tools/insertImage.mjs +58 -0
- package/tools/insertLink.js +8 -0
- package/tools/insertLink.mjs +61 -0
- package/tools/insertTable/popup.js +8 -0
- package/tools/insertTable/popup.mjs +94 -0
- package/tools/insertTable/popupGrid.js +8 -0
- package/tools/insertTable/popupGrid.mjs +58 -0
- package/tools/insertTable/tool.js +8 -0
- package/tools/insertTable/tool.mjs +73 -0
- package/tools/lists-styled.js +8 -0
- package/tools/lists-styled.mjs +61 -0
- package/tools/lists.js +8 -0
- package/tools/lists.mjs +47 -0
- package/tools/outdent.js +8 -0
- package/tools/outdent.mjs +43 -0
- package/tools/pdf.js +8 -0
- package/tools/pdf.mjs +36 -0
- package/tools/print.js +8 -0
- package/tools/print.mjs +38 -0
- package/tools/proseMirrorTool.js +8 -0
- package/tools/proseMirrorTool.mjs +37 -0
- package/tools/selectAll.js +8 -0
- package/tools/selectAll.mjs +36 -0
- package/tools/table-wizard/cellPropsUtils.js +8 -0
- package/tools/table-wizard/cellPropsUtils.mjs +124 -0
- package/tools/table-wizard/tableCellProperties.js +8 -0
- package/tools/table-wizard/tableCellProperties.mjs +238 -0
- package/tools/table-wizard/tableProperties.js +8 -0
- package/tools/table-wizard/tableProperties.mjs +292 -0
- package/tools/table-wizard/tablePropsUtils.js +8 -0
- package/tools/table-wizard/tablePropsUtils.mjs +288 -0
- package/tools/table-wizard/utils.js +8 -0
- package/tools/table-wizard/utils.mjs +91 -0
- package/tools/tableEdit.js +8 -0
- package/tools/tableEdit.mjs +36 -0
- package/tools/unlink.js +8 -0
- package/tools/unlink.mjs +41 -0
- package/tools/utils.js +8 -0
- package/tools/utils.mjs +51 -0
- package/tools/viewHtml.js +8 -0
- package/tools/viewHtml.mjs +57 -0
- package/utils/browser-detection.js +8 -0
- package/utils/browser-detection.mjs +12 -0
- package/utils/controlled-value.js +8 -0
- package/utils/controlled-value.mjs +19 -0
- package/utils/index.js +8 -0
- package/utils/index.mjs +162 -0
- package/utils/props-key.js +8 -0
- package/utils/props-key.mjs +13 -0
- package/Editor.d.ts +0 -122
- package/EditorProps.d.ts +0 -200
- package/config/defaultStyles.d.ts +0 -16
- package/config/pasteSettings.d.ts +0 -10
- package/config/schema.d.ts +0 -5
- package/config/shortcuts.d.ts +0 -28
- package/config/toolsSettings.d.ts +0 -493
- package/dialogs/EditorDialogProps.d.ts +0 -30
- package/dialogs/FindReplace.d.ts +0 -75
- package/dialogs/index.d.ts +0 -53
- package/dialogs/insertImage.d.ts +0 -32
- package/dialogs/insertLink.d.ts +0 -30
- package/dialogs/viewHtml.d.ts +0 -29
- package/messages/index.d.ts +0 -338
- package/package-metadata.d.ts +0 -9
- package/tools/ToolProps.d.ts +0 -41
- package/tools/align.d.ts +0 -11
- package/tools/applyColor.d.ts +0 -16
- package/tools/cleanFormatting.d.ts +0 -20
- package/tools/findReplace.d.ts +0 -33
- package/tools/fontStyle.d.ts +0 -32
- package/tools/formatBlock.d.ts +0 -22
- package/tools/history.d.ts +0 -30
- package/tools/indent.d.ts +0 -21
- package/tools/index.d.ts +0 -718
- package/tools/inlineFormat.d.ts +0 -51
- package/tools/insertImage.d.ts +0 -17
- package/tools/insertLink.d.ts +0 -28
- package/tools/insertTable/index.d.ts +0 -7
- package/tools/insertTable/popup.d.ts +0 -97
- package/tools/insertTable/popupGrid.d.ts +0 -35
- package/tools/insertTable/tool.d.ts +0 -28
- package/tools/lists-styled.d.ts +0 -8
- package/tools/lists.d.ts +0 -31
- package/tools/outdent.d.ts +0 -21
- package/tools/pdf.d.ts +0 -29
- package/tools/print.d.ts +0 -20
- package/tools/proseMirrorTool.d.ts +0 -16
- package/tools/selectAll.d.ts +0 -20
- package/tools/table-wizard/cellPropsUtils.d.ts +0 -40
- package/tools/table-wizard/tableCellProperties.d.ts +0 -24
- package/tools/table-wizard/tableProperties.d.ts +0 -15
- package/tools/table-wizard/tablePropsUtils.d.ts +0 -56
- package/tools/table-wizard/utils.d.ts +0 -43
- package/tools/tableEdit.d.ts +0 -102
- package/tools/unlink.d.ts +0 -21
- package/tools/utils.d.ts +0 -54
- package/tools/viewHtml.d.ts +0 -28
- package/utils/browser-detection.d.ts +0 -8
- package/utils/controlled-value.d.ts +0 -9
- package/utils/index.d.ts +0 -367
- package/utils/props-key.d.ts +0 -9
|
@@ -0,0 +1,549 @@
|
|
|
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
|
+
*/
|
|
8
|
+
"use client";
|
|
9
|
+
import { keys as e, messages as i } from "../messages/index.mjs";
|
|
10
|
+
import { boldIcon as c, italicIcon as r, underlineIcon as m, strikethroughIcon as p, subscriptIcon as d, supscriptIcon as g, linkIcon as f, fileAddIcon as u, tableAddIcon as I, tableRowInsertAboveIcon as v, tableRowInsertBelowIcon as y, tableColumnInsertLeftIcon as R, tableColumnInsertRightIcon as b, tableRowDeleteIcon as h, tableColumnDeleteIcon as C, tableDeleteIcon as k, cellsMergeIcon as N, cellSplitHorizontallyIcon as H, printIcon as w, selectAllIcon as x, filePdfIcon as A, clearCssIcon as L, imageIcon as F, codeIcon as M, binocularsIcon as z, unlinkIcon as W, undoIcon as D, redoIcon as B, foregroundColorIcon as P, dropletIcon as T, alignLeftIcon as U, alignRightIcon as G, alignCenterIcon as J, alignJustifyIcon as O, alignRemoveIcon as K, indentIcon as V, outdentIcon as j, listOrderedIcon as q, listUnorderedIcon as Q } from "@progress/kendo-svg-icons";
|
|
11
|
+
import { indentRules as o, bold as X, italic as Y, underline as Z, strikethrough as _, subscript as $, superscript as S, link as t, alignLeftRules as E, alignRightRules as ee, alignCenterRules as ne, alignJustifyRules as ae, alignRemoveRules as le, outdentRules as ie } from "@progress/kendo-editor-common";
|
|
12
|
+
const l = { ...o.listsTypes };
|
|
13
|
+
var s;
|
|
14
|
+
((n) => {
|
|
15
|
+
const a = {
|
|
16
|
+
type: "button"
|
|
17
|
+
};
|
|
18
|
+
n.bold = {
|
|
19
|
+
...X,
|
|
20
|
+
props: {
|
|
21
|
+
icon: "bold",
|
|
22
|
+
svgIcon: c,
|
|
23
|
+
...a
|
|
24
|
+
},
|
|
25
|
+
messages: {
|
|
26
|
+
title: e.bold
|
|
27
|
+
},
|
|
28
|
+
commandName: "Bold"
|
|
29
|
+
}, n.italic = {
|
|
30
|
+
...Y,
|
|
31
|
+
props: {
|
|
32
|
+
icon: "italic",
|
|
33
|
+
svgIcon: r,
|
|
34
|
+
...a
|
|
35
|
+
},
|
|
36
|
+
messages: {
|
|
37
|
+
title: e.italic
|
|
38
|
+
},
|
|
39
|
+
commandName: "Italic"
|
|
40
|
+
}, n.underline = {
|
|
41
|
+
...Z,
|
|
42
|
+
props: {
|
|
43
|
+
icon: "underline",
|
|
44
|
+
svgIcon: m,
|
|
45
|
+
...a
|
|
46
|
+
},
|
|
47
|
+
messages: {
|
|
48
|
+
title: e.underline
|
|
49
|
+
},
|
|
50
|
+
commandName: "Underline"
|
|
51
|
+
}, n.strikethrough = {
|
|
52
|
+
..._,
|
|
53
|
+
props: {
|
|
54
|
+
icon: "strikethrough",
|
|
55
|
+
svgIcon: p,
|
|
56
|
+
...a
|
|
57
|
+
},
|
|
58
|
+
messages: {
|
|
59
|
+
title: e.strikethrough
|
|
60
|
+
},
|
|
61
|
+
commandName: "Strikethrough"
|
|
62
|
+
}, n.subscript = {
|
|
63
|
+
...$,
|
|
64
|
+
props: {
|
|
65
|
+
icon: "subscript",
|
|
66
|
+
svgIcon: d,
|
|
67
|
+
...a
|
|
68
|
+
},
|
|
69
|
+
messages: {
|
|
70
|
+
title: e.subscript
|
|
71
|
+
},
|
|
72
|
+
commandName: "Subscript"
|
|
73
|
+
}, n.superscript = {
|
|
74
|
+
...S,
|
|
75
|
+
props: {
|
|
76
|
+
icon: "supscript",
|
|
77
|
+
svgIcon: g,
|
|
78
|
+
...a
|
|
79
|
+
},
|
|
80
|
+
messages: {
|
|
81
|
+
title: e.superscript
|
|
82
|
+
},
|
|
83
|
+
commandName: "Superscript"
|
|
84
|
+
}, n.link = {
|
|
85
|
+
...t,
|
|
86
|
+
props: {
|
|
87
|
+
icon: "link",
|
|
88
|
+
svgIcon: f,
|
|
89
|
+
...a
|
|
90
|
+
},
|
|
91
|
+
messages: {
|
|
92
|
+
insertHyperlink: e.insertHyperlink,
|
|
93
|
+
insertHyperlinkDialogTitle: e.insertHyperlinkDialogTitle,
|
|
94
|
+
insertHyperlinkAddress: e.insertHyperlinkAddress,
|
|
95
|
+
insertHyperlinkTitle: e.insertHyperlinkTitle,
|
|
96
|
+
insertHyperlinkNewWindow: e.insertHyperlinkNewWindow,
|
|
97
|
+
insertHyperlinkCancel: e.insertHyperlinkCancel,
|
|
98
|
+
insertHyperlinkInsert: e.insertHyperlinkInsert
|
|
99
|
+
},
|
|
100
|
+
commandName: "Link"
|
|
101
|
+
}, n.insertFile = {
|
|
102
|
+
...t,
|
|
103
|
+
props: {
|
|
104
|
+
icon: "file-add",
|
|
105
|
+
svgIcon: u,
|
|
106
|
+
...a
|
|
107
|
+
},
|
|
108
|
+
messages: {
|
|
109
|
+
insertHyperlink: e.insertFile,
|
|
110
|
+
insertHyperlinkDialogTitle: e.insertFileDialogTitle,
|
|
111
|
+
insertHyperlinkAddress: e.insertFileAddress,
|
|
112
|
+
insertHyperlinkTitle: e.insertFileTitle,
|
|
113
|
+
insertHyperlinkNewWindow: "",
|
|
114
|
+
insertHyperlinkCancel: e.insertFileCancel,
|
|
115
|
+
insertHyperlinkInsert: e.insertFileInsert
|
|
116
|
+
},
|
|
117
|
+
commandName: "InsertFile",
|
|
118
|
+
linkTarget: !1
|
|
119
|
+
}, n.insertTable = {
|
|
120
|
+
props: {
|
|
121
|
+
icon: "table-add",
|
|
122
|
+
svgIcon: I,
|
|
123
|
+
...a
|
|
124
|
+
},
|
|
125
|
+
messages: {
|
|
126
|
+
createTable: e.createTable,
|
|
127
|
+
createTableHint: e.createTableHint
|
|
128
|
+
},
|
|
129
|
+
commandName: "InsertTable"
|
|
130
|
+
}, n.addRowBefore = {
|
|
131
|
+
props: {
|
|
132
|
+
icon: "table-row-insert-above",
|
|
133
|
+
svgIcon: v,
|
|
134
|
+
...a
|
|
135
|
+
},
|
|
136
|
+
messages: {
|
|
137
|
+
title: e.addRowBefore
|
|
138
|
+
},
|
|
139
|
+
commandName: "AddRowBefore"
|
|
140
|
+
}, n.addRowAfter = {
|
|
141
|
+
props: {
|
|
142
|
+
icon: "table-row-insert-below",
|
|
143
|
+
svgIcon: y,
|
|
144
|
+
...a
|
|
145
|
+
},
|
|
146
|
+
messages: {
|
|
147
|
+
title: e.addRowAfter
|
|
148
|
+
},
|
|
149
|
+
commandName: "AddRowAfter"
|
|
150
|
+
}, n.addColumnBefore = {
|
|
151
|
+
props: {
|
|
152
|
+
icon: "table-column-insert-left",
|
|
153
|
+
svgIcon: R,
|
|
154
|
+
...a
|
|
155
|
+
},
|
|
156
|
+
messages: {
|
|
157
|
+
title: e.addColumnBefore
|
|
158
|
+
},
|
|
159
|
+
commandName: "AddColumnBefore"
|
|
160
|
+
}, n.addColumnAfter = {
|
|
161
|
+
props: {
|
|
162
|
+
icon: "table-column-insert-right",
|
|
163
|
+
svgIcon: b,
|
|
164
|
+
...a
|
|
165
|
+
},
|
|
166
|
+
messages: {
|
|
167
|
+
title: e.addColumnAfter
|
|
168
|
+
},
|
|
169
|
+
commandName: "AddColumnAfter"
|
|
170
|
+
}, n.deleteRow = {
|
|
171
|
+
props: {
|
|
172
|
+
icon: "table-row-delete",
|
|
173
|
+
svgIcon: h,
|
|
174
|
+
...a
|
|
175
|
+
},
|
|
176
|
+
messages: {
|
|
177
|
+
title: e.deleteRow
|
|
178
|
+
},
|
|
179
|
+
commandName: "DeleteRow"
|
|
180
|
+
}, n.deleteColumn = {
|
|
181
|
+
props: {
|
|
182
|
+
icon: "table-column-delete",
|
|
183
|
+
svgIcon: C,
|
|
184
|
+
...a
|
|
185
|
+
},
|
|
186
|
+
messages: {
|
|
187
|
+
title: e.deleteColumn
|
|
188
|
+
},
|
|
189
|
+
commandName: "DeleteColumn"
|
|
190
|
+
}, n.deleteTable = {
|
|
191
|
+
props: {
|
|
192
|
+
icon: "table-delete",
|
|
193
|
+
svgIcon: k,
|
|
194
|
+
...a
|
|
195
|
+
},
|
|
196
|
+
messages: {
|
|
197
|
+
title: e.deleteTable
|
|
198
|
+
},
|
|
199
|
+
commandName: "DeleteTable"
|
|
200
|
+
}, n.mergeCells = {
|
|
201
|
+
props: {
|
|
202
|
+
icon: "cells-merge",
|
|
203
|
+
svgIcon: N,
|
|
204
|
+
...a
|
|
205
|
+
},
|
|
206
|
+
messages: {
|
|
207
|
+
title: e.mergeCells
|
|
208
|
+
},
|
|
209
|
+
commandName: "MergeCells"
|
|
210
|
+
}, n.splitCell = {
|
|
211
|
+
props: {
|
|
212
|
+
icon: "cell-split-horizontally",
|
|
213
|
+
svgIcon: H,
|
|
214
|
+
...a
|
|
215
|
+
},
|
|
216
|
+
messages: {
|
|
217
|
+
title: e.splitCell
|
|
218
|
+
},
|
|
219
|
+
commandName: "SplitCell"
|
|
220
|
+
}, n.print = {
|
|
221
|
+
props: {
|
|
222
|
+
icon: "print",
|
|
223
|
+
svgIcon: w,
|
|
224
|
+
...a
|
|
225
|
+
},
|
|
226
|
+
messages: {
|
|
227
|
+
title: e.print
|
|
228
|
+
}
|
|
229
|
+
}, n.selectAll = {
|
|
230
|
+
props: {
|
|
231
|
+
icon: "select-all",
|
|
232
|
+
svgIcon: x,
|
|
233
|
+
...a
|
|
234
|
+
},
|
|
235
|
+
messages: {
|
|
236
|
+
title: e.selectAll
|
|
237
|
+
}
|
|
238
|
+
}, n.pdf = {
|
|
239
|
+
props: {
|
|
240
|
+
icon: "file-pdf",
|
|
241
|
+
svgIcon: A,
|
|
242
|
+
...a
|
|
243
|
+
},
|
|
244
|
+
messages: {
|
|
245
|
+
title: e.pdf
|
|
246
|
+
}
|
|
247
|
+
}, n.savePdfOptions = {
|
|
248
|
+
fileName: "editor.pdf",
|
|
249
|
+
paperSize: "A4",
|
|
250
|
+
margin: "1cm"
|
|
251
|
+
}, n.cleanFormatting = {
|
|
252
|
+
props: {
|
|
253
|
+
icon: "clear-css",
|
|
254
|
+
svgIcon: L,
|
|
255
|
+
...a
|
|
256
|
+
},
|
|
257
|
+
messages: {
|
|
258
|
+
title: e.cleanFormatting
|
|
259
|
+
},
|
|
260
|
+
commandName: "CleanFormatting"
|
|
261
|
+
}, n.image = {
|
|
262
|
+
node: "image",
|
|
263
|
+
props: {
|
|
264
|
+
icon: "image",
|
|
265
|
+
svgIcon: F,
|
|
266
|
+
...a
|
|
267
|
+
},
|
|
268
|
+
messages: {
|
|
269
|
+
insertImage: e.insertImage,
|
|
270
|
+
insertImageDialogTitle: e.insertImageDialogTitle,
|
|
271
|
+
insertImageAddress: e.insertImageAddress,
|
|
272
|
+
insertImageTitle: e.insertImageTitle,
|
|
273
|
+
insertImageAltText: e.insertImageAltText,
|
|
274
|
+
insertImageWidth: e.insertImageWidth,
|
|
275
|
+
insertImageHeight: e.insertImageHeight,
|
|
276
|
+
insertImageCancel: e.insertImageCancel,
|
|
277
|
+
insertImageInsert: e.insertImageInsert
|
|
278
|
+
},
|
|
279
|
+
commandName: "InsertImage"
|
|
280
|
+
}, n.viewHtml = {
|
|
281
|
+
props: {
|
|
282
|
+
icon: "code",
|
|
283
|
+
svgIcon: M,
|
|
284
|
+
...a
|
|
285
|
+
},
|
|
286
|
+
messages: {
|
|
287
|
+
viewHtml: e.viewHtml,
|
|
288
|
+
viewHtmlDialogTitle: e.viewHtmlDialogTitle,
|
|
289
|
+
viewHtmlCancel: e.viewHtmlCancel,
|
|
290
|
+
viewHtmlUpdate: e.viewHtmlUpdate
|
|
291
|
+
},
|
|
292
|
+
commandName: "SetContent"
|
|
293
|
+
}, n.findAndReplace = {
|
|
294
|
+
props: {
|
|
295
|
+
icon: "find",
|
|
296
|
+
svgIcon: z,
|
|
297
|
+
...a
|
|
298
|
+
},
|
|
299
|
+
messages: {
|
|
300
|
+
findReplaceToolTitle: e.findReplaceToolTitle,
|
|
301
|
+
findReplaceDialogTitle: e.findReplaceDialogTitle,
|
|
302
|
+
findReplaceTabFind: e.findReplaceTabFind,
|
|
303
|
+
findReplaceTabReplace: e.findReplaceTabReplace,
|
|
304
|
+
findReplaceFindWhat: e.findReplaceFindWhat,
|
|
305
|
+
findReplaceReplaceWith: e.findReplaceReplaceWith,
|
|
306
|
+
findReplaceReplace: e.findReplaceReplace,
|
|
307
|
+
findReplaceReplaceAll: e.findReplaceReplaceAll,
|
|
308
|
+
findReplaceMatchCase: e.findReplaceMatchCase,
|
|
309
|
+
findReplaceMatchWord: e.findReplaceMatchWord,
|
|
310
|
+
findReplaceMatchCyclic: e.findReplaceMatchCyclic,
|
|
311
|
+
findReplaceUseRegExp: e.findReplaceUseRegExp,
|
|
312
|
+
findReplacePrevMatch: e.findReplacePrevMatch,
|
|
313
|
+
findReplaceNextMatch: e.findReplaceNextMatch,
|
|
314
|
+
findReplaceMatches: e.findReplaceMatches
|
|
315
|
+
}
|
|
316
|
+
}, n.unlink = {
|
|
317
|
+
...t,
|
|
318
|
+
props: {
|
|
319
|
+
icon: "unlink",
|
|
320
|
+
svgIcon: W,
|
|
321
|
+
...a
|
|
322
|
+
},
|
|
323
|
+
messages: {
|
|
324
|
+
title: e.unlink
|
|
325
|
+
},
|
|
326
|
+
commandName: "Unlink"
|
|
327
|
+
}, n.undo = {
|
|
328
|
+
props: {
|
|
329
|
+
icon: "undo",
|
|
330
|
+
svgIcon: D,
|
|
331
|
+
...a
|
|
332
|
+
},
|
|
333
|
+
messages: {
|
|
334
|
+
title: e.undo
|
|
335
|
+
},
|
|
336
|
+
commandName: "Undo"
|
|
337
|
+
}, n.redo = {
|
|
338
|
+
props: {
|
|
339
|
+
icon: "redo",
|
|
340
|
+
svgIcon: B,
|
|
341
|
+
...a
|
|
342
|
+
},
|
|
343
|
+
messages: {
|
|
344
|
+
title: e.redo
|
|
345
|
+
},
|
|
346
|
+
commandName: "Redo"
|
|
347
|
+
}, n.fontSize = {
|
|
348
|
+
style: "font-size",
|
|
349
|
+
defaultItem: { text: i[e.fontSize], value: "", localizationKey: e.fontSize },
|
|
350
|
+
items: [
|
|
351
|
+
{ text: "1 (8pt)", value: "xx-small" },
|
|
352
|
+
{ text: "2 (10pt)", value: "x-small" },
|
|
353
|
+
{ text: "3 (12pt)", value: "small" },
|
|
354
|
+
{ text: "4 (14pt)", value: "medium" },
|
|
355
|
+
{ text: "5 (18pt)", value: "large" },
|
|
356
|
+
{ text: "6 (24pt)", value: "x-large" },
|
|
357
|
+
{ text: "7 (36pt)", value: "xx-large" }
|
|
358
|
+
],
|
|
359
|
+
commandName: "FontSize"
|
|
360
|
+
}, n.fontName = {
|
|
361
|
+
style: "font-family",
|
|
362
|
+
defaultItem: { text: i[e.fontName], value: "", localizationKey: e.fontName },
|
|
363
|
+
items: [
|
|
364
|
+
{
|
|
365
|
+
text: "Arial",
|
|
366
|
+
value: "Arial, Helvetica, sans-serif",
|
|
367
|
+
style: { fontFamily: "Arial, Helvetica, sans-serif" }
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
text: "Courier New",
|
|
371
|
+
value: "'Courier New', Courier, monospace",
|
|
372
|
+
style: { fontFamily: "'Courier New', Courier, monospace" }
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
text: "Georgia",
|
|
376
|
+
value: "Georgia, serif",
|
|
377
|
+
style: { fontFamily: "Georgia, serif" }
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
text: "Impact",
|
|
381
|
+
value: "Impact, Charcoal, sans-serif",
|
|
382
|
+
style: { fontFamily: "Impact, Charcoal, sans-serif" }
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
text: "Lucida Console",
|
|
386
|
+
value: "'Lucida Console', Monaco, monospace",
|
|
387
|
+
style: { fontFamily: "'Lucida Console', Monaco, monospace" }
|
|
388
|
+
},
|
|
389
|
+
{
|
|
390
|
+
text: "Tahoma",
|
|
391
|
+
value: "Tahoma, Geneva, sans-serif",
|
|
392
|
+
style: { fontFamily: "Tahoma, Geneva, sans-serif" }
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
text: "Times New Roman",
|
|
396
|
+
value: "'Times New Roman', Times,serif",
|
|
397
|
+
style: { fontFamily: "'Times New Roman', Times,serif" }
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
text: "Trebuchet MS",
|
|
401
|
+
value: "'Trebuchet MS', Helvetica, sans-serif",
|
|
402
|
+
style: { fontFamily: "'Trebuchet MS', Helvetica, sans-serif" }
|
|
403
|
+
},
|
|
404
|
+
{
|
|
405
|
+
text: "Verdana",
|
|
406
|
+
value: "Verdana, Geneva, sans-serif",
|
|
407
|
+
style: { fontFamily: "Verdana, Geneva, sans-serif" }
|
|
408
|
+
}
|
|
409
|
+
],
|
|
410
|
+
commandName: "FontName"
|
|
411
|
+
}, n.formatBlock = {
|
|
412
|
+
defaultItem: { text: i[e.format], value: "", localizationKey: e.format },
|
|
413
|
+
items: [
|
|
414
|
+
{ text: "Paragraph", value: "p", style: { display: "block", marginLeft: 0 } },
|
|
415
|
+
{ text: "Heading 1", value: "h1", style: { display: "block", fontSize: "2em", marginLeft: 0, fontWeight: "bold" } },
|
|
416
|
+
{ text: "Heading 2", value: "h2", style: { display: "block", fontSize: "1.5em", marginLeft: 0, fontWeight: "bold" } },
|
|
417
|
+
{ text: "Heading 3", value: "h3", style: { display: "block", fontSize: "1.17em", marginLeft: 0, fontWeight: "bold" } },
|
|
418
|
+
{ text: "Heading 4", value: "h4", style: { display: "block", fontSize: "1em", marginLeft: 0, fontWeight: "bold" } },
|
|
419
|
+
{ text: "Heading 5", value: "h5", style: { display: "block", fontSize: "0.83em", marginLeft: 0, fontWeight: "bold" } },
|
|
420
|
+
{ text: "Heading 6", value: "h6", style: { display: "block", fontSize: "0.67em", marginLeft: 0, fontWeight: "bold" } }
|
|
421
|
+
],
|
|
422
|
+
commandName: "FormatBlock"
|
|
423
|
+
}, n.foreColor = {
|
|
424
|
+
style: "color",
|
|
425
|
+
colorPickerProps: {
|
|
426
|
+
icon: "foreground-color",
|
|
427
|
+
svgIcon: P,
|
|
428
|
+
view: "palette",
|
|
429
|
+
title: e.foregroundColor,
|
|
430
|
+
ariaLabel: e.foreColorLabel
|
|
431
|
+
},
|
|
432
|
+
commandName: "ForeColor"
|
|
433
|
+
}, n.backColor = {
|
|
434
|
+
style: "background-color",
|
|
435
|
+
colorPickerProps: {
|
|
436
|
+
icon: "droplet",
|
|
437
|
+
svgIcon: T,
|
|
438
|
+
view: "palette",
|
|
439
|
+
title: e.backgroundColor,
|
|
440
|
+
ariaLabel: e.backColorLabel
|
|
441
|
+
},
|
|
442
|
+
commandName: "BackColor"
|
|
443
|
+
}, n.alignLeft = {
|
|
444
|
+
actions: [...E],
|
|
445
|
+
props: {
|
|
446
|
+
icon: "align-left",
|
|
447
|
+
svgIcon: U,
|
|
448
|
+
...a
|
|
449
|
+
},
|
|
450
|
+
messages: {
|
|
451
|
+
title: e.alignLeft
|
|
452
|
+
},
|
|
453
|
+
commandName: "AlignLeft"
|
|
454
|
+
}, n.alignRight = {
|
|
455
|
+
actions: [...ee],
|
|
456
|
+
props: {
|
|
457
|
+
icon: "align-right",
|
|
458
|
+
svgIcon: G,
|
|
459
|
+
...a
|
|
460
|
+
},
|
|
461
|
+
messages: {
|
|
462
|
+
title: e.alignRight
|
|
463
|
+
},
|
|
464
|
+
commandName: "AlignRight"
|
|
465
|
+
}, n.alignCenter = {
|
|
466
|
+
actions: [...ne],
|
|
467
|
+
props: {
|
|
468
|
+
icon: "align-center",
|
|
469
|
+
svgIcon: J,
|
|
470
|
+
...a
|
|
471
|
+
},
|
|
472
|
+
messages: {
|
|
473
|
+
title: e.alignCenter
|
|
474
|
+
},
|
|
475
|
+
commandName: "AlignCenter"
|
|
476
|
+
}, n.alignJustify = {
|
|
477
|
+
actions: [...ae],
|
|
478
|
+
props: {
|
|
479
|
+
icon: "align-justify",
|
|
480
|
+
svgIcon: O,
|
|
481
|
+
...a
|
|
482
|
+
},
|
|
483
|
+
messages: {
|
|
484
|
+
title: e.alignJustify
|
|
485
|
+
},
|
|
486
|
+
commandName: "AlignJustify"
|
|
487
|
+
}, n.alignRemove = {
|
|
488
|
+
actions: [...le],
|
|
489
|
+
props: {
|
|
490
|
+
icon: "align-remove",
|
|
491
|
+
svgIcon: K,
|
|
492
|
+
...a
|
|
493
|
+
},
|
|
494
|
+
messages: {},
|
|
495
|
+
commandName: "AlignRemove"
|
|
496
|
+
}, n.indent = {
|
|
497
|
+
actions: o.nodes,
|
|
498
|
+
listsTypes: l,
|
|
499
|
+
props: {
|
|
500
|
+
icon: "indent",
|
|
501
|
+
svgIcon: V,
|
|
502
|
+
...a
|
|
503
|
+
},
|
|
504
|
+
messages: {
|
|
505
|
+
title: e.indent
|
|
506
|
+
},
|
|
507
|
+
commandName: "Indent"
|
|
508
|
+
}, n.outdent = {
|
|
509
|
+
actions: ie.nodes,
|
|
510
|
+
listsTypes: l,
|
|
511
|
+
props: {
|
|
512
|
+
icon: "outdent",
|
|
513
|
+
svgIcon: j,
|
|
514
|
+
...a
|
|
515
|
+
},
|
|
516
|
+
messages: {
|
|
517
|
+
title: e.outdent
|
|
518
|
+
},
|
|
519
|
+
commandName: "Outdent"
|
|
520
|
+
}, n.orderedList = {
|
|
521
|
+
listType: l.orderedList,
|
|
522
|
+
props: {
|
|
523
|
+
icon: "list-ordered",
|
|
524
|
+
svgIcon: q,
|
|
525
|
+
...a
|
|
526
|
+
},
|
|
527
|
+
messages: {
|
|
528
|
+
title: e.orderedList
|
|
529
|
+
},
|
|
530
|
+
commandName: "OrderedList",
|
|
531
|
+
types: { ...l }
|
|
532
|
+
}, n.bulletList = {
|
|
533
|
+
listType: l.bulletList,
|
|
534
|
+
props: {
|
|
535
|
+
icon: "list-unordered",
|
|
536
|
+
svgIcon: Q,
|
|
537
|
+
...a
|
|
538
|
+
},
|
|
539
|
+
messages: {
|
|
540
|
+
title: e.bulletList
|
|
541
|
+
},
|
|
542
|
+
commandName: "UnorderedList",
|
|
543
|
+
types: { ...l }
|
|
544
|
+
};
|
|
545
|
+
})(s || (s = {}));
|
|
546
|
+
export {
|
|
547
|
+
s as EditorToolsSettings,
|
|
548
|
+
l as listsTypes
|
|
549
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
*/
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const A=require("react"),k=require("@progress/kendo-react-buttons"),B=require("@progress/kendo-react-dialogs"),E=require("@progress/kendo-react-layout"),N=require("@progress/kendo-react-intl"),l=require("../messages/index.js"),j=require("../config/toolsSettings.js"),P=require("../tools/utils.js"),m=require("@progress/kendo-editor-common"),F=require("@progress/kendo-react-common"),f=require("@progress/kendo-react-inputs"),x=require("@progress/kendo-react-form"),M=require("@progress/kendo-svg-icons");function K(u){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(u){for(const e in u)if(e!=="default"){const a=Object.getOwnPropertyDescriptor(u,e);Object.defineProperty(s,e,a.get?a:{enumerable:!0,get:()=>u[e]})}}return s.default=u,Object.freeze(s)}const t=K(A),U=13,_=27,V=j.EditorToolsSettings.findAndReplace;let w=class extends t.Component{constructor(s){super(s),this.onTabSelect=e=>{this.setState({selectedTab:e.selected})},this.onClose=()=>{const e=this.props.view,a=e.state,c=a.tr.setSelection(m.TextSelection.create(a.doc,a.selection.from,a.selection.to));e.updateState(a.apply(c)),e.focus(),this.props.onClose.call(void 0)},this.matchesMessage=e=>{const a=this.state.matches,c=this.state.nextMatch;let o=0,i=0;if(a&&c){const n=a.findIndex(r=>r.eq(c));o=n===-1?a.length:n+1,i=a.length}return P.formatString(e,o,i)},this.onFindNext=()=>{this.onFind()},this.onFindPrev=()=>{this.onFind(!0)},this.onFind=(e=!1)=>{const a=this.props.view,{searchText:c,matchCase:o,matchCyclic:i,matchWord:n,useRegExp:r}=this.state,h={text:c,matchWord:n,matchCase:o,useRegExp:r,backward:e,matchCyclic:i},d=m.find(a.state,h);if(d){const g=a.state.tr.setSelection(d);g.scrollIntoView(),a.updateState(a.state.apply(g)),this.setState({nextMatch:d})}},this.onReplace=()=>{const e=this.props.view,a=e.state.selection,{replaceText:c}=this.state;if(!a.empty){const o=a.from,i=o+c.length,n=m.replace(a,c,e.state.tr);n.setSelection(m.TextSelection.create(n.doc,o,i)),n.scrollIntoView(),e.dispatch(n),this.setNextState({})}},this.onReplaceAll=()=>{const e=this.props.view,{searchText:a,replaceText:c,matchCase:o,matchWord:i,useRegExp:n}=this.state,r={text:a,matchWord:i,matchCase:o,useRegExp:n},h=m.replaceAll(e.state,c,r);h&&e.dispatch(h),this.setNextState({})},this.onKeyDown=e=>{e.keyCode===U?this.onFindNext():e.keyCode===_&&this.onClose()},this.onMatchCaseChecked=e=>this.setNextState({matchCase:e.value}),this.onMatchWordChecked=e=>this.setNextState({matchWord:e.value}),this.onMatchCyclicChecked=e=>this.setNextState({matchCyclic:e.value}),this.onUseRegExpChecked=e=>this.setNextState({useRegExp:e.value}),this.onSearchChange=e=>this.setNextState({searchText:e.target.value}),this.onReplaceChange=e=>this.setNextState({replaceText:e.target.value}),this.setNextState=e=>{const a={...this.state,...e,matches:void 0,nextMatch:void 0},c=this.props.view;if(a.searchText){const{searchText:o,matchWord:i,matchCase:n,useRegExp:r,matchCyclic:h}=a,d={text:o,matchWord:i,matchCase:n,useRegExp:r},g=c.state.selection,p=m.findAll(c.state.doc,d);let C=!this.state.searchText&&p[0]||p.find(S=>S.from>=g.from)||h&&p[0]||void 0;this.setState({...a,matches:p,nextMatch:C})}else this.setState(a)},this.state={selectedTab:0,searchText:m.selectedLineTextOnly(s.view.state),replaceText:"",matchCase:!1,matchWord:!1,matchCyclic:!1,useRegExp:!1}}get settings(){return this.props.settings||V}componentDidUpdate(s,e){const a=this.props.view,{matches:c=[],nextMatch:o}=this.state;if(e.nextMatch!==o){const i=a.state,n=i.tr,r=[];c.forEach(h=>{r.push({from:h.from,to:h.to,attrs:{class:o&&h.eq(o)?"k-text-selected":"k-text-highlighted"}})}),n.setMeta(m.textHighlightKey,r),n.setSelection(o||m.TextSelection.create(i.doc,i.selection.from)),a.dispatch(n)}}render(){const s=N.provideLocalizationService(this),{findReplaceDialogTitle:e,findReplaceTabFind:a,findReplaceTabReplace:c,findReplaceFindWhat:o,findReplaceReplaceWith:i,findReplaceReplace:n,findReplaceReplaceAll:r,findReplaceMatchCase:h,findReplaceMatchWord:d,findReplaceMatchCyclic:g,findReplaceUseRegExp:p,findReplacePrevMatch:C,findReplaceNextMatch:S,findReplaceMatches:R}=this.settings.messages,{matchCase:W,matchWord:L,matchCyclic:q,useRegExp:I,searchText:D,replaceText:O,nextMatch:b}=this.state,v=t.createElement("div",{className:"k-search-options"},t.createElement("span",null,t.createElement(f.Checkbox,{id:"match-case",checked:W,onChange:this.onMatchCaseChecked}),t.createElement("label",{htmlFor:"match-case",className:"k-checkbox-label"},s.toLanguageString(h,l.messages[h]))),t.createElement("span",null,t.createElement(f.Checkbox,{id:"match-whole",checked:L,onChange:this.onMatchWordChecked}),t.createElement("label",{htmlFor:"match-whole",className:"k-checkbox-label"},s.toLanguageString(d,l.messages[d]))),t.createElement("span",null,t.createElement(f.Checkbox,{id:"match-cyclic",checked:q,onChange:this.onMatchCyclicChecked}),t.createElement("label",{htmlFor:"match-cyclic",className:"k-checkbox-label"},s.toLanguageString(g,l.messages[g]))),t.createElement("span",null,t.createElement(f.Checkbox,{id:"regular-expression",checked:I,onChange:this.onUseRegExpChecked}),t.createElement("label",{htmlFor:"regular-expression",className:"k-checkbox-label"},s.toLanguageString(p,l.messages[p])))),T=t.createElement("div",{className:"k-matches-container"},t.createElement(k.Button,{fillMode:"flat",themeColor:"primary",onClick:this.onFindPrev},t.createElement(F.IconWrap,{name:"chevron-left",icon:M.chevronLeftIcon}),s.toLanguageString(C,l.messages[C])),t.createElement("span",null,this.matchesMessage(s.toLanguageString(R,l.messages[R]))),t.createElement(k.Button,{fillMode:"flat",themeColor:"primary",onClick:this.onFindNext},s.toLanguageString(S,l.messages[S]),t.createElement(F.IconWrap,{name:"chevron-right",icon:M.chevronRightIcon}))),y=t.createElement(x.Form,{render:()=>t.createElement(x.FormElement,{horizontal:!0},t.createElement(x.FieldWrapper,null,t.createElement("label",{htmlFor:"findWhat",className:"k-form-label"},s.toLanguageString(o,l.messages[o])),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(f.Input,{id:"findWhat",type:"text",value:D,onChange:this.onSearchChange,onFocus:this.onSearchChange,onKeyDown:this.onKeyDown,autoFocus:!0}))))}),z=t.createElement(x.Form,{render:()=>t.createElement(x.FormElement,{horizontal:!0},t.createElement(x.FieldWrapper,null,t.createElement("label",{htmlFor:"replaceWith",className:"k-form-label"},s.toLanguageString(i,l.messages[i])),t.createElement("div",{className:"k-form-field-wrap"},t.createElement(f.Input,{id:"replaceWith",type:"text",value:O,onChange:this.onReplaceChange}))))});return t.createElement(B.Window,{title:s.toLanguageString(e,l.messages[e]),onClose:this.onClose,style:{width:"auto",height:"auto",userSelect:"none"},resizable:!1,minimizeButton:()=>null,maximizeButton:()=>null},t.createElement(E.TabStrip,{selected:this.state.selectedTab,className:"k-editor-find-replace",onSelect:this.onTabSelect,animation:!1},t.createElement(E.TabStripTab,{title:s.toLanguageString(a,l.messages[a])},y,v,T),t.createElement(E.TabStripTab,{title:s.toLanguageString(c,l.messages[c])},y,z,t.createElement("div",{className:"k-actions k-hstack k-justify-content-end"},t.createElement(k.Button,{disabled:!b,onClick:this.onReplace},s.toLanguageString(n,l.messages[n])),t.createElement(k.Button,{disabled:!b,onClick:this.onReplaceAll},s.toLanguageString(r,l.messages[r]))),v,T)))}};N.registerForLocalization(w);exports.FindAndReplaceDialog=w;
|