@syncfusion/ej2-richtexteditor 20.2.38 → 20.2.39

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.39
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.38",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-C8xFE0QDv7mvp6MUMDvckFoZ9m7Sd0jr6HhC124W+91UuAiWCIQhyEEE32UHNP5cxCDoQ9nQU7xmzf9rKdt9PA==",
5
+ "_integrity": "sha512-R8AtoHAIPqpoh/7JpkRUms9eRZPs7tWWTid2D9gZXd/JieNhPPEcoRKYjavpVRx/Cj4O7umyzzXHIekW+8h3Xw==",
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.38.tgz",
30
+ "_shasum": "332d081f0e815d62053ba5a2d14d14f9a0813411",
31
31
  "_spec": "@syncfusion/ej2-richtexteditor@*",
32
32
  "_where": "/jenkins/workspace/automation_release_19.1.0.1-ZPMUBNQ6AUYH6YGEFBPVYMEQLRRW2SLD4XCZ6GATNZJFYJ3RIAOA/packages/included",
33
33
  "author": {
@@ -40,10 +40,10 @@
40
40
  "dependencies": {
41
41
  "@syncfusion/ej2-base": "~20.2.38",
42
42
  "@syncfusion/ej2-buttons": "~20.2.38",
43
- "@syncfusion/ej2-filemanager": "~20.2.38",
43
+ "@syncfusion/ej2-filemanager": "~20.2.39",
44
44
  "@syncfusion/ej2-inputs": "~20.2.38",
45
- "@syncfusion/ej2-navigations": "~20.2.38",
46
- "@syncfusion/ej2-popups": "~20.2.38",
45
+ "@syncfusion/ej2-navigations": "~20.2.39",
46
+ "@syncfusion/ej2-popups": "~20.2.39",
47
47
  "@syncfusion/ej2-splitbuttons": "~20.2.38"
48
48
  },
49
49
  "deprecated": false,
@@ -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.39",
74
74
  "sideEffects": false
75
75
  }
@@ -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
  /**
@@ -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;
@@ -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) {
@@ -507,8 +507,9 @@ var ToolbarRenderer = /** @class */ (function () {
507
507
  proxy.parent.notify(events.selectionRestore, {});
508
508
  proxy.currentElement.querySelector('.' + CLS_RTE_ELEMENTS).style.borderBottomColor = colorpickerValue;
509
509
  var range = proxy.parent.formatter.editorManager.nodeSelection.getRange(proxy.parent.contentModule.getDocument());
510
+ var closestElement = closest(range.startContainer.parentNode, 'table');
510
511
  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') {
512
+ closest(range.startContainer.parentNode, 'td,th')) && range.collapsed && args.subCommand === 'BackgroundColor' && closest(closestElement, '.' + classes.CLS_RTE)) {
512
513
  proxy.parent.notify(events.tableColorPickerChanged, colorPickerArgs);
513
514
  }
514
515
  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 {