devexpress-richedit 24.1.7 → 24.1.8-build-24316-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.
- package/bin/gulpfile.js +1 -1
- package/bin/index-custom.js +1 -1
- package/bin/localization-builder.js +1 -1
- package/bin/nspell-index.js +1 -1
- package/bin/nspell.webpack.config.js +1 -1
- package/bin/webpack-externals.js +1 -1
- package/bin/webpack.config.js +1 -1
- package/dist/dx.richedit.d.ts +1 -1
- package/dist/dx.richedit.js +42 -1
- package/dist/dx.richedit.min.js +2 -2
- package/index.d.ts +1 -1
- package/index.js +1 -1
- package/lib/common/model/manipulators/document/sub-document-inserter.d.ts +1 -0
- package/lib/common/model/manipulators/document/sub-document-inserter.js +4 -0
- package/lib/common/model/manipulators/range/remove-interval-operation.d.ts +2 -0
- package/lib/common/model/manipulators/range/remove-interval-operation.js +2 -0
- package/lib/common/model/manipulators/range-permission-manipulator.d.ts +4 -0
- package/lib/common/model/manipulators/range-permission-manipulator.js +35 -0
- package/package.json +3 -3
package/index.d.ts
CHANGED
package/index.js
CHANGED
@@ -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
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "devexpress-richedit",
|
3
|
-
"version": "24.1.
|
3
|
+
"version": "24.1.8-build-24316-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.
|
18
|
-
"devextreme-dist": "24.1.
|
17
|
+
"devextreme": "24.1.8-build-24314-1936",
|
18
|
+
"devextreme-dist": "24.1.8-build-24314-1936"
|
19
19
|
},
|
20
20
|
"dependencies": {
|
21
21
|
"jszip": "~3.10.1",
|