@progress/kendo-react-editor 5.2.0 → 5.3.0-dev.202205040828
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/dist/cdn/js/kendo-react-editor.js +1 -1
- package/dist/es/config/defaultStyles.d.ts +2 -2
- package/dist/es/config/defaultStyles.js +2 -2
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/utils/index.d.ts +59 -53
- package/dist/es/utils/index.js +63 -54
- package/dist/npm/config/defaultStyles.d.ts +2 -2
- package/dist/npm/config/defaultStyles.js +2 -2
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/utils/index.d.ts +59 -53
- package/dist/npm/utils/index.js +62 -53
- package/dist/systemjs/kendo-react-editor.js +1 -1
- package/package.json +13 -13
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @hidden
|
|
3
3
|
*/
|
|
4
|
-
export declare const defaultStyle = "\nhtml, body {\n margin: 0;\n height: 100%;\n padding: 0;\n}\n\nhtml {\n min-height: 100%;\n}\n\nbody {\n box-sizing: border-box;\n position: relative;\n word-wrap: break-word;\n padding: 8px;\n}\n\nbody > .k-content {\n outline: 0;\n height: 100%;\n white-space: pre-wrap;\n}\n\n.k-content > p {\n margin: 0 0 1em;\n}\n\n.k-content table {\n white-space: pre-wrap;\n}\n\n.k-content .k-text-selected, .k-content::selection {\n color: HighlightText;\n background-color: Highlight;\n}\n\n.k-content .k-text-highlighted {\n background-color: #bbdefb;\n}\n\n.k-content .ProseMirror-selectednode {\n outline: 2px solid #8cf;\n}\n\n.ProseMirror-hideselection *::selection { background: transparent; }\n.ProseMirror-hideselection *::-moz-selection { background: transparent; }\n.ProseMirror-hideselection { caret-color: transparent; }\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.k-editor-resize-handles-wrapper {\n position: absolute;\n visibility: hidden;\n}\n\n.k-editor-resize-handle {\n position: absolute;\n visibility: visible;\n background-color: #fff;\n border: 1px solid #000;\n z-index: 100;\n width: 5px;\n height: 5px;\n}\n\n.k-editor-resize-handle.northwest {\n top: 0;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: nw-resize;\n}\n\n.k-editor-resize-handle.north {\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n cursor: n-resize;\n}\n\n.k-editor-resize-handle.northeast {\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n cursor: ne-resize;\n}\n\n.k-editor-resize-handle.southwest {\n left: 0;\n bottom: 0;\n transform: translate(-50%, 50%);\n cursor: sw-resize;\n}\n\n.k-editor-resize-handle.south {\n bottom: 0;\n left: 50%;\n transform: translate(-50%, 50%);\n cursor: s-resize;\n}\n\n.k-editor-resize-handle.southeast {\n right: 0;\n bottom: 0;\n transform: translate(50%, 50%);\n cursor: se-resize;\n}\n\n.k-editor-resize-handle.west {\n top: 50%;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: w-resize;\n}\n\n.k-editor-resize-handle.east {\n top: 50%;\n right: 0;\n transform: translate(50%, -50%);\n cursor: e-resize;\n}\n";
|
|
4
|
+
export declare const defaultStyle = "\nhtml, body {\n margin: 0;\n height: 100%;\n padding: 0;\n}\n\nhtml {\n min-height: 100%;\n}\n\nbody {\n box-sizing: border-box;\n position: relative;\n word-wrap: break-word;\n padding: 8px;\n}\n\nbody > .k-content {\n outline: 0;\n height: 100%;\n white-space: pre-wrap;\n}\n\n.k-content > p {\n margin: 0 0 1em;\n}\n\n.k-content table {\n white-space: pre-wrap;\n}\n\n.k-content .k-text-selected, .k-content::selection {\n color: HighlightText;\n background-color: Highlight;\n}\n\n.k-content .k-text-highlighted {\n background-color: #bbdefb;\n}\n\n.k-content .ProseMirror-selectednode {\n outline: 2px solid #8cf;\n}\n\n.ProseMirror-hideselection *::selection { background: transparent; }\n.ProseMirror-hideselection *::-moz-selection { background: transparent; }\n.ProseMirror-hideselection { caret-color: transparent; }\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.k-editor-resize-handles-wrapper {\n position: absolute;\n visibility: hidden;\n}\n\n.k-editor-resize-handle {\n position: absolute;\n visibility: visible;\n background-color: #fff;\n border: 1px solid #000;\n z-index: 100;\n width: 5px;\n height: 5px;\n}\n\n.k-editor-resize-handle.northwest {\n top: 0;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: nw-resize;\n}\n\n.k-editor-resize-handle.north {\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n cursor: n-resize;\n}\n\n.k-editor-resize-handle.northeast {\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n cursor: ne-resize;\n}\n\n.k-editor-resize-handle.southwest {\n left: 0;\n bottom: 0;\n transform: translate(-50%, 50%);\n cursor: sw-resize;\n}\n\n.k-editor-resize-handle.south {\n bottom: 0;\n left: 50%;\n transform: translate(-50%, 50%);\n cursor: s-resize;\n}\n\n.k-editor-resize-handle.southeast {\n right: 0;\n bottom: 0;\n transform: translate(50%, 50%);\n cursor: se-resize;\n}\n\n.k-editor-resize-handle.west {\n top: 50%;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: w-resize;\n}\n\n.k-editor-resize-handle.east {\n top: 50%;\n right: 0;\n transform: translate(50%, -50%);\n cursor: e-resize;\n}\n\n.k-editor-resize-wrap-element {\n display: inline-block;\n position: relative;\n}\n\n.ProseMirror .row-resize-handle {\n position: absolute;\n right: 0; left: 0; bottom: 0;\n transform: translate(0, 50%);\n height: 4px;\n z-index: 20;\n background-color: #adf;\n pointer-events: none;\n}\n\n.ProseMirror .column-resize-handle {\n position: absolute;\n right: -2px; top: 0; bottom: 0;\n width: 4px;\n z-index: 20;\n background-color: #adf;\n pointer-events: none;\n}\n\n.ProseMirror.resize-cursor {\n cursor: ew-resize;\n cursor: col-resize;\n}\n\n.ProseMirror.resize-cursor-vertical {\n cursor: sn-resize;\n cursor: row-resize;\n}\n\n.k-editor-resize-wrap-element table td p,\n.k-editor-resize-wrap-element table th p {\n margin: 0 auto;\n}\n";
|
|
5
5
|
/**
|
|
6
6
|
* @hidden
|
|
7
7
|
*/
|
|
8
|
-
export declare const tablesStyles = "\n .ProseMirror .tableWrapper {\n overflow-x: auto;\n margin: 1em 0;\n }\n\n .ProseMirror table {\n margin: 0;\n border-collapse: collapse;\n table-layout: fixed;\n width: 100%;\n overflow: hidden;\n }\n\n .ProseMirror td, .ProseMirror th {\n min-width: 1em;\n border: 1px solid #ddd;\n padding: 3px 5px;\n vertical-align: top;\n box-sizing: border-box;\n position: relative;\n }\n\n .ProseMirror th {\n font-weight: bold;\n text-align: left;\n }\n\n
|
|
8
|
+
export declare const tablesStyles = "\n .ProseMirror .tableWrapper {\n overflow-x: auto;\n margin: 1em 0;\n }\n\n .ProseMirror table {\n margin: 0;\n border-collapse: collapse;\n table-layout: fixed;\n width: 100%;\n overflow: hidden;\n }\n\n .ProseMirror td, .ProseMirror th {\n min-width: 1em;\n border: 1px solid #ddd;\n padding: 3px 5px;\n vertical-align: top;\n box-sizing: border-box;\n position: relative;\n }\n\n .ProseMirror th {\n font-weight: bold;\n text-align: left;\n }\n\n /* Give selected cells a blue overlay */\n .ProseMirror .selectedCell:after {\n z-index: 2;\n position: absolute;\n content: \"\";\n left: 0; right: 0; top: 0; bottom: 0;\n background: rgba(200, 200, 255, 0.4);\n pointer-events: none;\n }\n";
|
|
9
9
|
/**
|
|
10
10
|
* @hidden
|
|
11
11
|
*/
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @hidden
|
|
3
3
|
*/
|
|
4
|
-
export var defaultStyle = "\nhtml, body {\n margin: 0;\n height: 100%;\n padding: 0;\n}\n\nhtml {\n min-height: 100%;\n}\n\nbody {\n box-sizing: border-box;\n position: relative;\n word-wrap: break-word;\n padding: 8px;\n}\n\nbody > .k-content {\n outline: 0;\n height: 100%;\n white-space: pre-wrap;\n}\n\n.k-content > p {\n margin: 0 0 1em;\n}\n\n.k-content table {\n white-space: pre-wrap;\n}\n\n.k-content .k-text-selected, .k-content::selection {\n color: HighlightText;\n background-color: Highlight;\n}\n\n.k-content .k-text-highlighted {\n background-color: #bbdefb;\n}\n\n.k-content .ProseMirror-selectednode {\n outline: 2px solid #8cf;\n}\n\n.ProseMirror-hideselection *::selection { background: transparent; }\n.ProseMirror-hideselection *::-moz-selection { background: transparent; }\n.ProseMirror-hideselection { caret-color: transparent; }\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.k-editor-resize-handles-wrapper {\n position: absolute;\n visibility: hidden;\n}\n\n.k-editor-resize-handle {\n position: absolute;\n visibility: visible;\n background-color: #fff;\n border: 1px solid #000;\n z-index: 100;\n width: 5px;\n height: 5px;\n}\n\n.k-editor-resize-handle.northwest {\n top: 0;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: nw-resize;\n}\n\n.k-editor-resize-handle.north {\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n cursor: n-resize;\n}\n\n.k-editor-resize-handle.northeast {\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n cursor: ne-resize;\n}\n\n.k-editor-resize-handle.southwest {\n left: 0;\n bottom: 0;\n transform: translate(-50%, 50%);\n cursor: sw-resize;\n}\n\n.k-editor-resize-handle.south {\n bottom: 0;\n left: 50%;\n transform: translate(-50%, 50%);\n cursor: s-resize;\n}\n\n.k-editor-resize-handle.southeast {\n right: 0;\n bottom: 0;\n transform: translate(50%, 50%);\n cursor: se-resize;\n}\n\n.k-editor-resize-handle.west {\n top: 50%;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: w-resize;\n}\n\n.k-editor-resize-handle.east {\n top: 50%;\n right: 0;\n transform: translate(50%, -50%);\n cursor: e-resize;\n}\n";
|
|
4
|
+
export var defaultStyle = "\nhtml, body {\n margin: 0;\n height: 100%;\n padding: 0;\n}\n\nhtml {\n min-height: 100%;\n}\n\nbody {\n box-sizing: border-box;\n position: relative;\n word-wrap: break-word;\n padding: 8px;\n}\n\nbody > .k-content {\n outline: 0;\n height: 100%;\n white-space: pre-wrap;\n}\n\n.k-content > p {\n margin: 0 0 1em;\n}\n\n.k-content table {\n white-space: pre-wrap;\n}\n\n.k-content .k-text-selected, .k-content::selection {\n color: HighlightText;\n background-color: Highlight;\n}\n\n.k-content .k-text-highlighted {\n background-color: #bbdefb;\n}\n\n.k-content .ProseMirror-selectednode {\n outline: 2px solid #8cf;\n}\n\n.ProseMirror-hideselection *::selection { background: transparent; }\n.ProseMirror-hideselection *::-moz-selection { background: transparent; }\n.ProseMirror-hideselection { caret-color: transparent; }\n\n.ProseMirror-gapcursor {\n display: none;\n pointer-events: none;\n position: absolute;\n}\n\n.ProseMirror-gapcursor:after {\n content: \"\";\n display: block;\n position: absolute;\n top: -2px;\n width: 20px;\n border-top: 1px solid black;\n animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;\n}\n\n@keyframes ProseMirror-cursor-blink {\n to {\n visibility: hidden;\n }\n}\n\n.ProseMirror-focused .ProseMirror-gapcursor {\n display: block;\n}\n\n.k-editor-resize-handles-wrapper {\n position: absolute;\n visibility: hidden;\n}\n\n.k-editor-resize-handle {\n position: absolute;\n visibility: visible;\n background-color: #fff;\n border: 1px solid #000;\n z-index: 100;\n width: 5px;\n height: 5px;\n}\n\n.k-editor-resize-handle.northwest {\n top: 0;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: nw-resize;\n}\n\n.k-editor-resize-handle.north {\n top: 0;\n left: 50%;\n transform: translate(-50%, -50%);\n cursor: n-resize;\n}\n\n.k-editor-resize-handle.northeast {\n top: 0;\n right: 0;\n transform: translate(50%, -50%);\n cursor: ne-resize;\n}\n\n.k-editor-resize-handle.southwest {\n left: 0;\n bottom: 0;\n transform: translate(-50%, 50%);\n cursor: sw-resize;\n}\n\n.k-editor-resize-handle.south {\n bottom: 0;\n left: 50%;\n transform: translate(-50%, 50%);\n cursor: s-resize;\n}\n\n.k-editor-resize-handle.southeast {\n right: 0;\n bottom: 0;\n transform: translate(50%, 50%);\n cursor: se-resize;\n}\n\n.k-editor-resize-handle.west {\n top: 50%;\n left: 0;\n transform: translate(-50%, -50%);\n cursor: w-resize;\n}\n\n.k-editor-resize-handle.east {\n top: 50%;\n right: 0;\n transform: translate(50%, -50%);\n cursor: e-resize;\n}\n\n.k-editor-resize-wrap-element {\n display: inline-block;\n position: relative;\n}\n\n.ProseMirror .row-resize-handle {\n position: absolute;\n right: 0; left: 0; bottom: 0;\n transform: translate(0, 50%);\n height: 4px;\n z-index: 20;\n background-color: #adf;\n pointer-events: none;\n}\n\n.ProseMirror .column-resize-handle {\n position: absolute;\n right: -2px; top: 0; bottom: 0;\n width: 4px;\n z-index: 20;\n background-color: #adf;\n pointer-events: none;\n}\n\n.ProseMirror.resize-cursor {\n cursor: ew-resize;\n cursor: col-resize;\n}\n\n.ProseMirror.resize-cursor-vertical {\n cursor: sn-resize;\n cursor: row-resize;\n}\n\n.k-editor-resize-wrap-element table td p,\n.k-editor-resize-wrap-element table th p {\n margin: 0 auto;\n}\n";
|
|
5
5
|
/**
|
|
6
6
|
* @hidden
|
|
7
7
|
*/
|
|
8
|
-
export var tablesStyles = "\n .ProseMirror .tableWrapper {\n overflow-x: auto;\n margin: 1em 0;\n }\n\n .ProseMirror table {\n margin: 0;\n border-collapse: collapse;\n table-layout: fixed;\n width: 100%;\n overflow: hidden;\n }\n\n .ProseMirror td, .ProseMirror th {\n min-width: 1em;\n border: 1px solid #ddd;\n padding: 3px 5px;\n vertical-align: top;\n box-sizing: border-box;\n position: relative;\n }\n\n .ProseMirror th {\n font-weight: bold;\n text-align: left;\n }\n\n
|
|
8
|
+
export var tablesStyles = "\n .ProseMirror .tableWrapper {\n overflow-x: auto;\n margin: 1em 0;\n }\n\n .ProseMirror table {\n margin: 0;\n border-collapse: collapse;\n table-layout: fixed;\n width: 100%;\n overflow: hidden;\n }\n\n .ProseMirror td, .ProseMirror th {\n min-width: 1em;\n border: 1px solid #ddd;\n padding: 3px 5px;\n vertical-align: top;\n box-sizing: border-box;\n position: relative;\n }\n\n .ProseMirror th {\n font-weight: bold;\n text-align: left;\n }\n\n /* Give selected cells a blue overlay */\n .ProseMirror .selectedCell:after {\n z-index: 2;\n position: absolute;\n content: \"\";\n left: 0; right: 0; top: 0; bottom: 0;\n background: rgba(200, 200, 255, 0.4);\n pointer-events: none;\n }\n";
|
|
9
9
|
/**
|
|
10
10
|
* @hidden
|
|
11
11
|
*/
|
|
@@ -5,7 +5,7 @@ export var packageMetadata = {
|
|
|
5
5
|
name: '@progress/kendo-react-editor',
|
|
6
6
|
productName: 'KendoReact',
|
|
7
7
|
productCodes: ['KENDOUIREACT', 'KENDOUICOMPLETE'],
|
|
8
|
-
publishDate:
|
|
8
|
+
publishDate: 1651652236,
|
|
9
9
|
version: '',
|
|
10
10
|
licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning'
|
|
11
11
|
};
|
package/dist/es/utils/index.d.ts
CHANGED
|
@@ -10,13 +10,13 @@ export declare namespace EditorUtils {
|
|
|
10
10
|
/**
|
|
11
11
|
* Aligns the block elements in the selection.
|
|
12
12
|
*
|
|
13
|
-
* @returns {boolean}
|
|
13
|
+
* @returns {boolean}—If alignment is applied to any of the elements, returns `true`.
|
|
14
14
|
*/
|
|
15
15
|
function alignBlocks(view: EditorView<any>, actions: EditorToolsSettings.AlignAction[], command?: EditorToolsSettings.Command): boolean;
|
|
16
16
|
/**
|
|
17
17
|
* Wraps the selection in a `span` element with inline styles.
|
|
18
18
|
*
|
|
19
|
-
* @returns {boolean}
|
|
19
|
+
* @returns {boolean}—If a style is applied to any of the elements, returns `true`.
|
|
20
20
|
*/
|
|
21
21
|
function applyInlineStyle(view: EditorView<any>, options: {
|
|
22
22
|
style: string;
|
|
@@ -25,7 +25,7 @@ export declare namespace EditorUtils {
|
|
|
25
25
|
/**
|
|
26
26
|
* Applies the link mark.
|
|
27
27
|
*
|
|
28
|
-
* @returns {boolean}
|
|
28
|
+
* @returns {boolean}—If the link is applied, returns `true`.
|
|
29
29
|
*/
|
|
30
30
|
function applyLink(view: any, options: {
|
|
31
31
|
mark: string;
|
|
@@ -40,9 +40,9 @@ export declare namespace EditorUtils {
|
|
|
40
40
|
/**
|
|
41
41
|
* Checks if a node can be inserted in the current selection.
|
|
42
42
|
*
|
|
43
|
-
* @param {EditorState} state
|
|
44
|
-
* @param {NodeType} nodeType
|
|
45
|
-
* @returns {boolean}
|
|
43
|
+
* @param {EditorState} state—The `state` object of the Editor.
|
|
44
|
+
* @param {NodeType} nodeType—The type of the node that will be inserted.
|
|
45
|
+
* @returns {boolean}—The node of this type can be inserted in the current selection.
|
|
46
46
|
*/
|
|
47
47
|
function canInsert(state: EditorState<any>, nodeType: NodeType<any>): boolean;
|
|
48
48
|
/**
|
|
@@ -58,26 +58,26 @@ export declare namespace EditorUtils {
|
|
|
58
58
|
/**
|
|
59
59
|
* Converts the MS Word lists into HTML lists.
|
|
60
60
|
*
|
|
61
|
-
* @param {string} html
|
|
62
|
-
* @returns {string}
|
|
61
|
+
* @param {string} html—The input HTML.
|
|
62
|
+
* @returns {string}—The result HTML.
|
|
63
63
|
*/
|
|
64
64
|
function convertMsLists(html: string): string;
|
|
65
65
|
/**
|
|
66
66
|
* Creates an Editor document from HTML content.
|
|
67
67
|
*
|
|
68
|
-
* @param {Schema} schema
|
|
69
|
-
* @param {string} html
|
|
70
|
-
* @param {ParseOptions} parseOptions
|
|
71
|
-
* @returns {Node}
|
|
68
|
+
* @param {Schema} schema—The `schema` object of the Editor.
|
|
69
|
+
* @param {string} html—The HTML content.
|
|
70
|
+
* @param {ParseOptions} parseOptions—The HTML parsing options. Defaults to `{ preserveWhitespace: 'full' }`.
|
|
71
|
+
* @returns {Node}—The `document` object of the Editor.
|
|
72
72
|
*/
|
|
73
73
|
function createDocument(schema: Schema<any, any>, html: string, parseOptions?: ParseOptions<any>): Node<any>;
|
|
74
74
|
/**
|
|
75
75
|
* Creates a table.
|
|
76
76
|
*
|
|
77
|
-
* @param {object} tableTypes
|
|
78
|
-
* @param {number} rows
|
|
79
|
-
* @param {number} columns
|
|
80
|
-
* @returns {Node<any>}
|
|
77
|
+
* @param {object} tableTypes—An object which contains `table`, `table_row`, and `table_cell` node types.
|
|
78
|
+
* @param {number} rows—The number of rows.
|
|
79
|
+
* @param {number} columns—The number of columns.
|
|
80
|
+
* @returns {Node<any>}—The generated table.
|
|
81
81
|
*
|
|
82
82
|
* @example
|
|
83
83
|
* ```jsx-no-run
|
|
@@ -98,7 +98,7 @@ export declare namespace EditorUtils {
|
|
|
98
98
|
/**
|
|
99
99
|
* Formats the paragraph and heading nodes in the selection.
|
|
100
100
|
*
|
|
101
|
-
* @returns {boolean}
|
|
101
|
+
* @returns {boolean}—If an element is formatted, returns `true`.
|
|
102
102
|
*/
|
|
103
103
|
function formatBlockElements(view: EditorView<any>, value: 'p' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6', commandName?: EditorToolsSettings.Command): boolean;
|
|
104
104
|
/**
|
|
@@ -110,16 +110,16 @@ export declare namespace EditorUtils {
|
|
|
110
110
|
/**
|
|
111
111
|
* Gets the HTML from the `EditorState` object.
|
|
112
112
|
*
|
|
113
|
-
* @param {EditorState} state
|
|
114
|
-
|
|
115
|
-
* @returns {string}
|
|
113
|
+
* @param {EditorState} state—The `state` object of the Editor or an object containing editor's `doc` and `schema`
|
|
114
|
+
*—{ doc: value, schema: value.types.schema } where the `value` variable is the editor's value prop.
|
|
115
|
+
* @returns {string}—The HTML content.
|
|
116
116
|
*/
|
|
117
117
|
function getHtml(state: EditorState<any> | {
|
|
118
118
|
doc: Node;
|
|
119
119
|
schema: Schema;
|
|
120
120
|
}): string;
|
|
121
121
|
/**
|
|
122
|
-
* @returns {string[]}
|
|
122
|
+
* @returns {string[]}—An array of matched styles that are found in the selection.
|
|
123
123
|
*/
|
|
124
124
|
function getInlineStyles(state: EditorState<any>, style: {
|
|
125
125
|
name: string;
|
|
@@ -146,22 +146,22 @@ export declare namespace EditorUtils {
|
|
|
146
146
|
/**
|
|
147
147
|
* Indents the block elements in the selection.
|
|
148
148
|
*
|
|
149
|
-
* @returns {boolean}
|
|
149
|
+
* @returns {boolean}—If indentation is applied to any of the elements, returns `true`.
|
|
150
150
|
*/
|
|
151
151
|
function indentBlocks(view: EditorView<any>, actions: EditorToolsSettings.IndentAction[], command?: EditorToolsSettings.Command, dir?: string): boolean;
|
|
152
152
|
/**
|
|
153
153
|
* Adds new lines after block elements and hard breaks.
|
|
154
154
|
*
|
|
155
|
-
* @param {string} content
|
|
156
|
-
* @returns {string}
|
|
155
|
+
* @param {string} content—The HTML content.
|
|
156
|
+
* @returns {string}—The indented HTML.
|
|
157
157
|
*/
|
|
158
158
|
function indentHtml(content: string): string;
|
|
159
159
|
/**
|
|
160
160
|
* Inserts a node in the selection.
|
|
161
161
|
*
|
|
162
|
-
* @param {EditorView} view
|
|
163
|
-
* @param {Node} node
|
|
164
|
-
* @param {boolean} scrollIntoView
|
|
162
|
+
* @param {EditorView} view—The `view` object of the Editor.
|
|
163
|
+
* @param {Node} node—A `node` object of the Editor.
|
|
164
|
+
* @param {boolean} scrollIntoView—An optional parameter.
|
|
165
165
|
* Defines if the content element will be scrolled to the current selection.
|
|
166
166
|
*/
|
|
167
167
|
function insertNode(view: EditorView<any> | {
|
|
@@ -183,8 +183,8 @@ export declare namespace EditorUtils {
|
|
|
183
183
|
/**
|
|
184
184
|
* Removes the comments from the HTML.
|
|
185
185
|
*
|
|
186
|
-
* @param {string} html
|
|
187
|
-
* @returns {string}
|
|
186
|
+
* @param {string} html—The input HTML.
|
|
187
|
+
* @returns {string}—The result HTML.
|
|
188
188
|
*
|
|
189
189
|
* @example
|
|
190
190
|
* ```jsx-no-run
|
|
@@ -196,10 +196,10 @@ export declare namespace EditorUtils {
|
|
|
196
196
|
/**
|
|
197
197
|
* Removes the specified tag from the HTML and keeps its child nodes.
|
|
198
198
|
*
|
|
199
|
-
* @param {string} html
|
|
200
|
-
* @param {string} tag
|
|
199
|
+
* @param {string} html—The input HTML.
|
|
200
|
+
* @param {string} tag—A tag or multiple tags separated by a vertical slash which will be removed.
|
|
201
201
|
* For example, `span` or `b|i|u|span`.
|
|
202
|
-
* @returns {string}
|
|
202
|
+
* @returns {string}—The resulting HTML.
|
|
203
203
|
*
|
|
204
204
|
* @example
|
|
205
205
|
* ```jsx-no-run
|
|
@@ -211,9 +211,9 @@ export declare namespace EditorUtils {
|
|
|
211
211
|
/**
|
|
212
212
|
* A function for sanitizing the content on paste ([see example]({% slug paste_editor %})).
|
|
213
213
|
*
|
|
214
|
-
* @param {string} html
|
|
215
|
-
* @param {PasteCleanupSettings} settings
|
|
216
|
-
* @returns {string}
|
|
214
|
+
* @param {string} html—The input HTML.
|
|
215
|
+
* @param {PasteCleanupSettings} settings—The settings used for sanitizing the content.
|
|
216
|
+
* @returns {string}—The resulting HTML.
|
|
217
217
|
*/
|
|
218
218
|
function pasteCleanup(html: string, settings: PasteCleanupSettings): string;
|
|
219
219
|
/**
|
|
@@ -221,7 +221,7 @@ export declare namespace EditorUtils {
|
|
|
221
221
|
* The function will remove any class attribute which value starts with `Mso`.
|
|
222
222
|
* For example `<p class="MsoNormal">pasted from MS Word</p>` will result in `<p>pasted from MS Word</p>`.
|
|
223
223
|
*
|
|
224
|
-
* @param {Attr} attr
|
|
224
|
+
* @param {Attr} attr—The DOM class attribute that will be sanitized.
|
|
225
225
|
*/
|
|
226
226
|
function sanitizeClassAttr(attr: Attr): void;
|
|
227
227
|
/**
|
|
@@ -230,20 +230,20 @@ export declare namespace EditorUtils {
|
|
|
230
230
|
* For example `<p><span style='color:#7C7C7C;mso-themecolor:accent3;mso-themeshade:191;background:silver;'>content</span></p>`,
|
|
231
231
|
* will result in `<p><span style="color: #7C7C7C; background: silver;">content</span></p>`.
|
|
232
232
|
*
|
|
233
|
-
* @param {Attr} attr
|
|
233
|
+
* @param {Attr} attr—The DOM style attribute that will be sanitized.
|
|
234
234
|
*/
|
|
235
235
|
function sanitizeStyleAttr(attr: Attr): void;
|
|
236
236
|
/**
|
|
237
237
|
* A function that will remove a DOM attribute from the pasted content ([see example]({% slug paste_editor %})).
|
|
238
238
|
*
|
|
239
|
-
* @param {Attr} attr
|
|
239
|
+
* @param {Attr} attr—The DOM attribute that will be removed.
|
|
240
240
|
*/
|
|
241
241
|
function removeAttribute(attr: Attr): void;
|
|
242
242
|
/**
|
|
243
243
|
* Removes the invalid HTML.
|
|
244
244
|
*
|
|
245
|
-
* @param {string} html
|
|
246
|
-
* @returns {string}
|
|
245
|
+
* @param {string} html—The HTML which will be sanitized.
|
|
246
|
+
* @returns {string}—The sanitized HTML.
|
|
247
247
|
*
|
|
248
248
|
* @example
|
|
249
249
|
* ```jsx-no-run
|
|
@@ -256,16 +256,16 @@ export declare namespace EditorUtils {
|
|
|
256
256
|
* If the input `html` contains images with 'src' pointing to local file system (it happens when pasting images and text from MS Word),
|
|
257
257
|
* the function will extract the images sources from the RTF in base64 format and replace them in the input `html`.
|
|
258
258
|
*
|
|
259
|
-
* @param html
|
|
260
|
-
* @param clipboardData
|
|
261
|
-
* @returns
|
|
259
|
+
* @param html—The input HTML (pasted HTML).
|
|
260
|
+
* @param clipboardData—The paste event clipboardData object (event.clipboardData).
|
|
261
|
+
* @returns—The html with the replaced images sources.
|
|
262
262
|
*/
|
|
263
263
|
function replaceImageSourcesFromRtf(html: string, clipboardData: DataTransfer): string;
|
|
264
264
|
/**
|
|
265
265
|
* Creates a plugin which highlights the matches of Find and Replace dialog.
|
|
266
266
|
*
|
|
267
|
-
* @param {PluginKey} key
|
|
268
|
-
* @returns {Plugin}
|
|
267
|
+
* @param {PluginKey} key—The key of the plugin (Optional).
|
|
268
|
+
* @returns {Plugin}—The text highlight plugin.
|
|
269
269
|
*/
|
|
270
270
|
function textHighlight(key?: PluginKey): Plugin;
|
|
271
271
|
/**
|
|
@@ -276,19 +276,25 @@ export declare namespace EditorUtils {
|
|
|
276
276
|
/**
|
|
277
277
|
* Creates a plugin which adds image resizing functionality.
|
|
278
278
|
*
|
|
279
|
-
* @param {ImageResizeOptions} options
|
|
280
|
-
* @returns {Plugin}
|
|
279
|
+
* @param {ImageResizeOptions} options—The resizing option (Optional).
|
|
280
|
+
* @returns {Plugin}—The image resizing plugin.
|
|
281
281
|
*/
|
|
282
282
|
function imageResizing(options?: ImageResizeOptions): Plugin;
|
|
283
|
+
/**
|
|
284
|
+
* Returns a collection of plugins that adds table resizing functionality.
|
|
285
|
+
*
|
|
286
|
+
* @returns {Plugin[]}—The table resizing plugins.
|
|
287
|
+
*/
|
|
288
|
+
function tableResizing(): Plugin[];
|
|
283
289
|
/**
|
|
284
290
|
* Sets the HTML to the `EditorView`.
|
|
285
291
|
*
|
|
286
|
-
* @param {EditorView} view
|
|
287
|
-
* @param {string} html
|
|
288
|
-
* @param {Command} command
|
|
292
|
+
* @param {EditorView} view—The `view` object of the Editor.
|
|
293
|
+
* @param {string} html—The HTML content.
|
|
294
|
+
* @param {Command} command—An optional parameter.
|
|
289
295
|
* Defines the type of the command that will be set to the `setHtml` metadata of the transaction.
|
|
290
296
|
* Defaults to `SetContent`.
|
|
291
|
-
* @param {ParseOptions} parseOptions
|
|
297
|
+
* @param {ParseOptions} parseOptions—An optional parameter.
|
|
292
298
|
* Defines the options that will be used for parsing the HTML. Defaults to `{ preserveWhitespace: 'full' }`.
|
|
293
299
|
*/
|
|
294
300
|
function setHtml(view: EditorView<any>, html: string, command?: EditorToolsSettings.Command, parseOptions?: ParseOptions<any>): void;
|
|
@@ -321,8 +327,8 @@ export declare namespace EditorUtils {
|
|
|
321
327
|
* A function which returns the mapped `Shortcuts` object based on the passed settings.
|
|
322
328
|
* Useful when the default Editor nodes or tool settings are changed and the `Shortcuts` object has to be regenerated.
|
|
323
329
|
*
|
|
324
|
-
* @params
|
|
325
|
-
* @returns
|
|
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.
|
|
326
332
|
*/
|
|
327
333
|
function getShortcuts(settings?: {
|
|
328
334
|
types?: {
|
package/dist/es/utils/index.js
CHANGED
|
@@ -11,7 +11,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
11
11
|
};
|
|
12
12
|
import * as shortcuts from './../config/shortcuts';
|
|
13
13
|
import { marks as schemaMarks, nodes as schemaNodes } from './../config/schema';
|
|
14
|
-
import { alignBlocks as alignBlocksCommon, applyInlineStyle as applyInlineStyleCommon, applyLink as applyLinkCommon, canIndentAsListItem, canOutdentAsListItem, parseContent, canInsert as canInsertCommon, createTable as createTableCommon, formatBlockElements as formatBlockElementsCommon, getBlockFormats as getBlockFormatsCommon, getHtml as getHtmlCommon, getInlineStyles as getInlineStylesCommon, getMark as getMarkCommon, hasMark as hasMarkCommon, hasNode as hasNodeCommon, indentBlocks as indentBlocksCommon, setHtml as setHtmlCommon, insertNode as insertNodeCommon, isAligned as isAlignedCommon, isIndented as isIndentedCommon, toggleInlineFormat as toggleInlineFormatCommon, toggleList as toggleListCommon, indentHtml as indentHtmlCommon, convertMsLists as convertMsListsCommon, removeComments as removeCommentsCommon, removeTag as removeTagCommon, sanitize as sanitizeCommon, pasteCleanup as pasteCleanupCommon, sanitizeClassAttr as sanitizeClassAttrCommon, sanitizeStyleAttr as sanitizeStyleAttrCommon, removeAttribute as removeAttributeCommon, replaceImageSourcesFromRtf as replaceImageSourcesFromRtfCommon, textHighlight as textHighlightCommon, imageResizing as imageResizingCommon, imageResizeKey as imageResizeKeyCommon, trimWhitespace } from '@progress/kendo-editor-common';
|
|
14
|
+
import { alignBlocks as alignBlocksCommon, applyInlineStyle as applyInlineStyleCommon, applyLink as applyLinkCommon, canIndentAsListItem, canOutdentAsListItem, parseContent, canInsert as canInsertCommon, createTable as createTableCommon, formatBlockElements as formatBlockElementsCommon, getBlockFormats as getBlockFormatsCommon, getHtml as getHtmlCommon, getInlineStyles as getInlineStylesCommon, getMark as getMarkCommon, hasMark as hasMarkCommon, hasNode as hasNodeCommon, indentBlocks as indentBlocksCommon, setHtml as setHtmlCommon, insertNode as insertNodeCommon, isAligned as isAlignedCommon, isIndented as isIndentedCommon, toggleInlineFormat as toggleInlineFormatCommon, toggleList as toggleListCommon, indentHtml as indentHtmlCommon, convertMsLists as convertMsListsCommon, removeComments as removeCommentsCommon, removeTag as removeTagCommon, sanitize as sanitizeCommon, pasteCleanup as pasteCleanupCommon, sanitizeClassAttr as sanitizeClassAttrCommon, sanitizeStyleAttr as sanitizeStyleAttrCommon, removeAttribute as removeAttributeCommon, replaceImageSourcesFromRtf as replaceImageSourcesFromRtfCommon, textHighlight as textHighlightCommon, imageResizing as imageResizingCommon, imageResizeKey as imageResizeKeyCommon, tableResizing as tableResizingCommon, trimWhitespace } from '@progress/kendo-editor-common';
|
|
15
15
|
import { editorPropsKey } from './props-key';
|
|
16
16
|
/**
|
|
17
17
|
* Represents a wrapping namespace for the utility functions, `nodes`, and `marks` objects of the Editor.
|
|
@@ -21,7 +21,7 @@ export var EditorUtils;
|
|
|
21
21
|
/**
|
|
22
22
|
* Aligns the block elements in the selection.
|
|
23
23
|
*
|
|
24
|
-
* @returns {boolean}
|
|
24
|
+
* @returns {boolean}—If alignment is applied to any of the elements, returns `true`.
|
|
25
25
|
*/
|
|
26
26
|
function alignBlocks(view, actions, command) {
|
|
27
27
|
return Boolean(alignBlocksCommon(actions, command)(view.state, view.dispatch));
|
|
@@ -30,7 +30,7 @@ export var EditorUtils;
|
|
|
30
30
|
/**
|
|
31
31
|
* Wraps the selection in a `span` element with inline styles.
|
|
32
32
|
*
|
|
33
|
-
* @returns {boolean}
|
|
33
|
+
* @returns {boolean}—If a style is applied to any of the elements, returns `true`.
|
|
34
34
|
*/
|
|
35
35
|
function applyInlineStyle(view, options, command) {
|
|
36
36
|
return applyInlineStyleCommon(options, command)(view.state, view.dispatch);
|
|
@@ -39,7 +39,7 @@ export var EditorUtils;
|
|
|
39
39
|
/**
|
|
40
40
|
* Applies the link mark.
|
|
41
41
|
*
|
|
42
|
-
* @returns {boolean}
|
|
42
|
+
* @returns {boolean}—If the link is applied, returns `true`.
|
|
43
43
|
*/
|
|
44
44
|
function applyLink(view, options, command) {
|
|
45
45
|
return applyLinkCommon(options, command)(view.state, view.dispatch);
|
|
@@ -57,9 +57,9 @@ export var EditorUtils;
|
|
|
57
57
|
/**
|
|
58
58
|
* Checks if a node can be inserted in the current selection.
|
|
59
59
|
*
|
|
60
|
-
* @param {EditorState} state
|
|
61
|
-
* @param {NodeType} nodeType
|
|
62
|
-
* @returns {boolean}
|
|
60
|
+
* @param {EditorState} state—The `state` object of the Editor.
|
|
61
|
+
* @param {NodeType} nodeType—The type of the node that will be inserted.
|
|
62
|
+
* @returns {boolean}—The node of this type can be inserted in the current selection.
|
|
63
63
|
*/
|
|
64
64
|
function canInsert(state, nodeType) {
|
|
65
65
|
return canInsertCommon(state, nodeType);
|
|
@@ -77,8 +77,8 @@ export var EditorUtils;
|
|
|
77
77
|
/**
|
|
78
78
|
* Converts the MS Word lists into HTML lists.
|
|
79
79
|
*
|
|
80
|
-
* @param {string} html
|
|
81
|
-
* @returns {string}
|
|
80
|
+
* @param {string} html—The input HTML.
|
|
81
|
+
* @returns {string}—The result HTML.
|
|
82
82
|
*/
|
|
83
83
|
function convertMsLists(html) {
|
|
84
84
|
return convertMsListsCommon(html);
|
|
@@ -87,10 +87,10 @@ export var EditorUtils;
|
|
|
87
87
|
/**
|
|
88
88
|
* Creates an Editor document from HTML content.
|
|
89
89
|
*
|
|
90
|
-
* @param {Schema} schema
|
|
91
|
-
* @param {string} html
|
|
92
|
-
* @param {ParseOptions} parseOptions
|
|
93
|
-
* @returns {Node}
|
|
90
|
+
* @param {Schema} schema—The `schema` object of the Editor.
|
|
91
|
+
* @param {string} html—The HTML content.
|
|
92
|
+
* @param {ParseOptions} parseOptions—The HTML parsing options. Defaults to `{ preserveWhitespace: 'full' }`.
|
|
93
|
+
* @returns {Node}—The `document` object of the Editor.
|
|
94
94
|
*/
|
|
95
95
|
function createDocument(schema, html, parseOptions) {
|
|
96
96
|
return parseContent(trimWhitespace(html), schema, parseOptions !== undefined ? parseOptions : { preserveWhitespace: 'full' });
|
|
@@ -99,10 +99,10 @@ export var EditorUtils;
|
|
|
99
99
|
/**
|
|
100
100
|
* Creates a table.
|
|
101
101
|
*
|
|
102
|
-
* @param {object} tableTypes
|
|
103
|
-
* @param {number} rows
|
|
104
|
-
* @param {number} columns
|
|
105
|
-
* @returns {Node<any>}
|
|
102
|
+
* @param {object} tableTypes—An object which contains `table`, `table_row`, and `table_cell` node types.
|
|
103
|
+
* @param {number} rows—The number of rows.
|
|
104
|
+
* @param {number} columns—The number of columns.
|
|
105
|
+
* @returns {Node<any>}—The generated table.
|
|
106
106
|
*
|
|
107
107
|
* @example
|
|
108
108
|
* ```jsx-no-run
|
|
@@ -122,7 +122,7 @@ export var EditorUtils;
|
|
|
122
122
|
/**
|
|
123
123
|
* Formats the paragraph and heading nodes in the selection.
|
|
124
124
|
*
|
|
125
|
-
* @returns {boolean}
|
|
125
|
+
* @returns {boolean}—If an element is formatted, returns `true`.
|
|
126
126
|
*/
|
|
127
127
|
function formatBlockElements(view, value, commandName) {
|
|
128
128
|
return formatBlockElementsCommon(value, commandName)(view.state, view.dispatch);
|
|
@@ -140,16 +140,16 @@ export var EditorUtils;
|
|
|
140
140
|
/**
|
|
141
141
|
* Gets the HTML from the `EditorState` object.
|
|
142
142
|
*
|
|
143
|
-
* @param {EditorState} state
|
|
144
|
-
|
|
145
|
-
* @returns {string}
|
|
143
|
+
* @param {EditorState} state—The `state` object of the Editor or an object containing editor's `doc` and `schema`
|
|
144
|
+
*—{ doc: value, schema: value.types.schema } where the `value` variable is the editor's value prop.
|
|
145
|
+
* @returns {string}—The HTML content.
|
|
146
146
|
*/
|
|
147
147
|
function getHtml(state) {
|
|
148
148
|
return getHtmlCommon(state);
|
|
149
149
|
}
|
|
150
150
|
EditorUtils.getHtml = getHtml;
|
|
151
151
|
/**
|
|
152
|
-
* @returns {string[]}
|
|
152
|
+
* @returns {string[]}—An array of matched styles that are found in the selection.
|
|
153
153
|
*/
|
|
154
154
|
function getInlineStyles(state, style) {
|
|
155
155
|
return getInlineStylesCommon(state, style);
|
|
@@ -185,7 +185,7 @@ export var EditorUtils;
|
|
|
185
185
|
/**
|
|
186
186
|
* Indents the block elements in the selection.
|
|
187
187
|
*
|
|
188
|
-
* @returns {boolean}
|
|
188
|
+
* @returns {boolean}—If indentation is applied to any of the elements, returns `true`.
|
|
189
189
|
*/
|
|
190
190
|
function indentBlocks(view, actions, command, dir) {
|
|
191
191
|
return Boolean(indentBlocksCommon(actions, command, dir)(view.state, view.dispatch));
|
|
@@ -194,8 +194,8 @@ export var EditorUtils;
|
|
|
194
194
|
/**
|
|
195
195
|
* Adds new lines after block elements and hard breaks.
|
|
196
196
|
*
|
|
197
|
-
* @param {string} content
|
|
198
|
-
* @returns {string}
|
|
197
|
+
* @param {string} content—The HTML content.
|
|
198
|
+
* @returns {string}—The indented HTML.
|
|
199
199
|
*/
|
|
200
200
|
function indentHtml(content) {
|
|
201
201
|
return indentHtmlCommon(content);
|
|
@@ -204,9 +204,9 @@ export var EditorUtils;
|
|
|
204
204
|
/**
|
|
205
205
|
* Inserts a node in the selection.
|
|
206
206
|
*
|
|
207
|
-
* @param {EditorView} view
|
|
208
|
-
* @param {Node} node
|
|
209
|
-
* @param {boolean} scrollIntoView
|
|
207
|
+
* @param {EditorView} view—The `view` object of the Editor.
|
|
208
|
+
* @param {Node} node—A `node` object of the Editor.
|
|
209
|
+
* @param {boolean} scrollIntoView—An optional parameter.
|
|
210
210
|
* Defines if the content element will be scrolled to the current selection.
|
|
211
211
|
*/
|
|
212
212
|
function insertNode(view, node, scrollIntoView) {
|
|
@@ -234,8 +234,8 @@ export var EditorUtils;
|
|
|
234
234
|
/**
|
|
235
235
|
* Removes the comments from the HTML.
|
|
236
236
|
*
|
|
237
|
-
* @param {string} html
|
|
238
|
-
* @returns {string}
|
|
237
|
+
* @param {string} html—The input HTML.
|
|
238
|
+
* @returns {string}—The result HTML.
|
|
239
239
|
*
|
|
240
240
|
* @example
|
|
241
241
|
* ```jsx-no-run
|
|
@@ -250,10 +250,10 @@ export var EditorUtils;
|
|
|
250
250
|
/**
|
|
251
251
|
* Removes the specified tag from the HTML and keeps its child nodes.
|
|
252
252
|
*
|
|
253
|
-
* @param {string} html
|
|
254
|
-
* @param {string} tag
|
|
253
|
+
* @param {string} html—The input HTML.
|
|
254
|
+
* @param {string} tag—A tag or multiple tags separated by a vertical slash which will be removed.
|
|
255
255
|
* For example, `span` or `b|i|u|span`.
|
|
256
|
-
* @returns {string}
|
|
256
|
+
* @returns {string}—The resulting HTML.
|
|
257
257
|
*
|
|
258
258
|
* @example
|
|
259
259
|
* ```jsx-no-run
|
|
@@ -268,9 +268,9 @@ export var EditorUtils;
|
|
|
268
268
|
/**
|
|
269
269
|
* A function for sanitizing the content on paste ([see example]({% slug paste_editor %})).
|
|
270
270
|
*
|
|
271
|
-
* @param {string} html
|
|
272
|
-
* @param {PasteCleanupSettings} settings
|
|
273
|
-
* @returns {string}
|
|
271
|
+
* @param {string} html—The input HTML.
|
|
272
|
+
* @param {PasteCleanupSettings} settings—The settings used for sanitizing the content.
|
|
273
|
+
* @returns {string}—The resulting HTML.
|
|
274
274
|
*/
|
|
275
275
|
function pasteCleanup(html, settings) {
|
|
276
276
|
return pasteCleanupCommon(html, settings);
|
|
@@ -281,7 +281,7 @@ export var EditorUtils;
|
|
|
281
281
|
* The function will remove any class attribute which value starts with `Mso`.
|
|
282
282
|
* For example `<p class="MsoNormal">pasted from MS Word</p>` will result in `<p>pasted from MS Word</p>`.
|
|
283
283
|
*
|
|
284
|
-
* @param {Attr} attr
|
|
284
|
+
* @param {Attr} attr—The DOM class attribute that will be sanitized.
|
|
285
285
|
*/
|
|
286
286
|
function sanitizeClassAttr(attr) {
|
|
287
287
|
sanitizeClassAttrCommon(attr);
|
|
@@ -293,7 +293,7 @@ export var EditorUtils;
|
|
|
293
293
|
* For example `<p><span style='color:#7C7C7C;mso-themecolor:accent3;mso-themeshade:191;background:silver;'>content</span></p>`,
|
|
294
294
|
* will result in `<p><span style="color: #7C7C7C; background: silver;">content</span></p>`.
|
|
295
295
|
*
|
|
296
|
-
* @param {Attr} attr
|
|
296
|
+
* @param {Attr} attr—The DOM style attribute that will be sanitized.
|
|
297
297
|
*/
|
|
298
298
|
function sanitizeStyleAttr(attr) {
|
|
299
299
|
sanitizeStyleAttrCommon(attr);
|
|
@@ -302,7 +302,7 @@ export var EditorUtils;
|
|
|
302
302
|
/**
|
|
303
303
|
* A function that will remove a DOM attribute from the pasted content ([see example]({% slug paste_editor %})).
|
|
304
304
|
*
|
|
305
|
-
* @param {Attr} attr
|
|
305
|
+
* @param {Attr} attr—The DOM attribute that will be removed.
|
|
306
306
|
*/
|
|
307
307
|
function removeAttribute(attr) {
|
|
308
308
|
removeAttributeCommon(attr);
|
|
@@ -311,8 +311,8 @@ export var EditorUtils;
|
|
|
311
311
|
/**
|
|
312
312
|
* Removes the invalid HTML.
|
|
313
313
|
*
|
|
314
|
-
* @param {string} html
|
|
315
|
-
* @returns {string}
|
|
314
|
+
* @param {string} html—The HTML which will be sanitized.
|
|
315
|
+
* @returns {string}—The sanitized HTML.
|
|
316
316
|
*
|
|
317
317
|
* @example
|
|
318
318
|
* ```jsx-no-run
|
|
@@ -328,9 +328,9 @@ export var EditorUtils;
|
|
|
328
328
|
* If the input `html` contains images with 'src' pointing to local file system (it happens when pasting images and text from MS Word),
|
|
329
329
|
* the function will extract the images sources from the RTF in base64 format and replace them in the input `html`.
|
|
330
330
|
*
|
|
331
|
-
* @param html
|
|
332
|
-
* @param clipboardData
|
|
333
|
-
* @returns
|
|
331
|
+
* @param html—The input HTML (pasted HTML).
|
|
332
|
+
* @param clipboardData—The paste event clipboardData object (event.clipboardData).
|
|
333
|
+
* @returns—The html with the replaced images sources.
|
|
334
334
|
*/
|
|
335
335
|
function replaceImageSourcesFromRtf(html, clipboardData) {
|
|
336
336
|
return replaceImageSourcesFromRtfCommon(html, clipboardData);
|
|
@@ -339,8 +339,8 @@ export var EditorUtils;
|
|
|
339
339
|
/**
|
|
340
340
|
* Creates a plugin which highlights the matches of Find and Replace dialog.
|
|
341
341
|
*
|
|
342
|
-
* @param {PluginKey} key
|
|
343
|
-
* @returns {Plugin}
|
|
342
|
+
* @param {PluginKey} key—The key of the plugin (Optional).
|
|
343
|
+
* @returns {Plugin}—The text highlight plugin.
|
|
344
344
|
*/
|
|
345
345
|
function textHighlight(key) {
|
|
346
346
|
return textHighlightCommon(key);
|
|
@@ -349,22 +349,31 @@ export var EditorUtils;
|
|
|
349
349
|
/**
|
|
350
350
|
* Creates a plugin which adds image resizing functionality.
|
|
351
351
|
*
|
|
352
|
-
* @param {ImageResizeOptions} options
|
|
353
|
-
* @returns {Plugin}
|
|
352
|
+
* @param {ImageResizeOptions} options—The resizing option (Optional).
|
|
353
|
+
* @returns {Plugin}—The image resizing plugin.
|
|
354
354
|
*/
|
|
355
355
|
function imageResizing(options) {
|
|
356
356
|
return imageResizingCommon(options);
|
|
357
357
|
}
|
|
358
358
|
EditorUtils.imageResizing = imageResizing;
|
|
359
|
+
/**
|
|
360
|
+
* Returns a collection of plugins that adds table resizing functionality.
|
|
361
|
+
*
|
|
362
|
+
* @returns {Plugin[]}—The table resizing plugins.
|
|
363
|
+
*/
|
|
364
|
+
function tableResizing() {
|
|
365
|
+
return tableResizingCommon();
|
|
366
|
+
}
|
|
367
|
+
EditorUtils.tableResizing = tableResizing;
|
|
359
368
|
/**
|
|
360
369
|
* Sets the HTML to the `EditorView`.
|
|
361
370
|
*
|
|
362
|
-
* @param {EditorView} view
|
|
363
|
-
* @param {string} html
|
|
364
|
-
* @param {Command} command
|
|
371
|
+
* @param {EditorView} view—The `view` object of the Editor.
|
|
372
|
+
* @param {string} html—The HTML content.
|
|
373
|
+
* @param {Command} command—An optional parameter.
|
|
365
374
|
* Defines the type of the command that will be set to the `setHtml` metadata of the transaction.
|
|
366
375
|
* Defaults to `SetContent`.
|
|
367
|
-
* @param {ParseOptions} parseOptions
|
|
376
|
+
* @param {ParseOptions} parseOptions—An optional parameter.
|
|
368
377
|
* Defines the options that will be used for parsing the HTML. Defaults to `{ preserveWhitespace: 'full' }`.
|
|
369
378
|
*/
|
|
370
379
|
function setHtml(view, html, command, parseOptions) {
|
|
@@ -395,8 +404,8 @@ export var EditorUtils;
|
|
|
395
404
|
* A function which returns the mapped `Shortcuts` object based on the passed settings.
|
|
396
405
|
* Useful when the default Editor nodes or tool settings are changed and the `Shortcuts` object has to be regenerated.
|
|
397
406
|
*
|
|
398
|
-
* @params
|
|
399
|
-
* @returns
|
|
407
|
+
* @params—An object which holds specific types of nodes and tool settings that are used by the default `Shortcuts` handlers.
|
|
408
|
+
* @returns—An object which holds the shortcuts.
|
|
400
409
|
*/
|
|
401
410
|
// tslint:enable:max-line-length
|
|
402
411
|
function getShortcuts(settings) {
|