@progress/kendo-vue-editor 11.0.0 → 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/Editor.d.ts +15 -52
- package/EditorProps.d.ts +57 -43
- package/config/pasteSettings.d.ts +1 -1
- package/config/toolsSettings.d.ts +72 -33
- package/dist/cdn/js/kendo-vue-editor.js +1 -1
- package/index.d.mts +1 -1
- package/index.d.ts +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -13
- package/tools/ToolProps.d.ts +2 -2
- package/tools/pdf.d.ts +3 -3
- package/tools/print.d.ts +1 -1
- package/utils/cleanup.d.ts +5 -5
- package/utils/main.d.ts +85 -85
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} -
|
|
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} -
|
|
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} -
|
|
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
|
|
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
|
|
47
|
+
* Checks if you can insert a node in the current selection.
|
|
48
48
|
*
|
|
49
|
-
* @param {EditorState} state
|
|
50
|
-
* @param {NodeType} nodeType
|
|
51
|
-
* @returns {boolean}
|
|
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
|
|
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
|
|
65
|
+
* Converts MS Word lists into HTML lists.
|
|
66
66
|
*
|
|
67
|
-
* @param {string} html
|
|
68
|
-
* @returns {string}
|
|
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
|
|
75
|
-
* @param {string} html
|
|
76
|
-
* @param {ParseOptions} parseOptions
|
|
77
|
-
* @returns {Node}
|
|
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
|
|
84
|
-
* @param {number} rows
|
|
85
|
-
* @param {number} columns
|
|
86
|
-
* @returns {Node}
|
|
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}
|
|
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
|
|
120
|
-
*
|
|
121
|
-
* @returns {string}
|
|
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
|
-
*
|
|
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
|
|
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}
|
|
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
|
|
162
|
-
* @returns {string}
|
|
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
|
|
169
|
-
* @param {Node} node
|
|
170
|
-
* @param {boolean} scrollIntoView
|
|
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
|
|
193
|
-
* @returns {string}
|
|
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
|
|
206
|
-
* @param {string} tag
|
|
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}
|
|
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
|
-
*
|
|
219
|
+
* Cleans up the pasted content ([see example](slug:paste_editor)).
|
|
219
220
|
*
|
|
220
|
-
* @param {string} html
|
|
221
|
-
* @param {PasteCleanupSettings} settings
|
|
222
|
-
* @returns {string}
|
|
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
|
-
*
|
|
227
|
-
* The function
|
|
228
|
-
* For example `<p class="MsoNormal">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
|
|
231
|
+
* @param {Attr} attr The DOM `class` attribute to clean up.
|
|
231
232
|
*/
|
|
232
233
|
function sanitizeClassAttr(attr: Attr): void;
|
|
233
234
|
/**
|
|
234
|
-
*
|
|
235
|
-
* The function
|
|
236
|
-
* For example `<p><span style='color:#7C7C7C;mso-themecolor:accent3;mso-themeshade:191;background:silver;'>content</span></p
|
|
237
|
-
*
|
|
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
|
|
240
|
+
* @param {Attr} attr The DOM `style` attribute to clean up.
|
|
240
241
|
*/
|
|
241
242
|
function sanitizeStyleAttr(attr: Attr): void;
|
|
242
243
|
/**
|
|
243
|
-
*
|
|
244
|
+
* Removes a DOM attribute from the pasted content ([see example](slug:paste_editor)).
|
|
244
245
|
*
|
|
245
|
-
* @param {Attr} attr
|
|
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
|
|
252
|
-
* @returns {string}
|
|
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
|
-
*
|
|
263
|
-
*
|
|
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
|
|
266
|
-
* @param clipboardData
|
|
267
|
-
* @returns
|
|
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
|
|
272
|
+
* Creates a plugin that highlights the matches of the Find and Replace dialog.
|
|
272
273
|
*
|
|
273
|
-
* @param {PluginKey} key
|
|
274
|
-
* @returns {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
|
-
*
|
|
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
|
|
284
|
+
* Creates a plugin that lets you resize images.
|
|
284
285
|
*
|
|
285
|
-
* @param {ImageResizeOptions} options
|
|
286
|
-
* @returns {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
|
|
293
|
-
* @param {string} html
|
|
294
|
-
* @param {Command} command
|
|
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
|
|
298
|
-
*
|
|
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
|
-
*
|
|
328
|
-
*
|
|
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
|
|
331
|
-
* @returns
|
|
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`
|
|
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`
|
|
349
|
+
* The `PluginKey` that the image resizing plugin of the Editor uses.
|
|
350
350
|
*/
|
|
351
351
|
const imageResizeKey: PluginKey;
|
|
352
352
|
/**
|