devexpress-richedit 24.2.8-build-25149-0115 → 25.1.2-beta

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 (123) 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.css +1 -1
  9. package/dist/dx.richedit.d.ts +11 -3
  10. package/dist/dx.richedit.js +2494 -2002
  11. package/dist/dx.richedit.min.js +2 -2
  12. package/index.d.ts +1 -1
  13. package/index.js +1 -1
  14. package/lib/client/_constants.d.ts +1 -0
  15. package/lib/client/_constants.js +3 -0
  16. package/lib/client/bars/rich-edit-ribbon/ribbon-items-data.js +11 -0
  17. package/lib/client/client-rich-edit.js +5 -3
  18. package/lib/client/commands/commands.js +12 -0
  19. package/lib/client/i-rich-constructor-settings.d.ts +2 -0
  20. package/lib/client/model-api/api-utils/parameter-checker.d.ts +1 -1
  21. package/lib/client/model-api/api-utils/parameter-checker.js +2 -2
  22. package/lib/client/public/commands/enum.d.ts +3 -1
  23. package/lib/client/public/commands/enum.js +2 -0
  24. package/lib/client/public/options.d.ts +2 -0
  25. package/lib/client/public/options.js +2 -0
  26. package/lib/client/public/rich-edit.d.ts +4 -0
  27. package/lib/client/public/rich-edit.js +21 -0
  28. package/lib/client/ribbon/i-toolbar-item-options.d.ts +1 -1
  29. package/lib/client/settings.js +4 -0
  30. package/lib/client/utils/focus-helper.js +5 -22
  31. package/lib/common/canvas/canvas-manager.d.ts +2 -0
  32. package/lib/common/canvas/canvas-manager.js +34 -20
  33. package/lib/common/canvas/canvas-scroll-info.d.ts +6 -3
  34. package/lib/common/canvas/canvas-scroll-info.js +9 -4
  35. package/lib/common/canvas/canvas-scroll-manager.d.ts +4 -1
  36. package/lib/common/canvas/canvas-scroll-manager.js +28 -20
  37. package/lib/common/canvas/canvas-size-info.d.ts +3 -2
  38. package/lib/common/canvas/canvas-size-info.js +4 -6
  39. package/lib/common/canvas/renderes/canvas-listener/print-layout-view-canvas-listener.js +2 -2
  40. package/lib/common/canvas/renderes/common/document-renderer.d.ts +5 -2
  41. package/lib/common/canvas/renderes/common/document-renderer.js +5 -0
  42. package/lib/common/canvas/renderes/view-manager.d.ts +9 -1
  43. package/lib/common/canvas/renderes/view-manager.js +27 -2
  44. package/lib/common/commands/client-command.d.ts +3 -1
  45. package/lib/common/commands/client-command.js +2 -0
  46. package/lib/common/commands/command-manager.js +4 -0
  47. package/lib/common/commands/layout/apply-style-command.d.ts +2 -2
  48. package/lib/common/commands/layout/apply-style-command.js +4 -3
  49. package/lib/common/commands/layout/change-zoom-level-command.d.ts +10 -0
  50. package/lib/common/commands/layout/change-zoom-level-command.js +30 -0
  51. package/lib/common/commands/layout/toggle-allow-zoom-command.d.ts +7 -0
  52. package/lib/common/commands/layout/toggle-allow-zoom-command.js +17 -0
  53. package/lib/common/commands/ruler/ruler-table-column-separators-command.d.ts +9 -2
  54. package/lib/common/commands/ruler/ruler-table-column-separators-command.js +24 -15
  55. package/lib/common/commands/toc/set-paragraph-level-command.js +1 -1
  56. package/lib/common/formats/rtf/import/table/normalization/apply-use-values.d.ts +6 -0
  57. package/lib/common/formats/rtf/import/table/normalization/apply-use-values.js +90 -0
  58. package/lib/common/formats/rtf/import/table/table-converter.js +7 -2
  59. package/lib/common/input-controller.js +4 -0
  60. package/lib/common/interfaces/i-zoom-level-holder.d.ts +3 -0
  61. package/lib/common/interfaces/i-zoom-level-holder.js +1 -0
  62. package/lib/common/layout/document-layout.d.ts +2 -0
  63. package/lib/common/layout/document-layout.js +4 -0
  64. package/lib/common/layout-formatter/formatter/base-formatter.js +2 -1
  65. package/lib/common/model/borders/border-info.js +1 -1
  66. package/lib/common/model/changes/change.d.ts +2 -1
  67. package/lib/common/model/changes/enums.d.ts +2 -1
  68. package/lib/common/model/changes/enums.js +1 -0
  69. package/lib/common/model/changes/model/zoom-level.d.ts +8 -0
  70. package/lib/common/model/changes/model/zoom-level.js +8 -0
  71. package/lib/common/model/character/character-properties.d.ts +1 -1
  72. package/lib/common/model/character/character-properties.js +2 -14
  73. package/lib/common/model/creator/creator.js +6 -0
  74. package/lib/common/model/history/items/character-properties-history-items.d.ts +1 -2
  75. package/lib/common/model/history/items/character-properties-history-items.js +2 -3
  76. package/lib/common/model/json/enums/json-control-enums.d.ts +2 -1
  77. package/lib/common/model/json/enums/json-control-enums.js +1 -0
  78. package/lib/common/model/json/exporters/json-control-options-converter.js +2 -0
  79. package/lib/common/model/json/importers/json-importer.js +2 -0
  80. package/lib/common/model/manipulators/character-properties-manipulator.js +2 -2
  81. package/lib/common/model/manipulators/i-properties-manipulator.d.ts +1 -1
  82. package/lib/common/model/manipulators/model-manipulator.d.ts +2 -1
  83. package/lib/common/model/manipulators/model-manipulator.js +4 -0
  84. package/lib/common/model/options/control.d.ts +1 -0
  85. package/lib/common/model/options/control.js +1 -0
  86. package/lib/common/model/paragraph/paragraph-style.d.ts +9 -4
  87. package/lib/common/model/paragraph/paragraph-style.js +20 -14
  88. package/lib/common/model/rich-utils.d.ts +2 -0
  89. package/lib/common/model/rich-utils.js +2 -0
  90. package/lib/common/mouse-handler/resize-box-helper.js +2 -2
  91. package/lib/common/rich-edit-core.d.ts +0 -1
  92. package/lib/common/rich-edit-core.js +17 -22
  93. package/lib/common/ui/ruler/controls/base.d.ts +7 -2
  94. package/lib/common/ui/ruler/controls/base.js +11 -3
  95. package/lib/common/ui/ruler/controls/column.d.ts +17 -5
  96. package/lib/common/ui/ruler/controls/column.js +37 -21
  97. package/lib/common/ui/ruler/controls/divisions.d.ts +18 -5
  98. package/lib/common/ui/ruler/controls/divisions.js +41 -13
  99. package/lib/common/ui/ruler/controls/indent/first-line.js +2 -2
  100. package/lib/common/ui/ruler/controls/indent/left.js +2 -2
  101. package/lib/common/ui/ruler/controls/indent/right.js +2 -2
  102. package/lib/common/ui/ruler/controls/margin/base.js +3 -3
  103. package/lib/common/ui/ruler/controls/owner.d.ts +2 -0
  104. package/lib/common/ui/ruler/controls/owner.js +4 -0
  105. package/lib/common/ui/ruler/controls/ruler.js +8 -4
  106. package/lib/common/ui/ruler/controls/tab/tab-info.d.ts +15 -0
  107. package/lib/common/ui/ruler/controls/tab/tab-info.js +19 -0
  108. package/lib/common/ui/ruler/controls/tab/tab.d.ts +3 -3
  109. package/lib/common/ui/ruler/controls/tab/tab.js +10 -11
  110. package/lib/common/ui/ruler/controls/table.js +5 -4
  111. package/lib/common/ui/ruler/controls/vertical-line.js +1 -2
  112. package/lib/common/ui/ruler/controls/zoomable-value.d.ts +8 -0
  113. package/lib/common/ui/ruler/controls/zoomable-value.js +15 -0
  114. package/lib/common/ui/ruler/manager.d.ts +6 -2
  115. package/lib/common/ui/ruler/manager.js +13 -4
  116. package/lib/common/ui/ruler/model-data.d.ts +1 -0
  117. package/lib/common/ui/ruler/model-data.js +1 -0
  118. package/lib/common/ui/ruler/ruler.js +2 -0
  119. package/lib/common/utils/mixed-size.d.ts +27 -0
  120. package/lib/common/utils/mixed-size.js +91 -0
  121. package/lib/common/view-settings/views-settings.d.ts +2 -0
  122. package/lib/common/view-settings/views-settings.js +3 -0
  123. package/package.json +7 -7
@@ -0,0 +1,15 @@
1
+ export class RulerValue {
2
+ set value(value) {
3
+ this.originalValue = value / this.zoomLevelHolder.zoomLevel;
4
+ }
5
+ ;
6
+ get value() {
7
+ const calculatedValue = this.originalValue * this.zoomLevelHolder.zoomLevel;
8
+ return calculatedValue;
9
+ }
10
+ ;
11
+ constructor(originalValue, zoomLevelHolder) {
12
+ this.originalValue = originalValue;
13
+ this.zoomLevelHolder = zoomLevelHolder;
14
+ }
15
+ }
@@ -1,6 +1,6 @@
1
1
  import { MinMaxNumber } from '@devexpress/utils/lib/class/min-max';
2
2
  import { RulerColumnsControl } from './controls/column';
3
- import { RulerDivisionsControl } from './controls/divisions';
3
+ import { DivisionInfo, RulerDivisionsControl } from './controls/divisions';
4
4
  import { RulerFirstLineIndentDragHandle } from './controls/indent/first-line';
5
5
  import { RulerLeftIndentDragHandle } from './controls/indent/left';
6
6
  import { RulerRightIndentDragHandle } from './controls/indent/right';
@@ -34,10 +34,14 @@ export declare class RulerControls {
34
34
  readonly tables: RulerTablesControl;
35
35
  readonly tabs: RulerTabsControl;
36
36
  readonly mouseHandler: RulerMouseHandler;
37
- readonly moveStepSize: number;
37
+ readonly modelData: RulerModelData;
38
+ readonly divisionInfo: DivisionInfo;
39
+ private moveStepSize;
38
40
  get paragraphLeftPosition(): number;
39
41
  get paragraphRightPosition(): number;
40
42
  constructor(canvas: HTMLDivElement, modelData: RulerModelData);
43
+ calculateMoveStepSize(): void;
44
+ updateZoomLevel(): void;
41
45
  dispose(): void;
42
46
  update(): void;
43
47
  private updateModelState;
@@ -42,13 +42,14 @@ export class RulerControls {
42
42
  this.mouseEventsManager = new RulerMouseEventsManager();
43
43
  this.viewElementScrollManager = new RulerViewElementScrollManager();
44
44
  this.canvas = canvas;
45
- const divisionInfo = DivisionInfo.create(modelData.unitType);
46
- const maxPageWidth = UnitConverter.twipsToPixelsF(PaperSizeConverter.calculatePaperSize(PaperKind.PrcEnvelopeNumber10Rotated).width);
47
- this.moveStepSize = modelData.unitType == RichEditUnit.Inch ? divisionInfo.stepSize / 2 : divisionInfo.stepSize;
45
+ this.modelData = modelData;
46
+ this.divisionInfo = DivisionInfo.create(modelData.unitType, this.modelData.innerClientProperties.viewsSettings);
47
+ this.calculateMoveStepSize();
48
+ const maxPageWidth = UnitConverter.twipsToPixelsF(PaperSizeConverter.calculatePaperSize(PaperKind.PrcEnvelopeNumber10Rotated).width) * this.modelData.zoomLevel;
48
49
  this.wrapper = new RulerWrapper(modelData, this);
49
50
  this.ruler = new RulerControl(modelData, this);
50
51
  this.tabTypeBox = new RulerTabTypeControl(modelData, this);
51
- this.divisions = new RulerDivisionsControl(modelData, this, divisionInfo, maxPageWidth);
52
+ this.divisions = new RulerDivisionsControl(modelData, this, this.divisionInfo, maxPageWidth);
52
53
  this.leftMargin = new RulerLeftMarginDragHandle(modelData, this, maxPageWidth);
53
54
  this.rightMargin = new RulerRightMarginDragHandle(modelData, this, maxPageWidth);
54
55
  this.leftIndent = new RulerLeftIndentDragHandle(modelData, this);
@@ -64,6 +65,12 @@ export class RulerControls {
64
65
  this.mouseEventsManager.addListener(this.mouseHandler);
65
66
  this.viewElementScrollManager.addListener(this.ruler, this.canvas);
66
67
  }
68
+ calculateMoveStepSize() {
69
+ this.moveStepSize = this.modelData.unitType == RichEditUnit.Inch ? this.divisionInfo.stepSize / 2 : this.divisionInfo.stepSize;
70
+ }
71
+ updateZoomLevel() {
72
+ this.divisionInfo.updateZoomLevel();
73
+ }
67
74
  dispose() {
68
75
  this.lineControl.dispose();
69
76
  this.wrapper.dispose();
@@ -82,8 +89,10 @@ export class RulerControls {
82
89
  this.viewElementScrollManager.dispose();
83
90
  }
84
91
  update() {
92
+ this.updateZoomLevel();
85
93
  this.updateModelState();
86
94
  this.updateView();
95
+ this.calculateMoveStepSize();
87
96
  }
88
97
  updateModelState() {
89
98
  this.ruler.updateModelState();
@@ -21,6 +21,7 @@ export declare class RulerModelData {
21
21
  get isReadOnly(): boolean;
22
22
  get unitType(): RichEditUnit;
23
23
  get selection(): Selection;
24
+ get zoomLevel(): number;
24
25
  constructor(core: RichEditCore, settings: RulerSettings);
25
26
  private fixSettings;
26
27
  private getDefaultStyle;
@@ -13,6 +13,7 @@ export class RulerModelData {
13
13
  get isReadOnly() { return this.core.readOnly != ReadOnlyMode.None; }
14
14
  get unitType() { return this.core.uiUnitConverter.getUnits(); }
15
15
  get selection() { return this.core.selection; }
16
+ get zoomLevel() { return this.core.viewManager.zoomLevel; }
16
17
  constructor(core, settings) {
17
18
  this.core = core;
18
19
  this.settings = this.fixSettings(settings);
@@ -146,6 +146,8 @@ export class HorizontalRulerControl extends BatchUpdatableObject {
146
146
  case ModelChangeType.TableCellRemoved:
147
147
  case ModelChangeType.TableCellInserted:
148
148
  return HorizontalRulerEventType.FullReset;
149
+ case ModelChangeType.ZoomLevelChanged:
150
+ return HorizontalRulerEventType.FullReset;
149
151
  default:
150
152
  return HorizontalRulerEventType.None;
151
153
  }
@@ -0,0 +1,27 @@
1
+ export declare class MixedSize {
2
+ static fromLayout(value: number): MixedSize;
3
+ static fromUI(value: number): MixedSize;
4
+ private _UISizePart;
5
+ private _UISize;
6
+ private _layoutSizePart;
7
+ private _layoutSize;
8
+ private _scale;
9
+ private _scaleIsSpecified;
10
+ get UISize(): number;
11
+ get LayoutSize(): number;
12
+ private get UISizePart();
13
+ private set UISizePart(value);
14
+ private get LayoutSizePart();
15
+ private set LayoutSizePart(value);
16
+ private onSizeChanged;
17
+ addUISize(value: number): this;
18
+ addLayoutSize(value: number): this;
19
+ addSize(value: MixedSize): this;
20
+ subtractUISize(value: number): this;
21
+ subtractLayoutSize(value: number): this;
22
+ subtractSize(value: MixedSize): this;
23
+ private checkSizeHasSameScale;
24
+ private checkScaleIsSpecified;
25
+ useScale(value: number): this;
26
+ clear(): this;
27
+ }
@@ -0,0 +1,91 @@
1
+ import { isDefined } from "@devexpress/utils/lib/utils/common";
2
+ export class MixedSize {
3
+ constructor() {
4
+ this._UISizePart = 0;
5
+ this._layoutSizePart = 0;
6
+ this._scale = 1;
7
+ this._scaleIsSpecified = false;
8
+ }
9
+ static fromLayout(value) {
10
+ return new MixedSize().addLayoutSize(value);
11
+ }
12
+ static fromUI(value) {
13
+ return new MixedSize().addUISize(value);
14
+ }
15
+ get UISize() {
16
+ this.checkScaleIsSpecified();
17
+ if (!isDefined(this._UISize))
18
+ this._UISize = this._layoutSizePart * this._scale + this._UISizePart;
19
+ return this._UISize;
20
+ }
21
+ get LayoutSize() {
22
+ this.checkScaleIsSpecified();
23
+ if (!isDefined(this._layoutSize))
24
+ this._layoutSize = this._layoutSizePart + this._UISizePart / this._scale;
25
+ return this._layoutSize;
26
+ }
27
+ get UISizePart() {
28
+ return this._UISizePart;
29
+ }
30
+ set UISizePart(value) {
31
+ this._UISizePart = value;
32
+ this.onSizeChanged();
33
+ }
34
+ get LayoutSizePart() {
35
+ return this._layoutSizePart;
36
+ }
37
+ set LayoutSizePart(value) {
38
+ this._layoutSizePart = value;
39
+ this.onSizeChanged();
40
+ }
41
+ onSizeChanged() {
42
+ this._UISize = null;
43
+ this._layoutSize = null;
44
+ }
45
+ addUISize(value) {
46
+ this.UISizePart += value;
47
+ return this;
48
+ }
49
+ addLayoutSize(value) {
50
+ this.LayoutSizePart += value;
51
+ return this;
52
+ }
53
+ addSize(value) {
54
+ this.checkSizeHasSameScale(value);
55
+ this.addLayoutSize(value._layoutSizePart);
56
+ this.addUISize(value._UISizePart);
57
+ return this;
58
+ }
59
+ subtractUISize(value) {
60
+ this.UISizePart -= value;
61
+ return this;
62
+ }
63
+ subtractLayoutSize(value) {
64
+ this.LayoutSizePart -= value;
65
+ return this;
66
+ }
67
+ subtractSize(value) {
68
+ this.checkSizeHasSameScale(value);
69
+ this.subtractLayoutSize(value._layoutSizePart);
70
+ this.subtractUISize(value._UISizePart);
71
+ return this;
72
+ }
73
+ checkSizeHasSameScale(size) {
74
+ if (size._scaleIsSpecified && size._scale !== this._scale)
75
+ throw new Error("The size has a different scale and cannot be added.");
76
+ }
77
+ checkScaleIsSpecified() {
78
+ if (!this._scaleIsSpecified)
79
+ console.warn("MixedSize is used without specifying the scale.");
80
+ }
81
+ useScale(value) {
82
+ this._scale = value;
83
+ this._scaleIsSpecified = true;
84
+ return this;
85
+ }
86
+ clear() {
87
+ this.UISizePart = 0;
88
+ this.LayoutSizePart = 0;
89
+ return this;
90
+ }
91
+ }
@@ -20,6 +20,8 @@ export declare class ViewSettings {
20
20
  fixedWidth?: number;
21
21
  pageVerticalInfo: RenderPageVertivalInfo;
22
22
  showHorizontalRuler: boolean;
23
+ zoomLevel: number;
24
+ allowZoom: boolean;
23
25
  private _widthOfPage;
24
26
  get isFixedWidthMode(): boolean;
25
27
  set widthOfPage(val: number);
@@ -57,6 +57,7 @@ export class ViewSettings {
57
57
  this.paddings = new Margins(15, 15, 15, 15);
58
58
  this.pageVerticalInfo = new RenderPageVertivalInfo();
59
59
  this.showHorizontalRuler = true;
60
+ this.zoomLevel = 1.0;
60
61
  }
61
62
  copyFrom(obj) {
62
63
  this.paddings = new Margins(obj.paddings.left, obj.paddings.right, obj.paddings.top, obj.paddings.bottom);
@@ -64,6 +65,8 @@ export class ViewSettings {
64
65
  this._widthOfPage = obj._widthOfPage;
65
66
  this.fixedWidth = obj.fixedWidth;
66
67
  this.showHorizontalRuler = obj.showHorizontalRuler;
68
+ this.zoomLevel = obj.zoomLevel;
69
+ this.allowZoom = obj.allowZoom;
67
70
  this.pageVerticalInfo.copyFrom(obj.pageVerticalInfo);
68
71
  }
69
72
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devexpress-richedit",
3
- "version": "24.2.8-build-25149-0115",
3
+ "version": "25.1.2-beta",
4
4
  "homepage": "https://www.devexpress.com/",
5
5
  "bugs": "https://www.devexpress.com/support/",
6
6
  "author": "Developer Express Inc.",
@@ -14,18 +14,18 @@
14
14
  "build-nspell": "webpack --mode production --config=bin/nspell.webpack.config.js"
15
15
  },
16
16
  "peerDependencies": {
17
- "devextreme": "24.2.8-build-25148-1935",
18
- "devextreme-dist": "24.2.8-build-25148-1935"
17
+ "devextreme": "25.1.2-beta",
18
+ "devextreme-dist": "25.1.2-beta"
19
19
  },
20
20
  "dependencies": {
21
21
  "jszip": "~3.10.1",
22
- "tslib": "2.6.0",
22
+ "tslib": "2.6.2",
23
23
  "@devexpress/utils": "^1.4.3"
24
24
  },
25
25
  "devDependencies": {
26
- "webpack": "5.75.0",
27
- "terser-webpack-plugin": "5.3.6",
28
- "webpack-cli": "5.0.1",
26
+ "webpack": "5.89.0",
27
+ "terser-webpack-plugin": "5.3.10",
28
+ "webpack-cli": "5.1.4",
29
29
  "gulp-minify-css": "1.2.4",
30
30
  "gulp": "4.0.2",
31
31
  "gulp-concat-css": "3.1.0",