devexpress-richedit 24.1.12-build-25093-0104 → 24.1.12

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 (34) hide show
  1. package/dist/dx.richedit.js +159 -106
  2. package/dist/dx.richedit.min.js +1 -1
  3. package/lib/client/client-rich-edit.js +2 -2
  4. package/lib/client/commands/mail-merge-command.js +2 -1
  5. package/lib/client/formats/docx/export/data.d.ts +5 -1
  6. package/lib/client/formats/docx/export/data.js +3 -2
  7. package/lib/client/formats/docx/export/exporter.d.ts +2 -3
  8. package/lib/client/formats/docx/export/exporter.js +3 -3
  9. package/lib/client/formats/docx/export/exporters/base/table/table.d.ts +1 -1
  10. package/lib/client/formats/docx/export/exporters/base/table/table.js +4 -4
  11. package/lib/client/formats/docx/import/destination/paragraph-properties/properties/paragraph-spacing-destination.js +6 -4
  12. package/lib/client/model-api/formats/exporter.js +1 -1
  13. package/lib/client/public/rich-edit.js +2 -2
  14. package/lib/common/canvas/canvas-manager.js +10 -4
  15. package/lib/common/canvas/renderes/common/document-renderer.js +10 -12
  16. package/lib/common/formats/i-document-exporter.d.ts +3 -0
  17. package/lib/common/input-controller.d.ts +5 -5
  18. package/lib/common/input-controller.js +12 -12
  19. package/lib/common/layout/document-layout.d.ts +3 -0
  20. package/lib/common/layout/document-layout.js +6 -0
  21. package/lib/common/layout/main-structures/layout-page-area.d.ts +3 -0
  22. package/lib/common/layout/main-structures/layout-page-area.js +6 -0
  23. package/lib/common/layout/main-structures/layout-page.d.ts +3 -0
  24. package/lib/common/layout/main-structures/layout-page.js +8 -0
  25. package/lib/common/layout-formatter/floating/position-calculators/horizontal.d.ts +1 -0
  26. package/lib/common/layout-formatter/floating/position-calculators/horizontal.js +16 -12
  27. package/lib/common/layout-formatter/row/states.js +0 -2
  28. package/lib/common/layout-formatter/row/tab-info.js +1 -1
  29. package/lib/common/mouse-handler/mouse-handler/mouse-handler-default-state.d.ts +1 -1
  30. package/lib/common/mouse-handler/mouse-handler/mouse-handler-default-state.js +22 -25
  31. package/lib/common/rich-edit-core.js +3 -2
  32. package/lib/common/utils/size-utils.d.ts +14 -7
  33. package/lib/common/utils/size-utils.js +43 -18
  34. package/package.json +3 -3
@@ -93,7 +93,7 @@ export class RichEditCore {
93
93
  this.invalidateLayoutAfterFontsLoaded();
94
94
  });
95
95
  }
96
- get isReadOnlyPersistent() { return this.readOnly == ReadOnlyMode.Persistent; }
96
+ get isReadOnlyPersistent() { return this.readOnly === ReadOnlyMode.Persistent; }
97
97
  get model() { return this.modelManager.model; }
98
98
  get isDisposed() {
99
99
  return this._isDisposed;
@@ -257,8 +257,8 @@ export class RichEditCore {
257
257
  this.readOnly = ReadOnlyMode.Persistent;
258
258
  else if (!readOnly && this.readOnly === ReadOnlyMode.Persistent) {
259
259
  this.readOnly = ReadOnlyMode.None;
260
- this.inputController.inputEditor.initializeIfNotReadOnly();
261
260
  }
261
+ this.inputController.inputEditor.initializeEditableStateCore();
262
262
  }
263
263
  setWorkSession(sessionGuid, documentInfo) {
264
264
  this.sessionGuid = sessionGuid;
@@ -384,6 +384,7 @@ export class RichEditCore {
384
384
  pictureRenderer: this.viewManager.renderer,
385
385
  uiUnitConverter: this.uiUnitConverter,
386
386
  lastMaxNumPages: this.layout.lastMaxNumPages,
387
+ grids: this.layout.grids,
387
388
  pageIndex: this.selection.pageIndex,
388
389
  sessionGuid: this.sessionGuid,
389
390
  clientGuid: this.clientGuid,
@@ -1,11 +1,17 @@
1
+ declare type ScrollbarsWidth = {
2
+ horizontal: number;
3
+ vertical: number;
4
+ };
1
5
  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;
6
+ private static _scrollbarsWidth;
7
+ static getScrollbarsWidth(): ScrollbarsWidth;
8
+ static getWidthInfo(element: HTMLElement): DimensionInfo;
9
+ static getClientWidth(element: HTMLElement): number;
10
+ static getHeightInfo(element: HTMLElement): DimensionInfo;
11
+ static getClientHeight(element: HTMLElement): number;
12
+ static getOffsetSize(element: HTMLElement): DOMRect;
13
+ static getOffsetWidth(element: HTMLElement): number;
14
+ static getOffsetHeight(element: HTMLElement): number;
9
15
  }
10
16
  export declare class DimensionInfo {
11
17
  readonly offsetSize: number;
@@ -13,3 +19,4 @@ export declare class DimensionInfo {
13
19
  readonly scrollbarSize: number;
14
20
  constructor(offsetSize: number, clientSize: number, scrollbarSize: number);
15
21
  }
22
+ export {};
@@ -1,28 +1,53 @@
1
+ import { isDefined } from "@devexpress/utils/lib/utils/common";
1
2
  export class SizeUtils {
3
+ static getScrollbarsWidth() {
4
+ if (!isDefined(this._scrollbarsWidth)) {
5
+ const scrollDiv = document.createElement('div');
6
+ scrollDiv.style.visibility = 'hidden';
7
+ scrollDiv.style.overflow = 'scroll';
8
+ scrollDiv.style.position = 'absolute';
9
+ scrollDiv.style.top = '-9999px';
10
+ scrollDiv.style.width = '100px';
11
+ scrollDiv.style.height = '100px';
12
+ document.body.appendChild(scrollDiv);
13
+ const innerDiv = document.createElement('div');
14
+ innerDiv.style.width = '100%';
15
+ innerDiv.style.height = '100%';
16
+ scrollDiv.appendChild(innerDiv);
17
+ this._scrollbarsWidth = {
18
+ horizontal: SizeUtils.getOffsetHeight(scrollDiv) - SizeUtils.getOffsetHeight(innerDiv),
19
+ vertical: SizeUtils.getOffsetWidth(scrollDiv) - SizeUtils.getOffsetWidth(innerDiv)
20
+ };
21
+ scrollDiv.remove();
22
+ }
23
+ return this._scrollbarsWidth;
24
+ }
2
25
  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);
26
+ const computedStyle = getComputedStyle(element);
27
+ const offsetWidth = this.getOffsetWidth(element);
28
+ const offsetWidthWithoutBorder = offsetWidth
29
+ - parseCssValue(computedStyle.borderLeftWidth)
30
+ - parseCssValue(computedStyle.borderRightWidth);
31
+ let scrollbarWidth = 0;
32
+ if (Math.round(offsetWidthWithoutBorder) > element.clientWidth)
33
+ scrollbarWidth = SizeUtils.getScrollbarsWidth().vertical;
34
+ const clientWidth = offsetWidthWithoutBorder - scrollbarWidth;
35
+ return new DimensionInfo(offsetWidth, clientWidth, scrollbarWidth);
12
36
  }
13
37
  static getClientWidth(element) {
14
38
  return this.getWidthInfo(element).clientSize;
15
39
  }
16
40
  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);
41
+ const computedStyle = getComputedStyle(element);
42
+ const offsetHeight = this.getOffsetHeight(element);
43
+ const offsetHeightWithoutBorder = offsetHeight
44
+ - parseCssValue(computedStyle.borderTopWidth)
45
+ - parseCssValue(computedStyle.borderBottomWidth);
46
+ let scrollbarWidth = 0;
47
+ if (Math.round(offsetHeightWithoutBorder) > element.clientHeight)
48
+ scrollbarWidth = SizeUtils.getScrollbarsWidth().horizontal;
49
+ const clientHeight = offsetHeightWithoutBorder - scrollbarWidth;
50
+ return new DimensionInfo(offsetHeight, clientHeight, scrollbarWidth);
26
51
  }
27
52
  static getClientHeight(element) {
28
53
  return this.getHeightInfo(element).clientSize;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devexpress-richedit",
3
- "version": "24.1.12-build-25093-0104",
3
+ "version": "24.1.12",
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.1.12-build-25091-1936",
18
- "devextreme-dist": "24.1.12-build-25091-1936"
17
+ "devextreme": "24.1.12",
18
+ "devextreme-dist": "24.1.12"
19
19
  },
20
20
  "dependencies": {
21
21
  "jszip": "~3.10.1",