@progress/kendo-angular-editor 2.5.0-dev.202111240844 → 3.0.0-dev.202112211443

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 (194) hide show
  1. package/dist/cdn/js/kendo-angular-editor.js +2 -2
  2. package/dist/cdn/main.js +1 -1
  3. package/dist/es/common/error-messages.js +3 -2
  4. package/dist/es/editor.component.js +102 -69
  5. package/dist/es/index.js +1 -0
  6. package/dist/es/main.js +1 -0
  7. package/dist/es/package-metadata.js +1 -1
  8. package/dist/es/preventable-events/paste-event-data.js +4 -0
  9. package/dist/es/preventable-events/paste-event.js +25 -0
  10. package/dist/es/tools/alignment/editor-align-center-button.directive.js +5 -3
  11. package/dist/es/tools/alignment/editor-align-justify-button.directive.js +5 -3
  12. package/dist/es/tools/alignment/editor-align-left-button.directive.js +5 -3
  13. package/dist/es/tools/alignment/editor-align-right-button.directive.js +5 -3
  14. package/dist/es/tools/editor-clean-formatting-button.directive.js +5 -3
  15. package/dist/es/tools/fontfamily/editor-fontfamily.component.js +9 -3
  16. package/dist/es/tools/fontsize/editor-fontsize.component.js +9 -3
  17. package/dist/es/tools/format/editor-format.component.js +9 -3
  18. package/dist/es/tools/history/editor-redo-button.directive.js +5 -3
  19. package/dist/es/tools/history/editor-undo-button.directive.js +5 -3
  20. package/dist/es/tools/image/editor-insert-image-button.directive.js +5 -3
  21. package/dist/es/tools/indentation/editor-indent-button.directive.js +5 -3
  22. package/dist/es/tools/indentation/editor-outdent-button.directive.js +5 -3
  23. package/dist/es/tools/link/editor-create-link-button.directive.js +5 -3
  24. package/dist/es/tools/link/editor-insert-file-button.directive.js +5 -3
  25. package/dist/es/tools/link/editor-unlink-button.directive.js +5 -3
  26. package/dist/es/tools/list/editor-insert-ordered-list-button.directive.js +5 -3
  27. package/dist/es/tools/list/editor-insert-unordered-list-button.directive.js +5 -3
  28. package/dist/es/tools/print/editor-print-button.directive.js +5 -3
  29. package/dist/es/tools/select-all/select-all-button.directive.js +5 -3
  30. package/dist/es/tools/shared/editor-command-base.js +3 -1
  31. package/dist/es/tools/shared/editor-command-button.js +3 -2
  32. package/dist/es/tools/shared/editor-command-dialog.js +3 -2
  33. package/dist/es/tools/source/editor-view-source-button.directive.js +5 -3
  34. package/dist/es/tools/tables/editor-add-column-after-button.directive.js +5 -3
  35. package/dist/es/tools/tables/editor-add-column-before-button.directive.js +5 -3
  36. package/dist/es/tools/tables/editor-add-row-after-button.directive.js +5 -3
  37. package/dist/es/tools/tables/editor-add-row-before-button.directive.js +5 -3
  38. package/dist/es/tools/tables/editor-delete-column-button.directive.js +5 -3
  39. package/dist/es/tools/tables/editor-delete-row-button.directive.js +5 -3
  40. package/dist/es/tools/tables/editor-delete-table-button.directive.js +5 -3
  41. package/dist/es/tools/tables/editor-merge-cells-button.directive.js +5 -3
  42. package/dist/es/tools/tables/editor-split-cell-button.directive.js +5 -3
  43. package/dist/es/tools/tools.service.js +20 -0
  44. package/dist/es/tools/typographical-emphasis/editor-bold-button.directive.js +5 -3
  45. package/dist/es/tools/typographical-emphasis/editor-italic-button.directive.js +5 -3
  46. package/dist/es/tools/typographical-emphasis/editor-strikethrough-button.directive.js +5 -3
  47. package/dist/es/tools/typographical-emphasis/editor-subscript-button.directive.js +5 -3
  48. package/dist/es/tools/typographical-emphasis/editor-superscript-button.directive.js +5 -3
  49. package/dist/es/tools/typographical-emphasis/editor-underline-button.directive.js +5 -3
  50. package/dist/es2015/common/error-messages.js +3 -2
  51. package/dist/es2015/common/paste-cleanup-settings.d.ts +14 -0
  52. package/dist/es2015/editor.component.d.ts +18 -11
  53. package/dist/es2015/editor.component.js +102 -69
  54. package/dist/es2015/index.d.ts +1 -0
  55. package/dist/es2015/index.js +1 -0
  56. package/dist/es2015/index.metadata.json +1 -1
  57. package/dist/es2015/main.d.ts +2 -0
  58. package/dist/es2015/main.js +1 -0
  59. package/dist/es2015/package-metadata.js +1 -1
  60. package/dist/es2015/preventable-events/paste-event-data.d.ts +21 -0
  61. package/dist/es2015/preventable-events/paste-event-data.js +4 -0
  62. package/dist/es2015/preventable-events/paste-event.d.ts +27 -0
  63. package/dist/es2015/preventable-events/paste-event.js +20 -0
  64. package/dist/es2015/tools/alignment/editor-align-center-button.directive.d.ts +2 -1
  65. package/dist/es2015/tools/alignment/editor-align-center-button.directive.js +5 -3
  66. package/dist/es2015/tools/alignment/editor-align-justify-button.directive.d.ts +2 -1
  67. package/dist/es2015/tools/alignment/editor-align-justify-button.directive.js +5 -3
  68. package/dist/es2015/tools/alignment/editor-align-left-button.directive.d.ts +2 -1
  69. package/dist/es2015/tools/alignment/editor-align-left-button.directive.js +5 -3
  70. package/dist/es2015/tools/alignment/editor-align-right-button.directive.d.ts +2 -1
  71. package/dist/es2015/tools/alignment/editor-align-right-button.directive.js +5 -3
  72. package/dist/es2015/tools/editor-clean-formatting-button.directive.d.ts +2 -1
  73. package/dist/es2015/tools/editor-clean-formatting-button.directive.js +5 -3
  74. package/dist/es2015/tools/fontfamily/editor-fontfamily.component.d.ts +3 -1
  75. package/dist/es2015/tools/fontfamily/editor-fontfamily.component.js +9 -3
  76. package/dist/es2015/tools/fontsize/editor-fontsize.component.d.ts +3 -1
  77. package/dist/es2015/tools/fontsize/editor-fontsize.component.js +9 -3
  78. package/dist/es2015/tools/format/editor-format.component.d.ts +3 -1
  79. package/dist/es2015/tools/format/editor-format.component.js +9 -3
  80. package/dist/es2015/tools/history/editor-redo-button.directive.d.ts +2 -1
  81. package/dist/es2015/tools/history/editor-redo-button.directive.js +5 -3
  82. package/dist/es2015/tools/history/editor-undo-button.directive.d.ts +2 -1
  83. package/dist/es2015/tools/history/editor-undo-button.directive.js +5 -3
  84. package/dist/es2015/tools/image/editor-insert-image-button.directive.d.ts +2 -1
  85. package/dist/es2015/tools/image/editor-insert-image-button.directive.js +5 -3
  86. package/dist/es2015/tools/indentation/editor-indent-button.directive.d.ts +2 -1
  87. package/dist/es2015/tools/indentation/editor-indent-button.directive.js +5 -3
  88. package/dist/es2015/tools/indentation/editor-outdent-button.directive.d.ts +2 -1
  89. package/dist/es2015/tools/indentation/editor-outdent-button.directive.js +5 -3
  90. package/dist/es2015/tools/link/editor-create-link-button.directive.d.ts +2 -1
  91. package/dist/es2015/tools/link/editor-create-link-button.directive.js +5 -3
  92. package/dist/es2015/tools/link/editor-insert-file-button.directive.d.ts +2 -1
  93. package/dist/es2015/tools/link/editor-insert-file-button.directive.js +5 -3
  94. package/dist/es2015/tools/link/editor-unlink-button.directive.d.ts +2 -1
  95. package/dist/es2015/tools/link/editor-unlink-button.directive.js +5 -3
  96. package/dist/es2015/tools/list/editor-insert-ordered-list-button.directive.d.ts +2 -1
  97. package/dist/es2015/tools/list/editor-insert-ordered-list-button.directive.js +5 -3
  98. package/dist/es2015/tools/list/editor-insert-unordered-list-button.directive.d.ts +2 -1
  99. package/dist/es2015/tools/list/editor-insert-unordered-list-button.directive.js +5 -3
  100. package/dist/es2015/tools/print/editor-print-button.directive.d.ts +2 -1
  101. package/dist/es2015/tools/print/editor-print-button.directive.js +5 -3
  102. package/dist/es2015/tools/select-all/select-all-button.directive.d.ts +2 -1
  103. package/dist/es2015/tools/select-all/select-all-button.directive.js +5 -3
  104. package/dist/es2015/tools/shared/editor-command-base.d.ts +3 -1
  105. package/dist/es2015/tools/shared/editor-command-base.js +3 -1
  106. package/dist/es2015/tools/shared/editor-command-button.d.ts +3 -1
  107. package/dist/es2015/tools/shared/editor-command-button.js +3 -2
  108. package/dist/es2015/tools/shared/editor-command-dialog.d.ts +3 -1
  109. package/dist/es2015/tools/shared/editor-command-dialog.js +3 -2
  110. package/dist/es2015/tools/source/editor-view-source-button.directive.d.ts +2 -1
  111. package/dist/es2015/tools/source/editor-view-source-button.directive.js +5 -3
  112. package/dist/es2015/tools/tables/editor-add-column-after-button.directive.d.ts +2 -1
  113. package/dist/es2015/tools/tables/editor-add-column-after-button.directive.js +5 -3
  114. package/dist/es2015/tools/tables/editor-add-column-before-button.directive.d.ts +2 -1
  115. package/dist/es2015/tools/tables/editor-add-column-before-button.directive.js +5 -3
  116. package/dist/es2015/tools/tables/editor-add-row-after-button.directive.d.ts +2 -1
  117. package/dist/es2015/tools/tables/editor-add-row-after-button.directive.js +5 -3
  118. package/dist/es2015/tools/tables/editor-add-row-before-button.directive.d.ts +2 -1
  119. package/dist/es2015/tools/tables/editor-add-row-before-button.directive.js +5 -3
  120. package/dist/es2015/tools/tables/editor-delete-column-button.directive.d.ts +2 -1
  121. package/dist/es2015/tools/tables/editor-delete-column-button.directive.js +5 -3
  122. package/dist/es2015/tools/tables/editor-delete-row-button.directive.d.ts +2 -1
  123. package/dist/es2015/tools/tables/editor-delete-row-button.directive.js +5 -3
  124. package/dist/es2015/tools/tables/editor-delete-table-button.directive.d.ts +2 -1
  125. package/dist/es2015/tools/tables/editor-delete-table-button.directive.js +5 -3
  126. package/dist/es2015/tools/tables/editor-merge-cells-button.directive.d.ts +2 -1
  127. package/dist/es2015/tools/tables/editor-merge-cells-button.directive.js +5 -3
  128. package/dist/es2015/tools/tables/editor-split-cell-button.directive.d.ts +2 -1
  129. package/dist/es2015/tools/tables/editor-split-cell-button.directive.js +5 -3
  130. package/dist/es2015/tools/tools.service.d.ts +11 -0
  131. package/dist/es2015/tools/tools.service.js +22 -0
  132. package/dist/es2015/tools/typographical-emphasis/editor-bold-button.directive.d.ts +2 -1
  133. package/dist/es2015/tools/typographical-emphasis/editor-bold-button.directive.js +5 -3
  134. package/dist/es2015/tools/typographical-emphasis/editor-italic-button.directive.d.ts +2 -1
  135. package/dist/es2015/tools/typographical-emphasis/editor-italic-button.directive.js +5 -3
  136. package/dist/es2015/tools/typographical-emphasis/editor-strikethrough-button.directive.d.ts +2 -1
  137. package/dist/es2015/tools/typographical-emphasis/editor-strikethrough-button.directive.js +5 -3
  138. package/dist/es2015/tools/typographical-emphasis/editor-subscript-button.directive.d.ts +2 -1
  139. package/dist/es2015/tools/typographical-emphasis/editor-subscript-button.directive.js +5 -3
  140. package/dist/es2015/tools/typographical-emphasis/editor-superscript-button.directive.d.ts +2 -1
  141. package/dist/es2015/tools/typographical-emphasis/editor-superscript-button.directive.js +5 -3
  142. package/dist/es2015/tools/typographical-emphasis/editor-underline-button.directive.d.ts +2 -1
  143. package/dist/es2015/tools/typographical-emphasis/editor-underline-button.directive.js +5 -3
  144. package/dist/fesm2015/index.js +301 -186
  145. package/dist/fesm5/index.js +302 -186
  146. package/dist/npm/common/error-messages.js +3 -1
  147. package/dist/npm/editor.component.js +98 -65
  148. package/dist/npm/index.js +2 -0
  149. package/dist/npm/main.js +2 -0
  150. package/dist/npm/package-metadata.js +1 -1
  151. package/dist/npm/preventable-events/paste-event-data.js +6 -0
  152. package/dist/npm/preventable-events/paste-event.js +27 -0
  153. package/dist/npm/tools/alignment/editor-align-center-button.directive.js +5 -3
  154. package/dist/npm/tools/alignment/editor-align-justify-button.directive.js +5 -3
  155. package/dist/npm/tools/alignment/editor-align-left-button.directive.js +5 -3
  156. package/dist/npm/tools/alignment/editor-align-right-button.directive.js +5 -3
  157. package/dist/npm/tools/editor-clean-formatting-button.directive.js +5 -3
  158. package/dist/npm/tools/fontfamily/editor-fontfamily.component.js +9 -3
  159. package/dist/npm/tools/fontsize/editor-fontsize.component.js +9 -3
  160. package/dist/npm/tools/format/editor-format.component.js +9 -3
  161. package/dist/npm/tools/history/editor-redo-button.directive.js +5 -3
  162. package/dist/npm/tools/history/editor-undo-button.directive.js +5 -3
  163. package/dist/npm/tools/image/editor-insert-image-button.directive.js +5 -3
  164. package/dist/npm/tools/indentation/editor-indent-button.directive.js +5 -3
  165. package/dist/npm/tools/indentation/editor-outdent-button.directive.js +5 -3
  166. package/dist/npm/tools/link/editor-create-link-button.directive.js +5 -3
  167. package/dist/npm/tools/link/editor-insert-file-button.directive.js +5 -3
  168. package/dist/npm/tools/link/editor-unlink-button.directive.js +5 -3
  169. package/dist/npm/tools/list/editor-insert-ordered-list-button.directive.js +5 -3
  170. package/dist/npm/tools/list/editor-insert-unordered-list-button.directive.js +5 -3
  171. package/dist/npm/tools/print/editor-print-button.directive.js +5 -3
  172. package/dist/npm/tools/select-all/select-all-button.directive.js +5 -3
  173. package/dist/npm/tools/shared/editor-command-base.js +3 -1
  174. package/dist/npm/tools/shared/editor-command-button.js +3 -2
  175. package/dist/npm/tools/shared/editor-command-dialog.js +3 -2
  176. package/dist/npm/tools/source/editor-view-source-button.directive.js +5 -3
  177. package/dist/npm/tools/tables/editor-add-column-after-button.directive.js +5 -3
  178. package/dist/npm/tools/tables/editor-add-column-before-button.directive.js +5 -3
  179. package/dist/npm/tools/tables/editor-add-row-after-button.directive.js +5 -3
  180. package/dist/npm/tools/tables/editor-add-row-before-button.directive.js +5 -3
  181. package/dist/npm/tools/tables/editor-delete-column-button.directive.js +5 -3
  182. package/dist/npm/tools/tables/editor-delete-row-button.directive.js +5 -3
  183. package/dist/npm/tools/tables/editor-delete-table-button.directive.js +5 -3
  184. package/dist/npm/tools/tables/editor-merge-cells-button.directive.js +5 -3
  185. package/dist/npm/tools/tables/editor-split-cell-button.directive.js +5 -3
  186. package/dist/npm/tools/tools.service.js +22 -0
  187. package/dist/npm/tools/typographical-emphasis/editor-bold-button.directive.js +5 -3
  188. package/dist/npm/tools/typographical-emphasis/editor-italic-button.directive.js +5 -3
  189. package/dist/npm/tools/typographical-emphasis/editor-strikethrough-button.directive.js +5 -3
  190. package/dist/npm/tools/typographical-emphasis/editor-subscript-button.directive.js +5 -3
  191. package/dist/npm/tools/typographical-emphasis/editor-superscript-button.directive.js +5 -3
  192. package/dist/npm/tools/typographical-emphasis/editor-underline-button.directive.js +5 -3
  193. package/dist/systemjs/kendo-angular-editor.js +1 -1
  194. package/package.json +4 -4
@@ -2,7 +2,7 @@
2
2
  * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
- var ɵ0 = function (arg) { return "plugins must be a function, but received " + JSON.stringify(arg) + "."; };
5
+ var ɵ0 = function (arg) { return "plugins must be a function, but received " + JSON.stringify(arg) + "."; }, ɵ1 = function (arg) { return "pastedContent must be a function, but received " + JSON.stringify(arg) + "."; };
6
6
  /* tslint:disable:variable-name */
7
7
  /**
8
8
  * @hidden
@@ -11,8 +11,9 @@ export var EditorErrorMessages = {
11
11
  schemaType: 'Expected value of type Schema. See http://www.telerik.com/kendo-angular-ui/components/editor/schema/',
12
12
  setSchemaOnce: 'The Schema cannot be changed dynamically. See http://www.telerik.com/kendo-angular-ui/components/editor/schema/',
13
13
  pluginsCallbackType: ɵ0,
14
+ pastedContentCallbackType: ɵ1,
14
15
  setPluginsOnce: 'The plugins cannot be changed dynamically. See http://www.telerik.com/kendo-angular-ui/components/editor/plugins/',
15
16
  setPlaceHolderOnce: 'The placeholder cannot be changed dynamically. See http://www.telerik.com/kendo-angular-ui/components/editor/placeholder/',
16
17
  printTool: 'The Print tool and functionality are supported only in iframe mode. See https://www.telerik.com/kendo-angular-ui-develop/components/editor/api/EditorPrintButtonDirective/'
17
18
  };
18
- export { ɵ0 };
19
+ export { ɵ0, ɵ1 };
@@ -5,12 +5,12 @@
5
5
  import * as tslib_1 from "tslib";
6
6
  import { Component, HostBinding, ViewChild, ContentChild, ViewContainerRef, Output, ElementRef, EventEmitter, forwardRef, Input, ChangeDetectorRef, NgZone, isDevMode } from '@angular/core';
7
7
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
8
- import { BehaviorSubject, fromEvent, merge, Subject, zip } from 'rxjs';
9
- import { map, filter, auditTime, take } from 'rxjs/operators';
8
+ import { BehaviorSubject, fromEvent, Subject, zip } from 'rxjs';
9
+ import { map, filter, take } from 'rxjs/operators';
10
10
  import { ToolBarComponent } from '@progress/kendo-angular-toolbar';
11
11
  import { DialogService } from '@progress/kendo-angular-dialog';
12
- import { isDocumentAvailable, KendoInput } from '@progress/kendo-angular-common';
13
- import { buildKeymap, buildListKeymap, hasSameMarkup, getHtml, pasteCleanup, sanitize, removeComments, sanitizeClassAttr, sanitizeStyleAttr, removeAttribute, placeholder, EditorView, EditorState, baseKeymap, keymap, history, parseContent, Plugin, PluginKey, TextSelection, Schema, gapCursor, getSelectionText, imageResizing } from '@progress/kendo-editor-common';
12
+ import { hasObservers, isDocumentAvailable, KendoInput } from '@progress/kendo-angular-common';
13
+ import { buildKeymap, buildListKeymap, getHtml, pasteCleanup, sanitize, removeComments, sanitizeClassAttr, sanitizeStyleAttr, removeAttribute, placeholder, EditorView, EditorState, baseKeymap, keymap, history, parseContent, Plugin, PluginKey, TextSelection, Schema, AllSelection, gapCursor, getSelectionText, imageResizing } from '@progress/kendo-editor-common';
14
14
  import { validatePackage } from '@progress/kendo-licensing';
15
15
  import { packageMetadata } from './package-metadata';
16
16
  import { schema } from './config/schema';
@@ -24,15 +24,17 @@ import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
24
24
  import { EditorLocalizationService } from './localization/editor-localization.service';
25
25
  import { defaultStyle, tablesStyles, rtlStyles } from './common/styles';
26
26
  import { EditorErrorMessages } from './common/error-messages';
27
+ import { EditorToolsService } from './tools/tools.service';
28
+ import { EditorPasteEvent } from './preventable-events/paste-event';
27
29
  var EMPTY_PARAGRAPH = '<p></p>';
28
30
  var defaultPasteCleanupSettings = {
29
31
  convertMsLists: false,
30
32
  removeAttributes: [],
31
33
  removeHtmlComments: false,
32
- removeInvalidHTML: false,
34
+ removeInvalidHTML: true,
33
35
  removeMsClasses: false,
34
36
  removeMsStyles: false,
35
- stripTags: ['']
37
+ stripTags: []
36
38
  };
37
39
  var removeCommentsIf = conditionallyExecute(removeComments);
38
40
  var removeInvalidHTMLIf = conditionallyExecute(sanitize);
@@ -54,13 +56,14 @@ var ɵ0 = getPasteCleanupAttributes;
54
56
  * Represents the [Kendo UI Editor component for Angular]({% slug overview_editor %}).
55
57
  */
56
58
  var EditorComponent = /** @class */ (function () {
57
- function EditorComponent(dialogService, localization, cdr, ngZone, element) {
59
+ function EditorComponent(dialogService, localization, cdr, ngZone, element, toolsService) {
58
60
  var _this = this;
59
61
  this.dialogService = dialogService;
60
62
  this.localization = localization;
61
63
  this.cdr = cdr;
62
64
  this.ngZone = ngZone;
63
65
  this.element = element;
66
+ this.toolsService = toolsService;
64
67
  /**
65
68
  * If set to `false`, the Editor will run in style non-encapsulated mode. This means
66
69
  * that the styles of the page will be persisted in the Editor and its content will be affected by them.
@@ -72,14 +75,6 @@ var EditorComponent = /** @class */ (function () {
72
75
  * @default false
73
76
  */
74
77
  this.applyToWord = false;
75
- /**
76
- * By design, the Editor emits `valueChange`, updates the model and the ToolBar state on each keystroke.
77
- * When you are interested in ignoring the new values for a given amout of time and take only the most recent one, you can use the `updateInterval` property.
78
- * A possible use case is to get the new values and to update the ToolBar state at a maximum rate per second in order to speed up your application.
79
- * The specified interval (in milliseconds) should be a positive number.
80
- * By default the `updateInterval` is set to 100 miliseconds. If set to zero the delay will be disabled entirely.
81
- */
82
- this.updateInterval = 100;
83
78
  /**
84
79
  * By default, whitespace is collapsed as per HTML's rules.
85
80
  * Set to `true` to preserve whitespace, but normalize newlines to spaces.
@@ -105,6 +100,11 @@ var EditorComponent = /** @class */ (function () {
105
100
  * Fires when the content area of the Editor is focused ([see example]({% slug overview_editor %}#toc-events)).
106
101
  */
107
102
  this.onFocus = new EventEmitter();
103
+ /**
104
+ * Fires when the user performs paste in the content area of the Editor ([see example]({% slug overview_editor %}#toc-events)).
105
+ * The event is preventable. If you cancel it, the Editor content will not change.
106
+ */
107
+ this.paste = new EventEmitter();
108
108
  /**
109
109
  * Fires when the content area of the Editor is blurred ([see example]({% slug overview_editor %}#toc-events)).
110
110
  */
@@ -120,10 +120,73 @@ var EditorComponent = /** @class */ (function () {
120
120
  this.valueModified = new Subject();
121
121
  this._readonly = false;
122
122
  this._placeholder = '';
123
+ this.inForm = false;
123
124
  this.afterViewInit = new Subject();
124
125
  this.contentAreaLoaded = new Subject();
125
- this.onChangeCallback = function (_) { }; // tslint:disable-line:no-empty
126
+ this.dispatchTransaction = function (tr) {
127
+ var docChanged = tr.docChanged;
128
+ if (docChanged) {
129
+ var doc = tr.doc;
130
+ var html_1 = getHtml({ doc: doc });
131
+ _this.trOnChange = tr;
132
+ _this.htmlOnChange = html_1;
133
+ _this.ngZone.run(function () {
134
+ _this.valueModified.next(html_1);
135
+ });
136
+ }
137
+ if (!docChanged || _this.inForm) {
138
+ _this.view.updateState(_this.view.state.apply(tr));
139
+ }
140
+ };
141
+ this.transformPastedHTML = function (dirtyHtml) {
142
+ var pasteCleanupSettings = tslib_1.__assign({}, defaultPasteCleanupSettings, _this.pasteCleanupSettings);
143
+ var html = pipe(removeInvalidHTMLIf(pasteCleanupSettings.removeInvalidHTML), removeCommentsIf(pasteCleanupSettings.removeHtmlComments))(dirtyHtml);
144
+ var clean = pasteCleanup(html, {
145
+ convertMsLists: pasteCleanupSettings.convertMsLists,
146
+ stripTags: pasteCleanupSettings.stripTags.join('|'),
147
+ attributes: getPasteCleanupAttributes(pasteCleanupSettings)
148
+ });
149
+ if (hasObservers(_this.paste)) {
150
+ var event_1 = new EditorPasteEvent(clean, dirtyHtml, _this._pasteEvent);
151
+ _this.ngZone.run(function () { return _this.paste.emit(event_1); });
152
+ return event_1.isDefaultPrevented() ? '' : event_1.cleanedHtml;
153
+ }
154
+ return clean;
155
+ };
156
+ this.changeValue = function (value) {
157
+ var prev = _this._value;
158
+ _this._value = value;
159
+ if (!_this._view) {
160
+ return;
161
+ }
162
+ if (_this.htmlOnChange === value && _this.trOnChange) {
163
+ _this.view.updateState(_this.view.state.apply(_this.trOnChange));
164
+ }
165
+ else {
166
+ if ((prev || '') !== (value || '')) {
167
+ var iframeContentWindowNotPresent = _this.iframe && !_this.container.element.nativeElement.contentWindow;
168
+ if (iframeContentWindowNotPresent) {
169
+ return;
170
+ }
171
+ var state = _this.view.state;
172
+ var nextDoc = parseContent(value || '', state.schema, { preserveWhitespace: _this.preserveWhitespace });
173
+ var tr = state.tr
174
+ .setSelection(new AllSelection(state.doc))
175
+ .replaceSelectionWith(nextDoc);
176
+ _this.view.updateState(state.apply(tr));
177
+ }
178
+ }
179
+ _this.trOnChange = null;
180
+ _this.htmlOnChange = null;
181
+ };
182
+ this.onChangeCallback = function (value) {
183
+ _this.changeValue(value);
184
+ };
126
185
  this.onTouchedCallback = function (_) { }; // tslint:disable-line:no-empty
186
+ this.onPaste = function (_view, nativeEvent) {
187
+ _this._pasteEvent = nativeEvent;
188
+ return false;
189
+ };
127
190
  validatePackage(packageMetadata);
128
191
  this.direction = localization.rtl ? 'rtl' : 'ltr';
129
192
  // https://stackoverflow.com/questions/56572483/chrome-is-synchronously-handling-iframe-loading-whereas-firefox-handles-it-asyn
@@ -132,6 +195,9 @@ var EditorComponent = /** @class */ (function () {
132
195
  EditorComponent_1 = EditorComponent;
133
196
  Object.defineProperty(EditorComponent.prototype, "value", {
134
197
  get: function () {
198
+ if (this.trOnChange) {
199
+ return this.htmlOnChange;
200
+ }
135
201
  var value = this._view ? this.getSource() : this._value;
136
202
  if (value === EMPTY_PARAGRAPH) {
137
203
  return this._value ? '' : this._value;
@@ -144,23 +210,7 @@ var EditorComponent = /** @class */ (function () {
144
210
  * Sets the value of the Editor ([see example]({% slug overview_editor %}#toc-basic-usage)).
145
211
  */
146
212
  set: function (value) {
147
- if (this._previousValue === value) {
148
- return;
149
- }
150
- this._value = value;
151
- this._previousValue = value;
152
- if (this._view) {
153
- var iframeContentWindowNotPresent = this.iframe && !this.container.element.nativeElement.contentWindow;
154
- if (iframeContentWindowNotPresent) {
155
- return;
156
- }
157
- this.exec('setHTML', {
158
- content: this._value || '',
159
- parseOptions: {
160
- preserveWhitespace: this.preserveWhitespace
161
- }
162
- });
163
- }
213
+ this.changeValue(value);
164
214
  },
165
215
  enumerable: true,
166
216
  configurable: true
@@ -408,6 +458,7 @@ var EditorComponent = /** @class */ (function () {
408
458
  var rtl = _a.rtl;
409
459
  _this.direction = rtl ? 'rtl' : 'ltr';
410
460
  }));
461
+ this.subs.add(this.toolsService.needsCheck.subscribe(function () { return _this.cdr.markForCheck(); }));
411
462
  };
412
463
  EditorComponent.prototype.ngAfterViewInit = function () {
413
464
  this.afterViewInit.next();
@@ -420,6 +471,9 @@ var EditorComponent = /** @class */ (function () {
420
471
  };
421
472
  EditorComponent.prototype.ngOnChanges = function (changes) {
422
473
  var _this = this;
474
+ if (changes.value && this.view) {
475
+ this.changeValue(changes.value.currentValue);
476
+ }
423
477
  if (changes.iframe && !changes.iframe.isFirstChange()) {
424
478
  this.ngZone.onStable.pipe(take(1)).subscribe(function () { return _this.initialize(); });
425
479
  }
@@ -505,8 +559,6 @@ var EditorComponent = /** @class */ (function () {
505
559
  var command = editorCommands[commandName](attr);
506
560
  // Executes a ProseMirror command.
507
561
  command(this._view.state, this._view.dispatch, this._view);
508
- // See the `dispatchTransaction` comments.
509
- // this.stateChange.emit(updateToolBar(this.view));
510
562
  };
511
563
  /**
512
564
  * Opens a dialog.
@@ -591,6 +643,7 @@ var EditorComponent = /** @class */ (function () {
591
643
  * @hidden
592
644
  */
593
645
  EditorComponent.prototype.writeValue = function (value) {
646
+ this.inForm = true;
594
647
  // To avoid confusion, non-existent values are always undefined.
595
648
  this.value = value === null ? undefined : value;
596
649
  };
@@ -619,7 +672,6 @@ var EditorComponent = /** @class */ (function () {
619
672
  return;
620
673
  }
621
674
  var currentSchema = this.schema || schema;
622
- var that = this;
623
675
  var containerNativeElement = this.container.element.nativeElement;
624
676
  var contentNode = parseContent((this.value || '').trim(), currentSchema, { preserveWhitespace: this.preserveWhitespace });
625
677
  if (this.iframe) {
@@ -663,7 +715,7 @@ var EditorComponent = /** @class */ (function () {
663
715
  }),
664
716
  new Plugin({
665
717
  key: new PluginKey('editor-filter-disabled-state'),
666
- filterTransaction: function () { return !_this.disabled; }
718
+ filterTransaction: function () { return !_this.disabled || _this.inForm; }
667
719
  }),
668
720
  history(),
669
721
  keymap(buildListKeymap(currentSchema)),
@@ -690,31 +742,10 @@ var EditorComponent = /** @class */ (function () {
690
742
  _this._view = new EditorView({ mount: _this.viewMountElement }, {
691
743
  state: state,
692
744
  editable: function () { return !_this.readonly; },
693
- dispatchTransaction: function (tr) {
694
- // `this` is bound to the view instance.
695
- this.updateState(this.state.apply(tr));
696
- // that.cdr.detectChanges();
697
- // When the user utilizes keyboard shortcuts&mdash;for example, `Ctrl`+`b`&mdash;
698
- // `tr.docChanged` is `true` and the toolbar is not updated.
699
- // A possible future solution is to move the keymaps to the service.
700
- // if (!tr.docChanged) {
701
- // that.stateChange.emit(updateToolBar(that.view));
702
- // }
703
- var value = that.value;
704
- if (!hasSameMarkup(value, that._previousValue, this.state.schema)) {
705
- that._previousValue = value;
706
- that.ngZone.run(function () { return that.valueModified.next(value); });
707
- }
708
- },
709
- transformPastedHTML: function (html) {
710
- var pasteCleanupSettings = tslib_1.__assign({}, defaultPasteCleanupSettings, _this.pasteCleanupSettings);
711
- var clean = pipe(removeCommentsIf(pasteCleanupSettings.removeHtmlComments), removeInvalidHTMLIf(pasteCleanupSettings.removeInvalidHTML))(html);
712
- var attributes = getPasteCleanupAttributes(pasteCleanupSettings);
713
- return pasteCleanup(clean, {
714
- convertMsLists: pasteCleanupSettings.convertMsLists,
715
- stripTags: pasteCleanupSettings.stripTags.join('|'),
716
- attributes: attributes
717
- });
745
+ dispatchTransaction: _this.dispatchTransaction,
746
+ transformPastedHTML: _this.transformPastedHTML,
747
+ handleDOMEvents: {
748
+ paste: _this.onPaste
718
749
  }
719
750
  });
720
751
  });
@@ -755,7 +786,7 @@ var EditorComponent = /** @class */ (function () {
755
786
  _this.cdr.detectChanges();
756
787
  }
757
788
  }));
758
- this.subs.add(merge(this.valueModified.pipe(filter(function () { return _this.updateInterval > 0; }), auditTime(this.updateInterval)), this.valueModified.pipe(filter(function () { return _this.updateInterval === 0; }))).subscribe(function (value) {
789
+ this.subs.add(this.valueModified.subscribe(function (value) {
759
790
  _this.onChangeCallback(value);
760
791
  _this.valueChange.emit(value);
761
792
  _this.cdr.markForCheck();
@@ -849,10 +880,6 @@ var EditorComponent = /** @class */ (function () {
849
880
  tslib_1.__metadata("design:type", String),
850
881
  tslib_1.__metadata("design:paramtypes", [String])
851
882
  ], EditorComponent.prototype, "placeholder", null);
852
- tslib_1.__decorate([
853
- Input(),
854
- tslib_1.__metadata("design:type", Number)
855
- ], EditorComponent.prototype, "updateInterval", void 0);
856
883
  tslib_1.__decorate([
857
884
  Input(),
858
885
  tslib_1.__metadata("design:type", Object)
@@ -873,6 +900,10 @@ var EditorComponent = /** @class */ (function () {
873
900
  Output('focus'),
874
901
  tslib_1.__metadata("design:type", EventEmitter)
875
902
  ], EditorComponent.prototype, "onFocus", void 0);
903
+ tslib_1.__decorate([
904
+ Output(),
905
+ tslib_1.__metadata("design:type", EventEmitter)
906
+ ], EditorComponent.prototype, "paste", void 0);
876
907
  tslib_1.__decorate([
877
908
  Output('blur'),
878
909
  tslib_1.__metadata("design:type", EventEmitter)
@@ -960,6 +991,7 @@ var EditorComponent = /** @class */ (function () {
960
991
  selector: 'kendo-editor',
961
992
  providers: [
962
993
  EditorLocalizationService,
994
+ EditorToolsService,
963
995
  {
964
996
  provide: LocalizationService,
965
997
  useExisting: EditorLocalizationService
@@ -979,7 +1011,7 @@ var EditorComponent = /** @class */ (function () {
979
1011
  }
980
1012
  ],
981
1013
  /* tslint:disable:max-line-length */
982
- template: "\n <ng-container\n kendoEditorLocalizedMessages\n i18n-alignCenter=\"kendo.editor.alignCenter|The title of the tool that aligns text in the center.\"\n alignCenter=\"Center text\"\n i18n-alignJustify=\"kendo.editor.alignJustify|The title of the tool that justifies text both left and right.\"\n alignJustify=\"Justify\"\n i18n-alignLeft=\"kendo.editor.alignLeft|The title of the tool that aligns text on the left.\"\n alignLeft=\"Align text left\"\n i18n-alignRight=\"kendo.editor.alignRight|The title of the tool that aligns text on the right.\"\n alignRight=\"Align text right\"\n i18n-backColor=\"kendo.editor.backColor|The title of the tool that changes the text background color.\"\n backColor=\"Background color\"\n i18n-bold=\"kendo.editor.bold|The title of the tool that makes text bold.\"\n bold=\"Bold\"\n i18n-cleanFormatting=\"kendo.editor.cleanFormatting|The title of the Clean Formatting tool.\"\n cleanFormatting=\"Clean formatting\"\n i18n-createLink=\"kendo.editor.createLink|The title of the tool that creates hyperlinks.\"\n createLink=\"Insert link\"\n i18n-dialogApply=\"kendo.editor.dialogApply|The label of the **Apply** button in all editor dialogs.\"\n dialogApply=\"Apply\"\n i18n-dialogCancel=\"kendo.editor.dialogCancel|The label of the **Cancel** button in all editor dialogs.\"\n dialogCancel=\"Cancel\"\n i18n-dialogInsert=\"kendo.editor.dialogInsert|The label of the **Insert** button in all editor dialogs.\"\n dialogInsert=\"Insert\"\n i18n-dialogUpdate=\"kendo.editor.dialogUpdate|The label of the **Update** button in all editor dialogs.\"\n dialogUpdate=\"Update\"\n i18n-fileText=\"kendo.editor.fileText|The caption for the file text in the insertFile dialog.\"\n fileText=\"Text\"\n i18n-fileTitle=\"kendo.editor.fileTitle|The caption for the file Title in the insertFile dialog.\"\n fileTitle=\"Title\"\n i18n-fileWebAddress=\"kendo.editor.fileWebAddress|The caption for the file URL in the insertFile dialog.\"\n fileWebAddress=\"Web address\"\n i18n-fontFamily=\"kendo.editor.fontFamily|The title of the tool that changes the text font.\"\n fontFamily=\"Select font family\"\n i18n-fontSize=\"kendo.editor.fontSize|The title of the tool that changes the text size.\"\n fontSize=\"Select font size\"\n i18n-foreColor=\"kendo.editor.foreColor|The title of the tool that changes the text color.\"\n foreColor=\"Color\"\n i18n-format=\"kendo.editor.format|The title of the tool that lets users choose block formats.\"\n format=\"Format\"\n i18n-imageAltText=\"kendo.editor.imageAltText|The caption for the image alternate text in the insertImage dialog.\"\n imageAltText=\"Alternate text\"\n i18n-imageHeight=\"kendo.editor.imageHeight|The caption for the image height in the insertImage dialog.\"\n imageHeight=\"Height (px)\"\n i18n-imageWebAddress=\"kendo.editor.imageWebAddress|The caption for the image URL in the insertImage dialog.\"\n imageWebAddress=\"Web address\"\n i18n-imageWidth=\"kendo.editor.imageWidth|The caption for the image width in the insertImage dialog.\"\n imageWidth=\"Width (px)\"\n i18n-indent=\"kendo.editor.indent|The title of the tool that indents the content.\"\n indent=\"Indent\"\n i18n-insertFile=\"kendo.editor.insertFile|The title of the tool that inserts links to files.\"\n insertFile=\"Insert file\"\n i18n-insertImage=\"kendo.editor.insertImage|The title of the tool that inserts images.\"\n insertImage=\"Insert image\"\n i18n-insertOrderedList=\"kendo.editor.insertOrderedList|The title of the tool that inserts an ordered list.\"\n insertOrderedList=\"Insert ordered list\"\n i18n-insertUnorderedList=\"kendo.editor.insertUnorderedList|The title of the tool that inserts an unordered list.\"\n insertUnorderedList=\"Insert unordered list\"\n i18n-italic=\"kendo.editor.italic|The title of the tool that makes text italicized.\"\n italic=\"Italic\"\n i18n-linkOpenInNewWindow=\"kendo.editor.linkOpenInNewWindow|The caption for the checkbox for opening the link in a new window in the createLink dialog.\"\n linkOpenInNewWindow=\"Open link in new window\"\n i18n-linkText=\"kendo.editor.linkText|The caption for the link text in the createLink dialog.\"\n linkText=\"Text\"\n i18n-linkTitle=\"kendo.editor.linkTitle|The caption for the link title in the createLink dialog.\"\n linkTitle=\"Title\"\n i18n-linkWebAddress=\"kendo.editor.linkWebAddress|The caption for the URL in the createLink dialog.\"\n linkWebAddress=\"Web address\"\n i18n-outdent=\"kendo.editor.outdent|The title of the tool that outdents the content.\"\n outdent=\"Outdent\"\n i18n-print=\"kendo.editor.print|The title of the print tool.\"\n print=\"Print\"\n i18n-redo=\"kendo.editor.redo|The title of the tool that undos the last action.\"\n redo=\"Redo\"\n i18n-selectAll=\"kendo.editor.selectAll|The title of the tool that selects all content.\"\n selectAll=\"Select All\"\n i18n-strikethrough=\"kendo.editor.strikethrough|The title of the tool that strikes through text.\"\n strikethrough=\"Strikethrough\"\n i18n-subscript=\"kendo.editor.subscript|The title of the tool that makes text subscript.\"\n subscript=\"Subscript\"\n i18n-superscript=\"kendo.editor.superscript|The title of the tool that makes text superscript.\"\n superscript=\"Superscript\"\n i18n-underline=\"kendo.editor.underline|The title of the tool that underlines text.\"\n underline=\"Underline\"\n i18n-unlink=\"kendo.editor.unlink|The title of the tool that removes hyperlinks.\"\n unlink=\"Remove Link\"\n i18n-undo=\"kendo.editor.undo|The title of the tool that undos the last action.\"\n undo=\"Undo\"\n i18n-viewSource=\"kendo.editor.viewSource|The title of the tool that shows the editor value as HTML.\"\n viewSource=\"View source\"\n i18n-insertTable=\"kendo.editor.insertTable|The title of the tool that inserts table.\"\n insertTable=\"Insert Table\"\n i18n-addColumnBefore=\"kendo.editor.addColumnBefore|The title of the tool that adds new column before currently selected column.\"\n addColumnBefore=\"Add column before\"\n i18n-addColumnAfter=\"kendo.editor.addColumnAfter|The title of the tool that adds new column after currently selected column.\"\n addColumnAfter=\"Add column after\"\n i18n-addRowBefore=\"kendo.editor.addRowBefore|The title of the tool that adds new row before currently selected row.\"\n addRowBefore=\"Add row before\"\n i18n-addRowAfter=\"kendo.editor.addRowAfter|The title of the tool that adds new row after currently selected row.\"\n addRowAfter=\"Add row after\"\n i18n-deleteColumn=\"kendo.editor.deleteColumn|The title of the tool that deletes a table column.\"\n deleteColumn=\"Delete column\"\n i18n-deleteRow=\"kendo.editor.deleteRow|The title of the tool that deletes a table row.\"\n deleteRow=\"Delete row\"\n i18n-deleteTable=\"kendo.editor.deleteTable|The title of the tool that deletes a table.\"\n deleteTable=\"Delete table\"\n >\n </ng-container>\n\n <ng-content select=\"kendo-toolbar\"></ng-content>\n <kendo-toolbar [overflow]=\"true\" [tabindex]=\"readonly ? -1 : 0\" *ngIf=\"!userToolBarElement\" #defaultToolbar>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorBoldButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorItalicButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnderlineButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-dropdownlist kendoEditorFormat></kendo-toolbar-dropdownlist>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorAlignLeftButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignCenterButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignRightButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignJustifyButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertUnorderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorInsertOrderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorIndentButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorOutdentButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorCreateLinkButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnlinkButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertImageButton></kendo-toolbar-button>\n </kendo-toolbar>\n\n <div *ngIf=\"!iframe\" #content [attr.dir]=\"direction\" class=\"k-editor-content\"></div>\n\n <div class=\"k-editor-content\" *ngIf=\"iframe\">\n <iframe #content frameborder=\"0\" class=\"k-iframe\" (load)=\"iframeOnLoad()\"></iframe>\n </div>\n\n <ng-container #dialogsContainer></ng-container>\n ",
1014
+ template: "\n <ng-container\n kendoEditorLocalizedMessages\n i18n-alignCenter=\"kendo.editor.alignCenter|The title of the tool that aligns text in the center.\"\n alignCenter=\"Center text\"\n i18n-alignJustify=\"kendo.editor.alignJustify|The title of the tool that justifies text both left and right.\"\n alignJustify=\"Justify\"\n i18n-alignLeft=\"kendo.editor.alignLeft|The title of the tool that aligns text on the left.\"\n alignLeft=\"Align text left\"\n i18n-alignRight=\"kendo.editor.alignRight|The title of the tool that aligns text on the right.\"\n alignRight=\"Align text right\"\n i18n-backColor=\"kendo.editor.backColor|The title of the tool that changes the text background color.\"\n backColor=\"Background color\"\n i18n-bold=\"kendo.editor.bold|The title of the tool that makes text bold.\"\n bold=\"Bold\"\n i18n-cleanFormatting=\"kendo.editor.cleanFormatting|The title of the Clean Formatting tool.\"\n cleanFormatting=\"Clean formatting\"\n i18n-createLink=\"kendo.editor.createLink|The title of the tool that creates hyperlinks.\"\n createLink=\"Insert link\"\n i18n-dialogApply=\"kendo.editor.dialogApply|The label of the **Apply** button in all editor dialogs.\"\n dialogApply=\"Apply\"\n i18n-dialogCancel=\"kendo.editor.dialogCancel|The label of the **Cancel** button in all editor dialogs.\"\n dialogCancel=\"Cancel\"\n i18n-dialogInsert=\"kendo.editor.dialogInsert|The label of the **Insert** button in all editor dialogs.\"\n dialogInsert=\"Insert\"\n i18n-dialogUpdate=\"kendo.editor.dialogUpdate|The label of the **Update** button in all editor dialogs.\"\n dialogUpdate=\"Update\"\n i18n-fileText=\"kendo.editor.fileText|The caption for the file text in the insertFile dialog.\"\n fileText=\"Text\"\n i18n-fileTitle=\"kendo.editor.fileTitle|The caption for the file Title in the insertFile dialog.\"\n fileTitle=\"Title\"\n i18n-fileWebAddress=\"kendo.editor.fileWebAddress|The caption for the file URL in the insertFile dialog.\"\n fileWebAddress=\"Web address\"\n i18n-fontFamily=\"kendo.editor.fontFamily|The title of the tool that changes the text font.\"\n fontFamily=\"Select font family\"\n i18n-fontSize=\"kendo.editor.fontSize|The title of the tool that changes the text size.\"\n fontSize=\"Select font size\"\n i18n-foreColor=\"kendo.editor.foreColor|The title of the tool that changes the text color.\"\n foreColor=\"Color\"\n i18n-format=\"kendo.editor.format|The title of the tool that lets users choose block formats.\"\n format=\"Format\"\n i18n-imageAltText=\"kendo.editor.imageAltText|The caption for the image alternate text in the insertImage dialog.\"\n imageAltText=\"Alternate text\"\n i18n-imageHeight=\"kendo.editor.imageHeight|The caption for the image height in the insertImage dialog.\"\n imageHeight=\"Height (px)\"\n i18n-imageWebAddress=\"kendo.editor.imageWebAddress|The caption for the image URL in the insertImage dialog.\"\n imageWebAddress=\"Web address\"\n i18n-imageWidth=\"kendo.editor.imageWidth|The caption for the image width in the insertImage dialog.\"\n imageWidth=\"Width (px)\"\n i18n-indent=\"kendo.editor.indent|The title of the tool that indents the content.\"\n indent=\"Indent\"\n i18n-insertFile=\"kendo.editor.insertFile|The title of the tool that inserts links to files.\"\n insertFile=\"Insert file\"\n i18n-insertImage=\"kendo.editor.insertImage|The title of the tool that inserts images.\"\n insertImage=\"Insert image\"\n i18n-insertOrderedList=\"kendo.editor.insertOrderedList|The title of the tool that inserts an ordered list.\"\n insertOrderedList=\"Insert ordered list\"\n i18n-insertUnorderedList=\"kendo.editor.insertUnorderedList|The title of the tool that inserts an unordered list.\"\n insertUnorderedList=\"Insert unordered list\"\n i18n-italic=\"kendo.editor.italic|The title of the tool that makes text italicized.\"\n italic=\"Italic\"\n i18n-linkOpenInNewWindow=\"kendo.editor.linkOpenInNewWindow|The caption for the checkbox for opening the link in a new window in the createLink dialog.\"\n linkOpenInNewWindow=\"Open link in new window\"\n i18n-linkText=\"kendo.editor.linkText|The caption for the link text in the createLink dialog.\"\n linkText=\"Text\"\n i18n-linkTitle=\"kendo.editor.linkTitle|The caption for the link title in the createLink dialog.\"\n linkTitle=\"Title\"\n i18n-linkWebAddress=\"kendo.editor.linkWebAddress|The caption for the URL in the createLink dialog.\"\n linkWebAddress=\"Web address\"\n i18n-outdent=\"kendo.editor.outdent|The title of the tool that outdents the content.\"\n outdent=\"Outdent\"\n i18n-print=\"kendo.editor.print|The title of the print tool.\"\n print=\"Print\"\n i18n-redo=\"kendo.editor.redo|The title of the tool that undos the last action.\"\n redo=\"Redo\"\n i18n-selectAll=\"kendo.editor.selectAll|The title of the tool that selects all content.\"\n selectAll=\"Select All\"\n i18n-strikethrough=\"kendo.editor.strikethrough|The title of the tool that strikes through text.\"\n strikethrough=\"Strikethrough\"\n i18n-subscript=\"kendo.editor.subscript|The title of the tool that makes text subscript.\"\n subscript=\"Subscript\"\n i18n-superscript=\"kendo.editor.superscript|The title of the tool that makes text superscript.\"\n superscript=\"Superscript\"\n i18n-underline=\"kendo.editor.underline|The title of the tool that underlines text.\"\n underline=\"Underline\"\n i18n-unlink=\"kendo.editor.unlink|The title of the tool that removes hyperlinks.\"\n unlink=\"Remove Link\"\n i18n-undo=\"kendo.editor.undo|The title of the tool that undos the last action.\"\n undo=\"Undo\"\n i18n-viewSource=\"kendo.editor.viewSource|The title of the tool that shows the editor value as HTML.\"\n viewSource=\"View source\"\n i18n-insertTable=\"kendo.editor.insertTable|The title of the tool that inserts table.\"\n insertTable=\"Insert Table\"\n i18n-addColumnBefore=\"kendo.editor.addColumnBefore|The title of the tool that adds new column before currently selected column.\"\n addColumnBefore=\"Add column before\"\n i18n-addColumnAfter=\"kendo.editor.addColumnAfter|The title of the tool that adds new column after currently selected column.\"\n addColumnAfter=\"Add column after\"\n i18n-addRowBefore=\"kendo.editor.addRowBefore|The title of the tool that adds new row before currently selected row.\"\n addRowBefore=\"Add row before\"\n i18n-addRowAfter=\"kendo.editor.addRowAfter|The title of the tool that adds new row after currently selected row.\"\n addRowAfter=\"Add row after\"\n i18n-deleteColumn=\"kendo.editor.deleteColumn|The title of the tool that deletes a table column.\"\n deleteColumn=\"Delete column\"\n i18n-deleteRow=\"kendo.editor.deleteRow|The title of the tool that deletes a table row.\"\n deleteRow=\"Delete row\"\n i18n-deleteTable=\"kendo.editor.deleteTable|The title of the tool that deletes a table.\"\n deleteTable=\"Delete table\"\n >\n </ng-container>\n\n <ng-content select=\"kendo-toolbar\"></ng-content>\n <kendo-toolbar [overflow]=\"true\" [tabindex]=\"readonly ? -1 : 0\" *ngIf=\"!userToolBarElement\" #defaultToolbar>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorBoldButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorItalicButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnderlineButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-dropdownlist kendoEditorFormat></kendo-toolbar-dropdownlist>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorAlignLeftButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignCenterButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignRightButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorAlignJustifyButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertUnorderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorInsertOrderedListButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorIndentButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorOutdentButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorCreateLinkButton></kendo-toolbar-button>\n <kendo-toolbar-button kendoEditorUnlinkButton></kendo-toolbar-button>\n </kendo-toolbar-buttongroup>\n <kendo-toolbar-button kendoEditorInsertImageButton></kendo-toolbar-button>\n </kendo-toolbar>\n\n <div *ngIf=\"!iframe\" #content [attr.dir]=\"direction\" class=\"k-editor-content\"></div>\n\n <div class=\"k-editor-content\" *ngIf=\"iframe\">\n <iframe #content srcdoc=\"<!DOCTYPE html>\" frameborder=\"0\" class=\"k-iframe\" (load)=\"iframeOnLoad()\"></iframe>\n </div>\n\n <ng-container #dialogsContainer></ng-container>\n ",
983
1015
  styles: [
984
1016
  "\n >>> .k-editor-content > .ProseMirror {\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n outline: none;\n overflow: auto;\n }\n\n .k-iframe {\n width: 100%;\n height: 100%;\n display: block;\n }\n "
985
1017
  ]
@@ -988,7 +1020,8 @@ var EditorComponent = /** @class */ (function () {
988
1020
  LocalizationService,
989
1021
  ChangeDetectorRef,
990
1022
  NgZone,
991
- ElementRef])
1023
+ ElementRef,
1024
+ EditorToolsService])
992
1025
  ], EditorComponent);
993
1026
  return EditorComponent;
994
1027
  }());
package/dist/es/index.js CHANGED
@@ -60,6 +60,7 @@ export { EditorInsertTableButtonComponent } from './tools/tables/editor-insert-t
60
60
  export { EditorMergeCellsButtonDirective } from './tools/tables/editor-merge-cells-button.directive';
61
61
  export { EditorSplitCellButtonDirective } from './tools/tables/editor-split-cell-button.directive';
62
62
  export { PopupTableGridComponent } from './tools/tables/popup-table-grid.component';
63
+ export { EditorToolsService } from './tools/tools.service';
63
64
  export { EditorBoldButtonDirective } from './tools/typographical-emphasis/editor-bold-button.directive';
64
65
  export { EditorItalicButtonDirective } from './tools/typographical-emphasis/editor-italic-button.directive';
65
66
  export { EditorStrikethroughButtonDirective } from './tools/typographical-emphasis/editor-strikethrough-button.directive';
package/dist/es/main.js CHANGED
@@ -6,3 +6,4 @@ export { EditorComponent } from './editor.component';
6
6
  export { EditorModule } from './editor.module';
7
7
  export { schema, Schema } from './config/schema';
8
8
  export { EditorState, Plugin, PluginKey, Transaction, EditorView, Decoration, DecorationSet, NodeType, Node, MarkType, Mark, InputRule, inputRules, wrappingInputRule, textblockTypeInputRule, keymap, baseKeymap, history, dropCursor, gapCursor, tableNodes, getSelectionText } from '@progress/kendo-editor-common';
9
+ export { EditorPasteEvent } from './preventable-events/paste-event';
@@ -9,7 +9,7 @@ export var packageMetadata = {
9
9
  name: '@progress/kendo-angular-editor',
10
10
  productName: 'Kendo UI for Angular',
11
11
  productCodes: ['KENDOUIANGULAR', 'KENDOUICOMPLETE'],
12
- publishDate: 1637743184,
12
+ publishDate: 1640097479,
13
13
  version: '',
14
14
  licensingDocsUrl: 'https://www.telerik.com/kendo-angular-ui/my-license/?utm_medium=product&utm_source=kendoangular&utm_campaign=kendo-ui-angular-purchase-license-keys-warning'
15
15
  };
@@ -0,0 +1,4 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
@@ -0,0 +1,25 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2021 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the project root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import * as tslib_1 from "tslib";
6
+ import { PreventableEvent } from "@progress/kendo-angular-common";
7
+ /**
8
+ * The Editor [`paste`]({% slug api_editor_editorcomponent %}#toc-paste) event.
9
+ */
10
+ var EditorPasteEvent = /** @class */ (function (_super) {
11
+ tslib_1.__extends(EditorPasteEvent, _super);
12
+ /**
13
+ * Constructs the event arguments for the `paste` event.
14
+ * @hidden
15
+ */
16
+ function EditorPasteEvent(cleanedHtml, originalHtml, originalEvent) {
17
+ var _this = _super.call(this) || this;
18
+ _this.cleanedHtml = cleanedHtml;
19
+ _this.originalHtml = originalHtml;
20
+ _this.originalEvent = originalEvent;
21
+ return _this;
22
+ }
23
+ return EditorPasteEvent;
24
+ }(PreventableEvent));
25
+ export { EditorPasteEvent };
@@ -8,6 +8,7 @@ import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
8
8
  import { EditorComponent } from '../../editor.component';
9
9
  import { EditorCommandButton } from '../shared/editor-command-button';
10
10
  import { EditorLocalizationService } from '../../localization/editor-localization.service';
11
+ import { EditorToolsService } from '../tools.service';
11
12
  /**
12
13
  * A directive which configures an existing `ToolBarButtonComponent` as an Editor AlignCenter tool
13
14
  * ([see example]({% slug toolbartools_editor %}#toc-built-in-tools)).
@@ -28,8 +29,8 @@ import { EditorLocalizationService } from '../../localization/editor-localizatio
28
29
  */
29
30
  var EditorAlignCenterButtonDirective = /** @class */ (function (_super) {
30
31
  tslib_1.__extends(EditorAlignCenterButtonDirective, _super);
31
- function EditorAlignCenterButtonDirective(button, editor, localization) {
32
- return _super.call(this, 'alignCenter', button, editor, localization) || this;
32
+ function EditorAlignCenterButtonDirective(button, editor, localization, toolsService) {
33
+ return _super.call(this, 'alignCenter', button, editor, localization, toolsService) || this;
33
34
  }
34
35
  EditorAlignCenterButtonDirective = tslib_1.__decorate([
35
36
  Directive({
@@ -38,7 +39,8 @@ var EditorAlignCenterButtonDirective = /** @class */ (function (_super) {
38
39
  tslib_1.__param(1, Host()),
39
40
  tslib_1.__metadata("design:paramtypes", [ToolBarButtonComponent,
40
41
  EditorComponent,
41
- EditorLocalizationService])
42
+ EditorLocalizationService,
43
+ EditorToolsService])
42
44
  ], EditorAlignCenterButtonDirective);
43
45
  return EditorAlignCenterButtonDirective;
44
46
  }(EditorCommandButton));
@@ -8,6 +8,7 @@ import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
8
8
  import { EditorComponent } from '../../editor.component';
9
9
  import { EditorCommandButton } from '../shared/editor-command-button';
10
10
  import { EditorLocalizationService } from '../../localization/editor-localization.service';
11
+ import { EditorToolsService } from '../tools.service';
11
12
  /**
12
13
  * A directive which configures an existing `ToolBarButtonComponent` as an Editor AlignJustify tool
13
14
  * ([see example]({% slug toolbartools_editor %}#toc-built-in-tools)).
@@ -28,8 +29,8 @@ import { EditorLocalizationService } from '../../localization/editor-localizatio
28
29
  */
29
30
  var EditorAlignJustifyButtonDirective = /** @class */ (function (_super) {
30
31
  tslib_1.__extends(EditorAlignJustifyButtonDirective, _super);
31
- function EditorAlignJustifyButtonDirective(button, editor, localization) {
32
- return _super.call(this, 'alignJustify', button, editor, localization) || this;
32
+ function EditorAlignJustifyButtonDirective(button, editor, localization, toolsService) {
33
+ return _super.call(this, 'alignJustify', button, editor, localization, toolsService) || this;
33
34
  }
34
35
  EditorAlignJustifyButtonDirective = tslib_1.__decorate([
35
36
  Directive({
@@ -38,7 +39,8 @@ var EditorAlignJustifyButtonDirective = /** @class */ (function (_super) {
38
39
  tslib_1.__param(1, Host()),
39
40
  tslib_1.__metadata("design:paramtypes", [ToolBarButtonComponent,
40
41
  EditorComponent,
41
- EditorLocalizationService])
42
+ EditorLocalizationService,
43
+ EditorToolsService])
42
44
  ], EditorAlignJustifyButtonDirective);
43
45
  return EditorAlignJustifyButtonDirective;
44
46
  }(EditorCommandButton));
@@ -8,6 +8,7 @@ import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
8
8
  import { EditorComponent } from '../../editor.component';
9
9
  import { EditorCommandButton } from '../shared/editor-command-button';
10
10
  import { EditorLocalizationService } from '../../localization/editor-localization.service';
11
+ import { EditorToolsService } from '../tools.service';
11
12
  /**
12
13
  * A directive which configures an existing `ToolBarButtonComponent` as an Editor AlignLeft tool
13
14
  * ([see example]({% slug toolbartools_editor %}#toc-built-in-tools)).
@@ -28,8 +29,8 @@ import { EditorLocalizationService } from '../../localization/editor-localizatio
28
29
  */
29
30
  var EditorAlignLeftButtonDirective = /** @class */ (function (_super) {
30
31
  tslib_1.__extends(EditorAlignLeftButtonDirective, _super);
31
- function EditorAlignLeftButtonDirective(button, editor, localization) {
32
- return _super.call(this, 'alignLeft', button, editor, localization) || this;
32
+ function EditorAlignLeftButtonDirective(button, editor, localization, toolsService) {
33
+ return _super.call(this, 'alignLeft', button, editor, localization, toolsService) || this;
33
34
  }
34
35
  EditorAlignLeftButtonDirective = tslib_1.__decorate([
35
36
  Directive({
@@ -38,7 +39,8 @@ var EditorAlignLeftButtonDirective = /** @class */ (function (_super) {
38
39
  tslib_1.__param(1, Host()),
39
40
  tslib_1.__metadata("design:paramtypes", [ToolBarButtonComponent,
40
41
  EditorComponent,
41
- EditorLocalizationService])
42
+ EditorLocalizationService,
43
+ EditorToolsService])
42
44
  ], EditorAlignLeftButtonDirective);
43
45
  return EditorAlignLeftButtonDirective;
44
46
  }(EditorCommandButton));
@@ -8,6 +8,7 @@ import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
8
8
  import { EditorComponent } from '../../editor.component';
9
9
  import { EditorCommandButton } from '../shared/editor-command-button';
10
10
  import { EditorLocalizationService } from '../../localization/editor-localization.service';
11
+ import { EditorToolsService } from '../tools.service';
11
12
  /**
12
13
  * A directive which configures an existing `ToolBarButtonComponent` as an Editor AlignRight tool
13
14
  * ([see example]({% slug toolbartools_editor %}#toc-built-in-tools)).
@@ -28,8 +29,8 @@ import { EditorLocalizationService } from '../../localization/editor-localizatio
28
29
  */
29
30
  var EditorAlignRightButtonDirective = /** @class */ (function (_super) {
30
31
  tslib_1.__extends(EditorAlignRightButtonDirective, _super);
31
- function EditorAlignRightButtonDirective(button, editor, localization) {
32
- return _super.call(this, 'alignRight', button, editor, localization) || this;
32
+ function EditorAlignRightButtonDirective(button, editor, localization, toolsService) {
33
+ return _super.call(this, 'alignRight', button, editor, localization, toolsService) || this;
33
34
  }
34
35
  EditorAlignRightButtonDirective = tslib_1.__decorate([
35
36
  Directive({
@@ -38,7 +39,8 @@ var EditorAlignRightButtonDirective = /** @class */ (function (_super) {
38
39
  tslib_1.__param(1, Host()),
39
40
  tslib_1.__metadata("design:paramtypes", [ToolBarButtonComponent,
40
41
  EditorComponent,
41
- EditorLocalizationService])
42
+ EditorLocalizationService,
43
+ EditorToolsService])
42
44
  ], EditorAlignRightButtonDirective);
43
45
  return EditorAlignRightButtonDirective;
44
46
  }(EditorCommandButton));
@@ -8,6 +8,7 @@ import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
8
8
  import { EditorComponent } from '../editor.component';
9
9
  import { EditorCommandButton } from './shared/editor-command-button';
10
10
  import { EditorLocalizationService } from '../localization/editor-localization.service';
11
+ import { EditorToolsService } from './tools.service';
11
12
  /**
12
13
  * A directive which configures an existing `ToolBarButtonComponent` as an Editor Clean Formatting tool
13
14
  * ([see example]({% slug toolbartools_editor %}#toc-built-in-tools)).
@@ -27,8 +28,8 @@ import { EditorLocalizationService } from '../localization/editor-localization.s
27
28
  */
28
29
  var EditorCleanFormattingButtonDirective = /** @class */ (function (_super) {
29
30
  tslib_1.__extends(EditorCleanFormattingButtonDirective, _super);
30
- function EditorCleanFormattingButtonDirective(button, editor, localization) {
31
- return _super.call(this, 'cleanFormatting', button, editor, localization) || this;
31
+ function EditorCleanFormattingButtonDirective(button, editor, localization, toolsService) {
32
+ return _super.call(this, 'cleanFormatting', button, editor, localization, toolsService) || this;
32
33
  }
33
34
  EditorCleanFormattingButtonDirective = tslib_1.__decorate([
34
35
  Directive({
@@ -37,7 +38,8 @@ var EditorCleanFormattingButtonDirective = /** @class */ (function (_super) {
37
38
  tslib_1.__param(1, Host()),
38
39
  tslib_1.__metadata("design:paramtypes", [ToolBarButtonComponent,
39
40
  EditorComponent,
40
- EditorLocalizationService])
41
+ EditorLocalizationService,
42
+ EditorToolsService])
41
43
  ], EditorCleanFormattingButtonDirective);
42
44
  return EditorCleanFormattingButtonDirective;
43
45
  }(EditorCommandButton));