devexpress-richedit 24.1.13-build-25156-0103 → 24.1.13

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.
@@ -16391,19 +16391,22 @@ var utils_base64 = __webpack_require__(6477);
16391
16391
 
16392
16392
 
16393
16393
  class CacheImageInfo {
16394
- constructor(base64, actualId, tmpId, imageUrl, file, referenceInfo, size, isLoaded) {
16394
+ constructor(base64, actualId, tmpId, imageUrl, file, referenceInfo, size, isLoaded, isActualSize) {
16395
16395
  this._base64 = base64 !== undefined ? utils_base64.Base64Utils.normalizeToDataUrl(base64, "image/png") : undefined;
16396
16396
  this.actualId = actualId;
16397
16397
  this.tmpId = tmpId;
16398
16398
  this._referenceInfo = referenceInfo;
16399
16399
  this._size = size ? size : CacheImageInfo.emptyPictureSize;
16400
16400
  this._isLoaded = isLoaded !== undefined ? isLoaded : false;
16401
+ this._isSizeDefined = isActualSize ? isActualSize : !!size;
16401
16402
  this.imageUrl = imageUrl;
16402
16403
  this.file = file;
16403
16404
  }
16404
16405
  static get emptyPictureSize() { return new geometry_size.Size(CacheImageInfo.emptyPicDimension, CacheImageInfo.emptyPicDimension); }
16405
16406
  get isLoaded() { return this._referenceInfo ? this._referenceInfo._isLoaded : this._isLoaded; }
16406
16407
  set isLoaded(val) { this._isLoaded = val; }
16408
+ get isSizeDefined() { return this._referenceInfo ? this._referenceInfo._isSizeDefined : this._isSizeDefined; }
16409
+ set isSizeDefined(val) { this._isSizeDefined = val; }
16407
16410
  get size() { return this._referenceInfo ? this._referenceInfo._size : this._size; }
16408
16411
  set size(val) { this._size = val; }
16409
16412
  get currId() { return this.actualId !== undefined ? this.actualId : this.tmpId; }
@@ -16416,6 +16419,7 @@ class CacheImageInfo {
16416
16419
  this._base64 = undefined;
16417
16420
  this._size = undefined;
16418
16421
  this._isLoaded = undefined;
16422
+ this._isSizeDefined = undefined;
16419
16423
  this.file = undefined;
16420
16424
  }
16421
16425
  equals(obj) {
@@ -16428,7 +16432,7 @@ class CacheImageInfo {
16428
16432
  this.size.equals(obj.size);
16429
16433
  }
16430
16434
  clone() {
16431
- return new CacheImageInfo(this._base64, this.actualId, this.tmpId, this.imageUrl, this.file, this._referenceInfo, this._size, this._isLoaded);
16435
+ return new CacheImageInfo(this._base64, this.actualId, this.tmpId, this.imageUrl, this.file, this._referenceInfo, this._size, this._isLoaded, this._isSizeDefined);
16432
16436
  }
16433
16437
  shouldMakeImagePdfCompatible() {
16434
16438
  if ((0,common.isDefined)(this._convertedBase64))
@@ -43017,7 +43021,7 @@ class PictureManipulator extends RunsBaseManipulator {
43017
43021
  this.history.addTransaction(() => {
43018
43022
  this.modelManipulator.range.removeInterval(new SubDocumentInterval(subDocument, interval), true, false);
43019
43023
  const newInfo = new InlinePictureInfo(pictureRun.size.clone(), new Shape(), -1, pictureRun.info.containerProperties, pictureRun.info.nonVisualDrawingProperties);
43020
- this.modelManipulator.picture.insertInlinePictureViaHistory(new SubDocumentPosition(subDocument, interval.start), charPropsBundle, newInfo);
43024
+ this.modelManipulator.picture.insertInlinePictureViaHistory(new SubDocumentPosition(subDocument, interval.start), charPropsBundle, newInfo, new ImageLoadingOptions(!pictureRun.cacheInfo.isSizeDefined));
43021
43025
  });
43022
43026
  }
43023
43027
  }
@@ -43032,7 +43036,7 @@ class PictureManipulator extends RunsBaseManipulator {
43032
43036
  anchorInfo.zOrder = this.modelManipulator.floatingObject.zOrder.getNewZOrder(subDocument);
43033
43037
  this.modelManipulator.range.removeInterval(new SubDocumentInterval(subDocument, interval), true, false);
43034
43038
  const newInfo = new AnchorPictureInfo(pictureRun.size.clone(), new Shape(), anchorInfo, pictureRun.info.containerProperties, pictureRun.info.nonVisualDrawingProperties);
43035
- this.modelManipulator.picture.insertAnchoredPictureViaHistory(new SubDocumentPosition(subDocument, interval.start), charPropsBundle, newInfo, new ImageLoadingOptions(false));
43039
+ this.modelManipulator.picture.insertAnchoredPictureViaHistory(new SubDocumentPosition(subDocument, interval.start), charPropsBundle, newInfo, new ImageLoadingOptions(!pictureRun.cacheInfo.isSizeDefined));
43036
43040
  run = subDocument.getRunByPosition(interval.start);
43037
43041
  }
43038
43042
  let anchoredRun = run.getType() == RunType.AnchoredPictureRun ? run : run;
@@ -84536,7 +84540,7 @@ class ImagesApi {
84536
84540
  applyVerticalPosition(verticalPosition, anchorInfo);
84537
84541
  const anchorPictureInfo = new AnchorPictureInfo(new PictureSize(true, 0, cacheInfo, new geometry_size.Size(100, 100)), shape, anchorInfo, new NonVisualDrawingObjectInfo(), new NonVisualDrawingObjectInfo());
84538
84542
  anchorPictureInfo.containerProperties.description = options.description;
84539
- this._processor.modelManager.modelManipulator.picture.insertAnchoredPictureViaHistory(new SubDocumentPosition(this._subDocument, position), inputPos.charPropsBundle, anchorPictureInfo, new ImageLoadingOptions(false, size ? new geometry_size.Size(size.width, size.height) : undefined, (_picInterval, _cacheInfo) => setTimeout(() => {
84543
+ this._processor.modelManager.modelManipulator.picture.insertAnchoredPictureViaHistory(new SubDocumentPosition(this._subDocument, position), inputPos.charPropsBundle, anchorPictureInfo, ImageLoadingOptions.initByActualSize(size ? new geometry_size.Size(size.width, size.height) : undefined, (_picInterval, _cacheInfo) => setTimeout(() => {
84540
84544
  callback(getFloatingImageApiFromRun(this._processor, this._subDocument, this._subDocument.getRunAndIndexesByPosition(position)));
84541
84545
  }, 0)));
84542
84546
  this._processor.endUpdate();
@@ -95775,7 +95779,7 @@ class WordHolderInfo {
95775
95779
  }
95776
95780
  if (res == null)
95777
95781
  return false;
95778
- if (this.rowFormatter.row.isEmpty()) {
95782
+ if (this.rowFormatter.row.isEmpty() || this.rowFormatter.row.containsSpacesOnly()) {
95779
95783
  if (this.rowFormatter.rowSizesManager.rowFormattingInfo.isFloatingIntersectRow) {
95780
95784
  this.rowFormatter.rowSizesManager.rowFormattingInfo.findNextYPosWhatHasNeededSpace(res.requiredWidth);
95781
95785
  return this.pushBoxes();
@@ -127932,8 +127936,18 @@ class PrintDocumentOnClient extends CommandBase {
127932
127936
  return true;
127933
127937
  }
127934
127938
  printCore(htmlPrinting, printWindow, closePrintDialogWithHtmlPreview, needSwitchViewType, needToggleHiddenSymbols) {
127935
- if (htmlPrinting)
127936
- this.generatePrintDocument(printWindow, closePrintDialogWithHtmlPreview);
127939
+ if (htmlPrinting) {
127940
+ this.generatePrintDocument(printWindow.document);
127941
+ printWindow.focus();
127942
+ const interval = setInterval(() => {
127943
+ if (printWindow.document.readyState == 'complete') {
127944
+ printWindow.print();
127945
+ if (closePrintDialogWithHtmlPreview && !browser.Browser.AndroidMobilePlatform)
127946
+ printWindow.close();
127947
+ clearInterval(interval);
127948
+ }
127949
+ }, 100);
127950
+ }
127937
127951
  else {
127938
127952
  pdfExport(this.control, (blob, _stream) => {
127939
127953
  if (window.navigator.msSaveOrOpenBlob && !browser.Browser.Edge)
@@ -127948,12 +127962,27 @@ class PrintDocumentOnClient extends CommandBase {
127948
127962
  this.control.commandManager.getCommand(RichEditClientCommand.ToggleShowWhitespace).execute(this.control.commandManager.isPublicApiCall);
127949
127963
  this.control.commandManager.isPrintingProcessing = false;
127950
127964
  }
127951
- generatePrintDocument(printWindow, closePrintDialogWithHtmlPreview) {
127965
+ generatePrintDocument(document) {
127952
127966
  const height = this.control.layout.pages[0].height;
127953
127967
  const width = this.control.layout.pages[0].width;
127954
- let printWindowContent = `<!DOCTYPE html>
127955
- <html moznomarginboxes mozdisallowselectionprint>
127968
+ let fontLink = "";
127969
+ let divsToLoadFonts = "";
127970
+ const googleFonts = this.getGoogleFonts();
127971
+ if (googleFonts.length > 0) {
127972
+ fontLink = this.createGoogleFontStyleLink(googleFonts);
127973
+ divsToLoadFonts = googleFonts.reduce((prev, curr) => {
127974
+ const fontStyles = [`font-family:${curr}`, 'font-weight:bold', 'font-style:italic'];
127975
+ const result = [];
127976
+ for (let i = 1; i <= fontStyles.length; i++)
127977
+ result.push(`<div style="font-size:1pt;position:absolute;top:-1000px;${fontStyles.slice(0, i).join(';')}">${curr}</div>`);
127978
+ return prev ? [prev, ...result].join('\n') : result.join('\n');
127979
+ }, null);
127980
+ }
127981
+ document.documentElement.innerHTML =
127982
+ `<!DOCTYPE html>
127983
+ <html moznomarginboxes mozdisallowselectionprint>
127956
127984
  <head>
127985
+ ${fontLink}
127957
127986
  <style ${this._nonce ? `nonce="${this._nonce}"` : ''}>
127958
127987
  html, body {
127959
127988
  margin: 0;
@@ -127972,22 +128001,25 @@ class PrintDocumentOnClient extends CommandBase {
127972
128001
  </style>
127973
128002
  </head>
127974
128003
  <body>
128004
+ ${divsToLoadFonts}
127975
128005
  </body>
127976
- </html>`;
127977
- printWindow.document.write(printWindowContent);
127978
- printWindow.document.close();
128006
+ </html>`;
127979
128007
  this.generatePrintContent().forEach((child) => {
127980
- printWindow.document.body.appendChild(child);
128008
+ document.body.appendChild(child);
127981
128009
  });
127982
- printWindow.focus();
127983
- const interval = setInterval(() => {
127984
- if (printWindow.document.readyState == 'complete') {
127985
- printWindow.print();
127986
- if (closePrintDialogWithHtmlPreview && !browser.Browser.AndroidMobilePlatform)
127987
- printWindow.close();
127988
- clearInterval(interval);
127989
- }
127990
- }, 100);
128010
+ }
128011
+ getGoogleFonts() {
128012
+ return this.control.modelManager.richOptions.fonts.fonts.reduce((res, f) => {
128013
+ if (f.useGoogleFonts)
128014
+ res.push(f.fontFamily);
128015
+ return res;
128016
+ }, []);
128017
+ }
128018
+ createGoogleFontStyleLink(fontFamilies) {
128019
+ const url = new URL('https://fonts.googleapis.com/css');
128020
+ url.searchParams.append('family', fontFamilies.join('|'));
128021
+ url.searchParams.append('display', 'auto');
128022
+ return `<link href="${url.toString()}" rel="stylesheet" />`;
127991
128023
  }
127992
128024
  generatePrintContent() {
127993
128025
  const layout = this.control.layout;
@@ -141756,7 +141788,7 @@ class ClientRichEdit {
141756
141788
  this.contextMenuSettings = settings.contextMenuSettings;
141757
141789
  this.fullScreenHelper = new FullScreenHelper(element);
141758
141790
  if (true)
141759
- external_DevExpress_config_default()(JSON.parse(atob('eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaVREZzBkbWxZYUZOS1MyWnRRams0U0VOTVkxTTRNaUlLZlE9PS53SkN1UVJhY3dIaU9DMEdWZFBPVlNacDJsRThrcTdTbUZTTWpIMXgvamxEMnowbzQvYWFkVm9zK1g2ZzlwSDZaYjdUUXdOdlZvQkduRUNwblB2M0ZaOUV4eWlkK3pybUxITE8yZnIyVzFTOEJOWE1YaE1mSlNPdjJ3aCs5SDBSd2lMejJxUT09In0=')));
141791
+ external_DevExpress_config_default()(JSON.parse(atob('eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaVUyTnFlV05wY0hrM1ptcHpZMm8wV2xwdWVFUTVUaUlLZlE9PS5NQTY1NWlJNi9wMlJTZ2NnamlnVXFOTDVNUU15YjAzRGh3ZjdUeWlvcURSajIwL3Izbnl3S3dJOHdUVlM4aUR3eG1ZeWN4UmlIYWtiTTN3dS8ydUs2UTY2V3VXalFEeFlJbXhhajVBVFUrZDQzN2gwTGQvYXlqTHRiZWlhbFJBRkxWVWh6Zz09In0=')));
141760
141792
  this.prepareElement(element, settings);
141761
141793
  this.initDefaultFontsAndStyles();
141762
141794
  this.initBars(settings.ribbon, settings.fonts);