devexpress-richedit 25.1.2-beta → 25.1.3

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 (56) 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 +1 -2
  10. package/dist/dx.richedit.js +1243 -1208
  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/client-rich-edit.js +2 -2
  15. package/lib/client/commands/commands.js +0 -3
  16. package/lib/client/model-api/character-properties.js +13 -17
  17. package/lib/client/model-api/document.js +2 -0
  18. package/lib/client/model-api/images/images.js +1 -1
  19. package/lib/client/public/commands/enum.d.ts +1 -2
  20. package/lib/client/public/commands/enum.js +0 -1
  21. package/lib/client/public/options.d.ts +1 -0
  22. package/lib/client/utils/focus-helper.js +22 -5
  23. package/lib/common/canvas/canvas-manager.js +1 -1
  24. package/lib/common/canvas/canvas-size-info.d.ts +1 -0
  25. package/lib/common/canvas/canvas-size-info.js +2 -2
  26. package/lib/common/canvas/renderes/view-manager.js +4 -3
  27. package/lib/common/commands/client-command.d.ts +1 -2
  28. package/lib/common/commands/client-command.js +0 -1
  29. package/lib/common/commands/command-manager.js +0 -2
  30. package/lib/common/commands/document/print-document-on-client-command.d.ts +2 -0
  31. package/lib/common/commands/document/print-document-on-client-command.js +46 -18
  32. package/lib/common/commands/layout/apply-style-command.d.ts +2 -2
  33. package/lib/common/commands/layout/apply-style-command.js +3 -4
  34. package/lib/common/commands/toc/set-paragraph-level-command.js +1 -1
  35. package/lib/common/input-controller.js +1 -1
  36. package/lib/common/layout/document-layout.js +4 -1
  37. package/lib/common/layout-formatter/row/word-holder.js +1 -1
  38. package/lib/common/model/borders/border-info.js +1 -1
  39. package/lib/common/model/caches/images.d.ts +4 -1
  40. package/lib/common/model/caches/images.js +6 -2
  41. package/lib/common/model/character/character-properties.d.ts +1 -1
  42. package/lib/common/model/character/character-properties.js +14 -2
  43. package/lib/common/model/fields/field.d.ts +1 -1
  44. package/lib/common/model/fields/field.js +4 -3
  45. package/lib/common/model/fields/tree-creator.js +1 -1
  46. package/lib/common/model/history/items/character-properties-history-items.d.ts +2 -1
  47. package/lib/common/model/history/items/character-properties-history-items.js +3 -2
  48. package/lib/common/model/manipulators/character-properties-manipulator.js +2 -2
  49. package/lib/common/model/manipulators/i-properties-manipulator.d.ts +1 -1
  50. package/lib/common/model/manipulators/picture-manipulator/picture-manipulator.js +2 -2
  51. package/lib/common/model/options/fonts.d.ts +1 -1
  52. package/lib/common/ui/ruler/controls/ruler.js +3 -7
  53. package/lib/common/ui/ruler/controls/vertical-line.js +2 -1
  54. package/package.json +3 -3
  55. package/lib/common/commands/layout/toggle-allow-zoom-command.d.ts +0 -7
  56. package/lib/common/commands/layout/toggle-allow-zoom-command.js +0 -17
@@ -287,15 +287,16 @@ export class Field {
287
287
  return newInterval.start = Field.correctIntervalDueToFieldsCaseSelectionCollapsed(subDocument.fields, newInterval.start);
288
288
  const indexesInterval = Field.correctIntervalDueToFieldsWithoutUiChecks(subDocument, newInterval);
289
289
  ListUtils.forEach(fields, (field) => {
290
- if (field.getResultInterval().equals(newInterval) && !this.isFloatingObjectSelected(subDocument, newInterval))
290
+ if (field.getResultInterval().equals(newInterval) && !this.isResizableObjectSelected(subDocument, newInterval))
291
291
  newInterval.expand(field.getAllFieldInterval());
292
292
  }, indexesInterval.start, indexesInterval.end);
293
293
  }
294
- static isFloatingObjectSelected(subDocument, interval) {
294
+ static isResizableObjectSelected(subDocument, interval) {
295
295
  if (interval.length !== 1)
296
296
  return false;
297
297
  const run = subDocument.getRunByPosition(interval.start);
298
- return run && (run.getType() == RunType.AnchoredPictureRun || run.getType() == RunType.AnchoredTextBoxRun);
298
+ const runType = run && run.getType();
299
+ return runType == RunType.AnchoredPictureRun || runType == RunType.AnchoredTextBoxRun || runType == RunType.InlinePictureRun;
299
300
  }
300
301
  static correctWhenPositionInStartCode(fields, position) {
301
302
  if (fields.length < 1)
@@ -104,7 +104,7 @@ export class FieldsWaitingForUpdate {
104
104
  }
105
105
  if (!fieldParser.update(response)) {
106
106
  someFieldInCurrentInfoNotUpdated = true;
107
- info.parsers.push(fieldParser);
107
+ info.parsers.unshift(fieldParser);
108
108
  }
109
109
  else
110
110
  fieldParser.destructor();
@@ -14,7 +14,8 @@ import { HistoryItemIntervalStateObject, HistoryItemIntervalUseStateObject } fro
14
14
  export declare class FontUseValueHistoryItem extends IntervalBasedHistoryItem {
15
15
  oldState: HistoryItemIntervalState<HistoryItemIntervalStateObject>;
16
16
  newValue: number;
17
- constructor(modelManipulator: ModelManipulator, subDocInterval: SubDocumentInterval, newValue: number);
17
+ keepCustomFormatting: boolean;
18
+ constructor(modelManipulator: ModelManipulator, subDocInterval: SubDocumentInterval, newValue: number, keepCustomFormatting?: boolean);
18
19
  redo(): void;
19
20
  undo(): void;
20
21
  }
@@ -1,12 +1,13 @@
1
1
  import { Errors } from '@devexpress/utils/lib/errors';
2
2
  import { IntervalBasedHistoryItem } from '../base/interval-based-history-item';
3
3
  export class FontUseValueHistoryItem extends IntervalBasedHistoryItem {
4
- constructor(modelManipulator, subDocInterval, newValue) {
4
+ constructor(modelManipulator, subDocInterval, newValue, keepCustomFormatting = false) {
5
5
  super(modelManipulator, subDocInterval);
6
6
  this.newValue = newValue;
7
+ this.keepCustomFormatting = keepCustomFormatting;
7
8
  }
8
9
  redo() {
9
- this.oldState = this.modelManipulator.characterProperties.useValue.setValue(this.boundSubDocument, this.interval, this.newValue);
10
+ this.oldState = this.modelManipulator.characterProperties.useValue.setValue(this.boundSubDocument, this.interval, this.newValue, this.keepCustomFormatting);
10
11
  }
11
12
  undo() {
12
13
  this.modelManipulator.characterProperties.useValue.restoreValue(this.boundSubDocument, this.oldState);
@@ -74,7 +74,7 @@ class CharacterPropertiesUseValueManipulator {
74
74
  constructor(manipulator) {
75
75
  this.manipulator = manipulator;
76
76
  }
77
- setValue(subDocument, interval, newValue) {
77
+ setValue(subDocument, interval, newValue, keepCustomFormatting = false) {
78
78
  var oldState = new HistoryItemIntervalState();
79
79
  if (!ControlOptions.isEnabled(subDocument.documentModel.options.characterFormatting))
80
80
  return oldState;
@@ -84,7 +84,7 @@ class CharacterPropertiesUseValueManipulator {
84
84
  var run = iterator.currentRun;
85
85
  oldState.register(new HistoryItemIntervalStateObject(iterator.currentInterval(), run.maskedCharacterProperties.getUseValueFull()));
86
86
  var properties = run.maskedCharacterProperties.clone();
87
- properties.setUseValueFull(newValue);
87
+ properties.setUseValueFull(newValue, keepCustomFormatting);
88
88
  run.setCharacterProperties(properties);
89
89
  run.onCharacterPropertiesChanged();
90
90
  }
@@ -8,7 +8,7 @@ export interface IIntervalPropertyWithUseValueManipulator<T> {
8
8
  restoreValue(subDocument: SubDocument, state: HistoryItemIntervalState<HistoryItemIntervalUseStateObject>): any;
9
9
  }
10
10
  export interface IIntervalPropertyManipulator<T> {
11
- setValue(subDocument: SubDocument, interval: FixedInterval, newValue: T): HistoryItemIntervalState<HistoryItemIntervalStateObject>;
11
+ setValue(subDocument: SubDocument, interval: FixedInterval, newValue: T, keepCustomFormatting?: boolean): HistoryItemIntervalState<HistoryItemIntervalStateObject>;
12
12
  restoreValue(subDocument: SubDocument, state: HistoryItemIntervalState<HistoryItemIntervalStateObject>): any;
13
13
  }
14
14
  export interface IListLevelPropertyManipulator<T> {
@@ -88,7 +88,7 @@ export class PictureManipulator extends RunsBaseManipulator {
88
88
  this.history.addTransaction(() => {
89
89
  this.modelManipulator.range.removeInterval(new SubDocumentInterval(subDocument, interval), true, false);
90
90
  const newInfo = new InlinePictureInfo(pictureRun.size.clone(), new Shape(), -1, pictureRun.info.containerProperties, pictureRun.info.nonVisualDrawingProperties);
91
- this.modelManipulator.picture.insertInlinePictureViaHistory(new SubDocumentPosition(subDocument, interval.start), charPropsBundle, newInfo);
91
+ this.modelManipulator.picture.insertInlinePictureViaHistory(new SubDocumentPosition(subDocument, interval.start), charPropsBundle, newInfo, new ImageLoadingOptions(!pictureRun.cacheInfo.isSizeDefined));
92
92
  });
93
93
  }
94
94
  }
@@ -103,7 +103,7 @@ export class PictureManipulator extends RunsBaseManipulator {
103
103
  anchorInfo.zOrder = this.modelManipulator.floatingObject.zOrder.getNewZOrder(subDocument);
104
104
  this.modelManipulator.range.removeInterval(new SubDocumentInterval(subDocument, interval), true, false);
105
105
  const newInfo = new AnchorPictureInfo(pictureRun.size.clone(), new Shape(), anchorInfo, pictureRun.info.containerProperties, pictureRun.info.nonVisualDrawingProperties);
106
- this.modelManipulator.picture.insertAnchoredPictureViaHistory(new SubDocumentPosition(subDocument, interval.start), charPropsBundle, newInfo, new ImageLoadingOptions(false));
106
+ this.modelManipulator.picture.insertAnchoredPictureViaHistory(new SubDocumentPosition(subDocument, interval.start), charPropsBundle, newInfo, new ImageLoadingOptions(!pictureRun.cacheInfo.isSizeDefined));
107
107
  run = subDocument.getRunByPosition(interval.start);
108
108
  }
109
109
  let anchoredRun = run.getType() == RunType.AnchoredPictureRun ? run : run;
@@ -9,7 +9,7 @@ export interface IFontSettings {
9
9
  name: string;
10
10
  fontFamily: string;
11
11
  googleFontsResponse?: string;
12
- useGoogleFonts?: string;
12
+ useGoogleFonts?: boolean;
13
13
  italicFontUri?: string;
14
14
  boldFontUri?: string;
15
15
  boldItalicFontUri?: string;
@@ -41,13 +41,9 @@ export class RulerControl extends RulerBase {
41
41
  }
42
42
  adjust() {
43
43
  const viewWidth = this.controls.canvas.clientWidth;
44
- if (viewWidth > this.pageWidth)
45
- this.initialMarginLeftElement = (viewWidth - this.pageWidth - RULLER_NUMBER_CORRECTION * 2) / 2;
46
- else {
47
- const paddingLeft = DomUtils.pxToInt(DomUtils.getCurrentStyle(this.controls.canvas).paddingLeft);
48
- const pageAreaBorderWidth = (this.controls.canvas.scrollWidth - paddingLeft - this.pageWidth) / 2;
49
- this.initialMarginLeftElement = paddingLeft + pageAreaBorderWidth - RULLER_NUMBER_CORRECTION;
50
- }
44
+ const paddingLeft = DomUtils.pxToInt(DomUtils.getCurrentStyle(this.controls.canvas).paddingLeft);
45
+ const minValue = paddingLeft - RULLER_NUMBER_CORRECTION;
46
+ this.initialMarginLeftElement = Math.max((viewWidth - this.pageWidth - RULLER_NUMBER_CORRECTION * 2) / 2, minValue);
51
47
  this.rootElement.style.left = this.calculateLeftOffset();
52
48
  this.setPaddings();
53
49
  this.canHandleScroll = this.controls.canvas.scrollWidth > this.controls.canvas.offsetWidth;
@@ -1,6 +1,7 @@
1
1
  import { DomUtils } from '@devexpress/utils/lib/utils/dom';
2
2
  import { DocumentRenderer } from '../../../canvas/renderes/common/document-renderer';
3
3
  import { RULLER_NUMBER_CORRECTION } from '../settings';
4
+ import { SizeUtils } from '../../../../common/utils/size-utils';
4
5
  export const TABLE_COLUMN_SEPARATOR_RULER_LINE_CLASS_NAME = " table";
5
6
  export var SnapTo;
6
7
  (function (SnapTo) {
@@ -33,7 +34,7 @@ export class RulerVerticalLineControl {
33
34
  DomUtils.addClassName(this.rootElement, TABLE_COLUMN_SEPARATOR_RULER_LINE_CLASS_NAME);
34
35
  else
35
36
  DomUtils.removeClassName(this.rootElement, TABLE_COLUMN_SEPARATOR_RULER_LINE_CLASS_NAME);
36
- this.rootElement.style.height = this.canvas.clientHeight + "px";
37
+ this.rootElement.style.height = SizeUtils.getClientHeight(this.canvas) + "px";
37
38
  this.rootElement.style.top = this.canvas.offsetTop + "px";
38
39
  this.rulerControlLeft = this.rulerControlElement.offsetLeft;
39
40
  this.rulerControlWidth = this.rulerControlElement.offsetWidth;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devexpress-richedit",
3
- "version": "25.1.2-beta",
3
+ "version": "25.1.3",
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": "25.1.2-beta",
18
- "devextreme-dist": "25.1.2-beta"
17
+ "devextreme": "25.1.3",
18
+ "devextreme-dist": "25.1.3"
19
19
  },
20
20
  "dependencies": {
21
21
  "jszip": "~3.10.1",
@@ -1,7 +0,0 @@
1
- import { CommandBase, CommandSimpleOptions } from '../command-base';
2
- import { SimpleCommandState } from '../command-states';
3
- export declare class ToggleAllowZoomCommand extends CommandBase<SimpleCommandState> {
4
- getState(): SimpleCommandState;
5
- executeCore(_state: SimpleCommandState, options: CommandSimpleOptions<boolean>): boolean;
6
- isEnabledInReadOnlyMode(): boolean;
7
- }
@@ -1,17 +0,0 @@
1
- import { CommandBase } from '../command-base';
2
- import { SimpleCommandState } from '../command-states';
3
- export class ToggleAllowZoomCommand extends CommandBase {
4
- getState() {
5
- return new SimpleCommandState(this.isEnabled(), this.control.viewManager.allowZoom);
6
- }
7
- executeCore(_state, options) {
8
- const allowZoom = this.control.viewManager.allowZoom;
9
- if (options.param === allowZoom)
10
- return false;
11
- this.control.viewManager.allowZoom = !allowZoom;
12
- return true;
13
- }
14
- isEnabledInReadOnlyMode() {
15
- return true;
16
- }
17
- }