devexpress-richedit 25.1.3 → 25.1.4-build-25191-0102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) 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 +1 -1
  9. package/dist/dx.richedit.js +253 -218
  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/commands/mail-merge-command.js +3 -2
  14. package/lib/client/commands/open-document-command.js +4 -0
  15. package/lib/client/formats/docx/export/exporters/relations/base.js +2 -2
  16. package/lib/client/formats/docx/import/destination/numbering/numberings-destination.js +1 -1
  17. package/lib/client/formats/docx/import/destination/runs/text-destination.js +1 -1
  18. package/lib/client/model-api/images/image-enums.js +1 -0
  19. package/lib/client/model-api/table/enums.js +4 -0
  20. package/lib/client/public/commands/enum.js +1 -0
  21. package/lib/client/public/ribbon/item-ids.js +1 -0
  22. package/lib/client/public/rich-edit.d.ts +5 -5
  23. package/lib/client/ribbon/toolbar-items/index.d.ts +1 -1
  24. package/lib/client/ribbon/toolbar-items/toolbar-item-template-creators/index.d.ts +7 -7
  25. package/lib/common/canvas/canvas-scroll-manager.js +1 -1
  26. package/lib/common/commands/dialogs/dialog-layout-options-command.js +0 -3
  27. package/lib/common/commands/floating-objects/floating-object-drag-drop-change-position-command.js +0 -3
  28. package/lib/common/commands/layout/toggle-show-hidden-symbols-command.js +0 -3
  29. package/lib/common/formats/html/export/html-export.d.ts +8 -0
  30. package/lib/common/formats/html/export/html-export.js +49 -26
  31. package/lib/common/formats/html/import/containers/runs.d.ts +2 -1
  32. package/lib/common/formats/html/import/containers/runs.js +2 -1
  33. package/lib/common/formats/html/import/html-importer.d.ts +0 -1
  34. package/lib/common/formats/html/import/html-importer.js +2 -3
  35. package/lib/common/formats/html/import/html-model-inserter.js +4 -0
  36. package/lib/common/formats/html/import/importers/list-base.js +2 -1
  37. package/lib/common/formats/rtf/utils/list-level-display-text-helper.js +2 -2
  38. package/lib/common/input-controller.js +1 -1
  39. package/lib/common/layout/main-structures/layout-row.d.ts +1 -2
  40. package/lib/common/layout/main-structures/layout-row.js +0 -1
  41. package/lib/common/layout-formatter/row/result.js +1 -1
  42. package/lib/common/layout-formatter/row/size-engine/row-formatting-info.d.ts +1 -0
  43. package/lib/common/layout-formatter/row/size-engine/row-formatting-info.js +2 -2
  44. package/lib/common/layout-formatter/row/size-engine/row-sizes-manager.d.ts +2 -0
  45. package/lib/common/layout-formatter/row/size-engine/row-sizes-manager.js +2 -0
  46. package/lib/common/layout-formatter/row/states.js +1 -1
  47. package/lib/common/layout-formatter/row/tab-info.d.ts +2 -1
  48. package/lib/common/layout-formatter/row/tab-info.js +40 -40
  49. package/lib/common/model/fields/parsers/field-code-parser-doc-variable.d.ts +1 -1
  50. package/lib/common/model/fields/parsers/field-code-parser.d.ts +1 -1
  51. package/lib/common/model/paragraph/paragraph-style.d.ts +1 -0
  52. package/lib/common/model/paragraph/paragraph-style.js +3 -0
  53. package/lib/common/scroll/canvas-states.d.ts +4 -4
  54. package/lib/common/scroll/model-states.d.ts +5 -5
  55. package/package.json +3 -3
  56. package/lib/client/formats/docx/import/destination/field/field-data-destination.d.ts +0 -0
  57. package/lib/client/formats/docx/import/destination/field/field-data-destination.js +0 -0
  58. package/lib/client/formats/docx/import/destination/field/form-field-destination.d.ts +0 -0
  59. package/lib/client/formats/docx/import/destination/field/form-field-destination.js +0 -0
  60. package/lib/client/formats/docx/import/destination/paragraph-properties/paragraph-mark-run-properties-destination.d.ts +0 -0
  61. package/lib/client/formats/docx/import/destination/paragraph-properties/paragraph-mark-run-properties-destination.js +0 -0
  62. package/lib/common/formats/rtf/import/properties-normalization/tmp.d.ts +0 -0
  63. package/lib/common/formats/rtf/import/properties-normalization/tmp.js +0 -0
  64. package/lib/common/layout-formatter/box/generator/multi-dimension-iterator.d.ts +0 -0
  65. package/lib/common/layout-formatter/box/generator/multi-dimension-iterator.js +0 -0
  66. package/lib/common/layout-formatter/table/layout-row-index-helper.d.ts +0 -0
  67. package/lib/common/layout-formatter/table/layout-row-index-helper.js +0 -0
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (index.d.ts)
3
- * Version: 25.1.3
3
+ * Version: 25.1.4
4
4
  * Copyright (c) 2012 - 2025 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: 25.1.3
3
+ * Version: 25.1.4
4
4
  * Copyright (c) 2012 - 2025 Developer Express Inc. ALL RIGHTS RESERVED
5
5
  * License: https://www.devexpress.com/Support/EULAs
6
6
  */
@@ -8,7 +8,6 @@ import { InsertParagraphManipulatorParams } from '../../common/model/manipulator
8
8
  import { RangeCopy } from '../../common/model/manipulators/range/create-range-copy-operation';
9
9
  import { InsertTextManipulatorParams } from '../../common/model/manipulators/text-manipulator/insert-text-manipulator-params';
10
10
  import { ControlOptions, DocumentCapability } from '../../common/model/options/control';
11
- import { RichUtils } from '../../common/model/rich-utils';
12
11
  import { RunType } from '../../common/model/runs/run-type';
13
12
  import { SectionStartType } from '../../common/model/section/enums';
14
13
  import { SubDocumentIntervals, SubDocumentPosition } from '../../common/model/sub-document';
@@ -125,8 +124,10 @@ export class MailMergeCommand extends CommandBase {
125
124
  replaceMergeFieldsInSubDocument(modelManager, record, lastProcessedPositionInMainSubDocument, subDoc) {
126
125
  const processField = (parser) => {
127
126
  if (parser instanceof FieldCodeParserMailMerge) {
127
+ parser.update(null);
128
128
  const fieldName = parser.getMergeFieldName();
129
- return RichUtils.replaceParagraphEndCharsWithLineBreak(this.getResultByFieldName(record, fieldName));
129
+ const simpleText = this.getResultByFieldName(record, fieldName);
130
+ return parser.getFormattedResult(simpleText);
130
131
  }
131
132
  return null;
132
133
  };
@@ -71,6 +71,8 @@ export class OpenDocumentCommand extends CommandBase {
71
71
  return false;
72
72
  this.beforeOpen();
73
73
  core.activeDocumentImporter.importFromFile(file, this.control.modelManager.richOptions, (documentModel, formatImagesImporter) => {
74
+ if (core.isDisposed)
75
+ return;
74
76
  core.activeDocumentImporter = null;
75
77
  this.openCore(fileName, format, documentModel, formatImagesImporter, extension);
76
78
  if (!this.suppressUpdateFields)
@@ -78,6 +80,8 @@ export class OpenDocumentCommand extends CommandBase {
78
80
  if (callback)
79
81
  callback(true, null);
80
82
  }, (reason) => {
83
+ if (core.isDisposed)
84
+ return;
81
85
  core.activeDocumentImporter = null;
82
86
  this.control.loadingPanelManager.loadingPanel.setVisible(false);
83
87
  NewDocumentCommand.newDocumentInner.call(this);
@@ -21,9 +21,9 @@ export class RelationsBaseExporter extends ExporterBaseWithRootElement {
21
21
  urlEncodeAsciiSpecialSymbols(url) {
22
22
  if (url) {
23
23
  if (url.indexOf(' ') >= 0)
24
- url = url.replace(' ', '%20');
24
+ url = url.replace(/ /g, '%20');
25
25
  if (url.indexOf('\'') >= 0)
26
- url = url.replace("\'", '%27');
26
+ url = url.replace(/'/g, '%27');
27
27
  }
28
28
  return url;
29
29
  }
@@ -438,7 +438,7 @@ export class ListLevelFormatStringDestination extends ListLevelElementDestinatio
438
438
  }
439
439
  convertFormatString(value) {
440
440
  const regex = new RegExp(/%\d/);
441
- let result = value.replace('{', '{{').replace('}', '}}');
441
+ let result = value.replace(/{/g, '{{').replace(/}/g, '}}');
442
442
  let match = result.match(regex);
443
443
  if (match) {
444
444
  do {
@@ -16,6 +16,6 @@ export class TextDestination extends ElementDestination {
16
16
  return true;
17
17
  }
18
18
  replaceLineBreakOnSpace(text) {
19
- return text.replace('\n', ' ');
19
+ return text.replace(/\n/g, ' ');
20
20
  }
21
21
  }
@@ -1,3 +1,4 @@
1
+ import { AnchorObjectVerticalPositionAlignment } from '../../../common/model/floating-objects/enums';
1
2
  export var FloatingObjectHorizontalPositionTypeApi;
2
3
  (function (FloatingObjectHorizontalPositionTypeApi) {
3
4
  FloatingObjectHorizontalPositionTypeApi[FloatingObjectHorizontalPositionTypeApi["Aligned"] = 0] = "Aligned";
@@ -1,3 +1,7 @@
1
+ import { ParagraphAlignment } from '../../../common/model/paragraph/paragraph-properties';
2
+ import { BorderLineStyle } from '../../../common/model/borders/enums';
3
+ import { TableCellVerticalAlignment } from '../../../common/model/tables/secondary-structures/table-base-structures';
4
+ import { TableHeightUnitType, TableWidthUnitType } from '../../../common/model/tables/secondary-structures/table-units';
1
5
  export var BorderLineStyleApi;
2
6
  (function (BorderLineStyleApi) {
3
7
  BorderLineStyleApi[BorderLineStyleApi["Nil"] = -1] = "Nil";
@@ -1,3 +1,4 @@
1
+ import { RichEditClientCommand as Command } from '../../../common/commands/client-command';
1
2
  export var FileTabCommandId;
2
3
  (function (FileTabCommandId) {
3
4
  FileTabCommandId[FileTabCommandId["CreateDocument"] = 412] = "CreateDocument";
@@ -1,3 +1,4 @@
1
+ import { RichEditClientCommand as Command } from '../../../common/commands/client-command';
1
2
  export var FileTabItemId;
2
3
  (function (FileTabItemId) {
3
4
  FileTabItemId[FileTabItemId["CreateNewDocument"] = 412] = "CreateNewDocument";
@@ -118,20 +118,20 @@ declare enum PrintModeApi {
118
118
  Html = 1,
119
119
  Pdf = 2
120
120
  }
121
- export { CharacterPropertiesApi as CharacterProperties, CharacterPropertiesScriptApi as CharacterPropertiesScript, ICharacterProperties } from '../model-api/character-properties';
121
+ export { CharacterPropertiesApi as CharacterProperties, CharacterPropertiesScriptApi as CharacterPropertiesScript, type ICharacterProperties } from '../model-api/character-properties';
122
122
  export { HyperlinkInfoApi as HyperlinkInfo } from '../model-api/field';
123
123
  export { IntervalApi as Interval } from '../model-api/interval';
124
124
  export { ListTypeApi as ListType, ListLevelNumberAlignmentApi as ListLevelNumberAlignment, ListLevelFormatApi as ListLevelFormat } from '../model-api/lists/enums';
125
125
  export { ListLevelSettingsApi as ListLevelSettings } from '../model-api/lists/list-level-settings';
126
126
  export { ListApi as List } from '../model-api/lists/lists';
127
- export { ParagraphAlignmentApi as ParagraphAlignment, ParagraphLineSpacingTypeApi as ParagraphLineSpacingType, ParagraphFirstLineIndentApi as ParagraphFirstLineIndent, ParagraphPropertiesApi as ParagraphProperties, ParagraphApi as Paragraph, IParagraphProperties } from '../model-api/paragraph';
128
- export { MarginsApi as Margins, SizeApi as Size, IMargins, } from '../model-api/size';
127
+ export { ParagraphAlignmentApi as ParagraphAlignment, ParagraphLineSpacingTypeApi as ParagraphLineSpacingType, ParagraphFirstLineIndentApi as ParagraphFirstLineIndent, ParagraphPropertiesApi as ParagraphProperties, ParagraphApi as Paragraph, type IParagraphProperties } from '../model-api/paragraph';
128
+ export { MarginsApi as Margins, SizeApi as Size, type IMargins, } from '../model-api/size';
129
129
  export { SubDocumentTypeApi as SubDocumentType, HeaderFooterTypeApi as HeaderFooterType, SectionBreakTypeApi as SectionBreakType, SubDocumentApi as SubDocument } from '../model-api/sub-document';
130
130
  export { BookmarkApi as Bookmark } from '../model-api/bookmark';
131
131
  export { BookmarkClientApi as BookmarkBase } from '../api/bookmark';
132
132
  export { PaperSizeApi as PaperSize } from '../model-api/section';
133
133
  export { TableApi as Table } from '../model-api/table/table';
134
- export { TableBordersBaseApi as TableBordersBase, TableBordersApi as TableBorders, TableCellBordersApi as TableCellBorders, TableBorderApi as TableBorder, ITableBorders, ITableCellBorders, } from '../model-api/table/table-borders';
134
+ export { TableBordersBaseApi as TableBordersBase, TableBordersApi as TableBorders, TableCellBordersApi as TableCellBorders, TableBorderApi as TableBorder, type ITableBorders, type ITableCellBorders, } from '../model-api/table/table-borders';
135
135
  export { TableStyleOptionsApi as TableStyleOptions } from '../model-api/table/table-style-options';
136
136
  export { TableWidthTypeApi as TableWidthType, TableContentVerticalAlignmentApi as TableContentVerticalAlignment, TableContentHorizontalAlignmentApi as TableContentHorizontalAlignment, TableRowHeightTypeApi as TableRowHeightType, BorderLineStyleApi as BorderLineStyle, } from '../model-api/table/enums';
137
137
  export { SectionApi as Section } from '../model-api/section';
@@ -175,7 +175,7 @@ export { TableLayoutTabCommandId };
175
175
  export { FloatingObjectsFormatTabCommandId };
176
176
  export { ContextMenuCommandId };
177
177
  export { WrapTypeApi as WrapType, WrapSideApi as WrapSide, FloatingObjectHorizontalAlignmentApi as FloatingObjectHorizontalAlignment, FloatingObjectHorizontalAnchorElementApi as FloatingObjectHorizontalAnchorElement, FloatingObjectHorizontalPositionTypeApi as FloatingObjectHorizontalPositionType, FloatingObjectVerticalAnchorElementApi as FloatingObjectVerticalAnchorElement, FloatingObjectVerticalAlignmentApi as FloatingObjectVerticalAlignment, FloatingObjectVerticalPositionTypeApi as FloatingObjectVerticalPositionType } from '../model-api/images/image-enums';
178
- export { HorizontalAbsolutePositionApi as HorizontalAbsolutePosition, HorizontalAlignedPositionApi as HorizontalAlignedPosition, HorizontalRelativePositionApi as HorizontalRelativePosition, VerticalAbsolutePositionApi as VerticalAbsolutePosition, VerticalAlignedPositionApi as VerticalAlignedPosition, VerticalRelativePositionApi as VerticalRelativePosition, IFloatingObjectDistanceApi as IFloatingObjectDistance, IHorizontalAlignedPositionApi as IHorizontalAlignedPosition, IHorizontalAbsolutePositionApi as IHorizontalAbsolutePosition, IHorizontalRelativePositionApi as IHorizontalRelativePosition, IVerticalAlignedPositionApi as IVerticalAlignedPosition, IVerticalAbsolutePositionApi as IVerticalAbsolutePosition, IVerticalRelativePositionApi as IVerticalRelativePosition, IInsertedFloatingImageOptionsApi as IInsertedFloatingImageOptions, IInsertedInlineImageOptionsApi as IInsertedInlineImageOptions, } from '../model-api/images/image-interfaces';
178
+ export { HorizontalAbsolutePositionApi as HorizontalAbsolutePosition, HorizontalAlignedPositionApi as HorizontalAlignedPosition, HorizontalRelativePositionApi as HorizontalRelativePosition, VerticalAbsolutePositionApi as VerticalAbsolutePosition, VerticalAlignedPositionApi as VerticalAlignedPosition, VerticalRelativePositionApi as VerticalRelativePosition, type IFloatingObjectDistanceApi as IFloatingObjectDistance, type IHorizontalAlignedPositionApi as IHorizontalAlignedPosition, type IHorizontalAbsolutePositionApi as IHorizontalAbsolutePosition, type IHorizontalRelativePositionApi as IHorizontalRelativePosition, type IVerticalAlignedPositionApi as IVerticalAlignedPosition, type IVerticalAbsolutePositionApi as IVerticalAbsolutePosition, type IVerticalRelativePositionApi as IVerticalRelativePosition, type IInsertedFloatingImageOptionsApi as IInsertedFloatingImageOptions, type IInsertedInlineImageOptionsApi as IInsertedInlineImageOptions, } from '../model-api/images/image-interfaces';
179
179
  export { FloatingImageApi as FloatingImage } from '../model-api/images/floating-image';
180
180
  export { InlineImageApi as InlineImage } from '../model-api/images/inline-image';
181
181
  export { ImageApi as Image } from '../model-api/images/image';
@@ -4,7 +4,7 @@ export { ToolbarMenuItem } from './toolbar-menu-item';
4
4
  export { ToolbarSelectBoxItem } from './toolbar-select-box-item';
5
5
  export { ToolbarSeparatorItem } from './toolbar-separator-item';
6
6
  export { ToolbarItemBase } from './toolbar-item-base';
7
- export { InteractiveItemOptions, ToolbarInteractiveItem } from './toolbar-interactive-item';
7
+ export { type InteractiveItemOptions, ToolbarInteractiveItem } from './toolbar-interactive-item';
8
8
  export { ToolbarSubMenuItem } from './toolbar-sub-menu-item';
9
9
  export { ToolbarColorBoxItem } from './toolbar-color-box-item';
10
10
  export { ToolbarNumberBoxItem } from './toolbar-number-box-item';
@@ -1,8 +1,8 @@
1
- export { ButtonToolbarItemTemplateCreator, IButtonToolbarItemTemplateCreatorOptions } from './button-toolbar-item-template-creator';
2
- export { ButtonGroupToolbarItemTemplateCreator, IButtonGroupToolbarItemTemplateCreatorOptions } from './button-group-toolbar-item-template-creator';
3
- export { MenuToolbarItemTemplateCreator, IMenuToolbarItemTemplateCreatorOptions } from './menu-toolbar-item-template-creator';
4
- export { SelectBoxToolbarItemTemplateCreator, ISelectBoxToolbarItemTemplateCreatorOptions } from './select-box-toolbar-item-template-creator';
1
+ export { ButtonToolbarItemTemplateCreator, type IButtonToolbarItemTemplateCreatorOptions } from './button-toolbar-item-template-creator';
2
+ export { ButtonGroupToolbarItemTemplateCreator, type IButtonGroupToolbarItemTemplateCreatorOptions } from './button-group-toolbar-item-template-creator';
3
+ export { MenuToolbarItemTemplateCreator, type IMenuToolbarItemTemplateCreatorOptions } from './menu-toolbar-item-template-creator';
4
+ export { SelectBoxToolbarItemTemplateCreator, type ISelectBoxToolbarItemTemplateCreatorOptions } from './select-box-toolbar-item-template-creator';
5
5
  export { SeparatorToolbarItemTemplateCreator } from './separator-toolbar-item-template-creator';
6
- export { NumberBoxToolbarItemTemplateCreator, INumberBoxToolbarItemTemplateCreatorOptions } from './number-box-toolbar-item-template-creator';
7
- export { ColorBoxToolbarItemTemplateCreator, IColorBoxToolbarItemTemplateCreatorOptions } from './color-box-toolbar-item-template-creator';
8
- export { IToolbarItemTemplateCreator } from './base-types';
6
+ export { NumberBoxToolbarItemTemplateCreator, type INumberBoxToolbarItemTemplateCreatorOptions } from './number-box-toolbar-item-template-creator';
7
+ export { ColorBoxToolbarItemTemplateCreator, type IColorBoxToolbarItemTemplateCreatorOptions } from './color-box-toolbar-item-template-creator';
8
+ export { type IToolbarItemTemplateCreator } from './base-types';
@@ -69,7 +69,7 @@ export class CanvasScrollManager {
69
69
  height.clear().addLayoutSize(position.page.height);
70
70
  if (relativePosition === RelativePosition.Bottom)
71
71
  y.subtractUISize(this.sizes.getVisibleAreaHeight(false));
72
- y.addUISize(canvasState.getVerticalOffset(this.sizes));
72
+ y.addLayoutSize(canvasState.getVerticalOffset(this.sizes));
73
73
  if (relativePosition === RelativePosition.Inside) {
74
74
  let scrollTop = this.canvas.scrollTop;
75
75
  const scrollVisibleAreaHeight = this.sizes.getVisibleAreaHeight(false);
@@ -58,7 +58,6 @@ export class DialogLayoutOptionsCommand extends ShowDialogCommandBase {
58
58
  let run = subDocument.getRunByPosition(position);
59
59
  let modelManipulator = this.modelManipulator;
60
60
  let anchorInfoManipulator = modelManipulator.floatingObject.anchorInfo;
61
- const topInfo = this.control.viewManager.canvasManager.getScrollTopInfo();
62
61
  let history = this.history;
63
62
  history.beginTransaction();
64
63
  let changed = false;
@@ -224,8 +223,6 @@ export class DialogLayoutOptionsCommand extends ShowDialogCommandBase {
224
223
  changed = true;
225
224
  }
226
225
  history.endTransaction();
227
- if (topInfo)
228
- this.selection.scrollManager.setScroll(new ScrollState().byScrollInfo.setPageInfo(topInfo));
229
226
  return changed;
230
227
  }
231
228
  getDialogName() {
@@ -11,7 +11,6 @@ import { Point } from '@devexpress/utils/lib/geometry/point';
11
11
  import { HitTestDeviation, RectangleDeviation, Rectangle as Rect } from '@devexpress/utils/lib/geometry/rectangle';
12
12
  import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
13
13
  import { SelectionHistoryItem } from '../../model/history/selection/selection-history-item';
14
- import { ScrollState } from '../../scroll/model-states';
15
14
  import { RichEditClientCommand } from '../client-command';
16
15
  import { CommandBase, CommandOptions } from '../command-base';
17
16
  import { SimpleCommandState } from '../command-states';
@@ -45,7 +44,6 @@ export class FloatingObjectDragDropChangePositionCommand extends CommandBase {
45
44
  this.getFloatingObjectParentSubDocument().isEditable([new FixedInterval(specialRunInfo.getPosition(), 1)]);
46
45
  }
47
46
  executeCore(_state, options) {
48
- const topInfo = this.control.viewManager.canvasManager.getScrollTopInfo();
49
47
  const runInfo = this.activeSubDocument.getRunAndIndexesByPosition(this.selection.specialRunInfo.getPosition());
50
48
  const oldRun = runInfo.run.clone();
51
49
  const oldRunPos = runInfo.getAbsoluteRunPosition();
@@ -60,7 +58,6 @@ export class FloatingObjectDragDropChangePositionCommand extends CommandBase {
60
58
  this.changeActiveSubDocument(initialHtr, finalClickPoint);
61
59
  this.move(oldRun, oldRunPos, initialHtr, options.endPageIndex, options.finalPoint);
62
60
  this.history.endTransaction();
63
- this.selection.scrollManager.setScroll(new ScrollState().byScrollInfo.setPageInfo(topInfo));
64
61
  return true;
65
62
  }
66
63
  changeActiveSubDocument(htr, point) {
@@ -1,4 +1,3 @@
1
- import { ScrollState } from '../../scroll/model-states';
2
1
  import { CommandBase } from '../command-base';
3
2
  import { SimpleCommandState } from '../command-states';
4
3
  export class ToggleShowHiddenSymbolsCommand extends CommandBase {
@@ -12,9 +11,7 @@ export class ToggleShowHiddenSymbolsCommand extends CommandBase {
12
11
  let newValue = options.param;
13
12
  if (newValue !== this.control.innerClientProperties.showHiddenSymbols) {
14
13
  this.control.innerClientProperties.showHiddenSymbols = newValue;
15
- const topInfo = this.control.viewManager.canvasManager.getScrollTopInfo();
16
14
  this.control.layoutFormatterManager.invalidator.onChangedAllLayout();
17
- this.selection.scrollManager.setScroll(new ScrollState().byScrollInfo.setPageInfo(topInfo));
18
15
  return true;
19
16
  }
20
17
  return false;
@@ -5,12 +5,19 @@ import { Paragraph } from '../../../model/paragraph/paragraph';
5
5
  import { SubDocument } from '../../../model/sub-document';
6
6
  import { HtmlBuilder } from './html-builder';
7
7
  import { IExportModelOptions } from '../../i-document-exporter';
8
+ interface ListInterval {
9
+ listStartValue: number;
10
+ start: number;
11
+ end: number;
12
+ }
8
13
  interface List {
9
14
  parentList?: List;
10
15
  numberingListIndex: number;
11
16
  listLevelIndex: number;
12
17
  start: number;
13
18
  end: number;
19
+ intervals: ListInterval[];
20
+ paragraphsCount: number;
14
21
  }
15
22
  interface IHtmlExporterOptions {
16
23
  sanitaizeHyperlinkURIs?: boolean;
@@ -30,6 +37,7 @@ export declare class HtmlExporter {
30
37
  getHtmlElementsByInterval(model: DocumentModel, subDocument: SubDocument, interval: FixedInterval, guidLabel: string): HtmlBuilder;
31
38
  getParagraphsByInterval(subDocument: SubDocument, interval: FixedInterval): Paragraph[];
32
39
  getListsByParagraphs(paragraphs: Paragraph[]): List[];
40
+ updateListIntervals(list: List, start: number, end: number): void;
33
41
  private addParentTableRecursively;
34
42
  startList(model: DocumentModel, subDocument: SubDocument, interval: FixedInterval, builder: HtmlBuilder, lists: List[], position: number): void;
35
43
  private endList;
@@ -287,7 +287,7 @@ export class HtmlExporter {
287
287
  .configure((el) => {
288
288
  el.setAttribute('border', '1');
289
289
  el.style.cssText = 'border-width: 0px; border-collapse: collapse; border-spacing: 0px;';
290
- el.setAttribute('id', guidLabel.replace("id=\"", "").replace("\"", ""));
290
+ el.setAttribute('id', guidLabel.replace(/id="/g, "").replace(/"/g, ""));
291
291
  })
292
292
  .startChild('tbody')
293
293
  .startChild('tr')
@@ -484,17 +484,26 @@ export class HtmlExporter {
484
484
  });
485
485
  if (!list) {
486
486
  const parentList = (previousList === null || previousList === void 0 ? void 0 : previousList.numberingListIndex) === numberingListIndex ? previousList : null;
487
- list = { parentList, numberingListIndex, listLevelIndex, start, end };
487
+ list = { parentList, numberingListIndex, listLevelIndex, start, end, intervals: [], paragraphsCount: 0 };
488
488
  listsInInterval.push(list);
489
489
  }
490
+ list.paragraphsCount++;
490
491
  previousList = list;
491
- do {
492
- list.end = end;
493
- } while (list = list.parentList);
492
+ this.updateListIntervals(list, start, end);
494
493
  }
495
494
  }
496
495
  return listsInInterval;
497
496
  }
497
+ updateListIntervals(list, start, end) {
498
+ list.end = end;
499
+ const lastInterval = list.intervals.at(-1);
500
+ if (lastInterval && lastInterval.end === start)
501
+ lastInterval.end = end;
502
+ else
503
+ list.intervals.push({ start, end, listStartValue: list.paragraphsCount });
504
+ if (list.parentList)
505
+ this.updateListIntervals(list.parentList, start, end);
506
+ }
498
507
  addParentTableRecursively(model, builder, parentCell, paragraphStartPosition) {
499
508
  const parentRow = parentCell.parentRow;
500
509
  const parentTable = parentRow.parentTable;
@@ -532,51 +541,65 @@ export class HtmlExporter {
532
541
  startList(model, subDocument, interval, builder, lists, position) {
533
542
  if (!lists.length)
534
543
  return;
535
- let listIndex = lists.findIndex((list) => list.start === position);
536
- if (listIndex < 0 && position === interval.start) {
544
+ const listsToStart = lists.filter(list => list.intervals.some(interval => interval.start === position));
545
+ if (!listsToStart.length && position === interval.start) {
537
546
  const firstParagraph = subDocument.getParagraphByPosition(position);
538
547
  if (firstParagraph.getNumberingListIndex() === lists[0].numberingListIndex)
539
- listIndex = 0;
548
+ listsToStart.push(lists[0]);
540
549
  }
541
- if (listIndex > -1) {
542
- const numberingList = model.numberingLists[lists[listIndex].numberingListIndex];
543
- const numberingListFormat = numberingList.levels[lists[listIndex].listLevelIndex].getListLevelProperties().format;
544
- const numberingListType = numberingList.getListType();
545
- let listFormatType = "";
546
- switch (numberingListFormat) {
550
+ for (const list of listsToStart) {
551
+ const numberingList = model.numberingLists[list.numberingListIndex];
552
+ const level = numberingList.levels[list.listLevelIndex];
553
+ const format = level.getListLevelProperties().format;
554
+ const listType = numberingList.getListType();
555
+ const levelStart = level.getNewStart();
556
+ const intervalStart = list.intervals.find(interval => interval.start === position).listStartValue;
557
+ const listStart = Math.max(levelStart, intervalStart);
558
+ let listStyleType = "";
559
+ switch (format) {
547
560
  case NumberingFormat.Bullet:
548
- listFormatType = "disc";
561
+ listStyleType = "disc";
549
562
  break;
550
563
  case NumberingFormat.Decimal:
551
- listFormatType = "decimal";
564
+ listStyleType = "decimal";
552
565
  break;
553
566
  case NumberingFormat.LowerLetter:
554
- listFormatType = "lower-alpha";
567
+ listStyleType = "lower-alpha";
555
568
  break;
556
569
  case NumberingFormat.UpperLetter:
557
- listFormatType = "upper-alpha";
570
+ listStyleType = "upper-alpha";
558
571
  break;
559
572
  case NumberingFormat.LowerRoman:
560
- listFormatType = "lower-roman";
573
+ listStyleType = "lower-roman";
561
574
  break;
562
575
  case NumberingFormat.UpperRoman:
563
- listFormatType = "upper-roman";
576
+ listStyleType = "upper-roman";
564
577
  break;
565
578
  default:
566
579
  break;
567
580
  }
568
581
  builder
569
- .startChild(numberingListType !== NumberingType.Bullet ? "ol" : "ul")
570
- .configure((e) => e.style.cssText = "list-style-type:" + listFormatType);
582
+ .startChild(listType !== NumberingType.Bullet ? "ol" : "ul")
583
+ .configure((e) => {
584
+ e.style.cssText = "list-style-type:" + listStyleType;
585
+ if (listStart > 1)
586
+ e.setAttribute("start", listStart.toString());
587
+ });
571
588
  }
572
589
  }
573
590
  endList(model, builder, lists, endPosition) {
574
591
  for (let i = lists.length - 1; i >= 0; i--) {
575
- if (lists[i].end === endPosition) {
576
- const listType = model.numberingLists[lists[i].numberingListIndex].getListType();
577
- lists.splice(i, 1);
578
- builder.endChild(listType != NumberingType.Bullet ? "ol" : "ul");
592
+ const list = lists[i];
593
+ for (let j = list.intervals.length - 1; j >= 0; j--) {
594
+ const interval = list.intervals[j];
595
+ if (interval.end === endPosition) {
596
+ const listType = model.numberingLists[list.numberingListIndex].getListType();
597
+ builder.endChild(listType !== NumberingType.Bullet ? "ol" : "ul");
598
+ list.intervals.splice(j, 1);
599
+ }
579
600
  }
601
+ if (list.intervals.length === 0)
602
+ lists.splice(i, 1);
580
603
  }
581
604
  }
582
605
  getHtmlText(text) {
@@ -31,7 +31,8 @@ export declare class ImportedParagraphListInfo {
31
31
  listType: NumberingType;
32
32
  displayFormatString: string;
33
33
  maskedCharacterProperties: MaskedCharacterProperties;
34
- constructor(listIndex: number, listLevel: number, listFormat: NumberingFormat, listType: NumberingType, displayFormatString: string, maskedCharacterProperties: MaskedCharacterProperties);
34
+ newStart: number;
35
+ constructor(listIndex: number, listLevel: number, listFormat: NumberingFormat, listType: NumberingType, displayFormatString: string, maskedCharacterProperties: MaskedCharacterProperties, newStart?: number);
35
36
  }
36
37
  export declare class ImportedParagraphRunInfo extends RunInfo {
37
38
  listInfo: ImportedParagraphListInfo;
@@ -40,13 +40,14 @@ export class ImportedTextRunInfo extends RunInfo {
40
40
  }
41
41
  ImportedTextRunInfo.tabRegex = new RegExp(RichUtils.specialCharacters.NonBreakingSpace + "{1,}", "gi");
42
42
  export class ImportedParagraphListInfo {
43
- constructor(listIndex, listLevel, listFormat, listType, displayFormatString, maskedCharacterProperties) {
43
+ constructor(listIndex, listLevel, listFormat, listType, displayFormatString, maskedCharacterProperties, newStart = 1) {
44
44
  this.listIndex = listIndex;
45
45
  this.listLevel = listLevel;
46
46
  this.listFormat = listFormat;
47
47
  this.listType = listType;
48
48
  this.displayFormatString = displayFormatString;
49
49
  this.maskedCharacterProperties = maskedCharacterProperties;
50
+ this.newStart = newStart;
50
51
  }
51
52
  }
52
53
  export class ImportedParagraphRunInfo extends RunInfo {
@@ -38,7 +38,6 @@ export declare class HtmlImporter {
38
38
  get currElement(): HTMLElement;
39
39
  get currElementChildren(): HTMLElement[];
40
40
  levelInfo: LevelInfo[];
41
- get prevLevelInfo(): LevelInfo;
42
41
  get currLevelInfo(): LevelInfo;
43
42
  get currListItemLevelInfo(): LevelInfo | null;
44
43
  fieldsId: number;
@@ -72,7 +72,6 @@ export class HtmlImporter {
72
72
  ;
73
73
  get currElementChildren() { return ListUtils.last(this.levelInfo).childElements; }
74
74
  ;
75
- get prevLevelInfo() { return this.levelInfo[this.levelInfo.length - 2]; }
76
75
  get currLevelInfo() { return ListUtils.last(this.levelInfo); }
77
76
  get currListItemLevelInfo() { return ListUtils.reverseElementBy(this.levelInfo, (levelInfo) => { var _a; return ((_a = levelInfo.tagImporter) === null || _a === void 0 ? void 0 : _a.elementTag()) === 'LI'; }); }
78
77
  get currListInfo() {
@@ -305,7 +304,7 @@ export class HtmlImporter {
305
304
  html = html.replace(/<o:[pP][^>]*>\s*<\/o:[pP]>/gi, '');
306
305
  html = html.replace(/<o:[pP][^>]*>.*?<\/o:[pP]>/gi, '&nbsp;');
307
306
  html = html.replace(/<st1:.*?>/gi, '');
308
- html = html.replace(/<\!--[\s\S]*?-->/g, '');
307
+ html = html.replace(/<!--[\s\S]*?(-->|$)/g, '');
309
308
  html = html.replace(/\s*style="\s*"/gi, '');
310
309
  html = html.replace(/style=""/ig, "");
311
310
  html = html.replace(/style=''/ig, "");
@@ -346,7 +345,7 @@ export class HtmlImporter {
346
345
  html = html.replace(/\n/gi, RichUtils.specialCharacters.LineBreak);
347
346
  html = html.replace(/(<\/(?!(p)+)(\s*[^>]*)?>)<\/td>/gi, '$1<p>&nbsp;</p></td>');
348
347
  html = html.replace(/(<\/(?!(p)+)(\s*[^>]*)?>)<\/th>/gi, '$1<p>&nbsp;</p></th>');
349
- html = html.replace(/<script(\s[^>]*)?>[\s\S]*?<\/script>/gi, '');
348
+ html = html.replace(/<script\b[^>]*>[\s\S]*?(<\/script\b[^>]*>|$)/gi, '');
350
349
  html = html.replace(/<u>([\s\S]*?)<\/u>/gi, '<span style="text-decoration: underline">$1</span>');
351
350
  html = html.replace(/<s>([\s\S]*?)<\/s>/gi, '<span style="text-decoration: line-through">$1</span>');
352
351
  html = html.replace(/<\/([^\s>]+)(\s[^>]*)?><br><\/([^\s>]+)(\s[^>]*)?>/gi, '');
@@ -144,6 +144,10 @@ export class HtmlModelInserter {
144
144
  if (listInfo.displayFormatString) {
145
145
  modelManipulator.numberingList.listLevelProperties.displayFormatString.setValue(model, false, targetListIndex, listLevelIndex, listInfo.displayFormatString);
146
146
  }
147
+ if (listInfo.newStart) {
148
+ modelManipulator.numberingList.setIOverrideListLevelNewStart(numberingListIndex, listLevelIndex, listInfo.newStart);
149
+ modelManipulator.numberingList.setIOverrideListLevelOverrideStart(numberingListIndex, listLevelIndex, true);
150
+ }
147
151
  if (listInfo.maskedCharacterProperties) {
148
152
  listLevel.setCharacterProperties(listInfo.maskedCharacterProperties);
149
153
  listLevel.onCharacterPropertiesChanged();
@@ -20,7 +20,8 @@ export class HtmlListTagImporterBase extends HtmlTagImporterBase {
20
20
  }
21
21
  const listFormat = ParagraphListPropertiesUtils.getListType(this.element);
22
22
  const displayFormat = ParagraphListPropertiesUtils.importDisplayFormatStringByParentListFormat(listFormat, parentList === null || parentList === void 0 ? void 0 : parentList.listFormat, listLevel);
23
- this.importer.listInfos.push(new ImportedParagraphListInfo(listIndex, listLevel, listFormat, listFormat == NumberingFormat.Bullet ? NumberingType.Bullet : NumberingType.MultiLevel, displayFormat, null));
23
+ const startIndex = parseInt(this.element.getAttribute('start'));
24
+ this.importer.listInfos.push(new ImportedParagraphListInfo(listIndex, listLevel, listFormat, listFormat == NumberingFormat.Bullet ? NumberingType.Bullet : NumberingType.MultiLevel, displayFormat, null, startIndex));
24
25
  }
25
26
  isImportChildren() {
26
27
  return true;
@@ -18,8 +18,8 @@ export class ListLevelDisplayTextHelper {
18
18
  static getTextRange(placeholderIndices, startPlaceHolderIndex, text) {
19
19
  var index = placeholderIndices[startPlaceHolderIndex] + 1;
20
20
  var result = text.substr(index, placeholderIndices[startPlaceHolderIndex + 1] - index);
21
- result = result.replace("{", "{{");
22
- result = result.replace("}", "}}");
21
+ result = result.replace(/{/g, "{{");
22
+ result = result.replace(/}/g, "}}");
23
23
  return result;
24
24
  }
25
25
  }
@@ -828,7 +828,7 @@ export class InputController {
828
828
  }
829
829
  static getCopyPasteHtmlContentForEditable(html, guidLabel) {
830
830
  const builder = new HtmlBuilder();
831
- const id = guidLabel.replace("id=\"", "").replace("\"", "");
831
+ const id = guidLabel.replace(/id="/g, "").replace(/"/g, "");
832
832
  builder
833
833
  .startChild('a')
834
834
  .configure((el) => {
@@ -13,8 +13,7 @@ export declare enum LayoutRowStateFlags {
13
13
  SectionEnd = 8,
14
14
  DocumentEnd = 16,
15
15
  CellTableEnd = 64,
16
- PageBreakBefore = 128,
17
- InfinityWidth = 256
16
+ PageBreakBefore = 128
18
17
  }
19
18
  export declare class LayoutRow extends Rectangle {
20
19
  boxes: LayoutBox[];
@@ -12,7 +12,6 @@ export var LayoutRowStateFlags;
12
12
  LayoutRowStateFlags[LayoutRowStateFlags["DocumentEnd"] = 16] = "DocumentEnd";
13
13
  LayoutRowStateFlags[LayoutRowStateFlags["CellTableEnd"] = 64] = "CellTableEnd";
14
14
  LayoutRowStateFlags[LayoutRowStateFlags["PageBreakBefore"] = 128] = "PageBreakBefore";
15
- LayoutRowStateFlags[LayoutRowStateFlags["InfinityWidth"] = 256] = "InfinityWidth";
16
15
  })(LayoutRowStateFlags || (LayoutRowStateFlags = {}));
17
16
  export class LayoutRow extends Rectangle {
18
17
  get hasEffectToPageHeight() { return this.boxes.length != 1 || !this.boxes[0].isSectionBreakBox; }
@@ -42,7 +42,7 @@ export class RowFormatterResult {
42
42
  return;
43
43
  this.rowFormatter.tabInfo.shiftBoxesAfterLastTab();
44
44
  const dontJustifyLinesEndingInSoftLineBreak = this.rowFormatter.manager.model.compatibilitySettings.dontJustifyLinesEndingInSoftLineBreak;
45
- if (!this.row.flags.get(LayoutRowStateFlags.InfinityWidth))
45
+ if (!this.rowFormatter.rowSizesManager.isInfinityWidth)
46
46
  BoxAligner.align(this.row, this.rowFormatter.paragraphProps.alignment, currLogicRowEndPos, this.rowBoxIndexStart, dontJustifyLinesEndingInSoftLineBreak);
47
47
  this.rowBoxIndexStart = this.row.boxes.length;
48
48
  }
@@ -19,6 +19,7 @@ export declare class RowFormattingInfo {
19
19
  lastNonEmptyIntervalIndex: number;
20
20
  tableCell: TableCell;
21
21
  private intersectsObjects;
22
+ isInfinityWidth: boolean;
22
23
  get isFloatingIntersectRow(): boolean;
23
24
  get lastNonEmptyInterval(): RowIntervalInfo;
24
25
  constructor(minY: number, height: number, outerHorizontalRowContentBounds: FixedInterval, boundsOfAnchoredOblectsOnThisColumn: AnchorObjectBoundsInfo[], tableCell: TableCell | null);
@@ -84,7 +84,7 @@ export class RowFormattingInfo {
84
84
  let index = 0;
85
85
  while (index < this.intervals.length) {
86
86
  const interval = this.intervals[index];
87
- if (interval.start <= position && position < interval.end || position < interval.start)
87
+ if (position < interval.start || interval.start <= position && position < interval.end)
88
88
  break;
89
89
  index++;
90
90
  }
@@ -109,7 +109,7 @@ export class RowFormattingInfo {
109
109
  calcIntersectObjects(height) {
110
110
  const initRect = new Rectangle(this.outerHorizontalRowContentBounds.start, this.minY, this.outerHorizontalRowContentBounds.length, height);
111
111
  return ListUtils.reducedMap(this.boundsOfAnchoredOblectsOnThisColumn, (objInfo) => {
112
- if (this.tableCell !== objInfo.cell)
112
+ if (this.tableCell !== objInfo.cell || this.isInfinityWidth)
113
113
  return null;
114
114
  const rect = Rectangle.getNonCollapsedIntersection(initRect, objInfo.bounds);
115
115
  if (!rect)
@@ -13,6 +13,8 @@ export declare class RowSizesManager {
13
13
  private row;
14
14
  rowStartPos: number;
15
15
  constructor(rowFormatter: RowFormatter, outerHorizontalRowContentBounds: FixedInterval, minY: number, rowSpacingBeforeApplier: IRowSpacingBeforeApplier, boundsOfAnchoredOblectsOnThisColumn: AnchorObjectBoundsInfo[], isFirstRowInParagraph: boolean);
16
+ get isInfinityWidth(): boolean;
17
+ set isInfinityWidth(value: boolean);
16
18
  private addNumberingListBoxes;
17
19
  addFullWord(boxes: LayoutBox[]): AddFullWordResult;
18
20
  addWordByChars(boxes: LayoutBox[]): number;
@@ -26,6 +26,8 @@ export class RowSizesManager {
26
26
  this.rowFormattingInfo = new RowFormattingInfo(minY, this.heightCalculator.currState.getFullRowHeight(), outerHorizontalRowContentBounds, boundsOfAnchoredOblectsOnThisColumn, tableCell);
27
27
  this.rowFormattingInfo.calculate();
28
28
  }
29
+ get isInfinityWidth() { return this.rowFormattingInfo.isInfinityWidth; }
30
+ set isInfinityWidth(value) { this.rowFormattingInfo.isInfinityWidth = value; }
29
31
  addNumberingListBoxes() {
30
32
  const { paragraph, result: { paragraphIndex }, numberingListCountersManager, manager: formatterManager } = this.rowFormatter;
31
33
  const counters = numberingListCountersManager.calculateCounters(paragraphIndex);
@@ -45,7 +45,7 @@ export class RowBaseFormatterState {
45
45
  return;
46
46
  if (!this.rowFormatter.rowSizesManager.addNumberingBoxes())
47
47
  return;
48
- if (this.rowFormatter.tabInfo.addTabBox())
48
+ if (this.rowFormatter.tabInfo.tryAddTabBox())
49
49
  this.rowFormatter.setState(TextRowFormatterState.Base);
50
50
  else
51
51
  this.rowFormatter.finishRow();