devexpress-richedit 24.2.7-build-25079-0118 → 24.2.7-build-25100-0108

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.
@@ -13,6 +13,7 @@ export declare class ClientRibbonBar extends RibbonBarBase implements IRibbonBar
13
13
  private _toolbarItemsCache;
14
14
  private ownerElement;
15
15
  private activeItem;
16
+ private focusHandler;
16
17
  constructor(ownerControl: IControlOwner, ownerElement: HTMLElement, apiRibbon: ApiRibbon, fonts: FontsSettings);
17
18
  protected updateContextItem(_commandKey: RichEditClientCommand): void;
18
19
  onCanvasMouseDown(): void;
@@ -6,6 +6,7 @@ import { ListUtils } from '@devexpress/utils/lib/utils/list';
6
6
  import { StringMapUtils } from '@devexpress/utils/lib/utils/map/string';
7
7
  import { createInnerTab } from '../public/ribbon/creator';
8
8
  import { SizeUtils } from '../../common/utils/size-utils';
9
+ import { FocusHelper } from '../utils/focus-helper';
9
10
  export class ClientRibbonBar extends RibbonBarBase {
10
11
  constructor(ownerControl, ownerElement, apiRibbon, fonts) {
11
12
  var _a;
@@ -14,6 +15,7 @@ export class ClientRibbonBar extends RibbonBarBase {
14
15
  this.ownerElement = ownerElement;
15
16
  this.init(apiRibbon, fonts);
16
17
  this.createControl((_a = apiRibbon.activeTabIndex) !== null && _a !== void 0 ? _a : 1);
18
+ this.focusHandler = FocusHelper.preventFocusOnClick(this.ribbon.element);
17
19
  }
18
20
  updateContextItem(_commandKey) {
19
21
  }
@@ -39,13 +41,13 @@ export class ClientRibbonBar extends RibbonBarBase {
39
41
  }
40
42
  dispose() {
41
43
  this.ribbon.dispose();
44
+ this.focusHandler.dispose();
42
45
  }
43
46
  checkActivateHeaderFooter(_selection) {
44
47
  return false;
45
48
  }
46
49
  createControl(activeTabIndex) {
47
50
  const element = document.createElement('div');
48
- element.tabIndex = 0;
49
51
  const firstChild = this.ownerElement.firstChild;
50
52
  if (firstChild)
51
53
  this.ownerElement.insertBefore(element, firstChild);
@@ -0,0 +1,4 @@
1
+ import { IDisposable } from "@devexpress/utils/lib/types";
2
+ export declare class FocusHelper {
3
+ static preventFocusOnClick(element: HTMLElement): IDisposable;
4
+ }
@@ -0,0 +1,36 @@
1
+ export class FocusHelper {
2
+ static preventFocusOnClick(element) {
3
+ return new FocusBlocker(element);
4
+ }
5
+ }
6
+ class FocusBlocker {
7
+ constructor(target) {
8
+ this.target = target;
9
+ this.onPointerDownBinded = this.onPointerDown.bind(this);
10
+ this.addEventListeners(target);
11
+ }
12
+ addEventListeners(element) {
13
+ element.addEventListener("pointerdown", this.onPointerDownBinded);
14
+ }
15
+ removeEventListeners(element) {
16
+ element.removeEventListener("pointerdown", this.onPointerDownBinded);
17
+ }
18
+ onPointerDown(event) {
19
+ for (const element of event.composedPath()) {
20
+ if (!(element instanceof HTMLElement))
21
+ continue;
22
+ if (element === this.target) {
23
+ event.preventDefault();
24
+ break;
25
+ }
26
+ if (!this.target.contains(element) || element.tabIndex > -1)
27
+ break;
28
+ }
29
+ }
30
+ dispose() {
31
+ if (this.target) {
32
+ this.removeEventListeners(this.target);
33
+ this.target = null;
34
+ }
35
+ }
36
+ }
@@ -318,17 +318,23 @@ export class CanvasManager extends BatchUpdatableObject {
318
318
  onScrollIntervalTick() {
319
319
  const evtX = this.lastMousePosition.x;
320
320
  const evtY = this.lastMousePosition.y;
321
- const inHorizontalArea = evtX >= this.canvasPosition.x && evtX <= this.canvasPosition.x + this.sizes.getVisibleAreaWidth(true);
322
- const inVerticalArea = evtY >= this.canvasPosition.y && evtY <= this.canvasPosition.y + this.sizes.getVisibleAreaHeight(true);
321
+ const inHorizontalArea = evtX >= this.canvasPosition.x && evtX <= this.canvasPosition.x + this.sizes.getVisibleAreaWidth(false);
322
+ const inVerticalArea = evtY >= this.canvasPosition.y && evtY <= this.canvasPosition.y + this.sizes.getVisibleAreaHeight(false);
323
323
  if (!inHorizontalArea && !inVerticalArea)
324
324
  return;
325
+ const yOffsetWithoutScrollbar = this.canvasPosition.y + this.sizes.getVisibleAreaHeight(false) - evtY;
326
+ const yOffsetWithScrollbar = this.canvasPosition.y + this.sizes.getVisibleAreaHeight(true) - evtY;
327
+ const outsideHorizontalScrollbar = yOffsetWithoutScrollbar > 0 || yOffsetWithScrollbar < 0;
325
328
  if (inHorizontalArea && evtY - this.canvasPosition.y <= AUTOSCROLL_AREA_SIZE)
326
329
  this.viewManager.canvas.scrollTop -= AUTOSCROLL_STEP;
327
- else if (inHorizontalArea && this.canvasPosition.y + this.sizes.getVisibleAreaHeight(true) - evtY <= AUTOSCROLL_AREA_SIZE)
330
+ else if (inHorizontalArea && yOffsetWithoutScrollbar <= AUTOSCROLL_AREA_SIZE && outsideHorizontalScrollbar)
328
331
  this.viewManager.canvas.scrollTop += AUTOSCROLL_STEP;
332
+ const xOffsetWithoutScrollbar = this.canvasPosition.x + this.sizes.getVisibleAreaWidth(false) - evtX;
333
+ const xOffsetWithScrollbar = this.canvasPosition.x + this.sizes.getVisibleAreaWidth(true) - evtX;
334
+ const outsideVerticalScrollbar = xOffsetWithoutScrollbar > 0 || xOffsetWithScrollbar < 0;
329
335
  if (inVerticalArea && evtX - this.canvasPosition.x <= AUTOSCROLL_AREA_SIZE)
330
336
  this.viewManager.canvas.scrollLeft -= AUTOSCROLL_STEP;
331
- else if (inVerticalArea && this.canvasPosition.x + this.sizes.getVisibleAreaWidth(true) - evtX <= AUTOSCROLL_AREA_SIZE)
337
+ else if (inVerticalArea && xOffsetWithoutScrollbar <= AUTOSCROLL_AREA_SIZE && outsideVerticalScrollbar)
332
338
  this.viewManager.canvas.scrollLeft += AUTOSCROLL_STEP;
333
339
  }
334
340
  static getCursorClassName(pointer) {
@@ -1,18 +1,23 @@
1
1
  import { CharacterStyle } from '../../model/character/character-style';
2
2
  import { ParagraphStyle } from '../../model/paragraph/paragraph-style';
3
- import { SubDocument } from '../../model/sub-document';
3
+ import { SubDocumentInterval } from '../../model/sub-document';
4
4
  import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
5
5
  import { CommandBase, CommandSimpleOptions } from '../command-base';
6
6
  import { ApplyStyleCommandState } from '../command-states';
7
+ export interface IApplyStyleCommandParams {
8
+ styleName: string;
9
+ keepDirectFormatting?: boolean;
10
+ }
7
11
  export declare class ApplyStyleCommand extends CommandBase<ApplyStyleCommandState> {
8
12
  getState(): ApplyStyleCommandState;
9
13
  private getStyleName;
10
- executeCore(state: ApplyStyleCommandState, options: CommandSimpleOptions<string>): boolean;
11
- applyCharacterStyle(interval: FixedInterval, style: CharacterStyle, isPresetStyle: boolean, subDocument: SubDocument): void;
12
- applyParagraphStyle(interval: FixedInterval, style: ParagraphStyle, isPresetStyle: boolean, subDocument: SubDocument): void;
13
- applyParagraphLinkedStyle(interval: FixedInterval, style: ParagraphStyle, isPresetStyle: boolean, subDocument: SubDocument): void;
14
- private createCharacterStyle;
15
- calculateAffectedParagraphCount(interval: FixedInterval, subDocument: SubDocument): number;
14
+ DEPRECATEDConvertOptionsParameter(parameter: string | IApplyStyleCommandParams): IApplyStyleCommandParams;
15
+ executeCore(state: ApplyStyleCommandState, options: CommandSimpleOptions<IApplyStyleCommandParams>): boolean;
16
+ applyCharacterStyle(subDocumentInterval: SubDocumentInterval, style: CharacterStyle, isPresetStyle: boolean): void;
17
+ applyParagraphStyle(subDocumentInterval: SubDocumentInterval, style: ParagraphStyle, isPresetStyle: boolean, keepDirectFormatting?: boolean): void;
18
+ applyParagraphLinkedStyle(subDocumentInterval: SubDocumentInterval, style: ParagraphStyle, isPresetStyle: boolean): void;
19
+ private addLinkedCharacterStyle;
20
+ calculateAffectedParagraphCount(subDocumentInterval: SubDocumentInterval): number;
16
21
  isEnabled(): boolean;
17
22
  protected canModify(): boolean;
18
23
  protected getIntervalsForModifying(): FixedInterval[];
@@ -9,7 +9,6 @@ import { ControlOptions } from '../../model/options/control';
9
9
  import { RichUtils } from '../../model/rich-utils';
10
10
  import { StylesManager } from '../../model/styles-manager';
11
11
  import { SubDocumentInterval } from '../../model/sub-document';
12
- import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
13
12
  import { SearchUtils } from '@devexpress/utils/lib/utils/search';
14
13
  import { CommandBase } from '../command-base';
15
14
  import { StringUtils } from '@devexpress/utils/lib/utils/string';
@@ -50,16 +49,19 @@ export class ApplyStyleCommand extends CommandBase {
50
49
  getStyleName(style) {
51
50
  return style.styleName;
52
51
  }
52
+ DEPRECATEDConvertOptionsParameter(parameter) {
53
+ return typeof parameter === 'string' ? { styleName: parameter } : parameter;
54
+ }
53
55
  executeCore(state, options) {
54
56
  const parameter = options.param;
55
- if (StringUtils.isNullOrEmpty(parameter))
57
+ if (StringUtils.isNullOrEmpty(parameter.styleName))
56
58
  return false;
57
- let interval = state.interval.clone();
59
+ const subDocumentInterval = new SubDocumentInterval(options.subDocument, state.interval.clone());
58
60
  let executed = true;
59
61
  let isPresetStyle = false;
60
62
  this.history.beginTransaction();
61
- if (StylesManager.isParagraphStyle(parameter) && state.paragraphStyleChangeEnabled) {
62
- const styleName = StylesManager.getStyleNameWithoutPrefix(parameter);
63
+ if (StylesManager.isParagraphStyle(parameter.styleName) && state.paragraphStyleChangeEnabled) {
64
+ const styleName = StylesManager.getStyleNameWithoutPrefix(parameter.styleName);
63
65
  let paragraphStyle = this.control.modelManager.model.getParagraphStyleByName(styleName);
64
66
  if (!paragraphStyle) {
65
67
  const presetStyle = StylesManager.getPresetParagraphStyleByName(styleName);
@@ -68,12 +70,12 @@ export class ApplyStyleCommand extends CommandBase {
68
70
  paragraphStyle = StylesManager.getPresetParagraphStyleByName(styleName).clone();
69
71
  isPresetStyle = true;
70
72
  }
71
- this.applyParagraphStyle(interval, paragraphStyle, isPresetStyle, options.subDocument);
73
+ this.applyParagraphStyle(subDocumentInterval, paragraphStyle, isPresetStyle, parameter.keepDirectFormatting);
72
74
  }
73
- else if (!StylesManager.isParagraphStyle(parameter) && state.characterStyleChangeEnabled) {
74
- const styleName = StylesManager.getStyleNameWithoutPrefix(parameter);
75
- if (interval.length == 0)
76
- interval = options.subDocument.getWholeWordInterval(interval.start);
75
+ else if (!StylesManager.isParagraphStyle(parameter.styleName) && state.characterStyleChangeEnabled) {
76
+ const styleName = StylesManager.getStyleNameWithoutPrefix(parameter.styleName);
77
+ if (subDocumentInterval.interval.length == 0)
78
+ subDocumentInterval.interval = options.subDocument.getWholeWordInterval(subDocumentInterval.interval.start);
77
79
  let characterStyle = this.control.modelManager.model.getCharacterStyleByName(styleName);
78
80
  if (!characterStyle) {
79
81
  const presetStyle = StylesManager.getPresetCharacterStyleByName(styleName);
@@ -82,9 +84,9 @@ export class ApplyStyleCommand extends CommandBase {
82
84
  characterStyle = presetStyle.clone();
83
85
  isPresetStyle = true;
84
86
  }
85
- if (interval.length == 0) {
87
+ if (subDocumentInterval.interval.length == 0) {
86
88
  if (isPresetStyle) {
87
- let fontInfo = characterStyle.maskedCharacterProperties.fontInfo;
89
+ const fontInfo = characterStyle.maskedCharacterProperties.fontInfo;
88
90
  if (fontInfo && fontInfo.measurer === undefined)
89
91
  characterStyle.maskedCharacterProperties.fontInfo = this.control.modelManager.model.cache.fontInfoCache.getItemByName(fontInfo.name);
90
92
  }
@@ -92,50 +94,56 @@ export class ApplyStyleCommand extends CommandBase {
92
94
  executed = false;
93
95
  }
94
96
  else
95
- this.applyCharacterStyle(interval, characterStyle, isPresetStyle, options.subDocument);
97
+ this.applyCharacterStyle(subDocumentInterval, characterStyle, isPresetStyle);
96
98
  }
97
99
  this.history.endTransaction();
98
100
  return executed;
99
101
  }
100
- applyCharacterStyle(interval, style, isPresetStyle, subDocument) {
102
+ applyCharacterStyle(subDocumentInterval, style, isPresetStyle) {
101
103
  if (ControlOptions.isEnabled(this.control.modelManager.richOptions.control.characterStyle)) {
102
- this.modelManipulator.style.applyCharacterStyle(new SubDocumentInterval(subDocument, interval), isPresetStyle ? this.control.modelManager.model.stylesManager.addCharacterStyle(style) : style, false);
104
+ const characterStyle = isPresetStyle ? this.control.modelManager.model.stylesManager.addCharacterStyle(style) : style;
105
+ this.modelManipulator.style.applyCharacterStyle(subDocumentInterval, characterStyle, false);
103
106
  }
104
107
  }
105
- applyParagraphStyle(interval, style, isPresetStyle, subDocument) {
106
- var count = this.calculateAffectedParagraphCount(interval, subDocument);
108
+ applyParagraphStyle(subDocumentInterval, style, isPresetStyle, keepDirectFormatting = false) {
109
+ const count = this.calculateAffectedParagraphCount(subDocumentInterval);
107
110
  if (count > 0 && ControlOptions.isEnabled(this.control.modelManager.richOptions.control.paragraphStyle)) {
108
- var paragraphIndex = SearchUtils.normedInterpolationIndexOf(subDocument.paragraphs, p => p.startLogPosition.value, interval.start);
109
- for (var i = 0; i < count; i++) {
110
- var paragraph = subDocument.paragraphs[paragraphIndex + i];
111
- var paragraphInterval = new FixedInterval(paragraph.startLogPosition.value, paragraph.length);
112
- var modelManipulator = this.modelManipulator;
113
- this.history.addAndRedo(new ApplyParagraphStyleHistoryItem(modelManipulator, new SubDocumentInterval(subDocument, paragraphInterval), isPresetStyle ? modelManipulator.model.stylesManager.addParagraphStyle(style) : style));
114
- this.history.addAndRedo(new ParagraphUseValueHistoryItem(modelManipulator, new SubDocumentInterval(subDocument, paragraphInterval), 0));
115
- this.history.addAndRedo(new FontUseValueHistoryItem(modelManipulator, new SubDocumentInterval(subDocument, paragraphInterval), 0));
116
- this.history.addAndRedo(new AddParagraphToListHistoryItem(this.modelManipulator, subDocument, paragraphIndex, NumberingList.NumberingListNotSettedIndex, -1));
111
+ const { interval, subDocument } = subDocumentInterval;
112
+ const paragraphs = subDocument.paragraphs;
113
+ const paragraphIndex = SearchUtils.normedInterpolationIndexOf(paragraphs, p => p.startLogPosition.value, interval.start);
114
+ for (let i = 0; i < count; i++) {
115
+ const paragraph = paragraphs[paragraphIndex + i];
116
+ const modelManipulator = this.modelManipulator;
117
+ const paragraphSubDocumentInterval = new SubDocumentInterval(subDocument, paragraph.interval);
118
+ style = isPresetStyle ? modelManipulator.model.stylesManager.addParagraphStyle(style) : style;
119
+ this.history.addAndRedo(new ApplyParagraphStyleHistoryItem(modelManipulator, paragraphSubDocumentInterval, style));
120
+ this.history.addAndRedo(new ParagraphUseValueHistoryItem(modelManipulator, paragraphSubDocumentInterval, 0));
121
+ if (!keepDirectFormatting)
122
+ this.history.addAndRedo(new FontUseValueHistoryItem(modelManipulator, paragraphSubDocumentInterval, 0));
123
+ this.history.addAndRedo(new AddParagraphToListHistoryItem(modelManipulator, subDocument, paragraphIndex, NumberingList.NumberingListNotSettedIndex, -1));
117
124
  }
118
125
  }
119
126
  else
120
- this.applyParagraphLinkedStyle(interval, style, isPresetStyle, subDocument);
127
+ this.applyParagraphLinkedStyle(subDocumentInterval, style, isPresetStyle);
121
128
  }
122
- applyParagraphLinkedStyle(interval, style, isPresetStyle, subDocument) {
129
+ applyParagraphLinkedStyle(subDocumentInterval, style, isPresetStyle) {
123
130
  if (ControlOptions.isEnabled(this.control.modelManager.richOptions.control.characterStyle)) {
124
131
  if (!style.linkedStyle)
125
- this.createCharacterStyle(style);
126
- this.applyCharacterStyle(interval, style.linkedStyle, isPresetStyle, subDocument);
132
+ this.addLinkedCharacterStyle(style);
133
+ this.applyCharacterStyle(subDocumentInterval, style.linkedStyle, isPresetStyle);
127
134
  }
128
135
  }
129
- createCharacterStyle(paragraphStyle) {
130
- var style = new CharacterStyle(paragraphStyle.styleName + " Char", paragraphStyle.localizedName + " Char", false, false, false, false, paragraphStyle.maskedCharacterProperties);
136
+ addLinkedCharacterStyle(paragraphStyle) {
137
+ const style = new CharacterStyle(paragraphStyle.styleName + " Char", paragraphStyle.localizedName + " Char", false, false, false, false, paragraphStyle.maskedCharacterProperties);
131
138
  this.history.addAndRedo(new CreateStyleLinkHistoryItem(this.modelManipulator, style, paragraphStyle));
132
139
  }
133
- calculateAffectedParagraphCount(interval, subDocument) {
134
- var paragraphs = subDocument.getParagraphsByInterval(interval);
140
+ calculateAffectedParagraphCount(subDocumentInterval) {
141
+ const { interval, subDocument } = subDocumentInterval;
142
+ const paragraphs = subDocument.getParagraphsByInterval(interval);
135
143
  if (paragraphs.length > 1)
136
144
  return paragraphs.length;
137
- var paragraph = paragraphs[0];
138
- var lastParagraphCharSelected = interval.length >= paragraph.length - 1;
145
+ const paragraph = paragraphs[0];
146
+ const lastParagraphCharSelected = interval.length >= paragraph.length - 1;
139
147
  if (interval.start === paragraph.startLogPosition.value && lastParagraphCharSelected || interval.length === 0)
140
148
  return 1;
141
149
  return 0;
@@ -1,6 +1,8 @@
1
1
  import { CommandBase, CommandSimpleOptions } from '../command-base';
2
2
  import { SimpleCommandState } from '../command-states';
3
3
  export declare abstract class SetParagraphLevelCommandBase extends CommandBase<SimpleCommandState> {
4
+ private get commandManager();
5
+ private get modelManager();
4
6
  isEnabled(): boolean;
5
7
  getState(): SimpleCommandState;
6
8
  executeCore(_state: SimpleCommandState, options: CommandSimpleOptions<number>): boolean;
@@ -5,24 +5,30 @@ import { RichEditClientCommand } from '../client-command';
5
5
  import { CommandBase, CommandSimpleOptions } from '../command-base';
6
6
  import { SimpleCommandState } from '../command-states';
7
7
  export class SetParagraphLevelCommandBase extends CommandBase {
8
+ get commandManager() { return this.control.commandManager; }
9
+ get modelManager() { return this.control.modelManager; }
8
10
  isEnabled() {
9
- return super.isEnabled() && ControlOptions.isEnabled(this.control.modelManager.richOptions.control.paragraphFormatting);
11
+ return super.isEnabled() && ControlOptions.isEnabled(this.modelManager.richOptions.control.paragraphFormatting);
10
12
  }
11
13
  getState() {
12
14
  const state = new SimpleCommandState(this.isEnabled());
13
- state.value = this.control.commandManager.getCommand(RichEditClientCommand.ChangeHeadingLevel).getState().value == this.getLevel(null);
15
+ state.value = this.commandManager.getCommand(RichEditClientCommand.ChangeHeadingLevel).getState().value == this.getLevel(null);
14
16
  return state;
15
17
  }
16
18
  executeCore(_state, options) {
17
19
  const level = this.getLevel(options.param);
18
20
  const styleName = level > 0 ? `${ParagraphStyle.headingStyleName} ${level}` : ParagraphStyle.normalStyleName;
19
- let paragraphStyle = this.control.modelManager.model.getParagraphStyleByName(styleName);
21
+ let paragraphStyle = this.modelManager.model.getParagraphStyleByName(styleName);
20
22
  if (!paragraphStyle)
21
23
  paragraphStyle = StylesManager.getPresetParagraphStyleByName(styleName);
22
- if (paragraphStyle)
23
- this.control.commandManager.getCommand(RichEditClientCommand.ChangeStyle).execute(this.control.commandManager.isPublicApiCall, new CommandSimpleOptions(this.control, StylesManager.paragraphPrefix + styleName));
24
- else
25
- this.control.commandManager.getCommand(RichEditClientCommand.ChangeHeadingLevel).execute(this.control.commandManager.isPublicApiCall, new CommandSimpleOptions(this.control, level));
24
+ if (paragraphStyle) {
25
+ const commandOptions = new CommandSimpleOptions(this.control, { styleName: StylesManager.paragraphPrefix + styleName, keepDirectFormatting: true });
26
+ this.commandManager.getCommand(RichEditClientCommand.ChangeStyle).execute(this.commandManager.isPublicApiCall, commandOptions);
27
+ }
28
+ else {
29
+ const commandOptions = new CommandSimpleOptions(this.control, level);
30
+ this.commandManager.getCommand(RichEditClientCommand.ChangeHeadingLevel).execute(this.commandManager.isPublicApiCall, commandOptions);
31
+ }
26
32
  return true;
27
33
  }
28
34
  getRelatedCommands() {
@@ -13,7 +13,8 @@ export declare enum LayoutRowStateFlags {
13
13
  SectionEnd = 8,
14
14
  DocumentEnd = 16,
15
15
  CellTableEnd = 64,
16
- PageBreakBefore = 128
16
+ PageBreakBefore = 128,
17
+ InfinityWidth = 256
17
18
  }
18
19
  export declare class LayoutRow extends Rectangle {
19
20
  boxes: LayoutBox[];
@@ -2,6 +2,7 @@ import { Flag } from '@devexpress/utils/lib/class/flag';
2
2
  import { UnitConverter } from '@devexpress/utils/lib/class/unit-converter';
3
3
  import { Rectangle } from '@devexpress/utils/lib/geometry/rectangle';
4
4
  import { ListUtils } from '@devexpress/utils/lib/utils/list';
5
+ import { LayoutBoxType } from './layout-boxes/layout-box';
5
6
  export var LayoutRowStateFlags;
6
7
  (function (LayoutRowStateFlags) {
7
8
  LayoutRowStateFlags[LayoutRowStateFlags["NormallyEnd"] = 0] = "NormallyEnd";
@@ -12,6 +13,7 @@ export var LayoutRowStateFlags;
12
13
  LayoutRowStateFlags[LayoutRowStateFlags["DocumentEnd"] = 16] = "DocumentEnd";
13
14
  LayoutRowStateFlags[LayoutRowStateFlags["CellTableEnd"] = 64] = "CellTableEnd";
14
15
  LayoutRowStateFlags[LayoutRowStateFlags["PageBreakBefore"] = 128] = "PageBreakBefore";
16
+ LayoutRowStateFlags[LayoutRowStateFlags["InfinityWidth"] = 256] = "InfinityWidth";
15
17
  })(LayoutRowStateFlags || (LayoutRowStateFlags = {}));
16
18
  export class LayoutRow extends Rectangle {
17
19
  get hasEffectToPageHeight() { return this.boxes.length != 1 || !this.boxes[0].isSectionBreakBox; }
@@ -127,7 +129,7 @@ export class LayoutRow extends Rectangle {
127
129
  return lastBoxIndexWhatCanStrikeoutAndUnderline;
128
130
  }
129
131
  containsSpacesOnly() {
130
- return this.boxes.length > 0 && ListUtils.allOf(this.boxes, val => val.isWhitespace());
132
+ return this.boxes.length > 0 && ListUtils.allOf(this.boxes, val => val.isWhitespace() || val.getType() === LayoutBoxType.ParagraphMark);
131
133
  }
132
134
  }
133
135
  export class LayoutRowWithIndex extends LayoutRow {
@@ -42,7 +42,8 @@ export class RowFormatterResult {
42
42
  return;
43
43
  this.rowFormatter.tabInfo.shiftBoxesAfterLastTab();
44
44
  const dontJustifyLinesEndingInSoftLineBreak = this.rowFormatter.manager.model.compatibilitySettings.dontJustifyLinesEndingInSoftLineBreak;
45
- BoxAligner.align(this.row, this.rowFormatter.paragraphProps.alignment, currLogicRowEndPos, this.rowBoxIndexStart, dontJustifyLinesEndingInSoftLineBreak);
45
+ if (!this.row.flags.get(LayoutRowStateFlags.InfinityWidth))
46
+ BoxAligner.align(this.row, this.rowFormatter.paragraphProps.alignment, currLogicRowEndPos, this.rowBoxIndexStart, dontJustifyLinesEndingInSoftLineBreak);
46
47
  this.rowBoxIndexStart = this.row.boxes.length;
47
48
  }
48
49
  deleteSomeAnchorObjects(index, posToRestart) {
@@ -7,6 +7,7 @@ import { SearchUtils } from '@devexpress/utils/lib/utils/search';
7
7
  import { StringUtils } from '@devexpress/utils/lib/utils/string';
8
8
  import { LayoutBoxType } from '../../layout/main-structures/layout-boxes/layout-box';
9
9
  import { TabLeaderType } from '../../layout/main-structures/layout-boxes/layout-tab-space-box';
10
+ import { LayoutRowStateFlags } from '../../layout/main-structures/layout-row';
10
11
  import { TabAlign } from '../../model/paragraph/paragraph';
11
12
  import { ParagraphFirstLineIndent } from '../../model/paragraph/paragraph-properties';
12
13
  import { TabInfo } from '../../model/paragraph/paragraph-style';
@@ -85,9 +86,10 @@ export class RowTabInfo {
85
86
  if (tabXPosRelativePage > lastInterval.end) {
86
87
  if (lastInterval.end < this.rowFormatter.paragraphHorizontalBounds.end) {
87
88
  if (this.rowFormatter.manager.model.compatibilitySettings.compatibilityMode < CompatibilityMode.Word2013) {
89
+ this.currInterval.avaliableWidth = Number.MAX_SAFE_INTEGER - this.currInterval.busyWidth;
88
90
  this.currInterval.length = Number.MAX_SAFE_INTEGER;
89
- this.currInterval.avaliableWidth = Number.MAX_SAFE_INTEGER;
90
91
  this.row.width = Number.MAX_SAFE_INTEGER;
92
+ this.row.flags.set(LayoutRowStateFlags.InfinityWidth, true);
91
93
  return this.addTabBox();
92
94
  }
93
95
  else if (tabBox.right < this.rowFormatter.paragraphHorizontalBounds.end) {
@@ -61,7 +61,7 @@ export class ParagraphStyle extends StyleBase {
61
61
  }
62
62
  }
63
63
  ParagraphStyle.normalStyleName = "Normal";
64
- ParagraphStyle.headingStyleName = "heading";
64
+ ParagraphStyle.headingStyleName = "Heading";
65
65
  ParagraphStyle.tocStyleName = "toc";
66
66
  export class TabProperties {
67
67
  constructor() {
@@ -1,11 +1,11 @@
1
1
  export declare class SizeUtils {
2
- static getWidthInfo(element: Element): DimensionInfo;
3
- static getClientWidth(element: Element): number;
4
- static getHeightInfo(element: Element): DimensionInfo;
5
- static getClientHeight(element: Element): number;
6
- static getOffsetSize(element: Element): DOMRect;
7
- static getOffsetWidth(element: Element): number;
8
- static getOffsetHeight(element: Element): number;
2
+ static getWidthInfo(element: HTMLElement): DimensionInfo;
3
+ static getClientWidth(element: HTMLElement): number;
4
+ static getHeightInfo(element: HTMLElement): DimensionInfo;
5
+ static getClientHeight(element: HTMLElement): number;
6
+ static getOffsetSize(element: HTMLElement): DOMRect;
7
+ static getOffsetWidth(element: HTMLElement): number;
8
+ static getOffsetHeight(element: HTMLElement): number;
9
9
  }
10
10
  export declare class DimensionInfo {
11
11
  readonly offsetSize: number;
@@ -1,28 +1,26 @@
1
1
  export class SizeUtils {
2
2
  static getWidthInfo(element) {
3
- const offsetSize = SizeUtils.getOffsetWidth(element);
4
- const style = getComputedStyle(element);
5
- const inset = parseCssValue(style.borderLeftWidth)
6
- + parseCssValue(style.borderRightWidth)
7
- + parseCssValue(style.paddingLeft)
8
- + parseCssValue(style.paddingRight);
9
- const sizeWithScrollBar = offsetSize - inset;
10
- const scrollBarSize = Math.round(sizeWithScrollBar) - element.clientWidth;
11
- return new DimensionInfo(offsetSize, sizeWithScrollBar - scrollBarSize, scrollBarSize);
3
+ const computedStyle = getComputedStyle(element);
4
+ const offsetWidth = this.getOffsetWidth(element);
5
+ const offsetWidthWithoutBorder = offsetWidth
6
+ - parseCssValue(computedStyle.borderLeftWidth)
7
+ - parseCssValue(computedStyle.borderRightWidth);
8
+ const scrollbarWidth = offsetWidthWithoutBorder - element.clientWidth;
9
+ const clientWidth = offsetWidthWithoutBorder - scrollbarWidth;
10
+ return new DimensionInfo(offsetWidth, clientWidth, scrollbarWidth);
12
11
  }
13
12
  static getClientWidth(element) {
14
13
  return this.getWidthInfo(element).clientSize;
15
14
  }
16
15
  static getHeightInfo(element) {
17
- const offsetSize = SizeUtils.getOffsetHeight(element);
18
- const style = getComputedStyle(element);
19
- const inset = parseCssValue(style.borderTopWidth)
20
- + parseCssValue(style.borderBottomWidth)
21
- + parseCssValue(style.paddingTop)
22
- + parseCssValue(style.paddingBottom);
23
- const sizeWithScrollBar = offsetSize - inset;
24
- const scrollBarSize = Math.round(sizeWithScrollBar) - element.clientHeight;
25
- return new DimensionInfo(offsetSize, sizeWithScrollBar - scrollBarSize, scrollBarSize);
16
+ const computedStyle = getComputedStyle(element);
17
+ const offsetHeight = this.getOffsetHeight(element);
18
+ const offsetHeightWithoutBorder = offsetHeight
19
+ - parseCssValue(computedStyle.borderTopWidth)
20
+ - parseCssValue(computedStyle.borderBottomWidth);
21
+ const scrollbarHeight = offsetHeightWithoutBorder - element.clientHeight;
22
+ const clientHeight = offsetHeightWithoutBorder - scrollbarHeight;
23
+ return new DimensionInfo(offsetHeight, clientHeight, scrollbarHeight);
26
24
  }
27
25
  static getClientHeight(element) {
28
26
  return this.getHeightInfo(element).clientSize;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devexpress-richedit",
3
- "version": "24.2.7-build-25079-0118",
3
+ "version": "24.2.7-build-25100-0108",
4
4
  "homepage": "https://www.devexpress.com/",
5
5
  "bugs": "https://www.devexpress.com/support/",
6
6
  "author": "Developer Express Inc.",
@@ -14,8 +14,8 @@
14
14
  "build-nspell": "webpack --mode production --config=bin/nspell.webpack.config.js"
15
15
  },
16
16
  "peerDependencies": {
17
- "devextreme": "24.2.7-build-25078-1935",
18
- "devextreme-dist": "24.2.7-build-25078-1935"
17
+ "devextreme": "24.2.7-build-25098-1935",
18
+ "devextreme-dist": "24.2.7-build-25098-1935"
19
19
  },
20
20
  "dependencies": {
21
21
  "jszip": "~3.10.1",