@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
@@ -39,6 +39,7 @@ var Table = /** @class */ (function () {
39
39
  this.parent.on(events.dropDownSelect, this.dropdownSelect, this);
40
40
  this.parent.on(events.keyDown, this.keyDown, this);
41
41
  this.parent.on(events.mouseUp, this.selectionTable, this);
42
+ this.parent.on(events.bindCssClass, this.setCssClass, this);
42
43
  this.parent.on(events.destroy, this.destroy, this);
43
44
  };
44
45
  Table.prototype.removeEventListener = function () {
@@ -59,8 +60,38 @@ var Table = /** @class */ (function () {
59
60
  this.parent.off(events.tableColorPickerChanged, this.setBGColor);
60
61
  this.parent.off(events.keyDown, this.keyDown);
61
62
  this.parent.off(events.mouseUp, this.selectionTable);
63
+ this.parent.off(events.bindCssClass, this.setCssClass);
62
64
  this.parent.off(events.destroy, this.destroy);
63
65
  };
66
+ Table.prototype.updateCss = function (currentObj, e) {
67
+ if (currentObj && e.cssClass) {
68
+ if (isNullOrUndefined(e.oldCssClass)) {
69
+ currentObj.setProperties({ cssClass: (currentObj.cssClass + ' ' + e.cssClass).trim() });
70
+ }
71
+ else {
72
+ currentObj.setProperties({ cssClass: (currentObj.cssClass.replace(e.oldCssClass, '').trim() + ' ' + e.cssClass).trim() });
73
+ }
74
+ }
75
+ };
76
+ Table.prototype.setCssClass = function (e) {
77
+ if (this.popupObj && e.cssClass) {
78
+ if (isNullOrUndefined(e.oldCssClass)) {
79
+ addClass([this.popupObj.element], e.cssClass);
80
+ }
81
+ else {
82
+ removeClass([this.popupObj.element], e.oldCssClass);
83
+ addClass([this.popupObj.element], e.cssClass);
84
+ }
85
+ }
86
+ this.updateCss(this.createTableButton, e);
87
+ this.updateCss(this.editdlgObj, e);
88
+ var numericTextBoxObj = [
89
+ this.columnTextBox, this.rowTextBox, this.tableWidthNum, this.tableCellPadding, this.tableCellSpacing
90
+ ];
91
+ for (var i = 0; i < numericTextBoxObj.length; i++) {
92
+ this.updateCss(numericTextBoxObj[i], e);
93
+ }
94
+ };
64
95
  Table.prototype.selectionTable = function (e) {
65
96
  var target = e.args.target;
66
97
  if (Browser.info.name === 'mozilla' && !isNOU(closest(target, 'table')) && closest(target, 'table').tagName === 'TABLE') {
@@ -193,6 +224,7 @@ var Table = /** @class */ (function () {
193
224
  };
194
225
  Table.prototype.showDialog = function () {
195
226
  this.openDialog(false);
227
+ this.setCssClass({ cssClass: this.parent.cssClass });
196
228
  };
197
229
  Table.prototype.closeDialog = function () {
198
230
  if (this.editdlgObj) {
@@ -766,7 +798,8 @@ var Table = /** @class */ (function () {
766
798
  var tableWidth = parseInt(getComputedStyle(_this.curTable).width, 10);
767
799
  var tableHeight = parseInt(getComputedStyle(_this.curTable).height, 10);
768
800
  var paddingSize = +getComputedStyle(_this.contentModule.getEditPanel()).paddingRight.match(/\d/g).join('');
769
- var rteWidth = _this.contentModule.getEditPanel().offsetWidth - paddingSize * 2;
801
+ var rteWidth = _this.contentModule.getEditPanel().offsetWidth - (_this.contentModule.getEditPanel().offsetWidth -
802
+ _this.contentModule.getEditPanel().clientWidth) - paddingSize * 2;
770
803
  if (_this.resizeBtnStat.column) {
771
804
  var cellColl = _this.curTable.rows[_this.calMaxCol(_this.curTable)].cells;
772
805
  var width = parseFloat(_this.columnEle.offsetWidth.toString());
@@ -913,12 +946,12 @@ var Table = /** @class */ (function () {
913
946
  this.parent.getToolbarElement().querySelector('.e-expended-nav').setAttribute('tabindex', '1');
914
947
  }
915
948
  this.dlgDiv.appendChild(btnEle);
916
- var button = new Button({
917
- iconCss: 'e-icons e-create-table', content: insertbtn, cssClass: 'e-flat',
949
+ this.createTableButton = new Button({
950
+ iconCss: 'e-icons e-create-table', content: insertbtn, cssClass: 'e-flat' + ' ' + this.parent.cssClass,
918
951
  enableRtl: this.parent.enableRtl, locale: this.parent.locale
919
952
  });
920
- button.isStringTemplate = true;
921
- button.appendTo(btnEle);
953
+ this.createTableButton.isStringTemplate = true;
954
+ this.createTableButton.appendTo(btnEle);
922
955
  EventHandler.add(btnEle, 'click', this.insertTableDialog, { self: this, args: args.args, selection: args.selection });
923
956
  this.parent.getToolbar().appendChild(this.dlgDiv);
924
957
  var target = args.args.originalEvent.target;
@@ -941,6 +974,9 @@ var Table = /** @class */ (function () {
941
974
  }
942
975
  });
943
976
  addClass([this.popupObj.element], 'e-popup-open');
977
+ if (!isNOU(this.parent.cssClass)) {
978
+ addClass([this.popupObj.element], this.parent.cssClass);
979
+ }
944
980
  this.popupObj.refreshPosition(target);
945
981
  };
946
982
  Table.prototype.docClick = function (e) {
@@ -1013,7 +1049,8 @@ var Table = /** @class */ (function () {
1013
1049
  _this.cancelDialog(e);
1014
1050
  },
1015
1051
  buttonModel: { cssClass: 'e-flat e-cancel', content: cancel }
1016
- }]
1052
+ }],
1053
+ cssClass: this.parent.cssClass
1017
1054
  });
1018
1055
  this.editdlgObj.element.style.maxHeight = 'none';
1019
1056
  this.editdlgObj.content.querySelector('input').focus();
@@ -1044,6 +1081,9 @@ var Table = /** @class */ (function () {
1044
1081
  buttonModel: { cssClass: 'e-flat e-cancel', content: cancel }
1045
1082
  }]
1046
1083
  });
1084
+ if (!isNOU(proxy.parent.cssClass)) {
1085
+ proxy.editdlgObj.setProperties({ cssClass: proxy.parent.cssClass });
1086
+ }
1047
1087
  proxy.editdlgObj.element.style.maxHeight = 'none';
1048
1088
  proxy.editdlgObj.content.querySelector('input').focus();
1049
1089
  };
@@ -1063,7 +1103,8 @@ var Table = /** @class */ (function () {
1063
1103
  placeholder: tableColumn,
1064
1104
  floatLabelType: 'Auto',
1065
1105
  max: 50,
1066
- enableRtl: this.parent.enableRtl, locale: this.parent.locale
1106
+ enableRtl: this.parent.enableRtl, locale: this.parent.locale,
1107
+ cssClass: this.parent.cssClass
1067
1108
  });
1068
1109
  this.columnTextBox.isStringTemplate = true;
1069
1110
  this.columnTextBox.appendTo(tableWrap.querySelector('#tableColumn'));
@@ -1074,7 +1115,8 @@ var Table = /** @class */ (function () {
1074
1115
  placeholder: tableRow,
1075
1116
  floatLabelType: 'Auto',
1076
1117
  max: 50,
1077
- enableRtl: this.parent.enableRtl, locale: this.parent.locale
1118
+ enableRtl: this.parent.enableRtl, locale: this.parent.locale,
1119
+ cssClass: this.parent.cssClass
1078
1120
  });
1079
1121
  this.rowTextBox.isStringTemplate = true;
1080
1122
  this.rowTextBox.appendTo(tableWrap.querySelector('#tableRow'));
@@ -1103,7 +1145,7 @@ var Table = /** @class */ (function () {
1103
1145
  var header = this.l10n.getConstant('tabledialogHeader');
1104
1146
  var dialogModel = {
1105
1147
  header: header,
1106
- cssClass: classes.CLS_RTE_ELEMENTS,
1148
+ cssClass: classes.CLS_RTE_ELEMENTS + ' ' + this.parent.cssClass,
1107
1149
  enableRtl: this.parent.enableRtl,
1108
1150
  locale: this.parent.locale,
1109
1151
  showCloseIcon: true, closeOnEscape: true, width: (Browser.isDevice) ? '290px' : '340px', height: 'initial',
@@ -1193,7 +1235,7 @@ var Table = /** @class */ (function () {
1193
1235
  + ' </div><div class="e-rte-field"><input type="text" data-role ="none" id="cellSpacing" class="e-cell-spacing" /></div>';
1194
1236
  var contentElem = parseHtml(content);
1195
1237
  tableWrap.appendChild(contentElem);
1196
- var widthNum = new NumericTextBox({
1238
+ this.tableWidthNum = new NumericTextBox({
1197
1239
  format: 'n0',
1198
1240
  min: 0,
1199
1241
  value: widthVal,
@@ -1201,9 +1243,9 @@ var Table = /** @class */ (function () {
1201
1243
  floatLabelType: 'Auto',
1202
1244
  enableRtl: this.parent.enableRtl, locale: this.parent.locale
1203
1245
  });
1204
- widthNum.isStringTemplate = true;
1205
- widthNum.appendTo(tableWrap.querySelector('#tableWidth'));
1206
- var padding = new NumericTextBox({
1246
+ this.tableWidthNum.isStringTemplate = true;
1247
+ this.tableWidthNum.appendTo(tableWrap.querySelector('#tableWidth'));
1248
+ this.tableCellPadding = new NumericTextBox({
1207
1249
  format: 'n0',
1208
1250
  min: 0,
1209
1251
  // eslint-disable-next-line
@@ -1212,9 +1254,9 @@ var Table = /** @class */ (function () {
1212
1254
  floatLabelType: 'Auto',
1213
1255
  enableRtl: this.parent.enableRtl, locale: this.parent.locale
1214
1256
  });
1215
- padding.isStringTemplate = true;
1216
- padding.appendTo(tableWrap.querySelector('#cellPadding'));
1217
- var spacing = new NumericTextBox({
1257
+ this.tableCellPadding.isStringTemplate = true;
1258
+ this.tableCellPadding.appendTo(tableWrap.querySelector('#cellPadding'));
1259
+ this.tableCellSpacing = new NumericTextBox({
1218
1260
  format: 'n0',
1219
1261
  min: 0,
1220
1262
  // eslint-disable-next-line
@@ -1223,8 +1265,8 @@ var Table = /** @class */ (function () {
1223
1265
  floatLabelType: 'Auto',
1224
1266
  enableRtl: this.parent.enableRtl, locale: this.parent.locale
1225
1267
  });
1226
- spacing.isStringTemplate = true;
1227
- spacing.appendTo(tableWrap.querySelector('#cellSpacing'));
1268
+ this.tableCellSpacing.isStringTemplate = true;
1269
+ this.tableCellSpacing.appendTo(tableWrap.querySelector('#cellSpacing'));
1228
1270
  return tableWrap;
1229
1271
  };
1230
1272
  /**
@@ -115,7 +115,8 @@ var ToolbarRenderer = /** @class */ (function () {
115
115
  created: this.toolbarCreated.bind(this),
116
116
  clicked: this.toolbarClicked.bind(this),
117
117
  enablePersistence: args.enablePersistence,
118
- enableRtl: args.enableRtl
118
+ enableRtl: args.enableRtl,
119
+ cssClass: args.cssClass
119
120
  });
120
121
  args.rteToolbarObj.toolbarObj.isStringTemplate = true;
121
122
  args.rteToolbarObj.toolbarObj.createElement = this.parent.createElement;