devexpress-richedit 24.2.6-build-25065-0102 → 24.2.6-build-25072-0103
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/dist/dx.richedit.js +177 -156
- package/dist/dx.richedit.min.js +1 -1
- package/lib/common/canvas/canvas-scroll-manager.d.ts +0 -1
- package/lib/common/canvas/canvas-scroll-manager.js +1 -11
- package/lib/common/canvas/canvas-size-info.d.ts +3 -3
- package/lib/common/canvas/canvas-size-info.js +19 -13
- package/lib/common/canvas/renderes/view-manager.js +1 -5
- package/lib/common/model/section/section-properties.js +5 -0
- package/lib/common/utils/size-utils.d.ts +8 -0
- package/lib/common/utils/size-utils.js +32 -8
- package/package.json +3 -3
@@ -5,7 +5,6 @@ import { ViewManager } from './renderes/view-manager';
|
|
5
5
|
export declare class CanvasScrollManager implements IScrollLayoutChangesListener {
|
6
6
|
private updateScrollTimeoutId;
|
7
7
|
private waitForDblClickTimeoutId;
|
8
|
-
private scrollMeasurer;
|
9
8
|
private horizontalRuler;
|
10
9
|
private viewManager;
|
11
10
|
private get canvas();
|
@@ -24,18 +24,8 @@ export class CanvasScrollManager {
|
|
24
24
|
this.updateScrollVisibility();
|
25
25
|
}
|
26
26
|
updateScrollVisibility() {
|
27
|
-
if (!this.scrollMeasurer) {
|
28
|
-
this.scrollMeasurer = document.createElement("div");
|
29
|
-
this.scrollMeasurer.style.position = "absolute";
|
30
|
-
this.scrollMeasurer.style.top = "0";
|
31
|
-
this.scrollMeasurer.style.bottom = "0";
|
32
|
-
this.scrollMeasurer.style.right = "0";
|
33
|
-
this.scrollMeasurer.style.left = "0";
|
34
|
-
}
|
35
|
-
this.canvas.appendChild(this.scrollMeasurer);
|
36
27
|
const prevScrollYVisibility = this.sizes.scrollYVisible;
|
37
|
-
this.sizes.updateScrollVisibility(this.
|
38
|
-
this.canvas.removeChild(this.scrollMeasurer);
|
28
|
+
this.sizes.updateScrollVisibility(this.canvas);
|
39
29
|
if (prevScrollYVisibility !== this.sizes.scrollYVisible && this.horizontalRuler)
|
40
30
|
this.horizontalRuler.adjust();
|
41
31
|
}
|
@@ -14,9 +14,9 @@ export declare class CanvasSizeInfo implements IControlHeightProvider {
|
|
14
14
|
initialize(page: HTMLElement, canvas: HTMLDivElement): void;
|
15
15
|
findPageIndexByOffsetY(pages: LayoutPage[], offsetY: number): number;
|
16
16
|
getPageOffsetY(layoutPage: LayoutPage): number;
|
17
|
-
setVisibleAreaSize
|
17
|
+
private setVisibleAreaSize;
|
18
18
|
getVisibleAreaWidth(includeScrollBars: boolean): number;
|
19
19
|
getVisibleAreaHeight(includeScrollBars: boolean): number;
|
20
|
-
updateScrollVisibility(
|
21
|
-
|
20
|
+
updateScrollVisibility(canvas: HTMLDivElement): void;
|
21
|
+
updateSize(canvas: HTMLDivElement): boolean;
|
22
22
|
}
|
@@ -2,6 +2,7 @@ import { RenderPageVertivalInfo } from '../view-settings/views-settings';
|
|
2
2
|
import { Size } from '@devexpress/utils/lib/geometry/size';
|
3
3
|
import { SearchUtils } from '@devexpress/utils/lib/utils/search';
|
4
4
|
import { DomUtils } from '@devexpress/utils/lib/utils/dom';
|
5
|
+
import { SizeUtils } from '../utils/size-utils';
|
5
6
|
export class CanvasSizeInfo {
|
6
7
|
constructor() {
|
7
8
|
this.topSpacing = -1;
|
@@ -18,7 +19,7 @@ export class CanvasSizeInfo {
|
|
18
19
|
this.pageVerticalInfo.init(DomUtils.getCurrentStyle(page));
|
19
20
|
this.topSpacing = this.pageVerticalInfo.topPageBorderWidth + this.pageVerticalInfo.topMargin;
|
20
21
|
this.betweenPageSpacing = this.pageVerticalInfo.betweenPageSpacing;
|
21
|
-
this.setVisibleAreaSize(canvas
|
22
|
+
this.setVisibleAreaSize(SizeUtils.getClientWidth(canvas), SizeUtils.getClientHeight(canvas));
|
22
23
|
}
|
23
24
|
findPageIndexByOffsetY(pages, offsetY) {
|
24
25
|
return Math.max(0, SearchUtils.normedInterpolationIndexOf(pages, (p) => this.getPageOffsetY(p), offsetY));
|
@@ -31,21 +32,26 @@ export class CanvasSizeInfo {
|
|
31
32
|
this.visibleAreaSize.height = height;
|
32
33
|
}
|
33
34
|
getVisibleAreaWidth(includeScrollBars) {
|
34
|
-
if (includeScrollBars)
|
35
|
+
if (!includeScrollBars)
|
35
36
|
return this.visibleAreaSize.width;
|
36
|
-
return this.scrollYVisible ? this.visibleAreaSize.width
|
37
|
+
return this.scrollYVisible ? this.visibleAreaSize.width + this.scrollWidth : this.visibleAreaSize.width;
|
37
38
|
}
|
38
39
|
getVisibleAreaHeight(includeScrollBars) {
|
39
|
-
if (includeScrollBars)
|
40
|
+
if (!includeScrollBars)
|
40
41
|
return this.visibleAreaSize.height;
|
41
|
-
return this.scrollXVisible ? this.visibleAreaSize.height
|
42
|
-
}
|
43
|
-
updateScrollVisibility(
|
44
|
-
this.scrollXVisible =
|
45
|
-
this.scrollYVisible =
|
46
|
-
}
|
47
|
-
|
48
|
-
|
49
|
-
|
42
|
+
return this.scrollXVisible ? this.visibleAreaSize.height + this.scrollWidth : this.visibleAreaSize.height;
|
43
|
+
}
|
44
|
+
updateScrollVisibility(canvas) {
|
45
|
+
this.scrollXVisible = SizeUtils.getHeightInfo(canvas).scrollbarSize > 0;
|
46
|
+
this.scrollYVisible = SizeUtils.getWidthInfo(canvas).scrollbarSize > 0;
|
47
|
+
}
|
48
|
+
updateSize(canvas) {
|
49
|
+
const width = SizeUtils.getClientWidth(canvas);
|
50
|
+
const height = SizeUtils.getClientHeight(canvas);
|
51
|
+
if (this.visibleAreaSize.width !== width || this.visibleAreaSize.height !== height) {
|
52
|
+
this.setVisibleAreaSize(width, height);
|
53
|
+
return true;
|
54
|
+
}
|
55
|
+
return false;
|
50
56
|
}
|
51
57
|
}
|
@@ -24,7 +24,6 @@ import { MisspelledSelectionRenderer } from './selection-renderers/misspelled-se
|
|
24
24
|
import { RangePermissionRenderer } from './selection-renderers/range-permission-renderer';
|
25
25
|
import { SearchSelectionRenderer } from './selection-renderers/search-selection-renderer';
|
26
26
|
import { SelectionRenderer } from './selection-renderers/selection-renderer';
|
27
|
-
import { SizeUtils } from '../../../common/utils/size-utils';
|
28
27
|
export class ViewManager {
|
29
28
|
get renderer() { return this.renderers[this.innerClientProperties.viewsSettings.viewType]; }
|
30
29
|
get printLayoutRenderer() { return this.renderers[ViewType.PrintLayout]; }
|
@@ -82,11 +81,8 @@ export class ViewManager {
|
|
82
81
|
this.canvasListener.onCanvasScroll();
|
83
82
|
}
|
84
83
|
}
|
85
|
-
else if (this.sizes.
|
86
|
-
const size = SizeUtils.getOffsetSize(this.canvas);
|
87
|
-
this.sizes.setVisibleAreaSize(size.width, size.height);
|
84
|
+
else if (this.sizes.updateSize(this.canvas))
|
88
85
|
this.scroll.onCanvasSizeChanged();
|
89
|
-
}
|
90
86
|
}
|
91
87
|
NotifyPagesReady(pageChanges) {
|
92
88
|
this.canvasListener.onPagesReady(pageChanges);
|
@@ -5,6 +5,7 @@ import { SectionStartType } from './enums';
|
|
5
5
|
import { SectionColumnProperties } from './section-column-properties';
|
6
6
|
import { PaperKind } from './paper-kind';
|
7
7
|
import { LineNumberingProperties } from './line-numbering-properties';
|
8
|
+
import { NoteProperties } from '../footnotes/footnote';
|
8
9
|
export class SectionProperties {
|
9
10
|
constructor() {
|
10
11
|
this.margins = new Margins(1440, 1440, 1440, 1440);
|
@@ -22,6 +23,8 @@ export class SectionProperties {
|
|
22
23
|
this.firstPageNumber = -1;
|
23
24
|
this.continueNumbering = true;
|
24
25
|
this.lineNumbering = new LineNumberingProperties();
|
26
|
+
this.footNote = NoteProperties.createDefault();
|
27
|
+
this.endNote = NoteProperties.createDefault();
|
25
28
|
}
|
26
29
|
static createSimpleSectionProperties(width, height) {
|
27
30
|
const simpleSectionProperties = new SectionProperties();
|
@@ -64,6 +67,8 @@ export class SectionProperties {
|
|
64
67
|
else
|
65
68
|
this.columnsInfo = obj.columnsInfo;
|
66
69
|
this.lineNumbering.copyFrom(obj.lineNumbering);
|
70
|
+
this.footNote.copyFrom(obj.footNote);
|
71
|
+
this.endNote.copyFrom(obj.endNote);
|
67
72
|
this.equalWidthColumns = obj.equalWidthColumns;
|
68
73
|
this.marginBottom = obj.marginBottom;
|
69
74
|
this.marginLeft = obj.marginLeft;
|
@@ -1,7 +1,15 @@
|
|
1
1
|
export declare class SizeUtils {
|
2
|
+
static getWidthInfo(element: Element): DimensionInfo;
|
2
3
|
static getClientWidth(element: Element): number;
|
4
|
+
static getHeightInfo(element: Element): DimensionInfo;
|
3
5
|
static getClientHeight(element: Element): number;
|
4
6
|
static getOffsetSize(element: Element): DOMRect;
|
5
7
|
static getOffsetWidth(element: Element): number;
|
6
8
|
static getOffsetHeight(element: Element): number;
|
7
9
|
}
|
10
|
+
export declare class DimensionInfo {
|
11
|
+
readonly offsetSize: number;
|
12
|
+
readonly clientSize: number;
|
13
|
+
readonly scrollbarSize: number;
|
14
|
+
constructor(offsetSize: number, clientSize: number, scrollbarSize: number);
|
15
|
+
}
|
@@ -1,17 +1,31 @@
|
|
1
1
|
export class SizeUtils {
|
2
|
-
static
|
2
|
+
static getWidthInfo(element) {
|
3
|
+
const offsetSize = SizeUtils.getOffsetWidth(element);
|
3
4
|
const style = getComputedStyle(element);
|
4
|
-
const
|
5
|
-
|
5
|
+
const inset = parseCssValue(style.borderLeftWidth)
|
6
|
+
+ parseCssValue(style.borderRightWidth)
|
7
|
+
+ parseCssValue(style.paddingLeft)
|
8
|
+
+ parseCssValue(style.paddingRight);
|
9
|
+
const sizeWithScrollBar = offsetSize - inset;
|
6
10
|
const scrollBarSize = Math.round(sizeWithScrollBar) - element.clientWidth;
|
7
|
-
return sizeWithScrollBar - scrollBarSize;
|
11
|
+
return new DimensionInfo(offsetSize, sizeWithScrollBar - scrollBarSize, scrollBarSize);
|
8
12
|
}
|
9
|
-
static
|
13
|
+
static getClientWidth(element) {
|
14
|
+
return this.getWidthInfo(element).clientSize;
|
15
|
+
}
|
16
|
+
static getHeightInfo(element) {
|
17
|
+
const offsetSize = SizeUtils.getOffsetHeight(element);
|
10
18
|
const style = getComputedStyle(element);
|
11
|
-
const
|
12
|
-
|
19
|
+
const inset = parseCssValue(style.borderTopWidth)
|
20
|
+
+ parseCssValue(style.borderBottomWidth)
|
21
|
+
+ parseCssValue(style.paddingTop)
|
22
|
+
+ parseCssValue(style.paddingBottom);
|
23
|
+
const sizeWithScrollBar = offsetSize - inset;
|
13
24
|
const scrollBarSize = Math.round(sizeWithScrollBar) - element.clientHeight;
|
14
|
-
return sizeWithScrollBar - scrollBarSize;
|
25
|
+
return new DimensionInfo(offsetSize, sizeWithScrollBar - scrollBarSize, scrollBarSize);
|
26
|
+
}
|
27
|
+
static getClientHeight(element) {
|
28
|
+
return this.getHeightInfo(element).clientSize;
|
15
29
|
}
|
16
30
|
static getOffsetSize(element) {
|
17
31
|
return element.getBoundingClientRect();
|
@@ -23,3 +37,13 @@ export class SizeUtils {
|
|
23
37
|
return SizeUtils.getOffsetSize(element).height;
|
24
38
|
}
|
25
39
|
}
|
40
|
+
function parseCssValue(value) {
|
41
|
+
return value ? parseFloat(value) : 0;
|
42
|
+
}
|
43
|
+
export class DimensionInfo {
|
44
|
+
constructor(offsetSize, clientSize, scrollbarSize) {
|
45
|
+
this.offsetSize = offsetSize;
|
46
|
+
this.clientSize = clientSize;
|
47
|
+
this.scrollbarSize = scrollbarSize;
|
48
|
+
}
|
49
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "devexpress-richedit",
|
3
|
-
"version": "24.2.6-build-
|
3
|
+
"version": "24.2.6-build-25072-0103",
|
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.6-build-
|
18
|
-
"devextreme-dist": "24.2.6-build-
|
17
|
+
"devextreme": "24.2.6-build-25071-1429",
|
18
|
+
"devextreme-dist": "24.2.6-build-25071-1429"
|
19
19
|
},
|
20
20
|
"dependencies": {
|
21
21
|
"jszip": "~3.10.1",
|