devexpress-richedit 24.1.11-build-25044-1420 → 24.1.11-build-25058-0102

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.
@@ -31221,6 +31221,7 @@ ApplyFieldHyperlinkStyleHistoryItem.mask = CharacterPropertiesMask.UseAll & ~(Ch
31221
31221
 
31222
31222
 
31223
31223
 
31224
+
31224
31225
  class FieldCodeParserHyperlink extends FieldCodeParserClientUpdatingBase {
31225
31226
  get name() { return FieldName.Hyperlink; }
31226
31227
  parseCodeCurrentFieldInternal(_responce) {
@@ -31237,15 +31238,14 @@ class FieldCodeParserHyperlink extends FieldCodeParserClientUpdatingBase {
31237
31238
  const text = (_b = (_a = this.parameterInfoList[0]) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : "";
31238
31239
  const newHyperlinkInfo = this.updateHyperlinkInfo(text);
31239
31240
  if (!newHyperlinkInfo) {
31240
- if (!this.modelManager.richOptions.fields.keepHyperlinkResultForInvalidReference) {
31241
+ if (!this.modelManager.richOptions.fields.keepHyperlinkResultForInvalidReference)
31241
31242
  this.removeInterval(this.getTopField().getResultInterval());
31242
- }
31243
31243
  return true;
31244
31244
  }
31245
31245
  const modelManipulator = this.modelManager.modelManipulator;
31246
31246
  const resultInterval = field.getResultInterval();
31247
31247
  if (resultInterval.length === 0) {
31248
- const resultText = text !== null && text !== void 0 ? text : "#" + newHyperlinkInfo.anchor;
31248
+ const resultText = utils_string.StringUtils.isNullOrEmpty(text) ? `#${newHyperlinkInfo.anchor}` : text;
31249
31249
  const newResultInterval = new fixed.FixedInterval(resultInterval.start, resultText.length);
31250
31250
  this.setInputPositionState();
31251
31251
  this.replaceTextByInterval(resultInterval, resultText);
@@ -107019,12 +107019,11 @@ class TouchHandlerPopupMenuState extends TouchHandlerStateBase {
107019
107019
  return new TouchHandlerBeginTapProcessingState(this.handler, evt);
107020
107020
  }
107021
107021
  canExtendSelection(mousePoint, lpStart) {
107022
- return this.handler.control.focusManager.isInFocus &&
107023
- this.handler.control.selection.isCollapsed() &&
107022
+ return this.handler.control.selection.isCollapsed() &&
107024
107023
  this.isHitPoints(mousePoint, lpStart.getPositionRelativePage(this.handler.control.measurer), lpStart.row.height);
107025
107024
  }
107026
107025
  canExtendSelectionOnOneSide(mousePoint, selectionInterval) {
107027
- return this.handler.control.focusManager.isInFocus && this.isLeftOrRightEdge(mousePoint, selectionInterval);
107026
+ return this.isLeftOrRightEdge(mousePoint, selectionInterval);
107028
107027
  }
107029
107028
  getLayoutPosition(logPosition) {
107030
107029
  var subDocument = this.handler.control.selection.activeSubDocument;
@@ -134785,7 +134784,14 @@ class ClipboardCommand extends CommandBase {
134785
134784
  this.control.endUpdate();
134786
134785
  }
134787
134786
  tryWriteToClipboard() {
134788
- this.clipboardHelper.tryWriteToClipboard(ClipboardCommand.builtInClipboard.clipboardData).catch(reason => console.log(reason));
134787
+ return __awaiter(this, void 0, void 0, function* () {
134788
+ try {
134789
+ yield this.clipboardHelper.tryWriteToClipboard(ClipboardCommand.builtInClipboard.clipboardData);
134790
+ }
134791
+ catch (error) {
134792
+ console.log(error);
134793
+ }
134794
+ });
134789
134795
  }
134790
134796
  isVisible() {
134791
134797
  return true;
@@ -134982,15 +134988,17 @@ class ClipboardHelper {
134982
134988
  return Promise.reject(ClipboardHelper.noDataInClipboardMessage);
134983
134989
  }
134984
134990
  insertClipboardItem(item, type, insert) {
134985
- return item.getType(type)
134986
- .then(blob => this.readAsText(blob))
134987
- .then(text => insert(text));
134991
+ return __awaiter(this, void 0, void 0, function* () {
134992
+ const blob = yield item.getType(type);
134993
+ const text = yield this.readAsText(blob);
134994
+ return yield insert(text);
134995
+ });
134988
134996
  }
134989
134997
  insertPlainText(text) {
134990
134998
  return new Promise((resolve, reject) => {
134991
- if (ClipboardHelper.lastWritenTextHash === this.calculateHash(text))
134999
+ if (ClipboardHelper.lastWrittenTextHash === this.calculateHash(text))
134992
135000
  reject();
134993
- ClipboardHelper.lastWritenTextHash = -1;
135001
+ ClipboardHelper.lastWrittenTextHash = -1;
134994
135002
  const command = new InsertPlainTextCommand(this.control);
134995
135003
  if (command.execute(false, new CommandSimpleOptions(this.control, text)))
134996
135004
  resolve();
@@ -135012,30 +135020,43 @@ class ClipboardHelper {
135012
135020
  }
135013
135021
  });
135014
135022
  }
135023
+ tryWriteToClipboard(clipboardData) {
135024
+ return __awaiter(this, void 0, void 0, function* () {
135025
+ if (this.canWriteToClipboard())
135026
+ yield this.writeToClipboard(clipboardData);
135027
+ });
135028
+ }
135015
135029
  canWriteToClipboard() {
135016
135030
  var _a;
135017
- return !!((_a = this.clipboard) === null || _a === void 0 ? void 0 : _a.writeText);
135031
+ return !!((_a = this.clipboard) === null || _a === void 0 ? void 0 : _a.write);
135018
135032
  }
135019
135033
  writeToClipboard(clipboardData) {
135020
- ClipboardHelper.lastWritenTextHash = -1;
135034
+ ClipboardHelper.lastWrittenTextHash = -1;
135021
135035
  return new Promise((resolve, reject) => {
135022
135036
  const modelManager = this.createModelManager(clipboardData.model);
135023
135037
  const exporter = new TxtExporter(modelManager.modelManipulator, new DocumentExporterOptions());
135024
135038
  exporter.exportToBlob((blob) => __awaiter(this, void 0, void 0, function* () {
135025
- const text = yield this.readAsText(blob);
135026
- if (this.useWithBuildInClipboard)
135027
- ClipboardHelper.lastWritenTextHash = this.calculateHash(text);
135028
- if (this.canWriteToClipboard())
135029
- this.clipboard.writeText(text).then(() => resolve()).catch(reason => reject(reason));
135039
+ let error = null;
135040
+ try {
135041
+ const item = this.createClipboardItem(blob);
135042
+ yield this.clipboard.write([item]);
135043
+ }
135044
+ catch (err) {
135045
+ error = err;
135046
+ }
135047
+ if (this.useWithBuildInClipboard) {
135048
+ const text = yield this.readAsText(blob);
135049
+ ClipboardHelper.lastWrittenTextHash = this.calculateHash(text);
135050
+ }
135051
+ if (error)
135052
+ reject(error);
135030
135053
  else
135031
- return Promise.reject(ClipboardHelper.browserDoesNotSupportWritingToClipboard);
135054
+ resolve();
135032
135055
  }));
135033
135056
  });
135034
135057
  }
135035
- tryWriteToClipboard(clipboardData) {
135036
- if (this.canWriteToClipboard())
135037
- return this.writeToClipboard(clipboardData);
135038
- return Promise.resolve();
135058
+ createClipboardItem(blob) {
135059
+ return new ClipboardItem({ 'text/plain': blob });
135039
135060
  }
135040
135061
  calculateHash(text) {
135041
135062
  let hash = 0;
@@ -135055,10 +135076,9 @@ class ClipboardHelper {
135055
135076
  }
135056
135077
  }
135057
135078
  ClipboardHelper.browserDoesNotSupportReadingFromClipboard = 'The browser does not support reading from the clipboard.';
135058
- ClipboardHelper.browserDoesNotSupportWritingToClipboard = 'The browser does not support writing to the clipboard.';
135059
135079
  ClipboardHelper.noDataInClipboardMessage = 'There is no any supported data in the clipboard.';
135060
135080
  ClipboardHelper.clipboardItemCannotBeInsertedMessage = 'The clipboard item cannot be inserted.';
135061
- ClipboardHelper.lastWritenTextHash = -1;
135081
+ ClipboardHelper.lastWrittenTextHash = -1;
135062
135082
  class InsertHtmlCommand extends CommandBase {
135063
135083
  getState() {
135064
135084
  return new SimpleCommandState(this.isEnabled());