devexpress-richedit 24.2.11 → 24.2.12

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.
package/bin/gulpfile.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (gulpfile.js)
3
- * Version: 24.2.11
3
+ * Version: 24.2.12
4
4
  * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
5
5
  * License: https://www.devexpress.com/Support/EULAs",
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (index-custom.js)
3
- * Version: 24.2.11
3
+ * Version: 24.2.12
4
4
  * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
5
5
  * License: https://www.devexpress.com/Support/EULAs",
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (localization-builder.js)
3
- * Version: 24.2.11
3
+ * Version: 24.2.12
4
4
  * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
5
5
  * License: https://www.devexpress.com/Support/EULAs",
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (nspell-index.js)
3
- * Version: 24.2.11
3
+ * Version: 24.2.12
4
4
  * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
5
5
  * License: https://www.devexpress.com/Support/EULAs",
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (nspell.webpack.config.js)
3
- * Version: 24.2.11
3
+ * Version: 24.2.12
4
4
  * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
5
5
  * License: https://www.devexpress.com/Support/EULAs",
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (webpack-externals.js)
3
- * Version: 24.2.11
3
+ * Version: 24.2.12
4
4
  * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
5
5
  * License: https://www.devexpress.com/Support/EULAs",
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (webpack.config.js)
3
- * Version: 24.2.11
3
+ * Version: 24.2.12
4
4
  * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
5
5
  * License: https://www.devexpress.com/Support/EULAs",
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (dx.richedit.d.ts)
3
- * Version: 24.2.11
3
+ * Version: 24.2.12
4
4
  * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
5
5
  * License: https://www.devexpress.com/Support/EULAs",
6
6
  */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (dx.richedit.js)
3
- * Version: 24.2.11
3
+ * Version: 24.2.12
4
4
  * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
5
5
  * License: https://www.devexpress.com/Support/EULAs",
6
6
  */
@@ -13,7 +13,13 @@
13
13
 
14
14
 
15
15
  Object.defineProperty(exports, "__esModule", ({ value: true }));
16
- exports.Browser = void 0;
16
+ exports.Browser = exports.addBrowserClassNamesToHtml = void 0;
17
+ var resolveBrowserClassNames = null;
18
+ function addBrowserClassNamesToHtml() {
19
+ if (resolveBrowserClassNames && typeof resolveBrowserClassNames === 'function')
20
+ resolveBrowserClassNames();
21
+ }
22
+ exports.addBrowserClassNamesToHtml = addBrowserClassNamesToHtml;
17
23
  var Browser = (function () {
18
24
  function Browser() {
19
25
  }
@@ -216,10 +222,17 @@ var Browser = (function () {
216
222
  if (typeof document !== 'undefined' && document && document.documentElement) {
217
223
  if (document.documentElement.className !== '')
218
224
  documentElementClassName = ' ' + documentElementClassName;
219
- document.documentElement.className += documentElementClassName;
220
225
  Browser.Info = documentElementClassName;
226
+ Browser.applyClassNamesOnDemand(document.documentElement, documentElementClassName);
221
227
  }
222
228
  };
229
+ Browser.applyClassNamesOnDemand = function (documentElement, documentElementClassName) {
230
+ return new Promise(function (resolve) {
231
+ resolveBrowserClassNames = resolve;
232
+ }).then(function () {
233
+ documentElement.className += documentElementClassName;
234
+ });
235
+ };
223
236
  Browser.getUserAgent = function () {
224
237
  return Browser.hasNavigator() && navigator.userAgent ? navigator.userAgent.toLowerCase() : '';
225
238
  };
@@ -5091,12 +5104,12 @@ var DomUtils = (function () {
5091
5104
  }
5092
5105
  return window.getComputedStyle(element, null);
5093
5106
  };
5094
- DomUtils.setFocus = function (element) {
5107
+ DomUtils.setFocus = function (element, focusOptions) {
5095
5108
  function focusCore() {
5096
5109
  try {
5097
- element.focus();
5110
+ element.focus(focusOptions);
5098
5111
  if (browser_1.Browser.IE && document.activeElement !== element)
5099
- element.focus();
5112
+ element.focus(focusOptions);
5100
5113
  }
5101
5114
  catch (e) {
5102
5115
  }
@@ -19045,10 +19058,20 @@ class LayoutTableCellInfo extends rectangle.Rectangle {
19045
19058
  }
19046
19059
  getFirstLayoutRowByModelPositionIncludingInternalTables() {
19047
19060
  const firstInternalTable = this.internalTables[0];
19048
- return firstInternalTable ?
19049
- utils_list.ListUtils.min(firstInternalTable.tableRows[0].rowCells, cell => cell.getFirstLayoutRowByModelPositionIncludingInternalTables().columnOffset)
19050
- .getFirstLayoutRowByModelPositionIncludingInternalTables() :
19051
- this.layoutRows[0];
19061
+ if (firstInternalTable) {
19062
+ let result = null;
19063
+ let minOffset = Number.MAX_VALUE;
19064
+ for (const cell of firstInternalTable.tableRows[0].rowCells) {
19065
+ const firstRow = cell.getFirstLayoutRowByModelPositionIncludingInternalTables();
19066
+ if (firstRow.columnOffset < minOffset) {
19067
+ minOffset = firstRow.columnOffset;
19068
+ result = firstRow;
19069
+ }
19070
+ }
19071
+ return result;
19072
+ }
19073
+ else
19074
+ return this.layoutRows[0];
19052
19075
  }
19053
19076
  getEndPosition() {
19054
19077
  const internalTableAfterLastRow = this.internalTables[this.layoutRows.length];
@@ -42734,6 +42757,7 @@ class ColumnCalculator {
42734
42757
 
42735
42758
 
42736
42759
 
42760
+
42737
42761
  class BoundsCalculator {
42738
42762
  constructor() {
42739
42763
  this.pageIndex = -1;
@@ -42744,19 +42768,19 @@ class BoundsCalculator {
42744
42768
  const sectionProperties = this.section.sectionProperties;
42745
42769
  this.equalWidthColumns = sectionProperties.equalWidthColumns;
42746
42770
  this.columnCount = sectionProperties.columnCount;
42747
- this.space = unit_converter/* UnitConverter */.u.twipsToPixelsF(sectionProperties.space);
42748
- this.marginTop = unit_converter/* UnitConverter */.u.twipsToPixelsF(sectionProperties.marginTop);
42749
- this.marginBottom = unit_converter/* UnitConverter */.u.twipsToPixelsF(sectionProperties.marginBottom);
42750
- this.marginRight = unit_converter/* UnitConverter */.u.twipsToPixelsF(sectionProperties.marginRight);
42751
- this.marginBottom = unit_converter/* UnitConverter */.u.twipsToPixelsF(sectionProperties.marginBottom);
42752
- this.marginLeft = unit_converter/* UnitConverter */.u.twipsToPixelsF(sectionProperties.marginLeft);
42753
- this.pageWidth = unit_converter/* UnitConverter */.u.twipsToPixelsF(sectionProperties.pageWidth);
42754
- this.pageHeight = unit_converter/* UnitConverter */.u.twipsToPixelsF(sectionProperties.pageHeight);
42755
- this.headerOffset = unit_converter/* UnitConverter */.u.twipsToPixelsF(sectionProperties.headerOffset);
42756
- this.footerOffset = unit_converter/* UnitConverter */.u.twipsToPixelsF(sectionProperties.footerOffset);
42771
+ this.space = this.twipsToPixelsF(sectionProperties.space);
42772
+ this.marginTop = this.twipsToPixelsF(sectionProperties.marginTop);
42773
+ this.marginBottom = this.twipsToPixelsF(sectionProperties.marginBottom);
42774
+ this.marginRight = this.twipsToPixelsF(sectionProperties.marginRight);
42775
+ this.marginBottom = this.twipsToPixelsF(sectionProperties.marginBottom);
42776
+ this.marginLeft = this.twipsToPixelsF(sectionProperties.marginLeft);
42777
+ this.pageWidth = this.twipsToPixelsF(sectionProperties.pageWidth);
42778
+ this.pageHeight = this.twipsToPixelsF(sectionProperties.pageHeight);
42779
+ this.headerOffset = this.twipsToPixelsF(sectionProperties.headerOffset);
42780
+ this.footerOffset = this.twipsToPixelsF(sectionProperties.footerOffset);
42757
42781
  if (this.mirrorMargins && this.pageIndex >= 0 && (0,common.isEven)(this.pageIndex))
42758
42782
  [this.marginRight, this.marginLeft] = [this.marginLeft, this.marginRight];
42759
- this.columnsInfo = utils_list.ListUtils.map(sectionProperties.columnsInfo, (columnProps) => columnProps.clone().applyConverter(unit_converter/* UnitConverter */.u.twipsToPixelsF));
42783
+ this.columnsInfo = utils_list.ListUtils.map(sectionProperties.columnsInfo, (columnProps) => columnProps.clone().applyConverter(this.twipsToPixelsF));
42760
42784
  this.avaliablePageHeight = this.pageHeight - (this.marginTop + this.marginBottom);
42761
42785
  this.availableHeaderFooterWidth = this.pageWidth - this.marginLeft - this.marginRight;
42762
42786
  }
@@ -42765,6 +42789,9 @@ class BoundsCalculator {
42765
42789
  this.mainPageAreasBounds = [];
42766
42790
  this.mainColumnsBounds = [];
42767
42791
  }
42792
+ twipsToPixelsF(twips) {
42793
+ return math.MathUtils.round(unit_converter/* UnitConverter */.u.twipsToPixelsF(twips), BoundsCalculator.PRECISION);
42794
+ }
42768
42795
  setHeaderBounds(currHeight) {
42769
42796
  if (currHeight == 0) {
42770
42797
  this.headerPageAreaBounds = null;
@@ -42827,6 +42854,7 @@ class BoundsCalculator {
42827
42854
  }
42828
42855
  }
42829
42856
  BoundsCalculator.MAX_HEADER_FOOTER_HEIGHT_COEFF = 0.48;
42857
+ BoundsCalculator.PRECISION = 3;
42830
42858
 
42831
42859
  ;// CONCATENATED MODULE: ./src/common/model/manipulators/picture-manipulator/loader/picture-loader.ts
42832
42860
 
@@ -107822,6 +107850,42 @@ class RichLayoutUtils {
107822
107850
  }
107823
107851
  }
107824
107852
 
107853
+ ;// CONCATENATED MODULE: ./src/common/utils/unicode-string.ts
107854
+
107855
+ class UnicodeString {
107856
+ constructor(value) {
107857
+ this.value = value;
107858
+ }
107859
+ get chars() {
107860
+ if (!this._chars)
107861
+ this._chars = (0,common.isDefined)(this.value) ? Array.from(this.value) : [];
107862
+ return this._chars;
107863
+ }
107864
+ get size() {
107865
+ return this.chars.length;
107866
+ }
107867
+ get isEmpty() {
107868
+ return this.chars.length === 0;
107869
+ }
107870
+ charAt(index) {
107871
+ return this.chars.at(index);
107872
+ }
107873
+ substring(start, end) {
107874
+ return new UnicodeString(this.chars.slice(start, end).join(''));
107875
+ }
107876
+ [Symbol.toPrimitive](hint) {
107877
+ if (hint === "string" || hint === "default")
107878
+ return this.value;
107879
+ return NaN;
107880
+ }
107881
+ toString() {
107882
+ return this.value;
107883
+ }
107884
+ valueOf() {
107885
+ return this.value;
107886
+ }
107887
+ }
107888
+
107825
107889
  ;// CONCATENATED MODULE: ./src/common/event-manager.ts
107826
107890
 
107827
107891
 
@@ -107847,6 +107911,7 @@ class RichLayoutUtils {
107847
107911
 
107848
107912
 
107849
107913
 
107914
+
107850
107915
 
107851
107916
 
107852
107917
  var MouseButton;
@@ -107948,7 +108013,7 @@ class EventManager {
107948
108013
  }
107949
108014
  onText(text, isUpdated) {
107950
108015
  if (isUpdated)
107951
- this.modifyLastInsertedSymbol(text);
108016
+ this.modifyLastInsertedText(text);
107952
108017
  else {
107953
108018
  if (this.control.commandManager.clipboardTimerId === null) {
107954
108019
  this.accumulatedText += text;
@@ -107998,26 +108063,32 @@ class EventManager {
107998
108063
  this.control.modelManager.modelManipulator.range.removeIntervalInner(insertTextHistoryItem.params.subDocPos.subDocument, intervalForModify, false);
107999
108064
  return true;
108000
108065
  }
108001
- modifyLastInsertedSymbol(symbol) {
108002
- if (symbol.length !== 1)
108003
- throw new Error(lib_errors/* Errors */.D.InternalException);
108066
+ modifyLastInsertedText(newText) {
108004
108067
  const insertTextHistoryInfo = this.control.modelManager.modelManipulator.text.getLastModifiableHistoryItem((hi) => hi instanceof InsertTextHistoryItem);
108068
+ const newCharsCount = new UnicodeString(newText).size;
108005
108069
  if (!insertTextHistoryInfo)
108006
108070
  throw new Error(lib_errors/* Errors */.D.InternalException);
108007
- const textLength = insertTextHistoryInfo.params.text.length;
108008
- insertTextHistoryInfo.params.text = insertTextHistoryInfo.params.text.substr(0, textLength - 1) + symbol;
108009
- this.updateSymbol(insertTextHistoryInfo.params.subDocPos.subDocument, insertTextHistoryInfo.params.subDocPos.position + textLength - 1, symbol);
108071
+ const historyItemUnicodeStr = new UnicodeString(insertTextHistoryInfo.params.text);
108072
+ if (newCharsCount > historyItemUnicodeStr.size)
108073
+ throw new Error(lib_errors/* Errors */.D.InternalException);
108074
+ const keptText = historyItemUnicodeStr.substring(0, -newCharsCount);
108075
+ const oldText = historyItemUnicodeStr.substring(keptText.size);
108076
+ insertTextHistoryInfo.params.text = keptText + newText;
108077
+ const position = insertTextHistoryInfo.params.subDocPos.position + keptText.value.length;
108078
+ this.updateText(insertTextHistoryInfo.params.subDocPos.subDocument, position, oldText.value, newText);
108010
108079
  }
108011
- updateSymbol(subDocument, position, symbol) {
108080
+ updateText(subDocument, position, oldText, newText) {
108012
108081
  const state = new HistoryItemIntervalState();
108013
108082
  const chunkIndex = search.SearchUtils.normedInterpolationIndexOf(subDocument.chunks, c => c.startLogPosition.value, position);
108014
108083
  const chunk = subDocument.chunks[chunkIndex];
108015
108084
  const chunkRelativePosition = position - chunk.startLogPosition.value;
108016
- const oldSymbol = chunk.textBuffer.substr(chunkRelativePosition, 1);
108017
- state.register(new HistoryItemTextBufferStateObject(position, symbol));
108018
- chunk.textBuffer = chunk.textBuffer.substr(0, chunkRelativePosition) + symbol + chunk.textBuffer.substr(chunkRelativePosition + 1);
108085
+ state.register(new HistoryItemTextBufferStateObject(position, newText));
108086
+ const textBufferPrevLength = chunk.textBuffer.length;
108087
+ chunk.textBuffer = chunk.textBuffer.substring(0, chunkRelativePosition) + newText + chunk.textBuffer.substring(chunkRelativePosition + oldText.length);
108088
+ const sectionIndex = search.SearchUtils.normedInterpolationIndexOf(subDocument.documentModel.sections, (s) => s.startLogPosition.value, position);
108089
+ const section = subDocument.documentModel.sections[sectionIndex];
108090
+ section.setLength(subDocument, section.getLength() + (chunk.textBuffer.length - textBufferPrevLength));
108019
108091
  this.control.modelManager.modelManipulator.notifyModelChanged(new TextBufferChangedSubDocumentChange(subDocument.id, state));
108020
- return oldSymbol;
108021
108092
  }
108022
108093
  insertFunc() {
108023
108094
  const insertCommand = this.control.commandManager.getCommand(RichEditClientCommand.InsertText);
@@ -110828,6 +110899,7 @@ class ClipboardContentInserter {
110828
110899
 
110829
110900
 
110830
110901
 
110902
+
110831
110903
 
110832
110904
 
110833
110905
  const INPUT_CLASS_NAME = "dxreInputTarget";
@@ -111010,23 +111082,35 @@ class InputEditorBase {
111010
111082
  this.previousText = currentText;
111011
111083
  }
111012
111084
  onTextInput(_data) {
111013
- const text = this.getEditableDocumentText();
111014
- if (text) {
111015
- if (this.previousText) {
111016
- const previousText = this.previousText;
111017
- const previousTextLastIndex = previousText.length - 1;
111018
- if (text[previousTextLastIndex] && text[previousTextLastIndex] != previousText[previousTextLastIndex])
111019
- this.onText(text[previousTextLastIndex], text, true);
111020
- const insertedCharacterCount = text.length - previousText.length;
111021
- if (insertedCharacterCount > 0) {
111022
- for (let i = text.length - insertedCharacterCount; i < text.length; i++)
111023
- this.onText(text[i], text, false);
111024
- }
111085
+ const newText = new UnicodeString(this.getEditableDocumentText());
111086
+ if (newText.isEmpty)
111087
+ return;
111088
+ const oldText = new UnicodeString(this.previousText);
111089
+ if (oldText.isEmpty)
111090
+ this.onText(newText.value, newText.value, false);
111091
+ else if (oldText.value !== newText.value) {
111092
+ const modifiedCharIndex = this.findModifiedCharIndex(oldText, newText);
111093
+ if (modifiedCharIndex == 0)
111094
+ this.onTextReplace(newText.value, newText.value);
111095
+ else {
111096
+ if (modifiedCharIndex < oldText.size && newText.size >= oldText.size)
111097
+ this.onText(newText.substring(modifiedCharIndex, oldText.size).value, newText.value, true);
111098
+ if (newText.size > oldText.size)
111099
+ this.onText(newText.substring(oldText.size).value, newText.value, false);
111025
111100
  }
111026
- else
111027
- this.onText(text, text, false);
111028
111101
  }
111029
111102
  }
111103
+ findModifiedCharIndex(oldText, newText) {
111104
+ let index = 0;
111105
+ while (true) {
111106
+ const oldChar = oldText.charAt(index);
111107
+ const newChar = newText.charAt(index);
111108
+ if (!oldChar || !newChar || oldChar !== newChar)
111109
+ break;
111110
+ index++;
111111
+ }
111112
+ return index;
111113
+ }
111030
111114
  tryObtainCodeFromChar(char) {
111031
111115
  if (char == "\n")
111032
111116
  return key/* KeyCode */.VD.Enter;
@@ -111405,9 +111489,11 @@ class IFrameInputEditor extends InputEditorBase {
111405
111489
  browser.Browser.Chrome && this.inputElement === document.activeElement ||
111406
111490
  ((browser.Browser.IE || browser.Browser.Edge) && this.control.readOnly == ReadOnlyMode.Persistent) ||
111407
111491
  browser.Browser.Firefox)
111408
- this.inputElement.contentWindow.focus();
111409
- else
111410
- dom.DomUtils.setFocus(this.control.readOnly == ReadOnlyMode.Persistent ? this.inputElement : this.editableDocument.body);
111492
+ this.inputElement.contentWindow.focus({ preventScroll: true });
111493
+ else {
111494
+ const element = this.control.readOnly == ReadOnlyMode.Persistent ? this.inputElement : this.editableDocument.body;
111495
+ dom.DomUtils.setFocus(element, { preventScroll: true });
111496
+ }
111411
111497
  }
111412
111498
  setPosition(left, top, force = false) {
111413
111499
  if (this.IMEState === IMEState.None || force)
@@ -147324,7 +147410,7 @@ class ClientRichEdit {
147324
147410
  this.contextMenuSettings = settings.contextMenuSettings;
147325
147411
  this.fullScreenHelper = new FullScreenHelper(element);
147326
147412
  if (true)
147327
- external_DevExpress_config_default()(JSON.parse(atob('eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaVpsaFRURzVTVVZGaFlWZHVablUxVlU1YWRVcGFaeUlLZlE9PS5IK0d1SUtQY0lwRjAwQUFydDZLNGV3STgyalduS0NYSjhudGFOTWhCZnpxY09CRkhtaTVGU3VjTzdmMkpFYWZHYm5EdDJONGpjZ04zTTRVK0QyVVJFbjIrRW5PaFdNODJSWHcyRTV3OVYrSHhsb3JrdHF2ZmhTRmI1aXRWZ3o0bXNWTlNtZz09In0=')));
147413
+ external_DevExpress_config_default()(JSON.parse(atob('eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWRGVnBkelZwVEZWelZtbEZka1pYYm5oa1MwZFdieUlLZlE9PS5VZWgzY0VOS2s0eE5yNURseUQ4MVRETDN3eWNvN1JPWld2dVRIM1Z2dHFVY3RPSmpNSW5SR1A5cWtka1IrcEdMb2ZUZkpMNUx1d0hIMWlYSXdlR0hIK3dSdU9pM3F6RDFwZUM2S2ZpTkczY0VEZ24rWTZtaHQzM2xwSzlWNUpDbkplVmhkZz09In0=')));
147328
147414
  this.prepareElement(element, settings);
147329
147415
  this.initDefaultFontsAndStyles();
147330
147416
  this.initBars(settings.ribbon, settings.fonts);