@syncfusion/ej2-richtexteditor 20.1.51 → 20.1.56

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 (72) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/dist/ej2-richtexteditor.umd.min.js +2 -2
  3. package/dist/ej2-richtexteditor.umd.min.js.map +1 -1
  4. package/dist/es6/ej2-richtexteditor.es2015.js +356 -94
  5. package/dist/es6/ej2-richtexteditor.es2015.js.map +1 -1
  6. package/dist/es6/ej2-richtexteditor.es5.js +356 -94
  7. package/dist/es6/ej2-richtexteditor.es5.js.map +1 -1
  8. package/dist/global/ej2-richtexteditor.min.js +2 -2
  9. package/dist/global/ej2-richtexteditor.min.js.map +1 -1
  10. package/dist/global/index.d.ts +1 -1
  11. package/package.json +12 -12
  12. package/src/editor-manager/plugin/dom-node.js +7 -1
  13. package/src/editor-manager/plugin/inserthtml.js +2 -1
  14. package/src/editor-manager/plugin/nodecutter.js +1 -1
  15. package/src/rich-text-editor/actions/base-quick-toolbar.js +8 -3
  16. package/src/rich-text-editor/actions/base-toolbar.d.ts +1 -0
  17. package/src/rich-text-editor/actions/base-toolbar.js +14 -1
  18. package/src/rich-text-editor/actions/color-picker.d.ts +2 -0
  19. package/src/rich-text-editor/actions/color-picker.js +22 -1
  20. package/src/rich-text-editor/actions/dropdown-buttons.d.ts +2 -0
  21. package/src/rich-text-editor/actions/dropdown-buttons.js +25 -0
  22. package/src/rich-text-editor/actions/enter-key.js +3 -2
  23. package/src/rich-text-editor/actions/file-manager.d.ts +1 -0
  24. package/src/rich-text-editor/actions/file-manager.js +14 -1
  25. package/src/rich-text-editor/actions/paste-clean-up.d.ts +6 -0
  26. package/src/rich-text-editor/actions/paste-clean-up.js +79 -47
  27. package/src/rich-text-editor/actions/quick-toolbar.d.ts +2 -0
  28. package/src/rich-text-editor/actions/quick-toolbar.js +23 -2
  29. package/src/rich-text-editor/actions/toolbar.d.ts +1 -0
  30. package/src/rich-text-editor/actions/toolbar.js +13 -1
  31. package/src/rich-text-editor/base/constant.d.ts +5 -0
  32. package/src/rich-text-editor/base/constant.js +5 -0
  33. package/src/rich-text-editor/base/interface.d.ts +11 -0
  34. package/src/rich-text-editor/base/rich-text-editor.js +2 -0
  35. package/src/rich-text-editor/renderer/content-renderer.js +2 -1
  36. package/src/rich-text-editor/renderer/image-module.d.ts +5 -0
  37. package/src/rich-text-editor/renderer/image-module.js +57 -13
  38. package/src/rich-text-editor/renderer/link-module.d.ts +2 -0
  39. package/src/rich-text-editor/renderer/link-module.js +19 -2
  40. package/src/rich-text-editor/renderer/table-module.d.ts +6 -0
  41. package/src/rich-text-editor/renderer/table-module.js +60 -18
  42. package/src/rich-text-editor/renderer/toolbar-renderer.js +2 -1
  43. package/styles/bootstrap-dark.css +135 -519
  44. package/styles/bootstrap.css +136 -525
  45. package/styles/bootstrap4.css +145 -572
  46. package/styles/bootstrap5-dark.css +135 -539
  47. package/styles/bootstrap5.css +135 -539
  48. package/styles/fabric-dark.css +134 -518
  49. package/styles/fabric.css +135 -519
  50. package/styles/fluent-dark.css +134 -521
  51. package/styles/fluent.css +134 -521
  52. package/styles/highcontrast-light.css +135 -519
  53. package/styles/highcontrast.css +135 -517
  54. package/styles/material-dark.css +134 -518
  55. package/styles/material.css +135 -519
  56. package/styles/rich-text-editor/bootstrap-dark.css +135 -519
  57. package/styles/rich-text-editor/bootstrap.css +136 -525
  58. package/styles/rich-text-editor/bootstrap4.css +145 -572
  59. package/styles/rich-text-editor/bootstrap5-dark.css +135 -539
  60. package/styles/rich-text-editor/bootstrap5.css +135 -539
  61. package/styles/rich-text-editor/fabric-dark.css +134 -518
  62. package/styles/rich-text-editor/fabric.css +135 -519
  63. package/styles/rich-text-editor/fluent-dark.css +134 -521
  64. package/styles/rich-text-editor/fluent.css +134 -521
  65. package/styles/rich-text-editor/highcontrast-light.css +135 -519
  66. package/styles/rich-text-editor/highcontrast.css +135 -517
  67. package/styles/rich-text-editor/material-dark.css +134 -518
  68. package/styles/rich-text-editor/material.css +135 -519
  69. package/styles/rich-text-editor/tailwind-dark.css +135 -524
  70. package/styles/rich-text-editor/tailwind.css +135 -524
  71. package/styles/tailwind-dark.css +135 -524
  72. package/styles/tailwind.css +135 -524
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 20.1.51
3
+ * version : 20.1.56
4
4
  * Copyright Syncfusion Inc. 2001 - 2020. All rights reserved.
5
5
  * Use of this code is subject to the terms of our license.
6
6
  * A copy of the current license can be obtained at any time by e-mailing
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "_from": "@syncfusion/ej2-richtexteditor@*",
3
- "_id": "@syncfusion/ej2-richtexteditor@20.1.50",
3
+ "_id": "@syncfusion/ej2-richtexteditor@20.1.55",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-gkz4PlU7B1CB+wMuzLpWYTa/n3NaAlzqGYfk2gxHEx+26SxT8sIbVVqGHSjvT9wKHU4TSczQhqTCg3+aiS8RHA==",
5
+ "_integrity": "sha512-62Rvxj/EQwsiPPPAy15EYFm6lX3GcnRVlhtzmuePAa0UZWJQza9JKYpyJJDouMKozDsa/ekG+reDFrCeswoJLw==",
6
6
  "_location": "/@syncfusion/ej2-richtexteditor",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -26,8 +26,8 @@
26
26
  "/@syncfusion/ej2-react-richtexteditor",
27
27
  "/@syncfusion/ej2-vue-richtexteditor"
28
28
  ],
29
- "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.1.50.tgz",
30
- "_shasum": "17718651142faa753d87d51a230d39c2a8e02db5",
29
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.1.55.tgz",
30
+ "_shasum": "250a94b80e644648ab21dda7654ac57331425f4d",
31
31
  "_spec": "@syncfusion/ej2-richtexteditor@*",
32
32
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
33
33
  "author": {
@@ -38,13 +38,13 @@
38
38
  },
39
39
  "bundleDependencies": false,
40
40
  "dependencies": {
41
- "@syncfusion/ej2-base": "~20.1.50",
42
- "@syncfusion/ej2-buttons": "~20.1.50",
43
- "@syncfusion/ej2-filemanager": "~20.1.47",
44
- "@syncfusion/ej2-inputs": "~20.1.48",
45
- "@syncfusion/ej2-navigations": "~20.1.51",
46
- "@syncfusion/ej2-popups": "~20.1.47",
47
- "@syncfusion/ej2-splitbuttons": "~20.1.47"
41
+ "@syncfusion/ej2-base": "~20.1.56",
42
+ "@syncfusion/ej2-buttons": "~20.1.55",
43
+ "@syncfusion/ej2-filemanager": "~20.1.56",
44
+ "@syncfusion/ej2-inputs": "~20.1.55",
45
+ "@syncfusion/ej2-navigations": "~20.1.56",
46
+ "@syncfusion/ej2-popups": "~20.1.55",
47
+ "@syncfusion/ej2-splitbuttons": "~20.1.55"
48
48
  },
49
49
  "deprecated": false,
50
50
  "description": "Essential JS 2 RichTextEditor component",
@@ -70,6 +70,6 @@
70
70
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
71
71
  },
72
72
  "typings": "index.d.ts",
73
- "version": "20.1.51",
73
+ "version": "20.1.56",
74
74
  "sideEffects": false
75
75
  }
@@ -541,7 +541,13 @@ var DOMNode = /** @class */ (function () {
541
541
  markerStart.appendChild(start);
542
542
  }
543
543
  else {
544
- this.replaceWith(start, this.marker(markerClassName.startSelection, this.encode(start.textContent)));
544
+ if (start.nodeType != 3 && start.nodeName != '#text') {
545
+ var marker = this.marker(markerClassName.startSelection, '');
546
+ append([this.parseHTMLFragment(marker)], start);
547
+ }
548
+ else {
549
+ this.replaceWith(start, this.marker(markerClassName.startSelection, this.encode(start.textContent)));
550
+ }
545
551
  }
546
552
  if (end.nodeType !== Node.TEXT_NODE && end.tagName === 'BR' &&
547
553
  CONSTANT.IGNORE_BLOCK_TAGS.indexOf(end.parentNode.tagName.toLocaleLowerCase()) >= 0) {
@@ -377,7 +377,8 @@ var InsertHtml = /** @class */ (function () {
377
377
  tempSpan.parentNode.replaceChild(node, tempSpan);
378
378
  }
379
379
  else {
380
- var currentNode = nodes[nodes.length - 1];
380
+ var nodeSelection = new NodeSelection();
381
+ var currentNode = this.getNodeCollection(range, nodeSelection, node)[this.getNodeCollection(range, nodeSelection, node).length - 1];
381
382
  var splitedElm = void 0;
382
383
  if ((currentNode.nodeName === 'BR' || currentNode.nodeName === 'HR') && !isNOU(currentNode.parentElement) &&
383
384
  currentNode.parentElement.textContent.trim().length === 0) {
@@ -122,7 +122,7 @@ var NodeCutter = /** @class */ (function () {
122
122
  else if (len > -1) {
123
123
  this.spliceEmptyNode(fragment.childNodes[0], isStart);
124
124
  }
125
- else if (fragment.nodeType !== 3 && fragment.nodeType !== 11) {
125
+ else if (fragment.nodeType !== 3 && fragment.nodeType !== 11 && fragment.nodeName !== 'IMG') {
126
126
  fragment.parentNode.removeChild(fragment);
127
127
  }
128
128
  return fragment;
@@ -50,17 +50,18 @@ var BaseQuickToolbar = /** @class */ (function () {
50
50
  this.element = this.parent.createElement('div', { id: popupId, className: className + ' ' + classes.CLS_RTE_ELEMENTS });
51
51
  this.element.setAttribute('aria-owns', this.parent.getID());
52
52
  this.appendPopupContent();
53
- this.createToolbar(args.toolbarItems, args.mode);
53
+ this.createToolbar(args.toolbarItems, args.mode, args.cssClass);
54
54
  this.popupRenderer.renderPopup(this);
55
55
  this.addEventListener();
56
56
  };
57
- BaseQuickToolbar.prototype.createToolbar = function (items, mode) {
57
+ BaseQuickToolbar.prototype.createToolbar = function (items, mode, cssClass) {
58
58
  this.quickTBarObj = new BaseToolbar(this.parent, this.locator);
59
59
  this.quickTBarObj.render({
60
60
  container: 'quick',
61
61
  target: this.toolbarElement,
62
62
  items: items,
63
- mode: mode
63
+ mode: mode,
64
+ cssClass: cssClass
64
65
  });
65
66
  this.quickTBarObj.toolbarObj.refresh();
66
67
  };
@@ -252,6 +253,10 @@ var BaseQuickToolbar = /** @class */ (function () {
252
253
  _this.popupObj.element.classList.remove('e-popup-open');
253
254
  removeClass([_this.element], [classes.CLS_HIDE]);
254
255
  _this.popupObj.show({ name: 'ZoomIn', duration: (Browser.isIE ? 250 : 400) });
256
+ if (_this.popupObj && _this.parent.cssClass) {
257
+ removeClass([_this.popupObj.element], _this.parent.cssClass);
258
+ addClass([_this.popupObj.element], _this.parent.cssClass);
259
+ }
255
260
  setStyleAttribute(_this.element, {
256
261
  maxWidth: window.outerWidth + 'px'
257
262
  });
@@ -16,6 +16,7 @@ export declare class BaseToolbar {
16
16
  constructor(parent?: IRichTextEditor, serviceLocator?: ServiceLocator);
17
17
  private addEventListener;
18
18
  private removeEventListener;
19
+ private setCssClass;
19
20
  private setRtl;
20
21
  private getClass;
21
22
  private getTemplateObject;
@@ -23,12 +23,24 @@ var BaseToolbar = /** @class */ (function () {
23
23
  }
24
24
  BaseToolbar.prototype.addEventListener = function () {
25
25
  this.parent.on(events.rtlMode, this.setRtl, this);
26
+ this.parent.on(events.bindCssClass, this.setCssClass, this);
26
27
  this.parent.on(events.destroy, this.removeEventListener, this);
27
28
  };
28
29
  BaseToolbar.prototype.removeEventListener = function () {
29
30
  this.parent.off(events.rtlMode, this.setRtl);
31
+ this.parent.off(events.bindCssClass, this.setCssClass);
30
32
  this.parent.off(events.destroy, this.removeEventListener);
31
33
  };
34
+ BaseToolbar.prototype.setCssClass = function (e) {
35
+ if (!isNullOrUndefined(this.toolbarObj)) {
36
+ if (isNullOrUndefined(e.oldCssClass)) {
37
+ this.toolbarObj.setProperties({ cssClass: (this.toolbarObj.cssClass + ' ' + e.cssClass).trim() });
38
+ }
39
+ else {
40
+ this.toolbarObj.setProperties({ cssClass: (this.toolbarObj.cssClass.replace(e.oldCssClass, '').trim() + ' ' + e.cssClass).trim() });
41
+ }
42
+ }
43
+ };
32
44
  BaseToolbar.prototype.setRtl = function (args) {
33
45
  if (!isNullOrUndefined(this.toolbarObj)) {
34
46
  this.toolbarObj.setProperties({ enableRtl: args.enableRtl });
@@ -158,7 +170,8 @@ var BaseToolbar = /** @class */ (function () {
158
170
  items: this.getItems(args.items, args.container),
159
171
  overflowMode: args.mode,
160
172
  enablePersistence: this.parent.enablePersistence,
161
- enableRtl: this.parent.enableRtl
173
+ enableRtl: this.parent.enableRtl,
174
+ cssClass: args.cssClass,
162
175
  };
163
176
  };
164
177
  /**
@@ -36,6 +36,8 @@ export declare class ColorPickerInput {
36
36
  */
37
37
  destroyColorPicker(): void;
38
38
  private setRtl;
39
+ private setCssClass;
40
+ private updateCss;
39
41
  protected addEventListener(): void;
40
42
  private onPropertyChanged;
41
43
  protected removeEventListener(): void;
@@ -1,4 +1,4 @@
1
- import { select, detach, extend } from '@syncfusion/ej2-base';
1
+ import { select, detach, extend, isNullOrUndefined } from '@syncfusion/ej2-base';
2
2
  import { RenderType } from '../base/enum';
3
3
  import * as events from '../base/constant';
4
4
  import * as classes from '../base/classes';
@@ -83,6 +83,9 @@ var ColorPickerInput = /** @class */ (function () {
83
83
  }
84
84
  }
85
85
  });
86
+ if (this.parent.inlineMode.enable) {
87
+ this.setCssClass({ cssClass: this.parent.cssClass });
88
+ }
86
89
  };
87
90
  ColorPickerInput.prototype.destroy = function () {
88
91
  this.removeEventListener();
@@ -128,12 +131,29 @@ var ColorPickerInput = /** @class */ (function () {
128
131
  this.backgroundColorDropDown.setProperties({ enableRtl: args.enableRtl });
129
132
  }
130
133
  };
134
+ ColorPickerInput.prototype.setCssClass = function (e) {
135
+ this.updateCss(this.fontColorPicker, this.fontColorDropDown, e);
136
+ this.updateCss(this.backgroundColorPicker, this.backgroundColorDropDown, e);
137
+ };
138
+ ColorPickerInput.prototype.updateCss = function (colorPickerObj, dropDownObj, e) {
139
+ if (colorPickerObj && e.cssClass) {
140
+ if (isNullOrUndefined(e.oldCssClass)) {
141
+ colorPickerObj.setProperties({ cssClass: (colorPickerObj.cssClass + ' ' + e.cssClass).trim() });
142
+ dropDownObj.setProperties({ cssClass: (dropDownObj.cssClass + ' ' + e.cssClass).trim() });
143
+ }
144
+ else {
145
+ colorPickerObj.setProperties({ cssClass: (colorPickerObj.cssClass.replace(e.oldCssClass, '').trim() + ' ' + e.cssClass).trim() });
146
+ dropDownObj.setProperties({ cssClass: (dropDownObj.cssClass.replace(e.oldCssClass, '').trim() + ' ' + e.cssClass).trim() });
147
+ }
148
+ }
149
+ };
131
150
  ColorPickerInput.prototype.addEventListener = function () {
132
151
  this.parent.on(events.toolbarRenderComplete, this.renderColorPickerInput, this);
133
152
  this.parent.on(events.rtlMode, this.setRtl, this);
134
153
  this.parent.on(events.destroy, this.destroy, this);
135
154
  this.parent.on(events.destroyColorPicker, this.destroyColorPicker, this);
136
155
  this.parent.on(events.modelChanged, this.onPropertyChanged, this);
156
+ this.parent.on(events.bindCssClass, this.setCssClass, this);
137
157
  };
138
158
  ColorPickerInput.prototype.onPropertyChanged = function (model) {
139
159
  var newProp = model.newProp;
@@ -206,6 +226,7 @@ var ColorPickerInput = /** @class */ (function () {
206
226
  this.parent.off(events.rtlMode, this.setRtl);
207
227
  this.parent.off(events.destroyColorPicker, this.destroyColorPicker);
208
228
  this.parent.off(events.modelChanged, this.onPropertyChanged);
229
+ this.parent.off(events.bindCssClass, this.setCssClass);
209
230
  };
210
231
  return ColorPickerInput;
211
232
  }());
@@ -54,6 +54,8 @@ export declare class DropDownButtons {
54
54
  */
55
55
  destroyDropDowns(): void;
56
56
  private setRtl;
57
+ private updateCss;
58
+ private setCssClass;
57
59
  protected addEventListener(): void;
58
60
  private onIframeMouseDown;
59
61
  protected removeEventListener(): void;
@@ -187,6 +187,9 @@ var DropDownButtons = /** @class */ (function () {
187
187
  }
188
188
  }
189
189
  });
190
+ if (this.parent.inlineMode.enable) {
191
+ this.setCssClass({ cssClass: this.parent.cssClass });
192
+ }
190
193
  };
191
194
  DropDownButtons.prototype.getUpdateItems = function (items, value) {
192
195
  var dropDownItems = items.slice();
@@ -474,6 +477,26 @@ var DropDownButtons = /** @class */ (function () {
474
477
  this.bulletFormatListDropDown.setProperties({ enableRtl: args.enableRtl });
475
478
  }
476
479
  };
480
+ DropDownButtons.prototype.updateCss = function (dropDownObj, e) {
481
+ if (dropDownObj && e.cssClass) {
482
+ if (isNullOrUndefined(e.oldCssClass)) {
483
+ dropDownObj.setProperties({ cssClass: (dropDownObj.cssClass + ' ' + e.cssClass).trim() });
484
+ }
485
+ else {
486
+ dropDownObj.setProperties({ cssClass: (dropDownObj.cssClass.replace(e.oldCssClass, '').trim() + ' ' + e.cssClass).trim() });
487
+ }
488
+ }
489
+ };
490
+ DropDownButtons.prototype.setCssClass = function (e) {
491
+ var dropDownObj = [
492
+ this.formatDropDown, this.fontNameDropDown, this.fontSizeDropDown, this.alignDropDown, this.imageAlignDropDown,
493
+ this.displayDropDown, this.numberFormatListDropDown, this.bulletFormatListDropDown, this.tableRowsDropDown,
494
+ this.tableColumnsDropDown, this.tableCellVerticalAlignDropDown
495
+ ];
496
+ for (var i = 0; i < dropDownObj.length; i++) {
497
+ this.updateCss(dropDownObj[i], e);
498
+ }
499
+ };
477
500
  DropDownButtons.prototype.addEventListener = function () {
478
501
  if (this.parent.isDestroyed) {
479
502
  return;
@@ -483,6 +506,7 @@ var DropDownButtons = /** @class */ (function () {
483
506
  this.parent.on(events.rtlMode, this.setRtl, this);
484
507
  this.parent.on(events.destroy, this.removeEventListener, this);
485
508
  this.parent.on(events.modelChanged, this.onPropertyChanged, this);
509
+ this.parent.on(events.bindCssClass, this.setCssClass, this);
486
510
  };
487
511
  DropDownButtons.prototype.onIframeMouseDown = function () {
488
512
  dispatchEvent(document, 'mousedown');
@@ -496,6 +520,7 @@ var DropDownButtons = /** @class */ (function () {
496
520
  this.parent.off(events.beforeDropDownItemRender, this.beforeRender);
497
521
  this.parent.off(events.destroy, this.removeEventListener);
498
522
  this.parent.off(events.modelChanged, this.onPropertyChanged);
523
+ this.parent.off(events.bindCssClass, this.setCssClass);
499
524
  };
500
525
  return DropDownButtons;
501
526
  }());
@@ -292,8 +292,9 @@ var EnterKeyAction = /** @class */ (function () {
292
292
  };
293
293
  EnterKeyAction.prototype.removeBRElement = function (currentElement) {
294
294
  if (Browser.userAgent.indexOf('Firefox') != -1 &&
295
- this.range.endOffset === currentElement.textContent.length &&
296
- currentElement.lastChild.nodeName === 'BR') {
295
+ this.range.endOffset === currentElement.textContent.length && (currentElement.textContent.length !== 0 ||
296
+ currentElement.querySelectorAll('BR').length > 1) &&
297
+ !isNOU(currentElement.lastChild) && currentElement.lastChild.nodeName === 'BR') {
297
298
  detach(currentElement.lastChild);
298
299
  }
299
300
  };
@@ -18,6 +18,7 @@ export declare class FileManager {
18
18
  private constructor();
19
19
  private initialize;
20
20
  private render;
21
+ private setCssClass;
21
22
  private renderFileManager;
22
23
  private getInputUrlElement;
23
24
  private insertImageUrl;
@@ -1,4 +1,4 @@
1
- import { Browser, detach, closest, isNullOrUndefined as isNOU, EventHandler } from '@syncfusion/ej2-base';
1
+ import { Browser, detach, closest, isNullOrUndefined as isNOU, EventHandler, isNullOrUndefined } from '@syncfusion/ej2-base';
2
2
  import { ContextMenu, DetailsView, FileManager as EJ2FileManager } from '@syncfusion/ej2-filemanager';
3
3
  import { NavigationPane, Toolbar } from '@syncfusion/ej2-filemanager';
4
4
  import { RenderType } from '../base/enum';
@@ -78,6 +78,17 @@ var FileManager = /** @class */ (function () {
78
78
  this.dialogObj.createElement = this.parent.createElement;
79
79
  this.dialogObj.appendTo(dlgTarget);
80
80
  this.dialogObj.show(Browser.isDevice ? true : false);
81
+ this.setCssClass({ cssClass: this.parent.cssClass });
82
+ };
83
+ FileManager.prototype.setCssClass = function (e) {
84
+ if (this.dialogObj && e.cssClass) {
85
+ if (isNullOrUndefined(e.oldCssClass)) {
86
+ this.dialogObj.setProperties({ cssClass: (this.dialogObj.cssClass + ' ' + e.cssClass).trim() });
87
+ }
88
+ else {
89
+ this.dialogObj.setProperties({ cssClass: (this.dialogObj.cssClass.replace(e.oldCssClass, '').trim() + ' ' + e.cssClass).trim() });
90
+ }
91
+ }
81
92
  };
82
93
  FileManager.prototype.renderFileManager = function () {
83
94
  var _this = this;
@@ -202,12 +213,14 @@ var FileManager = /** @class */ (function () {
202
213
  FileManager.prototype.addEventListener = function () {
203
214
  this.parent.on(events.initialEnd, this.initialize, this);
204
215
  this.parent.on(events.renderFileManager, this.render, this);
216
+ this.parent.on(events.bindCssClass, this.setCssClass, this);
205
217
  this.parent.on(events.destroy, this.destroy, this);
206
218
  };
207
219
  FileManager.prototype.removeEventListener = function () {
208
220
  EventHandler.remove(this.parent.element.ownerDocument, 'mousedown', this.onDocumentClick);
209
221
  this.parent.off(events.initialEnd, this.initialize);
210
222
  this.parent.off(events.renderFileManager, this.render);
223
+ this.parent.off(events.bindCssClass, this.setCssClass);
211
224
  this.parent.off(events.destroy, this.destroy);
212
225
  };
213
226
  FileManager.prototype.destroyComponents = function () {
@@ -14,6 +14,10 @@ export declare class PasteCleanup {
14
14
  private dialogRenderObj;
15
15
  private popupObj;
16
16
  private uploadObj;
17
+ private dialogObj;
18
+ private keepRadioButton;
19
+ private cleanRadioButton;
20
+ private plainTextRadioButton;
17
21
  private inlineNode;
18
22
  private blockNode;
19
23
  private isNotFromHtml;
@@ -46,6 +50,8 @@ export declare class PasteCleanup {
46
50
  private radioRender;
47
51
  private selectFormatting;
48
52
  private pasteDialog;
53
+ private updateCss;
54
+ private setCssClass;
49
55
  private destroyDialog;
50
56
  private cleanAppleClass;
51
57
  private formatting;
@@ -1,7 +1,7 @@
1
1
  import * as events from '../base/constant';
2
2
  import { Popup } from '@syncfusion/ej2-popups';
3
3
  import { RadioButton } from '@syncfusion/ej2-buttons';
4
- import { isNullOrUndefined as isNOU, isNullOrUndefined, detach, extend, addClass } from '@syncfusion/ej2-base';
4
+ import { isNullOrUndefined as isNOU, isNullOrUndefined, detach, extend, addClass, removeClass } from '@syncfusion/ej2-base';
5
5
  import { getUniqueID, Browser } from '@syncfusion/ej2-base';
6
6
  import { CLS_RTE_PASTE_KEEP_FORMAT, CLS_RTE_PASTE_REMOVE_FORMAT, CLS_RTE_PASTE_PLAIN_FORMAT } from '../base/classes';
7
7
  import { CLS_RTE_PASTE_OK, CLS_RTE_PASTE_CANCEL, CLS_RTE_DIALOG_MIN_HEIGHT } from '../base/classes';
@@ -42,6 +42,7 @@ var PasteCleanup = /** @class */ (function () {
42
42
  return;
43
43
  }
44
44
  this.parent.on(events.pasteClean, this.pasteClean, this);
45
+ this.parent.on(events.bindCssClass, this.setCssClass, this);
45
46
  this.parent.on(events.destroy, this.destroy, this);
46
47
  };
47
48
  PasteCleanup.prototype.destroy = function () {
@@ -52,6 +53,7 @@ var PasteCleanup = /** @class */ (function () {
52
53
  return;
53
54
  }
54
55
  this.parent.off(events.pasteClean, this.pasteClean);
56
+ this.parent.off(events.bindCssClass, this.setCssClass);
55
57
  this.parent.off(events.destroy, this.destroy);
56
58
  };
57
59
  PasteCleanup.prototype.pasteClean = function (e) {
@@ -231,7 +233,7 @@ var PasteCleanup = /** @class */ (function () {
231
233
  id: this.parent.element.id + '_upload', attrs: { type: 'File', name: 'UploadFiles' }
232
234
  });
233
235
  var offsetY = this.parent.iframeSettings.enable ? -50 : -90;
234
- var popupObj = new Popup(popupEle, {
236
+ this.popupObj = new Popup(popupEle, {
235
237
  relateTo: imgElem,
236
238
  height: '85px',
237
239
  width: '300px',
@@ -244,19 +246,22 @@ var PasteCleanup = /** @class */ (function () {
244
246
  // eslint-disable-next-line
245
247
  close: function (event) {
246
248
  _this.parent.isBlur = false;
247
- popupObj.destroy();
248
- detach(popupObj.element);
249
+ _this.popupObj.destroy();
250
+ detach(_this.popupObj.element);
249
251
  }
250
252
  });
251
- popupObj.element.style.display = 'none';
252
- addClass([popupObj.element], [classes.CLS_POPUP_OPEN, classes.CLS_RTE_UPLOAD_POPUP]);
253
+ this.popupObj.element.style.display = 'none';
254
+ addClass([this.popupObj.element], [classes.CLS_POPUP_OPEN, classes.CLS_RTE_UPLOAD_POPUP]);
255
+ if (!isNOU(this.parent.cssClass)) {
256
+ addClass([this.popupObj.element], this.parent.cssClass);
257
+ }
253
258
  var timeOut = fileList.size > 1000000 ? 300 : 100;
254
259
  setTimeout(function () {
255
- _this.refreshPopup(imgElem, popupObj);
260
+ _this.refreshPopup(imgElem, _this.popupObj);
256
261
  }, timeOut);
257
262
  var rawFile;
258
263
  var beforeUploadArgs;
259
- var uploadObj = new Uploader({
264
+ this.uploadObj = new Uploader({
260
265
  asyncSettings: {
261
266
  saveUrl: this.parent.insertImageSettings.saveUrl,
262
267
  removeUrl: this.parent.insertImageSettings.removeUrl
@@ -266,7 +271,7 @@ var PasteCleanup = /** @class */ (function () {
266
271
  allowedExtensions: this.parent.insertImageSettings.allowedTypes.toString(),
267
272
  success: function (e) {
268
273
  setTimeout(function () {
269
- _this.popupClose(popupObj, uploadObj, imgElem, e);
274
+ _this.popupClose(_this.popupObj, _this.uploadObj, imgElem, e);
270
275
  }, 900);
271
276
  },
272
277
  uploading: function (e) {
@@ -276,8 +281,8 @@ var PasteCleanup = /** @class */ (function () {
276
281
  if (!isNullOrUndefined(imgElem)) {
277
282
  detach(imgElem);
278
283
  }
279
- if (!isNullOrUndefined(popupObj.element)) {
280
- detach(popupObj.element);
284
+ if (!isNullOrUndefined(_this.popupObj.element)) {
285
+ detach(_this.popupObj.element);
281
286
  }
282
287
  }
283
288
  else {
@@ -297,11 +302,11 @@ var PasteCleanup = /** @class */ (function () {
297
302
  }
298
303
  _this.toolbarEnableDisable(true);
299
304
  /* eslint-disable */
300
- uploadObj.currentRequestHeader = beforeUploadArgs.currentRequest ?
301
- beforeUploadArgs.currentRequest : uploadObj.currentRequestHeader;
302
- uploadObj.customFormDatas = beforeUploadArgs.customFormData && beforeUploadArgs.customFormData.length > 0 ?
303
- beforeUploadArgs.customFormData : uploadObj.customFormDatas;
304
- uploadObj.uploadFiles(rawFile, null);
305
+ _this.uploadObj.currentRequestHeader = beforeUploadArgs.currentRequest ?
306
+ beforeUploadArgs.currentRequest : _this.uploadObj.currentRequestHeader;
307
+ _this.uploadObj.customFormDatas = beforeUploadArgs.customFormData && beforeUploadArgs.customFormData.length > 0 ?
308
+ beforeUploadArgs.customFormData : _this.uploadObj.customFormDatas;
309
+ _this.uploadObj.uploadFiles(rawFile, null);
305
310
  /* eslint-enable */
306
311
  });
307
312
  }
@@ -313,7 +318,7 @@ var PasteCleanup = /** @class */ (function () {
313
318
  // eslint-disable-next-line
314
319
  failure: function (e) {
315
320
  setTimeout(function () {
316
- _this.uploadFailure(imgElem, uploadObj, popupObj, e);
321
+ _this.uploadFailure(imgElem, _this.uploadObj, _this.popupObj, e);
317
322
  }, 900);
318
323
  },
319
324
  canceling: function () {
@@ -322,7 +327,7 @@ var PasteCleanup = /** @class */ (function () {
322
327
  detach(imgElem.nextSibling);
323
328
  }
324
329
  detach(imgElem);
325
- popupObj.close();
330
+ _this.popupObj.close();
326
331
  },
327
332
  selected: function (e) {
328
333
  e.cancel = true;
@@ -336,10 +341,10 @@ var PasteCleanup = /** @class */ (function () {
336
341
  detach(imgElem.nextSibling);
337
342
  }
338
343
  detach(imgElem);
339
- popupObj.close();
344
+ _this.popupObj.close();
340
345
  }
341
346
  });
342
- uploadObj.appendTo(popupObj.element.childNodes[0]);
347
+ this.uploadObj.appendTo(this.popupObj.element.childNodes[0]);
343
348
  /* eslint-disable */
344
349
  var fileData = [{
345
350
  name: fileList.name,
@@ -349,13 +354,13 @@ var PasteCleanup = /** @class */ (function () {
349
354
  validationMessages: { minSize: "", maxSize: "" },
350
355
  statusCode: '1'
351
356
  }];
352
- uploadObj.createFileList(fileData);
353
- uploadObj.filesData.push(fileData[0]);
357
+ this.uploadObj.createFileList(fileData);
358
+ this.uploadObj.filesData.push(fileData[0]);
354
359
  /* eslint-enable */
355
360
  rawFile = fileData;
356
- uploadObj.upload(fileData);
357
- popupObj.element.getElementsByClassName('e-file-select-wrap')[0].style.display = 'none';
358
- detach(popupObj.element.querySelector('.e-rte-dialog-upload .e-file-select-wrap'));
361
+ this.uploadObj.upload(fileData);
362
+ this.popupObj.element.getElementsByClassName('e-file-select-wrap')[0].style.display = 'none';
363
+ detach(this.popupObj.element.querySelector('.e-rte-dialog-upload .e-file-select-wrap'));
359
364
  };
360
365
  PasteCleanup.prototype.uploadFailure = function (imgElem, uploadObj, popupObj, e) {
361
366
  this.parent.inputElement.contentEditable = 'true';
@@ -448,19 +453,19 @@ var PasteCleanup = /** @class */ (function () {
448
453
  }
449
454
  };
450
455
  PasteCleanup.prototype.radioRender = function () {
451
- var keepRadioButton = new RadioButton({ label: this.i10n.getConstant('keepFormat'),
456
+ this.keepRadioButton = new RadioButton({ label: this.i10n.getConstant('keepFormat'),
452
457
  name: 'pasteOption', checked: true });
453
- keepRadioButton.isStringTemplate = true;
458
+ this.keepRadioButton.isStringTemplate = true;
454
459
  var keepFormatElement = this.parent.element.querySelector('#keepFormating');
455
- keepRadioButton.appendTo(keepFormatElement);
456
- var cleanRadioButton = new RadioButton({ label: this.i10n.getConstant('cleanFormat'), name: 'pasteOption' });
457
- cleanRadioButton.isStringTemplate = true;
460
+ this.keepRadioButton.appendTo(keepFormatElement);
461
+ this.cleanRadioButton = new RadioButton({ label: this.i10n.getConstant('cleanFormat'), name: 'pasteOption' });
462
+ this.cleanRadioButton.isStringTemplate = true;
458
463
  var cleanFormatElement = this.parent.element.querySelector('#cleanFormat');
459
- cleanRadioButton.appendTo(cleanFormatElement);
460
- var plainTextRadioButton = new RadioButton({ label: this.i10n.getConstant('plainText'), name: 'pasteOption' });
461
- plainTextRadioButton.isStringTemplate = true;
464
+ this.cleanRadioButton.appendTo(cleanFormatElement);
465
+ this.plainTextRadioButton = new RadioButton({ label: this.i10n.getConstant('plainText'), name: 'pasteOption' });
466
+ this.plainTextRadioButton.isStringTemplate = true;
462
467
  var plainTextElement = this.parent.element.querySelector('#plainTextFormat');
463
- plainTextRadioButton.appendTo(plainTextElement);
468
+ this.plainTextRadioButton.appendTo(plainTextElement);
464
469
  };
465
470
  PasteCleanup.prototype.selectFormatting = function (value, args, keepChecked, cleanChecked) {
466
471
  if (keepChecked) {
@@ -481,15 +486,15 @@ var PasteCleanup = /** @class */ (function () {
481
486
  buttons: [
482
487
  {
483
488
  click: function () {
484
- if (!dialog.isDestroyed) {
489
+ if (!_this.dialogObj.isDestroyed) {
485
490
  var keepChecked = _this.parent.element.querySelector('#keepFormating').checked;
486
491
  var cleanChecked = _this.parent.element.querySelector('#cleanFormat').checked;
487
- dialog.hide();
492
+ _this.dialogObj.hide();
488
493
  _this.parent.height = isHeight ? preRTEHeight : _this.parent.height;
489
494
  isHeight = false;
490
- var argument = dialog;
495
+ var argument = _this.dialogObj;
491
496
  _this.dialogRenderObj.close(argument);
492
- dialog.destroy();
497
+ _this.dialogObj.destroy();
493
498
  _this.selectFormatting(value, args, keepChecked, cleanChecked);
494
499
  }
495
500
  },
@@ -501,13 +506,13 @@ var PasteCleanup = /** @class */ (function () {
501
506
  },
502
507
  {
503
508
  click: function () {
504
- if (!dialog.isDestroyed) {
505
- dialog.hide();
509
+ if (!_this.dialogObj.isDestroyed) {
510
+ _this.dialogObj.hide();
506
511
  _this.parent.height = isHeight ? preRTEHeight : _this.parent.height;
507
512
  isHeight = false;
508
- var args_1 = dialog;
513
+ var args_1 = _this.dialogObj;
509
514
  _this.dialogRenderObj.close(args_1);
510
- dialog.destroy();
515
+ _this.dialogObj.destroy();
511
516
  }
512
517
  },
513
518
  buttonModel: {
@@ -530,7 +535,7 @@ var PasteCleanup = /** @class */ (function () {
530
535
  isModal: true,
531
536
  visible: false
532
537
  };
533
- var dialog = this.dialogRenderObj.render(dialogModel);
538
+ this.dialogObj = this.dialogRenderObj.render(dialogModel);
534
539
  var rteDialogWrapper = this.parent.element.querySelector('#' + this.parent.getID()
535
540
  + '_pasteCleanupDialog');
536
541
  if (rteDialogWrapper !== null && rteDialogWrapper.innerHTML !== '') {
@@ -542,15 +547,42 @@ var PasteCleanup = /** @class */ (function () {
542
547
  });
543
548
  this.parent.element.appendChild(rteDialogWrapper);
544
549
  }
545
- dialog.appendTo(rteDialogWrapper);
550
+ this.dialogObj.appendTo(rteDialogWrapper);
546
551
  this.radioRender();
547
552
  /* eslint-disable */
548
- if (this.parent.element.offsetHeight < parseInt(dialog.height.split('px')[0], null)) {
549
- this.parent.height = parseInt(dialog.height.split('px')[0], null) + 40;
553
+ if (this.parent.element.offsetHeight < parseInt(this.dialogObj.height.split('px')[0], null)) {
554
+ this.parent.height = parseInt(this.dialogObj.height.split('px')[0], null) + 40;
550
555
  /* eslint-enable */
551
556
  isHeight = true;
552
557
  }
553
- dialog.show();
558
+ this.dialogObj.show();
559
+ this.setCssClass({ cssClass: this.parent.cssClass });
560
+ };
561
+ PasteCleanup.prototype.updateCss = function (currentObj, e) {
562
+ if (currentObj && e.cssClass) {
563
+ if (isNullOrUndefined(e.oldCssClass)) {
564
+ currentObj.setProperties({ cssClass: (currentObj.cssClass + ' ' + e.cssClass).trim() });
565
+ }
566
+ else {
567
+ currentObj.setProperties({ cssClass: (currentObj.cssClass.replace(e.oldCssClass, '').trim() + ' ' + e.cssClass).trim() });
568
+ }
569
+ }
570
+ };
571
+ PasteCleanup.prototype.setCssClass = function (e) {
572
+ if (this.popupObj && e.cssClass) {
573
+ if (isNullOrUndefined(e.oldCssClass)) {
574
+ addClass([this.popupObj.element], e.cssClass);
575
+ }
576
+ else {
577
+ removeClass([this.popupObj.element], e.oldCssClass);
578
+ addClass([this.popupObj.element], e.cssClass);
579
+ }
580
+ }
581
+ this.updateCss(this.dialogObj, e);
582
+ this.updateCss(this.uploadObj, e);
583
+ this.updateCss(this.plainTextRadioButton, e);
584
+ this.updateCss(this.cleanRadioButton, e);
585
+ this.updateCss(this.keepRadioButton, e);
554
586
  };
555
587
  PasteCleanup.prototype.destroyDialog = function (rteDialogWrapper) {
556
588
  var rteDialogContainer = this.parent.element.querySelector('.e-dlg-container');