@syncfusion/ej2-richtexteditor 27.2.2 → 27.2.3

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.
@@ -3055,11 +3055,11 @@ let formatsLocale = [
3055
3055
  let numberFormatListLocale = [
3056
3056
  { locale: 'numberFormatListNone', value: 'none' },
3057
3057
  { locale: 'numberFormatListNumber', value: 'decimal' },
3058
- { locale: 'numberFormatListLowerAlpha', value: 'lower-alpha' },
3059
- { locale: 'numberFormatListUpperAlpha', value: 'upper-alpha' },
3060
- { locale: 'numberFormatListLowerRoman', value: 'lower-roman' },
3061
- { locale: 'numberFormatListUpperRoman', value: 'upper-roman' },
3062
- { locale: 'numberFormatListLowerGreek', value: 'lower-greek' }
3058
+ { locale: 'numberFormatListLowerAlpha', value: 'lowerAlpha' },
3059
+ { locale: 'numberFormatListUpperAlpha', value: 'upperAlpha' },
3060
+ { locale: 'numberFormatListLowerRoman', value: 'lowerRoman' },
3061
+ { locale: 'numberFormatListUpperRoman', value: 'upperRoman' },
3062
+ { locale: 'numberFormatListLowerGreek', value: 'lowerGreek' }
3063
3063
  ];
3064
3064
  let bulletFormatListLocale = [
3065
3065
  { locale: 'bulletFormatListNone', value: 'none' },
@@ -8745,9 +8745,17 @@ class Image$1 {
8745
8745
  }
8746
8746
  };
8747
8747
  proxy.inputUrl.setAttribute('disabled', 'true');
8748
- if (isNullOrUndefined(proxy.parent.insertImageSettings.saveUrl) && this.isAllowedTypes
8749
- && !isNullOrUndefined(this.dialogObj) && selectArgs.filesData[0].size <= this.uploadObj.maxFileSize) {
8750
- this.dialogObj.getButtons(0).element.removeAttribute('disabled');
8748
+ if (!isNullOrUndefined(this.dialogObj)) {
8749
+ const button = this.dialogObj.getButtons(0);
8750
+ if (!isNullOrUndefined(button)) {
8751
+ if (isNullOrUndefined(proxy.parent.insertImageSettings.saveUrl) && this.isAllowedTypes
8752
+ && selectArgs.filesData[0].size <= this.uploadObj.maxFileSize) {
8753
+ button.element.removeAttribute('disabled');
8754
+ }
8755
+ else {
8756
+ button.element.setAttribute('disabled', 'true');
8757
+ }
8758
+ }
8751
8759
  }
8752
8760
  });
8753
8761
  reader.readAsDataURL(selectArgs.filesData[0].rawFile);
@@ -17068,6 +17076,13 @@ class Toolbar {
17068
17076
  target: this.tbElement,
17069
17077
  cssClass: this.parent.getCssClass()
17070
17078
  });
17079
+ if (this.parent.element.classList.contains('e-rte-full-screen')) {
17080
+ this.updateItem({
17081
+ targetItem: 'Maximize',
17082
+ updateItem: 'Minimize',
17083
+ baseToolbar: this.parent.getBaseToolbarObject()
17084
+ });
17085
+ }
17071
17086
  if (!this.parent.inlineMode.enable) {
17072
17087
  if (this.parent.toolbarSettings.enableFloating) {
17073
17088
  this.checkIsTransformChild();
@@ -23870,7 +23885,7 @@ class NodeCutter {
23870
23885
  fragment = this.spliceEmptyNode(fragment, false);
23871
23886
  if (fragment && fragment.childNodes.length > 0) {
23872
23887
  const isEmpty = (fragment.childNodes.length === 1 && fragment.childNodes[0].nodeName !== 'IMG' && !(fragment.querySelectorAll('img').length > 0)
23873
- && this.isRteElm(fragment) && fragment.textContent.trim() === '' && fragment.textContent !== ' ' && fragment.textContent.charCodeAt(0) !== 160) ? true : false;
23888
+ && this.isRteElm(fragment) && fragment.textContent.trim() === '' && fragment.textContent.charCodeAt(0) !== 32 && fragment.textContent.charCodeAt(0) !== 160) ? true : false;
23874
23889
  if (!isEmpty) {
23875
23890
  if (node) {
23876
23891
  InsertMethods.AppendBefore(fragment, node);
@@ -23891,7 +23906,7 @@ class NodeCutter {
23891
23906
  fragment = this.spliceEmptyNode(fragment, true);
23892
23907
  if (fragment && fragment.childNodes.length > 0) {
23893
23908
  const isEmpty = (fragment.childNodes.length === 1 && fragment.childNodes[0].nodeName !== 'IMG'
23894
- && this.isRteElm(fragment) && fragment.textContent.trim() === '' && fragment.textContent !== ' ' && fragment.textContent.charCodeAt(0) !== 160) ? true : false;
23909
+ && this.isRteElm(fragment) && fragment.textContent.trim() === '' && fragment.textContent.charCodeAt(0) !== 32 && fragment.textContent.charCodeAt(0) !== 160) ? true : false;
23895
23910
  if (!isEmpty) {
23896
23911
  if (node) {
23897
23912
  InsertMethods.AppendBefore(fragment, node, true);
@@ -32415,7 +32430,10 @@ class HtmlEditor {
32415
32430
  const editorValue = currentRange.startContainer.textContent.slice(0, currentRange.startOffset);
32416
32431
  const orderedList = this.isOrderedList(editorValue);
32417
32432
  const unOrderedList = this.isUnOrderedList(editorValue);
32418
- const hasSplitedText = this.hasMultipleTextNode(currentRange);
32433
+ let hasSplitedText = false;
32434
+ if (orderedList || unOrderedList) {
32435
+ hasSplitedText = this.hasMultipleTextNode(currentRange);
32436
+ }
32419
32437
  if (!hasSplitedText && (orderedList && !unOrderedList || unOrderedList && !orderedList)) {
32420
32438
  const eventArgs = {
32421
32439
  callBack: null,
@@ -32485,6 +32503,11 @@ class HtmlEditor {
32485
32503
  hasMultipleTextNode(range) {
32486
32504
  if (range && range.startContainer && range.startContainer.parentNode) {
32487
32505
  const parentNode = range.startContainer.parentNode;
32506
+ if (range.startContainer.previousElementSibling &&
32507
+ range.startContainer.previousElementSibling.classList.contains('e-mention-chip')
32508
+ && !range.startContainer.previousElementSibling.isContentEditable) {
32509
+ return true;
32510
+ }
32488
32511
  if (this.parent.enterKey === 'BR' || closest(parentNode, 'table')) {
32489
32512
  return false;
32490
32513
  }
@@ -37024,13 +37047,21 @@ class EnterKeyAction {
37024
37047
  }
37025
37048
  let isMediaNode = false; // To check the image audio and video node cases
37026
37049
  let isFocusedFirst = false;
37050
+ const parentElement = this.range.startContainer.parentElement;
37051
+ const isPreWrapApplied = parentElement ? this.parent.contentModule.getDocument().defaultView.getComputedStyle(this.range.startContainer.parentElement, null).getPropertyValue('white-space') === 'pre-wrap' : false;
37027
37052
  if (this.range.startOffset !== 0 && this.range.endOffset !== 0 &&
37028
37053
  this.range.startContainer === this.range.endContainer && !(!isNullOrUndefined(nearBlockNode.childNodes[0])
37029
37054
  && (nearBlockNode.childNodes[0].nodeName === 'IMG' || nearBlockNode.querySelectorAll('img, audio, video').length > 0))) {
37030
37055
  const startNodeText = this.range.startContainer.textContent;
37031
37056
  const splitFirstText = startNodeText.substring(0, this.range.startOffset);
37032
- // eslint-disable-next-line max-len
37033
- if (splitFirstText.charCodeAt(this.range.startOffset - 1) !== 160 && splitFirstText.trim().length === 0) {
37057
+ const lastCharBeforeCursor = splitFirstText.charCodeAt(this.range.startOffset - 1);
37058
+ const isSplitTextEmpty = splitFirstText.trim().length === 0;
37059
+ const hasContentAfterCursor = startNodeText.slice(this.range.startOffset).trim().length !== 0;
37060
+ const isCursorAtStartNonPreWrap = lastCharBeforeCursor !== 160
37061
+ && isSplitTextEmpty && !isPreWrapApplied;
37062
+ const isCursorAtStartPreWrapWithContent = lastCharBeforeCursor === 32
37063
+ && isPreWrapApplied && isSplitTextEmpty && hasContentAfterCursor;
37064
+ if (isCursorAtStartNonPreWrap || isCursorAtStartPreWrapWithContent) {
37034
37065
  isFocusedFirst = true;
37035
37066
  }
37036
37067
  }