@syncfusion/ej2-richtexteditor 27.1.50 → 27.1.51

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 : 27.1.50
3
+ * version : 27.1.51
4
4
  * Copyright Syncfusion Inc. 2001 - 2023. 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@27.1.48",
3
+ "_id": "@syncfusion/ej2-richtexteditor@27.1.50",
4
4
  "_inBundle": false,
5
- "_integrity": "sha512-O6LTfLB+i7f8Fkc9RWMiv7Ko97D0DoF8iybwrwvZeygcujdQoBoWGjwpPxeM9KG5o/jlZ/4FqtcLEWFxpHcKWw==",
5
+ "_integrity": "sha512-orGMpNrcyPfYUwByIaO2zdQ0eDKJ07gaPEx01fLUObZHWZgqiBM6EpG6FRyCw0eybBJrgbr9+d4tmadweUZn+A==",
6
6
  "_location": "/@syncfusion/ej2-richtexteditor",
7
7
  "_phantomChildren": {},
8
8
  "_requested": {
@@ -25,8 +25,8 @@
25
25
  "/@syncfusion/ej2-react-richtexteditor",
26
26
  "/@syncfusion/ej2-vue-richtexteditor"
27
27
  ],
28
- "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-27.1.48.tgz",
29
- "_shasum": "167af738a4a40e0e0b9a8e3f7768a4656ba45e89",
28
+ "_resolved": "https://nexus.syncfusioninternal.com/repository/ej2-hotfix-new/@syncfusion/ej2-richtexteditor/-/ej2-richtexteditor-27.1.50.tgz",
29
+ "_shasum": "b41d99da06db0fe513c5e6427603da956a09107c",
30
30
  "_spec": "@syncfusion/ej2-richtexteditor@*",
31
31
  "_where": "/jenkins/workspace/elease-automation_release_27.1.1/packages/included",
32
32
  "author": {
@@ -38,11 +38,11 @@
38
38
  "bundleDependencies": false,
39
39
  "dependencies": {
40
40
  "@syncfusion/ej2-base": "~27.1.50",
41
- "@syncfusion/ej2-buttons": "~27.1.50",
42
- "@syncfusion/ej2-dropdowns": "~27.1.50",
43
- "@syncfusion/ej2-filemanager": "~27.1.50",
41
+ "@syncfusion/ej2-buttons": "~27.1.51",
42
+ "@syncfusion/ej2-dropdowns": "~27.1.51",
43
+ "@syncfusion/ej2-filemanager": "~27.1.51",
44
44
  "@syncfusion/ej2-inputs": "~27.1.50",
45
- "@syncfusion/ej2-navigations": "~27.1.50",
45
+ "@syncfusion/ej2-navigations": "~27.1.51",
46
46
  "@syncfusion/ej2-popups": "~27.1.50",
47
47
  "@syncfusion/ej2-splitbuttons": "~27.1.50"
48
48
  },
@@ -80,6 +80,6 @@
80
80
  "url": "git+https://github.com/syncfusion/ej2-javascript-ui-controls.git"
81
81
  },
82
82
  "typings": "index.d.ts",
83
- "version": "27.1.50",
83
+ "version": "27.1.51",
84
84
  "sideEffects": false
85
85
  }
@@ -282,6 +282,9 @@ var InsertHtml = /** @class */ (function () {
282
282
  var rangeElement = closest(nearestAnchor, 'span');
283
283
  rangeElement.appendChild(tempSpan);
284
284
  }
285
+ else if (nodes[0].nodeName === '#text' && nodes[0].nodeValue.includes('\u200B') && !isNOU(nodes[0].parentElement) && !isNOU(nodes[0].parentElement.previousElementSibling) && nodes[0].parentElement.previousElementSibling.classList.contains('e-mention-chip')) {
286
+ range.startContainer.parentElement.insertAdjacentElement('afterend', tempSpan);
287
+ }
285
288
  else {
286
289
  range.insertNode(tempSpan);
287
290
  }
@@ -367,6 +370,24 @@ var InsertHtml = /** @class */ (function () {
367
370
  if (lastSelectionNode.nodeName === '#text') {
368
371
  this.placeCursorEnd(lastSelectionNode, node, nodeSelection, docElement, editNode);
369
372
  }
373
+ else if (lastSelectionNode.nodeName === 'HR') {
374
+ var nextSiblingNode = lastSelectionNode.nextSibling ? lastSelectionNode.nextSibling : null;
375
+ var siblingTag = enterAction === 'DIV' ? createElement('div') : createElement('p');
376
+ siblingTag.appendChild(createElement('br'));
377
+ if (!isNOU(nextSiblingNode) && nextSiblingNode.nodeName === 'HR') {
378
+ lastSelectionNode.parentNode.insertBefore(siblingTag, nextSiblingNode);
379
+ lastSelectionNode = siblingTag;
380
+ }
381
+ else if (!isNOU(nextSiblingNode)) {
382
+ lastSelectionNode = nextSiblingNode;
383
+ }
384
+ else {
385
+ lastSelectionNode.parentNode.appendChild(siblingTag);
386
+ lastSelectionNode.parentNode.insertBefore(lastSelectionNode, siblingTag);
387
+ lastSelectionNode = siblingTag;
388
+ }
389
+ nodeSelection.setSelectionText(docElement, lastSelectionNode, lastSelectionNode, 0, 0);
390
+ }
370
391
  else {
371
392
  this.cursorPos(lastSelectionNode, node, nodeSelection, docElement, editNode, enterAction);
372
393
  }
@@ -516,15 +516,22 @@ var MsWordPaste = /** @class */ (function () {
516
516
  var styleProperty = resultElem[j].getAttribute('style');
517
517
  if (!isNOU(styleProperty) && styleProperty.trim() !== '') {
518
518
  var valueSplit = values[i].split(';');
519
+ for (var q = 0; q < valueSplit.length; q++) {
520
+ if (valueSplit[q].split(':')[0] === 'border' && valueSplit[q].split(':')[1] === 'none') {
521
+ valueSplit.splice(q, 1);
522
+ q--;
523
+ }
524
+ }
519
525
  if (!fromClass) {
520
526
  for (var k = 0; k < valueSplit.length; k++) {
521
- if (styleProperty.indexOf(valueSplit[k].split(':')[0]) >= 0) {
527
+ var propertyName = valueSplit[k].split(':')[0];
528
+ if (styleProperty.includes(propertyName + ':')) {
522
529
  valueSplit.splice(k, 1);
523
530
  k--;
524
531
  }
525
532
  }
526
533
  }
527
- var changedValue = styleProperty + valueSplit.join(';') + ';';
534
+ var changedValue = valueSplit.join(';') + ';' + styleProperty;
528
535
  resultElem[j].setAttribute('style', changedValue);
529
536
  }
530
537
  else {
@@ -228,6 +228,9 @@ var TableCommand = /** @class */ (function () {
228
228
  for (var i = 0; i < thTdElm.length; i++) {
229
229
  thTdElm[i].dataset.oldWidth = (thTdElm[i].offsetWidth / currentTabElm.offsetWidth * 100) + '%';
230
230
  }
231
+ if (isNOU(currentTabElm.style.width) || currentTabElm.style.width === '') {
232
+ currentTabElm.style.width = currentTabElm.offsetWidth + 'px';
233
+ }
231
234
  for (var i = 0; i < allRows.length; i++) {
232
235
  curCell = allRows[i].querySelectorAll(':scope > td, :scope > th')[colIndex];
233
236
  var colTemplate = curCell.cloneNode(true);
@@ -160,7 +160,12 @@ var EnterKeyAction = /** @class */ (function () {
160
160
  else {
161
161
  var nearBlockNode = void 0;
162
162
  if (isTableEnter && _this.parent.formatter.editorManager.domNode.isBlockNode(_this.startNode)) {
163
- nearBlockNode = _this.startNode;
163
+ if (_this.range.startContainer.nodeName === '#text' && !isNOU(_this.range.startContainer.previousSibling) && _this.range.startContainer.previousSibling.nodeName === 'HR') {
164
+ nearBlockNode = _this.range.startContainer.nextSibling;
165
+ }
166
+ else {
167
+ nearBlockNode = _this.startNode;
168
+ }
164
169
  }
165
170
  else {
166
171
  nearBlockNode = _this.parent.formatter.editorManager.domNode.blockParentNode(_this.startNode);
@@ -208,7 +213,7 @@ var EnterKeyAction = /** @class */ (function () {
208
213
  }
209
214
  else {
210
215
  if ((nearBlockNode.textContent.trim().length !== 0 ||
211
- nearBlockNode.childNodes[0].nodeName === 'IMG' ||
216
+ (!isNOU(nearBlockNode.childNodes[0]) && nearBlockNode.childNodes[0].nodeName === 'IMG') ||
212
217
  (nearBlockNode.textContent.trim() === '' && nearBlockNode.querySelectorAll('img, audio, video').length > 0))) {
213
218
  if ((_this.range.startOffset === _this.range.endOffset && _this.range.startOffset !== 0)) {
214
219
  newElem = _this.parent.formatter.editorManager.nodeCutter.SplitNode(_this.range, nearBlockNode, false).cloneNode(true);
@@ -650,12 +650,13 @@ var HtmlEditor = /** @class */ (function () {
650
650
  this.isImageDelete = false;
651
651
  }
652
652
  var brNode = this.deleteRangeElement.querySelector('BR');
653
+ var brLastChildNode = this.deleteRangeElement.lastChild;
653
654
  if (brNode && brNode.classList.contains('e-rte-image-remove-focus')) {
654
655
  removeClass([brNode], ['e-rte-image-focus']);
655
656
  return;
656
657
  }
657
- else if (brNode) {
658
- detach(brNode);
658
+ else if (brNode && brLastChildNode && brLastChildNode.nodeName === 'BR') {
659
+ detach(brLastChildNode);
659
660
  e.args.preventDefault();
660
661
  }
661
662
  if (!isNullOrUndefined(this.deleteRangeElement) && (this.deleteOldRangeElement.tagName !== 'OL' && this.deleteOldRangeElement.tagName !== 'UL')
@@ -115,12 +115,12 @@ var PasteCleanup = /** @class */ (function () {
115
115
  if (e.args && !isNOU(e.args.clipboardData)) {
116
116
  value = e.args.clipboardData.getData('text/html');
117
117
  }
118
- this.parent.trigger(events.beforePasteCleanup, { value: value });
119
118
  if (e.args && value !== null && this.parent.editorMode === 'HTML') {
120
119
  var file = void 0;
121
120
  if (value.length === 0) {
122
121
  var htmlRegex = new RegExp(/<\/[a-z][\s\S]*>/i);
123
122
  value = e.args.clipboardData.getData('text/plain');
123
+ this.parent.trigger(events.beforePasteCleanup, { value: value });
124
124
  this.isNotFromHtml = value !== '' ? true : false;
125
125
  value = value.replace(/</g, '&lt;');
126
126
  value = value.replace(/>/g, '&gt;');
@@ -153,6 +153,7 @@ var PasteCleanup = /** @class */ (function () {
153
153
  }
154
154
  }
155
155
  else if (value.length > 0) {
156
+ this.parent.trigger(events.beforePasteCleanup, { value: value });
156
157
  this.parent.formatter.editorManager.observer.notify(EVENTS.MS_WORD_CLEANUP, {
157
158
  args: e.args,
158
159
  text: e.text,
@@ -588,14 +588,14 @@ export interface RichTextEditorModel extends ComponentModel{
588
588
  * default: 'Paragraph',
589
589
  * width: '65px',
590
590
  * types: [
591
- * { text: 'Paragraph' },
592
- * { text: 'Code' },
593
- * { text: 'Heading 1' },
594
- * { text: 'Heading 2' },
595
- * { text: 'Heading 3' },
596
- * { text: 'Heading 4' },
597
- * { text: 'Heading 5' },
598
- * { text: 'Heading 6' }
591
+ * { text: 'Paragraph', value: 'P'},
592
+ * { text: 'Heading 1', value: 'H1' },
593
+ * { text: 'Heading 2', value: 'H2' },
594
+ * { text: 'Heading 3', value: 'H3' },
595
+ * { text: 'Heading 4', value: 'H4' },
596
+ * { text: 'Heading 5', value: 'H5' },
597
+ * { text: 'Heading 6', value: 'H6' },
598
+ * { text: 'Preformatted', value: 'Pre' },
599
599
  * ]
600
600
  * }
601
601
  */
@@ -757,14 +757,14 @@ export declare class RichTextEditor extends Component<HTMLElement> implements IN
757
757
  * default: 'Paragraph',
758
758
  * width: '65px',
759
759
  * types: [
760
- * { text: 'Paragraph' },
761
- * { text: 'Code' },
762
- * { text: 'Heading 1' },
763
- * { text: 'Heading 2' },
764
- * { text: 'Heading 3' },
765
- * { text: 'Heading 4' },
766
- * { text: 'Heading 5' },
767
- * { text: 'Heading 6' }
760
+ * { text: 'Paragraph', value: 'P'},
761
+ * { text: 'Heading 1', value: 'H1' },
762
+ * { text: 'Heading 2', value: 'H2' },
763
+ * { text: 'Heading 3', value: 'H3' },
764
+ * { text: 'Heading 4', value: 'H4' },
765
+ * { text: 'Heading 5', value: 'H5' },
766
+ * { text: 'Heading 6', value: 'H6' },
767
+ * { text: 'Preformatted', value: 'Pre' },
768
768
  * ]
769
769
  * }
770
770
  */
@@ -1785,7 +1785,7 @@ var Image = /** @class */ (function () {
1785
1785
  };
1786
1786
  proxy.inputUrl.setAttribute('disabled', 'true');
1787
1787
  if (isNOU(proxy.parent.insertImageSettings.saveUrl) && _this.isAllowedTypes
1788
- && !isNOU(_this.dialogObj)) {
1788
+ && !isNOU(_this.dialogObj) && selectArgs.filesData[0].size <= _this.uploadObj.maxFileSize) {
1789
1789
  _this.dialogObj.getButtons(0).element.removeAttribute('disabled');
1790
1790
  }
1791
1791
  });