devexpress-richedit 24.2.6 → 25.1.1-alpha
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 +1 -1
- package/dist/dx.richedit.d.ts +11 -3
- package/dist/dx.richedit.js +1555 -1230
- package/dist/dx.richedit.min.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/client/_constants.d.ts +1 -0
- package/lib/client/_constants.js +3 -0
- package/lib/client/bars/ribbon.d.ts +1 -0
- package/lib/client/bars/ribbon.js +3 -1
- package/lib/client/bars/rich-edit-ribbon/ribbon-items-data.js +11 -0
- package/lib/client/client-rich-edit.js +4 -2
- package/lib/client/commands/commands.js +12 -0
- package/lib/client/i-rich-constructor-settings.d.ts +2 -0
- package/lib/client/model-api/api-utils/parameter-checker.d.ts +1 -1
- package/lib/client/model-api/api-utils/parameter-checker.js +2 -2
- package/lib/client/public/commands/enum.d.ts +3 -1
- package/lib/client/public/commands/enum.js +2 -0
- package/lib/client/public/options.d.ts +2 -0
- package/lib/client/public/options.js +2 -0
- package/lib/client/public/rich-edit.d.ts +4 -0
- package/lib/client/public/rich-edit.js +21 -0
- package/lib/client/ribbon/i-toolbar-item-options.d.ts +1 -1
- package/lib/client/settings.js +4 -0
- package/lib/client/utils/focus-helper.d.ts +4 -0
- package/lib/client/utils/focus-helper.js +36 -0
- package/lib/common/canvas/canvas-manager.d.ts +2 -0
- package/lib/common/canvas/canvas-manager.js +11 -5
- package/lib/common/canvas/renderes/common/document-renderer.d.ts +1 -1
- package/lib/common/canvas/renderes/view-manager.d.ts +4 -0
- package/lib/common/canvas/renderes/view-manager.js +17 -0
- package/lib/common/commands/client-command.d.ts +3 -1
- package/lib/common/commands/client-command.js +2 -0
- package/lib/common/commands/command-manager.js +4 -0
- package/lib/common/commands/layout/apply-style-command.d.ts +12 -7
- package/lib/common/commands/layout/apply-style-command.js +44 -36
- package/lib/common/commands/layout/change-zoom-level-command.d.ts +10 -0
- package/lib/common/commands/layout/change-zoom-level-command.js +30 -0
- package/lib/common/commands/layout/toggle-allow-zoom-command.d.ts +7 -0
- package/lib/common/commands/layout/toggle-allow-zoom-command.js +17 -0
- package/lib/common/commands/ruler/ruler-table-column-separators-command.d.ts +9 -2
- package/lib/common/commands/ruler/ruler-table-column-separators-command.js +24 -15
- package/lib/common/commands/toc/set-paragraph-level-command.d.ts +2 -0
- package/lib/common/commands/toc/set-paragraph-level-command.js +13 -7
- package/lib/common/interfaces/i-zoom-level-holder.d.ts +3 -0
- package/lib/common/interfaces/i-zoom-level-holder.js +1 -0
- package/lib/common/layout/main-structures/layout-row.d.ts +2 -1
- package/lib/common/layout/main-structures/layout-row.js +3 -1
- package/lib/common/layout-formatter/formatter/base-formatter.js +2 -1
- package/lib/common/layout-formatter/row/result.js +2 -1
- package/lib/common/layout-formatter/row/tab-info.js +3 -1
- package/lib/common/model/json/enums/json-control-enums.d.ts +2 -1
- package/lib/common/model/json/enums/json-control-enums.js +1 -0
- package/lib/common/model/json/exporters/json-control-options-converter.js +2 -0
- package/lib/common/model/json/importers/json-importer.js +2 -0
- package/lib/common/model/options/control.d.ts +1 -0
- package/lib/common/model/options/control.js +1 -0
- package/lib/common/model/paragraph/paragraph-style.d.ts +9 -4
- package/lib/common/model/paragraph/paragraph-style.js +20 -13
- package/lib/common/model/rich-utils.d.ts +2 -0
- package/lib/common/model/rich-utils.js +2 -0
- package/lib/common/mouse-handler/resize-box-helper.js +2 -2
- package/lib/common/rich-edit-core.d.ts +0 -1
- package/lib/common/rich-edit-core.js +2 -6
- package/lib/common/ui/ruler/controls/base.d.ts +7 -2
- package/lib/common/ui/ruler/controls/base.js +11 -3
- package/lib/common/ui/ruler/controls/column.d.ts +17 -5
- package/lib/common/ui/ruler/controls/column.js +37 -21
- package/lib/common/ui/ruler/controls/divisions.d.ts +18 -5
- package/lib/common/ui/ruler/controls/divisions.js +41 -13
- package/lib/common/ui/ruler/controls/indent/first-line.js +2 -2
- package/lib/common/ui/ruler/controls/indent/left.js +2 -2
- package/lib/common/ui/ruler/controls/indent/right.js +2 -2
- package/lib/common/ui/ruler/controls/margin/base.js +3 -3
- package/lib/common/ui/ruler/controls/owner.d.ts +2 -0
- package/lib/common/ui/ruler/controls/owner.js +4 -0
- package/lib/common/ui/ruler/controls/ruler.js +2 -2
- package/lib/common/ui/ruler/controls/tab/tab-info.d.ts +15 -0
- package/lib/common/ui/ruler/controls/tab/tab-info.js +19 -0
- package/lib/common/ui/ruler/controls/tab/tab.d.ts +3 -3
- package/lib/common/ui/ruler/controls/tab/tab.js +10 -11
- package/lib/common/ui/ruler/controls/table.js +5 -4
- package/lib/common/ui/ruler/controls/zoomable-value.d.ts +8 -0
- package/lib/common/ui/ruler/controls/zoomable-value.js +15 -0
- package/lib/common/ui/ruler/manager.d.ts +6 -2
- package/lib/common/ui/ruler/manager.js +13 -4
- package/lib/common/ui/ruler/model-data.d.ts +1 -0
- package/lib/common/ui/ruler/model-data.js +1 -0
- package/lib/common/view-settings/views-settings.d.ts +2 -0
- package/lib/common/view-settings/views-settings.js +3 -0
- package/package.json +7 -7
@@ -1,7 +1,6 @@
|
|
1
1
|
import { EvtUtils } from '@devexpress/utils/lib/utils/evt';
|
2
2
|
import { TabLeaderType } from '../../../../layout/main-structures/layout-boxes/layout-tab-space-box';
|
3
3
|
import { TabAlign } from '../../../../model/paragraph/paragraph';
|
4
|
-
import { TabInfo } from '../../../../model/paragraph/paragraph-style';
|
5
4
|
import { MinMaxNumber } from '@devexpress/utils/lib/class/min-max';
|
6
5
|
import { UnitConverter } from '@devexpress/utils/lib/class/unit-converter';
|
7
6
|
import { DomUtils } from '@devexpress/utils/lib/utils/dom';
|
@@ -13,6 +12,7 @@ import { RulerMultiControl } from '../owner';
|
|
13
12
|
import { RulerShadow } from '../shadow';
|
14
13
|
import { RulerLineDisplayType, SnapTo } from '../vertical-line';
|
15
14
|
import { RulerTabUtils } from './utils';
|
15
|
+
import { RulerTabInfo } from './tab-info';
|
16
16
|
const RULLER_TABMARK_Y_POSITION = 6;
|
17
17
|
var TabAction;
|
18
18
|
(function (TabAction) {
|
@@ -27,7 +27,8 @@ export class RulerTabsControlState {
|
|
27
27
|
this.enabled = enabled;
|
28
28
|
}
|
29
29
|
clone() {
|
30
|
-
|
30
|
+
const clonedTabs = ListUtils.deepCopy(this.tabs);
|
31
|
+
return new RulerTabsControlState(clonedTabs, this.enabled);
|
31
32
|
}
|
32
33
|
}
|
33
34
|
export class RulerTabViewState {
|
@@ -54,9 +55,7 @@ export class RulerTabsControl extends RulerMultiControl {
|
|
54
55
|
if (this.modelData.showTabs) {
|
55
56
|
const paragraph = this.modelData.selection.activeSubDocument.getParagraphByPosition(this.modelData.selection.intervalsInfo.interval.start);
|
56
57
|
const tabs = ListUtils.map(paragraph.getTabs().positions, tab => {
|
57
|
-
|
58
|
-
newTab.position = UnitConverter.twipsToPixelsF(tab.position);
|
59
|
-
return newTab;
|
58
|
+
return new RulerTabInfo(UnitConverter.twipsToPixelsF(tab.position), tab.alignment, tab.leader, tab.deleted, tab.isDefault, this.modelData);
|
60
59
|
});
|
61
60
|
return new RulerTabsControlState(tabs, true);
|
62
61
|
}
|
@@ -106,8 +105,8 @@ export class RulerTabsControl extends RulerMultiControl {
|
|
106
105
|
if (this.isTabMarkZone(evt) && pos >= this.minPosition() && pos <= this.maxPosition()) {
|
107
106
|
this.tabAction = TabAction.Insert;
|
108
107
|
this.handleControlIndex = this.currModelState.tabs.length;
|
109
|
-
const tabPosition = this.controls.chooseClosestAnchorPosition(pos, [], new MinMaxNumber(this.minPosition(), this.maxPosition()));
|
110
|
-
this.newTab = new
|
108
|
+
const tabPosition = this.controls.chooseClosestAnchorPosition(pos, [], new MinMaxNumber(this.minPosition(), this.maxPosition())) / this.modelData.zoomLevel;
|
109
|
+
this.newTab = new RulerTabInfo(tabPosition, this.controls.tabTypeBox.align, TabLeaderType.None, false, false, this.modelData);
|
111
110
|
this.currModelState.tabs.push(this.newTab.clone());
|
112
111
|
this.updateView();
|
113
112
|
this.updatePresentation();
|
@@ -138,20 +137,20 @@ export class RulerTabsControl extends RulerMultiControl {
|
|
138
137
|
else {
|
139
138
|
const tab = this.currModelState.tabs[this.handleControlIndex];
|
140
139
|
this.modelData.commandManager.getCommand(RichEditClientCommand.InsertTabRuler)
|
141
|
-
.execute(this.modelData.commandManager.isPublicApiCall, { position: tab.
|
140
|
+
.execute(this.modelData.commandManager.isPublicApiCall, { position: tab.originalPosition, align: tab.alignment });
|
142
141
|
}
|
143
142
|
break;
|
144
143
|
}
|
145
144
|
case TabAction.Move: {
|
146
145
|
if (this.deleteTab) {
|
147
146
|
this.modelData.commandManager.getCommand(RichEditClientCommand.DeleteTabRuler)
|
148
|
-
.execute(this.modelData.commandManager.isPublicApiCall, this.prevModelState.tabs[this.handleControlIndex].
|
147
|
+
.execute(this.modelData.commandManager.isPublicApiCall, this.prevModelState.tabs[this.handleControlIndex].originalPosition);
|
149
148
|
}
|
150
149
|
else {
|
151
150
|
this.modelData.commandManager.getCommand(RichEditClientCommand.MoveTabRuler)
|
152
151
|
.execute(this.modelData.commandManager.isPublicApiCall, {
|
153
|
-
start: this.prevModelState.tabs[this.handleControlIndex].
|
154
|
-
end: this.currModelState.tabs[this.handleControlIndex].
|
152
|
+
start: this.prevModelState.tabs[this.handleControlIndex].originalPosition,
|
153
|
+
end: this.currModelState.tabs[this.handleControlIndex].originalPosition
|
155
154
|
});
|
156
155
|
}
|
157
156
|
break;
|
@@ -39,7 +39,7 @@ export class RulerTablesControl extends RulerMultiControl {
|
|
39
39
|
const state = this.modelData.commandManager.getCommand(RichEditClientCommand.RulerTableColumnSeparators).getState();
|
40
40
|
return state.enabled ?
|
41
41
|
new RulerTableModelState(state.value, state.value.tableIndex, state.enabled) :
|
42
|
-
new RulerTableModelState(new TableColumnSeparatorStruct(), -1, false);
|
42
|
+
new RulerTableModelState(new TableColumnSeparatorStruct(this.modelData), -1, false);
|
43
43
|
}
|
44
44
|
updateView() {
|
45
45
|
const offset = this.controls.leftMargin.currModelState.modelValue + this.controls.columns.currModelState.activeColumn.leftPos;
|
@@ -71,9 +71,10 @@ export class RulerTablesControl extends RulerMultiControl {
|
|
71
71
|
});
|
72
72
|
}
|
73
73
|
onMouseUp() {
|
74
|
-
const oldPos = this.prevModelState.columnSeparators.items[this.handleControlIndex].
|
75
|
-
const newPos = this.currModelState.columnSeparators.items[this.handleControlIndex].
|
76
|
-
const
|
74
|
+
const oldPos = this.prevModelState.columnSeparators.items[this.handleControlIndex].originalPosition;
|
75
|
+
const newPos = this.currModelState.columnSeparators.items[this.handleControlIndex].originalPosition;
|
76
|
+
const diffPos = newPos - oldPos;
|
77
|
+
const param = new RulerChangeTableColumnWidthCommandParameters(this.currModelState.tableIndex, diffPos, null, oldPos, true);
|
77
78
|
this.modelData.commandManager.getCommand(RichEditClientCommand.RulerChangeTableColumnWidth)
|
78
79
|
.execute(this.modelData.commandManager.isPublicApiCall, param);
|
79
80
|
this.finishHandle();
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { IZoomLevelHolder } from '../../../interfaces/i-zoom-level-holder';
|
2
|
+
export declare class RulerValue {
|
3
|
+
originalValue: number;
|
4
|
+
private zoomLevelHolder;
|
5
|
+
set value(value: number);
|
6
|
+
get value(): number;
|
7
|
+
constructor(originalValue: number, zoomLevelHolder: IZoomLevelHolder);
|
8
|
+
}
|
@@ -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
|
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
|
-
|
46
|
-
|
47
|
-
this.
|
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);
|
@@ -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": "
|
3
|
+
"version": "25.1.1-alpha",
|
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": "
|
18
|
-
"devextreme-dist": "
|
17
|
+
"devextreme": "25.1.1-alpha",
|
18
|
+
"devextreme-dist": "25.1.1-alpha"
|
19
19
|
},
|
20
20
|
"dependencies": {
|
21
21
|
"jszip": "~3.10.1",
|
22
|
-
"tslib": "2.6.
|
22
|
+
"tslib": "2.6.2",
|
23
23
|
"@devexpress/utils": "^1.4.3"
|
24
24
|
},
|
25
25
|
"devDependencies": {
|
26
|
-
"webpack": "5.
|
27
|
-
"terser-webpack-plugin": "5.3.
|
28
|
-
"webpack-cli": "5.
|
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",
|