@progress/kendo-react-editor 13.3.0-develop.9 → 13.4.0-develop.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/Editor.d.ts +125 -0
  2. package/Editor.js +1 -1
  3. package/Editor.mjs +77 -77
  4. package/EditorProps.d.ts +406 -0
  5. package/config/defaultStyles.d.ts +19 -0
  6. package/config/pasteSettings.d.ts +13 -0
  7. package/config/schema.d.ts +8 -0
  8. package/config/shortcuts.d.ts +31 -0
  9. package/config/shortcuts.mjs +7 -7
  10. package/config/toolsSettings.d.ts +496 -0
  11. package/dialogs/EditorDialogProps.d.ts +33 -0
  12. package/dialogs/FindReplace.d.ts +79 -0
  13. package/dialogs/FindReplace.mjs +3 -3
  14. package/dialogs/index.d.ts +56 -0
  15. package/dialogs/insertImage.d.ts +35 -0
  16. package/dialogs/insertImage.mjs +3 -3
  17. package/dialogs/insertLink.d.ts +33 -0
  18. package/dialogs/insertLink.mjs +3 -3
  19. package/dialogs/viewHtml.d.ts +32 -0
  20. package/dialogs/viewHtml.mjs +3 -3
  21. package/dist/cdn/js/kendo-react-editor.js +1 -1
  22. package/index.d.mts +176 -3134
  23. package/index.d.ts +176 -3134
  24. package/index.mjs +139 -139
  25. package/messages/index.d.ts +359 -0
  26. package/package-metadata.d.ts +12 -0
  27. package/package-metadata.js +1 -1
  28. package/package-metadata.mjs +10 -16
  29. package/package.json +12 -12
  30. package/tools/ToolProps.d.ts +41 -0
  31. package/tools/align.d.ts +14 -0
  32. package/tools/applyColor.d.ts +19 -0
  33. package/tools/cleanFormatting.d.ts +23 -0
  34. package/tools/findReplace.d.ts +36 -0
  35. package/tools/findReplace.mjs +3 -3
  36. package/tools/fontStyle.d.ts +35 -0
  37. package/tools/fontStyle.mjs +3 -3
  38. package/tools/formatBlock.d.ts +25 -0
  39. package/tools/formatBlock.mjs +3 -3
  40. package/tools/history.d.ts +33 -0
  41. package/tools/indent.d.ts +24 -0
  42. package/tools/index.d.ts +717 -0
  43. package/tools/index.mjs +1 -1
  44. package/tools/inlineFormat.d.ts +54 -0
  45. package/tools/inlineFormat.mjs +3 -3
  46. package/tools/insertImage.d.ts +20 -0
  47. package/tools/insertLink.d.ts +31 -0
  48. package/tools/insertTable/index.d.ts +10 -0
  49. package/tools/insertTable/popup.d.ts +100 -0
  50. package/tools/insertTable/popupGrid.d.ts +38 -0
  51. package/tools/insertTable/tool.d.ts +31 -0
  52. package/tools/lists-styled.d.ts +12 -0
  53. package/tools/lists.d.ts +34 -0
  54. package/tools/outdent.d.ts +24 -0
  55. package/tools/pdf.d.ts +32 -0
  56. package/tools/print.d.ts +23 -0
  57. package/tools/proseMirrorTool.d.ts +19 -0
  58. package/tools/selectAll.d.ts +23 -0
  59. package/tools/table-wizard/cellPropsUtils.d.ts +43 -0
  60. package/tools/table-wizard/cellPropsUtils.mjs +5 -5
  61. package/tools/table-wizard/tableCellProperties.d.ts +27 -0
  62. package/tools/table-wizard/tableProperties.d.ts +18 -0
  63. package/tools/table-wizard/tableProperties.mjs +13 -13
  64. package/tools/table-wizard/tablePropsUtils.d.ts +59 -0
  65. package/tools/table-wizard/tablePropsUtils.mjs +9 -9
  66. package/tools/table-wizard/utils.d.ts +46 -0
  67. package/tools/tableEdit.d.ts +105 -0
  68. package/tools/tableEdit.mjs +3 -3
  69. package/tools/unlink.d.ts +24 -0
  70. package/tools/utils.d.ts +57 -0
  71. package/tools/utils.mjs +1 -1
  72. package/tools/viewHtml.d.ts +31 -0
  73. package/utils/browser-detection.d.ts +11 -0
  74. package/utils/controlled-value.d.ts +12 -0
  75. package/utils/index.d.ts +370 -0
  76. package/utils/props-key.d.ts +12 -0
@@ -0,0 +1,370 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { ImageResizeOptions as ImageResizeOptionsCommon, Schema, NodeSpec, MarkSpec, Node, NodeType, Mark, MarkType, ParseOptions, EditorView, EditorState, Transaction, Plugin, PluginKey } from '@progress/kendo-editor-common';
9
+ import { EditorToolsSettings } from './../config/toolsSettings.js';
10
+ import { PasteCleanupSettings } from '../config/pasteSettings.js';
11
+ import * as shortcuts from './../config/shortcuts.js';
12
+ /**
13
+ * Represents a wrapping namespace for the utility functions, `nodes`, and `marks` objects of the Editor.
14
+ */
15
+ export declare namespace EditorUtils {
16
+ /**
17
+ * Aligns the block elements in the selection.
18
+ *
19
+ * @returns {boolean}—If alignment is applied to any of the elements, returns `true`.
20
+ */
21
+ function alignBlocks(view: EditorView, actions: EditorToolsSettings.AlignAction[], command?: EditorToolsSettings.Command): boolean;
22
+ /**
23
+ * Wraps the selection in a `span` element with inline styles.
24
+ *
25
+ * @returns {boolean}—If a style is applied to any of the elements, returns `true`.
26
+ */
27
+ function applyInlineStyle(view: EditorView, options: {
28
+ style: string;
29
+ value: string;
30
+ }, command?: EditorToolsSettings.Command): boolean;
31
+ /**
32
+ * Applies the link mark.
33
+ *
34
+ * @returns {boolean}—If the link is applied, returns `true`.
35
+ */
36
+ function applyLink(view: any, options: {
37
+ mark: string;
38
+ attrs: any;
39
+ }, command?: EditorToolsSettings.Command): boolean;
40
+ /**
41
+ * Checks if any of the `list` elements in the selection can be indented.
42
+ *
43
+ * @returns {boolean}
44
+ */
45
+ function canIndentList(state: EditorState, nodeType: NodeType): boolean;
46
+ /**
47
+ * Checks if a node can be inserted in the current selection.
48
+ *
49
+ * @param {EditorState} state—The `state` object of the Editor.
50
+ * @param {NodeType} nodeType—The type of the node that will be inserted.
51
+ * @returns {boolean}—The node of this type can be inserted in the current selection.
52
+ */
53
+ function canInsert(state: EditorState, nodeType: NodeType): boolean;
54
+ /**
55
+ * Checks if any of the `list` elements in the selection can be outdented.
56
+ *
57
+ * @returns {boolean}
58
+ */
59
+ function canOutdentList(state: EditorState, listsTypes: {
60
+ listItem: string;
61
+ orderedList: string;
62
+ bulletList: string;
63
+ }): boolean;
64
+ /**
65
+ * Converts the MS Word lists into HTML lists.
66
+ *
67
+ * @param {string} html—The input HTML.
68
+ * @returns {string}—The result HTML.
69
+ */
70
+ function convertMsLists(html: string): string;
71
+ /**
72
+ * Creates an Editor document from HTML content.
73
+ *
74
+ * @param {Schema} schema—The `schema` object of the Editor.
75
+ * @param {string} html—The HTML content.
76
+ * @param {ParseOptions} parseOptions—The HTML parsing options. Defaults to `{ preserveWhitespace: 'full' }`.
77
+ * @returns {Node}—The `document` object of the Editor.
78
+ */
79
+ function createDocument(schema: Schema<any, any>, html: string, parseOptions?: ParseOptions): Node;
80
+ /**
81
+ * Creates a table.
82
+ *
83
+ * @param {object} tableTypes&mdash;An object which contains `table`, `table_row`, and `table_cell` node types.
84
+ * @param {number} rows&mdash;The number of rows.
85
+ * @param {number} columns&mdash;The number of columns.
86
+ * @returns {Node}&mdash;The generated table.
87
+ *
88
+ * @example
89
+ * ```jsx-no-run
90
+ * import { EditorUtils } from '@progress/kendo-react-editor';
91
+ *
92
+ * const nodes = editorRef.view.state.schema.nodes;
93
+ * const rows = 3;
94
+ * const columns = 4;
95
+ *
96
+ * const table = EditorUtils.createTable(nodes, rows, columns);
97
+ * ```
98
+ */
99
+ function createTable(tableTypes: {
100
+ table: NodeType;
101
+ table_row: NodeType;
102
+ table_cell: NodeType;
103
+ }, rows: number, columns: number): Node;
104
+ /**
105
+ * Formats the paragraph and heading nodes in the selection.
106
+ *
107
+ * @returns {boolean}&mdash;If an element is formatted, returns `true`.
108
+ */
109
+ function formatBlockElements(view: EditorView, value: 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6', commandName?: EditorToolsSettings.Command): boolean;
110
+ /**
111
+ * Returns the paragraph and heading nodes in the selection.
112
+ *
113
+ * @returns {string[]}
114
+ */
115
+ function getBlockFormats(state: EditorState): string[];
116
+ /**
117
+ * Gets the HTML from the `EditorState` object.
118
+ *
119
+ * @param {EditorState} state&mdash;The `state` object of the Editor or an object containing editor's `doc` and `schema`
120
+ *&mdash;{ doc: value, schema: value.types.schema } where the `value` variable is the editor's value prop.
121
+ * @returns {string}&mdash;The HTML content.
122
+ */
123
+ function getHtml(state: EditorState | {
124
+ doc: Node;
125
+ schema: Schema;
126
+ }): string;
127
+ /**
128
+ * @returns {string[]}&mdash;An array of matched styles that are found in the selection.
129
+ */
130
+ function getInlineStyles(state: EditorState, style: {
131
+ name: string;
132
+ value: RegExp;
133
+ }): string[];
134
+ /**
135
+ * Returns a mark of the specified type from the nodes in selection.
136
+ *
137
+ * @returns {Mark}
138
+ */
139
+ function getMark(state: EditorState, markType: MarkType): Mark | undefined;
140
+ /**
141
+ * Checks if according to the specified `InlineFormatOptions` a node in the selection is present.
142
+ *
143
+ * @returns {boolean}
144
+ */
145
+ function hasMark(state: EditorState, options: EditorToolsSettings.InlineFormatOptions): boolean;
146
+ /**
147
+ * Checks if the selection contains a specific type of node.
148
+ *
149
+ * @returns {boolean}
150
+ */
151
+ function hasNode(state: EditorState, nodeType: NodeType): boolean;
152
+ /**
153
+ * Indents the block elements in the selection.
154
+ *
155
+ * @returns {boolean}&mdash;If indentation is applied to any of the elements, returns `true`.
156
+ */
157
+ function indentBlocks(view: EditorView, actions: EditorToolsSettings.IndentAction[], command?: EditorToolsSettings.Command, dir?: string): boolean;
158
+ /**
159
+ * Adds new lines after block elements and hard breaks.
160
+ *
161
+ * @param {string} content&mdash;The HTML content.
162
+ * @returns {string}&mdash;The indented HTML.
163
+ */
164
+ function indentHtml(content: string): string;
165
+ /**
166
+ * Inserts a node in the selection.
167
+ *
168
+ * @param {EditorView} view&mdash;The `view` object of the Editor.
169
+ * @param {Node} node&mdash;A `node` object of the Editor.
170
+ * @param {boolean} scrollIntoView&mdash;An optional parameter.
171
+ * Defines if the content element will be scrolled to the current selection.
172
+ */
173
+ function insertNode(view: EditorView | {
174
+ state: EditorState;
175
+ dispatch: (tr: Transaction) => void;
176
+ }, node: Node, scrollIntoView?: boolean | undefined): void;
177
+ /**
178
+ * Checks if any of the block elements in the selection is aligned.
179
+ *
180
+ * @returns {boolean}
181
+ */
182
+ function isAligned(state: EditorState, actions: EditorToolsSettings.AlignAction[]): boolean;
183
+ /**
184
+ * Checks if any of the block elements in the selection is indented.
185
+ *
186
+ * @returns {boolean}
187
+ */
188
+ function isIndented(state: any, actions: EditorToolsSettings.IndentAction[], dir?: string): boolean;
189
+ /**
190
+ * Removes the comments from the HTML.
191
+ *
192
+ * @param {string} html&mdash;The input HTML.
193
+ * @returns {string}&mdash;The result HTML.
194
+ *
195
+ * @example
196
+ * ```jsx-no-run
197
+ * import { EditorUtils } from '@progress/kendo-react-editor';
198
+ * const html = EditorUtils.removeComments('<p>some content<!-- comment --></p>');
199
+ * ```
200
+ */
201
+ function removeComments(html: string): string;
202
+ /**
203
+ * Removes the specified tag from the HTML and keeps its child nodes.
204
+ *
205
+ * @param {string} html&mdash;The input HTML.
206
+ * @param {string} tag&mdash;A tag or multiple tags separated by a vertical slash which will be removed.
207
+ * For example, `span` or `b|i|u|span`.
208
+ * @returns {string}&mdash;The resulting HTML.
209
+ *
210
+ * @example
211
+ * ```jsx-no-run
212
+ * import { EditorUtils } from '@progress/kendo-react-editor';
213
+ * const html = EditorUtils.removeTag('<p>some <span>content</span></p>', 'span|p');
214
+ * ```
215
+ */
216
+ function removeTag(html: string, tag: string): string;
217
+ /**
218
+ * A function for sanitizing the content on paste ([see example](https://www.telerik.com/kendo-react-ui/components/editor/paste)).
219
+ *
220
+ * @param {string} html&mdash;The input HTML.
221
+ * @param {PasteCleanupSettings} settings&mdash;The settings used for sanitizing the content.
222
+ * @returns {string}&mdash;The resulting HTML.
223
+ */
224
+ function pasteCleanup(html: string, settings: PasteCleanupSettings): string;
225
+ /**
226
+ * A function for sanitizing the CSS classes of the pasted from MS Word content ([see example](https://www.telerik.com/kendo-react-ui/components/editor/paste)).
227
+ * The function will remove any class attribute which value starts with `Mso`.
228
+ * For example `<p class="MsoNormal">pasted from MS Word</p>` will result in `<p>pasted from MS Word</p>`.
229
+ *
230
+ * @param {Attr} attr&mdash;The DOM class attribute that will be sanitized.
231
+ */
232
+ function sanitizeClassAttr(attr: Attr): void;
233
+ /**
234
+ * A function for sanitizing the style attributes of the pasted from MS Word content ([see example](https://www.telerik.com/kendo-react-ui/components/editor/paste)).
235
+ * The function will loop through all styles and will remove those that are invalid.
236
+ * For example `<p><span style='color:#7C7C7C;mso-themecolor:accent3;mso-themeshade:191;background:silver;'>content</span></p>`,
237
+ * will result in `<p><span style="color: #7C7C7C; background: silver;">content</span></p>`.
238
+ *
239
+ * @param {Attr} attr&mdash;The DOM style attribute that will be sanitized.
240
+ */
241
+ function sanitizeStyleAttr(attr: Attr): void;
242
+ /**
243
+ * A function that will remove a DOM attribute from the pasted content ([see example](https://www.telerik.com/kendo-react-ui/components/editor/paste)).
244
+ *
245
+ * @param {Attr} attr&mdash;The DOM attribute that will be removed.
246
+ */
247
+ function removeAttribute(attr: Attr): void;
248
+ /**
249
+ * Removes the invalid HTML.
250
+ *
251
+ * @param {string} html&mdash;The HTML which will be sanitized.
252
+ * @returns {string}&mdash;The sanitized HTML.
253
+ *
254
+ * @example
255
+ * ```jsx-no-run
256
+ * import { EditorUtils } from '@progress/kendo-react-editor';
257
+ * const html = EditorUtils.sanitize('something pasted from MS Word, containing <o:p>, <w:sdtPr>, <v:shapes tags');
258
+ * ```
259
+ */
260
+ function sanitize(html: string): string;
261
+ /**
262
+ * If the input `html` contains images with 'src' pointing to local file system (it happens when pasting images and text from MS Word),
263
+ * the function will extract the images sources from the RTF in base64 format and replace them in the input `html`.
264
+ *
265
+ * @param html&mdash;The input HTML (pasted HTML).
266
+ * @param clipboardData&mdash;The paste event clipboardData object (event.clipboardData).
267
+ * @returns&mdash;The html with the replaced images sources.
268
+ */
269
+ function replaceImageSourcesFromRtf(html: string, clipboardData: DataTransfer): string;
270
+ /**
271
+ * Creates a plugin which highlights the matches of Find and Replace dialog.
272
+ *
273
+ * @param {PluginKey} key&mdash;The key of the plugin (Optional).
274
+ * @returns {Plugin}&mdash;The text highlight plugin.
275
+ */
276
+ function textHighlight(key?: PluginKey): Plugin;
277
+ /**
278
+ * The image resizing plugin options.
279
+ */
280
+ interface ImageResizeOptions extends ImageResizeOptionsCommon {
281
+ }
282
+ /**
283
+ * Creates a plugin which adds image resizing functionality.
284
+ *
285
+ * @param {ImageResizeOptions} options&mdash;The resizing option (Optional).
286
+ * @returns {Plugin}&mdash;The image resizing plugin.
287
+ */
288
+ function imageResizing(options?: ImageResizeOptions): Plugin;
289
+ /**
290
+ * Returns a collection of plugins that adds table resizing functionality.
291
+ *
292
+ * @returns {Plugin[]}&mdash;The table resizing plugins.
293
+ */
294
+ function tableResizing(): Plugin[];
295
+ /**
296
+ * Sets the HTML to the `EditorView`.
297
+ *
298
+ * @param {EditorView} view&mdash;The `view` object of the Editor.
299
+ * @param {string} html&mdash;The HTML content.
300
+ * @param {Command} command&mdash;An optional parameter.
301
+ * Defines the type of the command that will be set to the `setHtml` metadata of the transaction.
302
+ * Defaults to `SetContent`.
303
+ * @param {ParseOptions} parseOptions&mdash;An optional parameter.
304
+ * Defines the options that will be used for parsing the HTML. Defaults to `{ preserveWhitespace: 'full' }`.
305
+ */
306
+ function setHtml(view: EditorView, html: string, command?: EditorToolsSettings.Command, parseOptions?: ParseOptions): void;
307
+ /**
308
+ * Toggles the inline element formatting according to the `InlineFormatOptions` and `markAttrs` settings.
309
+ *
310
+ * @returns {boolean}
311
+ */
312
+ function toggleInlineFormat(view: {
313
+ state: EditorState;
314
+ dispatch: (tr: Transaction) => void;
315
+ }, options: EditorToolsSettings.InlineFormatOptions, transaction?: Transaction, markAttrs?: any): boolean;
316
+ /**
317
+ * Toggles a list of the specified type.
318
+ *
319
+ * @returns {boolean}
320
+ */
321
+ function toggleList(view: EditorView, types: {
322
+ listType: string;
323
+ orderedList: string;
324
+ bulletList: string;
325
+ listItem: string;
326
+ }, command?: EditorToolsSettings.Command): boolean;
327
+ /**
328
+ * Represents the `Shortcuts` object.
329
+ */
330
+ interface Shortcuts extends shortcuts.Shortcuts {
331
+ }
332
+ /**
333
+ * A function which returns the mapped `Shortcuts` object based on the passed settings.
334
+ * Useful when the default Editor nodes or tool settings are changed and the `Shortcuts` object has to be regenerated.
335
+ *
336
+ * @params&mdash;An object which holds specific types of nodes and tool settings that are used by the default `Shortcuts` handlers.
337
+ * @returns&mdash;An object which holds the shortcuts.
338
+ */
339
+ function getShortcuts(settings?: {
340
+ types?: {
341
+ listItem: string;
342
+ hardBreak: string;
343
+ };
344
+ toolsSettings?: {
345
+ bold?: EditorToolsSettings.InlineFormatOptions;
346
+ italic?: EditorToolsSettings.InlineFormatOptions;
347
+ underline?: EditorToolsSettings.InlineFormatOptions;
348
+ };
349
+ }): Shortcuts;
350
+ /**
351
+ * The `PluginKey` used in the Editor to pass editor props to the tools.
352
+ */
353
+ const propsKey: PluginKey;
354
+ /**
355
+ * The `PluginKey` used in the Editor by the image resizing plugin.
356
+ */
357
+ const imageResizeKey: PluginKey;
358
+ /**
359
+ * Represents the `marks` object of the Editor.
360
+ */
361
+ const marks: {
362
+ [mark: string]: MarkSpec;
363
+ };
364
+ /**
365
+ * Represents the `nodes` object of the Editor.
366
+ */
367
+ const nodes: {
368
+ [node: string]: NodeSpec;
369
+ };
370
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2026 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ import { PluginKey } from '@progress/kendo-editor-common';
9
+ /**
10
+ * @hidden
11
+ */
12
+ export declare const editorPropsKey: PluginKey<any>;