devexpress-richedit 24.1.7-build-24288-0102 → 24.1.8-build-24309-0102

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 (29) 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 +1 -1
  9. package/dist/dx.richedit.js +136 -63
  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/client-rich-edit.js +6 -6
  14. package/lib/client/dialogs/hyperlink-dialog.js +13 -6
  15. package/lib/client/model-api/collections/hyperlink-collection.js +1 -1
  16. package/lib/common/commands/dialogs/dialog-hyperlink-command.js +10 -4
  17. package/lib/common/commands/fields/open-hyperlink-command.js +7 -4
  18. package/lib/common/model/fields/field.d.ts +4 -1
  19. package/lib/common/model/fields/field.js +18 -2
  20. package/lib/common/model/fields/parsers/field-code-parser-hyperlink.js +31 -37
  21. package/lib/common/model/manipulators/document/sub-document-inserter.d.ts +1 -0
  22. package/lib/common/model/manipulators/document/sub-document-inserter.js +4 -0
  23. package/lib/common/model/manipulators/range/remove-interval-operation.d.ts +2 -0
  24. package/lib/common/model/manipulators/range/remove-interval-operation.js +2 -0
  25. package/lib/common/model/manipulators/range-permission-manipulator.d.ts +4 -0
  26. package/lib/common/model/manipulators/range-permission-manipulator.js +35 -0
  27. package/lib/common/utils/utils.d.ts +1 -0
  28. package/lib/common/utils/utils.js +6 -0
  29. package/package.json +3 -3
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (index.d.ts)
3
- * Version: 24.1.7
3
+ * Version: 24.1.8
4
4
  * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
5
5
  * License: https://www.devexpress.com/Support/EULAs
6
6
  */
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * DevExpress WebRichEdit (index.js)
3
- * Version: 24.1.7
3
+ * Version: 24.1.8
4
4
  * Copyright (c) 2012 - 2024 Developer Express Inc. ALL RIGHTS RESERVED
5
5
  * License: https://www.devexpress.com/Support/EULAs
6
6
  */
@@ -53,8 +53,8 @@ export class ClientRichEdit {
53
53
  this.rawDataSource = settings.rawDataSource;
54
54
  this.contextMenuSettings = settings.contextMenuSettings;
55
55
  this.fullScreenHelper = new FullScreenHelper(element);
56
- if ("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWNIQktkR3hUTlRaeU1HRjZNV3R4VldwWFNuTXRaeUlLZlE9PS5GSzV0WCtSUkt0akY2Q2NwaExOa0R2V0RCTHVkb0ZrdTN3LzJEMGMxRVlWMXp4KzJEYURkYnA0MGtPbXpKTnBRMXB0TUpiT1NTUm1JVmJaSU5VejRINDE3ejZMTDF4cDRZdWpyL2hQU3RiZlNodkNJMGFmemN4TzhXL1ZaVUJUR2gyZUh6UT09In0=")
57
- config(JSON.parse(atob("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWNIQktkR3hUTlRaeU1HRjZNV3R4VldwWFNuTXRaeUlLZlE9PS5GSzV0WCtSUkt0akY2Q2NwaExOa0R2V0RCTHVkb0ZrdTN3LzJEMGMxRVlWMXp4KzJEYURkYnA0MGtPbXpKTnBRMXB0TUpiT1NTUm1JVmJaSU5VejRINDE3ejZMTDF4cDRZdWpyL2hQU3RiZlNodkNJMGFmemN4TzhXL1ZaVUJUR2gyZUh6UT09In0=")));
56
+ if ("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWNsQXpXRVkxYm5aUmEyRjVjRTk1UWt4d2RXTlVRU0lLZlE9PS5mRVhyTm1adGMwdWRsdzlOa3hheDBPejFzTEdNU0RwUHBXWGhVdEllc0xvU21lMVhxTC9jZWw2QUtMVVFjVFJERURuN0dRM1k0ZzVMRTlVSGJsK0lUM09zbmpOZnBxYS9nTFY2bmpHbWt2NytLQnVvWWtyTE9LbGtyQjRWQ00rVVZYdDNKZz09In0=")
57
+ config(JSON.parse(atob("eyJsaWNlbnNlS2V5IjoiZXdvZ0lDSm1iM0p0WVhRaU9pQXhMQW9nSUNKcGJuUmxjbTVoYkZWellXZGxTV1FpT2lBaWNsQXpXRVkxYm5aUmEyRjVjRTk1UWt4d2RXTlVRU0lLZlE9PS5mRVhyTm1adGMwdWRsdzlOa3hheDBPejFzTEdNU0RwUHBXWGhVdEllc0xvU21lMVhxTC9jZWw2QUtMVVFjVFJERURuN0dRM1k0ZzVMRTlVSGJsK0lUM09zbmpOZnBxYS9nTFY2bmpHbWt2NytLQnVvWWtyTE9LbGtyQjRWQ00rVVZYdDNKZz09In0=")));
58
58
  this.prepareElement(element, settings);
59
59
  this.initDefaultFontsAndStyles();
60
60
  this.initBars(settings.ribbon, settings.fonts);
@@ -585,11 +585,11 @@ export class ClientRichEdit {
585
585
  return this.barHolder.ribbon;
586
586
  }
587
587
  getLinkType(hyperlinkInfo) {
588
- if (hyperlinkInfo.anchor)
589
- return DocumentLinkType.Bookmark;
590
- if (hyperlinkInfo.uri && hyperlinkInfo.uri.substr(0, 7) === "mailto:")
588
+ if (hyperlinkInfo.isMail())
591
589
  return DocumentLinkType.EmailAddress;
592
- return DocumentLinkType.Hyperlink;
590
+ if (hyperlinkInfo.isUri())
591
+ return DocumentLinkType.Hyperlink;
592
+ return DocumentLinkType.Bookmark;
593
593
  }
594
594
  setFullScreenMode() {
595
595
  this.fullScreenHelper.prepareFullScreenMode();
@@ -1,5 +1,6 @@
1
1
  import { formatMessage } from 'devextreme/localization';
2
2
  import { DialogBase } from './dialog-base';
3
+ import { UrlUtils } from '../../common/utils/utils';
3
4
  export class HyperlinkDialog extends DialogBase {
4
5
  constructor() {
5
6
  super(...arguments);
@@ -146,13 +147,19 @@ export class HyperlinkDialog extends DialogBase {
146
147
  parameters.text = data.text;
147
148
  parameters.tooltip = data.tooltip;
148
149
  const tabPanelSelectedIndex = this.tabPanel.option('selectedIndex');
149
- if (tabPanelSelectedIndex == 0)
150
- parameters.url = data.url;
151
- else if (tabPanelSelectedIndex == 1)
152
- parameters.anchor = data.anchor;
150
+ if (tabPanelSelectedIndex == 0) {
151
+ [parameters.url, parameters.anchor] = UrlUtils.splitUrlByAnchor(data.url);
152
+ }
153
153
  else {
154
- const subject = data.subject ? this.subjectPrefix + data.subject : '';
155
- parameters.url = this.mailtoPrefix + data.email + subject;
154
+ if (tabPanelSelectedIndex == 1) {
155
+ parameters.url = "";
156
+ parameters.anchor = data.anchor;
157
+ }
158
+ else {
159
+ const subject = data.subject ? this.subjectPrefix + data.subject : '';
160
+ parameters.url = this.mailtoPrefix + data.email + subject;
161
+ parameters.anchor = "";
162
+ }
156
163
  }
157
164
  }
158
165
  }
@@ -60,7 +60,7 @@ export class HyperlinkCollection extends Collection {
60
60
  subDocument.insertText(field.getCodeInterval().start, HyperlinkInfo.getNewCodeText(info));
61
61
  if (canChangeHyperlinkDisplayText && hyperlinkInfo.text || field.getResultInterval().length == 0) {
62
62
  subDocument.deleteText(convertToIntervalApi(field.getResultInterval()));
63
- subDocument.insertText(field.getResultInterval().start, !hyperlinkInfo.text || hyperlinkInfo.text == "" ? info.getUriPlusAnchor() : hyperlinkInfo.text);
63
+ subDocument.insertText(field.getResultInterval().start, !hyperlinkInfo.text || hyperlinkInfo.text == "" ? info.getUriWithAnchor() : hyperlinkInfo.text);
64
64
  }
65
65
  this._processor.modelManager.history.addAndRedo(new ApplyFieldHyperlinkStyleHistoryItem(this._processor.modelManager.modelManipulator, new SubDocumentInterval(this._subDocument, field.getResultInterval())));
66
66
  this._processor.modelManager.history.endTransaction();
@@ -36,8 +36,14 @@ export class DialogHyperlinkCommandBase extends ShowDialogCommandBase {
36
36
  var field = this.getState().value;
37
37
  if (field) {
38
38
  var hyperlinkInfo = field.getHyperlinkInfo();
39
- parameters.url = hyperlinkInfo.uri;
40
- parameters.anchor = hyperlinkInfo.anchor;
39
+ if (hyperlinkInfo.isUri()) {
40
+ parameters.url = hyperlinkInfo.getUriWithAnchor();
41
+ parameters.anchor = "";
42
+ }
43
+ else {
44
+ parameters.url = "";
45
+ parameters.anchor = hyperlinkInfo.anchor;
46
+ }
41
47
  parameters.tooltip = hyperlinkInfo.tip;
42
48
  parameters.text = FieldContextMenuHelper.getHyperlinkResultText(options.subDocument, field);
43
49
  }
@@ -50,7 +56,7 @@ export class DialogHyperlinkCommandBase extends ShowDialogCommandBase {
50
56
  if (newParams.tooltip == initParams.tooltip && newParams.url == initParams.url && newParams.anchor == initParams.anchor && newParams.text == initParams.text)
51
57
  return false;
52
58
  var hyperlinkInfo = new HyperlinkInfo(newParams.url, newParams.anchor, newParams.tooltip, false);
53
- if (hyperlinkInfo.anchor == "" && hyperlinkInfo.uri == "")
59
+ if (!hyperlinkInfo.isValid())
54
60
  return false;
55
61
  var modelManipulator = this.modelManipulator;
56
62
  var selection = this.selection;
@@ -72,7 +78,7 @@ export class DialogHyperlinkCommandBase extends ShowDialogCommandBase {
72
78
  }
73
79
  if (initParams.canChangeDisplayText && newParams.text != initParams.text || field.getResultInterval().length == 0) {
74
80
  selection.deprecatedSetSelection(field.getResultStartPosition(), field.getResultEndPosition(), false, selection.keepX, false, false);
75
- this.control.commandManager.getCommand(RichEditClientCommand.InsertText).execute(this.control.commandManager.isPublicApiCall, new CommandSimpleOptions(this.control, !newParams.text || newParams.text == "" ? hyperlinkInfo.getUriPlusAnchor() : newParams.text));
81
+ this.control.commandManager.getCommand(RichEditClientCommand.InsertText).execute(this.control.commandManager.isPublicApiCall, new CommandSimpleOptions(this.control, !newParams.text || newParams.text == "" ? hyperlinkInfo.getUriWithAnchor() : newParams.text));
76
82
  }
77
83
  history.addAndRedo(new ApplyFieldHyperlinkStyleHistoryItem(modelManipulator, new SubDocumentInterval(this.selection.activeSubDocument, field.getResultInterval())));
78
84
  selection.deprecatedSetSelection(field.getFieldEndPosition(), field.getFieldEndPosition(), false, selection.keepX, false, false);
@@ -25,12 +25,15 @@ export class OpenHyperlinkCommand extends HyperlinkCommandBase {
25
25
  this.history.endTransaction();
26
26
  this.aspxForceSendingRequest();
27
27
  }
28
- if (hyperlinkInfo.anchor)
28
+ if (hyperlinkInfo.isUri()) {
29
+ let uri = hyperlinkInfo.getUriWithAnchor();
30
+ if (!UrlUtils.isValid(uri))
31
+ uri = UrlUtils.EmptyPage;
32
+ Url.navigate(uri, "_blank");
33
+ }
34
+ else {
29
35
  this.control.commandManager.getCommand(RichEditClientCommand.GoToBookmark)
30
36
  .execute(this.control.commandManager.isPublicApiCall, new CommandSimpleOptions(this.control, hyperlinkInfo.anchor));
31
- else {
32
- const url = UrlUtils.isValid(hyperlinkInfo.uri) ? hyperlinkInfo.uri : UrlUtils.EmptyPage;
33
- Url.navigate(url, "_blank");
34
37
  }
35
38
  return true;
36
39
  }
@@ -29,8 +29,11 @@ export declare class HyperlinkInfo implements ICloneable<HyperlinkInfo> {
29
29
  visited: boolean;
30
30
  constructor(uri: string, anchor: string, tip: string, visited: boolean);
31
31
  clone(): HyperlinkInfo;
32
- getUriPlusAnchor(): string;
32
+ getUriWithAnchor(): string;
33
33
  static getNewCodeText(hyperlinkInfo: HyperlinkInfo): string;
34
+ isUri(): boolean;
35
+ isMail(): boolean;
36
+ isValid(): boolean;
34
37
  }
35
38
  export declare class SequenceInfo {
36
39
  identifier: string;
@@ -4,6 +4,7 @@ import { ListUtils } from '@devexpress/utils/lib/utils/list';
4
4
  import { SearchUtils } from '@devexpress/utils/lib/utils/search';
5
5
  import { FieldDeletedSubDocumentChange } from '../changes/sub-document/field/deleted';
6
6
  import { RunType } from '../runs/run-type';
7
+ import { UrlUtils } from '../../utils/utils';
7
8
  export var FieldNameType;
8
9
  (function (FieldNameType) {
9
10
  FieldNameType[FieldNameType["None"] = 0] = "None";
@@ -33,8 +34,8 @@ export class HyperlinkInfo {
33
34
  clone() {
34
35
  return new HyperlinkInfo(this.uri, this.anchor, this.tip, this.visited);
35
36
  }
36
- getUriPlusAnchor() {
37
- return this.uri + (this.anchor == "" ? "" : "#" + this.anchor);
37
+ getUriWithAnchor() {
38
+ return this.uri + (this.anchor.length > 0 ? "#" + this.anchor : "");
38
39
  }
39
40
  static getNewCodeText(hyperlinkInfo) {
40
41
  return [
@@ -45,6 +46,21 @@ export class HyperlinkInfo {
45
46
  hyperlinkInfo.anchor == "" ? "" : " \\l \"" + hyperlinkInfo.anchor + "\""
46
47
  ].join("");
47
48
  }
49
+ isUri() {
50
+ if (this.uri.length === 0)
51
+ return false;
52
+ if (this.uri.startsWith("#"))
53
+ return false;
54
+ if (this.isMail())
55
+ return false;
56
+ return UrlUtils.isValid(this.uri);
57
+ }
58
+ isMail() {
59
+ return this.uri.startsWith("mailto:");
60
+ }
61
+ isValid() {
62
+ return !!(this.uri || this.anchor);
63
+ }
48
64
  }
49
65
  export class SequenceInfo {
50
66
  constructor(identifier, repeats, hidesResult, resets, resetsWith) {
@@ -6,6 +6,7 @@ import { HyperlinkInfo } from '../field';
6
6
  import { FieldName } from '../names';
7
7
  import { FieldCodeParserState, FieldSwitchType } from './field-code-parser';
8
8
  import { FieldCodeParserClientUpdatingBase } from './field-code-parser-client-updating-base';
9
+ import { UrlUtils } from '../../../utils/utils';
9
10
  export class FieldCodeParserHyperlink extends FieldCodeParserClientUpdatingBase {
10
11
  get name() { return FieldName.Hyperlink; }
11
12
  parseCodeCurrentFieldInternal(_responce) {
@@ -17,54 +18,47 @@ export class FieldCodeParserHyperlink extends FieldCodeParserClientUpdatingBase
17
18
  return true;
18
19
  }
19
20
  fillResult() {
20
- var field = this.getTopField();
21
- var text = this.parameterInfoList[0] ? this.parameterInfoList[0].text : "";
22
- var newHyperlinkInfo = this.updateHyperlinkInfo(field, text);
21
+ var _a, _b;
22
+ const field = this.getTopField();
23
+ const text = (_b = (_a = this.parameterInfoList[0]) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : "";
24
+ const newHyperlinkInfo = this.updateHyperlinkInfo(text);
23
25
  if (!newHyperlinkInfo) {
24
- if (!this.modelManager.richOptions.fields.keepHyperlinkResultForInvalidReference)
26
+ if (!this.modelManager.richOptions.fields.keepHyperlinkResultForInvalidReference) {
25
27
  this.removeInterval(this.getTopField().getResultInterval());
28
+ }
26
29
  return true;
27
30
  }
28
- var modelManipulator = this.modelManager.modelManipulator;
29
- var resultInterval = field.getResultInterval();
30
- if (resultInterval.length == 0) {
31
- var resultText = text.length > 0 ? text : "#" + newHyperlinkInfo.anchor;
32
- var newResultInterval = new FixedInterval(resultInterval.start, resultText.length);
31
+ const modelManipulator = this.modelManager.modelManipulator;
32
+ const resultInterval = field.getResultInterval();
33
+ if (resultInterval.length === 0) {
34
+ const resultText = text !== null && text !== void 0 ? text : "#" + newHyperlinkInfo.anchor;
35
+ const newResultInterval = new FixedInterval(resultInterval.start, resultText.length);
33
36
  this.setInputPositionState();
34
37
  this.replaceTextByInterval(resultInterval, resultText);
35
- this.modelManager.history.addAndRedo(new ApplyFieldHyperlinkStyleHistoryItem(modelManipulator, new SubDocumentInterval(this.subDocument, newResultInterval)));
38
+ const subDocumentInterval = new SubDocumentInterval(this.subDocument, newResultInterval);
39
+ const historyItem = new ApplyFieldHyperlinkStyleHistoryItem(modelManipulator, subDocumentInterval);
40
+ this.modelManager.history.addAndRedo(historyItem);
36
41
  }
37
- this.modelManager.history.addAndRedo(new ChangeFieldHyperlinkInfoHistoryItem(modelManipulator, this.subDocument, field.index, newHyperlinkInfo));
42
+ const historyItem = new ChangeFieldHyperlinkInfoHistoryItem(modelManipulator, this.subDocument, field.index, newHyperlinkInfo);
43
+ this.modelManager.history.addAndRedo(historyItem);
38
44
  return true;
39
45
  }
40
- updateHyperlinkInfo(field, text) {
41
- var newHyperlinkInfo = field.isHyperlinkField() ? field.getHyperlinkInfo().clone() : new HyperlinkInfo("", "", "", false);
46
+ updateHyperlinkInfo(text) {
47
+ const newHyperlinkInfo = new HyperlinkInfo("", "", "", false);
48
+ [newHyperlinkInfo.uri, newHyperlinkInfo.anchor] = UrlUtils.splitUrlByAnchor(text);
42
49
  newHyperlinkInfo.visited = false;
43
- var tipSwitch;
44
- var bookmarkSwitch;
45
- for (var i = 0, switchInfo; switchInfo = this.switchInfoList[i]; i++)
46
- if (switchInfo.type == FieldSwitchType.FieldSpecific) {
47
- switch (switchInfo.name.toLocaleUpperCase()) {
48
- case "O":
49
- tipSwitch = switchInfo;
50
- break;
51
- case "L":
52
- bookmarkSwitch = switchInfo;
53
- break;
54
- }
50
+ for (const switchInfo of this.switchInfoList) {
51
+ if (switchInfo.type != FieldSwitchType.FieldSpecific)
52
+ continue;
53
+ switch (switchInfo.name.toLocaleUpperCase()) {
54
+ case "O":
55
+ newHyperlinkInfo.tip = switchInfo.arg;
56
+ break;
57
+ case "L":
58
+ newHyperlinkInfo.anchor = switchInfo.arg;
59
+ break;
55
60
  }
56
- newHyperlinkInfo.tip = tipSwitch ? tipSwitch.arg : "";
57
- var splitted = text.split("#");
58
- if (splitted.length == 1) {
59
- newHyperlinkInfo.uri = splitted[0];
60
- newHyperlinkInfo.anchor = bookmarkSwitch ? bookmarkSwitch.arg : "";
61
- if (newHyperlinkInfo.uri == "" && newHyperlinkInfo.anchor == "")
62
- return null;
63
- }
64
- else {
65
- newHyperlinkInfo.uri = splitted[0];
66
- newHyperlinkInfo.anchor = splitted[1];
67
61
  }
68
- return newHyperlinkInfo;
62
+ return newHyperlinkInfo.isValid() ? newHyperlinkInfo : null;
69
63
  }
70
64
  }
@@ -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);
@@ -348,6 +349,7 @@ export class RemoveIntervalOperationResult {
348
349
  this.historyRuns = [];
349
350
  this.nestingLevels = [];
350
351
  this.bookmarkItems = [];
352
+ this.rangePermssionsItems = [];
351
353
  this.cellsIterator = cellsIterator;
352
354
  }
353
355
  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
  }
@@ -14,4 +14,5 @@ export declare function splitByLines(text: string): string[];
14
14
  export declare class UrlUtils {
15
15
  static EmptyPage: string;
16
16
  static isValid(url: string): boolean;
17
+ static splitUrlByAnchor(url: string): [url: string, anchor: string];
17
18
  }
@@ -71,5 +71,11 @@ export class UrlUtils {
71
71
  catch (_a) { }
72
72
  return false;
73
73
  }
74
+ static splitUrlByAnchor(url) {
75
+ const hashTagPosition = url.indexOf("#");
76
+ if (hashTagPosition < 0)
77
+ return [url, ""];
78
+ return [url.substring(0, hashTagPosition), url.substring(hashTagPosition + 1)];
79
+ }
74
80
  }
75
81
  UrlUtils.EmptyPage = "about:blank";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "devexpress-richedit",
3
- "version": "24.1.7-build-24288-0102",
3
+ "version": "24.1.8-build-24309-0102",
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.1.7-build-24286-1936",
18
- "devextreme-dist": "24.1.7-build-24286-1936"
17
+ "devextreme": "24.1.8-build-24307-1936",
18
+ "devextreme-dist": "24.1.8-build-24307-1936"
19
19
  },
20
20
  "dependencies": {
21
21
  "jszip": "~3.10.1",