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
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (index.d.ts)
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
  */
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (index.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
  */
@@ -256,7 +256,8 @@ export class RibbonItemsData {
256
256
  { text: formatMessage('ASPxRichEditStringId.CreatePageField'), name: Command.CreatePageField },
257
257
  { text: formatMessage('ASPxRichEditStringId.CreatePageCountField'), name: Command.InsertPageCountField },
258
258
  { text: formatMessage('ASPxRichEditStringId.CreateEmptyMergeField'), name: Command.CreateEmptyMergeField },
259
- { text: formatMessage('ASPxRichEditStringId.CreateEmptyDocVariableField'), name: Command.CreateEmptyDocVariableField }
259
+ { text: formatMessage('ASPxRichEditStringId.CreateEmptyDocVariableField'), name: Command.CreateEmptyDocVariableField },
260
+ { text: formatMessage('ASPxRichEditStringId.CreateEmptyIfField'), name: Command.CreateEmptyIfField }
260
261
  ]
261
262
  },
262
263
  { type: 'Button', text: formatMessage('ASPxRichEditStringId.InsertMergeFieldTitle'), icon: 'dxre-icon-InsertDataField', alwaysShowText: true, name: Command.ShowInsertMergeFieldForm, },
@@ -61,8 +61,8 @@ export class ClientRichEdit {
61
61
  this.rawDataSource = settings.rawDataSource;
62
62
  this.contextMenuSettings = settings.contextMenuSettings;
63
63
  this.fullScreenHelper = new FullScreenHelper(element);
64
- if ("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWFYWkdXQzFTVkdFeU1IbFVPRGh0YzAxNmRsQTJaeUlLZlE9PS5GYjZ4U0JwU3BSVHBWajZ0dWtlQTJZaU1WVW5tb0ZoSDJKV3Ryak5iN3p6VlNrNzhKa294RVFKOW9rVlErYnh0SzM1WWlFZkpEWGJnNktrYVA1ZEljcnp0ZHlsOFlGL2ltc3BIWkY5aWlaeGtVK0FXbFVrV1RUb2c0ZnZDbWlxMTl2MWhIdz09In0=")
65
- config(JSON.parse(atob("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWFYWkdXQzFTVkdFeU1IbFVPRGh0YzAxNmRsQTJaeUlLZlE9PS5GYjZ4U0JwU3BSVHBWajZ0dWtlQTJZaU1WVW5tb0ZoSDJKV3Ryak5iN3p6VlNrNzhKa294RVFKOW9rVlErYnh0SzM1WWlFZkpEWGJnNktrYVA1ZEljcnp0ZHlsOFlGL2ltc3BIWkY5aWlaeGtVK0FXbFVrV1RUb2c0ZnZDbWlxMTl2MWhIdz09In0=")));
64
+ if ("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWFUbHhVemQxYzBSQ01HVlpTbDlrVGkxb2FYaGtVU0lLZlE9PS5INTlJcG94ZC90cWdVcE1leVdhamhubjl2NnFtMkFrQmc2MW0yU05ZUHIreFBrdnRLUm04Wm4rU08rUVQ3NEt3MVpWQ0pGeEJYV1dJRlNyRG1EZlVqYmV6N2RzTnpJbTR6S1A5M2l4amVQR0Jnb2o4eG9VSmZvNldmZzNMblpTUlNLcHFpZz09In0=")
65
+ config(JSON.parse(atob("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWFUbHhVemQxYzBSQ01HVlpTbDlrVGkxb2FYaGtVU0lLZlE9PS5INTlJcG94ZC90cWdVcE1leVdhamhubjl2NnFtMkFrQmc2MW0yU05ZUHIreFBrdnRLUm04Wm4rU08rUVQ3NEt3MVpWQ0pGeEJYV1dJRlNyRG1EZlVqYmV6N2RzTnpJbTR6S1A5M2l4amVQR0Jnb2o4eG9VSmZvNldmZzNMblpTUlNLcHFpZz09In0=")));
66
66
  this.prepareElement(element, settings);
67
67
  this.initDefaultFontsAndStyles();
68
68
  this.initBars(settings.ribbon, settings.fonts);
@@ -589,11 +589,11 @@ export class ClientRichEdit {
589
589
  return this.barHolder.ribbon;
590
590
  }
591
591
  getLinkType(hyperlinkInfo) {
592
- if (hyperlinkInfo.anchor)
593
- return DocumentLinkType.Bookmark;
594
- if (hyperlinkInfo.uri && hyperlinkInfo.uri.substr(0, 7) === "mailto:")
592
+ if (hyperlinkInfo.isMail())
595
593
  return DocumentLinkType.EmailAddress;
596
- return DocumentLinkType.Hyperlink;
594
+ if (hyperlinkInfo.isUri())
595
+ return DocumentLinkType.Hyperlink;
596
+ return DocumentLinkType.Bookmark;
597
597
  }
598
598
  setFullScreenMode() {
599
599
  this.fullScreenHelper.prepareFullScreenMode();
@@ -387,6 +387,9 @@ export function executeApiCommandCore(commandManager, commandId, parameter) {
387
387
  case MailMergeTabCommandId.CreateEmptyDocVariableField:
388
388
  parameter = undefined;
389
389
  break;
390
+ case MailMergeTabCommandId.CreateEmptyIfField:
391
+ parameter = undefined;
392
+ break;
390
393
  case MailMergeTabCommandId.ShowInsertMergeFieldDialog:
391
394
  parameter = undefined;
392
395
  break;
@@ -19,9 +19,10 @@ export class NewDocumentCommand extends CommandBase {
19
19
  return true;
20
20
  }
21
21
  static newDocumentInner() {
22
+ var _a;
22
23
  this.control.closeDocument();
23
24
  this.control.loadingPanelManager.loadingPanel.setVisible(true);
24
- const documentInfo = new DocumentInfo(DocumentInfo.defaultDocumentName, false);
25
+ const documentInfo = new DocumentInfo((_a = this.control.documentInfo) === null || _a === void 0 ? void 0 : _a.fileName, false);
25
26
  this.control.initialize("", documentInfo, 1, null);
26
27
  const options = new ModelCreatorOptions();
27
28
  new ModelCreator(options).setModel(this.control.modelManager.model).fillModel();
@@ -2030,6 +2030,8 @@ export function loadDefaultMessages() {
2030
2030
  "ASPxRichEditStringId.CreateEmptyMergeFieldDescription": "Retrieves a value from the bound data source.",
2031
2031
  "ASPxRichEditStringId.CreateEmptyDocVariableField": "DOCVARIABLE",
2032
2032
  "ASPxRichEditStringId.CreateEmptyDocVariableFieldDescription": "Enables you to programmatically insert complex content when this field is updated.",
2033
+ "ASPxRichEditStringId.CreateEmptyIfField": "IF",
2034
+ "ASPxRichEditStringId.CreateEmptyIfFieldDescription": "Compares two values and inserts text related to the comparison result.",
2033
2035
  "ASPxRichEditStringId.MenuCmd_Font_settings": "Font settings",
2034
2036
  "ASPxRichEditStringId.MenuCmd_Align_Paragraph": "Align Paragraph",
2035
2037
  "ASPxRichEditStringId.MenuCmd_Empty": "Empty",
@@ -1,5 +1,6 @@
1
1
  import { formatMessage } from 'devextreme/localization';
2
2
  import { DialogBase } from './dialog-base';
3
+ import { UrlUtils } from '../../common/utils/utils';
3
4
  export class HyperlinkDialog extends DialogBase {
4
5
  constructor() {
5
6
  super(...arguments);
@@ -146,13 +147,19 @@ export class HyperlinkDialog extends DialogBase {
146
147
  parameters.text = data.text;
147
148
  parameters.tooltip = data.tooltip;
148
149
  const tabPanelSelectedIndex = this.tabPanel.option('selectedIndex');
149
- if (tabPanelSelectedIndex == 0)
150
- parameters.url = data.url;
151
- else if (tabPanelSelectedIndex == 1)
152
- parameters.anchor = data.anchor;
150
+ if (tabPanelSelectedIndex == 0) {
151
+ [parameters.url, parameters.anchor] = UrlUtils.splitUrlByAnchor(data.url);
152
+ }
153
153
  else {
154
- const subject = data.subject ? this.subjectPrefix + data.subject : '';
155
- parameters.url = this.mailtoPrefix + data.email + subject;
154
+ if (tabPanelSelectedIndex == 1) {
155
+ parameters.url = "";
156
+ parameters.anchor = data.anchor;
157
+ }
158
+ else {
159
+ const subject = data.subject ? this.subjectPrefix + data.subject : '';
160
+ parameters.url = this.mailtoPrefix + data.email + subject;
161
+ parameters.anchor = "";
162
+ }
156
163
  }
157
164
  }
158
165
  }
@@ -11,7 +11,7 @@ export class OpenXmlColorImportHelper {
11
11
  if (themeValue != ThemeColorValues.None) {
12
12
  const themeColorIndex = ThemeColorIndexCalculator.calculateThemeColorIndex(themeValue);
13
13
  return themeColorIndex != ThemeColorIndexConstants.None ?
14
- ColorModelInfo.makeByThemeColorIndex(themeColorIndex, OpenXmlColorImportHelper.getTint(data, reader, 'themeTint', 'themeShade')) :
14
+ ColorModelInfo.makeByThemeColorIndex(themeColorIndex, OpenXmlColorImportHelper.getTint(data, reader, 'themeTint', 'themeShade'), themeValue) :
15
15
  ColorModelInfo.makeByThemeColorIndex(DXColor.empty);
16
16
  }
17
17
  else {
@@ -42,7 +42,7 @@ export class OpenXmlColorImportHelper {
42
42
  if (themeValue != ThemeColorValues.None) {
43
43
  const themeColorIndex = ThemeColorIndexCalculator.calculateThemeColorIndex(themeValue);
44
44
  if (themeColorIndex != ThemeColorIndexConstants.None)
45
- return ColorModelInfo.makeByThemeColorIndex(themeColorIndex, tint);
45
+ return ColorModelInfo.makeByThemeColorIndex(themeColorIndex, tint, themeValue);
46
46
  }
47
47
  return ColorModelInfo.makeByColor(data.readerHelper.getWpSTColorValue(reader, 'fill', DXColor.empty), tint);
48
48
  }
@@ -77,9 +77,10 @@ export class StyleManager {
77
77
  StringMapUtils.forEach(this.info, (info) => action(info));
78
78
  }
79
79
  addStyle(dest) {
80
+ var _a;
80
81
  if (this.currInfo.isDefault && !this.isDefaultProcessed) {
81
82
  this.isDefaultProcessed = true;
82
- if (this.defaultStyle.styleName === this.currInfo.name)
83
+ if (((_a = this.defaultStyle) === null || _a === void 0 ? void 0 : _a.styleName) === this.currInfo.name)
83
84
  this.applyProperties(dest, this.defaultStyle);
84
85
  else
85
86
  this.defaultStyle = this.addToModel(this.applyProperties(dest, this.createEmpty()));
@@ -80,8 +80,7 @@ export interface IRichEditFieldsSettings {
80
80
  defaultDateFormat?: string;
81
81
  openHyperlinkOnClick?: boolean;
82
82
  keepHyperlinkResultForInvalidReference?: boolean;
83
- disableRelativeHyperlinkUri?: boolean;
84
- allowedHyperlinkUriProtocols?: string[];
83
+ allowedHyperlinkUriSchemes?: string[];
85
84
  createHyperlinkTooltip?: (hyperlinkTooltip: string, hint: string) => string;
86
85
  }
87
86
  export interface IRichEditRangePermissionsSettings {
@@ -59,7 +59,7 @@ export class TextBoxCollection extends DrawingObjectCollectionBase {
59
59
  const anchorInfo = new AnchorInfo();
60
60
  anchorInfo.zOrder = this._processor.modelManager.modelManipulator.floatingObject.zOrder.getNewZOrder(this._subDocument);
61
61
  const inputPos = new InputPositionBase().setIntervals(SelectionIntervalsInfo.fromPosition(this._subDocument, position));
62
- this._processor.modelManager.modelManipulator.textBox.insertAnchoredTextBoxViaHistoty(new SubDocumentPosition(this._subDocument, position), inputPos.charPropsBundle, new BaseTextBoxInfo(null, size, new Shape(ColorUtils.fromString(ColorUtils.colorNames.white), ColorHelper.BLACK_COLOR, UnitConverter.pointsToTwips(3.0 / 4)), anchorInfo, textBoxProperties, new NonVisualDrawingObjectInfo()));
62
+ this._processor.modelManager.modelManipulator.textBox.insertAnchoredTextBoxViaHistory(new SubDocumentPosition(this._subDocument, position), inputPos.charPropsBundle, new BaseTextBoxInfo(null, size, new Shape(ColorUtils.fromString(ColorUtils.colorNames.white), ColorHelper.BLACK_COLOR, UnitConverter.pointsToTwips(3.0 / 4)), anchorInfo, textBoxProperties, new NonVisualDrawingObjectInfo()));
63
63
  const textBoxRun = this._subDocument.getRunByPosition(position);
64
64
  return new TextBoxApi(this._processor.modelManager, this._subDocument, textBoxRun, position);
65
65
  }
@@ -60,7 +60,7 @@ export class HyperlinkCollection extends Collection {
60
60
  subDocument.insertText(field.getCodeInterval().start, HyperlinkInfo.getNewCodeText(info));
61
61
  if (canChangeHyperlinkDisplayText && hyperlinkInfo.text || field.getResultInterval().length == 0) {
62
62
  subDocument.deleteText(convertToIntervalApi(field.getResultInterval()));
63
- subDocument.insertText(field.getResultInterval().start, !hyperlinkInfo.text || hyperlinkInfo.text == "" ? info.getUriPlusAnchor() : hyperlinkInfo.text);
63
+ subDocument.insertText(field.getResultInterval().start, !hyperlinkInfo.text || hyperlinkInfo.text == "" ? info.getUriWithAnchor() : hyperlinkInfo.text);
64
64
  }
65
65
  this._processor.modelManager.history.addAndRedo(new ApplyFieldHyperlinkStyleHistoryItem(this._processor.modelManager.modelManipulator, new SubDocumentInterval(this._subDocument, field.getResultInterval())));
66
66
  this._processor.modelManager.history.endTransaction();
@@ -133,6 +133,7 @@ export declare enum MailMergeTabCommandId {
133
133
  CreateNumPagesField = 236,
134
134
  CreateEmptyMergeField = 372,
135
135
  CreateEmptyDocVariableField = 373,
136
+ CreateEmptyIfField = 459,
136
137
  ShowInsertMergeFieldDialog = 214,
137
138
  ToggleViewMergedData = 213,
138
139
  ShowAllFieldCodes = 186,
@@ -139,6 +139,7 @@ export var MailMergeTabCommandId;
139
139
  MailMergeTabCommandId[MailMergeTabCommandId["CreateNumPagesField"] = 236] = "CreateNumPagesField";
140
140
  MailMergeTabCommandId[MailMergeTabCommandId["CreateEmptyMergeField"] = 372] = "CreateEmptyMergeField";
141
141
  MailMergeTabCommandId[MailMergeTabCommandId["CreateEmptyDocVariableField"] = 373] = "CreateEmptyDocVariableField";
142
+ MailMergeTabCommandId[MailMergeTabCommandId["CreateEmptyIfField"] = 459] = "CreateEmptyIfField";
142
143
  MailMergeTabCommandId[MailMergeTabCommandId["ShowInsertMergeFieldDialog"] = 214] = "ShowInsertMergeFieldDialog";
143
144
  MailMergeTabCommandId[MailMergeTabCommandId["ToggleViewMergedData"] = 213] = "ToggleViewMergedData";
144
145
  MailMergeTabCommandId[MailMergeTabCommandId["ShowAllFieldCodes"] = 186] = "ShowAllFieldCodes";
@@ -93,8 +93,7 @@ export interface IFieldsSettings {
93
93
  defaultDateFormat?: string;
94
94
  openHyperlinkOnClick?: boolean;
95
95
  keepHyperlinkResultForInvalidReference?: boolean;
96
- disableRelativeHyperlinkUri?: boolean;
97
- allowedHyperlinkUriProtocols?: string[];
96
+ allowedHyperlinkUriSchemes?: string[];
98
97
  createHyperlinkTooltip?: (hyperlinkTooltip: string, hint: string) => string;
99
98
  }
100
99
  export interface IBookmarkSettings {
@@ -133,6 +133,7 @@ export declare enum MailMergeTabItemId {
133
133
  CreateNumPagesField = 236,
134
134
  CreateEmptyMergeField = 372,
135
135
  CreateEmptyDocVariableField = 373,
136
+ CreateEmptyIfField = 459,
136
137
  ShowInsertMergeFieldDialog = 214,
137
138
  ToggleViewMergedData = 213,
138
139
  ShowAllFieldCodes = 186,
@@ -139,6 +139,7 @@ export var MailMergeTabItemId;
139
139
  MailMergeTabItemId[MailMergeTabItemId["CreateNumPagesField"] = 236] = "CreateNumPagesField";
140
140
  MailMergeTabItemId[MailMergeTabItemId["CreateEmptyMergeField"] = 372] = "CreateEmptyMergeField";
141
141
  MailMergeTabItemId[MailMergeTabItemId["CreateEmptyDocVariableField"] = 373] = "CreateEmptyDocVariableField";
142
+ MailMergeTabItemId[MailMergeTabItemId["CreateEmptyIfField"] = 459] = "CreateEmptyIfField";
142
143
  MailMergeTabItemId[MailMergeTabItemId["ShowInsertMergeFieldDialog"] = 214] = "ShowInsertMergeFieldDialog";
143
144
  MailMergeTabItemId[MailMergeTabItemId["ToggleViewMergedData"] = 213] = "ToggleViewMergedData";
144
145
  MailMergeTabItemId[MailMergeTabItemId["ShowAllFieldCodes"] = 186] = "ShowAllFieldCodes";
@@ -118,7 +118,7 @@ class RichEditPublic {
118
118
  mimeType = HtmlMimeType;
119
119
  break;
120
120
  }
121
- const fileName = OpenDocumentCommand.getFileNameWithoutExtension(this.documentName);
121
+ const fileName = OpenDocumentCommand.getFileNameWithoutExtension(this._native.core.documentInfo.fileName);
122
122
  const extension = Utils.documentFormatToExtension(format);
123
123
  const exportModelOptions = this._native.core.getExportModelOptions({ documentFormat: format });
124
124
  exportModelToBlob(exportModelOptions, blob => callback(FileUtils.createFile([blob], fileName + extension, { type: mimeType })));
@@ -146,10 +146,8 @@ export class Settings {
146
146
  result.fields.createHyperlinkTooltip = this.parseEventHandler(settings.fields.createHyperlinkTooltip);
147
147
  if (isDefined(settings.fields.keepHyperlinkResultForInvalidReference))
148
148
  result.fields.keepHyperlinkResultForInvalidReference = settings.fields.keepHyperlinkResultForInvalidReference;
149
- if (isDefined(settings.fields.disableRelativeHyperlinkUri))
150
- result.fields.disableRelativeHyperlinkUri = settings.fields.disableRelativeHyperlinkUri;
151
- if (isDefined(settings.fields.allowedHyperlinkUriProtocols))
152
- result.fields.allowedHyperlinkUriProtocols = settings.fields.allowedHyperlinkUriProtocols;
149
+ if (isDefined(settings.fields.allowedHyperlinkUriSchemes))
150
+ result.fields.allowedHyperlinkUriSchemes = settings.fields.allowedHyperlinkUriSchemes;
153
151
  }
154
152
  }
155
153
  static parsePrintingSettings(settings, result) {
@@ -418,5 +418,6 @@ export declare enum RichEditClientCommand {
418
418
  FloatingObjectBringForwardMenu = 455,
419
419
  FloatingObjectSendBackwardMenu = 456,
420
420
  NoSpellingSuggestions = 457,
421
- GetHtml = 458
421
+ GetHtml = 458,
422
+ CreateEmptyIfField = 459
422
423
  }
@@ -420,4 +420,5 @@ export var RichEditClientCommand;
420
420
  RichEditClientCommand[RichEditClientCommand["FloatingObjectSendBackwardMenu"] = 456] = "FloatingObjectSendBackwardMenu";
421
421
  RichEditClientCommand[RichEditClientCommand["NoSpellingSuggestions"] = 457] = "NoSpellingSuggestions";
422
422
  RichEditClientCommand[RichEditClientCommand["GetHtml"] = 458] = "GetHtml";
423
+ RichEditClientCommand[RichEditClientCommand["CreateEmptyIfField"] = 459] = "CreateEmptyIfField";
423
424
  })(RichEditClientCommand || (RichEditClientCommand = {}));
@@ -35,7 +35,7 @@ import { ShowQuickSearchPanelCommand } from './dialogs/show-quick-search-panel-c
35
35
  import { ChangePageColorCommand } from './document-properties/change-page-color-command';
36
36
  import { PrintDocumentOnClient } from './document/print-document-on-client-command';
37
37
  import { ChangeHyperlinkCommand } from './fields/change-hyperlink-command';
38
- import { CreateDateFieldCommand, CreateEmptyDocVariableFieldCommand, CreateEmptyMergeFieldCommand, CreateEquationCaptionFieldCommand, CreateFieldCommand, CreateFieldWithCodeCommand, CreateFigureCaptionFieldCommand, CreateMergeFieldCommand, CreatePageCountFieldCommand, CreatePageFieldCommand, CreateTableCaptionFieldCommand, CreateTableOfEquationsFieldCommand, CreateTableOfFiguresFieldCommand, CreateTableOfTablesFieldCommand, CreateTimeFieldCommand, CreateTocFieldCommand } from './fields/create-field-command';
38
+ import { CreateDateFieldCommand, CreateEmptyDocVariableFieldCommand, CreateEmptyIfFieldCommand, CreateEmptyMergeFieldCommand, CreateEquationCaptionFieldCommand, CreateFieldCommand, CreateFieldWithCodeCommand, CreateFigureCaptionFieldCommand, CreateMergeFieldCommand, CreatePageCountFieldCommand, CreatePageFieldCommand, CreateTableCaptionFieldCommand, CreateTableOfEquationsFieldCommand, CreateTableOfFiguresFieldCommand, CreateTableOfTablesFieldCommand, CreateTimeFieldCommand, CreateTocFieldCommand } from './fields/create-field-command';
39
39
  import { GoToFirstDataRecordCommand, GoToLastDataRecordCommand, GoToNextDataRecordCommand, GoToPreviousDataRecordCommand, GoToRecordCommandBase } from './fields/go-to-record-command';
40
40
  import { OpenHyperlinkCommand } from './fields/open-hyperlink-command';
41
41
  import { RemoveHyperlinkCommand } from './fields/remove-hyperlink-command';
@@ -524,6 +524,7 @@ export class CommandManager {
524
524
  this.createCommand(control, RichEditClientCommand.ChangeTextBoxProperties, ChangeTextBoxPropertiesCommand);
525
525
  this.createCommand(control, RichEditClientCommand.CreateEmptyMergeField, CreateEmptyMergeFieldCommand);
526
526
  this.createCommand(control, RichEditClientCommand.CreateEmptyDocVariableField, CreateEmptyDocVariableFieldCommand);
527
+ this.createCommand(control, RichEditClientCommand.CreateEmptyIfField, CreateEmptyIfFieldCommand);
527
528
  this.createCommand(control, RichEditClientCommand.FloatingObjectDragDropChangePosition, FloatingObjectDragDropChangePositionCommand);
528
529
  this.createCommand(control, RichEditClientCommand.InsertHtml, InsertHtmlCommand);
529
530
  this.createCommand(control, RichEditClientCommand.CreateTocField, CreateTocFieldCommand);
@@ -36,8 +36,14 @@ export class DialogHyperlinkCommandBase extends ShowDialogCommandBase {
36
36
  var field = this.getState().value;
37
37
  if (field) {
38
38
  var hyperlinkInfo = field.getHyperlinkInfo();
39
- parameters.url = hyperlinkInfo.uri;
40
- parameters.anchor = hyperlinkInfo.anchor;
39
+ if (hyperlinkInfo.isUri()) {
40
+ parameters.url = hyperlinkInfo.getUriWithAnchor();
41
+ parameters.anchor = "";
42
+ }
43
+ else {
44
+ parameters.url = "";
45
+ parameters.anchor = hyperlinkInfo.anchor;
46
+ }
41
47
  parameters.tooltip = hyperlinkInfo.tip;
42
48
  parameters.text = FieldContextMenuHelper.getHyperlinkResultText(options.subDocument, field);
43
49
  }
@@ -50,7 +56,7 @@ export class DialogHyperlinkCommandBase extends ShowDialogCommandBase {
50
56
  if (newParams.tooltip == initParams.tooltip && newParams.url == initParams.url && newParams.anchor == initParams.anchor && newParams.text == initParams.text)
51
57
  return false;
52
58
  var hyperlinkInfo = new HyperlinkInfo(newParams.url, newParams.anchor, newParams.tooltip, false);
53
- if (hyperlinkInfo.anchor == "" && hyperlinkInfo.uri == "")
59
+ if (!hyperlinkInfo.isValid())
54
60
  return false;
55
61
  var modelManipulator = this.modelManipulator;
56
62
  var selection = this.selection;
@@ -72,7 +78,7 @@ export class DialogHyperlinkCommandBase extends ShowDialogCommandBase {
72
78
  }
73
79
  if (initParams.canChangeDisplayText && newParams.text != initParams.text || field.getResultInterval().length == 0) {
74
80
  selection.deprecatedSetSelection(field.getResultStartPosition(), field.getResultEndPosition(), false, selection.keepX, false, false);
75
- this.control.commandManager.getCommand(RichEditClientCommand.InsertText).execute(this.control.commandManager.isPublicApiCall, new CommandSimpleOptions(this.control, !newParams.text || newParams.text == "" ? hyperlinkInfo.getUriPlusAnchor() : newParams.text));
81
+ this.control.commandManager.getCommand(RichEditClientCommand.InsertText).execute(this.control.commandManager.isPublicApiCall, new CommandSimpleOptions(this.control, !newParams.text || newParams.text == "" ? hyperlinkInfo.getUriWithAnchor() : newParams.text));
76
82
  }
77
83
  history.addAndRedo(new ApplyFieldHyperlinkStyleHistoryItem(modelManipulator, new SubDocumentInterval(this.selection.activeSubDocument, field.getResultInterval())));
78
84
  selection.deprecatedSetSelection(field.getFieldEndPosition(), field.getFieldEndPosition(), false, selection.keepX, false, false);
@@ -47,6 +47,10 @@ export declare class CreateEmptyDocVariableFieldCommand extends CreatePredefined
47
47
  getInsertedText(_parameter: string): string;
48
48
  needUpdate(): boolean;
49
49
  }
50
+ export declare class CreateEmptyIfFieldCommand extends CreatePredefinedFieldCommand {
51
+ getInsertedText(_parameter: string): string;
52
+ needUpdate(): boolean;
53
+ }
50
54
  export declare abstract class CreateTableOfContentCommandBase extends CreatePredefinedFieldCommand {
51
55
  isEnabled(): boolean;
52
56
  getInsertedText(_parameter: string): string;
@@ -170,6 +170,14 @@ export class CreateEmptyDocVariableFieldCommand extends CreatePredefinedFieldCom
170
170
  return false;
171
171
  }
172
172
  }
173
+ export class CreateEmptyIfFieldCommand extends CreatePredefinedFieldCommand {
174
+ getInsertedText(_parameter) {
175
+ return "IF";
176
+ }
177
+ needUpdate() {
178
+ return false;
179
+ }
180
+ }
173
181
  export class CreateTableOfContentCommandBase extends CreatePredefinedFieldCommand {
174
182
  isEnabled() {
175
183
  const currentTocField = FieldCommandHelper.findTocFieldBySelection(this.selection.activeSubDocument, this.selection);
@@ -4,7 +4,7 @@ import { ReadOnlyMode } from '../../interfaces/i-rich-edit-core';
4
4
  import { RichEditClientCommand } from '../client-command';
5
5
  import { CommandSimpleOptions } from '../command-base';
6
6
  import { HyperlinkCommandBase } from './hyperlink-command-base';
7
- import { createUrlValidationOptions, isUrlValid } from '../../../common/utils/utils';
7
+ import { createUrlValidationOptions, UrlUtils } from '../../../common/utils/utils';
8
8
  export class OpenHyperlinkCommand extends HyperlinkCommandBase {
9
9
  executeCore(state, options) {
10
10
  let field;
@@ -25,13 +25,16 @@ export class OpenHyperlinkCommand extends HyperlinkCommandBase {
25
25
  this.history.endTransaction();
26
26
  this.aspxForceSendingRequest();
27
27
  }
28
- if (hyperlinkInfo.anchor)
28
+ if (hyperlinkInfo.isUri()) {
29
+ const options = createUrlValidationOptions(this.control.modelManager);
30
+ let uri = hyperlinkInfo.getUriWithAnchor();
31
+ if (!UrlUtils.isValid(uri, options))
32
+ uri = UrlUtils.EmptyPage;
33
+ Url.navigate(uri, "_blank");
34
+ }
35
+ else {
29
36
  this.control.commandManager.getCommand(RichEditClientCommand.GoToBookmark)
30
37
  .execute(this.control.commandManager.isPublicApiCall, new CommandSimpleOptions(this.control, hyperlinkInfo.anchor));
31
- else {
32
- const options = createUrlValidationOptions(this.control);
33
- if (isUrlValid(hyperlinkInfo.uri, options))
34
- Url.navigate(hyperlinkInfo.uri, "_blank");
35
38
  }
36
39
  return true;
37
40
  }
@@ -200,7 +200,7 @@ export class FloatingObjectDragDropChangePositionCommand extends CommandBase {
200
200
  const newRun = this.activeSubDocument.getRunAndIndexesByPosition(position).run;
201
201
  if (newRun.getType() == RunType.AnchoredTextBoxRun) {
202
202
  const oldTextBoxRun = oldRun;
203
- const originalSubDocument = this.control.modelManager.model.subDocuments[oldTextBoxRun.subDocId];
203
+ const originalSubDocument = this.control.modelManager.model.subDocumentsCollection.collection[oldTextBoxRun.subDocId];
204
204
  this.history.addAndRedo(new SwitchTextBoxSubDocumentsStateHistoryItem(this.modelManipulator, originalSubDocument, this.activeSubDocument, position));
205
205
  }
206
206
  }
@@ -44,7 +44,7 @@ export class InsertAnchoredTextBoxCommand extends CommandBase {
44
44
  anchorInfo.zOrder = this.modelManipulator.floatingObject.zOrder.getNewZOrder(options.subDocument);
45
45
  anchorInfo.layoutTableCell = true;
46
46
  history.addTransaction(() => {
47
- this.modelManipulator.textBox.insertAnchoredTextBoxViaHistoty(new SubDocumentPosition(this.selection.activeSubDocument, this.selection.lastSelectedInterval.start), this.inputPosition.charPropsBundle, new BaseTextBoxInfo(null, size, new Shape(ColorUtils.fromString(ColorUtils.colorNames.white), ColorHelper.BLACK_COLOR, UnitConverter.pointsToTwips(3.0 / 4)), anchorInfo, textBoxProperties, new NonVisualDrawingObjectInfo()));
47
+ this.modelManipulator.textBox.insertAnchoredTextBoxViaHistory(new SubDocumentPosition(this.selection.activeSubDocument, this.selection.lastSelectedInterval.start), this.inputPosition.charPropsBundle, new BaseTextBoxInfo(null, size, new Shape(ColorUtils.fromString(ColorUtils.colorNames.white), ColorHelper.BLACK_COLOR, UnitConverter.pointsToTwips(3.0 / 4)), anchorInfo, textBoxProperties, new NonVisualDrawingObjectInfo()));
48
48
  this.history.addAndRedo(new SelectionHistoryItem(this.modelManipulator, this.selection, this.selection.getState(), this.selection.getState().setInterval(new FixedInterval(this.selection.lastSelectedInterval.start, 1))));
49
49
  this.control.commandManager.getCommand(RichEditClientCommand.ChangeActiveSubDocumentToTextBox)
50
50
  .execute(this.control.commandManager.isPublicApiCall, options);
@@ -6,21 +6,27 @@ import { SubDocument } from '../../../model/sub-document';
6
6
  import { HtmlBuilder } from './html-builder';
7
7
  import { IExportModelOptions } from '../../i-document-exporter';
8
8
  interface List {
9
+ parentList?: List;
9
10
  numberingListIndex: number;
10
11
  listLevelIndex: number;
11
12
  start: number;
12
13
  end: number;
13
14
  }
15
+ interface IHtmlExporterOptions {
16
+ sanitaizeHyperlinkURIs?: boolean;
17
+ convertRelativeURIsToAbsolute?: boolean;
18
+ }
14
19
  export declare class HtmlExporter {
15
20
  rangeCopy: RangeCopy;
16
21
  private exportModelOptions;
22
+ private htmlExporterOptions;
17
23
  private get modelManager();
18
24
  private get colorProvider();
19
25
  private get unitConverter();
20
26
  private get documentRenderer();
21
27
  private get lastMaxNumPages();
22
28
  private get pageIndex();
23
- constructor(exportModelOptions: IExportModelOptions);
29
+ constructor(exportModelOptions: IExportModelOptions, htmlExporterOptions?: IHtmlExporterOptions);
24
30
  getHtmlElementsByInterval(model: DocumentModel, subDocument: SubDocument, interval: FixedInterval, guidLabel: string): HtmlBuilder;
25
31
  getParagraphsByInterval(subDocument: SubDocument, interval: FixedInterval): Paragraph[];
26
32
  getListsByParagraphs(paragraphs: Paragraph[]): List[];
@@ -24,6 +24,8 @@ import { TableWidthUnitType } from '../../../model/tables/secondary-structures/t
24
24
  import { HtmlConverter } from '../../../rich-utils/html-converter';
25
25
  import { HtmlBuilder } from './html-builder';
26
26
  import { isDefined } from '@devexpress/utils/lib/utils/common';
27
+ import { createUrlValidationOptions, UrlUtils } from '../../../../common/utils/utils';
28
+ import { ListUtils } from '@devexpress/utils/lib/utils/list';
27
29
  export class HtmlExporter {
28
30
  get modelManager() { return this.exportModelOptions.modelManager; }
29
31
  get colorProvider() { return this.modelManager.model.colorProvider; }
@@ -33,11 +35,13 @@ export class HtmlExporter {
33
35
  ;
34
36
  get pageIndex() { return this.exportModelOptions.pageIndex; }
35
37
  ;
36
- constructor(exportModelOptions) {
38
+ constructor(exportModelOptions, htmlExporterOptions = null) {
37
39
  this.rangeCopy = null;
38
40
  this.exportModelOptions = exportModelOptions;
41
+ this.htmlExporterOptions = htmlExporterOptions;
39
42
  }
40
43
  getHtmlElementsByInterval(model, subDocument, interval, guidLabel) {
44
+ var _a, _b, _c, _d;
41
45
  if (interval.length === 0)
42
46
  return;
43
47
  const unitTypeToString = this.unitConverter.getUnits() == RichEditUnit.Centimeter ? "cm" : "in";
@@ -337,7 +341,18 @@ export class HtmlExporter {
337
341
  break;
338
342
  }
339
343
  if (hyperlinkInfo && !isInsideHyperlink) {
340
- const url = hyperlinkInfo.uri + (hyperlinkInfo.anchor != "" ? "#" + hyperlinkInfo.anchor : "");
344
+ const sanitaizeHyperlinkURIs = (_b = (_a = this.htmlExporterOptions) === null || _a === void 0 ? void 0 : _a.sanitaizeHyperlinkURIs) !== null && _b !== void 0 ? _b : false;
345
+ const convertRelativeURIsToAbsolute = (_d = (_c = this.htmlExporterOptions) === null || _c === void 0 ? void 0 : _c.convertRelativeURIsToAbsolute) !== null && _d !== void 0 ? _d : false;
346
+ let url = hyperlinkInfo.uri;
347
+ const options = createUrlValidationOptions(this.exportModelOptions.modelManager);
348
+ if (!sanitaizeHyperlinkURIs || UrlUtils.isValid(url, options)) {
349
+ if (convertRelativeURIsToAbsolute && UrlUtils.isRelative(url))
350
+ url = UrlUtils.convertToAbsolute(url).href;
351
+ if (hyperlinkInfo.anchor != "")
352
+ url = url + "#" + hyperlinkInfo.anchor;
353
+ }
354
+ else
355
+ url = UrlUtils.EmptyPage;
341
356
  const tooltip = hyperlinkInfo.tip;
342
357
  html
343
358
  .clear()
@@ -455,42 +470,27 @@ export class HtmlExporter {
455
470
  }
456
471
  getListsByParagraphs(paragraphs) {
457
472
  const listsInInterval = [];
473
+ let previousList = null;
458
474
  for (let i = 0, paragraph; paragraph = paragraphs[i]; i++) {
459
475
  if (paragraph.isInList()) {
460
- const paragraphNumberingListIndex = paragraph.getNumberingListIndex();
461
- const paragraphListLevelIndex = paragraph.getListLevelIndex();
462
- const paragraphStart = paragraph.startLogPosition.value;
463
- const paragraphEnd = paragraph.getEndPosition();
464
- let existingItem = null;
465
- for (let j = 0; j < listsInInterval.length; j++) {
466
- if (listsInInterval[j].numberingListIndex === paragraphNumberingListIndex
467
- && listsInInterval[j].listLevelIndex === paragraphListLevelIndex) {
468
- existingItem = listsInInterval[j];
469
- }
470
- }
471
- if (existingItem && (paragraphListLevelIndex === 0 || existingItem.end == paragraphStart
472
- || listsInInterval[listsInInterval.length - 1].listLevelIndex > paragraphListLevelIndex)) {
473
- existingItem.end = paragraphEnd;
474
- }
475
- else {
476
- listsInInterval.push({
477
- numberingListIndex: paragraphNumberingListIndex,
478
- listLevelIndex: paragraphListLevelIndex,
479
- start: paragraphStart,
480
- end: paragraphEnd,
481
- });
482
- }
483
- let listLevelIndex = paragraphListLevelIndex;
484
- while (listLevelIndex > 0) {
485
- let parentItem = null;
486
- for (let j = 0; j < listsInInterval.length; j++) {
487
- if (listsInInterval[j].listLevelIndex == listLevelIndex - 1)
488
- parentItem = listsInInterval[j];
489
- }
490
- if (parentItem)
491
- parentItem.end = paragraphEnd;
492
- listLevelIndex--;
476
+ const numberingListIndex = paragraph.getNumberingListIndex();
477
+ const listLevelIndex = paragraph.getListLevelIndex();
478
+ const start = paragraph.startLogPosition.value;
479
+ const end = paragraph.getEndPosition();
480
+ let list = ListUtils.reverseElementBy(listsInInterval, (list) => {
481
+ return list.listLevelIndex <= (previousList === null || previousList === void 0 ? void 0 : previousList.listLevelIndex)
482
+ && list.numberingListIndex === numberingListIndex
483
+ && list.listLevelIndex === listLevelIndex;
484
+ });
485
+ if (!list) {
486
+ const parentList = (previousList === null || previousList === void 0 ? void 0 : previousList.numberingListIndex) === numberingListIndex ? previousList : null;
487
+ list = { parentList, numberingListIndex, listLevelIndex, start, end };
488
+ listsInInterval.push(list);
493
489
  }
490
+ previousList = list;
491
+ do {
492
+ list.end = end;
493
+ } while (list = list.parentList);
494
494
  }
495
495
  }
496
496
  return listsInInterval;
@@ -191,7 +191,7 @@ export class HtmlImporter {
191
191
  const missTag = HtmlImporter.MapMissTablePropertiesByTagNames[ListUtils.last(this.levelInfo).tagImporter.elementTag()];
192
192
  ListUtils.forEach(this.currElementChildren, (childElement) => {
193
193
  const childElemStyle = this.getStyles(childElement);
194
- if (!Object.keys(childElemStyle).length)
194
+ if (childElement.nodeType !== Node.ELEMENT_NODE)
195
195
  return;
196
196
  for (var prop in this.getStyles(element)) {
197
197
  if (missTag && /^(border|background|marginLeft)/gi.test(prop))
@@ -13,9 +13,7 @@ export class HtmlListTagImporterBase extends HtmlTagImporterBase {
13
13
  this.importer.addCurrLevelParagraphRunIfNeeded();
14
14
  const listIndex = this.importer.listIndex;
15
15
  const parentList = ListUtils.last(this.importer.listInfos);
16
- const listLevel = parentList
17
- ? parentList.listLevel + 1
18
- : 0;
16
+ const listLevel = parentList ? parentList.listLevel + 1 : 0;
19
17
  if (listLevel === 9) {
20
18
  this._ignored = true;
21
19
  return;
@@ -31,6 +29,8 @@ export class HtmlListTagImporterBase extends HtmlTagImporterBase {
31
29
  if (this._ignored)
32
30
  return;
33
31
  this.importer.listInfos.pop();
34
- this.importer.listIndex++;
32
+ const parentList = ListUtils.last(this.importer.listInfos);
33
+ if (!parentList)
34
+ this.importer.listIndex++;
35
35
  }
36
36
  }