devexpress-richedit 24.2.1-alpha-24260-0102 → 24.2.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 (107) 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.d.ts +12 -1
  9. package/dist/dx.richedit.js +5908 -406
  10. package/dist/dx.richedit.min.js +2 -2
  11. package/index.d.ts +1 -1
  12. package/index.js +1 -1
  13. package/lib/client/bars/rich-edit-ribbon/ribbon-items-data.js +2 -1
  14. package/lib/client/client-rich-edit.js +6 -6
  15. package/lib/client/commands/commands.js +3 -0
  16. package/lib/client/commands/mail-merge-command.d.ts +4 -1
  17. package/lib/client/commands/mail-merge-command.js +51 -18
  18. package/lib/client/commands/new-document-command.js +2 -1
  19. package/lib/client/default-localization.js +2 -0
  20. package/lib/client/dialogs/hyperlink-dialog.js +13 -6
  21. package/lib/client/formats/docx/export/exporters/styles.d.ts +5 -0
  22. package/lib/client/formats/docx/export/exporters/styles.js +30 -1
  23. package/lib/client/formats/docx/import/color/open-xml-color-import-helper.js +2 -2
  24. package/lib/client/formats/docx/import/importers/styles-importer.js +2 -1
  25. package/lib/client/formatters-options.js +2 -2
  26. package/lib/client/i-rich-constructor-settings.d.ts +1 -2
  27. package/lib/client/model-api/api-utils/range-permission-finder.js +3 -1
  28. package/lib/client/model-api/collections/drawing-object-collection.js +1 -1
  29. package/lib/client/model-api/collections/hyperlink-collection.js +1 -1
  30. package/lib/client/model-api/collections/range-permission-collection.js +3 -2
  31. package/lib/client/public/commands/enum.d.ts +1 -0
  32. package/lib/client/public/commands/enum.js +1 -0
  33. package/lib/client/public/options.d.ts +1 -2
  34. package/lib/client/public/ribbon/item-ids.d.ts +1 -0
  35. package/lib/client/public/ribbon/item-ids.js +1 -0
  36. package/lib/client/public/rich-edit.js +1 -1
  37. package/lib/client/settings.js +2 -4
  38. package/lib/common/commands/client-command.d.ts +2 -1
  39. package/lib/common/commands/client-command.js +1 -0
  40. package/lib/common/commands/command-manager.js +2 -1
  41. package/lib/common/commands/dialogs/dialog-hyperlink-command.js +10 -4
  42. package/lib/common/commands/fields/create-field-command.d.ts +4 -0
  43. package/lib/common/commands/fields/create-field-command.js +8 -0
  44. package/lib/common/commands/fields/open-hyperlink-command.js +9 -6
  45. package/lib/common/commands/floating-objects/floating-object-drag-drop-change-position-command.js +1 -1
  46. package/lib/common/commands/floating-objects/insert-anchored-text-box-command.js +1 -1
  47. package/lib/common/formats/html/export/html-export.d.ts +7 -1
  48. package/lib/common/formats/html/export/html-export.js +35 -35
  49. package/lib/common/formats/html/import/html-importer.js +1 -1
  50. package/lib/common/formats/html/import/importers/list-base.js +4 -4
  51. package/lib/common/formats/rtf/export/helpers/rtf-export-helper.js +3 -2
  52. package/lib/common/input-controller.d.ts +14 -1
  53. package/lib/common/input-controller.js +58 -20
  54. package/lib/common/layout/document-layout.js +1 -1
  55. package/lib/common/layout/main-structures/layout-boxes/layout-space-box.js +1 -1
  56. package/lib/common/model/color/color-model-info.d.ts +1 -1
  57. package/lib/common/model/color/color-model-info.js +2 -1
  58. package/lib/common/model/fields/field.d.ts +4 -1
  59. package/lib/common/model/fields/field.js +18 -2
  60. package/lib/common/model/fields/names.d.ts +2 -1
  61. package/lib/common/model/fields/names.js +1 -0
  62. package/lib/common/model/fields/parsers/field-code-parser-client-updating-base.js +1 -1
  63. package/lib/common/model/fields/parsers/field-code-parser-doc-variable.js +1 -1
  64. package/lib/common/model/fields/parsers/field-code-parser-hyperlink.js +32 -38
  65. package/lib/common/model/fields/parsers/field-code-parser-if.d.ts +40 -0
  66. package/lib/common/model/fields/parsers/field-code-parser-if.js +141 -0
  67. package/lib/common/model/fields/parsers/field-code-parser-merge-field.js +1 -1
  68. package/lib/common/model/fields/parsers/field-code-parser.d.ts +3 -2
  69. package/lib/common/model/fields/parsers/field-code-parser.js +6 -12
  70. package/lib/common/model/fields/tree-creator.js +2 -0
  71. package/lib/common/model/history/items/floating-objects/insert-anchored-picture-history-item.js +1 -0
  72. package/lib/common/model/history/items/switch-text-box-sub-documents-state-history-item.js +0 -1
  73. package/lib/common/model/manipulators/document/sub-document-inserter.d.ts +1 -0
  74. package/lib/common/model/manipulators/document/sub-document-inserter.js +4 -0
  75. package/lib/common/model/manipulators/range/remove-interval-operation.d.ts +2 -0
  76. package/lib/common/model/manipulators/range/remove-interval-operation.js +10 -2
  77. package/lib/common/model/manipulators/range-permission-manipulator.d.ts +4 -0
  78. package/lib/common/model/manipulators/range-permission-manipulator.js +35 -0
  79. package/lib/common/model/manipulators/text-box-manipulator.d.ts +1 -1
  80. package/lib/common/model/manipulators/text-box-manipulator.js +2 -1
  81. package/lib/common/model/manipulators/text-manipulator/text-manipulator.js +1 -1
  82. package/lib/common/model/options/fields.d.ts +1 -2
  83. package/lib/common/model/options/fields.js +2 -5
  84. package/lib/common/model/range-permissions.js +6 -4
  85. package/lib/common/model/styles-manager.js +1 -0
  86. package/lib/common/selection/selection.js +2 -1
  87. package/lib/common/ui/ruler/controls/indent/first-line.js +5 -5
  88. package/lib/common/ui/ruler/controls/indent/left.js +6 -6
  89. package/lib/common/ui/ruler/controls/indent/right.js +4 -4
  90. package/lib/common/ui/ruler/controls/margin/left.js +1 -1
  91. package/lib/common/ui/ruler/controls/margin/right.js +1 -1
  92. package/lib/common/ui/ruler/controls/ruler.js +2 -2
  93. package/lib/common/ui/ruler/controls/tab/tab-type.js +3 -3
  94. package/lib/common/ui/ruler/controls/tab/tab.js +7 -7
  95. package/lib/common/ui/ruler/controls/tab/utils.d.ts +2 -2
  96. package/lib/common/ui/ruler/controls/tab/utils.js +5 -5
  97. package/lib/common/ui/ruler/controls/table.js +1 -1
  98. package/lib/common/ui/ruler/controls/vertical-line.d.ts +1 -2
  99. package/lib/common/ui/ruler/controls/vertical-line.js +2 -2
  100. package/lib/common/ui/ruler/controls/wrapper.js +1 -1
  101. package/lib/common/ui/ruler/manager.js +1 -1
  102. package/lib/common/ui/ruler/model-data.d.ts +8 -2
  103. package/lib/common/ui/ruler/model-data.js +6 -0
  104. package/lib/common/ui/ruler/ruler.js +2 -1
  105. package/lib/common/utils/utils.d.ts +10 -5
  106. package/lib/common/utils/utils.js +46 -18
  107. package/package.json +3 -3
@@ -205,8 +205,9 @@ export class Selection extends BatchUpdatableObject {
205
205
  this.resetInputPositionIfNeeded();
206
206
  }
207
207
  shouldResetInputPosition() {
208
+ var _a;
208
209
  const currentState = this.getState();
209
- return currentState.intervalsInfo.subDocument.id != this.prevState.intervalsInfo.subDocument.id ||
210
+ return currentState.intervalsInfo.subDocument.id != ((_a = this.prevState.intervalsInfo.subDocument) === null || _a === void 0 ? void 0 : _a.id) ||
210
211
  !ListUtils.equals(currentState.intervalsInfo.intervals, this.prevState.intervalsInfo.intervals);
211
212
  }
212
213
  resetInputPositionIfNeeded() {
@@ -7,17 +7,17 @@ import { RulerTemplateManager } from '../template-manager';
7
7
  import { RulerBaseIndentControl, RulerMinDistanceBetweenIndents } from './base';
8
8
  import { SizeUtils } from '../../../../../common/utils/size-utils';
9
9
  export class RulerFirstLineIndentDragHandle extends RulerBaseIndentControl {
10
- get heightOfProtrudingPart() { return this.modelData.settings.showLeftIndent ? this._heightOfProtrudingPart : 0; }
10
+ get heightOfProtrudingPart() { return this.modelData.showLeftIndent ? this._heightOfProtrudingPart : 0; }
11
11
  getRootClassName() {
12
- return this.modelData.settings.styles.firstLineIndentImage.spriteCssClass + " " +
13
- this.modelData.settings.styles.firstLineIndent.className;
12
+ return this.modelData.styles.firstLineIndentImage.spriteCssClass + " " +
13
+ this.modelData.styles.firstLineIndent.className;
14
14
  }
15
15
  constructor(modelData, controls) {
16
16
  super(modelData, controls);
17
17
  const template = RulerTemplateManager.getFirstLineIndentElementTemplate();
18
18
  if (template)
19
19
  this.rootElement.innerHTML = template;
20
- this.rootElement.title = this.modelData.settings.titles.firstLineIndent;
20
+ this.rootElement.title = this.modelData.titles.firstLineIndent;
21
21
  this.controls.ruler.rootElement.appendChild(this.rootElement);
22
22
  this.adjustByTop();
23
23
  this.leftCorrection = Math.round(SizeUtils.getOffsetWidth(this.rootElement) / 2);
@@ -36,7 +36,7 @@ export class RulerFirstLineIndentDragHandle extends RulerBaseIndentControl {
36
36
  const newViewState = this.controls.paragraphLeftPosition + this.currModelState.modelValue;
37
37
  if (newViewState != this.viewState) {
38
38
  this.viewState = newViewState;
39
- if (this.modelData.settings.showLeftIndent)
39
+ if (this.modelData.showLeftIndent)
40
40
  this.rootElement.style.left = this.viewState + RULLER_NUMBER_CORRECTION - this.leftCorrection + "px";
41
41
  else
42
42
  this.setVisible(false);
@@ -9,12 +9,12 @@ import { RulerBaseIndentControl, RulerMinDistanceBetweenIndents } from './base';
9
9
  import { SizeUtils } from '../../../../../common/utils/size-utils';
10
10
  const LEFT_INDENT_DRAG_HANDLE_BODY = RICH_EDIT_CLASS_NAME_PREFIX + "leftIndentDragHandleBody";
11
11
  export class RulerLeftIndentDragHandle extends RulerBaseIndentControl {
12
- get heightOfProtrudingPart() { return this.modelData.settings.showLeftIndent ? this._heightOfProtrudingPart : 0; }
13
- getRootClassName() { return this.modelData.settings.styles.leftIndent.className; }
12
+ get heightOfProtrudingPart() { return this.modelData.showLeftIndent ? this._heightOfProtrudingPart : 0; }
13
+ getRootClassName() { return this.modelData.styles.leftIndent.className; }
14
14
  constructor(modelData, controls) {
15
15
  super(modelData, controls);
16
16
  this.isActionLeftIndent = false;
17
- this.topElement = DocumentRenderer.renderContainer(this.modelData.settings.styles.leftIndentImage.spriteCssClass);
17
+ this.topElement = DocumentRenderer.renderContainer(this.modelData.styles.leftIndentImage.spriteCssClass);
18
18
  this.bodyElement = DocumentRenderer.renderContainer(LEFT_INDENT_DRAG_HANDLE_BODY);
19
19
  const topElementTemplate = RulerTemplateManager.getLeftIndentTopElementTemplate();
20
20
  if (topElementTemplate)
@@ -32,8 +32,8 @@ export class RulerLeftIndentDragHandle extends RulerBaseIndentControl {
32
32
  style.height = SizeUtils.getOffsetHeight(this.topElement) + SizeUtils.getOffsetHeight(this.bodyElement) + "px";
33
33
  style.width = mainElementWidth + "px";
34
34
  style.marginTop = this.controls.divisions.height / 2 + "px";
35
- this.bodyElement.title = this.modelData.settings.titles.leftIndent;
36
- this.topElement.title = this.modelData.settings.titles.hangingIndent;
35
+ this.bodyElement.title = this.modelData.titles.leftIndent;
36
+ this.topElement.title = this.modelData.titles.hangingIndent;
37
37
  this.leftCorrection = Math.round(SizeUtils.getOffsetWidth(this.rootElement) / 2);
38
38
  this._heightOfProtrudingPart = SizeUtils.getOffsetHeight(this.rootElement) - this.controls.divisions.height / 2;
39
39
  }
@@ -50,7 +50,7 @@ export class RulerLeftIndentDragHandle extends RulerBaseIndentControl {
50
50
  const newViewState = this.controls.paragraphLeftPosition + this.currModelState.modelValue;
51
51
  if (newViewState != this.viewState) {
52
52
  this.viewState = newViewState;
53
- if (this.modelData.settings.showLeftIndent)
53
+ if (this.modelData.showLeftIndent)
54
54
  this.rootElement.style.left = this.viewState + RULLER_NUMBER_CORRECTION - this.leftCorrection + "px";
55
55
  else
56
56
  this.setVisible(false);
@@ -9,15 +9,15 @@ const RulerMinDistanceBetweenIndentsOnView = 5;
9
9
  export class RulerRightIndentDragHandle extends RulerBaseIndentControl {
10
10
  get viewStateRelativeLeft() { return this.controls.ruler.pageWidth - this.viewState; }
11
11
  getRootClassName() {
12
- return this.modelData.settings.styles.rightIndentImage.spriteCssClass + " " +
13
- this.modelData.settings.styles.rightIndent.className;
12
+ return this.modelData.styles.rightIndentImage.spriteCssClass + " " +
13
+ this.modelData.styles.rightIndent.className;
14
14
  }
15
15
  constructor(modelData, controls) {
16
16
  super(modelData, controls);
17
17
  const template = RulerTemplateManager.getRightIndentElementTemplate();
18
18
  if (template)
19
19
  this.rootElement.innerHTML = template;
20
- this.rootElement.title = this.modelData.settings.titles.rightIndent;
20
+ this.rootElement.title = this.modelData.titles.rightIndent;
21
21
  this.controls.ruler.rootElement.appendChild(this.rootElement);
22
22
  this.adjustByTop();
23
23
  this.leftCorrection = Math.round(this.rootElement.offsetWidth / 2);
@@ -35,7 +35,7 @@ export class RulerRightIndentDragHandle extends RulerBaseIndentControl {
35
35
  const newViewState = this.correctRelativeLeftIndents(this.controls.ruler.pageWidth - this.controls.paragraphRightPosition + this.currModelState.modelValue);
36
36
  if (newViewState != this.viewState) {
37
37
  this.viewState = newViewState;
38
- if (this.modelData.settings.showRightIndent)
38
+ if (this.modelData.showRightIndent)
39
39
  this.rootElement.style.right = this.viewState + RULLER_NUMBER_CORRECTION - this.leftCorrection + "px";
40
40
  else
41
41
  this.setVisible(false);
@@ -18,7 +18,7 @@ export class RulerLeftMarginDragHandle extends RulerBaseMarginControl {
18
18
  this.handlePanelElement = DocumentRenderer.renderContainer(DIVISION_MARGIN_LEFT_CURSOR_CLASS_NAME);
19
19
  this.marginPanelElement.style.width = maxPageWidth + "px";
20
20
  this.handlePanelElement.style.width = maxPageWidth + "px";
21
- this.handlePanelElement.title = this.modelData.settings.titles.marginLeft;
21
+ this.handlePanelElement.title = this.modelData.titles.marginLeft;
22
22
  this.controls.ruler.rootElement.appendChild(this.marginPanelElement);
23
23
  this.controls.ruler.rootElement.appendChild(this.handlePanelElement);
24
24
  }
@@ -19,7 +19,7 @@ export class RulerRightMarginDragHandle extends RulerBaseMarginControl {
19
19
  this.handlePanelElement = DocumentRenderer.renderContainer(DIVISION_MARGIN_RIGHT_CURSOR_CLASS_NAME);
20
20
  this.marginPanelElement.style.width = maxPageWidth + "px";
21
21
  this.handlePanelElement.style.width = maxPageWidth + "px";
22
- this.handlePanelElement.title = this.modelData.settings.titles.marginRight;
22
+ this.handlePanelElement.title = this.modelData.titles.marginRight;
23
23
  this.controls.ruler.rootElement.appendChild(this.marginPanelElement);
24
24
  this.controls.ruler.rootElement.appendChild(this.handlePanelElement);
25
25
  }
@@ -6,7 +6,7 @@ import { RULLER_NUMBER_CORRECTION } from '../settings';
6
6
  import { RulerBase } from './base';
7
7
  import { DomUtils } from '@devexpress/utils/lib/utils/dom';
8
8
  export class RulerControl extends RulerBase {
9
- getRootClassName() { return this.modelData.settings.styles.control.className; }
9
+ getRootClassName() { return this.modelData.styles.control.className; }
10
10
  ;
11
11
  get pageWidth() { return this.currPageWidth; }
12
12
  ;
@@ -16,7 +16,7 @@ export class RulerControl extends RulerBase {
16
16
  this.initialMarginLeftElement = 0;
17
17
  this.currPageWidth = 0;
18
18
  this.prevPageWidth = 0;
19
- this.rootElement = DocumentRenderer.renderContainer(this.modelData.settings.styles.control.className);
19
+ this.rootElement = DocumentRenderer.renderContainer(this.modelData.styles.control.className);
20
20
  if (Browser.MSTouchUI)
21
21
  DomUtils.addClassName(this.rootElement, TouchUtils.msTouchDraggableClassName);
22
22
  this.controls.wrapper.rootElement.appendChild(this.rootElement);
@@ -15,7 +15,7 @@ export class RulerTabTypeControl extends RulerBase {
15
15
  this.evtHandlersHolder = new DomEventHandlersHolder();
16
16
  this.align = TabAlign.Left;
17
17
  this.innerSquareElement = DocumentRenderer.renderContainer("");
18
- this.alignElement = DocumentRenderer.renderContainer(RulerTabUtils.getSpriteClassName(this.align, this.modelData.settings));
18
+ this.alignElement = DocumentRenderer.renderContainer(RulerTabUtils.getSpriteClassName(this.align, this.modelData.styles));
19
19
  this.applyTemplate();
20
20
  this.innerSquareElement.appendChild(this.alignElement);
21
21
  this.rootElement.appendChild(this.innerSquareElement);
@@ -46,14 +46,14 @@ export class RulerTabTypeControl extends RulerBase {
46
46
  const size = this.innerSquareElement.offsetWidth;
47
47
  this.alignElement.style.top = (size - this.alignElement.offsetHeight) / 2 + "px";
48
48
  this.alignElement.style.left = (size - this.alignElement.offsetWidth) / 2 + "px";
49
- this.alignElement.title = this.modelData.settings.titles[RulerTabUtils.getTabTitlePropertyName(this.align)];
49
+ this.alignElement.title = this.modelData.titles[RulerTabUtils.getTabTitlePropertyName(this.align)];
50
50
  }
51
51
  onMouseDown(evt) {
52
52
  if (!this.modelData.isReadOnly) {
53
53
  this.align++;
54
54
  if (this.align > TabAlign.Decimal)
55
55
  this.align = TabAlign.Left;
56
- this.alignElement.className = RulerTabUtils.getSpriteClassName(this.align, this.modelData.settings);
56
+ this.alignElement.className = RulerTabUtils.getSpriteClassName(this.align, this.modelData.styles);
57
57
  this.applyTemplate();
58
58
  this.adjustAlignElement();
59
59
  EvtUtils.preventEvent(evt);
@@ -50,8 +50,8 @@ export class RulerTabsControl extends RulerMultiControl {
50
50
  this.deleteTab = false;
51
51
  }
52
52
  getModelState() {
53
- this.modelData.settings.showTabs = this.modelData.commandManager.getCommand(RichEditClientCommand.InsertTabRuler).getState().enabled;
54
- if (this.modelData.settings.showTabs) {
53
+ this.modelData.showTabs = this.modelData.commandManager.getCommand(RichEditClientCommand.InsertTabRuler).getState().enabled;
54
+ if (this.modelData.showTabs) {
55
55
  const paragraph = this.modelData.selection.activeSubDocument.getParagraphByPosition(this.modelData.selection.intervalsInfo.interval.start);
56
56
  const tabs = ListUtils.map(paragraph.getTabs().positions, tab => {
57
57
  const newTab = tab.clone();
@@ -195,7 +195,7 @@ class RulerTabControl {
195
195
  this.shadow = null;
196
196
  this.controls = controls;
197
197
  this.modelData = modelData;
198
- this.rootElement = DocumentRenderer.renderContainer(modelData.settings.styles.tab.className + " " + RulerTabUtils.getSpriteClassName(this.viewState.align, modelData.settings));
198
+ this.rootElement = DocumentRenderer.renderContainer(modelData.styles.tab.className + " " + RulerTabUtils.getSpriteClassName(this.viewState.align, modelData.styles));
199
199
  this.applyTemplate();
200
200
  controls.ruler.rootElement.appendChild(this.rootElement);
201
201
  this.rootElement.style.marginTop = (controls.divisions.height - this.rootElement.offsetHeight) + "px";
@@ -209,7 +209,7 @@ class RulerTabControl {
209
209
  setVisible(visible) {
210
210
  this.rootElement.style.display = visible ? 'block' : 'none';
211
211
  }
212
- canHandle(source) { return source == this.rootElement && this.modelData.settings.showTabs; }
212
+ canHandle(source) { return source == this.rootElement && this.modelData.showTabs; }
213
213
  showShadow() {
214
214
  this.shadow = new RulerShadow(this.rootElement);
215
215
  }
@@ -244,10 +244,10 @@ class RulerTabControl {
244
244
  }
245
245
  }
246
246
  changeAlign() {
247
- this.rootElement.className = this.modelData.settings.styles.tab.className + " " +
248
- RulerTabUtils.getSpriteClassName(this.viewState.align, this.modelData.settings);
247
+ this.rootElement.className = this.modelData.styles.tab.className + " " +
248
+ RulerTabUtils.getSpriteClassName(this.viewState.align, this.modelData.styles);
249
249
  this.applyTemplate();
250
- this.rootElement.title = this.modelData.settings.titles[RulerTabUtils.getTabTitlePropertyName(this.viewState.align)];
250
+ this.rootElement.title = this.modelData.titles[RulerTabUtils.getTabTitlePropertyName(this.viewState.align)];
251
251
  this.setCorrection();
252
252
  }
253
253
  applyTemplate() {
@@ -1,7 +1,7 @@
1
1
  import { TabAlign } from '../../../../model/paragraph/paragraph';
2
- import { RulerSettings } from '../../settings';
2
+ import { RulerStyles } from '../../settings';
3
3
  export declare class RulerTabUtils {
4
4
  static getTabTitlePropertyName(align: TabAlign): string;
5
- static getSpriteClassName(tabAlign: TabAlign, settings: RulerSettings): string;
5
+ static getSpriteClassName(tabAlign: TabAlign, styles: RulerStyles): string;
6
6
  static getTemplate(tabAlign: TabAlign): string | undefined;
7
7
  }
@@ -19,16 +19,16 @@ export class RulerTabUtils {
19
19
  }
20
20
  return "tab" + alignString;
21
21
  }
22
- static getSpriteClassName(tabAlign, settings) {
22
+ static getSpriteClassName(tabAlign, styles) {
23
23
  switch (tabAlign) {
24
24
  case TabAlign.Left:
25
- return settings.styles.tabImages.left.spriteCssClass;
25
+ return styles.tabImages.left.spriteCssClass;
26
26
  case TabAlign.Right:
27
- return settings.styles.tabImages.right.spriteCssClass;
27
+ return styles.tabImages.right.spriteCssClass;
28
28
  case TabAlign.Center:
29
- return settings.styles.tabImages.center.spriteCssClass;
29
+ return styles.tabImages.center.spriteCssClass;
30
30
  case TabAlign.Decimal:
31
- return settings.styles.tabImages.decimal.spriteCssClass;
31
+ return styles.tabImages.decimal.spriteCssClass;
32
32
  }
33
33
  return "";
34
34
  }
@@ -95,7 +95,7 @@ class RulerTableColumnState {
95
95
  constructor(modelData, controls) {
96
96
  this.controls = controls;
97
97
  this.rootElement = DocumentRenderer.renderContainer(TABLE_COLUMN_SEPARATOR_HANDLE_CLASS_NAME);
98
- this.separatorElement = DocumentRenderer.renderContainer(modelData.settings.styles.columnSeparatorImage.spriteCssClass);
98
+ this.separatorElement = DocumentRenderer.renderContainer(modelData.styles.columnSeparatorImage.spriteCssClass);
99
99
  const template = RulerTemplateManager.getTableColumnDragElementTemplate();
100
100
  if (template)
101
101
  this.separatorElement.innerHTML = template;
@@ -1,4 +1,3 @@
1
- import { RulerSettings } from '../settings';
2
1
  export declare const TABLE_COLUMN_SEPARATOR_RULER_LINE_CLASS_NAME: string;
3
2
  export declare enum SnapTo {
4
3
  LeftSide = 0,
@@ -16,7 +15,7 @@ export declare class RulerVerticalLineControl {
16
15
  private rulerControlWidth;
17
16
  private viewElementLeft;
18
17
  private rulerControlElement;
19
- constructor(canvas: HTMLDivElement, settings: RulerSettings, rulerControlElement: HTMLElement);
18
+ constructor(canvas: HTMLDivElement, className: string, rulerControlElement: HTMLElement);
20
19
  dispose(): void;
21
20
  show(type: RulerLineDisplayType): void;
22
21
  hide(): void;
@@ -13,14 +13,14 @@ export var RulerLineDisplayType;
13
13
  RulerLineDisplayType[RulerLineDisplayType["TableColumn"] = 1] = "TableColumn";
14
14
  })(RulerLineDisplayType || (RulerLineDisplayType = {}));
15
15
  export class RulerVerticalLineControl {
16
- constructor(canvas, settings, rulerControlElement) {
16
+ constructor(canvas, className, rulerControlElement) {
17
17
  this.borderWidth = 0;
18
18
  this.rulerControlLeft = 0;
19
19
  this.rulerControlWidth = 0;
20
20
  this.viewElementLeft = 0;
21
21
  this.canvas = canvas;
22
22
  this.rulerControlElement = rulerControlElement;
23
- this.rootElement = DocumentRenderer.renderContainer(settings.styles.line.className);
23
+ this.rootElement = DocumentRenderer.renderContainer(className);
24
24
  this.rootElement.style.display = "block";
25
25
  this.borderWidth = DomUtils.getHorizontalBordersWidth(this.rootElement);
26
26
  }
@@ -1,6 +1,6 @@
1
1
  import { RulerBase } from './base';
2
2
  export class RulerWrapper extends RulerBase {
3
- getRootClassName() { return this.modelData.settings.styles.wrapper.className; }
3
+ getRootClassName() { return this.modelData.styles.wrapper.className; }
4
4
  ;
5
5
  constructor(modelData, controls) {
6
6
  super(modelData, controls);
@@ -59,7 +59,7 @@ export class RulerControls {
59
59
  this.tabs = new RulerTabsControl(modelData, this);
60
60
  this.ruler.init();
61
61
  this.tabTypeBox.init();
62
- this.lineControl = new RulerVerticalLineControl(this.canvas, modelData.settings, this.ruler.rootElement);
62
+ this.lineControl = new RulerVerticalLineControl(this.canvas, modelData.styles.line.className, this.ruler.rootElement);
63
63
  this.mouseHandler = new RulerMouseHandler(modelData, this);
64
64
  this.mouseEventsManager.addListener(this.mouseHandler);
65
65
  this.viewElementScrollManager.addListener(this.ruler, this.canvas);
@@ -4,10 +4,16 @@ import { CommandManager } from '../../commands/command-manager';
4
4
  import { RichEditCore } from '../../rich-edit-core';
5
5
  import { InputPosition } from '../../selection/input-position';
6
6
  import { Selection } from '../../selection/selection';
7
- import { RulerSettings } from './settings';
7
+ import { RulerSettings, RulerStyles, RulerTitles, RulerVisibility } from './settings';
8
8
  export declare class RulerModelData {
9
9
  private core;
10
- readonly settings: RulerSettings;
10
+ private readonly settings;
11
+ visibility: RulerVisibility;
12
+ showTabs: boolean;
13
+ get showLeftIndent(): boolean;
14
+ get showRightIndent(): boolean;
15
+ get titles(): RulerTitles;
16
+ get styles(): RulerStyles;
11
17
  get inputPosition(): InputPosition;
12
18
  get commandManager(): CommandManager;
13
19
  get isClosed(): boolean;
@@ -1,6 +1,10 @@
1
1
  import { ReadOnlyMode } from '../../interfaces/i-rich-edit-core';
2
2
  import { RulerStyleInfo } from './settings';
3
3
  export class RulerModelData {
4
+ get showLeftIndent() { return this.settings.showLeftIndent; }
5
+ get showRightIndent() { return this.settings.showRightIndent; }
6
+ get titles() { return this.settings.titles; }
7
+ get styles() { return this.settings.styles; }
4
8
  get inputPosition() { return this.core.inputPosition; }
5
9
  ;
6
10
  get commandManager() { return this.core.commandManager; }
@@ -12,6 +16,8 @@ export class RulerModelData {
12
16
  constructor(core, settings) {
13
17
  this.core = core;
14
18
  this.settings = this.fixSettings(settings);
19
+ this.visibility = this.settings.visibility;
20
+ this.showTabs = this.settings.showTabs;
15
21
  }
16
22
  fixSettings(settings) {
17
23
  if (!settings.styles.firstLineIndent)
@@ -175,6 +175,7 @@ export class HorizontalRulerControl extends BatchUpdatableObject {
175
175
  }
176
176
  setVisible(visible) {
177
177
  if (visible != this._innerVisible || visible != this._visible) {
178
+ this.modelData.visibility = visible ? RulerVisibility.Visible : RulerVisibility.Hidden;
178
179
  this._visible = visible;
179
180
  this.innerSetVisible(visible);
180
181
  }
@@ -201,7 +202,7 @@ export class HorizontalRulerControl extends BatchUpdatableObject {
201
202
  return;
202
203
  if (!this.initialized && this.canvas.offsetWidth)
203
204
  this.controls = new RulerControls(this.canvas, this.modelData);
204
- this.setVisible(this.modelData.settings.visibility != RulerVisibility.Hidden);
205
+ this.setVisible(this.modelData.visibility != RulerVisibility.Hidden);
205
206
  this.onViewTypeChanged();
206
207
  }
207
208
  }
@@ -1,5 +1,5 @@
1
1
  import { Point } from '@devexpress/utils/lib/geometry/point';
2
- import { IRichEditControl } from '../interfaces/i-rich-edit-core';
2
+ import { IModelManager } from '../model-manager';
3
3
  export declare function rotatePoint(point: Point, angle: number, center: Point): Point;
4
4
  export declare class SearchTreeItemResult<T> {
5
5
  readonly parentList: T[];
@@ -13,8 +13,13 @@ export declare function searchTreeItem<T extends {
13
13
  export declare function convertToFunction(func: any): any | null;
14
14
  export declare function splitByLines(text: string): string[];
15
15
  export interface IUrlValidationOptions {
16
- allowRelativeUrl?: boolean;
17
- allowedProtocols?: string[];
16
+ allowedSchemes?: string[];
17
+ }
18
+ export declare function createUrlValidationOptions(modelManager: IModelManager): IUrlValidationOptions;
19
+ export declare class UrlUtils {
20
+ static EmptyPage: string;
21
+ static isValid(url: string, options?: IUrlValidationOptions): boolean;
22
+ static isRelative(url: string): boolean;
23
+ static convertToAbsolute(url: string): URL | null;
24
+ static splitUrlByAnchor(url: string): [url: string, anchor: string];
18
25
  }
19
- export declare function createUrlValidationOptions(control: IRichEditControl): IUrlValidationOptions;
20
- export declare function isUrlValid(url: string, options?: IUrlValidationOptions): boolean;
@@ -56,29 +56,57 @@ export function convertToFunction(func) {
56
56
  export function splitByLines(text) {
57
57
  return text ? text.split(/\r\n|\r|\n/) : [''];
58
58
  }
59
- export function createUrlValidationOptions(control) {
60
- const fieldSettings = control.modelManager.richOptions.fields;
59
+ export function createUrlValidationOptions(modelManager) {
60
+ const fieldSettings = modelManager.richOptions.fields;
61
61
  return {
62
- allowRelativeUrl: !fieldSettings.disableRelativeHyperlinkUri,
63
- allowedProtocols: fieldSettings.allowedHyperlinkUriProtocols
62
+ allowedSchemes: fieldSettings.allowedHyperlinkUriSchemes
64
63
  };
65
64
  }
65
+ const defaultAllowedProtocols = [
66
+ 'http',
67
+ 'https',
68
+ 'mailto',
69
+ 'tel'
70
+ ];
66
71
  const disallowedProtocols = [
67
- 'data',
68
- 'javascript'
72
+ 'javascript',
73
+ 'data'
69
74
  ];
70
- export function isUrlValid(url, options) {
71
- let currentLocation;
72
- if (options === null || options === void 0 ? void 0 : options.allowRelativeUrl)
73
- currentLocation = window.location.href;
74
- try {
75
- const resultUrl = new URL(url, currentLocation);
75
+ export class UrlUtils {
76
+ static isValid(url, options) {
77
+ var _a;
78
+ const resultUrl = this.convertToAbsolute(url);
79
+ if (!resultUrl)
80
+ return false;
76
81
  const protocol = resultUrl.protocol.slice(0, -1);
77
- const allowedProtocols = options === null || options === void 0 ? void 0 : options.allowedProtocols;
78
- if (allowedProtocols)
79
- return allowedProtocols.includes(protocol);
80
- return !disallowedProtocols.includes(protocol);
82
+ if (disallowedProtocols.includes(protocol))
83
+ return false;
84
+ const allowedProtocols = (_a = options === null || options === void 0 ? void 0 : options.allowedSchemes) !== null && _a !== void 0 ? _a : defaultAllowedProtocols;
85
+ return allowedProtocols.includes(protocol);
86
+ }
87
+ static isRelative(url) {
88
+ try {
89
+ new URL(url);
90
+ return false;
91
+ }
92
+ catch (_a) {
93
+ return true;
94
+ }
95
+ }
96
+ static convertToAbsolute(url) {
97
+ const currentLocation = window.location.href;
98
+ try {
99
+ return new URL(url, currentLocation);
100
+ }
101
+ catch (_a) {
102
+ return null;
103
+ }
104
+ }
105
+ static splitUrlByAnchor(url) {
106
+ const hashTagPosition = url.indexOf("#");
107
+ if (hashTagPosition < 0)
108
+ return [url, ""];
109
+ return [url.substring(0, hashTagPosition), url.substring(hashTagPosition + 1)];
81
110
  }
82
- catch (_a) { }
83
- return false;
84
111
  }
112
+ UrlUtils.EmptyPage = "about:blank";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devexpress-richedit",
3
- "version": "24.2.1-alpha-24260-0102",
3
+ "version": "24.2.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": "24.2.1-alpha-24256-1935",
18
- "devextreme-dist": "24.2.1-alpha-24256-1935"
17
+ "devextreme": "24.2.3",
18
+ "devextreme-dist": "24.2.3"
19
19
  },
20
20
  "dependencies": {
21
21
  "jszip": "~3.10.1",