@progress/kendo-vue-editor 11.0.0-develop.1 → 11.0.1-develop.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/utils/main.d.ts CHANGED
@@ -16,13 +16,13 @@ export declare namespace EditorUtils {
16
16
  /**
17
17
  * Aligns the block elements in the selection.
18
18
  *
19
- * @returns {boolean} - If alignment is applied to any of the elements, returns `true`.
19
+ * @returns {boolean} - Returns `true` if the function aligns any of the elements.
20
20
  */
21
21
  function alignBlocks(view: EditorView, actions: EditorToolsSettings.AlignAction[], command?: EditorToolsSettings.Command): boolean;
22
22
  /**
23
23
  * Wraps the selection in a `span` element with inline styles.
24
24
  *
25
- * @returns {boolean} - If a style is applied to any of the elements, returns `true`.
25
+ * @returns {boolean} - Returns `true` if the function applies a style to any of the elements.
26
26
  */
27
27
  function applyInlineStyle(view: EditorView, options: {
28
28
  style: string;
@@ -31,28 +31,28 @@ export declare namespace EditorUtils {
31
31
  /**
32
32
  * Applies the link mark.
33
33
  *
34
- * @returns {boolean} - If the link is applied, returns `true`.
34
+ * @returns {boolean} - Returns `true` if the function applies the link.
35
35
  */
36
36
  function applyLink(view: any, options: {
37
37
  mark: string;
38
38
  attrs: any;
39
39
  }, command?: EditorToolsSettings.Command): boolean;
40
40
  /**
41
- * Checks if any of the `list` elements in the selection can be indented.
41
+ * Checks if you can indent any of the `list` elements in the selection.
42
42
  *
43
43
  * @returns {boolean}
44
44
  */
45
45
  function canIndentList(state: EditorState, nodeType: NodeType): boolean;
46
46
  /**
47
- * Checks if a node can be inserted in the current selection.
47
+ * Checks if you can insert a node in the current selection.
48
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.
49
+ * @param {EditorState} state The `state` object of the Editor.
50
+ * @param {NodeType} nodeType The type of the node to insert.
51
+ * @returns {boolean} Returns `true` if you can insert a node of this type in the current selection.
52
52
  */
53
53
  function canInsert(state: EditorState, nodeType: NodeType): boolean;
54
54
  /**
55
- * Checks if any of the `list` elements in the selection can be outdented.
55
+ * Checks if you can outdent any of the `list` elements in the selection.
56
56
  *
57
57
  * @returns {boolean}
58
58
  */
@@ -62,28 +62,28 @@ export declare namespace EditorUtils {
62
62
  bulletList: string;
63
63
  }): boolean;
64
64
  /**
65
- * Converts the MS Word lists into HTML lists.
65
+ * Converts MS Word lists into HTML lists.
66
66
  *
67
- * @param {string} html - The input HTML.
68
- * @returns {string} - The result HTML.
67
+ * @param {string} html The input HTML.
68
+ * @returns {string} The resulting HTML.
69
69
  */
70
70
  function convertMsLists(html: string): string;
71
71
  /**
72
72
  * Creates an Editor document from HTML content.
73
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.
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
78
  */
79
79
  function createDocument(schema: Schema<any, any>, html: string, parseOptions?: ParseOptions): Node;
80
80
  /**
81
81
  * Creates a table.
82
82
  *
83
- * @param {object} tableTypes - An object which contains `table`, `table_row`, and `table_cell` node types.
84
- * @param {number} rows - The number of rows.
85
- * @param {number} columns - The number of columns.
86
- * @returns {Node} - The generated table.
83
+ * @param {object} tableTypes An object that contains the `table`, `table_row`, and `table_cell` node types.
84
+ * @param {number} rows The number of rows.
85
+ * @param {number} columns The number of columns.
86
+ * @returns {Node} The generated table.
87
87
  *
88
88
  * @example
89
89
  * ```jsx-no-run
@@ -104,7 +104,7 @@ export declare namespace EditorUtils {
104
104
  /**
105
105
  * Formats the paragraph and heading nodes in the selection.
106
106
  *
107
- * @returns {boolean} - If an element is formatted, returns `true`.
107
+ * @returns {boolean} Returns `true` if the function formats any element.
108
108
  */
109
109
  function formatBlockElements(view: EditorView, value: 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6', commandName?: EditorToolsSettings.Command): boolean;
110
110
  /**
@@ -116,59 +116,60 @@ export declare namespace EditorUtils {
116
116
  /**
117
117
  * Gets the HTML from the `EditorState` object.
118
118
  *
119
- * @param {EditorState} state - The `state` object of the Editor or an object containing editor's `doc` and `schema`
120
- * - { doc: value, schema: value.types.schema } where the `value` variable is the editor's value prop.
121
- * @returns {string} - The HTML content.
119
+ * @param {EditorState} state The `state` object of the Editor, or an object that contains the `doc` and `schema` of the Editor.
120
+ * For example, `{ doc: value, schema: value.types.schema }`, where `value` is the `value` prop of the Editor.
121
+ * @returns {string} The HTML content.
122
122
  */
123
123
  function getHtml(state: EditorState | {
124
124
  doc: Node;
125
125
  schema: Schema;
126
126
  }): string;
127
127
  /**
128
- * @returns {string[]} - An array of matched styles that are found in the selection.
128
+ * Returns the inline styles in the selection that match the specified style.
129
+ *
130
+ * @returns {string[]} An array of the matching styles in the selection.
129
131
  */
130
132
  function getInlineStyles(state: EditorState, style: {
131
133
  name: string;
132
134
  value: RegExp;
133
135
  }): string[];
134
136
  /**
135
- * Returns a mark of the specified type from the nodes in selection.
137
+ * Returns a mark of the specified type from the nodes in the selection.
136
138
  *
137
- * @returns {Mark}
139
+ * @returns {Mark} The mark of the specified type from the nodes in the selection.
138
140
  */
139
141
  function getMark(state: EditorState, markType: MarkType): Mark | undefined;
140
142
  /**
141
- * Checks if according to the specified `InlineFormatOptions` a node in the selection is present.
143
+ * Checks if the selection contains a node that matches the specified `InlineFormatOptions`.
142
144
  *
143
- * @returns {boolean}
145
+ * @returns {boolean} Returns `true` if the selection contains a node that matches the specified `InlineFormatOptions`.
144
146
  */
145
147
  function hasMark(state: EditorState, options: EditorToolsSettings.InlineFormatOptions): boolean;
146
148
  /**
147
149
  * Checks if the selection contains a specific type of node.
148
150
  *
149
- * @returns {boolean}
151
+ * @returns {boolean} Returns `true` if the selection contains a specific type of node.
150
152
  */
151
153
  function hasNode(state: EditorState, nodeType: NodeType): boolean;
152
154
  /**
153
155
  * Indents the block elements in the selection.
154
156
  *
155
- * @returns {boolean} - If indentation is applied to any of the elements, returns `true`.
157
+ * @returns {boolean} Returns `true` if the function indents any of the elements.
156
158
  */
157
159
  function indentBlocks(view: EditorView, actions: EditorToolsSettings.IndentAction[], command?: EditorToolsSettings.Command, dir?: string): boolean;
158
160
  /**
159
161
  * Adds new lines after block elements and hard breaks.
160
162
  *
161
- * @param {string} content - The HTML content.
162
- * @returns {string} - The indented HTML.
163
+ * @param {string} content The HTML content.
164
+ * @returns {string} The indented HTML.
163
165
  */
164
166
  function indentHtml(content: string): string;
165
167
  /**
166
168
  * Inserts a node in the selection.
167
169
  *
168
- * @param {EditorView} view - The `view` object of the Editor.
169
- * @param {Node} node - A `node` object of the Editor.
170
- * @param {boolean} scrollIntoView - An optional parameter.
171
- * Defines if the content element will be scrolled to the current selection.
170
+ * @param {EditorView} view The `view` object of the Editor.
171
+ * @param {Node} node A `node` object of the Editor.
172
+ * @param {boolean} scrollIntoView Optional. Sets whether the content element scrolls to the current selection.
172
173
  */
173
174
  function insertNode(view: EditorView | {
174
175
  state: EditorState;
@@ -177,20 +178,20 @@ export declare namespace EditorUtils {
177
178
  /**
178
179
  * Checks if any of the block elements in the selection is aligned.
179
180
  *
180
- * @returns {boolean}
181
+ * @returns {boolean} Returns `true` if any of the block elements in the selection is aligned.
181
182
  */
182
183
  function isAligned(state: EditorState, actions: EditorToolsSettings.AlignAction[]): boolean;
183
184
  /**
184
185
  * Checks if any of the block elements in the selection is indented.
185
186
  *
186
- * @returns {boolean}
187
+ * @returns {boolean} Returns `true` if any of the block elements in the selection is indented.
187
188
  */
188
189
  function isIndented(state: any, actions: EditorToolsSettings.IndentAction[], dir?: string): boolean;
189
190
  /**
190
191
  * Removes the comments from the HTML.
191
192
  *
192
- * @param {string} html - The input HTML.
193
- * @returns {string} - The result HTML.
193
+ * @param {string} html The input HTML.
194
+ * @returns {string} The resulting HTML.
194
195
  *
195
196
  * @example
196
197
  * ```jsx-no-run
@@ -202,10 +203,10 @@ export declare namespace EditorUtils {
202
203
  /**
203
204
  * Removes the specified tag from the HTML and keeps its child nodes.
204
205
  *
205
- * @param {string} html - The input HTML.
206
- * @param {string} tag - A tag or multiple tags separated by a vertical slash which will be removed.
206
+ * @param {string} html The input HTML.
207
+ * @param {string} tag The tag to remove. To remove more than one tag, separate them with a vertical bar.
207
208
  * For example, `span` or `b|i|u|span`.
208
- * @returns {string} - The resulting HTML.
209
+ * @returns {string} The resulting HTML.
209
210
  *
210
211
  * @example
211
212
  * ```jsx-no-run
@@ -215,41 +216,41 @@ export declare namespace EditorUtils {
215
216
  */
216
217
  function removeTag(html: string, tag: string): string;
217
218
  /**
218
- * A function for sanitizing the content on paste ([see example]({% slug paste_editor %})).
219
+ * Cleans up the pasted content ([see example](slug:paste_editor)).
219
220
  *
220
- * @param {string} html - The input HTML.
221
- * @param {PasteCleanupSettings} settings - The settings used for sanitizing the content.
222
- * @returns {string} - The resulting HTML.
221
+ * @param {string} html The input HTML.
222
+ * @param {PasteCleanupSettings} settings The settings that the function uses to clean up the content.
223
+ * @returns {string} The resulting HTML.
223
224
  */
224
225
  function pasteCleanup(html: string, settings: PasteCleanupSettings): string;
225
226
  /**
226
- * A function for sanitizing the CSS classes of the pasted from MS Word content ([see example]({% slug paste_editor %})).
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>`.
227
+ * Cleans up the CSS classes of content that you paste from MS Word ([see example](slug:paste_editor)).
228
+ * The function removes every `class` attribute whose value starts with `Mso`.
229
+ * For example, `<p class="MsoNormal">pasted from MS Word</p>` becomes `<p>pasted from MS Word</p>`.
229
230
  *
230
- * @param {Attr} attr - The DOM class attribute that will be sanitized.
231
+ * @param {Attr} attr The DOM `class` attribute to clean up.
231
232
  */
232
233
  function sanitizeClassAttr(attr: Attr): void;
233
234
  /**
234
- * A function for sanitizing the style attributes of the pasted from MS Word content ([see example]({% slug paste_editor %})).
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>`.
235
+ * Cleans up the style attributes of content that you paste from MS Word ([see example](slug:paste_editor)).
236
+ * The function checks all styles and removes the invalid ones.
237
+ * For example, `<p><span style='color:#7C7C7C;mso-themecolor:accent3;mso-themeshade:191;background:silver;'>content</span></p>`
238
+ * becomes `<p><span style="color: #7C7C7C; background: silver;">content</span></p>`.
238
239
  *
239
- * @param {Attr} attr - The DOM style attribute that will be sanitized.
240
+ * @param {Attr} attr The DOM `style` attribute to clean up.
240
241
  */
241
242
  function sanitizeStyleAttr(attr: Attr): void;
242
243
  /**
243
- * A function that will remove a DOM attribute from the pasted content ([see example]({% slug paste_editor %})).
244
+ * Removes a DOM attribute from the pasted content ([see example](slug:paste_editor)).
244
245
  *
245
- * @param {Attr} attr - The DOM attribute that will be removed.
246
+ * @param {Attr} attr The DOM attribute to remove.
246
247
  */
247
248
  function removeAttribute(attr: Attr): void;
248
249
  /**
249
250
  * Removes the invalid HTML.
250
251
  *
251
- * @param {string} html - The HTML which will be sanitized.
252
- * @returns {string} - The sanitized HTML.
252
+ * @param {string} html The HTML to sanitize.
253
+ * @returns {string} The sanitized HTML.
253
254
  *
254
255
  * @example
255
256
  * ```jsx-no-run
@@ -259,43 +260,42 @@ export declare namespace EditorUtils {
259
260
  */
260
261
  function sanitize(html: string): string;
261
262
  /**
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`.
263
+ * Replaces local image sources in the HTML with base64 sources from the RTF data.
264
+ * This happens when you paste images and text from MS Word, because the `src` of each image points to the local file system.
264
265
  *
265
- * @param html - The input HTML (pasted HTML).
266
- * @param clipboardData - The paste event clipboardData object (event.clipboardData).
267
- * @returns - The html with the replaced images sources.
266
+ * @param html The input HTML (the pasted HTML).
267
+ * @param clipboardData The `clipboardData` object of the paste event (`event.clipboardData`).
268
+ * @returns The HTML with the replaced image sources.
268
269
  */
269
270
  function replaceImageSourcesFromRtf(html: string, clipboardData: DataTransfer): string;
270
271
  /**
271
- * Creates a plugin which highlights the matches of Find and Replace dialog.
272
+ * Creates a plugin that highlights the matches of the Find and Replace dialog.
272
273
  *
273
- * @param {PluginKey} key - The key of the plugin (Optional).
274
- * @returns {Plugin} - The text highlight plugin.
274
+ * @param {PluginKey} key Optional. The key of the plugin.
275
+ * @returns {Plugin} The text highlight plugin.
275
276
  */
276
277
  function textHighlight(key?: PluginKey): Plugin;
277
278
  /**
278
- * The image resizing plugin options.
279
+ * Represents the options of the image resizing plugin.
279
280
  */
280
281
  interface ImageResizeOptions extends ImageResizeOptionsCommon {
281
282
  }
282
283
  /**
283
- * Creates a plugin which adds image resizing functionality.
284
+ * Creates a plugin that lets you resize images.
284
285
  *
285
- * @param {ImageResizeOptions} options - The resizing option (Optional).
286
- * @returns {Plugin} - The image resizing plugin.
286
+ * @param {ImageResizeOptions} options Optional. The resizing options.
287
+ * @returns {Plugin} The image resizing plugin.
287
288
  */
288
289
  function imageResizing(options?: ImageResizeOptions): Plugin;
289
290
  /**
290
291
  * Sets the HTML to the `EditorView`.
291
292
  *
292
- * @param {EditorView} view - The `view` object of the Editor.
293
- * @param {string} html - The HTML content.
294
- * @param {Command} command - An optional parameter.
295
- * Defines the type of the command that will be set to the `setHtml` metadata of the transaction.
293
+ * @param {EditorView} view The `view` object of the Editor.
294
+ * @param {string} html The HTML content.
295
+ * @param {Command} command Optional. The type of the command that the function sets to the `setHtml` metadata of the transaction.
296
296
  * Defaults to `SetContent`.
297
- * @param {ParseOptions} parseOptions - An optional parameter.
298
- * Defines the options that will be used for parsing the HTML. Defaults to `{ preserveWhitespace: 'full' }`.
297
+ * @param {ParseOptions} parseOptions Optional. The options that the function uses to parse the HTML.
298
+ * Defaults to `{ preserveWhitespace: 'full' }`.
299
299
  */
300
300
  function setHtml(view: EditorView, html: string, command?: EditorToolsSettings.Command, parseOptions?: ParseOptions): void;
301
301
  /**
@@ -324,11 +324,11 @@ export declare namespace EditorUtils {
324
324
  interface Shortcuts extends shortcuts.Shortcuts {
325
325
  }
326
326
  /**
327
- * A function which returns the mapped `Shortcuts` object based on the passed settings.
328
- * Useful when the default Editor nodes or tool settings are changed and the `Shortcuts` object has to be regenerated.
327
+ * Returns the `Shortcuts` object that matches the settings you pass.
328
+ * Use it when you change the default Editor nodes or tool settings and need to create the `Shortcuts` object again.
329
329
  *
330
- * @params - An object which holds specific types of nodes and tool settings that are used by the default `Shortcuts` handlers.
331
- * @returns - An object which holds the shortcuts.
330
+ * @params An object that holds the node types and tool settings that the default `Shortcuts` handlers use.
331
+ * @returns An object that holds the shortcuts.
332
332
  */
333
333
  function getShortcuts(settings?: {
334
334
  types?: {
@@ -342,11 +342,11 @@ export declare namespace EditorUtils {
342
342
  };
343
343
  }): Shortcuts;
344
344
  /**
345
- * The `PluginKey` used in the Editor to pass editor props to the tools.
345
+ * The `PluginKey` that the Editor uses to pass its props to the tools.
346
346
  */
347
347
  const propsKey: PluginKey;
348
348
  /**
349
- * The `PluginKey` used in the Editor by the image resizing plugin.
349
+ * The `PluginKey` that the image resizing plugin of the Editor uses.
350
350
  */
351
351
  const imageResizeKey: PluginKey;
352
352
  /**