@progress/kendo-react-editor 5.4.0-dev.202205200719 → 5.4.0-dev.202206061009

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 (113) hide show
  1. package/dist/cdn/js/kendo-react-editor.js +1 -1
  2. package/dist/es/Editor.d.ts +5 -5
  3. package/dist/es/Editor.js +25 -11
  4. package/dist/es/EditorProps.d.ts +1 -1
  5. package/dist/es/EditorProps.js +1 -0
  6. package/dist/es/config/pasteSettings.js +1 -0
  7. package/dist/es/config/shortcuts.d.ts +6 -6
  8. package/dist/es/config/shortcuts.js +1 -1
  9. package/dist/es/config/toolsSettings.js +23 -14
  10. package/dist/es/dialogs/EditorDialogProps.js +1 -0
  11. package/dist/es/dialogs/FindReplace.d.ts +1 -1
  12. package/dist/es/dialogs/FindReplace.js +6 -5
  13. package/dist/es/dialogs/insertImage.d.ts +1 -1
  14. package/dist/es/dialogs/insertImage.js +13 -2
  15. package/dist/es/dialogs/insertLink.d.ts +1 -1
  16. package/dist/es/dialogs/insertLink.js +13 -2
  17. package/dist/es/dialogs/main.js +3 -1
  18. package/dist/es/dialogs/viewHtml.d.ts +1 -1
  19. package/dist/es/dialogs/viewHtml.js +13 -2
  20. package/dist/es/main.d.ts +3 -3
  21. package/dist/es/main.js +116 -29
  22. package/dist/es/messages/index.d.ts +78 -391
  23. package/dist/es/package-metadata.js +1 -1
  24. package/dist/es/tools/ToolProps.d.ts +4 -1
  25. package/dist/es/tools/ToolProps.js +1 -0
  26. package/dist/es/tools/align.js +7 -3
  27. package/dist/es/tools/cleanFormatting.js +5 -3
  28. package/dist/es/tools/findReplace.d.ts +1 -1
  29. package/dist/es/tools/findReplace.js +7 -3
  30. package/dist/es/tools/fontStyle.js +7 -3
  31. package/dist/es/tools/formatBlock.js +7 -3
  32. package/dist/es/tools/indent.js +7 -3
  33. package/dist/es/tools/inlineFormat.js +7 -3
  34. package/dist/es/tools/insertImage.js +7 -3
  35. package/dist/es/tools/insertLink.js +7 -3
  36. package/dist/es/tools/insertTable/popup.js +3 -1
  37. package/dist/es/tools/insertTable/popupGrid.js +4 -2
  38. package/dist/es/tools/insertTable/tool.js +7 -3
  39. package/dist/es/tools/lists-styled.js +13 -4
  40. package/dist/es/tools/lists.js +7 -3
  41. package/dist/es/tools/main.d.ts +113 -112
  42. package/dist/es/tools/main.js +3 -1
  43. package/dist/es/tools/outdent.js +7 -3
  44. package/dist/es/tools/pdf.js +6 -4
  45. package/dist/es/tools/print.js +5 -3
  46. package/dist/es/tools/proseMirrorTool.js +7 -3
  47. package/dist/es/tools/selectAll.js +5 -3
  48. package/dist/es/tools/tableEdit.d.ts +8 -8
  49. package/dist/es/tools/unlink.js +7 -3
  50. package/dist/es/tools/utils.d.ts +1 -1
  51. package/dist/es/tools/viewHtml.js +7 -3
  52. package/dist/es/utils/controlled-value.d.ts +1 -2
  53. package/dist/npm/Editor.d.ts +5 -5
  54. package/dist/npm/Editor.js +35 -20
  55. package/dist/npm/EditorProps.d.ts +1 -1
  56. package/dist/npm/config/defaultStyles.js +1 -0
  57. package/dist/npm/config/schema.js +3 -2
  58. package/dist/npm/config/shortcuts.d.ts +6 -6
  59. package/dist/npm/config/shortcuts.js +7 -5
  60. package/dist/npm/config/toolsSettings.js +24 -14
  61. package/dist/npm/dialogs/FindReplace.d.ts +1 -1
  62. package/dist/npm/dialogs/FindReplace.js +15 -13
  63. package/dist/npm/dialogs/insertImage.d.ts +1 -1
  64. package/dist/npm/dialogs/insertImage.js +17 -5
  65. package/dist/npm/dialogs/insertLink.d.ts +1 -1
  66. package/dist/npm/dialogs/insertLink.js +18 -6
  67. package/dist/npm/dialogs/main.js +4 -1
  68. package/dist/npm/dialogs/viewHtml.d.ts +1 -1
  69. package/dist/npm/dialogs/viewHtml.js +19 -7
  70. package/dist/npm/main.d.ts +3 -3
  71. package/dist/npm/main.js +121 -33
  72. package/dist/npm/messages/index.d.ts +78 -391
  73. package/dist/npm/messages/index.js +2 -1
  74. package/dist/npm/package-metadata.js +2 -1
  75. package/dist/npm/tools/ToolProps.d.ts +4 -1
  76. package/dist/npm/tools/align.js +14 -8
  77. package/dist/npm/tools/applyColor.js +5 -3
  78. package/dist/npm/tools/cleanFormatting.js +10 -6
  79. package/dist/npm/tools/findReplace.d.ts +1 -1
  80. package/dist/npm/tools/findReplace.js +10 -5
  81. package/dist/npm/tools/fontStyle.js +12 -7
  82. package/dist/npm/tools/formatBlock.js +12 -7
  83. package/dist/npm/tools/history.js +3 -2
  84. package/dist/npm/tools/indent.js +16 -11
  85. package/dist/npm/tools/inlineFormat.js +12 -7
  86. package/dist/npm/tools/insertImage.js +13 -7
  87. package/dist/npm/tools/insertLink.js +11 -6
  88. package/dist/npm/tools/insertTable/index.js +3 -2
  89. package/dist/npm/tools/insertTable/popup.js +4 -1
  90. package/dist/npm/tools/insertTable/popupGrid.js +5 -3
  91. package/dist/npm/tools/insertTable/tool.js +13 -8
  92. package/dist/npm/tools/lists-styled.js +18 -7
  93. package/dist/npm/tools/lists.js +12 -7
  94. package/dist/npm/tools/main.d.ts +113 -112
  95. package/dist/npm/tools/main.js +4 -1
  96. package/dist/npm/tools/outdent.js +14 -9
  97. package/dist/npm/tools/pdf.js +10 -6
  98. package/dist/npm/tools/print.js +9 -5
  99. package/dist/npm/tools/proseMirrorTool.js +12 -6
  100. package/dist/npm/tools/selectAll.js +10 -6
  101. package/dist/npm/tools/tableEdit.d.ts +8 -8
  102. package/dist/npm/tools/tableEdit.js +14 -13
  103. package/dist/npm/tools/unlink.js +12 -7
  104. package/dist/npm/tools/utils.d.ts +1 -1
  105. package/dist/npm/tools/utils.js +1 -0
  106. package/dist/npm/tools/viewHtml.js +10 -5
  107. package/dist/npm/utils/browser-detection.js +1 -0
  108. package/dist/npm/utils/controlled-value.d.ts +1 -2
  109. package/dist/npm/utils/controlled-value.js +3 -1
  110. package/dist/npm/utils/index.js +37 -36
  111. package/dist/npm/utils/props-key.js +1 -0
  112. package/dist/systemjs/kendo-react-editor.js +1 -1
  113. package/package.json +13 -13
@@ -30,7 +30,7 @@ interface EditorStateInterface {
30
30
  * ReactDOM.render(<App />, document.querySelector('my-app'));
31
31
  * ```
32
32
  */
33
- export default class Editor extends React.Component<EditorProps, EditorStateInterface> {
33
+ export declare class Editor extends React.Component<EditorProps, EditorStateInterface> {
34
34
  /**
35
35
  * @hidden
36
36
  */
@@ -60,19 +60,19 @@ export default class Editor extends React.Component<EditorProps, EditorStateInte
60
60
  /**
61
61
  * The value of the Editor.
62
62
  */
63
- readonly value: Node | string;
63
+ get value(): Node | string;
64
64
  /**
65
65
  * Returns the DOM element of the Editor.
66
66
  */
67
- readonly element: HTMLElement;
67
+ get element(): HTMLElement | null;
68
68
  /**
69
69
  * Returns the content-editable DOM element of the Editor.
70
70
  */
71
- readonly contentElement: HTMLDivElement;
71
+ get contentElement(): HTMLDivElement | null;
72
72
  /**
73
73
  * Returns the `view` object of the Editor.
74
74
  */
75
- readonly view: EditorView<any>;
75
+ get view(): EditorView<any> | undefined;
76
76
  private _element;
77
77
  private _view?;
78
78
  private _contentElement;
package/dist/es/Editor.js CHANGED
@@ -2,10 +2,12 @@ var __extends = (this && this.__extends) || (function () {
2
2
  var extendStatics = function (d, b) {
3
3
  extendStatics = Object.setPrototypeOf ||
4
4
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
6
  return extendStatics(d, b);
7
7
  };
8
8
  return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
9
11
  extendStatics(d, b);
10
12
  function __() { this.constructor = d; }
11
13
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -22,6 +24,15 @@ var __assign = (this && this.__assign) || function () {
22
24
  };
23
25
  return __assign.apply(this, arguments);
24
26
  };
27
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
28
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
29
+ if (ar || !(i in from)) {
30
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
31
+ ar[i] = from[i];
32
+ }
33
+ }
34
+ return to.concat(ar || Array.prototype.slice.call(from));
35
+ };
25
36
  import * as React from 'react';
26
37
  import * as PropTypes from 'prop-types';
27
38
  import { ButtonGroup, Toolbar, ToolbarSeparator } from '@progress/kendo-react-buttons';
@@ -69,6 +80,9 @@ var Editor = /** @class */ (function (_super) {
69
80
  view: undefined,
70
81
  linkDialog: false
71
82
  };
83
+ _this._element = null;
84
+ _this._contentElement = null;
85
+ _this.iframe = null;
72
86
  _this.trOnChange = null;
73
87
  _this.htmlOnChange = null;
74
88
  /**
@@ -164,9 +178,9 @@ var Editor = /** @class */ (function (_super) {
164
178
  licensing.validatePackage(packageMetadata);
165
179
  }
166
180
  else {
167
- var message = "License activation failed for " + packageMetadata.name + "\n";
181
+ var message = "License activation failed for ".concat(packageMetadata.name, "\n");
168
182
  message += 'The @progress/kendo-licensing script is not loaded.\n';
169
- message += "See " + packageMetadata.licensingDocsUrl + " for more information.\n";
183
+ message += "See ".concat(packageMetadata.licensingDocsUrl, " for more information.\n");
170
184
  console.warn(message);
171
185
  }
172
186
  return _this;
@@ -187,7 +201,7 @@ var Editor = /** @class */ (function (_super) {
187
201
  }
188
202
  return this.props.defaultContent || '';
189
203
  },
190
- enumerable: true,
204
+ enumerable: false,
191
205
  configurable: true
192
206
  });
193
207
  Object.defineProperty(Editor.prototype, "element", {
@@ -197,7 +211,7 @@ var Editor = /** @class */ (function (_super) {
197
211
  get: function () {
198
212
  return this._element;
199
213
  },
200
- enumerable: true,
214
+ enumerable: false,
201
215
  configurable: true
202
216
  });
203
217
  Object.defineProperty(Editor.prototype, "contentElement", {
@@ -207,7 +221,7 @@ var Editor = /** @class */ (function (_super) {
207
221
  get: function () {
208
222
  return this._contentElement;
209
223
  },
210
- enumerable: true,
224
+ enumerable: false,
211
225
  configurable: true
212
226
  });
213
227
  Object.defineProperty(Editor.prototype, "view", {
@@ -217,7 +231,7 @@ var Editor = /** @class */ (function (_super) {
217
231
  get: function () {
218
232
  return this._view;
219
233
  },
220
- enumerable: true,
234
+ enumerable: false,
221
235
  configurable: true
222
236
  });
223
237
  /**
@@ -330,10 +344,10 @@ var Editor = /** @class */ (function (_super) {
330
344
  gapCursor(),
331
345
  tableEditing()
332
346
  ];
333
- var shortcuts = __assign({}, EditorUtils.getShortcuts({
347
+ var shortcuts = __assign(__assign({}, EditorUtils.getShortcuts({
334
348
  types: { listItem: 'list_item', hardBreak: 'hard_break' },
335
349
  toolsSettings: { bold: bold, italic: italic, underline: underline }
336
- }), { 'Mod-k': function () {
350
+ })), { 'Mod-k': function () {
337
351
  var linkDialog = _this.state.linkDialog;
338
352
  var editorView = _this.view;
339
353
  if (editorView) {
@@ -352,7 +366,7 @@ var Editor = /** @class */ (function (_super) {
352
366
  EditorUtils.createDocument(new Schema({ nodes: nodes, marks: marks }), value || defaultContent, { preserveWhitespace: preserveWhitespace });
353
367
  var viewProps = {
354
368
  state: EditorState.create({
355
- plugins: plugins.concat([keymap(shortcuts), keymap(baseKeymap)]),
369
+ plugins: __spreadArray(__spreadArray([], plugins, true), [keymap(shortcuts), keymap(baseKeymap)], false),
356
370
  doc: doc
357
371
  }),
358
372
  transformPastedHTML: this.onPasteHtml,
@@ -393,4 +407,4 @@ var Editor = /** @class */ (function (_super) {
393
407
  };
394
408
  return Editor;
395
409
  }(React.Component));
396
- export default Editor;
410
+ export { Editor };
@@ -2,7 +2,7 @@
2
2
  /// <reference types="react" />
3
3
  import { EditorState, Plugin, Transaction, EditorView, Schema, Node } from '@progress/kendo-editor-common';
4
4
  import { EditorUtils } from './utils';
5
- import Editor from './Editor';
5
+ import { Editor } from './Editor';
6
6
  interface EditorEvent {
7
7
  /**
8
8
  * An event target.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -13,10 +13,10 @@ export declare const getShortcuts: (settings?: {
13
13
  types?: {
14
14
  listItem: string;
15
15
  hardBreak: string;
16
- };
16
+ } | undefined;
17
17
  toolsSettings?: {
18
- bold?: EditorToolsSettings.InlineFormatOptions;
19
- italic?: EditorToolsSettings.InlineFormatOptions;
20
- underline?: EditorToolsSettings.InlineFormatOptions;
21
- };
22
- }) => Shortcuts;
18
+ bold?: EditorToolsSettings.InlineFormatOptions | undefined;
19
+ italic?: EditorToolsSettings.InlineFormatOptions | undefined;
20
+ underline?: EditorToolsSettings.InlineFormatOptions | undefined;
21
+ } | undefined;
22
+ } | undefined) => Shortcuts;
@@ -27,7 +27,7 @@ export var getShortcuts = function (settings) {
27
27
  });
28
28
  var listItem = settings && settings.types && settings.types.listItem || 'list_item';
29
29
  var toolsSettings = settings && settings.toolsSettings || {};
30
- var shortcutsSettings = __assign({ 'Mod-b': function (state, dispatch) { return toggleInlineFormat(toolsSettings.bold || bold)(state, dispatch); }, 'Mod-i': function (state, dispatch) { return toggleInlineFormat(toolsSettings.italic || italic)(state, dispatch); }, 'Mod-u': function (state, dispatch) { return toggleInlineFormat(toolsSettings.underline || underline)(state, dispatch); }, 'Mod-z': undo, 'Shift-Mod-z': redo }, __assign({}, !mac ? { 'Mod-y': redo } : {}), { 'Backspace': undoInputRule, 'Mod-Enter': insertBr, 'Shift-Enter': insertBr }, __assign({}, mac ? { 'Ctrl-Enter': insertBr } : {}), { 'Enter': function (state, dispatch) {
30
+ var shortcutsSettings = __assign(__assign(__assign(__assign({ 'Mod-b': function (state, dispatch) { return toggleInlineFormat(toolsSettings.bold || bold)(state, dispatch); }, 'Mod-i': function (state, dispatch) { return toggleInlineFormat(toolsSettings.italic || italic)(state, dispatch); }, 'Mod-u': function (state, dispatch) { return toggleInlineFormat(toolsSettings.underline || underline)(state, dispatch); }, 'Mod-z': undo, 'Shift-Mod-z': redo }, __assign({}, !mac ? { 'Mod-y': redo } : {})), { 'Backspace': undoInputRule, 'Mod-Enter': insertBr, 'Shift-Enter': insertBr }), __assign({}, mac ? { 'Ctrl-Enter': insertBr } : {})), { 'Enter': function (state, dispatch) {
31
31
  return splitListItem(state.schema.nodes[listItem])(state, dispatch);
32
32
  }, 'Tab': goToNextCell(1), 'Shift-Tab': goToNextCell(-1) });
33
33
  return shortcutsSettings;
@@ -9,6 +9,15 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
13
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
14
+ if (ar || !(i in from)) {
15
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
16
+ ar[i] = from[i];
17
+ }
18
+ }
19
+ return to.concat(ar || Array.prototype.slice.call(from));
20
+ };
12
21
  import { keys, messages } from './../messages';
13
22
  import { bold as boldSettings, italic as italicSettings, underline as underlineSettings, strikethrough as strikethroughSettings, subscript as subscriptSettings, superscript as superscriptSettings, link as linkSettings, alignLeftRules, alignRightRules, alignCenterRules, alignJustifyRules, alignRemoveRules, indentRules, outdentRules } from '@progress/kendo-editor-common';
14
23
  /**
@@ -29,43 +38,43 @@ export var EditorToolsSettings;
29
38
  /**
30
39
  * The object of the Bold tool settings.
31
40
  */
32
- EditorToolsSettings.bold = __assign({}, boldSettings, { props: __assign({ icon: 'bold' }, buttonCommonProps), messages: {
41
+ EditorToolsSettings.bold = __assign(__assign({}, boldSettings), { props: __assign({ icon: 'bold' }, buttonCommonProps), messages: {
33
42
  title: keys.bold
34
43
  }, commandName: 'Bold' });
35
44
  /**
36
45
  * The object of the Italic tool settings.
37
46
  */
38
- EditorToolsSettings.italic = __assign({}, italicSettings, { props: __assign({ icon: 'italic' }, buttonCommonProps), messages: {
47
+ EditorToolsSettings.italic = __assign(__assign({}, italicSettings), { props: __assign({ icon: 'italic' }, buttonCommonProps), messages: {
39
48
  title: keys.italic
40
49
  }, commandName: 'Italic' });
41
50
  /**
42
51
  * The object of the Underline tool settings.
43
52
  */
44
- EditorToolsSettings.underline = __assign({}, underlineSettings, { props: __assign({ icon: 'underline' }, buttonCommonProps), messages: {
53
+ EditorToolsSettings.underline = __assign(__assign({}, underlineSettings), { props: __assign({ icon: 'underline' }, buttonCommonProps), messages: {
45
54
  title: keys.underline
46
55
  }, commandName: 'Underline' });
47
56
  /**
48
57
  * The object of the Strikethrough tool settings.
49
58
  */
50
- EditorToolsSettings.strikethrough = __assign({}, strikethroughSettings, { props: __assign({ icon: 'strikethrough' }, buttonCommonProps), messages: {
59
+ EditorToolsSettings.strikethrough = __assign(__assign({}, strikethroughSettings), { props: __assign({ icon: 'strikethrough' }, buttonCommonProps), messages: {
51
60
  title: keys.strikethrough
52
61
  }, commandName: 'Strikethrough' });
53
62
  /**
54
63
  * The object of the Subscript tool settings.
55
64
  */
56
- EditorToolsSettings.subscript = __assign({}, subscriptSettings, { props: __assign({ icon: 'subscript' }, buttonCommonProps), messages: {
65
+ EditorToolsSettings.subscript = __assign(__assign({}, subscriptSettings), { props: __assign({ icon: 'subscript' }, buttonCommonProps), messages: {
57
66
  title: keys.subscript
58
67
  }, commandName: 'Subscript' });
59
68
  /**
60
69
  * The object of the Superscript tool settings.
61
70
  */
62
- EditorToolsSettings.superscript = __assign({}, superscriptSettings, { props: __assign({ icon: 'superscript' }, buttonCommonProps), messages: {
71
+ EditorToolsSettings.superscript = __assign(__assign({}, superscriptSettings), { props: __assign({ icon: 'superscript' }, buttonCommonProps), messages: {
63
72
  title: keys.superscript
64
73
  }, commandName: 'Superscript' });
65
74
  /**
66
75
  * The object of the Link tool settings.
67
76
  */
68
- EditorToolsSettings.link = __assign({}, linkSettings, { props: __assign({ icon: 'link-horizontal' }, buttonCommonProps), messages: {
77
+ EditorToolsSettings.link = __assign(__assign({}, linkSettings), { props: __assign({ icon: 'link-horizontal' }, buttonCommonProps), messages: {
69
78
  insertHyperlink: keys.insertHyperlink,
70
79
  insertHyperlinkDialogTitle: keys.insertHyperlinkDialogTitle,
71
80
  insertHyperlinkAddress: keys.insertHyperlinkAddress,
@@ -77,7 +86,7 @@ export var EditorToolsSettings;
77
86
  /**
78
87
  * The object of the Link tool settings.
79
88
  */
80
- EditorToolsSettings.insertFile = __assign({}, linkSettings, { props: __assign({ icon: 'file-add' }, buttonCommonProps), messages: {
89
+ EditorToolsSettings.insertFile = __assign(__assign({}, linkSettings), { props: __assign({ icon: 'file-add' }, buttonCommonProps), messages: {
81
90
  insertHyperlink: keys.insertFile,
82
91
  insertHyperlinkDialogTitle: keys.insertFileDialogTitle,
83
92
  insertHyperlinkAddress: keys.insertFileAddress,
@@ -296,7 +305,7 @@ export var EditorToolsSettings;
296
305
  /**
297
306
  * The object of the Unlink tool settings.
298
307
  */
299
- EditorToolsSettings.unlink = __assign({}, linkSettings, { props: __assign({ icon: 'unlink-horizontal' }, buttonCommonProps), messages: {
308
+ EditorToolsSettings.unlink = __assign(__assign({}, linkSettings), { props: __assign({ icon: 'unlink-horizontal' }, buttonCommonProps), messages: {
300
309
  title: keys.unlink
301
310
  }, commandName: 'Unlink' });
302
311
  /**
@@ -408,7 +417,7 @@ export var EditorToolsSettings;
408
417
  * The object of the AlignLeft tool settings.
409
418
  */
410
419
  EditorToolsSettings.alignLeft = {
411
- actions: alignLeftRules.slice(),
420
+ actions: __spreadArray([], alignLeftRules, true),
412
421
  props: __assign({ icon: 'align-left' }, buttonCommonProps),
413
422
  messages: {
414
423
  title: keys.alignLeft
@@ -419,7 +428,7 @@ export var EditorToolsSettings;
419
428
  * The object of the AlignRight tool settings.
420
429
  */
421
430
  EditorToolsSettings.alignRight = {
422
- actions: alignRightRules.slice(),
431
+ actions: __spreadArray([], alignRightRules, true),
423
432
  props: __assign({ icon: 'align-right' }, buttonCommonProps),
424
433
  messages: {
425
434
  title: keys.alignRight
@@ -430,7 +439,7 @@ export var EditorToolsSettings;
430
439
  * The object of the AlignCenter tool settings.
431
440
  */
432
441
  EditorToolsSettings.alignCenter = {
433
- actions: alignCenterRules.slice(),
442
+ actions: __spreadArray([], alignCenterRules, true),
434
443
  props: __assign({ icon: 'align-center' }, buttonCommonProps),
435
444
  messages: {
436
445
  title: keys.alignCenter
@@ -441,7 +450,7 @@ export var EditorToolsSettings;
441
450
  * The object of the AlignJustify tool settings.
442
451
  */
443
452
  EditorToolsSettings.alignJustify = {
444
- actions: alignJustifyRules.slice(),
453
+ actions: __spreadArray([], alignJustifyRules, true),
445
454
  props: __assign({ icon: 'align-justify' }, buttonCommonProps),
446
455
  messages: {
447
456
  title: keys.alignJustify
@@ -452,7 +461,7 @@ export var EditorToolsSettings;
452
461
  * The object of the AlignRemove tool settings.
453
462
  */
454
463
  EditorToolsSettings.alignRemove = {
455
- actions: alignRemoveRules.slice(),
464
+ actions: __spreadArray([], alignRemoveRules, true),
456
465
  props: __assign({ icon: 'align-remove' }, buttonCommonProps),
457
466
  messages: {},
458
467
  commandName: 'AlignRemove'
@@ -0,0 +1 @@
1
+ export {};
@@ -41,7 +41,7 @@ export declare class FindAndReplaceDialog extends React.Component<FindAndReplace
41
41
  * @hidden
42
42
  */
43
43
  state: FindAndReplaceDialogState;
44
- private readonly settings;
44
+ private get settings();
45
45
  constructor(props: FindAndReplaceDialogProps);
46
46
  /**
47
47
  * @hidden
@@ -2,10 +2,12 @@ var __extends = (this && this.__extends) || (function () {
2
2
  var extendStatics = function (d, b) {
3
3
  extendStatics = Object.setPrototypeOf ||
4
4
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
6
  return extendStatics(d, b);
7
7
  };
8
8
  return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
9
11
  extendStatics(d, b);
10
12
  function __() { this.constructor = d; }
11
13
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -118,7 +120,7 @@ var FindAndReplaceDialog = /** @class */ (function (_super) {
118
120
  _this.onSearchChange = function (e) { return _this.setNextState({ searchText: e.target.value }); };
119
121
  _this.onReplaceChange = function (e) { return _this.setNextState({ replaceText: e.target.value }); };
120
122
  _this.setNextState = function (next) {
121
- var nextState = __assign({}, _this.state, next, { matches: undefined, nextMatch: undefined });
123
+ var nextState = __assign(__assign(__assign({}, _this.state), next), { matches: undefined, nextMatch: undefined });
122
124
  var view = _this.props.view;
123
125
  if (nextState.searchText) {
124
126
  var text = nextState.searchText, matchWord = nextState.matchWord, matchCase = nextState.matchCase, useRegExp = nextState.useRegExp, matchCyclic = nextState.matchCyclic;
@@ -129,8 +131,7 @@ var FindAndReplaceDialog = /** @class */ (function (_super) {
129
131
  matches.find(function (match) { return match.from >= selection_1.from; }) ||
130
132
  (matchCyclic && matches[0]) ||
131
133
  undefined;
132
- _this.setState(__assign({}, nextState, { matches: matches,
133
- nextMatch: nextMatch }));
134
+ _this.setState(__assign(__assign({}, nextState), { matches: matches, nextMatch: nextMatch }));
134
135
  }
135
136
  else {
136
137
  _this.setState(nextState);
@@ -151,7 +152,7 @@ var FindAndReplaceDialog = /** @class */ (function (_super) {
151
152
  get: function () {
152
153
  return this.props.settings || settings;
153
154
  },
154
- enumerable: true,
155
+ enumerable: false,
155
156
  configurable: true
156
157
  });
157
158
  /**
@@ -22,7 +22,7 @@ export declare class InsertImageDialog extends React.Component<InsertImageDialog
22
22
  /**
23
23
  * @hidden
24
24
  */
25
- render(): {};
25
+ render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
26
26
  private onClose;
27
27
  private onInsert;
28
28
  }
@@ -2,15 +2,26 @@ var __extends = (this && this.__extends) || (function () {
2
2
  var extendStatics = function (d, b) {
3
3
  extendStatics = Object.setPrototypeOf ||
4
4
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
6
  return extendStatics(d, b);
7
7
  };
8
8
  return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
9
11
  extendStatics(d, b);
10
12
  function __() { this.constructor = d; }
11
13
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
14
  };
13
15
  })();
16
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
17
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
18
+ if (ar || !(i in from)) {
19
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
20
+ ar[i] = from[i];
21
+ }
22
+ }
23
+ return to.concat(ar || Array.prototype.slice.call(from));
24
+ };
14
25
  import * as React from 'react';
15
26
  import { Dialog, DialogActionsBar } from '@progress/kendo-react-dialogs';
16
27
  import { Button } from '@progress/kendo-react-buttons';
@@ -95,7 +106,7 @@ var InsertImageDialog = /** @class */ (function (_super) {
95
106
  var actionButtons = [(React.createElement(Button, { onClick: this.onClose, dir: dir, key: "cancel" }, localization.toLanguageString(insertImageCancel, messages[insertImageCancel]))), (React.createElement(Button, { onClick: this.onInsert, themeColor: 'primary', dir: dir, key: "insert" }, localization.toLanguageString(insertImageInsert, messages[insertImageInsert])))];
96
107
  var dialog = (React.createElement(Dialog, { title: localization.toLanguageString(insertImageDialogTitle, messages[insertImageDialogTitle]), onClose: this.onClose, key: "dialog", closeIcon: true, dir: dir, style: dir === 'rtl' ? { textAlign: 'right' } : undefined, appendTo: document.body },
97
108
  content,
98
- React.createElement(DialogActionsBar, null, actionButtons)));
109
+ React.createElement.apply(React, __spreadArray([DialogActionsBar, null], actionButtons, false))));
99
110
  return render ? render(dialog, { content: content, actionButtons: actionButtons }) : dialog;
100
111
  };
101
112
  return InsertImageDialog;
@@ -20,7 +20,7 @@ export declare class InsertLinkDialog extends React.Component<InsertLinkDialogPr
20
20
  /**
21
21
  * @hidden
22
22
  */
23
- render(): {};
23
+ render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
24
24
  private onClose;
25
25
  private onInsert;
26
26
  }
@@ -2,15 +2,26 @@ var __extends = (this && this.__extends) || (function () {
2
2
  var extendStatics = function (d, b) {
3
3
  extendStatics = Object.setPrototypeOf ||
4
4
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
6
  return extendStatics(d, b);
7
7
  };
8
8
  return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
9
11
  extendStatics(d, b);
10
12
  function __() { this.constructor = d; }
11
13
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
14
  };
13
15
  })();
16
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
17
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
18
+ if (ar || !(i in from)) {
19
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
20
+ ar[i] = from[i];
21
+ }
22
+ }
23
+ return to.concat(ar || Array.prototype.slice.call(from));
24
+ };
14
25
  import * as React from 'react';
15
26
  import { Dialog, DialogActionsBar } from '@progress/kendo-react-dialogs';
16
27
  import { Button } from '@progress/kendo-react-buttons';
@@ -71,7 +82,7 @@ var InsertLinkDialog = /** @class */ (function (_super) {
71
82
  ];
72
83
  var dialog = (React.createElement(Dialog, { title: localization.toLanguageString(insertHyperlinkDialogTitle, messages[insertHyperlinkDialogTitle]), onClose: this.onClose, closeIcon: true, dir: dir, style: dir === 'rtl' ? { textAlign: 'right' } : undefined, appendTo: document.body },
73
84
  content,
74
- React.createElement(DialogActionsBar, null, actionButtons)));
85
+ React.createElement.apply(React, __spreadArray([DialogActionsBar, null], actionButtons, false))));
75
86
  return render ? render(dialog, { content: content, actionButtons: actionButtons }) : dialog;
76
87
  };
77
88
  return InsertLinkDialog;
@@ -2,10 +2,12 @@ var __extends = (this && this.__extends) || (function () {
2
2
  var extendStatics = function (d, b) {
3
3
  extendStatics = Object.setPrototypeOf ||
4
4
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
6
  return extendStatics(d, b);
7
7
  };
8
8
  return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
9
11
  extendStatics(d, b);
10
12
  function __() { this.constructor = d; }
11
13
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
@@ -18,7 +18,7 @@ export declare class ViewHtmlDialog extends React.Component<ViewHtmlDialogProps>
18
18
  /**
19
19
  * @hidden
20
20
  */
21
- render(): {};
21
+ render(): string | number | boolean | React.ReactFragment | JSX.Element | null | undefined;
22
22
  private onUpdate;
23
23
  private onClose;
24
24
  }
@@ -2,15 +2,26 @@ var __extends = (this && this.__extends) || (function () {
2
2
  var extendStatics = function (d, b) {
3
3
  extendStatics = Object.setPrototypeOf ||
4
4
  ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
6
  return extendStatics(d, b);
7
7
  };
8
8
  return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
9
11
  extendStatics(d, b);
10
12
  function __() { this.constructor = d; }
11
13
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
12
14
  };
13
15
  })();
16
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
17
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
18
+ if (ar || !(i in from)) {
19
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
20
+ ar[i] = from[i];
21
+ }
22
+ }
23
+ return to.concat(ar || Array.prototype.slice.call(from));
24
+ };
14
25
  import * as React from 'react';
15
26
  import { Dialog, DialogActionsBar } from '@progress/kendo-react-dialogs';
16
27
  import { Button } from '@progress/kendo-react-buttons';
@@ -55,7 +66,7 @@ var ViewHtmlDialog = /** @class */ (function (_super) {
55
66
  ];
56
67
  var dialog = (React.createElement(Dialog, { title: localization.toLanguageString(viewHtmlDialogTitle, messages[viewHtmlDialogTitle]), onClose: this.onClose, key: "dialog", closeIcon: true, dir: dir, style: dir === 'rtl' ? { textAlign: 'right' } : undefined, appendTo: document.body },
57
68
  content,
58
- React.createElement(DialogActionsBar, null, actionButtons)));
69
+ React.createElement.apply(React, __spreadArray([DialogActionsBar, null], actionButtons, false))));
59
70
  return render ? render(dialog, { content: content, actionButtons: actionButtons }) : dialog;
60
71
  };
61
72
  return ViewHtmlDialog;
package/dist/es/main.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /// <reference types="prosemirror-model" />
2
- import Editor from './Editor';
2
+ import { Editor } from './Editor';
3
3
  import { EditorProps, EditorMountEvent, EditorPasteEvent, EditorChangeEvent, EditorExecuteEvent, EditorFocusEvent, EditorBlurEvent } from './EditorProps';
4
4
  import { EditorTools } from './tools/main';
5
5
  import { EditorToolsSettings } from './config/toolsSettings';
@@ -150,8 +150,8 @@ export declare const ProseMirror: {
150
150
  deleteColumn: typeof deleteColumn;
151
151
  rowIsHeader: typeof rowIsHeader;
152
152
  addRow: typeof addRow;
153
- addRowBefore: (state: EditorState<any>, dispatch?: (tr: Transaction<any>) => void) => boolean;
154
- addRowAfter: (state: EditorState<any>, dispatch?: (tr: Transaction<any>) => void) => boolean;
153
+ addRowBefore: (state: EditorState<any>, dispatch?: ((tr: Transaction<any>) => void) | undefined) => boolean;
154
+ addRowAfter: (state: EditorState<any>, dispatch?: ((tr: Transaction<any>) => void) | undefined) => boolean;
155
155
  deleteRow: typeof deleteRow;
156
156
  mergeCells: typeof mergeCells;
157
157
  splitCell: typeof splitCell;