devexpress-richedit 24.2.1-alpha-24260-0102 → 24.2.2-beta

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.
Files changed (98) hide show
  1. package/bin/gulpfile.js +1 -1
  2. package/bin/index-custom.js +1 -1
  3. package/bin/localization-builder.js +1 -1
  4. package/bin/nspell-index.js +1 -1
  5. package/bin/nspell.webpack.config.js +1 -1
  6. package/bin/webpack-externals.js +1 -1
  7. package/bin/webpack.config.js +1 -1
  8. package/dist/dx.richedit.d.ts +12 -1
  9. package/dist/dx.richedit.js +528 -226
  10. package/dist/dx.richedit.min.js +2 -2
  11. package/index.d.ts +1 -1
  12. package/index.js +1 -1
  13. package/lib/client/bars/rich-edit-ribbon/ribbon-items-data.js +2 -1
  14. package/lib/client/client-rich-edit.js +6 -6
  15. package/lib/client/commands/commands.js +3 -0
  16. package/lib/client/commands/new-document-command.js +2 -1
  17. package/lib/client/default-localization.js +2 -0
  18. package/lib/client/dialogs/hyperlink-dialog.js +13 -6
  19. package/lib/client/formats/docx/import/color/open-xml-color-import-helper.js +2 -2
  20. package/lib/client/formats/docx/import/importers/styles-importer.js +2 -1
  21. package/lib/client/i-rich-constructor-settings.d.ts +1 -2
  22. package/lib/client/model-api/collections/drawing-object-collection.js +1 -1
  23. package/lib/client/model-api/collections/hyperlink-collection.js +1 -1
  24. package/lib/client/public/commands/enum.d.ts +1 -0
  25. package/lib/client/public/commands/enum.js +1 -0
  26. package/lib/client/public/options.d.ts +1 -2
  27. package/lib/client/public/ribbon/item-ids.d.ts +1 -0
  28. package/lib/client/public/ribbon/item-ids.js +1 -0
  29. package/lib/client/public/rich-edit.js +1 -1
  30. package/lib/client/settings.js +2 -4
  31. package/lib/common/commands/client-command.d.ts +2 -1
  32. package/lib/common/commands/client-command.js +1 -0
  33. package/lib/common/commands/command-manager.js +2 -1
  34. package/lib/common/commands/dialogs/dialog-hyperlink-command.js +10 -4
  35. package/lib/common/commands/fields/create-field-command.d.ts +4 -0
  36. package/lib/common/commands/fields/create-field-command.js +8 -0
  37. package/lib/common/commands/fields/open-hyperlink-command.js +9 -6
  38. package/lib/common/commands/floating-objects/floating-object-drag-drop-change-position-command.js +1 -1
  39. package/lib/common/commands/floating-objects/insert-anchored-text-box-command.js +1 -1
  40. package/lib/common/formats/html/export/html-export.d.ts +7 -1
  41. package/lib/common/formats/html/export/html-export.js +35 -35
  42. package/lib/common/formats/html/import/html-importer.js +1 -1
  43. package/lib/common/formats/html/import/importers/list-base.js +4 -4
  44. package/lib/common/input-controller.d.ts +14 -1
  45. package/lib/common/input-controller.js +58 -20
  46. package/lib/common/layout/document-layout.js +1 -1
  47. package/lib/common/layout/main-structures/layout-boxes/layout-space-box.js +1 -1
  48. package/lib/common/model/color/color-model-info.d.ts +1 -1
  49. package/lib/common/model/color/color-model-info.js +2 -1
  50. package/lib/common/model/fields/field.d.ts +4 -1
  51. package/lib/common/model/fields/field.js +18 -2
  52. package/lib/common/model/fields/names.d.ts +2 -1
  53. package/lib/common/model/fields/names.js +1 -0
  54. package/lib/common/model/fields/parsers/field-code-parser-client-updating-base.js +1 -1
  55. package/lib/common/model/fields/parsers/field-code-parser-doc-variable.js +1 -1
  56. package/lib/common/model/fields/parsers/field-code-parser-hyperlink.js +32 -38
  57. package/lib/common/model/fields/parsers/field-code-parser-if.d.ts +39 -0
  58. package/lib/common/model/fields/parsers/field-code-parser-if.js +138 -0
  59. package/lib/common/model/fields/parsers/field-code-parser-merge-field.js +1 -1
  60. package/lib/common/model/fields/parsers/field-code-parser.d.ts +3 -2
  61. package/lib/common/model/fields/parsers/field-code-parser.js +6 -12
  62. package/lib/common/model/fields/tree-creator.js +2 -0
  63. package/lib/common/model/history/items/floating-objects/insert-anchored-picture-history-item.js +1 -0
  64. package/lib/common/model/history/items/switch-text-box-sub-documents-state-history-item.js +0 -1
  65. package/lib/common/model/manipulators/document/sub-document-inserter.d.ts +1 -0
  66. package/lib/common/model/manipulators/document/sub-document-inserter.js +4 -0
  67. package/lib/common/model/manipulators/range/remove-interval-operation.d.ts +2 -0
  68. package/lib/common/model/manipulators/range/remove-interval-operation.js +10 -2
  69. package/lib/common/model/manipulators/range-permission-manipulator.d.ts +4 -0
  70. package/lib/common/model/manipulators/range-permission-manipulator.js +35 -0
  71. package/lib/common/model/manipulators/text-box-manipulator.d.ts +1 -1
  72. package/lib/common/model/manipulators/text-box-manipulator.js +2 -1
  73. package/lib/common/model/manipulators/text-manipulator/text-manipulator.js +1 -1
  74. package/lib/common/model/options/fields.d.ts +1 -2
  75. package/lib/common/model/options/fields.js +2 -5
  76. package/lib/common/model/styles-manager.js +1 -0
  77. package/lib/common/selection/selection.js +2 -1
  78. package/lib/common/ui/ruler/controls/indent/first-line.js +5 -5
  79. package/lib/common/ui/ruler/controls/indent/left.js +6 -6
  80. package/lib/common/ui/ruler/controls/indent/right.js +4 -4
  81. package/lib/common/ui/ruler/controls/margin/left.js +1 -1
  82. package/lib/common/ui/ruler/controls/margin/right.js +1 -1
  83. package/lib/common/ui/ruler/controls/ruler.js +2 -2
  84. package/lib/common/ui/ruler/controls/tab/tab-type.js +3 -3
  85. package/lib/common/ui/ruler/controls/tab/tab.js +7 -7
  86. package/lib/common/ui/ruler/controls/tab/utils.d.ts +2 -2
  87. package/lib/common/ui/ruler/controls/tab/utils.js +5 -5
  88. package/lib/common/ui/ruler/controls/table.js +1 -1
  89. package/lib/common/ui/ruler/controls/vertical-line.d.ts +1 -2
  90. package/lib/common/ui/ruler/controls/vertical-line.js +2 -2
  91. package/lib/common/ui/ruler/controls/wrapper.js +1 -1
  92. package/lib/common/ui/ruler/manager.js +1 -1
  93. package/lib/common/ui/ruler/model-data.d.ts +8 -2
  94. package/lib/common/ui/ruler/model-data.js +6 -0
  95. package/lib/common/ui/ruler/ruler.js +2 -1
  96. package/lib/common/utils/utils.d.ts +10 -5
  97. package/lib/common/utils/utils.js +46 -18
  98. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (dx.richedit.js)
3
- * Version: 24.2.1
3
+ * Version: 24.2.2
4
4
  * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
5
5
  * License: https://www.devexpress.com/Support/EULAs
6
6
  */
@@ -1793,7 +1793,7 @@ exports.$ = void 0;
1793
1793
  var tslib_1 = __webpack_require__(2020);
1794
1794
  var date_1 = __webpack_require__(5308);
1795
1795
  var number_1 = __webpack_require__(2004);
1796
- var string_1 = __webpack_require__(5418);
1796
+ var string_1 = __webpack_require__(4950);
1797
1797
  var SimpleFormattersManager = (function () {
1798
1798
  function SimpleFormattersManager(options) {
1799
1799
  this.options = options;
@@ -2670,7 +2670,7 @@ exports.NumberFormatter = NumberFormatter;
2670
2670
 
2671
2671
  /***/ }),
2672
2672
 
2673
- /***/ 5418:
2673
+ /***/ 4950:
2674
2674
  /***/ (function(__unused_webpack_module, exports, __webpack_require__) {
2675
2675
 
2676
2676
  "use strict";
@@ -10244,7 +10244,7 @@ exports.write = function (buffer, value, offset, isLE, mLen, nBytes) {
10244
10244
  /* harmony export */ EW: function() { return /* binding */ createUrlValidationOptions; },
10245
10245
  /* harmony export */ Ev: function() { return /* binding */ splitByLines; },
10246
10246
  /* harmony export */ Fw: function() { return /* binding */ searchTreeItem; },
10247
- /* harmony export */ pM: function() { return /* binding */ isUrlValid; },
10247
+ /* harmony export */ jE: function() { return /* binding */ UrlUtils; },
10248
10248
  /* harmony export */ tm: function() { return /* binding */ convertToFunction; },
10249
10249
  /* harmony export */ xj: function() { return /* binding */ rotatePoint; }
10250
10250
  /* harmony export */ });
@@ -10309,32 +10309,60 @@ function convertToFunction(func) {
10309
10309
  function splitByLines(text) {
10310
10310
  return text ? text.split(/\r\n|\r|\n/) : [''];
10311
10311
  }
10312
- function createUrlValidationOptions(control) {
10313
- const fieldSettings = control.modelManager.richOptions.fields;
10312
+ function createUrlValidationOptions(modelManager) {
10313
+ const fieldSettings = modelManager.richOptions.fields;
10314
10314
  return {
10315
- allowRelativeUrl: !fieldSettings.disableRelativeHyperlinkUri,
10316
- allowedProtocols: fieldSettings.allowedHyperlinkUriProtocols
10315
+ allowedSchemes: fieldSettings.allowedHyperlinkUriSchemes
10317
10316
  };
10318
10317
  }
10318
+ const defaultAllowedProtocols = [
10319
+ 'http',
10320
+ 'https',
10321
+ 'mailto',
10322
+ 'tel'
10323
+ ];
10319
10324
  const disallowedProtocols = [
10320
- 'data',
10321
- 'javascript'
10325
+ 'javascript',
10326
+ 'data'
10322
10327
  ];
10323
- function isUrlValid(url, options) {
10324
- let currentLocation;
10325
- if (options === null || options === void 0 ? void 0 : options.allowRelativeUrl)
10326
- currentLocation = window.location.href;
10327
- try {
10328
- const resultUrl = new URL(url, currentLocation);
10328
+ class UrlUtils {
10329
+ static isValid(url, options) {
10330
+ var _a;
10331
+ const resultUrl = this.convertToAbsolute(url);
10332
+ if (!resultUrl)
10333
+ return false;
10329
10334
  const protocol = resultUrl.protocol.slice(0, -1);
10330
- const allowedProtocols = options === null || options === void 0 ? void 0 : options.allowedProtocols;
10331
- if (allowedProtocols)
10332
- return allowedProtocols.includes(protocol);
10333
- return !disallowedProtocols.includes(protocol);
10335
+ if (disallowedProtocols.includes(protocol))
10336
+ return false;
10337
+ const allowedProtocols = (_a = options === null || options === void 0 ? void 0 : options.allowedSchemes) !== null && _a !== void 0 ? _a : defaultAllowedProtocols;
10338
+ return allowedProtocols.includes(protocol);
10339
+ }
10340
+ static isRelative(url) {
10341
+ try {
10342
+ new URL(url);
10343
+ return false;
10344
+ }
10345
+ catch (_a) {
10346
+ return true;
10347
+ }
10348
+ }
10349
+ static convertToAbsolute(url) {
10350
+ const currentLocation = window.location.href;
10351
+ try {
10352
+ return new URL(url, currentLocation);
10353
+ }
10354
+ catch (_a) {
10355
+ return null;
10356
+ }
10357
+ }
10358
+ static splitUrlByAnchor(url) {
10359
+ const hashTagPosition = url.indexOf("#");
10360
+ if (hashTagPosition < 0)
10361
+ return [url, ""];
10362
+ return [url.substring(0, hashTagPosition), url.substring(hashTagPosition + 1)];
10334
10363
  }
10335
- catch (_a) { }
10336
- return false;
10337
10364
  }
10365
+ UrlUtils.EmptyPage = "about:blank";
10338
10366
 
10339
10367
 
10340
10368
  /***/ })
@@ -11362,10 +11390,11 @@ var ThemeColorValues;
11362
11390
  class color_model_info_ColorModelInfo {
11363
11391
  static get nullColor() { return color_model_info_ColorModelInfo.makeByColor(ColorHelper.AUTOMATIC_COLOR); }
11364
11392
  ;
11365
- static makeByThemeColorIndex(themeColorIndex, tint = 0) {
11393
+ static makeByThemeColorIndex(themeColorIndex, tint = 0, themeValue = ThemeColorValues.None) {
11366
11394
  const result = new color_model_info_ColorModelInfo();
11367
11395
  result.themeColorIndex = themeColorIndex;
11368
11396
  result.tint = tint;
11397
+ result.themeValue = themeValue;
11369
11398
  return result;
11370
11399
  }
11371
11400
  static makeByColor(color, tint = 0) {
@@ -25050,6 +25079,8 @@ class FieldDeletedSubDocumentChange {
25050
25079
  }
25051
25080
  }
25052
25081
 
25082
+ // EXTERNAL MODULE: ./src/common/utils/utils.ts
25083
+ var utils = __webpack_require__(5929);
25053
25084
  ;// CONCATENATED MODULE: ./src/common/model/fields/field.ts
25054
25085
 
25055
25086
 
@@ -25057,6 +25088,7 @@ class FieldDeletedSubDocumentChange {
25057
25088
 
25058
25089
 
25059
25090
 
25091
+
25060
25092
  var FieldNameType;
25061
25093
  (function (FieldNameType) {
25062
25094
  FieldNameType[FieldNameType["None"] = 0] = "None";
@@ -25086,8 +25118,8 @@ class HyperlinkInfo {
25086
25118
  clone() {
25087
25119
  return new HyperlinkInfo(this.uri, this.anchor, this.tip, this.visited);
25088
25120
  }
25089
- getUriPlusAnchor() {
25090
- return this.uri + (this.anchor == "" ? "" : "#" + this.anchor);
25121
+ getUriWithAnchor() {
25122
+ return this.uri + (this.anchor.length > 0 ? "#" + this.anchor : "");
25091
25123
  }
25092
25124
  static getNewCodeText(hyperlinkInfo) {
25093
25125
  return [
@@ -25098,6 +25130,21 @@ class HyperlinkInfo {
25098
25130
  hyperlinkInfo.anchor == "" ? "" : " \\l \"" + hyperlinkInfo.anchor + "\""
25099
25131
  ].join("");
25100
25132
  }
25133
+ isUri() {
25134
+ if (this.uri.length === 0)
25135
+ return false;
25136
+ if (this.uri.startsWith("#"))
25137
+ return false;
25138
+ if (this.isMail())
25139
+ return false;
25140
+ return utils/* UrlUtils */.jE.isValid(this.uri);
25141
+ }
25142
+ isMail() {
25143
+ return this.uri.startsWith("mailto:");
25144
+ }
25145
+ isValid() {
25146
+ return !!(this.uri || this.anchor);
25147
+ }
25101
25148
  }
25102
25149
  class SequenceInfo {
25103
25150
  constructor(identifier, repeats, hidesResult, resets, resetsWith) {
@@ -28882,6 +28929,7 @@ class StylesManager {
28882
28929
  }
28883
28930
  addTableCellStyleCore(oldStyle) {
28884
28931
  var newStyle = oldStyle.clone();
28932
+ this.tableCellStyleNameToIndex[newStyle.styleName] = this.documentModel.tableCellStyles.push(newStyle) - 1;
28885
28933
  newStyle.characterProperties = this.documentModel.cache.mergedCharacterPropertiesCache.getItem(oldStyle.characterProperties);
28886
28934
  newStyle.tableCellProperties = this.documentModel.cache.tableCellPropertiesCache.getItem(oldStyle.tableCellProperties);
28887
28935
  return newStyle;
@@ -32198,12 +32246,13 @@ class FieldSwitch {
32198
32246
  }
32199
32247
  }
32200
32248
  class FieldParameter {
32201
- constructor(interval, textRepresentation) {
32249
+ constructor(interval, textRepresentation, quoted = false) {
32202
32250
  this.text = textRepresentation;
32203
32251
  this.interval = interval;
32252
+ this.quoted = quoted;
32204
32253
  }
32205
32254
  clone() {
32206
- return new FieldParameter(this.interval.clone(), this.text);
32255
+ return new FieldParameter(this.interval.clone(), this.text, this.quoted);
32207
32256
  }
32208
32257
  }
32209
32258
  class FieldCodeParserHelper {
@@ -32468,7 +32517,7 @@ class FieldCodeParser {
32468
32517
  updateInfo() {
32469
32518
  if (!this.needUpdateInfo())
32470
32519
  return false;
32471
- this.parseSwitchesAndArgs(true);
32520
+ this.parseSwitchesAndArgs();
32472
32521
  this.updateInfoCore();
32473
32522
  return true;
32474
32523
  }
@@ -32476,14 +32525,7 @@ class FieldCodeParser {
32476
32525
  return false;
32477
32526
  }
32478
32527
  updateInfoCore() { }
32479
- parseSwitchesAndArgs(needAtLestOneSpaceAfterFieldName) {
32480
- if (needAtLestOneSpaceAfterFieldName) {
32481
- var prevPos = this.modelIterator.getAbsolutePosition();
32482
- if (this.skipWhitespaces())
32483
- this.modelIterator.setPosition(prevPos);
32484
- else
32485
- return this.modelIterator.run.getType() == RunType.FieldCodeEndRun;
32486
- }
32528
+ parseSwitchesAndArgs() {
32487
32529
  while (this.skipWhitespaces() && this.modelIterator.run.getType() != RunType.FieldCodeEndRun) {
32488
32530
  var currChar = this.modelIterator.getCurrentChar();
32489
32531
  if (FieldCodeParserHelper.isBackslesh(currChar)) {
@@ -32519,7 +32561,7 @@ class FieldCodeParser {
32519
32561
  var argInterval = parseResult.quoted ?
32520
32562
  fixed.FixedInterval.fromPositions(startPosition + 1, this.modelIterator.getAbsolutePosition() - 1) :
32521
32563
  fixed.FixedInterval.fromPositions(startPosition, this.modelIterator.getAbsolutePosition());
32522
- return new FieldParameter(argInterval, parseResult.argListChars.join(""));
32564
+ return new FieldParameter(argInterval, parseResult.argListChars.join(""), parseResult.quoted);
32523
32565
  }
32524
32566
  getSwitchInfo() {
32525
32567
  if (!this.moveIteratorToNextChar() || this.modelIterator.run.getType() != RunType.TextRun)
@@ -32623,6 +32665,7 @@ var FieldName;
32623
32665
  FieldName[FieldName["PageRef"] = 10] = "PageRef";
32624
32666
  FieldName[FieldName["Toc"] = 11] = "Toc";
32625
32667
  FieldName[FieldName["FillIn"] = 12] = "FillIn";
32668
+ FieldName[FieldName["If"] = 13] = "If";
32626
32669
  })(FieldName || (FieldName = {}));
32627
32670
 
32628
32671
  ;// CONCATENATED MODULE: ./src/common/model/history/items/change-field-hyperlink-info-history-item.ts
@@ -32709,7 +32752,7 @@ class FieldCodeParserClientUpdatingBase extends FieldCodeParser {
32709
32752
  }
32710
32753
  parseCodeCurrentFieldInternal(_responce) {
32711
32754
  this.removeInterval(this.getTopField().getResultInterval());
32712
- if (this.parseSwitchesAndArgs(true))
32755
+ if (this.parseSwitchesAndArgs())
32713
32756
  this.fillResult();
32714
32757
  this.parserState = FieldCodeParserState.end;
32715
32758
  return true;
@@ -33468,7 +33511,7 @@ class FieldCodeParserDocVariable extends FieldCodeParser {
33468
33511
  this.parserState = FieldCodeParserState.end;
33469
33512
  return true;
33470
33513
  }
33471
- if (!this.parseSwitchesAndArgs(true)) {
33514
+ if (!this.parseSwitchesAndArgs()) {
33472
33515
  this.parserState = FieldCodeParserState.end;
33473
33516
  return true;
33474
33517
  }
@@ -33635,10 +33678,11 @@ ApplyFieldHyperlinkStyleHistoryItem.mask = CharacterPropertiesMask.UseAll & ~(Ch
33635
33678
 
33636
33679
 
33637
33680
 
33681
+
33638
33682
  class FieldCodeParserHyperlink extends FieldCodeParserClientUpdatingBase {
33639
33683
  get name() { return FieldName.Hyperlink; }
33640
33684
  parseCodeCurrentFieldInternal(_responce) {
33641
- if (this.parseSwitchesAndArgs(true))
33685
+ if (this.parseSwitchesAndArgs())
33642
33686
  this.fillResult();
33643
33687
  else
33644
33688
  this.removeInterval(this.getTopField().getResultInterval());
@@ -33646,55 +33690,48 @@ class FieldCodeParserHyperlink extends FieldCodeParserClientUpdatingBase {
33646
33690
  return true;
33647
33691
  }
33648
33692
  fillResult() {
33649
- var field = this.getTopField();
33650
- var text = this.parameterInfoList[0] ? this.parameterInfoList[0].text : "";
33651
- var newHyperlinkInfo = this.updateHyperlinkInfo(field, text);
33693
+ var _a, _b;
33694
+ const field = this.getTopField();
33695
+ const text = (_b = (_a = this.parameterInfoList[0]) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : "";
33696
+ const newHyperlinkInfo = this.updateHyperlinkInfo(text);
33652
33697
  if (!newHyperlinkInfo) {
33653
- if (!this.modelManager.richOptions.fields.keepHyperlinkResultForInvalidReference)
33698
+ if (!this.modelManager.richOptions.fields.keepHyperlinkResultForInvalidReference) {
33654
33699
  this.removeInterval(this.getTopField().getResultInterval());
33700
+ }
33655
33701
  return true;
33656
33702
  }
33657
- var modelManipulator = this.modelManager.modelManipulator;
33658
- var resultInterval = field.getResultInterval();
33659
- if (resultInterval.length == 0) {
33660
- var resultText = text.length > 0 ? text : "#" + newHyperlinkInfo.anchor;
33661
- var newResultInterval = new fixed.FixedInterval(resultInterval.start, resultText.length);
33703
+ const modelManipulator = this.modelManager.modelManipulator;
33704
+ const resultInterval = field.getResultInterval();
33705
+ if (resultInterval.length === 0) {
33706
+ const resultText = text !== null && text !== void 0 ? text : "#" + newHyperlinkInfo.anchor;
33707
+ const newResultInterval = new fixed.FixedInterval(resultInterval.start, resultText.length);
33662
33708
  this.setInputPositionState();
33663
33709
  this.replaceTextByInterval(resultInterval, resultText);
33664
- this.modelManager.history.addAndRedo(new ApplyFieldHyperlinkStyleHistoryItem(modelManipulator, new SubDocumentInterval(this.subDocument, newResultInterval)));
33710
+ const subDocumentInterval = new SubDocumentInterval(this.subDocument, newResultInterval);
33711
+ const historyItem = new ApplyFieldHyperlinkStyleHistoryItem(modelManipulator, subDocumentInterval);
33712
+ this.modelManager.history.addAndRedo(historyItem);
33665
33713
  }
33666
- this.modelManager.history.addAndRedo(new ChangeFieldHyperlinkInfoHistoryItem(modelManipulator, this.subDocument, field.index, newHyperlinkInfo));
33714
+ const historyItem = new ChangeFieldHyperlinkInfoHistoryItem(modelManipulator, this.subDocument, field.index, newHyperlinkInfo);
33715
+ this.modelManager.history.addAndRedo(historyItem);
33667
33716
  return true;
33668
33717
  }
33669
- updateHyperlinkInfo(field, text) {
33670
- var newHyperlinkInfo = field.isHyperlinkField() ? field.getHyperlinkInfo().clone() : new HyperlinkInfo("", "", "", false);
33718
+ updateHyperlinkInfo(text) {
33719
+ const newHyperlinkInfo = new HyperlinkInfo("", "", "", false);
33720
+ [newHyperlinkInfo.uri, newHyperlinkInfo.anchor] = utils/* UrlUtils */.jE.splitUrlByAnchor(text);
33671
33721
  newHyperlinkInfo.visited = false;
33672
- var tipSwitch;
33673
- var bookmarkSwitch;
33674
- for (var i = 0, switchInfo; switchInfo = this.switchInfoList[i]; i++)
33675
- if (switchInfo.type == FieldSwitchType.FieldSpecific) {
33676
- switch (switchInfo.name.toLocaleUpperCase()) {
33677
- case "O":
33678
- tipSwitch = switchInfo;
33679
- break;
33680
- case "L":
33681
- bookmarkSwitch = switchInfo;
33682
- break;
33683
- }
33722
+ for (const switchInfo of this.switchInfoList) {
33723
+ if (switchInfo.type != FieldSwitchType.FieldSpecific)
33724
+ continue;
33725
+ switch (switchInfo.name.toLocaleUpperCase()) {
33726
+ case "O":
33727
+ newHyperlinkInfo.tip = switchInfo.arg;
33728
+ break;
33729
+ case "L":
33730
+ newHyperlinkInfo.anchor = switchInfo.arg;
33731
+ break;
33684
33732
  }
33685
- newHyperlinkInfo.tip = tipSwitch ? tipSwitch.arg : "";
33686
- var splitted = text.split("#");
33687
- if (splitted.length == 1) {
33688
- newHyperlinkInfo.uri = splitted[0];
33689
- newHyperlinkInfo.anchor = bookmarkSwitch ? bookmarkSwitch.arg : "";
33690
- if (newHyperlinkInfo.uri == "" && newHyperlinkInfo.anchor == "")
33691
- return null;
33692
- }
33693
- else {
33694
- newHyperlinkInfo.uri = splitted[0];
33695
- newHyperlinkInfo.anchor = splitted[1];
33696
33733
  }
33697
- return newHyperlinkInfo;
33734
+ return newHyperlinkInfo.isValid() ? newHyperlinkInfo : null;
33698
33735
  }
33699
33736
  }
33700
33737
 
@@ -33726,7 +33763,7 @@ class FieldCodeParserMailMerge extends FieldCodeParserDocVariable {
33726
33763
  }
33727
33764
  getMergeFieldName() {
33728
33765
  if (this.parameterInfoList.length == 0)
33729
- this.parseSwitchesAndArgs(true);
33766
+ this.parseSwitchesAndArgs();
33730
33767
  return this.parameterInfoList[0] ? this.parameterInfoList[0].text : '';
33731
33768
  }
33732
33769
  applyResponse(response) {
@@ -36275,6 +36312,146 @@ class FieldCodeParserFillIn extends FieldCodeParserClientUpdatingBase {
36275
36312
  }
36276
36313
  }
36277
36314
 
36315
+ ;// CONCATENATED MODULE: ./src/common/model/fields/parsers/field-code-parser-if.ts
36316
+
36317
+
36318
+ class FieldCodeParserIf extends FieldCodeParserClientUpdatingBase {
36319
+ get name() { return FieldName.If; }
36320
+ fillResult() {
36321
+ this.setInputPositionState();
36322
+ let result = null;
36323
+ try {
36324
+ const expression = this.parseParameters(this.parameterInfoList);
36325
+ result = expression.evaluate();
36326
+ }
36327
+ catch (err) {
36328
+ if (err instanceof IfExpressionError) {
36329
+ result = err.message;
36330
+ }
36331
+ }
36332
+ finally {
36333
+ if (result) {
36334
+ this.replaceTextByInterval(this.getTopField().getResultInterval(), result);
36335
+ }
36336
+ return true;
36337
+ }
36338
+ }
36339
+ parseParameters(parameters) {
36340
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
36341
+ if (parameters.length > 5)
36342
+ throw new IfExpressionTooManyParametersError();
36343
+ if (parameters.length === 0)
36344
+ throw new IfExpressionMissingParametersError();
36345
+ let leftExpression;
36346
+ let operator;
36347
+ let rightExpression;
36348
+ let trueText;
36349
+ let falseText;
36350
+ if (parameters.length <= 3 && !IfExpression.isOperator((_a = parameters[1]) === null || _a === void 0 ? void 0 : _a.text)) {
36351
+ leftExpression = new IfExpressionParameter((_b = parameters[0]) === null || _b === void 0 ? void 0 : _b.text, (_c = parameters[0]) === null || _c === void 0 ? void 0 : _c.quoted);
36352
+ trueText = (_d = parameters[1]) === null || _d === void 0 ? void 0 : _d.text;
36353
+ falseText = (_e = parameters[2]) === null || _e === void 0 ? void 0 : _e.text;
36354
+ }
36355
+ else {
36356
+ leftExpression = new IfExpressionParameter((_f = parameters[0]) === null || _f === void 0 ? void 0 : _f.text, (_g = parameters[0]) === null || _g === void 0 ? void 0 : _g.quoted);
36357
+ operator = (_h = parameters[1]) === null || _h === void 0 ? void 0 : _h.text;
36358
+ rightExpression = new IfExpressionParameter((_j = parameters[2]) === null || _j === void 0 ? void 0 : _j.text, (_k = parameters[2]) === null || _k === void 0 ? void 0 : _k.quoted);
36359
+ trueText = (_l = parameters[3]) === null || _l === void 0 ? void 0 : _l.text;
36360
+ falseText = (_m = parameters[4]) === null || _m === void 0 ? void 0 : _m.text;
36361
+ }
36362
+ return new IfExpression(operator, leftExpression, rightExpression, trueText, falseText);
36363
+ }
36364
+ }
36365
+ class IfExpression {
36366
+ constructor(operator, leftExpression, rightExpression, trueText = undefined, falseText = undefined) {
36367
+ this.operator = operator;
36368
+ this.leftExpression = leftExpression;
36369
+ this.rightExpression = rightExpression;
36370
+ this.trueText = trueText;
36371
+ this.falseText = falseText;
36372
+ }
36373
+ static isOperator(operator) {
36374
+ return IfExpression.operators.includes(operator);
36375
+ }
36376
+ evaluate() {
36377
+ if (!this.operator && !this.leftExpression.isNumber) {
36378
+ return this.leftExpression.text ? this.trueText : this.falseText;
36379
+ }
36380
+ if (!IfExpression.isOperator(this.operator)) {
36381
+ throw new IfExpressionInvalidOperatorError();
36382
+ }
36383
+ let difference;
36384
+ if (this.leftExpression.isNumber && this.rightExpression.isNumber) {
36385
+ difference = this.leftExpression.number - this.rightExpression.number;
36386
+ }
36387
+ else {
36388
+ const isEqualityOperator = this.operator === "=" || this.operator === "<>";
36389
+ const compareFunction = isEqualityOperator ? IfExpression.compareStringsWithWildcards : IfExpression.compareStrings;
36390
+ difference = compareFunction(this.leftExpression.text, this.rightExpression.text);
36391
+ }
36392
+ return this.evaluateComparison(difference) ? this.trueText : this.falseText;
36393
+ }
36394
+ evaluateComparison(comparisonResult) {
36395
+ switch (this.operator) {
36396
+ case "<":
36397
+ return comparisonResult < 0;
36398
+ case ">":
36399
+ return comparisonResult > 0;
36400
+ case "=":
36401
+ return comparisonResult === 0;
36402
+ case "<=":
36403
+ return comparisonResult <= 0;
36404
+ case ">=":
36405
+ return comparisonResult >= 0;
36406
+ case "<>":
36407
+ return comparisonResult != 0;
36408
+ default:
36409
+ return false;
36410
+ }
36411
+ }
36412
+ static compareStrings(leftValue, rightValue) {
36413
+ return leftValue.localeCompare(rightValue);
36414
+ }
36415
+ static compareStringsWithWildcards(leftValue, rightValue) {
36416
+ const escapedPattern = rightValue.replace(/[.+^${}()|[\]\\]/g, "\\$&");
36417
+ const regexPattern = escapedPattern.replace(/\*/g, '.*').replace(/\?/g, '.');
36418
+ const regex = new RegExp(`^${regexPattern}$`);
36419
+ return regex.test(leftValue) ? 0 : 1;
36420
+ }
36421
+ }
36422
+ IfExpression.operators = ["<", ">", "=", "<=", ">=", "<>"];
36423
+ class IfExpressionParameter {
36424
+ constructor(text, isQuoted = false) {
36425
+ this.text = text;
36426
+ this.number = parseFloat(text);
36427
+ this.isNumber = !isQuoted && !Number.isNaN(this.number);
36428
+ }
36429
+ }
36430
+ class IfExpressionError extends Error {
36431
+ constructor(message) {
36432
+ super(message);
36433
+ Object.setPrototypeOf(this, IfExpressionError.prototype);
36434
+ }
36435
+ }
36436
+ class IfExpressionInvalidOperatorError extends IfExpressionError {
36437
+ constructor(message) {
36438
+ super(message !== null && message !== void 0 ? message : "IF field error: Invalid comparison operator");
36439
+ Object.setPrototypeOf(this, IfExpressionInvalidOperatorError.prototype);
36440
+ }
36441
+ }
36442
+ class IfExpressionTooManyParametersError extends IfExpressionError {
36443
+ constructor(message) {
36444
+ super(message !== null && message !== void 0 ? message : "IF field error: Too many parameters");
36445
+ Object.setPrototypeOf(this, IfExpressionTooManyParametersError.prototype);
36446
+ }
36447
+ }
36448
+ class IfExpressionMissingParametersError extends IfExpressionError {
36449
+ constructor(message) {
36450
+ super(message !== null && message !== void 0 ? message : "IF field error: Missing parameter(s)");
36451
+ Object.setPrototypeOf(this, IfExpressionMissingParametersError.prototype);
36452
+ }
36453
+ }
36454
+
36278
36455
  ;// CONCATENATED MODULE: ./src/common/model/fields/tree-creator.ts
36279
36456
 
36280
36457
 
@@ -36295,6 +36472,7 @@ class FieldCodeParserFillIn extends FieldCodeParserClientUpdatingBase {
36295
36472
 
36296
36473
 
36297
36474
 
36475
+
36298
36476
 
36299
36477
  class FieldParsersAndIntervals {
36300
36478
  constructor(interval) {
@@ -36460,6 +36638,7 @@ class FieldsWaitingForUpdate {
36460
36638
  }
36461
36639
  FieldsWaitingForUpdate.TOC_NAME = "TOC";
36462
36640
  FieldsWaitingForUpdate.parsersMap = {
36641
+ ["IF"]: (args) => new FieldCodeParserIf(args),
36463
36642
  ["DATE"]: (args) => new FieldCodeParserDate(args),
36464
36643
  ["TIME"]: (args) => new FieldCodeParserTime(args),
36465
36644
  ["DOCVARIABLE"]: (args) => new FieldCodeParserDocVariable(args),
@@ -40880,6 +41059,7 @@ class InsertAnchoredTextBoxHistoryItem extends PositionBasedHistoryItem {
40880
41059
  }
40881
41060
  redo() {
40882
41061
  this.modelManipulator.textBox.insertAnchoredTextBox(this.subDocPos, this.charPropsBundle, this.textBoxInfo);
41062
+ this.modelManipulator.model.subDocumentsCollection.restore(this.textBoxInfo.innerSubDocument.id);
40883
41063
  }
40884
41064
  undo() {
40885
41065
  this.modelManipulator.range.removeIntervalWithoutHistory(this.boundSubDocument, new fixed.FixedInterval(this.position, 1), false);
@@ -40998,7 +41178,7 @@ class BaseTextBoxInfo {
40998
41178
  }
40999
41179
  }
41000
41180
  class TextBoxManipulator extends RunsBaseManipulator {
41001
- insertAnchoredTextBoxViaHistoty(subDocPos, charPropsBundle, textBoxInfo) {
41181
+ insertAnchoredTextBoxViaHistory(subDocPos, charPropsBundle, textBoxInfo) {
41002
41182
  this.history.addAndRedo(new InsertAnchoredTextBoxHistoryItem(this.modelManipulator, subDocPos, charPropsBundle, textBoxInfo));
41003
41183
  }
41004
41184
  insertAnchoredTextBox(subDocPos, charPropsBundle, textBoxInfo) {
@@ -41015,6 +41195,7 @@ class TextBoxManipulator extends RunsBaseManipulator {
41015
41195
  let textBoxSubDoc = textBoxInfo.innerSubDocument ?
41016
41196
  textBoxInfo.innerSubDocument :
41017
41197
  this.model.createSubDocument(SubDocumentInfoType.TextBox, subDocument.id);
41198
+ textBoxInfo.innerSubDocument = textBoxSubDoc;
41018
41199
  textBoxRun.subDocId = textBoxSubDoc.id;
41019
41200
  subDocument.chunks[insertedRun.chunkIndex].textRuns[insertedRun.runIndex].paragraph.length++;
41020
41201
  this.modelManipulator.notifyModelChanged(new AnchoredTextBoxInsertedSubDocumentChange(subDocument.id, textBoxRun.anchoredObjectID, textBoxRun.subDocId, insertPositionAtStartDocument, textBoxInfo.anchorInfo, textBoxRun.containerProperties));
@@ -41127,6 +41308,7 @@ class SubDocumentInserter {
41127
41308
  this.collectTables();
41128
41309
  this.collectFields();
41129
41310
  this.collectBookmarks();
41311
+ this.collectRangePermission();
41130
41312
  if (this.options.overlapTableCellContent) {
41131
41313
  const lastInsertedParagraph = this.targetSubDocument.getParagraphByPosition(this.currInsertSubDocumentPosition.position - 1);
41132
41314
  const nextParagraph = this.targetSubDocument.getParagraphByPosition(this.currInsertSubDocumentPosition.position);
@@ -41235,6 +41417,9 @@ class SubDocumentInserter {
41235
41417
  collectBookmarks() {
41236
41418
  this.targetModelManipulator.bookmark.insertBookmarksFromSubDocument(this.sourceSubDocument, this.targetSubDocument, this.sourceInterval, this.modelsConstOffset);
41237
41419
  }
41420
+ collectRangePermission() {
41421
+ this.targetModelManipulator.rangePermission.insertRangePermissionsFromSubDocument(this.sourceSubDocument, this.targetSubDocument, this.sourceInterval, this.modelsConstOffset);
41422
+ }
41238
41423
  prependTableByParagraph() {
41239
41424
  if (this.options.insertParagraphMarkBeforeIfStartsWithTable) {
41240
41425
  const tbl = Table.getTableByPosition(this.sourceSubDocument.tables, this.sourceInterval.start, false);
@@ -45505,6 +45690,7 @@ class NonVisualDrawingObjectInfoManipulator extends BaseManipulator {
45505
45690
 
45506
45691
 
45507
45692
 
45693
+
45508
45694
  class RangePermissionManipulator extends BaseManipulator {
45509
45695
  createRangePermission(subDocument, permissionTemplate) {
45510
45696
  subDocument.rangePermissions.push(new RangePermission(subDocument.positionManager, permissionTemplate.interval, permissionTemplate.userName, permissionTemplate.group));
@@ -45517,6 +45703,40 @@ class RangePermissionManipulator extends BaseManipulator {
45517
45703
  subDocument.filterRangePermissions(this.modelManipulator.modelManager.richOptions.documentProtection);
45518
45704
  this.modelManipulator.notifyModelChanged(new RangePermissionsChangedSubDocumentChange(subDocument.id, permissionTemplate));
45519
45705
  }
45706
+ insertRangePermissionsFromSubDocument(fromSubDocument, toSubDocument, fromInterval, modelsConstOffset) {
45707
+ const rangePermissions = fromSubDocument.rangePermissions;
45708
+ let ind = search.SearchUtils.normedInterpolationIndexOf(rangePermissions, (b) => b.start, fromInterval.start);
45709
+ while (rangePermissions[ind] && rangePermissions[ind].start >= fromInterval.start)
45710
+ ind--;
45711
+ ind = Math.max(0, ind);
45712
+ for (let rpm; (rpm = rangePermissions[ind]) && rpm.start <= fromInterval.end; ind++) {
45713
+ if (fromInterval.containsInterval(rpm.interval)) {
45714
+ const template = rpm.constRangePermission;
45715
+ template.interval.start += modelsConstOffset;
45716
+ template.interval.end += modelsConstOffset + 1;
45717
+ this.createRangePermission(toSubDocument, template);
45718
+ }
45719
+ }
45720
+ toSubDocument.rangePermissions = toSubDocument.rangePermissions.sort(ConstRangePermission.comparer);
45721
+ }
45722
+ deleteRangePermissions(subDocument, interval) {
45723
+ const rangePermissions = subDocument.rangePermissions;
45724
+ const result = [];
45725
+ let ind = search.SearchUtils.normedInterpolationIndexOf(rangePermissions, (b) => b.start, interval.start);
45726
+ while (rangePermissions[ind] && rangePermissions[ind].start >= interval.start)
45727
+ ind--;
45728
+ ind = Math.max(0, ind);
45729
+ for (let curr; (curr = rangePermissions[ind]) && curr.interval.start <= interval.end;) {
45730
+ if (interval.containsInterval(curr.interval)) {
45731
+ const tmpl = curr.constRangePermission;
45732
+ this.deleteRangePermission(subDocument, tmpl, ind);
45733
+ result.push(tmpl);
45734
+ }
45735
+ else
45736
+ ind++;
45737
+ }
45738
+ return result;
45739
+ }
45520
45740
  }
45521
45741
 
45522
45742
  ;// CONCATENATED MODULE: ./src/common/model/character/history-runs.ts
@@ -45650,6 +45870,7 @@ class RemoveIntervalOperation {
45650
45870
  this.cellsIterator = new SelectedCellsIterator(this.subDocument, interval);
45651
45871
  const result = new RemoveIntervalOperationResult(this.cellsIterator);
45652
45872
  result.bookmarkItems = this.modelManipulator.bookmark.deleteBookmarks(this.subDocument, interval);
45873
+ result.rangePermssionsItems = this.modelManipulator.rangePermission.deleteRangePermissions(this.subDocument, interval);
45653
45874
  if (this.tryPackSelectionInOneRun(interval, result))
45654
45875
  return result;
45655
45876
  var iterator = this.subDocument.getRunIterator(interval);
@@ -45680,8 +45901,14 @@ class RemoveIntervalOperation {
45680
45901
  var accumulatedInterval = new fixed.FixedInterval(this.position, 0);
45681
45902
  let removedTextList = [];
45682
45903
  while (iterator.moveNext()) {
45683
- if (utils_enum/* EnumUtils */.Y.isAnyOf(iterator.currentRun.getType(), RunType.AnchoredPictureRun, RunType.AnchoredTextBoxRun))
45684
- this.modelManipulator.notifyModelChanged(new AnchorObjectRemovedSubDocumentChange(this.subDocument.id, (iterator.currentRun).anchoredObjectID, iterator.currentInterval().start));
45904
+ if (utils_enum/* EnumUtils */.Y.isAnyOf(iterator.currentRun.getType(), RunType.AnchoredPictureRun, RunType.AnchoredTextBoxRun)) {
45905
+ const currentRun = iterator.currentRun;
45906
+ const position = iterator.currentInterval().start;
45907
+ const change = new AnchorObjectRemovedSubDocumentChange(this.subDocument.id, currentRun.anchoredObjectID, position);
45908
+ if (currentRun instanceof AnchoredTextBoxRun)
45909
+ this.modelManipulator.model.subDocumentsCollection.replace(currentRun.subDocId, subDocument.id);
45910
+ this.modelManipulator.notifyModelChanged(change);
45911
+ }
45685
45912
  if (iterator.currentChunk !== subDocument.chunks[this.currentChunkIndex]) {
45686
45913
  this.removeAccumulatedInterval(accumulatedInterval, this.position, 0, removedTextList);
45687
45914
  this.currentChunkIndex++;
@@ -45975,6 +46202,7 @@ class RemoveIntervalOperationResult {
45975
46202
  this.historyRuns = [];
45976
46203
  this.nestingLevels = [];
45977
46204
  this.bookmarkItems = [];
46205
+ this.rangePermssionsItems = [];
45978
46206
  this.cellsIterator = cellsIterator;
45979
46207
  }
45980
46208
  registerItem(historyRun) {
@@ -48031,7 +48259,7 @@ class TextManipulator extends RunsBaseManipulator {
48031
48259
  return null;
48032
48260
  const historyItems = history.historyItems;
48033
48261
  const result = history.currentIndex == historyItems.length - 1 ? this.getLastHistoryItemNode(historyItems, null, checkType) : null;
48034
- return !result.empty ? result : null;
48262
+ return (result === null || result === void 0 ? void 0 : result.empty) ? null : result;
48035
48263
  }
48036
48264
  getLastHistoryItemNode(historyItems, parent, checkType) {
48037
48265
  for (let ind = historyItems.length - 1, item; item = historyItems[ind]; ind--) {
@@ -68666,9 +68894,7 @@ class HtmlListTagImporterBase extends HtmlTagImporterBase {
68666
68894
  this.importer.addCurrLevelParagraphRunIfNeeded();
68667
68895
  const listIndex = this.importer.listIndex;
68668
68896
  const parentList = utils_list.ListUtils.last(this.importer.listInfos);
68669
- const listLevel = parentList
68670
- ? parentList.listLevel + 1
68671
- : 0;
68897
+ const listLevel = parentList ? parentList.listLevel + 1 : 0;
68672
68898
  if (listLevel === 9) {
68673
68899
  this._ignored = true;
68674
68900
  return;
@@ -68684,7 +68910,9 @@ class HtmlListTagImporterBase extends HtmlTagImporterBase {
68684
68910
  if (this._ignored)
68685
68911
  return;
68686
68912
  this.importer.listInfos.pop();
68687
- this.importer.listIndex++;
68913
+ const parentList = utils_list.ListUtils.last(this.importer.listInfos);
68914
+ if (!parentList)
68915
+ this.importer.listIndex++;
68688
68916
  }
68689
68917
  }
68690
68918
 
@@ -69158,8 +69386,6 @@ class HtmlThTagImporter extends HtmlTdTagImporter {
69158
69386
  }
69159
69387
  }
69160
69388
 
69161
- // EXTERNAL MODULE: ./src/common/utils/utils.ts
69162
- var utils = __webpack_require__(5929);
69163
69389
  ;// CONCATENATED MODULE: ./src/common/formats/html/import/importers/text-node.ts
69164
69390
 
69165
69391
 
@@ -69889,7 +70115,7 @@ class HtmlImporter {
69889
70115
  const missTag = HtmlImporter.MapMissTablePropertiesByTagNames[utils_list.ListUtils.last(this.levelInfo).tagImporter.elementTag()];
69890
70116
  utils_list.ListUtils.forEach(this.currElementChildren, (childElement) => {
69891
70117
  const childElemStyle = this.getStyles(childElement);
69892
- if (!Object.keys(childElemStyle).length)
70118
+ if (childElement.nodeType !== Node.ELEMENT_NODE)
69893
70119
  return;
69894
70120
  for (var prop in this.getStyles(element)) {
69895
70121
  if (missTag && /^(border|background|marginLeft)/gi.test(prop))
@@ -70401,6 +70627,8 @@ class HtmlBuilder {
70401
70627
 
70402
70628
 
70403
70629
 
70630
+
70631
+
70404
70632
 
70405
70633
 
70406
70634
 
@@ -70413,11 +70641,13 @@ class HtmlExporter {
70413
70641
  ;
70414
70642
  get pageIndex() { return this.exportModelOptions.pageIndex; }
70415
70643
  ;
70416
- constructor(exportModelOptions) {
70644
+ constructor(exportModelOptions, htmlExporterOptions = null) {
70417
70645
  this.rangeCopy = null;
70418
70646
  this.exportModelOptions = exportModelOptions;
70647
+ this.htmlExporterOptions = htmlExporterOptions;
70419
70648
  }
70420
70649
  getHtmlElementsByInterval(model, subDocument, interval, guidLabel) {
70650
+ var _a, _b, _c, _d;
70421
70651
  if (interval.length === 0)
70422
70652
  return;
70423
70653
  const unitTypeToString = this.unitConverter.getUnits() == RichEditUnit.Centimeter ? "cm" : "in";
@@ -70717,7 +70947,18 @@ class HtmlExporter {
70717
70947
  break;
70718
70948
  }
70719
70949
  if (hyperlinkInfo && !isInsideHyperlink) {
70720
- const url = hyperlinkInfo.uri + (hyperlinkInfo.anchor != "" ? "#" + hyperlinkInfo.anchor : "");
70950
+ const sanitaizeHyperlinkURIs = (_b = (_a = this.htmlExporterOptions) === null || _a === void 0 ? void 0 : _a.sanitaizeHyperlinkURIs) !== null && _b !== void 0 ? _b : false;
70951
+ const convertRelativeURIsToAbsolute = (_d = (_c = this.htmlExporterOptions) === null || _c === void 0 ? void 0 : _c.convertRelativeURIsToAbsolute) !== null && _d !== void 0 ? _d : false;
70952
+ let url = hyperlinkInfo.uri;
70953
+ const options = (0,utils/* createUrlValidationOptions */.EW)(this.exportModelOptions.modelManager);
70954
+ if (!sanitaizeHyperlinkURIs || utils/* UrlUtils */.jE.isValid(url, options)) {
70955
+ if (convertRelativeURIsToAbsolute && utils/* UrlUtils */.jE.isRelative(url))
70956
+ url = utils/* UrlUtils */.jE.convertToAbsolute(url).href;
70957
+ if (hyperlinkInfo.anchor != "")
70958
+ url = url + "#" + hyperlinkInfo.anchor;
70959
+ }
70960
+ else
70961
+ url = utils/* UrlUtils */.jE.EmptyPage;
70721
70962
  const tooltip = hyperlinkInfo.tip;
70722
70963
  html
70723
70964
  .clear()
@@ -70835,42 +71076,27 @@ class HtmlExporter {
70835
71076
  }
70836
71077
  getListsByParagraphs(paragraphs) {
70837
71078
  const listsInInterval = [];
71079
+ let previousList = null;
70838
71080
  for (let i = 0, paragraph; paragraph = paragraphs[i]; i++) {
70839
71081
  if (paragraph.isInList()) {
70840
- const paragraphNumberingListIndex = paragraph.getNumberingListIndex();
70841
- const paragraphListLevelIndex = paragraph.getListLevelIndex();
70842
- const paragraphStart = paragraph.startLogPosition.value;
70843
- const paragraphEnd = paragraph.getEndPosition();
70844
- let existingItem = null;
70845
- for (let j = 0; j < listsInInterval.length; j++) {
70846
- if (listsInInterval[j].numberingListIndex === paragraphNumberingListIndex
70847
- && listsInInterval[j].listLevelIndex === paragraphListLevelIndex) {
70848
- existingItem = listsInInterval[j];
70849
- }
70850
- }
70851
- if (existingItem && (paragraphListLevelIndex === 0 || existingItem.end == paragraphStart
70852
- || listsInInterval[listsInInterval.length - 1].listLevelIndex > paragraphListLevelIndex)) {
70853
- existingItem.end = paragraphEnd;
70854
- }
70855
- else {
70856
- listsInInterval.push({
70857
- numberingListIndex: paragraphNumberingListIndex,
70858
- listLevelIndex: paragraphListLevelIndex,
70859
- start: paragraphStart,
70860
- end: paragraphEnd,
70861
- });
70862
- }
70863
- let listLevelIndex = paragraphListLevelIndex;
70864
- while (listLevelIndex > 0) {
70865
- let parentItem = null;
70866
- for (let j = 0; j < listsInInterval.length; j++) {
70867
- if (listsInInterval[j].listLevelIndex == listLevelIndex - 1)
70868
- parentItem = listsInInterval[j];
70869
- }
70870
- if (parentItem)
70871
- parentItem.end = paragraphEnd;
70872
- listLevelIndex--;
71082
+ const numberingListIndex = paragraph.getNumberingListIndex();
71083
+ const listLevelIndex = paragraph.getListLevelIndex();
71084
+ const start = paragraph.startLogPosition.value;
71085
+ const end = paragraph.getEndPosition();
71086
+ let list = utils_list.ListUtils.reverseElementBy(listsInInterval, (list) => {
71087
+ return list.listLevelIndex <= (previousList === null || previousList === void 0 ? void 0 : previousList.listLevelIndex)
71088
+ && list.numberingListIndex === numberingListIndex
71089
+ && list.listLevelIndex === listLevelIndex;
71090
+ });
71091
+ if (!list) {
71092
+ const parentList = (previousList === null || previousList === void 0 ? void 0 : previousList.numberingListIndex) === numberingListIndex ? previousList : null;
71093
+ list = { parentList, numberingListIndex, listLevelIndex, start, end };
71094
+ listsInInterval.push(list);
70873
71095
  }
71096
+ previousList = list;
71097
+ do {
71098
+ list.end = end;
71099
+ } while (list = list.parentList);
70874
71100
  }
70875
71101
  }
70876
71102
  return listsInInterval;
@@ -71315,7 +71541,7 @@ class HyperlinkCollection extends Collection {
71315
71541
  subDocument.insertText(field.getCodeInterval().start, HyperlinkInfo.getNewCodeText(info));
71316
71542
  if (canChangeHyperlinkDisplayText && hyperlinkInfo.text || field.getResultInterval().length == 0) {
71317
71543
  subDocument.deleteText(convertToIntervalApi(field.getResultInterval()));
71318
- subDocument.insertText(field.getResultInterval().start, !hyperlinkInfo.text || hyperlinkInfo.text == "" ? info.getUriPlusAnchor() : hyperlinkInfo.text);
71544
+ subDocument.insertText(field.getResultInterval().start, !hyperlinkInfo.text || hyperlinkInfo.text == "" ? info.getUriWithAnchor() : hyperlinkInfo.text);
71319
71545
  }
71320
71546
  this._processor.modelManager.history.addAndRedo(new ApplyFieldHyperlinkStyleHistoryItem(this._processor.modelManager.modelManipulator, new SubDocumentInterval(this._subDocument, field.getResultInterval())));
71321
71547
  this._processor.modelManager.history.endTransaction();
@@ -72774,8 +73000,9 @@ class Selection extends batch_updatable/* BatchUpdatableObject */.IS {
72774
73000
  this.resetInputPositionIfNeeded();
72775
73001
  }
72776
73002
  shouldResetInputPosition() {
73003
+ var _a;
72777
73004
  const currentState = this.getState();
72778
- return currentState.intervalsInfo.subDocument.id != this.prevState.intervalsInfo.subDocument.id ||
73005
+ return currentState.intervalsInfo.subDocument.id != ((_a = this.prevState.intervalsInfo.subDocument) === null || _a === void 0 ? void 0 : _a.id) ||
72779
73006
  !utils_list.ListUtils.equals(currentState.intervalsInfo.intervals, this.prevState.intervalsInfo.intervals);
72780
73007
  }
72781
73008
  resetInputPositionIfNeeded() {
@@ -72813,7 +73040,7 @@ class AnchorObjectsPositionInfo {
72813
73040
  }
72814
73041
  add(obj, modelPosition) {
72815
73042
  this.delete(obj.objectId);
72816
- this.cache[obj.objectId] = new ModelPositionHolder(modelPosition, this.model.subDocuments[obj.belongsToSubDocId].positionManager);
73043
+ this.cache[obj.objectId] = new ModelPositionHolder(modelPosition, this.model.subDocumentsCollection.collection[obj.belongsToSubDocId].positionManager);
72817
73044
  }
72818
73045
  delete(id) {
72819
73046
  const info = this.cache[id];
@@ -74932,9 +75159,10 @@ class StyleManager {
74932
75159
  string.StringMapUtils.forEach(this.info, (info) => action(info));
74933
75160
  }
74934
75161
  addStyle(dest) {
75162
+ var _a;
74935
75163
  if (this.currInfo.isDefault && !this.isDefaultProcessed) {
74936
75164
  this.isDefaultProcessed = true;
74937
- if (this.defaultStyle.styleName === this.currInfo.name)
75165
+ if (((_a = this.defaultStyle) === null || _a === void 0 ? void 0 : _a.styleName) === this.currInfo.name)
74938
75166
  this.applyProperties(dest, this.defaultStyle);
74939
75167
  else
74940
75168
  this.defaultStyle = this.addToModel(this.applyProperties(dest, this.createEmpty()));
@@ -77737,7 +77965,7 @@ class OpenXmlColorImportHelper {
77737
77965
  if (themeValue != ThemeColorValues.None) {
77738
77966
  const themeColorIndex = ThemeColorIndexCalculator.calculateThemeColorIndex(themeValue);
77739
77967
  return themeColorIndex != ThemeColorIndexConstants.None ?
77740
- color_model_info_ColorModelInfo.makeByThemeColorIndex(themeColorIndex, OpenXmlColorImportHelper.getTint(data, reader, 'themeTint', 'themeShade')) :
77968
+ color_model_info_ColorModelInfo.makeByThemeColorIndex(themeColorIndex, OpenXmlColorImportHelper.getTint(data, reader, 'themeTint', 'themeShade'), themeValue) :
77741
77969
  color_model_info_ColorModelInfo.makeByThemeColorIndex(DXColor.empty);
77742
77970
  }
77743
77971
  else {
@@ -77768,7 +77996,7 @@ class OpenXmlColorImportHelper {
77768
77996
  if (themeValue != ThemeColorValues.None) {
77769
77997
  const themeColorIndex = ThemeColorIndexCalculator.calculateThemeColorIndex(themeValue);
77770
77998
  if (themeColorIndex != ThemeColorIndexConstants.None)
77771
- return color_model_info_ColorModelInfo.makeByThemeColorIndex(themeColorIndex, tint);
77999
+ return color_model_info_ColorModelInfo.makeByThemeColorIndex(themeColorIndex, tint, themeValue);
77772
78000
  }
77773
78001
  return color_model_info_ColorModelInfo.makeByColor(data.readerHelper.getWpSTColorValue(reader, 'fill', DXColor.empty), tint);
77774
78002
  }
@@ -88432,6 +88660,7 @@ var RichEditClientCommand;
88432
88660
  RichEditClientCommand[RichEditClientCommand["FloatingObjectSendBackwardMenu"] = 456] = "FloatingObjectSendBackwardMenu";
88433
88661
  RichEditClientCommand[RichEditClientCommand["NoSpellingSuggestions"] = 457] = "NoSpellingSuggestions";
88434
88662
  RichEditClientCommand[RichEditClientCommand["GetHtml"] = 458] = "GetHtml";
88663
+ RichEditClientCommand[RichEditClientCommand["CreateEmptyIfField"] = 459] = "CreateEmptyIfField";
88435
88664
  })(RichEditClientCommand || (RichEditClientCommand = {}));
88436
88665
 
88437
88666
  ;// CONCATENATED MODULE: ./src/common/interfaces/i-rich-edit-core.ts
@@ -95911,7 +96140,7 @@ class LayoutSpaceBox extends layout_box_LayoutBox {
95911
96140
  return LayoutBoxType.Space;
95912
96141
  }
95913
96142
  pushInfoForMeasure(info, showHiddenSymbols) {
95914
- info.push(new MeasureInfoNonText("&nbsp;", this.characterProperties));
96143
+ info.push(new MeasureInfoNonText(RichUtils.specialCharacters.Space, this.characterProperties));
95915
96144
  if (showHiddenSymbols)
95916
96145
  info.push(new MeasureInfoNonText(RichUtils.specialCharacters.HiddenSpace, this.characterProperties));
95917
96146
  }
@@ -107453,7 +107682,6 @@ class SwitchTextBoxSubDocumentsStateHistoryItem extends history_item_HistoryItem
107453
107682
  this.position = position;
107454
107683
  }
107455
107684
  redo() {
107456
- this.oldSubDocument = this.oldSubDocument.getActualSubDocument();
107457
107685
  const newRun = this.textBoxParentSubDocument.getRunAndIndexesByPosition(this.position).run;
107458
107686
  this.newSubDocument = this.modelManipulator.model.subDocuments[newRun.subDocId];
107459
107687
  this.modelManipulator.model.subDocumentsCollection.replace(this.oldSubDocument.id, this.newSubDocument.id);
@@ -107672,7 +107900,7 @@ class FloatingObjectDragDropChangePositionCommand extends CommandBase {
107672
107900
  const newRun = this.activeSubDocument.getRunAndIndexesByPosition(position).run;
107673
107901
  if (newRun.getType() == RunType.AnchoredTextBoxRun) {
107674
107902
  const oldTextBoxRun = oldRun;
107675
- const originalSubDocument = this.control.modelManager.model.subDocuments[oldTextBoxRun.subDocId];
107903
+ const originalSubDocument = this.control.modelManager.model.subDocumentsCollection.collection[oldTextBoxRun.subDocId];
107676
107904
  this.history.addAndRedo(new SwitchTextBoxSubDocumentsStateHistoryItem(this.modelManipulator, originalSubDocument, this.activeSubDocument, position));
107677
107905
  }
107678
107906
  }
@@ -112611,9 +112839,16 @@ const INPUT_CLASS_NAME = "dxreInputTarget";
112611
112839
  const EMPTY_KEYCODE = 229;
112612
112840
  const TAB_KEYCODE = 9;
112613
112841
  const IDEOGRAPHIC_SPACE_CHARCODE = 12288;
112842
+ var IMEState;
112843
+ (function (IMEState) {
112844
+ IMEState[IMEState["None"] = 0] = "None";
112845
+ IMEState[IMEState["Start"] = 1] = "Start";
112846
+ IMEState[IMEState["Process"] = 2] = "Process";
112847
+ })(IMEState || (IMEState = {}));
112614
112848
  class InputEditorBase {
112615
112849
  constructor(control, eventManager, parent) {
112616
112850
  this.newLineRegexp = /(\r\n|\n|\r)/gm;
112851
+ this.IMEState = IMEState.None;
112617
112852
  this.processTextOnKeyPress = false;
112618
112853
  this.evtHandlersHolder = new event_handlers_holder/* DomEventHandlersHolder */.$();
112619
112854
  this.control = control;
@@ -112621,7 +112856,6 @@ class InputEditorBase {
112621
112856
  this.canInsertTextOnInputEvent = this.canUseInputEvent();
112622
112857
  this.createHierarchy(parent);
112623
112858
  this.initialize();
112624
- this.isIME = false;
112625
112859
  this.inputWithAlt = false;
112626
112860
  }
112627
112861
  dispose() {
@@ -112694,7 +112928,7 @@ class InputEditorBase {
112694
112928
  }
112695
112929
  onKeyDown(evt) {
112696
112930
  if (!this.control.clientSideEvents.raiseKeyDown(evt)) {
112697
- if (!this.isIME) {
112931
+ if (this.IMEState === IMEState.None) {
112698
112932
  evt = this.getNormalizedEvent(evt);
112699
112933
  const keyCode = key/* KeyUtils */.LN.getEventKeyCode(evt);
112700
112934
  this.needProcessShortcut = !keyCode || keyCode == EMPTY_KEYCODE;
@@ -112859,6 +113093,9 @@ class DivInputEditor extends InputEditorBase {
112859
113093
  dispose() {
112860
113094
  super.dispose();
112861
113095
  clearTimeout(this.clearInputTimerId);
113096
+ clearTimeout(this.composUpdateTimerId);
113097
+ clearTimeout(this.composEndTimerId);
113098
+ clearTimeout(this.onTextInputTimerId);
112862
113099
  }
112863
113100
  initializeIfNotReadOnlyCore() {
112864
113101
  this.inputElement.contentEditable = "true";
@@ -112869,14 +113106,21 @@ class DivInputEditor extends InputEditorBase {
112869
113106
  }
112870
113107
  createInputElement() {
112871
113108
  const element = document.createElement("DIV");
112872
- if (browser.Browser.Safari)
112873
- element.autocapitalize = "off";
113109
+ element.autocapitalize = "off";
112874
113110
  if (browser.Browser.MacOSMobilePlatform && (Number(browser.Browser.PlaformMajorVersion) >= 16
112875
113111
  || browser.Browser.Safari && browser.Browser.MajorVersion >= 16)) {
112876
113112
  element.classList.add('dxreiOS16');
112877
113113
  }
112878
113114
  return element;
112879
113115
  }
113116
+ initEvents() {
113117
+ super.initEvents();
113118
+ this.evtHandlersHolder.addListener(this.getEditableDocument(), "compositionstart", this.onCompositionStart.bind(this));
113119
+ this.evtHandlersHolder.addListener(this.getEditableDocument(), "compositionupdate", (evt) => browser.Browser.IE || browser.Browser.Edge ?
113120
+ this.onCompositionUpdate(evt) : this.composUpdateTimerId = setTimeout(() => this.onCompositionUpdate(evt), 0));
113121
+ this.evtHandlersHolder.addListener(this.getEditableDocument(), "compositionend", (evt) => !browser.Browser.Safari ?
113122
+ this.onCompositionEnd(evt) : this.composEndTimerId = setTimeout(() => this.onCompositionEnd(evt), 0));
113123
+ }
112880
113124
  onKeyDown(evt) {
112881
113125
  var _a;
112882
113126
  this.handled = false;
@@ -112945,21 +113189,15 @@ class DivInputEditor extends InputEditorBase {
112945
113189
  this.onTextReplace(text.substr(lastWordStartIndex), text);
112946
113190
  else
112947
113191
  super.onTextInput(data);
112948
- if (this.previousText && text.length < this.previousText.length || !text.length) {
112949
- let deletedCharacterCount = this.previousText ? this.previousText.length - text.length : 1;
112950
- for (let i = 0; i < deletedCharacterCount; i++)
112951
- this.eventManager.onShortcut(key/* KeyCode */.VD.Backspace);
112952
- this.previousText = text;
112953
- }
112954
113192
  this.cursorWasSetOnLastPosition = true;
112955
113193
  }
112956
113194
  this.handled = true;
112957
- if (browser.Browser.MacOSMobilePlatform && text[text.length - 1] == " ")
113195
+ if (text[text.length - 1] == " ")
112958
113196
  this.clearInputElement();
112959
113197
  }
112960
113198
  }
112961
113199
  tryHandleShortcutByInputString(data) {
112962
- if (data && !this.isIME) {
113200
+ if (data && this.IMEState === IMEState.None) {
112963
113201
  let enteredChar = data.charAt(data.length - 1);
112964
113202
  const keyCode = this.tryObtainCodeFromChar(enteredChar);
112965
113203
  if (keyCode != EMPTY_KEYCODE) {
@@ -113050,6 +113288,31 @@ class DivInputEditor extends InputEditorBase {
113050
113288
  selection.selectAllChildren(this.inputElement);
113051
113289
  super.selectEditableDocumentContent();
113052
113290
  }
113291
+ onCompositionStart(_evt) {
113292
+ this.IMEState = IMEState.Start;
113293
+ this.needProcessShortcut = false;
113294
+ this.clearInputElement();
113295
+ }
113296
+ onCompositionUpdate(_evt) {
113297
+ const text = this.getEditableDocumentText();
113298
+ if (text.length && this.previousText != text) {
113299
+ if (this.IMEState === IMEState.Start)
113300
+ this.onText(text, text, this.previousText.length > 0);
113301
+ else if (this.IMEState === IMEState.Process)
113302
+ this.onTextReplace(text, text);
113303
+ }
113304
+ this.IMEState = IMEState.Process;
113305
+ }
113306
+ onCompositionEnd(_evt) {
113307
+ const text = this.getEditableDocumentText();
113308
+ if (this.previousText != text) {
113309
+ if (text.length > 0)
113310
+ this.onTextReplace(text, text);
113311
+ else
113312
+ this.onShortcutCore(_evt, key/* KeyCode */.VD.Backspace);
113313
+ }
113314
+ this.IMEState = IMEState.None;
113315
+ }
113053
113316
  }
113054
113317
  class IFrameInputEditor extends InputEditorBase {
113055
113318
  constructor(control, eventManager, parent) {
@@ -113153,7 +113416,7 @@ class IFrameInputEditor extends InputEditorBase {
113153
113416
  }
113154
113417
  setEditableDocumentContent(content) {
113155
113418
  super.setEditableDocumentContent(content);
113156
- this.isIME = false;
113419
+ this.IMEState = IMEState.None;
113157
113420
  this.editableDocument.body.innerHTML = "";
113158
113421
  if (typeof content === "string")
113159
113422
  this.editableDocument.body.innerHTML = content;
@@ -113201,7 +113464,7 @@ class IFrameInputEditor extends InputEditorBase {
113201
113464
  }
113202
113465
  onBlur(evt) {
113203
113466
  super.onBlur(evt);
113204
- this.isIME = false;
113467
+ this.IMEState = IMEState.None;
113205
113468
  this.endInputIME();
113206
113469
  }
113207
113470
  onShortcutCore(evt, shortcutCode) {
@@ -113230,7 +113493,7 @@ class IFrameInputEditor extends InputEditorBase {
113230
113493
  }
113231
113494
  }
113232
113495
  onCompositionStart(_evt) {
113233
- this.isIME = true;
113496
+ this.IMEState = IMEState.Start;
113234
113497
  this.needProcessShortcut = false;
113235
113498
  if (!browser.Browser.IE && !browser.Browser.Edge)
113236
113499
  this.clearInputElement();
@@ -113238,10 +113501,11 @@ class IFrameInputEditor extends InputEditorBase {
113238
113501
  }
113239
113502
  onCompositionUpdate(_evt) {
113240
113503
  const text = this.getEditableDocumentText();
113241
- if (this.isIME && text.length && this.previousText != text) {
113504
+ if (this.IMEState !== IMEState.None && text.length && this.previousText != text) {
113242
113505
  this.onTextReplace(text, text);
113243
113506
  this.updateInputIME();
113244
113507
  }
113508
+ this.IMEState = IMEState.Process;
113245
113509
  }
113246
113510
  onCompositionEnd(_evt) {
113247
113511
  const text = this.getEditableDocumentText();
@@ -113251,7 +113515,7 @@ class IFrameInputEditor extends InputEditorBase {
113251
113515
  this.clearInputElement();
113252
113516
  if (text.charCodeAt(text.length - 1) == IDEOGRAPHIC_SPACE_CHARCODE)
113253
113517
  this.clearInputElement();
113254
- this.isIME = false;
113518
+ this.IMEState = IMEState.None;
113255
113519
  this.endInputIME();
113256
113520
  }
113257
113521
  startInputIME() {
@@ -113320,7 +113584,10 @@ class InputController {
113320
113584
  this.inputEditor = this.createInputEditor(parent, eventManager);
113321
113585
  }
113322
113586
  initExporter() {
113323
- this.exporter = new HtmlExporter(this.control.getExportModelOptions());
113587
+ this.exporter = new HtmlExporter(this.control.getExportModelOptions(), {
113588
+ sanitaizeHyperlinkURIs: true,
113589
+ convertRelativeURIsToAbsolute: true
113590
+ });
113324
113591
  }
113325
113592
  dispose() {
113326
113593
  this.inputEditor.dispose();
@@ -113385,9 +113652,8 @@ class InputController {
113385
113652
  if (typeof html === 'string')
113386
113653
  el.innerHTML = html;
113387
113654
  });
113388
- if (typeof html !== "string") {
113655
+ if (typeof html !== "string")
113389
113656
  builder.assignFrom(html);
113390
- }
113391
113657
  builder.endChild('b');
113392
113658
  builder.endChild('span');
113393
113659
  builder.endChild('a');
@@ -114533,14 +114799,14 @@ var RulerLineDisplayType;
114533
114799
  RulerLineDisplayType[RulerLineDisplayType["TableColumn"] = 1] = "TableColumn";
114534
114800
  })(RulerLineDisplayType || (RulerLineDisplayType = {}));
114535
114801
  class RulerVerticalLineControl {
114536
- constructor(canvas, settings, rulerControlElement) {
114802
+ constructor(canvas, className, rulerControlElement) {
114537
114803
  this.borderWidth = 0;
114538
114804
  this.rulerControlLeft = 0;
114539
114805
  this.rulerControlWidth = 0;
114540
114806
  this.viewElementLeft = 0;
114541
114807
  this.canvas = canvas;
114542
114808
  this.rulerControlElement = rulerControlElement;
114543
- this.rootElement = DocumentRenderer.renderContainer(settings.styles.line.className);
114809
+ this.rootElement = DocumentRenderer.renderContainer(className);
114544
114810
  this.rootElement.style.display = "block";
114545
114811
  this.borderWidth = dom.DomUtils.getHorizontalBordersWidth(this.rootElement);
114546
114812
  }
@@ -115133,17 +115399,17 @@ class RulerBaseIndentControl extends RulerBase {
115133
115399
 
115134
115400
 
115135
115401
  class RulerFirstLineIndentDragHandle extends RulerBaseIndentControl {
115136
- get heightOfProtrudingPart() { return this.modelData.settings.showLeftIndent ? this._heightOfProtrudingPart : 0; }
115402
+ get heightOfProtrudingPart() { return this.modelData.showLeftIndent ? this._heightOfProtrudingPart : 0; }
115137
115403
  getRootClassName() {
115138
- return this.modelData.settings.styles.firstLineIndentImage.spriteCssClass + " " +
115139
- this.modelData.settings.styles.firstLineIndent.className;
115404
+ return this.modelData.styles.firstLineIndentImage.spriteCssClass + " " +
115405
+ this.modelData.styles.firstLineIndent.className;
115140
115406
  }
115141
115407
  constructor(modelData, controls) {
115142
115408
  super(modelData, controls);
115143
115409
  const template = RulerTemplateManager.getFirstLineIndentElementTemplate();
115144
115410
  if (template)
115145
115411
  this.rootElement.innerHTML = template;
115146
- this.rootElement.title = this.modelData.settings.titles.firstLineIndent;
115412
+ this.rootElement.title = this.modelData.titles.firstLineIndent;
115147
115413
  this.controls.ruler.rootElement.appendChild(this.rootElement);
115148
115414
  this.adjustByTop();
115149
115415
  this.leftCorrection = Math.round(SizeUtils.getOffsetWidth(this.rootElement) / 2);
@@ -115162,7 +115428,7 @@ class RulerFirstLineIndentDragHandle extends RulerBaseIndentControl {
115162
115428
  const newViewState = this.controls.paragraphLeftPosition + this.currModelState.modelValue;
115163
115429
  if (newViewState != this.viewState) {
115164
115430
  this.viewState = newViewState;
115165
- if (this.modelData.settings.showLeftIndent)
115431
+ if (this.modelData.showLeftIndent)
115166
115432
  this.rootElement.style.left = this.viewState + RULLER_NUMBER_CORRECTION - this.leftCorrection + "px";
115167
115433
  else
115168
115434
  this.setVisible(false);
@@ -115195,12 +115461,12 @@ class RulerFirstLineIndentDragHandle extends RulerBaseIndentControl {
115195
115461
 
115196
115462
  const LEFT_INDENT_DRAG_HANDLE_BODY = RICH_EDIT_CLASS_NAME_PREFIX + "leftIndentDragHandleBody";
115197
115463
  class RulerLeftIndentDragHandle extends RulerBaseIndentControl {
115198
- get heightOfProtrudingPart() { return this.modelData.settings.showLeftIndent ? this._heightOfProtrudingPart : 0; }
115199
- getRootClassName() { return this.modelData.settings.styles.leftIndent.className; }
115464
+ get heightOfProtrudingPart() { return this.modelData.showLeftIndent ? this._heightOfProtrudingPart : 0; }
115465
+ getRootClassName() { return this.modelData.styles.leftIndent.className; }
115200
115466
  constructor(modelData, controls) {
115201
115467
  super(modelData, controls);
115202
115468
  this.isActionLeftIndent = false;
115203
- this.topElement = DocumentRenderer.renderContainer(this.modelData.settings.styles.leftIndentImage.spriteCssClass);
115469
+ this.topElement = DocumentRenderer.renderContainer(this.modelData.styles.leftIndentImage.spriteCssClass);
115204
115470
  this.bodyElement = DocumentRenderer.renderContainer(LEFT_INDENT_DRAG_HANDLE_BODY);
115205
115471
  const topElementTemplate = RulerTemplateManager.getLeftIndentTopElementTemplate();
115206
115472
  if (topElementTemplate)
@@ -115218,8 +115484,8 @@ class RulerLeftIndentDragHandle extends RulerBaseIndentControl {
115218
115484
  style.height = SizeUtils.getOffsetHeight(this.topElement) + SizeUtils.getOffsetHeight(this.bodyElement) + "px";
115219
115485
  style.width = mainElementWidth + "px";
115220
115486
  style.marginTop = this.controls.divisions.height / 2 + "px";
115221
- this.bodyElement.title = this.modelData.settings.titles.leftIndent;
115222
- this.topElement.title = this.modelData.settings.titles.hangingIndent;
115487
+ this.bodyElement.title = this.modelData.titles.leftIndent;
115488
+ this.topElement.title = this.modelData.titles.hangingIndent;
115223
115489
  this.leftCorrection = Math.round(SizeUtils.getOffsetWidth(this.rootElement) / 2);
115224
115490
  this._heightOfProtrudingPart = SizeUtils.getOffsetHeight(this.rootElement) - this.controls.divisions.height / 2;
115225
115491
  }
@@ -115236,7 +115502,7 @@ class RulerLeftIndentDragHandle extends RulerBaseIndentControl {
115236
115502
  const newViewState = this.controls.paragraphLeftPosition + this.currModelState.modelValue;
115237
115503
  if (newViewState != this.viewState) {
115238
115504
  this.viewState = newViewState;
115239
- if (this.modelData.settings.showLeftIndent)
115505
+ if (this.modelData.showLeftIndent)
115240
115506
  this.rootElement.style.left = this.viewState + RULLER_NUMBER_CORRECTION - this.leftCorrection + "px";
115241
115507
  else
115242
115508
  this.setVisible(false);
@@ -115299,15 +115565,15 @@ const RulerMinDistanceBetweenIndentsOnView = 5;
115299
115565
  class RulerRightIndentDragHandle extends RulerBaseIndentControl {
115300
115566
  get viewStateRelativeLeft() { return this.controls.ruler.pageWidth - this.viewState; }
115301
115567
  getRootClassName() {
115302
- return this.modelData.settings.styles.rightIndentImage.spriteCssClass + " " +
115303
- this.modelData.settings.styles.rightIndent.className;
115568
+ return this.modelData.styles.rightIndentImage.spriteCssClass + " " +
115569
+ this.modelData.styles.rightIndent.className;
115304
115570
  }
115305
115571
  constructor(modelData, controls) {
115306
115572
  super(modelData, controls);
115307
115573
  const template = RulerTemplateManager.getRightIndentElementTemplate();
115308
115574
  if (template)
115309
115575
  this.rootElement.innerHTML = template;
115310
- this.rootElement.title = this.modelData.settings.titles.rightIndent;
115576
+ this.rootElement.title = this.modelData.titles.rightIndent;
115311
115577
  this.controls.ruler.rootElement.appendChild(this.rootElement);
115312
115578
  this.adjustByTop();
115313
115579
  this.leftCorrection = Math.round(this.rootElement.offsetWidth / 2);
@@ -115325,7 +115591,7 @@ class RulerRightIndentDragHandle extends RulerBaseIndentControl {
115325
115591
  const newViewState = this.correctRelativeLeftIndents(this.controls.ruler.pageWidth - this.controls.paragraphRightPosition + this.currModelState.modelValue);
115326
115592
  if (newViewState != this.viewState) {
115327
115593
  this.viewState = newViewState;
115328
- if (this.modelData.settings.showRightIndent)
115594
+ if (this.modelData.showRightIndent)
115329
115595
  this.rootElement.style.right = this.viewState + RULLER_NUMBER_CORRECTION - this.leftCorrection + "px";
115330
115596
  else
115331
115597
  this.setVisible(false);
@@ -115428,7 +115694,7 @@ class RulerLeftMarginDragHandle extends RulerBaseMarginControl {
115428
115694
  this.handlePanelElement = DocumentRenderer.renderContainer(DIVISION_MARGIN_LEFT_CURSOR_CLASS_NAME);
115429
115695
  this.marginPanelElement.style.width = maxPageWidth + "px";
115430
115696
  this.handlePanelElement.style.width = maxPageWidth + "px";
115431
- this.handlePanelElement.title = this.modelData.settings.titles.marginLeft;
115697
+ this.handlePanelElement.title = this.modelData.titles.marginLeft;
115432
115698
  this.controls.ruler.rootElement.appendChild(this.marginPanelElement);
115433
115699
  this.controls.ruler.rootElement.appendChild(this.handlePanelElement);
115434
115700
  }
@@ -115472,7 +115738,7 @@ class RulerRightMarginDragHandle extends RulerBaseMarginControl {
115472
115738
  this.handlePanelElement = DocumentRenderer.renderContainer(DIVISION_MARGIN_RIGHT_CURSOR_CLASS_NAME);
115473
115739
  this.marginPanelElement.style.width = maxPageWidth + "px";
115474
115740
  this.handlePanelElement.style.width = maxPageWidth + "px";
115475
- this.handlePanelElement.title = this.modelData.settings.titles.marginRight;
115741
+ this.handlePanelElement.title = this.modelData.titles.marginRight;
115476
115742
  this.controls.ruler.rootElement.appendChild(this.marginPanelElement);
115477
115743
  this.controls.ruler.rootElement.appendChild(this.handlePanelElement);
115478
115744
  }
@@ -115509,7 +115775,7 @@ var touch = __webpack_require__(1632);
115509
115775
 
115510
115776
 
115511
115777
  class RulerControl extends RulerBase {
115512
- getRootClassName() { return this.modelData.settings.styles.control.className; }
115778
+ getRootClassName() { return this.modelData.styles.control.className; }
115513
115779
  ;
115514
115780
  get pageWidth() { return this.currPageWidth; }
115515
115781
  ;
@@ -115519,7 +115785,7 @@ class RulerControl extends RulerBase {
115519
115785
  this.initialMarginLeftElement = 0;
115520
115786
  this.currPageWidth = 0;
115521
115787
  this.prevPageWidth = 0;
115522
- this.rootElement = DocumentRenderer.renderContainer(this.modelData.settings.styles.control.className);
115788
+ this.rootElement = DocumentRenderer.renderContainer(this.modelData.styles.control.className);
115523
115789
  if (browser.Browser.MSTouchUI)
115524
115790
  dom.DomUtils.addClassName(this.rootElement, touch.TouchUtils.msTouchDraggableClassName);
115525
115791
  this.controls.wrapper.rootElement.appendChild(this.rootElement);
@@ -115586,16 +115852,16 @@ class RulerTabUtils {
115586
115852
  }
115587
115853
  return "tab" + alignString;
115588
115854
  }
115589
- static getSpriteClassName(tabAlign, settings) {
115855
+ static getSpriteClassName(tabAlign, styles) {
115590
115856
  switch (tabAlign) {
115591
115857
  case TabAlign.Left:
115592
- return settings.styles.tabImages.left.spriteCssClass;
115858
+ return styles.tabImages.left.spriteCssClass;
115593
115859
  case TabAlign.Right:
115594
- return settings.styles.tabImages.right.spriteCssClass;
115860
+ return styles.tabImages.right.spriteCssClass;
115595
115861
  case TabAlign.Center:
115596
- return settings.styles.tabImages.center.spriteCssClass;
115862
+ return styles.tabImages.center.spriteCssClass;
115597
115863
  case TabAlign.Decimal:
115598
- return settings.styles.tabImages.decimal.spriteCssClass;
115864
+ return styles.tabImages.decimal.spriteCssClass;
115599
115865
  }
115600
115866
  return "";
115601
115867
  }
@@ -115666,8 +115932,8 @@ class RulerTabsControl extends RulerMultiControl {
115666
115932
  this.deleteTab = false;
115667
115933
  }
115668
115934
  getModelState() {
115669
- this.modelData.settings.showTabs = this.modelData.commandManager.getCommand(RichEditClientCommand.InsertTabRuler).getState().enabled;
115670
- if (this.modelData.settings.showTabs) {
115935
+ this.modelData.showTabs = this.modelData.commandManager.getCommand(RichEditClientCommand.InsertTabRuler).getState().enabled;
115936
+ if (this.modelData.showTabs) {
115671
115937
  const paragraph = this.modelData.selection.activeSubDocument.getParagraphByPosition(this.modelData.selection.intervalsInfo.interval.start);
115672
115938
  const tabs = utils_list.ListUtils.map(paragraph.getTabs().positions, tab => {
115673
115939
  const newTab = tab.clone();
@@ -115811,7 +116077,7 @@ class RulerTabControl {
115811
116077
  this.shadow = null;
115812
116078
  this.controls = controls;
115813
116079
  this.modelData = modelData;
115814
- this.rootElement = DocumentRenderer.renderContainer(modelData.settings.styles.tab.className + " " + RulerTabUtils.getSpriteClassName(this.viewState.align, modelData.settings));
116080
+ this.rootElement = DocumentRenderer.renderContainer(modelData.styles.tab.className + " " + RulerTabUtils.getSpriteClassName(this.viewState.align, modelData.styles));
115815
116081
  this.applyTemplate();
115816
116082
  controls.ruler.rootElement.appendChild(this.rootElement);
115817
116083
  this.rootElement.style.marginTop = (controls.divisions.height - this.rootElement.offsetHeight) + "px";
@@ -115825,7 +116091,7 @@ class RulerTabControl {
115825
116091
  setVisible(visible) {
115826
116092
  this.rootElement.style.display = visible ? 'block' : 'none';
115827
116093
  }
115828
- canHandle(source) { return source == this.rootElement && this.modelData.settings.showTabs; }
116094
+ canHandle(source) { return source == this.rootElement && this.modelData.showTabs; }
115829
116095
  showShadow() {
115830
116096
  this.shadow = new RulerShadow(this.rootElement);
115831
116097
  }
@@ -115860,10 +116126,10 @@ class RulerTabControl {
115860
116126
  }
115861
116127
  }
115862
116128
  changeAlign() {
115863
- this.rootElement.className = this.modelData.settings.styles.tab.className + " " +
115864
- RulerTabUtils.getSpriteClassName(this.viewState.align, this.modelData.settings);
116129
+ this.rootElement.className = this.modelData.styles.tab.className + " " +
116130
+ RulerTabUtils.getSpriteClassName(this.viewState.align, this.modelData.styles);
115865
116131
  this.applyTemplate();
115866
- this.rootElement.title = this.modelData.settings.titles[RulerTabUtils.getTabTitlePropertyName(this.viewState.align)];
116132
+ this.rootElement.title = this.modelData.titles[RulerTabUtils.getTabTitlePropertyName(this.viewState.align)];
115867
116133
  this.setCorrection();
115868
116134
  }
115869
116135
  applyTemplate() {
@@ -115891,7 +116157,7 @@ class RulerTabTypeControl extends RulerBase {
115891
116157
  this.evtHandlersHolder = new event_handlers_holder/* DomEventHandlersHolder */.$();
115892
116158
  this.align = TabAlign.Left;
115893
116159
  this.innerSquareElement = DocumentRenderer.renderContainer("");
115894
- this.alignElement = DocumentRenderer.renderContainer(RulerTabUtils.getSpriteClassName(this.align, this.modelData.settings));
116160
+ this.alignElement = DocumentRenderer.renderContainer(RulerTabUtils.getSpriteClassName(this.align, this.modelData.styles));
115895
116161
  this.applyTemplate();
115896
116162
  this.innerSquareElement.appendChild(this.alignElement);
115897
116163
  this.rootElement.appendChild(this.innerSquareElement);
@@ -115922,14 +116188,14 @@ class RulerTabTypeControl extends RulerBase {
115922
116188
  const size = this.innerSquareElement.offsetWidth;
115923
116189
  this.alignElement.style.top = (size - this.alignElement.offsetHeight) / 2 + "px";
115924
116190
  this.alignElement.style.left = (size - this.alignElement.offsetWidth) / 2 + "px";
115925
- this.alignElement.title = this.modelData.settings.titles[RulerTabUtils.getTabTitlePropertyName(this.align)];
116191
+ this.alignElement.title = this.modelData.titles[RulerTabUtils.getTabTitlePropertyName(this.align)];
115926
116192
  }
115927
116193
  onMouseDown(evt) {
115928
116194
  if (!this.modelData.isReadOnly) {
115929
116195
  this.align++;
115930
116196
  if (this.align > TabAlign.Decimal)
115931
116197
  this.align = TabAlign.Left;
115932
- this.alignElement.className = RulerTabUtils.getSpriteClassName(this.align, this.modelData.settings);
116198
+ this.alignElement.className = RulerTabUtils.getSpriteClassName(this.align, this.modelData.styles);
115933
116199
  this.applyTemplate();
115934
116200
  this.adjustAlignElement();
115935
116201
  utils_evt/* EvtUtils */.g.preventEvent(evt);
@@ -116623,7 +116889,7 @@ class RulerTableColumnState {
116623
116889
  constructor(modelData, controls) {
116624
116890
  this.controls = controls;
116625
116891
  this.rootElement = DocumentRenderer.renderContainer(TABLE_COLUMN_SEPARATOR_HANDLE_CLASS_NAME);
116626
- this.separatorElement = DocumentRenderer.renderContainer(modelData.settings.styles.columnSeparatorImage.spriteCssClass);
116892
+ this.separatorElement = DocumentRenderer.renderContainer(modelData.styles.columnSeparatorImage.spriteCssClass);
116627
116893
  const template = RulerTemplateManager.getTableColumnDragElementTemplate();
116628
116894
  if (template)
116629
116895
  this.separatorElement.innerHTML = template;
@@ -116657,7 +116923,7 @@ class RulerTableColumnState {
116657
116923
  ;// CONCATENATED MODULE: ./src/common/ui/ruler/controls/wrapper.ts
116658
116924
 
116659
116925
  class RulerWrapper extends RulerBase {
116660
- getRootClassName() { return this.modelData.settings.styles.wrapper.className; }
116926
+ getRootClassName() { return this.modelData.styles.wrapper.className; }
116661
116927
  ;
116662
116928
  constructor(modelData, controls) {
116663
116929
  super(modelData, controls);
@@ -116944,7 +117210,7 @@ class RulerControls {
116944
117210
  this.tabs = new RulerTabsControl(modelData, this);
116945
117211
  this.ruler.init();
116946
117212
  this.tabTypeBox.init();
116947
- this.lineControl = new RulerVerticalLineControl(this.canvas, modelData.settings, this.ruler.rootElement);
117213
+ this.lineControl = new RulerVerticalLineControl(this.canvas, modelData.styles.line.className, this.ruler.rootElement);
116948
117214
  this.mouseHandler = new RulerMouseHandler(modelData, this);
116949
117215
  this.mouseEventsManager.addListener(this.mouseHandler);
116950
117216
  this.viewElementScrollManager.addListener(this.ruler, this.canvas);
@@ -117017,6 +117283,10 @@ class RulerControls {
117017
117283
 
117018
117284
 
117019
117285
  class RulerModelData {
117286
+ get showLeftIndent() { return this.settings.showLeftIndent; }
117287
+ get showRightIndent() { return this.settings.showRightIndent; }
117288
+ get titles() { return this.settings.titles; }
117289
+ get styles() { return this.settings.styles; }
117020
117290
  get inputPosition() { return this.core.inputPosition; }
117021
117291
  ;
117022
117292
  get commandManager() { return this.core.commandManager; }
@@ -117028,6 +117298,8 @@ class RulerModelData {
117028
117298
  constructor(core, settings) {
117029
117299
  this.core = core;
117030
117300
  this.settings = this.fixSettings(settings);
117301
+ this.visibility = this.settings.visibility;
117302
+ this.showTabs = this.settings.showTabs;
117031
117303
  }
117032
117304
  fixSettings(settings) {
117033
117305
  if (!settings.styles.firstLineIndent)
@@ -117230,6 +117502,7 @@ class HorizontalRulerControl extends batch_updatable/* BatchUpdatableObject */.I
117230
117502
  }
117231
117503
  setVisible(visible) {
117232
117504
  if (visible != this._innerVisible || visible != this._visible) {
117505
+ this.modelData.visibility = visible ? RulerVisibility.Visible : RulerVisibility.Hidden;
117233
117506
  this._visible = visible;
117234
117507
  this.innerSetVisible(visible);
117235
117508
  }
@@ -117256,7 +117529,7 @@ class HorizontalRulerControl extends batch_updatable/* BatchUpdatableObject */.I
117256
117529
  return;
117257
117530
  if (!this.initialized && this.canvas.offsetWidth)
117258
117531
  this.controls = new RulerControls(this.canvas, this.modelData);
117259
- this.setVisible(this.modelData.settings.visibility != RulerVisibility.Hidden);
117532
+ this.setVisible(this.modelData.visibility != RulerVisibility.Hidden);
117260
117533
  this.onViewTypeChanged();
117261
117534
  }
117262
117535
  }
@@ -117911,7 +118184,6 @@ class FieldsSettings {
117911
118184
  ;
117912
118185
  constructor() {
117913
118186
  this.openHyperlinkOnClick = false;
117914
- this.disableRelativeHyperlinkUri = false;
117915
118187
  this.updateFieldsBeforePrint = true;
117916
118188
  this.updateFieldsOnPaste = true;
117917
118189
  this.defaultTimeFormat = FieldsSettings.DEFAULT_TIME_FORMAT;
@@ -117937,10 +118209,8 @@ class FieldsSettings {
117937
118209
  this.keepHyperlinkResultForInvalidReference = obj.keepHyperlinkResultForInvalidReference;
117938
118210
  if ((0,common.isDefined)(obj.createHyperlinkTooltip) && obj.createHyperlinkTooltip !== '')
117939
118211
  this.createHyperlinkTooltip = (0,utils/* convertToFunction */.tm)(obj.createHyperlinkTooltip);
117940
- if ((0,common.isDefined)(obj.disableRelativeHyperlinkUri))
117941
- this.disableRelativeHyperlinkUri = obj.disableRelativeHyperlinkUri;
117942
- if ((0,common.isDefined)(obj.allowedHyperlinkUriProtocols))
117943
- this.allowedHyperlinkUriProtocols = obj.allowedHyperlinkUriProtocols;
118212
+ if ((0,common.isDefined)(obj.allowedHyperlinkUriSchemes))
118213
+ this.allowedHyperlinkUriSchemes = obj.allowedHyperlinkUriSchemes;
117944
118214
  }
117945
118215
  clone() {
117946
118216
  const result = new FieldsSettings();
@@ -119498,6 +119768,7 @@ var MailMergeTabCommandId;
119498
119768
  MailMergeTabCommandId[MailMergeTabCommandId["CreateNumPagesField"] = 236] = "CreateNumPagesField";
119499
119769
  MailMergeTabCommandId[MailMergeTabCommandId["CreateEmptyMergeField"] = 372] = "CreateEmptyMergeField";
119500
119770
  MailMergeTabCommandId[MailMergeTabCommandId["CreateEmptyDocVariableField"] = 373] = "CreateEmptyDocVariableField";
119771
+ MailMergeTabCommandId[MailMergeTabCommandId["CreateEmptyIfField"] = 459] = "CreateEmptyIfField";
119501
119772
  MailMergeTabCommandId[MailMergeTabCommandId["ShowInsertMergeFieldDialog"] = 214] = "ShowInsertMergeFieldDialog";
119502
119773
  MailMergeTabCommandId[MailMergeTabCommandId["ToggleViewMergedData"] = 213] = "ToggleViewMergedData";
119503
119774
  MailMergeTabCommandId[MailMergeTabCommandId["ShowAllFieldCodes"] = 186] = "ShowAllFieldCodes";
@@ -123392,6 +123663,8 @@ function loadDefaultMessages() {
123392
123663
  "ASPxRichEditStringId.CreateEmptyMergeFieldDescription": "Retrieves a value from the bound data source.",
123393
123664
  "ASPxRichEditStringId.CreateEmptyDocVariableField": "DOCVARIABLE",
123394
123665
  "ASPxRichEditStringId.CreateEmptyDocVariableFieldDescription": "Enables you to programmatically insert complex content when this field is updated.",
123666
+ "ASPxRichEditStringId.CreateEmptyIfField": "IF",
123667
+ "ASPxRichEditStringId.CreateEmptyIfFieldDescription": "Compares two values and inserts text related to the comparison result.",
123395
123668
  "ASPxRichEditStringId.MenuCmd_Font_settings": "Font settings",
123396
123669
  "ASPxRichEditStringId.MenuCmd_Align_Paragraph": "Align Paragraph",
123397
123670
  "ASPxRichEditStringId.MenuCmd_Empty": "Empty",
@@ -123844,7 +124117,8 @@ class RibbonItemsData {
123844
124117
  { text: (0,external_DevExpress_localization_namespaceObject.formatMessage)('ASPxRichEditStringId.CreatePageField'), name: RichEditClientCommand.CreatePageField },
123845
124118
  { text: (0,external_DevExpress_localization_namespaceObject.formatMessage)('ASPxRichEditStringId.CreatePageCountField'), name: RichEditClientCommand.InsertPageCountField },
123846
124119
  { text: (0,external_DevExpress_localization_namespaceObject.formatMessage)('ASPxRichEditStringId.CreateEmptyMergeField'), name: RichEditClientCommand.CreateEmptyMergeField },
123847
- { text: (0,external_DevExpress_localization_namespaceObject.formatMessage)('ASPxRichEditStringId.CreateEmptyDocVariableField'), name: RichEditClientCommand.CreateEmptyDocVariableField }
124120
+ { text: (0,external_DevExpress_localization_namespaceObject.formatMessage)('ASPxRichEditStringId.CreateEmptyDocVariableField'), name: RichEditClientCommand.CreateEmptyDocVariableField },
124121
+ { text: (0,external_DevExpress_localization_namespaceObject.formatMessage)('ASPxRichEditStringId.CreateEmptyIfField'), name: RichEditClientCommand.CreateEmptyIfField }
123848
124122
  ]
123849
124123
  },
123850
124124
  { type: 'Button', text: (0,external_DevExpress_localization_namespaceObject.formatMessage)('ASPxRichEditStringId.InsertMergeFieldTitle'), icon: 'dxre-icon-InsertDataField', alwaysShowText: true, name: RichEditClientCommand.ShowInsertMergeFieldForm, },
@@ -128074,6 +128348,14 @@ class CreateEmptyDocVariableFieldCommand extends CreatePredefinedFieldCommand {
128074
128348
  return false;
128075
128349
  }
128076
128350
  }
128351
+ class CreateEmptyIfFieldCommand extends CreatePredefinedFieldCommand {
128352
+ getInsertedText(_parameter) {
128353
+ return "IF";
128354
+ }
128355
+ needUpdate() {
128356
+ return false;
128357
+ }
128358
+ }
128077
128359
  class CreateTableOfContentCommandBase extends CreatePredefinedFieldCommand {
128078
128360
  isEnabled() {
128079
128361
  const currentTocField = FieldCommandHelper.findTocFieldBySelection(this.selection.activeSubDocument, this.selection);
@@ -128170,8 +128452,14 @@ class DialogHyperlinkCommandBase extends ShowDialogCommandBase {
128170
128452
  var field = this.getState().value;
128171
128453
  if (field) {
128172
128454
  var hyperlinkInfo = field.getHyperlinkInfo();
128173
- parameters.url = hyperlinkInfo.uri;
128174
- parameters.anchor = hyperlinkInfo.anchor;
128455
+ if (hyperlinkInfo.isUri()) {
128456
+ parameters.url = hyperlinkInfo.getUriWithAnchor();
128457
+ parameters.anchor = "";
128458
+ }
128459
+ else {
128460
+ parameters.url = "";
128461
+ parameters.anchor = hyperlinkInfo.anchor;
128462
+ }
128175
128463
  parameters.tooltip = hyperlinkInfo.tip;
128176
128464
  parameters.text = FieldContextMenuHelper.getHyperlinkResultText(options.subDocument, field);
128177
128465
  }
@@ -128184,7 +128472,7 @@ class DialogHyperlinkCommandBase extends ShowDialogCommandBase {
128184
128472
  if (newParams.tooltip == initParams.tooltip && newParams.url == initParams.url && newParams.anchor == initParams.anchor && newParams.text == initParams.text)
128185
128473
  return false;
128186
128474
  var hyperlinkInfo = new HyperlinkInfo(newParams.url, newParams.anchor, newParams.tooltip, false);
128187
- if (hyperlinkInfo.anchor == "" && hyperlinkInfo.uri == "")
128475
+ if (!hyperlinkInfo.isValid())
128188
128476
  return false;
128189
128477
  var modelManipulator = this.modelManipulator;
128190
128478
  var selection = this.selection;
@@ -128206,7 +128494,7 @@ class DialogHyperlinkCommandBase extends ShowDialogCommandBase {
128206
128494
  }
128207
128495
  if (initParams.canChangeDisplayText && newParams.text != initParams.text || field.getResultInterval().length == 0) {
128208
128496
  selection.deprecatedSetSelection(field.getResultStartPosition(), field.getResultEndPosition(), false, selection.keepX, false, false);
128209
- this.control.commandManager.getCommand(RichEditClientCommand.InsertText).execute(this.control.commandManager.isPublicApiCall, new CommandSimpleOptions(this.control, !newParams.text || newParams.text == "" ? hyperlinkInfo.getUriPlusAnchor() : newParams.text));
128497
+ this.control.commandManager.getCommand(RichEditClientCommand.InsertText).execute(this.control.commandManager.isPublicApiCall, new CommandSimpleOptions(this.control, !newParams.text || newParams.text == "" ? hyperlinkInfo.getUriWithAnchor() : newParams.text));
128210
128498
  }
128211
128499
  history.addAndRedo(new ApplyFieldHyperlinkStyleHistoryItem(modelManipulator, new SubDocumentInterval(this.selection.activeSubDocument, field.getResultInterval())));
128212
128500
  selection.deprecatedSetSelection(field.getFieldEndPosition(), field.getFieldEndPosition(), false, selection.keepX, false, false);
@@ -130383,13 +130671,16 @@ class OpenHyperlinkCommand extends HyperlinkCommandBase {
130383
130671
  this.history.endTransaction();
130384
130672
  this.aspxForceSendingRequest();
130385
130673
  }
130386
- if (hyperlinkInfo.anchor)
130674
+ if (hyperlinkInfo.isUri()) {
130675
+ const options = (0,utils/* createUrlValidationOptions */.EW)(this.control.modelManager);
130676
+ let uri = hyperlinkInfo.getUriWithAnchor();
130677
+ if (!utils/* UrlUtils */.jE.isValid(uri, options))
130678
+ uri = utils/* UrlUtils */.jE.EmptyPage;
130679
+ url/* Url */.R.navigate(uri, "_blank");
130680
+ }
130681
+ else {
130387
130682
  this.control.commandManager.getCommand(RichEditClientCommand.GoToBookmark)
130388
130683
  .execute(this.control.commandManager.isPublicApiCall, new CommandSimpleOptions(this.control, hyperlinkInfo.anchor));
130389
- else {
130390
- const options = (0,utils/* createUrlValidationOptions */.EW)(this.control);
130391
- if ((0,utils/* isUrlValid */.pM)(hyperlinkInfo.uri, options))
130392
- url/* Url */.R.navigate(hyperlinkInfo.uri, "_blank");
130393
130684
  }
130394
130685
  return true;
130395
130686
  }
@@ -131005,7 +131296,7 @@ class InsertAnchoredTextBoxCommand extends CommandBase {
131005
131296
  anchorInfo.zOrder = this.modelManipulator.floatingObject.zOrder.getNewZOrder(options.subDocument);
131006
131297
  anchorInfo.layoutTableCell = true;
131007
131298
  history.addTransaction(() => {
131008
- this.modelManipulator.textBox.insertAnchoredTextBoxViaHistoty(new SubDocumentPosition(this.selection.activeSubDocument, this.selection.lastSelectedInterval.start), this.inputPosition.charPropsBundle, new BaseTextBoxInfo(null, size, new Shape(utils_color/* ColorUtils */.i.fromString(utils_color/* ColorUtils */.i.colorNames.white), ColorHelper.BLACK_COLOR, unit_converter/* UnitConverter */.u.pointsToTwips(3.0 / 4)), anchorInfo, textBoxProperties, new NonVisualDrawingObjectInfo()));
131299
+ this.modelManipulator.textBox.insertAnchoredTextBoxViaHistory(new SubDocumentPosition(this.selection.activeSubDocument, this.selection.lastSelectedInterval.start), this.inputPosition.charPropsBundle, new BaseTextBoxInfo(null, size, new Shape(utils_color/* ColorUtils */.i.fromString(utils_color/* ColorUtils */.i.colorNames.white), ColorHelper.BLACK_COLOR, unit_converter/* UnitConverter */.u.pointsToTwips(3.0 / 4)), anchorInfo, textBoxProperties, new NonVisualDrawingObjectInfo()));
131009
131300
  this.history.addAndRedo(new SelectionHistoryItem(this.modelManipulator, this.selection, this.selection.getState(), this.selection.getState().setInterval(new fixed.FixedInterval(this.selection.lastSelectedInterval.start, 1))));
131010
131301
  this.control.commandManager.getCommand(RichEditClientCommand.ChangeActiveSubDocumentToTextBox)
131011
131302
  .execute(this.control.commandManager.isPublicApiCall, options);
@@ -138790,6 +139081,7 @@ class CommandManager {
138790
139081
  this.createCommand(control, RichEditClientCommand.ChangeTextBoxProperties, ChangeTextBoxPropertiesCommand);
138791
139082
  this.createCommand(control, RichEditClientCommand.CreateEmptyMergeField, CreateEmptyMergeFieldCommand);
138792
139083
  this.createCommand(control, RichEditClientCommand.CreateEmptyDocVariableField, CreateEmptyDocVariableFieldCommand);
139084
+ this.createCommand(control, RichEditClientCommand.CreateEmptyIfField, CreateEmptyIfFieldCommand);
138793
139085
  this.createCommand(control, RichEditClientCommand.FloatingObjectDragDropChangePosition, FloatingObjectDragDropChangePositionCommand);
138794
139086
  this.createCommand(control, RichEditClientCommand.InsertHtml, InsertHtmlCommand);
138795
139087
  this.createCommand(control, RichEditClientCommand.CreateTocField, CreateTocFieldCommand);
@@ -139420,9 +139712,10 @@ class NewDocumentCommand extends CommandBase {
139420
139712
  return true;
139421
139713
  }
139422
139714
  static newDocumentInner() {
139715
+ var _a;
139423
139716
  this.control.closeDocument();
139424
139717
  this.control.loadingPanelManager.loadingPanel.setVisible(true);
139425
- const documentInfo = new DocumentInfo(DocumentInfo.defaultDocumentName, false);
139718
+ const documentInfo = new DocumentInfo((_a = this.control.documentInfo) === null || _a === void 0 ? void 0 : _a.fileName, false);
139426
139719
  this.control.initialize("", documentInfo, 1, null);
139427
139720
  const options = new ModelCreatorOptions();
139428
139721
  new ModelCreator(options).setModel(this.control.modelManager.model).fillModel();
@@ -141464,6 +141757,7 @@ class FontDialog extends DialogBase {
141464
141757
  ;// CONCATENATED MODULE: ./src/client/dialogs/hyperlink-dialog.ts
141465
141758
 
141466
141759
 
141760
+
141467
141761
  class HyperlinkDialog extends DialogBase {
141468
141762
  constructor() {
141469
141763
  super(...arguments);
@@ -141610,13 +141904,19 @@ class HyperlinkDialog extends DialogBase {
141610
141904
  parameters.text = data.text;
141611
141905
  parameters.tooltip = data.tooltip;
141612
141906
  const tabPanelSelectedIndex = this.tabPanel.option('selectedIndex');
141613
- if (tabPanelSelectedIndex == 0)
141614
- parameters.url = data.url;
141615
- else if (tabPanelSelectedIndex == 1)
141616
- parameters.anchor = data.anchor;
141907
+ if (tabPanelSelectedIndex == 0) {
141908
+ [parameters.url, parameters.anchor] = utils/* UrlUtils */.jE.splitUrlByAnchor(data.url);
141909
+ }
141617
141910
  else {
141618
- const subject = data.subject ? this.subjectPrefix + data.subject : '';
141619
- parameters.url = this.mailtoPrefix + data.email + subject;
141911
+ if (tabPanelSelectedIndex == 1) {
141912
+ parameters.url = "";
141913
+ parameters.anchor = data.anchor;
141914
+ }
141915
+ else {
141916
+ const subject = data.subject ? this.subjectPrefix + data.subject : '';
141917
+ parameters.url = this.mailtoPrefix + data.email + subject;
141918
+ parameters.anchor = "";
141919
+ }
141620
141920
  }
141621
141921
  }
141622
141922
  }
@@ -143129,10 +143429,8 @@ class Settings {
143129
143429
  result.fields.createHyperlinkTooltip = this.parseEventHandler(settings.fields.createHyperlinkTooltip);
143130
143430
  if ((0,common.isDefined)(settings.fields.keepHyperlinkResultForInvalidReference))
143131
143431
  result.fields.keepHyperlinkResultForInvalidReference = settings.fields.keepHyperlinkResultForInvalidReference;
143132
- if ((0,common.isDefined)(settings.fields.disableRelativeHyperlinkUri))
143133
- result.fields.disableRelativeHyperlinkUri = settings.fields.disableRelativeHyperlinkUri;
143134
- if ((0,common.isDefined)(settings.fields.allowedHyperlinkUriProtocols))
143135
- result.fields.allowedHyperlinkUriProtocols = settings.fields.allowedHyperlinkUriProtocols;
143432
+ if ((0,common.isDefined)(settings.fields.allowedHyperlinkUriSchemes))
143433
+ result.fields.allowedHyperlinkUriSchemes = settings.fields.allowedHyperlinkUriSchemes;
143136
143434
  }
143137
143435
  }
143138
143436
  static parsePrintingSettings(settings, result) {
@@ -143875,7 +144173,7 @@ class ClientRichEdit {
143875
144173
  this.contextMenuSettings = settings.contextMenuSettings;
143876
144174
  this.fullScreenHelper = new FullScreenHelper(element);
143877
144175
  if (true)
143878
- external_DevExpress_config_default()(JSON.parse(atob('eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWFYWkdXQzFTVkdFeU1IbFVPRGh0YzAxNmRsQTJaeUlLZlE9PS5GYjZ4U0JwU3BSVHBWajZ0dWtlQTJZaU1WVW5tb0ZoSDJKV3Ryak5iN3p6VlNrNzhKa294RVFKOW9rVlErYnh0SzM1WWlFZkpEWGJnNktrYVA1ZEljcnp0ZHlsOFlGL2ltc3BIWkY5aWlaeGtVK0FXbFVrV1RUb2c0ZnZDbWlxMTl2MWhIdz09In0=')));
144176
+ external_DevExpress_config_default()(JSON.parse(atob('eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWFUbHhVemQxYzBSQ01HVlpTbDlrVGkxb2FYaGtVU0lLZlE9PS5INTlJcG94ZC90cWdVcE1leVdhamhubjl2NnFtMkFrQmc2MW0yU05ZUHIreFBrdnRLUm04Wm4rU08rUVQ3NEt3MVpWQ0pGeEJYV1dJRlNyRG1EZlVqYmV6N2RzTnpJbTR6S1A5M2l4amVQR0Jnb2o4eG9VSmZvNldmZzNMblpTUlNLcHFpZz09In0=')));
143879
144177
  this.prepareElement(element, settings);
143880
144178
  this.initDefaultFontsAndStyles();
143881
144179
  this.initBars(settings.ribbon, settings.fonts);
@@ -144402,11 +144700,11 @@ class ClientRichEdit {
144402
144700
  return this.barHolder.ribbon;
144403
144701
  }
144404
144702
  getLinkType(hyperlinkInfo) {
144405
- if (hyperlinkInfo.anchor)
144406
- return DocumentLinkType.Bookmark;
144407
- if (hyperlinkInfo.uri && hyperlinkInfo.uri.substr(0, 7) === "mailto:")
144703
+ if (hyperlinkInfo.isMail())
144408
144704
  return DocumentLinkType.EmailAddress;
144409
- return DocumentLinkType.Hyperlink;
144705
+ if (hyperlinkInfo.isUri())
144706
+ return DocumentLinkType.Hyperlink;
144707
+ return DocumentLinkType.Bookmark;
144410
144708
  }
144411
144709
  setFullScreenMode() {
144412
144710
  this.fullScreenHelper.prepareFullScreenMode();
@@ -144966,6 +145264,9 @@ function executeApiCommandCore(commandManager, commandId, parameter) {
144966
145264
  case MailMergeTabCommandId.CreateEmptyDocVariableField:
144967
145265
  parameter = undefined;
144968
145266
  break;
145267
+ case MailMergeTabCommandId.CreateEmptyIfField:
145268
+ parameter = undefined;
145269
+ break;
144969
145270
  case MailMergeTabCommandId.ShowInsertMergeFieldDialog:
144970
145271
  parameter = undefined;
144971
145272
  break;
@@ -146278,7 +146579,7 @@ class RichEditPublic {
146278
146579
  mimeType = mime_type.HtmlMimeType;
146279
146580
  break;
146280
146581
  }
146281
- const fileName = OpenDocumentCommand.getFileNameWithoutExtension(this.documentName);
146582
+ const fileName = OpenDocumentCommand.getFileNameWithoutExtension(this._native.core.documentInfo.fileName);
146282
146583
  const extension = Utils.documentFormatToExtension(format);
146283
146584
  const exportModelOptions = this._native.core.getExportModelOptions({ documentFormat: format });
146284
146585
  exportModelToBlob(exportModelOptions, blob => callback(utils_file.FileUtils.createFile([blob], fileName + extension, { type: mimeType })));
@@ -146697,6 +146998,7 @@ var MailMergeTabItemId;
146697
146998
  MailMergeTabItemId[MailMergeTabItemId["CreateNumPagesField"] = 236] = "CreateNumPagesField";
146698
146999
  MailMergeTabItemId[MailMergeTabItemId["CreateEmptyMergeField"] = 372] = "CreateEmptyMergeField";
146699
147000
  MailMergeTabItemId[MailMergeTabItemId["CreateEmptyDocVariableField"] = 373] = "CreateEmptyDocVariableField";
147001
+ MailMergeTabItemId[MailMergeTabItemId["CreateEmptyIfField"] = 459] = "CreateEmptyIfField";
146700
147002
  MailMergeTabItemId[MailMergeTabItemId["ShowInsertMergeFieldDialog"] = 214] = "ShowInsertMergeFieldDialog";
146701
147003
  MailMergeTabItemId[MailMergeTabItemId["ToggleViewMergedData"] = 213] = "ToggleViewMergedData";
146702
147004
  MailMergeTabItemId[MailMergeTabItemId["ShowAllFieldCodes"] = 186] = "ShowAllFieldCodes";