@syncfusion/ej2-richtexteditor 20.2.38 → 20.2.43

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.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  * filename: index.d.ts
3
- * version : 20.2.38
3
+ * version : 20.2.43
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.2.36",
3
+ "_id": "@syncfusion/ej2-richtexteditor@20.2.40",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-C8xFE0QDv7mvp6MUMDvckFoZ9m7Sd0jr6HhC124W+91UuAiWCIQhyEEE32UHNP5cxCDoQ9nQU7xmzf9rKdt9PA==",
5
+ "_integrity": "sha512-UujypHiBETmZH0BRvYEQ3Ymz7fo37930L/lnqY5z4JGCRf1pcPGRfbNAVcY40vXJOkxbEnmH5nzge0JyMK3SfA==",
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.2.36.tgz",
30
- "_shasum": "71f185c480d459c1ab2e7d402d00a1faa27b6415",
29
+ "_resolved": "http://nexus.syncfusion.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-20.2.40.tgz",
30
+ "_shasum": "d1096ffac3f968b575499b3d57ac92d8d2f85558",
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.2.38",
42
- "@syncfusion/ej2-buttons": "~20.2.38",
43
- "@syncfusion/ej2-filemanager": "~20.2.38",
44
- "@syncfusion/ej2-inputs": "~20.2.38",
45
- "@syncfusion/ej2-navigations": "~20.2.38",
46
- "@syncfusion/ej2-popups": "~20.2.38",
47
- "@syncfusion/ej2-splitbuttons": "~20.2.38"
41
+ "@syncfusion/ej2-base": "~20.2.43",
42
+ "@syncfusion/ej2-buttons": "~20.2.43",
43
+ "@syncfusion/ej2-filemanager": "~20.2.43",
44
+ "@syncfusion/ej2-inputs": "~20.2.43",
45
+ "@syncfusion/ej2-navigations": "~20.2.43",
46
+ "@syncfusion/ej2-popups": "~20.2.43",
47
+ "@syncfusion/ej2-splitbuttons": "~20.2.43"
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.2.38",
73
+ "version": "20.2.43",
74
74
  "sideEffects": false
75
75
  }
@@ -233,7 +233,7 @@ var ToolbarStatus = /** @class */ (function () {
233
233
  if ((name !== null && name !== '' && name !== undefined)
234
234
  && (fontName === null || fontName === undefined || (fontName.filter(function (value, pos) {
235
235
  var pattern = new RegExp(name, 'i');
236
- if ((value.replace(/"/g, '').replace(/ /g, '') === name.replace(/"/g, '').replace(/ /g, '')) ||
236
+ if ((value.replace(/"/g, '').replace(/ /g, '').toLowerCase() === name.replace(/"/g, '').replace(/ /g, '').toLowerCase()) ||
237
237
  (value.search(pattern) > -1)) {
238
238
  index = pos;
239
239
  }
@@ -650,4 +650,9 @@ export declare const bindCssClass: string;
650
650
  * @hidden
651
651
 
652
652
  */
653
- export declare const blockInlineEmptyNodes: string;
653
+ export declare const blockEmptyNodes: string;
654
+ /**
655
+ * @hidden
656
+
657
+ */
658
+ export declare const inlineEmptyNodes: string;
@@ -650,4 +650,9 @@ export var bindCssClass = 'closeTableDialog';
650
650
  * @hidden
651
651
 
652
652
  */
653
- export var blockInlineEmptyNodes = "address:empty, article:empty, aside:empty, blockquote:empty,\n details:empty, dd:empty, div:empty, dl:empty, dt:empty, fieldset:empty, footer:empty,form:empty, h1:empty,\n h2:empty, h3:empty, h4:empty, h5:empty, h6:empty, header:empty, hgroup:empty, hr:empty, li:empty, main:empty, nav:empty,\n noscript:empty, output:empty, p:empty, pre:empty, section:empty, td:empty, th:empty,\n a:empty, abbr:empty, acronym:empty, b:empty, bdi:empty, bdo:empty, big:empty, button:empty,\n canvas:empty, cite:empty, code:empty, data:empty, datalist:empty, del:empty, dfn:empty, em:empty, font:empty, i:empty, iframe:empty,\n ins:empty, kbd:empty, label:empty, map:empty, mark:empty, meter:empty, noscript:empty, object:empty, output:empty, picture:empty, progress:empty,\n q:empty, ruby:empty, s:empty, samp:empty, script:empty, select:empty, slot:empty, small:empty, span:empty, strong:empty, strike:empty, sub:empty, sup:empty, svg:empty,\n template:empty, textarea:empty, time:empty, u:empty, tt:empty, var:empty, wbr:empty";
653
+ export var blockEmptyNodes = "address:empty, article:empty, aside:empty, blockquote:empty,\n details:empty, dd:empty, div:empty, dl:empty, dt:empty, fieldset:empty, footer:empty,form:empty, h1:empty,\n h2:empty, h3:empty, h4:empty, h5:empty, h6:empty, header:empty, hgroup:empty, li:empty, main:empty, nav:empty,\n noscript:empty, output:empty, p:empty, pre:empty, section:empty, td:empty, th:empty";
654
+ /**
655
+ * @hidden
656
+
657
+ */
658
+ export var inlineEmptyNodes = "a:empty, abbr:empty, acronym:empty, b:empty, bdi:empty, bdo:empty, big:empty, button:empty,\n canvas:empty, cite:empty, code:empty, data:empty, datalist:empty, del:empty, dfn:empty, em:empty, font:empty, i:empty, iframe:empty,\n ins:empty, kbd:empty, label:empty, map:empty, mark:empty, meter:empty, noscript:empty, object:empty, output:empty, picture:empty, progress:empty,\n q:empty, ruby:empty, s:empty, samp:empty, script:empty, select:empty, slot:empty, small:empty, span:empty, strong:empty, strike:empty, sub:empty, sup:empty, svg:empty,\n template:empty, textarea:empty, time:empty, u:empty, tt:empty, var:empty, wbr:empty";
@@ -509,10 +509,10 @@ var RichTextEditor = /** @class */ (function (_super) {
509
509
  }
510
510
  }
511
511
  var currentLastElem = closestLI;
512
- while (currentLastElem.nodeName !== '#text') {
512
+ while (currentLastElem.lastChild !== null && currentLastElem.nodeName !== '#text') {
513
513
  currentLastElem = currentLastElem.lastChild;
514
514
  }
515
- this.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(), isSameContainer ? currentLastElem : currentStartContainer, currentLastElem, currentStartOffset, currentLastElem.textContent.length);
515
+ this.formatter.editorManager.nodeSelection.setSelectionText(this.contentModule.getDocument(), isSameContainer ? (currentLastElem.nodeName === 'BR' && !isNOU(currentLastElem.previousSibling) ? currentLastElem.previousSibling : currentLastElem) : currentStartContainer, currentLastElem, currentStartOffset, (currentLastElem.nodeName === 'BR' ? 0 : currentLastElem.textContent.length));
516
516
  }
517
517
  };
518
518
  /**
@@ -851,8 +851,19 @@ var RichTextEditor = /** @class */ (function (_super) {
851
851
  if (this.isDestroyed || !this.isRendered) {
852
852
  return;
853
853
  }
854
- if (this.element.offsetParent === null && !isNOU(this.toolbarModule)) {
855
- this.toolbarModule.destroy();
854
+ if (this.element.offsetParent === null) {
855
+ if (!isNOU(this.toolbarModule)) {
856
+ this.toolbarModule.destroy();
857
+ }
858
+ if (!isNOU(this.imageModule)) {
859
+ this.imageModule.moduleDestroy();
860
+ }
861
+ if (!isNOU(this.linkModule)) {
862
+ this.linkModule.moduleDestroy();
863
+ }
864
+ if (!isNOU(this.renderModule)) {
865
+ this.renderModule.moduleDestroy();
866
+ }
856
867
  return;
857
868
  }
858
869
  this.notify(events.destroy, {});
@@ -2146,6 +2157,11 @@ var RichTextEditor = /** @class */ (function (_super) {
2146
2157
  case 'cut':
2147
2158
  this.onCut();
2148
2159
  break;
2160
+ case 'tab':
2161
+ if (this.iframeSettings.enable) {
2162
+ this.isBlur = true;
2163
+ }
2164
+ break;
2149
2165
  }
2150
2166
  if (e.callBack && (e.event.action === 'copy' || e.event.action === 'cut' || e.event.action === 'delete')) {
2151
2167
  e.callBack({
@@ -414,9 +414,13 @@ export function updateTextNode(value, rteObj) {
414
414
  var previousParent = void 0;
415
415
  var insertElem = void 0;
416
416
  while (tempNode.firstChild) {
417
- var emptyElem = tempNode.querySelectorAll(CONSTANT.blockInlineEmptyNodes);
418
- for (var i = 0; i < emptyElem.length; i++) {
419
- emptyElem[i].innerHTML = '<br>';
417
+ var emptyBlockElem = tempNode.querySelectorAll(CONSTANT.blockEmptyNodes);
418
+ for (var i = 0; i < emptyBlockElem.length; i++) {
419
+ emptyBlockElem[i].innerHTML = '<br>';
420
+ }
421
+ var emptyInlineElem = tempNode.querySelectorAll(CONSTANT.inlineEmptyNodes);
422
+ for (var i = 0; i < emptyInlineElem.length; i++) {
423
+ emptyInlineElem[i].innerHTML = '&ZeroWidthSpace;';
420
424
  }
421
425
  if (rteObj.enterKey !== 'BR' && ((tempNode.firstChild.nodeName === '#text' &&
422
426
  (tempNode.firstChild.textContent.indexOf('\n') < 0 || tempNode.firstChild.textContent.trim() !== '')) ||
@@ -30,6 +30,7 @@ export declare class Image {
30
30
  private isAllowedTypes;
31
31
  private pageX;
32
32
  private pageY;
33
+ private mouseX;
33
34
  private dialogRenderObj;
34
35
  private deletedImg;
35
36
  private changedWidthValue;
@@ -164,6 +165,14 @@ export declare class Image {
164
165
 
165
166
  */
166
167
  destroy(): void;
168
+ /**
169
+ * Clears the ImageModule.
170
+ *
171
+ * @returns {void}
172
+ * @hidden
173
+
174
+ */
175
+ moduleDestroy(): void;
167
176
  /**
168
177
  * For internal use only - Get the module name.
169
178
  *
@@ -17,6 +17,7 @@ var Image = /** @class */ (function () {
17
17
  this.isAllowedTypes = true;
18
18
  this.pageX = null;
19
19
  this.pageY = null;
20
+ this.mouseX = null;
20
21
  this.deletedImg = [];
21
22
  this.parent = parent;
22
23
  this.rteID = parent.element.id;
@@ -353,8 +354,9 @@ var Image = /** @class */ (function () {
353
354
  img.style.minWidth = this.parent.insertImageSettings.minWidth === 0 ? '20px' : formatUnit(this.parent.insertImageSettings.minWidth);
354
355
  if (this.parent.insertImageSettings.resizeByPercent) {
355
356
  if (parseInt('' + img.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
356
- var percentageValue = this.pixToPerc((width / height * expectedY), (img.previousElementSibling || img.parentElement));
357
- img.style.width = Math.min(Math.round((percentageValue / img.getBoundingClientRect().width) * expectedX * 100) / 100, 100) + '%';
357
+ var original = img.offsetWidth + this.mouseX;
358
+ var finalWidthByPerc = (original / img.offsetWidth) * (parseFloat(img.style.width).toString() == 'NaN' ? (img.offsetWidth / (parseFloat(getComputedStyle(this.parent.element).width)) * 100) : parseFloat(img.style.width));
359
+ img.style.width = ((finalWidthByPerc > 3) ? finalWidthByPerc : 3) + '%';
358
360
  }
359
361
  else {
360
362
  img.style.width = this.pixToPerc((width / height * expectedY), (img.previousElementSibling || img.parentElement)) + '%';
@@ -377,13 +379,20 @@ var Image = /** @class */ (function () {
377
379
  img.style.height = expectedY + 'px';
378
380
  }
379
381
  else {
380
- img.setAttribute('width', ((width / height * expectedY) + width / height).toString());
382
+ if (this.parent.iframeSettings.enable) {
383
+ img.setAttribute('width', (img.width + this.mouseX).toString());
384
+ }
385
+ else {
386
+ img.setAttribute('width', (img.offsetWidth + this.mouseX).toString());
387
+ }
381
388
  }
382
389
  }
383
390
  else if (height > width) {
384
391
  if (this.parent.insertImageSettings.resizeByPercent) {
385
392
  if (parseInt('' + img.getBoundingClientRect().width + '', 10) !== 0 && parseInt('' + width + '', 10) !== 0) {
386
- img.style.width = Math.min(Math.round((width / img.getBoundingClientRect().width) * expectedX * 100) / 100, 100) + '%';
393
+ var original = img.offsetWidth + this.mouseX;
394
+ var finalWidthByPerc = (original / img.offsetWidth) * (parseFloat(img.style.width).toString() == 'NaN' ? (img.offsetWidth / (parseFloat(getComputedStyle(this.parent.element).width)) * 100) : parseFloat(img.style.width));
395
+ img.style.width = ((finalWidthByPerc > 3) ? finalWidthByPerc : 3) + '%';
387
396
  }
388
397
  else {
389
398
  img.style.width = this.pixToPerc((expectedX / height * expectedY), (img.previousElementSibling || img.parentElement)) + '%';
@@ -450,6 +459,7 @@ var Image = /** @class */ (function () {
450
459
  var mouseY = (this.resizeBtnStat.topLeft || this.resizeBtnStat.topRight) ? -(pageY - this.pageY) : (pageY - this.pageY);
451
460
  var width = parseInt(this.imgDupPos.width, 10) + mouseX;
452
461
  var height = parseInt(this.imgDupPos.height, 10) + mouseY;
462
+ this.mouseX = mouseX;
453
463
  this.pageX = pageX;
454
464
  this.pageY = pageY;
455
465
  if (this.resizeBtnStat.botRight) {
@@ -2285,6 +2295,18 @@ var Image = /** @class */ (function () {
2285
2295
  this.prevSelectedImgEle = undefined;
2286
2296
  this.removeEventListener();
2287
2297
  };
2298
+ /* eslint-disable */
2299
+ /**
2300
+ * Clears the ImageModule.
2301
+ *
2302
+ * @returns {void}
2303
+ * @hidden
2304
+
2305
+ */
2306
+ /* eslint-enable */
2307
+ Image.prototype.moduleDestroy = function () {
2308
+ this.parent = null;
2309
+ };
2288
2310
  /**
2289
2311
  * For internal use only - Get the module name.
2290
2312
  *
@@ -48,6 +48,14 @@ export declare class Link {
48
48
 
49
49
  */
50
50
  destroy(): void;
51
+ /**
52
+ * Clears the Link Module.
53
+ *
54
+ * @returns {void}
55
+ * @hidden
56
+
57
+ */
58
+ moduleDestroy(): void;
51
59
  /**
52
60
  * For internal use only - Get the module name.
53
61
  *
@@ -520,6 +520,16 @@ var Link = /** @class */ (function () {
520
520
  Link.prototype.destroy = function () {
521
521
  this.removeEventListener();
522
522
  };
523
+ /**
524
+ * Clears the Link Module.
525
+ *
526
+ * @returns {void}
527
+ * @hidden
528
+
529
+ */
530
+ Link.prototype.moduleDestroy = function () {
531
+ this.parent = null;
532
+ };
523
533
  /**
524
534
  * For internal use only - Get the module name.
525
535
  *
@@ -40,6 +40,12 @@ export declare class Render {
40
40
  * @returns {void}
41
41
  */
42
42
  destroy(): void;
43
+ /**
44
+ * Clears the Render Module.
45
+ *
46
+ * @returns {void}
47
+ */
48
+ moduleDestroy(): void;
43
49
  private addEventListener;
44
50
  private removeEventListener;
45
51
  private keyUp;
@@ -51,6 +51,14 @@ var Render = /** @class */ (function () {
51
51
  Render.prototype.destroy = function () {
52
52
  this.removeEventListener();
53
53
  };
54
+ /**
55
+ * Clears the Render Module.
56
+ *
57
+ * @returns {void}
58
+ */
59
+ Render.prototype.moduleDestroy = function () {
60
+ this.parent = null;
61
+ };
54
62
  Render.prototype.addEventListener = function () {
55
63
  if (this.parent.isDestroyed) {
56
64
  return;
@@ -547,7 +547,8 @@ var Table = /** @class */ (function () {
547
547
  }
548
548
  var target = e.target || e.targetTouches[0].target;
549
549
  var closestTable = closest(target, 'table.e-rte-table');
550
- if (!isNOU(this.curTable) && !isNOU(closestTable) && closestTable !== this.curTable) {
550
+ if (!isNOU(this.curTable) && !isNOU(closestTable) && closestTable !== this.curTable &&
551
+ this.parent.contentModule.getEditPanel().contains(closestTable)) {
551
552
  this.removeResizeElement();
552
553
  this.removeHelper(e);
553
554
  this.cancelResizeAction();
@@ -824,7 +825,8 @@ var Table = /** @class */ (function () {
824
825
  var rteWidth = _this.contentModule.getEditPanel().offsetWidth - (_this.contentModule.getEditPanel().offsetWidth -
825
826
  _this.contentModule.getEditPanel().clientWidth) - paddingSize * 2;
826
827
  var widthCompare = void 0;
827
- if (!isNOU(_this.curTable.parentElement.closest('table'))) {
828
+ if (!isNOU(_this.curTable.parentElement.closest('table')) && !isNOU(_this.curTable.closest('td')) &&
829
+ _this.contentModule.getEditPanel().contains(_this.curTable.closest('td'))) {
828
830
  var currentTd = _this.curTable.closest('td');
829
831
  var currentTDPad = +getComputedStyle(currentTd).paddingRight.match(/\d/g).join('');
830
832
  // Padding of the current table with the parent element multiply with 2.
@@ -324,10 +324,11 @@ var ToolbarRenderer = /** @class */ (function () {
324
324
  proxy.parent.notify(events.selectionRestore, {});
325
325
  range = proxy.parent.formatter.editorManager.nodeSelection.getRange(proxy.parent.contentModule.getDocument());
326
326
  var parentNode = range.startContainer.parentNode;
327
+ var closestElement = closest(range.startContainer.parentNode, 'table');
327
328
  if ((range.startContainer.nodeName === 'TD' || range.startContainer.nodeName === 'TH' ||
328
329
  (closest(range.startContainer.parentNode, 'td,th')) ||
329
330
  (proxy.parent.iframeSettings.enable && !hasClass(parentNode.ownerDocument.querySelector('body'), 'e-lib')))
330
- && range.collapsed && args.subCommand === 'BackgroundColor') {
331
+ && range.collapsed && args.subCommand === 'BackgroundColor' && closest(closestElement, '.' + classes.CLS_RTE)) {
331
332
  proxy.parent.notify(events.tableColorPickerChanged, {
332
333
  item: { command: args.command, subCommand: args.subCommand,
333
334
  value: colorpickerValue }
@@ -507,8 +508,9 @@ var ToolbarRenderer = /** @class */ (function () {
507
508
  proxy.parent.notify(events.selectionRestore, {});
508
509
  proxy.currentElement.querySelector('.' + CLS_RTE_ELEMENTS).style.borderBottomColor = colorpickerValue;
509
510
  var range = proxy.parent.formatter.editorManager.nodeSelection.getRange(proxy.parent.contentModule.getDocument());
511
+ var closestElement = closest(range.startContainer.parentNode, 'table');
510
512
  if ((range.startContainer.nodeName === 'TD' || range.startContainer.nodeName === 'TH' || range.startContainer.nodeName === 'BODY' ||
511
- closest(range.startContainer.parentNode, 'td,th')) && range.collapsed && args.subCommand === 'BackgroundColor') {
513
+ closest(range.startContainer.parentNode, 'td,th')) && range.collapsed && args.subCommand === 'BackgroundColor' && closest(closestElement, '.' + classes.CLS_RTE)) {
512
514
  proxy.parent.notify(events.tableColorPickerChanged, colorPickerArgs);
513
515
  }
514
516
  else {
@@ -2541,7 +2541,7 @@
2541
2541
 
2542
2542
  span.e-rte-imageboxmark {
2543
2543
  background: #0078d4;
2544
- border: 1px solid #fff;
2544
+ border: 1px solid #1b1a19;
2545
2545
  display: block;
2546
2546
  height: 10px;
2547
2547
  position: absolute;
@@ -2550,7 +2550,7 @@ span.e-rte-imageboxmark {
2550
2550
  }
2551
2551
 
2552
2552
  .e-mob-rte span.e-rte-imageboxmark {
2553
- background: #fff;
2553
+ background: #1b1a19;
2554
2554
  border: 1px solid #0078d4;
2555
2555
  border-radius: 15px;
2556
2556
  height: 20px;
@@ -2559,7 +2559,7 @@ span.e-rte-imageboxmark {
2559
2559
 
2560
2560
  .e-mob-rte.e-mob-span span.e-rte-imageboxmark {
2561
2561
  background: #0078d4;
2562
- border: 1px solid #fff;
2562
+ border: 1px solid #1b1a19;
2563
2563
  }
2564
2564
 
2565
2565
  .e-rte-content .e-content img.e-resize {
@@ -2541,7 +2541,7 @@
2541
2541
 
2542
2542
  span.e-rte-imageboxmark {
2543
2543
  background: #0078d4;
2544
- border: 1px solid #fff;
2544
+ border: 1px solid #1b1a19;
2545
2545
  display: block;
2546
2546
  height: 10px;
2547
2547
  position: absolute;
@@ -2550,7 +2550,7 @@ span.e-rte-imageboxmark {
2550
2550
  }
2551
2551
 
2552
2552
  .e-mob-rte span.e-rte-imageboxmark {
2553
- background: #fff;
2553
+ background: #1b1a19;
2554
2554
  border: 1px solid #0078d4;
2555
2555
  border-radius: 15px;
2556
2556
  height: 20px;
@@ -2559,7 +2559,7 @@ span.e-rte-imageboxmark {
2559
2559
 
2560
2560
  .e-mob-rte.e-mob-span span.e-rte-imageboxmark {
2561
2561
  background: #0078d4;
2562
- border: 1px solid #fff;
2562
+ border: 1px solid #1b1a19;
2563
2563
  }
2564
2564
 
2565
2565
  .e-rte-content .e-content img.e-resize {