@progress/kendo-react-editor 6.1.1 → 7.0.0-develop.2

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 (231) hide show
  1. package/{dist/es/Editor.d.ts → Editor.d.ts} +5 -1
  2. package/{dist/npm/EditorProps.d.ts → EditorProps.d.ts} +4 -1
  3. package/LICENSE.md +1 -1
  4. package/{dist/es/config → config}/defaultStyles.d.ts +4 -0
  5. package/config/pasteSettings.d.ts +10 -0
  6. package/config/schema.d.ts +5 -0
  7. package/{dist/es/config → config}/shortcuts.d.ts +10 -6
  8. package/{dist/es/config → config}/toolsSettings.d.ts +4 -1
  9. package/{dist/npm/dialogs → dialogs}/EditorDialogProps.d.ts +4 -1
  10. package/{dist/npm/dialogs → dialogs}/FindReplace.d.ts +5 -1
  11. package/{dist/npm/dialogs/main.d.ts → dialogs/index.d.ts} +4 -0
  12. package/{dist/npm/dialogs → dialogs}/insertImage.d.ts +5 -1
  13. package/{dist/es/dialogs → dialogs}/insertLink.d.ts +5 -1
  14. package/{dist/npm/dialogs → dialogs}/viewHtml.d.ts +5 -1
  15. package/dist/cdn/js/kendo-react-editor.js +226 -1
  16. package/{dist/es/main.d.ts → index.d.ts} +10 -6
  17. package/index.js +226 -0
  18. package/index.mjs +4133 -0
  19. package/{dist/npm/messages → messages}/index.d.ts +4 -0
  20. package/package-metadata.d.ts +9 -0
  21. package/package.json +37 -52
  22. package/{dist/es/tools → tools}/ToolProps.d.ts +4 -1
  23. package/tools/align.d.ts +11 -0
  24. package/{dist/es/tools → tools}/applyColor.d.ts +4 -0
  25. package/{dist/npm/tools → tools}/cleanFormatting.d.ts +4 -0
  26. package/{dist/npm/tools → tools}/findReplace.d.ts +5 -1
  27. package/{dist/npm/tools → tools}/fontStyle.d.ts +4 -0
  28. package/{dist/es/tools → tools}/formatBlock.d.ts +4 -0
  29. package/{dist/npm/tools → tools}/history.d.ts +4 -0
  30. package/{dist/npm/tools → tools}/indent.d.ts +4 -0
  31. package/{dist/npm/tools/main.d.ts → tools/index.d.ts} +6 -2
  32. package/{dist/es/tools → tools}/inlineFormat.d.ts +4 -0
  33. package/tools/insertImage.d.ts +17 -0
  34. package/{dist/npm/tools → tools}/insertLink.d.ts +4 -0
  35. package/tools/insertTable/index.d.ts +7 -0
  36. package/{dist/npm/tools → tools}/insertTable/popup.d.ts +5 -1
  37. package/{dist/npm/tools → tools}/insertTable/popupGrid.d.ts +6 -2
  38. package/{dist/es/tools → tools}/insertTable/tool.d.ts +4 -0
  39. package/tools/lists-styled.d.ts +8 -0
  40. package/{dist/es/tools → tools}/lists.d.ts +4 -0
  41. package/{dist/es/tools → tools}/outdent.d.ts +4 -0
  42. package/{dist/npm/tools → tools}/pdf.d.ts +4 -0
  43. package/{dist/npm/tools → tools}/print.d.ts +4 -0
  44. package/{dist/npm/tools → tools}/proseMirrorTool.d.ts +4 -0
  45. package/{dist/npm/tools → tools}/selectAll.d.ts +4 -0
  46. package/{dist/npm/tools → tools}/table-wizard/cellPropsUtils.d.ts +4 -0
  47. package/{dist/npm/tools → tools}/table-wizard/tableCellProperties.d.ts +5 -1
  48. package/tools/table-wizard/tableProperties.d.ts +15 -0
  49. package/{dist/es/tools → tools}/table-wizard/tablePropsUtils.d.ts +5 -1
  50. package/{dist/es/tools → tools}/table-wizard/utils.d.ts +4 -0
  51. package/{dist/npm/tools → tools}/tableEdit.d.ts +4 -0
  52. package/{dist/npm/tools → tools}/unlink.d.ts +4 -0
  53. package/{dist/npm/tools → tools}/utils.d.ts +4 -0
  54. package/{dist/es/tools → tools}/viewHtml.d.ts +4 -0
  55. package/utils/browser-detection.d.ts +8 -0
  56. package/utils/controlled-value.d.ts +9 -0
  57. package/{dist/npm/utils → utils}/index.d.ts +4 -0
  58. package/utils/props-key.d.ts +9 -0
  59. package/about.md +0 -3
  60. package/dist/es/Editor.js +0 -441
  61. package/dist/es/EditorProps.d.ts +0 -197
  62. package/dist/es/EditorProps.js +0 -1
  63. package/dist/es/config/defaultStyles.js +0 -12
  64. package/dist/es/config/pasteSettings.d.ts +0 -6
  65. package/dist/es/config/pasteSettings.js +0 -1
  66. package/dist/es/config/schema.d.ts +0 -1
  67. package/dist/es/config/schema.js +0 -1
  68. package/dist/es/config/shortcuts.js +0 -34
  69. package/dist/es/config/toolsSettings.js +0 -522
  70. package/dist/es/dialogs/EditorDialogProps.d.ts +0 -27
  71. package/dist/es/dialogs/EditorDialogProps.js +0 -1
  72. package/dist/es/dialogs/FindReplace.d.ts +0 -71
  73. package/dist/es/dialogs/FindReplace.js +0 -248
  74. package/dist/es/dialogs/insertImage.d.ts +0 -28
  75. package/dist/es/dialogs/insertImage.js +0 -119
  76. package/dist/es/dialogs/insertLink.js +0 -94
  77. package/dist/es/dialogs/main.d.ts +0 -49
  78. package/dist/es/dialogs/main.js +0 -69
  79. package/dist/es/dialogs/viewHtml.d.ts +0 -25
  80. package/dist/es/dialogs/viewHtml.js +0 -79
  81. package/dist/es/main.js +0 -201
  82. package/dist/es/messages/index.d.ts +0 -334
  83. package/dist/es/messages/index.js +0 -989
  84. package/dist/es/package-metadata.d.ts +0 -5
  85. package/dist/es/package-metadata.js +0 -11
  86. package/dist/es/tools/ToolProps.js +0 -1
  87. package/dist/es/tools/align.d.ts +0 -7
  88. package/dist/es/tools/align.js +0 -70
  89. package/dist/es/tools/applyColor.js +0 -34
  90. package/dist/es/tools/cleanFormatting.d.ts +0 -16
  91. package/dist/es/tools/cleanFormatting.js +0 -50
  92. package/dist/es/tools/findReplace.d.ts +0 -29
  93. package/dist/es/tools/findReplace.js +0 -76
  94. package/dist/es/tools/fontStyle.d.ts +0 -28
  95. package/dist/es/tools/fontStyle.js +0 -91
  96. package/dist/es/tools/formatBlock.js +0 -89
  97. package/dist/es/tools/history.d.ts +0 -26
  98. package/dist/es/tools/history.js +0 -16
  99. package/dist/es/tools/indent.d.ts +0 -17
  100. package/dist/es/tools/indent.js +0 -90
  101. package/dist/es/tools/inlineFormat.js +0 -75
  102. package/dist/es/tools/insertImage.d.ts +0 -13
  103. package/dist/es/tools/insertImage.js +0 -78
  104. package/dist/es/tools/insertLink.d.ts +0 -24
  105. package/dist/es/tools/insertLink.js +0 -85
  106. package/dist/es/tools/insertTable/index.d.ts +0 -3
  107. package/dist/es/tools/insertTable/index.js +0 -3
  108. package/dist/es/tools/insertTable/popup.d.ts +0 -93
  109. package/dist/es/tools/insertTable/popup.js +0 -102
  110. package/dist/es/tools/insertTable/popupGrid.d.ts +0 -31
  111. package/dist/es/tools/insertTable/popupGrid.js +0 -54
  112. package/dist/es/tools/insertTable/tool.js +0 -106
  113. package/dist/es/tools/lists-styled.d.ts +0 -5
  114. package/dist/es/tools/lists-styled.js +0 -80
  115. package/dist/es/tools/lists.js +0 -84
  116. package/dist/es/tools/main.d.ts +0 -714
  117. package/dist/es/tools/main.js +0 -740
  118. package/dist/es/tools/outdent.js +0 -85
  119. package/dist/es/tools/pdf.d.ts +0 -25
  120. package/dist/es/tools/pdf.js +0 -44
  121. package/dist/es/tools/print.d.ts +0 -16
  122. package/dist/es/tools/print.js +0 -48
  123. package/dist/es/tools/proseMirrorTool.d.ts +0 -12
  124. package/dist/es/tools/proseMirrorTool.js +0 -67
  125. package/dist/es/tools/selectAll.d.ts +0 -16
  126. package/dist/es/tools/selectAll.js +0 -45
  127. package/dist/es/tools/table-wizard/cellPropsUtils.d.ts +0 -36
  128. package/dist/es/tools/table-wizard/cellPropsUtils.js +0 -203
  129. package/dist/es/tools/table-wizard/tableCellProperties.d.ts +0 -20
  130. package/dist/es/tools/table-wizard/tableCellProperties.js +0 -247
  131. package/dist/es/tools/table-wizard/tableProperties.d.ts +0 -11
  132. package/dist/es/tools/table-wizard/tableProperties.js +0 -294
  133. package/dist/es/tools/table-wizard/tablePropsUtils.js +0 -498
  134. package/dist/es/tools/table-wizard/utils.js +0 -144
  135. package/dist/es/tools/tableEdit.d.ts +0 -98
  136. package/dist/es/tools/tableEdit.js +0 -90
  137. package/dist/es/tools/unlink.d.ts +0 -17
  138. package/dist/es/tools/unlink.js +0 -77
  139. package/dist/es/tools/utils.d.ts +0 -50
  140. package/dist/es/tools/utils.js +0 -72
  141. package/dist/es/tools/viewHtml.js +0 -79
  142. package/dist/es/utils/browser-detection.d.ts +0 -4
  143. package/dist/es/utils/browser-detection.js +0 -5
  144. package/dist/es/utils/controlled-value.d.ts +0 -5
  145. package/dist/es/utils/controlled-value.js +0 -31
  146. package/dist/es/utils/index.d.ts +0 -363
  147. package/dist/es/utils/index.js +0 -431
  148. package/dist/es/utils/props-key.d.ts +0 -5
  149. package/dist/es/utils/props-key.js +0 -5
  150. package/dist/npm/Editor.d.ts +0 -118
  151. package/dist/npm/Editor.js +0 -444
  152. package/dist/npm/EditorProps.js +0 -2
  153. package/dist/npm/config/defaultStyles.d.ts +0 -12
  154. package/dist/npm/config/defaultStyles.js +0 -15
  155. package/dist/npm/config/pasteSettings.d.ts +0 -6
  156. package/dist/npm/config/pasteSettings.js +0 -2
  157. package/dist/npm/config/schema.d.ts +0 -1
  158. package/dist/npm/config/schema.js +0 -6
  159. package/dist/npm/config/shortcuts.d.ts +0 -24
  160. package/dist/npm/config/shortcuts.js +0 -38
  161. package/dist/npm/config/toolsSettings.d.ts +0 -490
  162. package/dist/npm/config/toolsSettings.js +0 -525
  163. package/dist/npm/dialogs/EditorDialogProps.js +0 -2
  164. package/dist/npm/dialogs/FindReplace.js +0 -251
  165. package/dist/npm/dialogs/insertImage.js +0 -122
  166. package/dist/npm/dialogs/insertLink.d.ts +0 -26
  167. package/dist/npm/dialogs/insertLink.js +0 -97
  168. package/dist/npm/dialogs/main.js +0 -72
  169. package/dist/npm/dialogs/viewHtml.js +0 -82
  170. package/dist/npm/main.d.ts +0 -176
  171. package/dist/npm/main.js +0 -189
  172. package/dist/npm/messages/index.js +0 -992
  173. package/dist/npm/package-metadata.d.ts +0 -5
  174. package/dist/npm/package-metadata.js +0 -14
  175. package/dist/npm/tools/ToolProps.d.ts +0 -38
  176. package/dist/npm/tools/ToolProps.js +0 -2
  177. package/dist/npm/tools/align.d.ts +0 -7
  178. package/dist/npm/tools/align.js +0 -74
  179. package/dist/npm/tools/applyColor.d.ts +0 -12
  180. package/dist/npm/tools/applyColor.js +0 -38
  181. package/dist/npm/tools/cleanFormatting.js +0 -54
  182. package/dist/npm/tools/findReplace.js +0 -79
  183. package/dist/npm/tools/fontStyle.js +0 -94
  184. package/dist/npm/tools/formatBlock.d.ts +0 -18
  185. package/dist/npm/tools/formatBlock.js +0 -92
  186. package/dist/npm/tools/history.js +0 -19
  187. package/dist/npm/tools/indent.js +0 -93
  188. package/dist/npm/tools/inlineFormat.d.ts +0 -47
  189. package/dist/npm/tools/inlineFormat.js +0 -78
  190. package/dist/npm/tools/insertImage.d.ts +0 -13
  191. package/dist/npm/tools/insertImage.js +0 -82
  192. package/dist/npm/tools/insertLink.js +0 -88
  193. package/dist/npm/tools/insertTable/index.d.ts +0 -3
  194. package/dist/npm/tools/insertTable/index.js +0 -7
  195. package/dist/npm/tools/insertTable/popup.js +0 -105
  196. package/dist/npm/tools/insertTable/popupGrid.js +0 -56
  197. package/dist/npm/tools/insertTable/tool.d.ts +0 -24
  198. package/dist/npm/tools/insertTable/tool.js +0 -109
  199. package/dist/npm/tools/lists-styled.d.ts +0 -5
  200. package/dist/npm/tools/lists-styled.js +0 -84
  201. package/dist/npm/tools/lists.d.ts +0 -27
  202. package/dist/npm/tools/lists.js +0 -87
  203. package/dist/npm/tools/main.js +0 -743
  204. package/dist/npm/tools/outdent.d.ts +0 -17
  205. package/dist/npm/tools/outdent.js +0 -88
  206. package/dist/npm/tools/pdf.js +0 -48
  207. package/dist/npm/tools/print.js +0 -52
  208. package/dist/npm/tools/proseMirrorTool.js +0 -71
  209. package/dist/npm/tools/selectAll.js +0 -49
  210. package/dist/npm/tools/table-wizard/cellPropsUtils.js +0 -208
  211. package/dist/npm/tools/table-wizard/tableCellProperties.js +0 -253
  212. package/dist/npm/tools/table-wizard/tableProperties.d.ts +0 -11
  213. package/dist/npm/tools/table-wizard/tableProperties.js +0 -298
  214. package/dist/npm/tools/table-wizard/tablePropsUtils.d.ts +0 -52
  215. package/dist/npm/tools/table-wizard/tablePropsUtils.js +0 -504
  216. package/dist/npm/tools/table-wizard/utils.d.ts +0 -39
  217. package/dist/npm/tools/table-wizard/utils.js +0 -153
  218. package/dist/npm/tools/tableEdit.js +0 -95
  219. package/dist/npm/tools/unlink.js +0 -80
  220. package/dist/npm/tools/utils.js +0 -82
  221. package/dist/npm/tools/viewHtml.d.ts +0 -24
  222. package/dist/npm/tools/viewHtml.js +0 -82
  223. package/dist/npm/utils/browser-detection.d.ts +0 -4
  224. package/dist/npm/utils/browser-detection.js +0 -8
  225. package/dist/npm/utils/controlled-value.d.ts +0 -5
  226. package/dist/npm/utils/controlled-value.js +0 -35
  227. package/dist/npm/utils/index.js +0 -434
  228. package/dist/npm/utils/props-key.d.ts +0 -5
  229. package/dist/npm/utils/props-key.js +0 -8
  230. package/dist/systemjs/kendo-react-editor.js +0 -1
  231. package/e2e-next/editor.basic.tests.ts +0 -24
@@ -1,434 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.EditorUtils = void 0;
15
- var shortcuts = require("./../config/shortcuts");
16
- var schema_1 = require("./../config/schema");
17
- var kendo_editor_common_1 = require("@progress/kendo-editor-common");
18
- var props_key_1 = require("./props-key");
19
- /**
20
- * Represents a wrapping namespace for the utility functions, `nodes`, and `marks` objects of the Editor.
21
- */
22
- var EditorUtils;
23
- (function (EditorUtils) {
24
- /**
25
- * Aligns the block elements in the selection.
26
- *
27
- * @returns {boolean}&mdash;If alignment is applied to any of the elements, returns `true`.
28
- */
29
- function alignBlocks(view, actions, command) {
30
- return Boolean((0, kendo_editor_common_1.alignBlocks)(actions, command)(view.state, view.dispatch));
31
- }
32
- EditorUtils.alignBlocks = alignBlocks;
33
- /**
34
- * Wraps the selection in a `span` element with inline styles.
35
- *
36
- * @returns {boolean}&mdash;If a style is applied to any of the elements, returns `true`.
37
- */
38
- function applyInlineStyle(view, options, command) {
39
- return (0, kendo_editor_common_1.applyInlineStyle)(options, command)(view.state, view.dispatch);
40
- }
41
- EditorUtils.applyInlineStyle = applyInlineStyle;
42
- /**
43
- * Applies the link mark.
44
- *
45
- * @returns {boolean}&mdash;If the link is applied, returns `true`.
46
- */
47
- function applyLink(view, options, command) {
48
- return (0, kendo_editor_common_1.applyLink)(options, command)(view.state, view.dispatch);
49
- }
50
- EditorUtils.applyLink = applyLink;
51
- /**
52
- * Checks if any of the `list` elements in the selection can be indented.
53
- *
54
- * @returns {boolean}
55
- */
56
- function canIndentList(state, nodeType) {
57
- return (0, kendo_editor_common_1.canIndentAsListItem)(state, nodeType);
58
- }
59
- EditorUtils.canIndentList = canIndentList;
60
- /**
61
- * Checks if a node can be inserted in the current selection.
62
- *
63
- * @param {EditorState} state&mdash;The `state` object of the Editor.
64
- * @param {NodeType} nodeType&mdash;The type of the node that will be inserted.
65
- * @returns {boolean}&mdash;The node of this type can be inserted in the current selection.
66
- */
67
- function canInsert(state, nodeType) {
68
- return (0, kendo_editor_common_1.canInsert)(state, nodeType);
69
- }
70
- EditorUtils.canInsert = canInsert;
71
- /**
72
- * Checks if any of the `list` elements in the selection can be outdented.
73
- *
74
- * @returns {boolean}
75
- */
76
- function canOutdentList(state, listsTypes) {
77
- return (0, kendo_editor_common_1.canOutdentAsListItem)(state, { listsTypes: listsTypes, nodes: [] });
78
- }
79
- EditorUtils.canOutdentList = canOutdentList;
80
- /**
81
- * Converts the MS Word lists into HTML lists.
82
- *
83
- * @param {string} html&mdash;The input HTML.
84
- * @returns {string}&mdash;The result HTML.
85
- */
86
- function convertMsLists(html) {
87
- return (0, kendo_editor_common_1.convertMsLists)(html);
88
- }
89
- EditorUtils.convertMsLists = convertMsLists;
90
- /**
91
- * Creates an Editor document from HTML content.
92
- *
93
- * @param {Schema} schema&mdash;The `schema` object of the Editor.
94
- * @param {string} html&mdash;The HTML content.
95
- * @param {ParseOptions} parseOptions&mdash;The HTML parsing options. Defaults to `{ preserveWhitespace: 'full' }`.
96
- * @returns {Node}&mdash;The `document` object of the Editor.
97
- */
98
- function createDocument(schema, html, parseOptions) {
99
- return (0, kendo_editor_common_1.parseContent)((0, kendo_editor_common_1.trimWhitespace)(html), schema, parseOptions !== undefined ? parseOptions : { preserveWhitespace: 'full' });
100
- }
101
- EditorUtils.createDocument = createDocument;
102
- /**
103
- * Creates a table.
104
- *
105
- * @param {object} tableTypes&mdash;An object which contains `table`, `table_row`, and `table_cell` node types.
106
- * @param {number} rows&mdash;The number of rows.
107
- * @param {number} columns&mdash;The number of columns.
108
- * @returns {Node}&mdash;The generated table.
109
- *
110
- * @example
111
- * ```jsx-no-run
112
- * import { EditorUtils } from '@progress/kendo-react-editor';
113
- *
114
- * const nodes = editorRef.view.state.schema.nodes;
115
- * const rows = 3;
116
- * const columns = 4;
117
- *
118
- * const table = EditorUtils.createTable(nodes, rows, columns);
119
- * ```
120
- */
121
- function createTable(tableTypes, rows, columns) {
122
- return (0, kendo_editor_common_1.createTable)(tableTypes, rows, columns);
123
- }
124
- EditorUtils.createTable = createTable;
125
- /**
126
- * Formats the paragraph and heading nodes in the selection.
127
- *
128
- * @returns {boolean}&mdash;If an element is formatted, returns `true`.
129
- */
130
- function formatBlockElements(view, value, commandName) {
131
- return (0, kendo_editor_common_1.formatBlockElements)(value, commandName)(view.state, view.dispatch);
132
- }
133
- EditorUtils.formatBlockElements = formatBlockElements;
134
- /**
135
- * Returns the paragraph and heading nodes in the selection.
136
- *
137
- * @returns {string[]}
138
- */
139
- function getBlockFormats(state) {
140
- return (0, kendo_editor_common_1.getBlockFormats)(state);
141
- }
142
- EditorUtils.getBlockFormats = getBlockFormats;
143
- /**
144
- * Gets the HTML from the `EditorState` object.
145
- *
146
- * @param {EditorState} state&mdash;The `state` object of the Editor or an object containing editor's `doc` and `schema`
147
- *&mdash;{ doc: value, schema: value.types.schema } where the `value` variable is the editor's value prop.
148
- * @returns {string}&mdash;The HTML content.
149
- */
150
- function getHtml(state) {
151
- return (0, kendo_editor_common_1.getHtml)(state);
152
- }
153
- EditorUtils.getHtml = getHtml;
154
- /**
155
- * @returns {string[]}&mdash;An array of matched styles that are found in the selection.
156
- */
157
- function getInlineStyles(state, style) {
158
- return (0, kendo_editor_common_1.getInlineStyles)(state, style);
159
- }
160
- EditorUtils.getInlineStyles = getInlineStyles;
161
- /**
162
- * Returns a mark of the specified type from the nodes in selection.
163
- *
164
- * @returns {Mark}
165
- */
166
- function getMark(state, markType) {
167
- return (0, kendo_editor_common_1.getMark)(state, markType);
168
- }
169
- EditorUtils.getMark = getMark;
170
- /**
171
- * Checks if according to the specified `InlineFormatOptions` a node in the selection is present.
172
- *
173
- * @returns {boolean}
174
- */
175
- function hasMark(state, options) {
176
- return (0, kendo_editor_common_1.hasMark)(state, options);
177
- }
178
- EditorUtils.hasMark = hasMark;
179
- /**
180
- * Checks if the selection contains a specific type of node.
181
- *
182
- * @returns {boolean}
183
- */
184
- function hasNode(state, nodeType) {
185
- return (0, kendo_editor_common_1.hasNode)(state, nodeType);
186
- }
187
- EditorUtils.hasNode = hasNode;
188
- /**
189
- * Indents the block elements in the selection.
190
- *
191
- * @returns {boolean}&mdash;If indentation is applied to any of the elements, returns `true`.
192
- */
193
- function indentBlocks(view, actions, command, dir) {
194
- return Boolean((0, kendo_editor_common_1.indentBlocks)(actions, command, dir)(view.state, view.dispatch));
195
- }
196
- EditorUtils.indentBlocks = indentBlocks;
197
- /**
198
- * Adds new lines after block elements and hard breaks.
199
- *
200
- * @param {string} content&mdash;The HTML content.
201
- * @returns {string}&mdash;The indented HTML.
202
- */
203
- function indentHtml(content) {
204
- return (0, kendo_editor_common_1.indentHtml)(content);
205
- }
206
- EditorUtils.indentHtml = indentHtml;
207
- /**
208
- * Inserts a node in the selection.
209
- *
210
- * @param {EditorView} view&mdash;The `view` object of the Editor.
211
- * @param {Node} node&mdash;A `node` object of the Editor.
212
- * @param {boolean} scrollIntoView&mdash;An optional parameter.
213
- * Defines if the content element will be scrolled to the current selection.
214
- */
215
- function insertNode(view, node, scrollIntoView) {
216
- (0, kendo_editor_common_1.insertNode)(node, scrollIntoView)(view.state, view.dispatch);
217
- }
218
- EditorUtils.insertNode = insertNode;
219
- /**
220
- * Checks if any of the block elements in the selection is aligned.
221
- *
222
- * @returns {boolean}
223
- */
224
- function isAligned(state, actions) {
225
- return (0, kendo_editor_common_1.isAligned)(state, actions);
226
- }
227
- EditorUtils.isAligned = isAligned;
228
- /**
229
- * Checks if any of the block elements in the selection is indented.
230
- *
231
- * @returns {boolean}
232
- */
233
- function isIndented(state, actions, dir) {
234
- return (0, kendo_editor_common_1.isIndented)(state, actions, dir);
235
- }
236
- EditorUtils.isIndented = isIndented;
237
- /**
238
- * Removes the comments from the HTML.
239
- *
240
- * @param {string} html&mdash;The input HTML.
241
- * @returns {string}&mdash;The result HTML.
242
- *
243
- * @example
244
- * ```jsx-no-run
245
- * import { EditorUtils } from '@progress/kendo-react-editor';
246
- * const html = EditorUtils.removeComments('<p>some content<!-- comment --></p>');
247
- * ```
248
- */
249
- function removeComments(html) {
250
- return (0, kendo_editor_common_1.removeComments)(html);
251
- }
252
- EditorUtils.removeComments = removeComments;
253
- /**
254
- * Removes the specified tag from the HTML and keeps its child nodes.
255
- *
256
- * @param {string} html&mdash;The input HTML.
257
- * @param {string} tag&mdash;A tag or multiple tags separated by a vertical slash which will be removed.
258
- * For example, `span` or `b|i|u|span`.
259
- * @returns {string}&mdash;The resulting HTML.
260
- *
261
- * @example
262
- * ```jsx-no-run
263
- * import { EditorUtils } from '@progress/kendo-react-editor';
264
- * const html = EditorUtils.removeTag('<p>some <span>content</span></p>', 'span|p');
265
- * ```
266
- */
267
- function removeTag(html, tag) {
268
- return (0, kendo_editor_common_1.removeTag)(html, tag);
269
- }
270
- EditorUtils.removeTag = removeTag;
271
- /**
272
- * A function for sanitizing the content on paste ([see example]({% slug paste_editor %})).
273
- *
274
- * @param {string} html&mdash;The input HTML.
275
- * @param {PasteCleanupSettings} settings&mdash;The settings used for sanitizing the content.
276
- * @returns {string}&mdash;The resulting HTML.
277
- */
278
- function pasteCleanup(html, settings) {
279
- return (0, kendo_editor_common_1.pasteCleanup)(html, settings);
280
- }
281
- EditorUtils.pasteCleanup = pasteCleanup;
282
- /**
283
- * A function for sanitizing the CSS classes of the pasted from MS Word content ([see example]({% slug paste_editor %})).
284
- * The function will remove any class attribute which value starts with `Mso`.
285
- * For example `<p class="MsoNormal">pasted from MS Word</p>` will result in `<p>pasted from MS Word</p>`.
286
- *
287
- * @param {Attr} attr&mdash;The DOM class attribute that will be sanitized.
288
- */
289
- function sanitizeClassAttr(attr) {
290
- (0, kendo_editor_common_1.sanitizeClassAttr)(attr);
291
- }
292
- EditorUtils.sanitizeClassAttr = sanitizeClassAttr;
293
- /**
294
- * A function for sanitizing the style attributes of the pasted from MS Word content ([see example]({% slug paste_editor %})).
295
- * The function will loop through all styles and will remove those that are invalid.
296
- * For example `<p><span style='color:#7C7C7C;mso-themecolor:accent3;mso-themeshade:191;background:silver;'>content</span></p>`,
297
- * will result in `<p><span style="color: #7C7C7C; background: silver;">content</span></p>`.
298
- *
299
- * @param {Attr} attr&mdash;The DOM style attribute that will be sanitized.
300
- */
301
- function sanitizeStyleAttr(attr) {
302
- (0, kendo_editor_common_1.sanitizeStyleAttr)(attr);
303
- }
304
- EditorUtils.sanitizeStyleAttr = sanitizeStyleAttr;
305
- /**
306
- * A function that will remove a DOM attribute from the pasted content ([see example]({% slug paste_editor %})).
307
- *
308
- * @param {Attr} attr&mdash;The DOM attribute that will be removed.
309
- */
310
- function removeAttribute(attr) {
311
- (0, kendo_editor_common_1.removeAttribute)(attr);
312
- }
313
- EditorUtils.removeAttribute = removeAttribute;
314
- /**
315
- * Removes the invalid HTML.
316
- *
317
- * @param {string} html&mdash;The HTML which will be sanitized.
318
- * @returns {string}&mdash;The sanitized HTML.
319
- *
320
- * @example
321
- * ```jsx-no-run
322
- * import { EditorUtils } from '@progress/kendo-react-editor';
323
- * const html = EditorUtils.sanitize('something pasted from MS Word, containing <o:p>, <w:sdtPr>, <v:shapes tags');
324
- * ```
325
- */
326
- function sanitize(html) {
327
- return (0, kendo_editor_common_1.sanitize)(html);
328
- }
329
- EditorUtils.sanitize = sanitize;
330
- /**
331
- * If the input `html` contains images with 'src' pointing to local file system (it happens when pasting images and text from MS Word),
332
- * the function will extract the images sources from the RTF in base64 format and replace them in the input `html`.
333
- *
334
- * @param html&mdash;The input HTML (pasted HTML).
335
- * @param clipboardData&mdash;The paste event clipboardData object (event.clipboardData).
336
- * @returns&mdash;The html with the replaced images sources.
337
- */
338
- function replaceImageSourcesFromRtf(html, clipboardData) {
339
- return (0, kendo_editor_common_1.replaceImageSourcesFromRtf)(html, clipboardData);
340
- }
341
- EditorUtils.replaceImageSourcesFromRtf = replaceImageSourcesFromRtf;
342
- /**
343
- * Creates a plugin which highlights the matches of Find and Replace dialog.
344
- *
345
- * @param {PluginKey} key&mdash;The key of the plugin (Optional).
346
- * @returns {Plugin}&mdash;The text highlight plugin.
347
- */
348
- function textHighlight(key) {
349
- return (0, kendo_editor_common_1.textHighlight)(key);
350
- }
351
- EditorUtils.textHighlight = textHighlight;
352
- /**
353
- * Creates a plugin which adds image resizing functionality.
354
- *
355
- * @param {ImageResizeOptions} options&mdash;The resizing option (Optional).
356
- * @returns {Plugin}&mdash;The image resizing plugin.
357
- */
358
- function imageResizing(options) {
359
- return (0, kendo_editor_common_1.imageResizing)(options);
360
- }
361
- EditorUtils.imageResizing = imageResizing;
362
- /**
363
- * Returns a collection of plugins that adds table resizing functionality.
364
- *
365
- * @returns {Plugin[]}&mdash;The table resizing plugins.
366
- */
367
- function tableResizing() {
368
- return (0, kendo_editor_common_1.tableResizing)();
369
- }
370
- EditorUtils.tableResizing = tableResizing;
371
- /**
372
- * Sets the HTML to the `EditorView`.
373
- *
374
- * @param {EditorView} view&mdash;The `view` object of the Editor.
375
- * @param {string} html&mdash;The HTML content.
376
- * @param {Command} command&mdash;An optional parameter.
377
- * Defines the type of the command that will be set to the `setHtml` metadata of the transaction.
378
- * Defaults to `SetContent`.
379
- * @param {ParseOptions} parseOptions&mdash;An optional parameter.
380
- * Defines the options that will be used for parsing the HTML. Defaults to `{ preserveWhitespace: 'full' }`.
381
- */
382
- function setHtml(view, html, command, parseOptions) {
383
- var trimmed = (0, kendo_editor_common_1.trimWhitespace)(html);
384
- (0, kendo_editor_common_1.setHtml)(trimmed, command, parseOptions)(view.state, view.dispatch);
385
- }
386
- EditorUtils.setHtml = setHtml;
387
- /**
388
- * Toggles the inline element formatting according to the `InlineFormatOptions` and `markAttrs` settings.
389
- *
390
- * @returns {boolean}
391
- */
392
- function toggleInlineFormat(view, options, transaction, markAttrs) {
393
- return (0, kendo_editor_common_1.toggleInlineFormat)(options, transaction, markAttrs)(view.state, view.dispatch);
394
- }
395
- EditorUtils.toggleInlineFormat = toggleInlineFormat;
396
- /**
397
- * Toggles a list of the specified type.
398
- *
399
- * @returns {boolean}
400
- */
401
- function toggleList(view, types, command) {
402
- return (0, kendo_editor_common_1.toggleList)(view.state, view.dispatch, view, types, command);
403
- }
404
- EditorUtils.toggleList = toggleList;
405
- /* eslint-disable max-len */
406
- /**
407
- * A function which returns the mapped `Shortcuts` object based on the passed settings.
408
- * Useful when the default Editor nodes or tool settings are changed and the `Shortcuts` object has to be regenerated.
409
- *
410
- * @params&mdash;An object which holds specific types of nodes and tool settings that are used by the default `Shortcuts` handlers.
411
- * @returns&mdash;An object which holds the shortcuts.
412
- */
413
- // tslint:enable:max-line-length
414
- function getShortcuts(settings) {
415
- return shortcuts.getShortcuts(settings);
416
- }
417
- EditorUtils.getShortcuts = getShortcuts;
418
- /**
419
- * The `PluginKey` used in the Editor to pass editor props to the tools.
420
- */
421
- EditorUtils.propsKey = props_key_1.editorPropsKey;
422
- /**
423
- * The `PluginKey` used in the Editor by the image resizing plugin.
424
- */
425
- EditorUtils.imageResizeKey = kendo_editor_common_1.imageResizeKey;
426
- /**
427
- * Represents the `marks` object of the Editor.
428
- */
429
- EditorUtils.marks = __assign({}, schema_1.marks);
430
- /**
431
- * Represents the `nodes` object of the Editor.
432
- */
433
- EditorUtils.nodes = __assign({}, schema_1.nodes);
434
- })(EditorUtils = exports.EditorUtils || (exports.EditorUtils = {}));
@@ -1,5 +0,0 @@
1
- import { PluginKey } from '@progress/kendo-editor-common';
2
- /**
3
- * @hidden
4
- */
5
- export declare const editorPropsKey: PluginKey<any>;
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.editorPropsKey = void 0;
4
- var kendo_editor_common_1 = require("@progress/kendo-editor-common");
5
- /**
6
- * @hidden
7
- */
8
- exports.editorPropsKey = new kendo_editor_common_1.PluginKey('editor-props');