devexpress-richedit 24.2.1-alpha-24260-0102 → 24.2.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 (98) 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 +528 -226
  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/new-document-command.js +2 -1
  17. package/lib/client/default-localization.js +2 -0
  18. package/lib/client/dialogs/hyperlink-dialog.js +13 -6
  19. package/lib/client/formats/docx/import/color/open-xml-color-import-helper.js +2 -2
  20. package/lib/client/formats/docx/import/importers/styles-importer.js +2 -1
  21. package/lib/client/i-rich-constructor-settings.d.ts +1 -2
  22. package/lib/client/model-api/collections/drawing-object-collection.js +1 -1
  23. package/lib/client/model-api/collections/hyperlink-collection.js +1 -1
  24. package/lib/client/public/commands/enum.d.ts +1 -0
  25. package/lib/client/public/commands/enum.js +1 -0
  26. package/lib/client/public/options.d.ts +1 -2
  27. package/lib/client/public/ribbon/item-ids.d.ts +1 -0
  28. package/lib/client/public/ribbon/item-ids.js +1 -0
  29. package/lib/client/public/rich-edit.js +1 -1
  30. package/lib/client/settings.js +2 -4
  31. package/lib/common/commands/client-command.d.ts +2 -1
  32. package/lib/common/commands/client-command.js +1 -0
  33. package/lib/common/commands/command-manager.js +2 -1
  34. package/lib/common/commands/dialogs/dialog-hyperlink-command.js +10 -4
  35. package/lib/common/commands/fields/create-field-command.d.ts +4 -0
  36. package/lib/common/commands/fields/create-field-command.js +8 -0
  37. package/lib/common/commands/fields/open-hyperlink-command.js +9 -6
  38. package/lib/common/commands/floating-objects/floating-object-drag-drop-change-position-command.js +1 -1
  39. package/lib/common/commands/floating-objects/insert-anchored-text-box-command.js +1 -1
  40. package/lib/common/formats/html/export/html-export.d.ts +7 -1
  41. package/lib/common/formats/html/export/html-export.js +35 -35
  42. package/lib/common/formats/html/import/html-importer.js +1 -1
  43. package/lib/common/formats/html/import/importers/list-base.js +4 -4
  44. package/lib/common/input-controller.d.ts +14 -1
  45. package/lib/common/input-controller.js +58 -20
  46. package/lib/common/layout/document-layout.js +1 -1
  47. package/lib/common/layout/main-structures/layout-boxes/layout-space-box.js +1 -1
  48. package/lib/common/model/color/color-model-info.d.ts +1 -1
  49. package/lib/common/model/color/color-model-info.js +2 -1
  50. package/lib/common/model/fields/field.d.ts +4 -1
  51. package/lib/common/model/fields/field.js +18 -2
  52. package/lib/common/model/fields/names.d.ts +2 -1
  53. package/lib/common/model/fields/names.js +1 -0
  54. package/lib/common/model/fields/parsers/field-code-parser-client-updating-base.js +1 -1
  55. package/lib/common/model/fields/parsers/field-code-parser-doc-variable.js +1 -1
  56. package/lib/common/model/fields/parsers/field-code-parser-hyperlink.js +32 -38
  57. package/lib/common/model/fields/parsers/field-code-parser-if.d.ts +39 -0
  58. package/lib/common/model/fields/parsers/field-code-parser-if.js +138 -0
  59. package/lib/common/model/fields/parsers/field-code-parser-merge-field.js +1 -1
  60. package/lib/common/model/fields/parsers/field-code-parser.d.ts +3 -2
  61. package/lib/common/model/fields/parsers/field-code-parser.js +6 -12
  62. package/lib/common/model/fields/tree-creator.js +2 -0
  63. package/lib/common/model/history/items/floating-objects/insert-anchored-picture-history-item.js +1 -0
  64. package/lib/common/model/history/items/switch-text-box-sub-documents-state-history-item.js +0 -1
  65. package/lib/common/model/manipulators/document/sub-document-inserter.d.ts +1 -0
  66. package/lib/common/model/manipulators/document/sub-document-inserter.js +4 -0
  67. package/lib/common/model/manipulators/range/remove-interval-operation.d.ts +2 -0
  68. package/lib/common/model/manipulators/range/remove-interval-operation.js +10 -2
  69. package/lib/common/model/manipulators/range-permission-manipulator.d.ts +4 -0
  70. package/lib/common/model/manipulators/range-permission-manipulator.js +35 -0
  71. package/lib/common/model/manipulators/text-box-manipulator.d.ts +1 -1
  72. package/lib/common/model/manipulators/text-box-manipulator.js +2 -1
  73. package/lib/common/model/manipulators/text-manipulator/text-manipulator.js +1 -1
  74. package/lib/common/model/options/fields.d.ts +1 -2
  75. package/lib/common/model/options/fields.js +2 -5
  76. package/lib/common/model/styles-manager.js +1 -0
  77. package/lib/common/selection/selection.js +2 -1
  78. package/lib/common/ui/ruler/controls/indent/first-line.js +5 -5
  79. package/lib/common/ui/ruler/controls/indent/left.js +6 -6
  80. package/lib/common/ui/ruler/controls/indent/right.js +4 -4
  81. package/lib/common/ui/ruler/controls/margin/left.js +1 -1
  82. package/lib/common/ui/ruler/controls/margin/right.js +1 -1
  83. package/lib/common/ui/ruler/controls/ruler.js +2 -2
  84. package/lib/common/ui/ruler/controls/tab/tab-type.js +3 -3
  85. package/lib/common/ui/ruler/controls/tab/tab.js +7 -7
  86. package/lib/common/ui/ruler/controls/tab/utils.d.ts +2 -2
  87. package/lib/common/ui/ruler/controls/tab/utils.js +5 -5
  88. package/lib/common/ui/ruler/controls/table.js +1 -1
  89. package/lib/common/ui/ruler/controls/vertical-line.d.ts +1 -2
  90. package/lib/common/ui/ruler/controls/vertical-line.js +2 -2
  91. package/lib/common/ui/ruler/controls/wrapper.js +1 -1
  92. package/lib/common/ui/ruler/manager.js +1 -1
  93. package/lib/common/ui/ruler/model-data.d.ts +8 -2
  94. package/lib/common/ui/ruler/model-data.js +6 -0
  95. package/lib/common/ui/ruler/ruler.js +2 -1
  96. package/lib/common/utils/utils.d.ts +10 -5
  97. package/lib/common/utils/utils.js +46 -18
  98. package/package.json +3 -3
@@ -38,7 +38,8 @@ export declare class FieldSwitch {
38
38
  export declare class FieldParameter {
39
39
  interval: FixedInterval;
40
40
  text: string;
41
- constructor(interval: FixedInterval, textRepresentation: string);
41
+ quoted: boolean;
42
+ constructor(interval: FixedInterval, textRepresentation: string, quoted?: boolean);
42
43
  clone(): FieldParameter;
43
44
  }
44
45
  export declare class FieldCodeParserHelper {
@@ -97,7 +98,7 @@ export declare abstract class FieldCodeParser {
97
98
  updateInfo(): boolean;
98
99
  protected needUpdateInfo(): boolean;
99
100
  protected updateInfoCore(): void;
100
- parseSwitchesAndArgs(needAtLestOneSpaceAfterFieldName: boolean): boolean;
101
+ parseSwitchesAndArgs(): boolean;
101
102
  private skipWhitespaces;
102
103
  private getFieldParameterInfo;
103
104
  private getSwitchInfo;
@@ -43,12 +43,13 @@ export class FieldSwitch {
43
43
  }
44
44
  }
45
45
  export class FieldParameter {
46
- constructor(interval, textRepresentation) {
46
+ constructor(interval, textRepresentation, quoted = false) {
47
47
  this.text = textRepresentation;
48
48
  this.interval = interval;
49
+ this.quoted = quoted;
49
50
  }
50
51
  clone() {
51
- return new FieldParameter(this.interval.clone(), this.text);
52
+ return new FieldParameter(this.interval.clone(), this.text, this.quoted);
52
53
  }
53
54
  }
54
55
  export class FieldCodeParserHelper {
@@ -313,7 +314,7 @@ export class FieldCodeParser {
313
314
  updateInfo() {
314
315
  if (!this.needUpdateInfo())
315
316
  return false;
316
- this.parseSwitchesAndArgs(true);
317
+ this.parseSwitchesAndArgs();
317
318
  this.updateInfoCore();
318
319
  return true;
319
320
  }
@@ -321,14 +322,7 @@ export class FieldCodeParser {
321
322
  return false;
322
323
  }
323
324
  updateInfoCore() { }
324
- parseSwitchesAndArgs(needAtLestOneSpaceAfterFieldName) {
325
- if (needAtLestOneSpaceAfterFieldName) {
326
- var prevPos = this.modelIterator.getAbsolutePosition();
327
- if (this.skipWhitespaces())
328
- this.modelIterator.setPosition(prevPos);
329
- else
330
- return this.modelIterator.run.getType() == RunType.FieldCodeEndRun;
331
- }
325
+ parseSwitchesAndArgs() {
332
326
  while (this.skipWhitespaces() && this.modelIterator.run.getType() != RunType.FieldCodeEndRun) {
333
327
  var currChar = this.modelIterator.getCurrentChar();
334
328
  if (FieldCodeParserHelper.isBackslesh(currChar)) {
@@ -364,7 +358,7 @@ export class FieldCodeParser {
364
358
  var argInterval = parseResult.quoted ?
365
359
  FixedInterval.fromPositions(startPosition + 1, this.modelIterator.getAbsolutePosition() - 1) :
366
360
  FixedInterval.fromPositions(startPosition, this.modelIterator.getAbsolutePosition());
367
- return new FieldParameter(argInterval, parseResult.argListChars.join(""));
361
+ return new FieldParameter(argInterval, parseResult.argListChars.join(""), parseResult.quoted);
368
362
  }
369
363
  getSwitchInfo() {
370
364
  if (!this.moveIteratorToNextChar() || this.modelIterator.run.getType() != RunType.TextRun)
@@ -18,6 +18,7 @@ import { FieldCodeParserTc } from './parsers/field-code-parser-tc';
18
18
  import { FieldCodeParserTime } from './parsers/field-code-parser-time';
19
19
  import { FieldCodeParserToc } from './parsers/field-code-parser-toc';
20
20
  import { FieldCodeParserFillIn } from './parsers/fill-in';
21
+ import { FieldCodeParserIf } from './parsers/field-code-parser-if';
21
22
  class FieldParsersAndIntervals {
22
23
  constructor(interval) {
23
24
  this.interval = interval;
@@ -182,6 +183,7 @@ export class FieldsWaitingForUpdate {
182
183
  }
183
184
  FieldsWaitingForUpdate.TOC_NAME = "TOC";
184
185
  FieldsWaitingForUpdate.parsersMap = {
186
+ ["IF"]: (args) => new FieldCodeParserIf(args),
185
187
  ["DATE"]: (args) => new FieldCodeParserDate(args),
186
188
  ["TIME"]: (args) => new FieldCodeParserTime(args),
187
189
  ["DOCVARIABLE"]: (args) => new FieldCodeParserDocVariable(args),
@@ -23,6 +23,7 @@ export class InsertAnchoredTextBoxHistoryItem extends PositionBasedHistoryItem {
23
23
  }
24
24
  redo() {
25
25
  this.modelManipulator.textBox.insertAnchoredTextBox(this.subDocPos, this.charPropsBundle, this.textBoxInfo);
26
+ this.modelManipulator.model.subDocumentsCollection.restore(this.textBoxInfo.innerSubDocument.id);
26
27
  }
27
28
  undo() {
28
29
  this.modelManipulator.range.removeIntervalWithoutHistory(this.boundSubDocument, new FixedInterval(this.position, 1), false);
@@ -7,7 +7,6 @@ export class SwitchTextBoxSubDocumentsStateHistoryItem extends HistoryItem {
7
7
  this.position = position;
8
8
  }
9
9
  redo() {
10
- this.oldSubDocument = this.oldSubDocument.getActualSubDocument();
11
10
  const newRun = this.textBoxParentSubDocument.getRunAndIndexesByPosition(this.position).run;
12
11
  this.newSubDocument = this.modelManipulator.model.subDocuments[newRun.subDocId];
13
12
  this.modelManipulator.model.subDocumentsCollection.replace(this.oldSubDocument.id, this.newSubDocument.id);
@@ -53,6 +53,7 @@ export declare class SubDocumentInserter {
53
53
  private getPatternTable;
54
54
  private collectFields;
55
55
  private collectBookmarks;
56
+ private collectRangePermission;
56
57
  private prependTableByParagraph;
57
58
  private getFontInfo;
58
59
  private getColorModelInfo;
@@ -96,6 +96,7 @@ export class SubDocumentInserter {
96
96
  this.collectTables();
97
97
  this.collectFields();
98
98
  this.collectBookmarks();
99
+ this.collectRangePermission();
99
100
  if (this.options.overlapTableCellContent) {
100
101
  const lastInsertedParagraph = this.targetSubDocument.getParagraphByPosition(this.currInsertSubDocumentPosition.position - 1);
101
102
  const nextParagraph = this.targetSubDocument.getParagraphByPosition(this.currInsertSubDocumentPosition.position);
@@ -204,6 +205,9 @@ export class SubDocumentInserter {
204
205
  collectBookmarks() {
205
206
  this.targetModelManipulator.bookmark.insertBookmarksFromSubDocument(this.sourceSubDocument, this.targetSubDocument, this.sourceInterval, this.modelsConstOffset);
206
207
  }
208
+ collectRangePermission() {
209
+ this.targetModelManipulator.rangePermission.insertRangePermissionsFromSubDocument(this.sourceSubDocument, this.targetSubDocument, this.sourceInterval, this.modelsConstOffset);
210
+ }
207
211
  prependTableByParagraph() {
208
212
  if (this.options.insertParagraphMarkBeforeIfStartsWithTable) {
209
213
  const tbl = Table.getTableByPosition(this.sourceSubDocument.tables, this.sourceInterval.start, false);
@@ -4,6 +4,7 @@ import { HistoryRun } from '../../character/history-runs';
4
4
  import { SubDocument } from '../../sub-document';
5
5
  import { TableCell } from '../../tables/main-structures/table-cell';
6
6
  import { ModelManipulator } from '../model-manipulator';
7
+ import { ConstRangePermission } from '../../range-permissions';
7
8
  export declare class RemoveIntervalOperation {
8
9
  modelManipulator: ModelManipulator;
9
10
  currentSectionIndex: number;
@@ -42,6 +43,7 @@ export declare class RemoveIntervalOperationResult {
42
43
  private nestingLevels;
43
44
  private cellsIterator;
44
45
  bookmarkItems: ConstBookmark[];
46
+ rangePermssionsItems: ConstRangePermission[];
45
47
  constructor(cellsIterator: SelectedCellsIterator);
46
48
  registerItem(historyRun: HistoryRun): void;
47
49
  private registerItemCore;
@@ -23,6 +23,7 @@ export class RemoveIntervalOperation {
23
23
  this.cellsIterator = new SelectedCellsIterator(this.subDocument, interval);
24
24
  const result = new RemoveIntervalOperationResult(this.cellsIterator);
25
25
  result.bookmarkItems = this.modelManipulator.bookmark.deleteBookmarks(this.subDocument, interval);
26
+ result.rangePermssionsItems = this.modelManipulator.rangePermission.deleteRangePermissions(this.subDocument, interval);
26
27
  if (this.tryPackSelectionInOneRun(interval, result))
27
28
  return result;
28
29
  var iterator = this.subDocument.getRunIterator(interval);
@@ -53,8 +54,14 @@ export class RemoveIntervalOperation {
53
54
  var accumulatedInterval = new FixedInterval(this.position, 0);
54
55
  let removedTextList = [];
55
56
  while (iterator.moveNext()) {
56
- if (EnumUtils.isAnyOf(iterator.currentRun.getType(), RunType.AnchoredPictureRun, RunType.AnchoredTextBoxRun))
57
- this.modelManipulator.notifyModelChanged(new AnchorObjectRemovedSubDocumentChange(this.subDocument.id, (iterator.currentRun).anchoredObjectID, iterator.currentInterval().start));
57
+ if (EnumUtils.isAnyOf(iterator.currentRun.getType(), RunType.AnchoredPictureRun, RunType.AnchoredTextBoxRun)) {
58
+ const currentRun = iterator.currentRun;
59
+ const position = iterator.currentInterval().start;
60
+ const change = new AnchorObjectRemovedSubDocumentChange(this.subDocument.id, currentRun.anchoredObjectID, position);
61
+ if (currentRun instanceof AnchoredTextBoxRun)
62
+ this.modelManipulator.model.subDocumentsCollection.replace(currentRun.subDocId, subDocument.id);
63
+ this.modelManipulator.notifyModelChanged(change);
64
+ }
58
65
  if (iterator.currentChunk !== subDocument.chunks[this.currentChunkIndex]) {
59
66
  this.removeAccumulatedInterval(accumulatedInterval, this.position, 0, removedTextList);
60
67
  this.currentChunkIndex++;
@@ -348,6 +355,7 @@ export class RemoveIntervalOperationResult {
348
355
  this.historyRuns = [];
349
356
  this.nestingLevels = [];
350
357
  this.bookmarkItems = [];
358
+ this.rangePermssionsItems = [];
351
359
  this.cellsIterator = cellsIterator;
352
360
  }
353
361
  registerItem(historyRun) {
@@ -1,7 +1,11 @@
1
1
  import { ConstRangePermission } from '../range-permissions';
2
2
  import { SubDocument } from '../sub-document';
3
3
  import { BaseManipulator } from './base-manipulator';
4
+ import { ConstInterval } from '@devexpress/utils/lib/intervals/const';
5
+ import { FixedInterval } from '@devexpress/utils/lib/intervals/fixed';
4
6
  export declare class RangePermissionManipulator extends BaseManipulator {
5
7
  createRangePermission(subDocument: SubDocument, permissionTemplate: ConstRangePermission): void;
6
8
  deleteRangePermission(subDocument: SubDocument, permissionTemplate: ConstRangePermission, permissionIndex?: number): void;
9
+ insertRangePermissionsFromSubDocument(fromSubDocument: SubDocument, toSubDocument: SubDocument, fromInterval: ConstInterval, modelsConstOffset: number): void;
10
+ deleteRangePermissions(subDocument: SubDocument, interval: FixedInterval): ConstRangePermission[];
7
11
  }
@@ -2,6 +2,7 @@ import { ListUtils } from '@devexpress/utils/lib/utils/list';
2
2
  import { RangePermissionsChangedSubDocumentChange } from '../changes/sub-document/range-permissions-changed';
3
3
  import { ConstRangePermission, RangePermission } from '../range-permissions';
4
4
  import { BaseManipulator } from './base-manipulator';
5
+ import { SearchUtils } from '@devexpress/utils/lib/utils/search';
5
6
  export class RangePermissionManipulator extends BaseManipulator {
6
7
  createRangePermission(subDocument, permissionTemplate) {
7
8
  subDocument.rangePermissions.push(new RangePermission(subDocument.positionManager, permissionTemplate.interval, permissionTemplate.userName, permissionTemplate.group));
@@ -14,4 +15,38 @@ export class RangePermissionManipulator extends BaseManipulator {
14
15
  subDocument.filterRangePermissions(this.modelManipulator.modelManager.richOptions.documentProtection);
15
16
  this.modelManipulator.notifyModelChanged(new RangePermissionsChangedSubDocumentChange(subDocument.id, permissionTemplate));
16
17
  }
18
+ insertRangePermissionsFromSubDocument(fromSubDocument, toSubDocument, fromInterval, modelsConstOffset) {
19
+ const rangePermissions = fromSubDocument.rangePermissions;
20
+ let ind = SearchUtils.normedInterpolationIndexOf(rangePermissions, (b) => b.start, fromInterval.start);
21
+ while (rangePermissions[ind] && rangePermissions[ind].start >= fromInterval.start)
22
+ ind--;
23
+ ind = Math.max(0, ind);
24
+ for (let rpm; (rpm = rangePermissions[ind]) && rpm.start <= fromInterval.end; ind++) {
25
+ if (fromInterval.containsInterval(rpm.interval)) {
26
+ const template = rpm.constRangePermission;
27
+ template.interval.start += modelsConstOffset;
28
+ template.interval.end += modelsConstOffset + 1;
29
+ this.createRangePermission(toSubDocument, template);
30
+ }
31
+ }
32
+ toSubDocument.rangePermissions = toSubDocument.rangePermissions.sort(ConstRangePermission.comparer);
33
+ }
34
+ deleteRangePermissions(subDocument, interval) {
35
+ const rangePermissions = subDocument.rangePermissions;
36
+ const result = [];
37
+ let ind = SearchUtils.normedInterpolationIndexOf(rangePermissions, (b) => b.start, interval.start);
38
+ while (rangePermissions[ind] && rangePermissions[ind].start >= interval.start)
39
+ ind--;
40
+ ind = Math.max(0, ind);
41
+ for (let curr; (curr = rangePermissions[ind]) && curr.interval.start <= interval.end;) {
42
+ if (interval.containsInterval(curr.interval)) {
43
+ const tmpl = curr.constRangePermission;
44
+ this.deleteRangePermission(subDocument, tmpl, ind);
45
+ result.push(tmpl);
46
+ }
47
+ else
48
+ ind++;
49
+ }
50
+ return result;
51
+ }
17
52
  }
@@ -17,6 +17,6 @@ export declare class BaseTextBoxInfo {
17
17
  constructor(innerSubDocument: SubDocument, size: AnchorTextBoxSize, shape: Shape, anchorInfo: AnchorInfo, textBoxProperties: TextBoxProperties, containerProperties: NonVisualDrawingObjectInfo);
18
18
  }
19
19
  export declare class TextBoxManipulator extends RunsBaseManipulator {
20
- insertAnchoredTextBoxViaHistoty(subDocPos: SubDocumentPosition, charPropsBundle: MaskedCharacterPropertiesBundle, textBoxInfo: BaseTextBoxInfo): void;
20
+ insertAnchoredTextBoxViaHistory(subDocPos: SubDocumentPosition, charPropsBundle: MaskedCharacterPropertiesBundle, textBoxInfo: BaseTextBoxInfo): void;
21
21
  insertAnchoredTextBox(subDocPos: SubDocumentPosition, charPropsBundle: MaskedCharacterPropertiesBundle, textBoxInfo: BaseTextBoxInfo): AnchoredTextBoxRun;
22
22
  }
@@ -16,7 +16,7 @@ export class BaseTextBoxInfo {
16
16
  }
17
17
  }
18
18
  export class TextBoxManipulator extends RunsBaseManipulator {
19
- insertAnchoredTextBoxViaHistoty(subDocPos, charPropsBundle, textBoxInfo) {
19
+ insertAnchoredTextBoxViaHistory(subDocPos, charPropsBundle, textBoxInfo) {
20
20
  this.history.addAndRedo(new InsertAnchoredTextBoxHistoryItem(this.modelManipulator, subDocPos, charPropsBundle, textBoxInfo));
21
21
  }
22
22
  insertAnchoredTextBox(subDocPos, charPropsBundle, textBoxInfo) {
@@ -33,6 +33,7 @@ export class TextBoxManipulator extends RunsBaseManipulator {
33
33
  let textBoxSubDoc = textBoxInfo.innerSubDocument ?
34
34
  textBoxInfo.innerSubDocument :
35
35
  this.model.createSubDocument(SubDocumentInfoType.TextBox, subDocument.id);
36
+ textBoxInfo.innerSubDocument = textBoxSubDoc;
36
37
  textBoxRun.subDocId = textBoxSubDoc.id;
37
38
  subDocument.chunks[insertedRun.chunkIndex].textRuns[insertedRun.runIndex].paragraph.length++;
38
39
  this.modelManipulator.notifyModelChanged(new AnchoredTextBoxInsertedSubDocumentChange(subDocument.id, textBoxRun.anchoredObjectID, textBoxRun.subDocId, insertPositionAtStartDocument, textBoxInfo.anchorInfo, textBoxRun.containerProperties));
@@ -39,7 +39,7 @@ export class TextManipulator extends RunsBaseManipulator {
39
39
  return null;
40
40
  const historyItems = history.historyItems;
41
41
  const result = history.currentIndex == historyItems.length - 1 ? this.getLastHistoryItemNode(historyItems, null, checkType) : null;
42
- return !result.empty ? result : null;
42
+ return (result === null || result === void 0 ? void 0 : result.empty) ? null : result;
43
43
  }
44
44
  getLastHistoryItemNode(historyItems, parent, checkType) {
45
45
  for (let ind = historyItems.length - 1, item; item = historyItems[ind]; ind--) {
@@ -6,8 +6,7 @@ export declare class FieldsSettings {
6
6
  defaultTimeFormat: string;
7
7
  defaultDateFormat: string;
8
8
  openHyperlinkOnClick: boolean;
9
- disableRelativeHyperlinkUri: boolean;
10
- allowedHyperlinkUriProtocols: string[];
9
+ allowedHyperlinkUriSchemes: string[];
11
10
  keepHyperlinkResultForInvalidReference: boolean;
12
11
  createHyperlinkTooltip: (hyperlinkTooltip: string, hint: string) => string;
13
12
  constructor();
@@ -4,7 +4,6 @@ export class FieldsSettings {
4
4
  ;
5
5
  constructor() {
6
6
  this.openHyperlinkOnClick = false;
7
- this.disableRelativeHyperlinkUri = false;
8
7
  this.updateFieldsBeforePrint = true;
9
8
  this.updateFieldsOnPaste = true;
10
9
  this.defaultTimeFormat = FieldsSettings.DEFAULT_TIME_FORMAT;
@@ -30,10 +29,8 @@ export class FieldsSettings {
30
29
  this.keepHyperlinkResultForInvalidReference = obj.keepHyperlinkResultForInvalidReference;
31
30
  if (isDefined(obj.createHyperlinkTooltip) && obj.createHyperlinkTooltip !== '')
32
31
  this.createHyperlinkTooltip = convertToFunction(obj.createHyperlinkTooltip);
33
- if (isDefined(obj.disableRelativeHyperlinkUri))
34
- this.disableRelativeHyperlinkUri = obj.disableRelativeHyperlinkUri;
35
- if (isDefined(obj.allowedHyperlinkUriProtocols))
36
- this.allowedHyperlinkUriProtocols = obj.allowedHyperlinkUriProtocols;
32
+ if (isDefined(obj.allowedHyperlinkUriSchemes))
33
+ this.allowedHyperlinkUriSchemes = obj.allowedHyperlinkUriSchemes;
37
34
  }
38
35
  clone() {
39
36
  const result = new FieldsSettings();
@@ -123,6 +123,7 @@ export class StylesManager {
123
123
  }
124
124
  addTableCellStyleCore(oldStyle) {
125
125
  var newStyle = oldStyle.clone();
126
+ this.tableCellStyleNameToIndex[newStyle.styleName] = this.documentModel.tableCellStyles.push(newStyle) - 1;
126
127
  newStyle.characterProperties = this.documentModel.cache.mergedCharacterPropertiesCache.getItem(oldStyle.characterProperties);
127
128
  newStyle.tableCellProperties = this.documentModel.cache.tableCellPropertiesCache.getItem(oldStyle.tableCellProperties);
128
129
  return newStyle;
@@ -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);