@progress/kendo-react-editor 7.2.4-develop.3 → 7.2.4-develop.4

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