devexpress-richedit 24.2.15 → 24.2.16
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.
- package/bin/gulpfile.js +1 -1
- package/bin/index-custom.js +1 -1
- package/bin/localization-builder.js +1 -1
- package/bin/nspell-index.js +1 -1
- package/bin/nspell.webpack.config.js +1 -1
- package/bin/webpack-externals.js +1 -1
- package/bin/webpack.config.js +1 -1
- package/dist/dx.richedit.css +0 -1
- package/dist/dx.richedit.d.ts +1 -1
- package/dist/dx.richedit.js +203 -155
- package/dist/dx.richedit.min.js +3 -3
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/client/client-rich-edit.js +2 -2
- package/lib/common/canvas/renderes/common/document-renderer.js +7 -1
- package/lib/common/event-manager.js +0 -1
- package/lib/common/layout-formatter/formatter/base-formatter.d.ts +1 -0
- package/lib/common/layout-formatter/formatter/base-formatter.js +11 -0
- package/lib/common/layout-formatter/row/formatter.js +4 -1
- package/lib/common/layout-formatter/row/result.d.ts +1 -1
- package/lib/common/layout-formatter/row/result.js +12 -17
- package/lib/common/layout-formatter/row/size-engine/row-formatting-info.d.ts +2 -1
- package/lib/common/layout-formatter/row/size-engine/row-formatting-info.js +7 -4
- package/lib/common/layout-formatter/row/size-engine/row-sizes-manager.js +1 -3
- package/lib/common/mouse-handler/mouse-handler/mouse-handler-default-state.d.ts +1 -0
- package/lib/common/mouse-handler/mouse-handler/mouse-handler-default-state.js +6 -4
- package/package.json +3 -3
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -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 ("
|
|
65
|
-
config(JSON.parse(atob("
|
|
64
|
+
if ("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWIxWnJZVFZoY2psb1V6TldVbk55VGtZemRXSnRTU0lLZlE9PS5OSEkvTkFqYmFPbi9nUFNNdzZqb3pTdk1nSFZFWG5mQ1pvSDNEK3VUY01zdHhoVGdCZTJEZ2xlUUxzaFppdVh2c29ZV3RWbWdxY3RzUWowbDZFMXBYT2hpUnlzNzVrdDU3Y3hEZ1VvanA2eUY3VWt6Nm16enVEYzZ0Lzk4bjlsWVlIeHpiUT09In0=")
|
|
65
|
+
config(JSON.parse(atob("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWIxWnJZVFZoY2psb1V6TldVbk55VGtZemRXSnRTU0lLZlE9PS5OSEkvTkFqYmFPbi9nUFNNdzZqb3pTdk1nSFZFWG5mQ1pvSDNEK3VUY01zdHhoVGdCZTJEZ2xlUUxzaFppdVh2c29ZV3RWbWdxY3RzUWowbDZFMXBYT2hpUnlzNzVrdDU3Y3hEZ1VvanA2eUY3VWt6Nm16enVEYzZ0Lzk4bjlsWVlIeHpiUT09In0=")));
|
|
66
66
|
this.prepareElement(element, settings);
|
|
67
67
|
this.initDefaultFontsAndStyles();
|
|
68
68
|
this.initBars(settings.ribbon, settings.fonts);
|
|
@@ -270,8 +270,14 @@ export class DocumentRenderer {
|
|
|
270
270
|
}
|
|
271
271
|
}
|
|
272
272
|
updatePageSize(page, pageElement) {
|
|
273
|
-
if (pageElement.offsetHeight != Math.round(page.height) || pageElement.offsetWidth != Math.round(page.width))
|
|
273
|
+
if (pageElement.offsetHeight != Math.round(page.height) || pageElement.offsetWidth != Math.round(page.width)) {
|
|
274
274
|
DomUtils.setStyleSize(pageElement.style, page);
|
|
275
|
+
if (this.viewManager.innerClientProperties.viewsSettings.isSimpleView) {
|
|
276
|
+
const paddings = this.viewManager.innerClientProperties.viewsSettings.paddings;
|
|
277
|
+
if (page.width - paddings.right <= this.viewManager.sizes.getVisibleAreaWidth(false))
|
|
278
|
+
pageElement.style.width = "100%";
|
|
279
|
+
}
|
|
280
|
+
}
|
|
275
281
|
}
|
|
276
282
|
updatePageClasses(pageElement) {
|
|
277
283
|
pageElement.className = RendererClassNames.PAGE;
|
|
@@ -116,7 +116,6 @@ export class EventManager {
|
|
|
116
116
|
onMouseDblClick(evt) {
|
|
117
117
|
Log.print(LogSource.EventManager, "onMouseDoubleClick", LogObjToStrCanvas.richMouseEvent(evt));
|
|
118
118
|
this.mouseHandler.onMouseDoubleClick(evt);
|
|
119
|
-
this.control.inputController.setPosition(evt.absolutePoint.x, evt.absolutePoint.y);
|
|
120
119
|
}
|
|
121
120
|
onMouseWheel(evt) {
|
|
122
121
|
Log.print(LogSource.EventManager, "onMouseWheel", LogObjToStrCanvas.richMouseEvent(evt));
|
|
@@ -38,6 +38,7 @@ export declare class BaseFormatter {
|
|
|
38
38
|
private tryExcludeAnchoredObjectFromCurrentPage;
|
|
39
39
|
private shouldEndColumn;
|
|
40
40
|
private processStateColumnEnd;
|
|
41
|
+
private calculateContentWidth;
|
|
41
42
|
private createNextPageArea;
|
|
42
43
|
private createNextColumn;
|
|
43
44
|
private pushRow;
|
|
@@ -239,6 +239,7 @@ export class BaseFormatter {
|
|
|
239
239
|
this.layoutPosition.column.height = columnHeight;
|
|
240
240
|
this.layoutPosition.pageArea.height = columnHeight;
|
|
241
241
|
this.layoutPosition.page.height = finalPageHeight;
|
|
242
|
+
this.layoutPosition.page.width = this.calculateContentWidth(this.layoutPosition.column) + margins.horizontal;
|
|
242
243
|
this.layoutPosition.page.minContentHeight = minVisibleAreaHeight;
|
|
243
244
|
}
|
|
244
245
|
createdColumn.paragraphFrames = ParagraphFrameCollector.collect(this.manager.model.colorProvider, createdColumn, this.subDocument.isMain() ?
|
|
@@ -258,6 +259,16 @@ export class BaseFormatter {
|
|
|
258
259
|
}
|
|
259
260
|
return true;
|
|
260
261
|
}
|
|
262
|
+
calculateContentWidth(column) {
|
|
263
|
+
let maxRight = 0;
|
|
264
|
+
column.tablesInfo.forEach(tableInfo => {
|
|
265
|
+
maxRight = Math.max(maxRight, tableInfo.right);
|
|
266
|
+
});
|
|
267
|
+
column.rows.forEach(row => {
|
|
268
|
+
maxRight = Math.max(maxRight, row.right);
|
|
269
|
+
});
|
|
270
|
+
return maxRight;
|
|
271
|
+
}
|
|
261
272
|
createNextPageArea() {
|
|
262
273
|
const newPageArea = new LayoutPageArea(this.subDocument);
|
|
263
274
|
newPageArea.setGeomerty(this.pageAreaBounds);
|
|
@@ -67,9 +67,12 @@ export class RowFormatter {
|
|
|
67
67
|
const prevRow = this.manager.activeFormatter.lastRowInfo.row;
|
|
68
68
|
const isFirstRowInParagraph = !prevRow || prevRow.flags.get(LayoutRowStateFlags.ParagraphEnd) ||
|
|
69
69
|
this.manager.activeFormatter.lastRowInfo.paragraphIndex != this.currWrapInfo.paragraphIndex;
|
|
70
|
-
|
|
70
|
+
let rowParagraphLeftIndent = isFirstRowInParagraph ?
|
|
71
71
|
UnitConverter.twipsToPixelsF(this.paragraphProps.getLeftIndentForFirstRow()) :
|
|
72
72
|
UnitConverter.twipsToPixelsF(this.paragraphProps.getLeftIndentForOtherRow());
|
|
73
|
+
if (this.manager.innerClientProperties.viewsSettings.isSimpleView) {
|
|
74
|
+
rowParagraphLeftIndent = Math.max(0, rowParagraphLeftIndent);
|
|
75
|
+
}
|
|
73
76
|
const rowContentHorizontalBounds = FixedInterval.fromPositions(paragraphHorizontalBounds.start + rowParagraphLeftIndent, paragraphHorizontalBounds.end - UnitConverter.twipsToPixelsF(this.paragraphProps.rightIndent));
|
|
74
77
|
this.rowSizesManager = new RowSizesManager(this, rowContentHorizontalBounds, minY, rowSpacingBeforeApplier, this.manager.activeFormatter.layoutRowBoundsCalculator.getRectangleBounds(this.manager), isFirstRowInParagraph);
|
|
75
78
|
this.tabInfo = new RowTabInfo(this, paragraphHorizontalBounds.start);
|
|
@@ -25,7 +25,7 @@ export declare class RowFormatterResult {
|
|
|
25
25
|
finishLogicalRow(currLogicRowEndPos: number): void;
|
|
26
26
|
private deleteSomeAnchorObjects;
|
|
27
27
|
finishRow(): void;
|
|
28
|
-
private
|
|
28
|
+
private getLastVisibleBox;
|
|
29
29
|
private addBracketBox;
|
|
30
30
|
private addBrackets;
|
|
31
31
|
private getBracketBox;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { Flag } from '@devexpress/utils/lib/class/flag';
|
|
2
|
-
import { EnumUtils } from '@devexpress/utils/lib/utils/enum';
|
|
3
2
|
import { ListUtils } from '@devexpress/utils/lib/utils/list';
|
|
4
3
|
import { MathUtils } from '@devexpress/utils/lib/utils/math';
|
|
5
4
|
import { SearchUtils } from '@devexpress/utils/lib/utils/search';
|
|
6
5
|
import { DocumentLayoutDetailsLevel } from '../../layout/document-layout-details-level';
|
|
7
6
|
import { BookmarkBox, LayoutBookmarkBoxType } from '../../layout/main-structures/layout-boxes/bookmark-box';
|
|
8
7
|
import { AnchoredObjectLevelType } from '../../layout/main-structures/layout-boxes/layout-anchored-object-box';
|
|
9
|
-
import { LayoutBoxType } from '../../layout/main-structures/layout-boxes/layout-box';
|
|
10
8
|
import { LayoutRow, LayoutRowStateFlags } from '../../layout/main-structures/layout-row';
|
|
11
9
|
import { BoxAligner } from './utils/box-aligner';
|
|
12
10
|
export var RowFormatterResultFlag;
|
|
@@ -52,7 +50,8 @@ export class RowFormatterResult {
|
|
|
52
50
|
}
|
|
53
51
|
finishRow() {
|
|
54
52
|
this.finishLogicalRow(this.rowFormatter.rowSizesManager.rowFormattingInfo.lastNonEmptyInterval.end);
|
|
55
|
-
const
|
|
53
|
+
const lastBox = ListUtils.last(this.row.boxes);
|
|
54
|
+
const lastBoxOffset = lastBox.rowOffset;
|
|
56
55
|
for (let ind = 0, anc; anc = this.newAnchoredObjects[ind]; ind++) {
|
|
57
56
|
if (anc.rowOffset > lastBoxOffset) {
|
|
58
57
|
this.deleteSomeAnchorObjects(ind, anc.rowOffset);
|
|
@@ -81,24 +80,20 @@ export class RowFormatterResult {
|
|
|
81
80
|
}
|
|
82
81
|
this.row.columnOffset = rowStartPos -
|
|
83
82
|
this.rowFormatter.manager.activeFormatter.layoutPosition.getLogPosition(DocumentLayoutDetailsLevel.Column);
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
const firstBox = this.row.boxes[0];
|
|
84
|
+
const lastVisibleBox = this.getLastVisibleBox();
|
|
85
|
+
if (lastVisibleBox)
|
|
86
|
+
this.row.width = Math.max(this.row.width, lastVisibleBox.right - firstBox.x);
|
|
87
87
|
const currState = this.rowFormatter.rowSizesManager.heightCalculator.currState;
|
|
88
88
|
this.row.increaseRowHeightFromSpacingBeforeAndAfter(currState.maxAscent, currState.maxDescent);
|
|
89
89
|
}
|
|
90
|
-
|
|
91
|
-
let
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
pictBox = box;
|
|
96
|
-
}
|
|
97
|
-
else if (!EnumUtils.isAnyOf(box.getType(), LayoutBoxType.ParagraphMark, LayoutBoxType.SectionMark, LayoutBoxType.LineBreak, LayoutBoxType.PageBreak)) {
|
|
98
|
-
return null;
|
|
99
|
-
}
|
|
90
|
+
getLastVisibleBox() {
|
|
91
|
+
for (let i = this.row.boxes.length - 1; i >= 0; i--) {
|
|
92
|
+
const box = this.row.boxes[i];
|
|
93
|
+
if (box.isVisible() && !box.isWhitespace())
|
|
94
|
+
return box;
|
|
100
95
|
}
|
|
101
|
-
return
|
|
96
|
+
return null;
|
|
102
97
|
}
|
|
103
98
|
addBracketBox(boxType, color, x, layoutBox) {
|
|
104
99
|
const box = new BookmarkBox(boxType);
|
|
@@ -4,7 +4,8 @@ import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
|
|
|
4
4
|
export declare class RowIntervalInfo extends FixedInterval {
|
|
5
5
|
avaliableWidth: number;
|
|
6
6
|
constructor(start: number, length: number, avaliableWidth?: number);
|
|
7
|
-
get
|
|
7
|
+
get rawUsedWidth(): number;
|
|
8
|
+
get usedWidth(): number;
|
|
8
9
|
get startOfFreeSpace(): number;
|
|
9
10
|
isConsiderBoxes(): boolean;
|
|
10
11
|
}
|
|
@@ -11,11 +11,14 @@ export class RowIntervalInfo extends FixedInterval {
|
|
|
11
11
|
super(start, length);
|
|
12
12
|
this.avaliableWidth = avaliableWidth;
|
|
13
13
|
}
|
|
14
|
-
get
|
|
14
|
+
get rawUsedWidth() {
|
|
15
15
|
return this.length - this.avaliableWidth;
|
|
16
16
|
}
|
|
17
|
+
get usedWidth() {
|
|
18
|
+
return Math.min(this.rawUsedWidth, this.length);
|
|
19
|
+
}
|
|
17
20
|
get startOfFreeSpace() {
|
|
18
|
-
return this.start + this.
|
|
21
|
+
return this.start + this.rawUsedWidth;
|
|
19
22
|
}
|
|
20
23
|
isConsiderBoxes() {
|
|
21
24
|
return this.avaliableWidth != this.length;
|
|
@@ -71,7 +74,7 @@ export class RowFormattingInfo {
|
|
|
71
74
|
recalculate(outerHorizontalRowContentBounds) {
|
|
72
75
|
const currInterval = this.currInterval;
|
|
73
76
|
this.calculate(outerHorizontalRowContentBounds);
|
|
74
|
-
const pos = currInterval.start + currInterval.
|
|
77
|
+
const pos = currInterval.start + currInterval.rawUsedWidth;
|
|
75
78
|
const index = this.findIntervalIndexByPosition(pos);
|
|
76
79
|
const interval = this.intervals[index];
|
|
77
80
|
if (interval && interval.start < pos) {
|
|
@@ -91,7 +94,7 @@ export class RowFormattingInfo {
|
|
|
91
94
|
return index;
|
|
92
95
|
}
|
|
93
96
|
canIncrementHeightTo(newHeight) {
|
|
94
|
-
const contentBounds = ListUtils.map(this.intervals, (c) => new Rectangle(c.start, this.minY, c.
|
|
97
|
+
const contentBounds = ListUtils.map(this.intervals, (c) => new Rectangle(c.start, this.minY, c.usedWidth, newHeight));
|
|
95
98
|
const intersectedObjects = this.calcIntersectObjects(newHeight);
|
|
96
99
|
return !ListUtils.unsafeAnyOf(intersectedObjects, (ancBound) => ListUtils.unsafeAnyOf(contentBounds, (contentBound) => RectangleUtils.getNonCollapsedIntersection(contentBound, ancBound)));
|
|
97
100
|
}
|
|
@@ -129,7 +129,7 @@ export class RowSizesManager {
|
|
|
129
129
|
}
|
|
130
130
|
else {
|
|
131
131
|
box.x = this.rowFormattingInfo.intervals[0].startOfFreeSpace;
|
|
132
|
-
this.rowFormattingInfo.intervals[0].avaliableWidth -=
|
|
132
|
+
this.rowFormattingInfo.intervals[0].avaliableWidth -= box.width;
|
|
133
133
|
this.addBoxIgnoreWidth();
|
|
134
134
|
}
|
|
135
135
|
}
|
|
@@ -166,8 +166,6 @@ export class RowSizesManager {
|
|
|
166
166
|
const box = this.rowFormatter.currBox;
|
|
167
167
|
box.x = this.rowFormattingInfo.currInterval.startOfFreeSpace;
|
|
168
168
|
this.rowFormattingInfo.currInterval.avaliableWidth -= box.width;
|
|
169
|
-
if (this.rowFormattingInfo.currInterval.avaliableWidth < 0)
|
|
170
|
-
this.rowFormattingInfo.currInterval.avaliableWidth = 0;
|
|
171
169
|
this.row.boxes.push(box);
|
|
172
170
|
this.rowFormattingInfo.lastNonEmptyIntervalIndex = this.rowFormattingInfo.currIndex;
|
|
173
171
|
this.rowFormatter.setBoxInfo(true);
|
|
@@ -21,6 +21,7 @@ export declare class MouseHandlerDefaultState extends MouseHandlerStateBase {
|
|
|
21
21
|
private beginCharacterMultiSelection;
|
|
22
22
|
private isLeftArea;
|
|
23
23
|
private isLeftAreaOffset;
|
|
24
|
+
private getLeftAreaOffset;
|
|
24
25
|
private shouldProcessResizeBoxVisualizer;
|
|
25
26
|
private beginResizeBoxMouseHandler;
|
|
26
27
|
private beginRotate;
|
|
@@ -316,12 +316,9 @@ export class MouseHandlerDefaultState extends MouseHandlerStateBase {
|
|
|
316
316
|
}
|
|
317
317
|
isLeftAreaOffset(htr, evt) {
|
|
318
318
|
if (htr) {
|
|
319
|
-
const columnX = htr.pageArea.x + htr.column.x;
|
|
320
|
-
const rowX = columnX + htr.row.x;
|
|
321
|
-
const leftAreaX = Math.min(columnX - MouseHandler.LEFT_AREA_COMMANDS_OFFSET, rowX);
|
|
322
319
|
if (htr.exactlyDetailLevel >= DocumentLayoutDetailsLevel.Page &&
|
|
323
320
|
htr.deviations[DocumentLayoutDetailsLevel.Column] & HitTestDeviation.Left &&
|
|
324
|
-
evt.layoutPoint.x <=
|
|
321
|
+
evt.layoutPoint.x <= this.getLeftAreaOffset(htr))
|
|
325
322
|
return true;
|
|
326
323
|
if (htr.detailsLevel >= DocumentLayoutDetailsLevel.Box &&
|
|
327
324
|
htr.exactlyDetailLevel >= DocumentLayoutDetailsLevel.Row &&
|
|
@@ -335,6 +332,11 @@ export class MouseHandlerDefaultState extends MouseHandlerStateBase {
|
|
|
335
332
|
}
|
|
336
333
|
return false;
|
|
337
334
|
}
|
|
335
|
+
getLeftAreaOffset(htr) {
|
|
336
|
+
const columnX = htr.pageArea.x + htr.column.x;
|
|
337
|
+
const rowX = columnX + htr.row.x;
|
|
338
|
+
return Math.min(columnX - MouseHandler.LEFT_AREA_COMMANDS_OFFSET, rowX);
|
|
339
|
+
}
|
|
338
340
|
shouldProcessResizeBoxVisualizer(evt) {
|
|
339
341
|
return this.handler.boxVisualizerManager.resizeBoxVisualizer.shouldCapture(evt) &&
|
|
340
342
|
this.handler.control.selection.activeSubDocument.isEditable([new FixedInterval(this.handler.control.selection.specialRunInfo.getPosition(), 1)]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "devexpress-richedit",
|
|
3
|
-
"version": "24.2.
|
|
3
|
+
"version": "24.2.16",
|
|
4
4
|
"homepage": "https://www.devexpress.com/",
|
|
5
5
|
"bugs": "https://www.devexpress.com/support/",
|
|
6
6
|
"author": "Developer Express Inc.",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"build-nspell": "webpack --mode production --config=bin/nspell.webpack.config.js"
|
|
12
12
|
},
|
|
13
13
|
"peerDependencies": {
|
|
14
|
-
"devextreme": "24.2.
|
|
15
|
-
"devextreme-dist": "24.2.
|
|
14
|
+
"devextreme": "24.2.16",
|
|
15
|
+
"devextreme-dist": "24.2.16"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
18
|
"webpack": "5.89.0",
|