devexpress-richedit 24.1.8-build-24316-0102 → 24.1.8-build-24340-0103
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/dist/dx.richedit.js +139 -75
- package/dist/dx.richedit.min.js +1 -1
- package/lib/client/formats/docx/export/exporters/styles.d.ts +5 -0
- package/lib/client/formats/docx/export/exporters/styles.js +30 -1
- package/lib/client/model-api/api-utils/range-permission-finder.js +3 -1
- package/lib/client/model-api/collections/drawing-object-collection.js +1 -1
- package/lib/client/model-api/collections/range-permission-collection.js +3 -2
- package/lib/common/commands/floating-objects/floating-object-drag-drop-change-position-command.js +1 -1
- package/lib/common/commands/floating-objects/insert-anchored-text-box-command.js +1 -1
- package/lib/common/formats/html/export/html-export.d.ts +1 -0
- package/lib/common/formats/html/export/html-export.js +19 -33
- package/lib/common/formats/html/import/importers/list-base.js +4 -4
- package/lib/common/formats/rtf/export/helpers/rtf-export-helper.js +3 -2
- package/lib/common/input-controller.d.ts +14 -1
- package/lib/common/input-controller.js +54 -19
- package/lib/common/layout/document-layout.js +1 -1
- package/lib/common/layout/main-structures/layout-boxes/layout-space-box.js +1 -1
- package/lib/common/model/history/items/floating-objects/insert-anchored-picture-history-item.js +1 -0
- package/lib/common/model/history/items/switch-text-box-sub-documents-state-history-item.js +0 -1
- package/lib/common/model/manipulators/range/remove-interval-operation.js +8 -2
- package/lib/common/model/manipulators/text-box-manipulator.d.ts +1 -1
- package/lib/common/model/manipulators/text-box-manipulator.js +2 -1
- package/lib/common/model/range-permissions.js +6 -4
- package/lib/common/selection/selection.js +2 -1
- package/package.json +3 -3
package/dist/dx.richedit.js
CHANGED
@@ -25415,8 +25415,8 @@ class FieldVisabilityInfo {
|
|
25415
25415
|
class RangePermission extends BookmarkBase {
|
25416
25416
|
constructor(positionManager, interval, userName, group) {
|
25417
25417
|
super(positionManager, interval);
|
25418
|
-
this.userName = userName
|
25419
|
-
this.group = group
|
25418
|
+
this.userName = userName;
|
25419
|
+
this.group = group;
|
25420
25420
|
}
|
25421
25421
|
isGranted(settings) {
|
25422
25422
|
return RangePermission.allow(this.group, RangePermission.Everyone_GROUP_NAME) ||
|
@@ -25425,7 +25425,7 @@ class RangePermission extends BookmarkBase {
|
|
25425
25425
|
RangePermission.allow(this.group, settings.authenticationGroup);
|
25426
25426
|
}
|
25427
25427
|
static allow(permissionValue, settingsValue) {
|
25428
|
-
return settingsValue != "" && permissionValue ==
|
25428
|
+
return settingsValue != "" && comparers.Comparers.stringIgnoreCase(permissionValue, settingsValue) == 0;
|
25429
25429
|
}
|
25430
25430
|
get end() { return this._interval.end - 1; }
|
25431
25431
|
get length() { return this.end - this.start; }
|
@@ -25450,7 +25450,9 @@ class RangePermission extends BookmarkBase {
|
|
25450
25450
|
return new RangePermission(positionManager, this.interval, this.userName, this.group);
|
25451
25451
|
}
|
25452
25452
|
equals(obj) {
|
25453
|
-
return super.equals(obj) && (utils_string.StringUtils.isNullOrEmpty(this.userName) ?
|
25453
|
+
return super.equals(obj) && (utils_string.StringUtils.isNullOrEmpty(this.userName) ?
|
25454
|
+
comparers.Comparers.stringIgnoreCase(obj.group, this.group) == 0 :
|
25455
|
+
comparers.Comparers.stringIgnoreCase(obj.userName, this.userName) == 0);
|
25454
25456
|
}
|
25455
25457
|
}
|
25456
25458
|
RangePermission.Everyone_GROUP_NAME = "Everyone".toLowerCase();
|
@@ -40888,6 +40890,7 @@ class InsertAnchoredTextBoxHistoryItem extends PositionBasedHistoryItem {
|
|
40888
40890
|
}
|
40889
40891
|
redo() {
|
40890
40892
|
this.modelManipulator.textBox.insertAnchoredTextBox(this.subDocPos, this.charPropsBundle, this.textBoxInfo);
|
40893
|
+
this.modelManipulator.model.subDocumentsCollection.restore(this.textBoxInfo.innerSubDocument.id);
|
40891
40894
|
}
|
40892
40895
|
undo() {
|
40893
40896
|
this.modelManipulator.range.removeIntervalWithoutHistory(this.boundSubDocument, new fixed.FixedInterval(this.position, 1), false);
|
@@ -41006,7 +41009,7 @@ class BaseTextBoxInfo {
|
|
41006
41009
|
}
|
41007
41010
|
}
|
41008
41011
|
class TextBoxManipulator extends RunsBaseManipulator {
|
41009
|
-
|
41012
|
+
insertAnchoredTextBoxViaHistory(subDocPos, charPropsBundle, textBoxInfo) {
|
41010
41013
|
this.history.addAndRedo(new InsertAnchoredTextBoxHistoryItem(this.modelManipulator, subDocPos, charPropsBundle, textBoxInfo));
|
41011
41014
|
}
|
41012
41015
|
insertAnchoredTextBox(subDocPos, charPropsBundle, textBoxInfo) {
|
@@ -41023,6 +41026,7 @@ class TextBoxManipulator extends RunsBaseManipulator {
|
|
41023
41026
|
let textBoxSubDoc = textBoxInfo.innerSubDocument ?
|
41024
41027
|
textBoxInfo.innerSubDocument :
|
41025
41028
|
this.model.createSubDocument(SubDocumentInfoType.TextBox, subDocument.id);
|
41029
|
+
textBoxInfo.innerSubDocument = textBoxSubDoc;
|
41026
41030
|
textBoxRun.subDocId = textBoxSubDoc.id;
|
41027
41031
|
subDocument.chunks[insertedRun.chunkIndex].textRuns[insertedRun.runIndex].paragraph.length++;
|
41028
41032
|
this.modelManipulator.notifyModelChanged(new AnchoredTextBoxInsertedSubDocumentChange(subDocument.id, textBoxRun.anchoredObjectID, textBoxRun.subDocId, insertPositionAtStartDocument, textBoxInfo.anchorInfo, textBoxRun.containerProperties));
|
@@ -45728,8 +45732,14 @@ class RemoveIntervalOperation {
|
|
45728
45732
|
var accumulatedInterval = new fixed.FixedInterval(this.position, 0);
|
45729
45733
|
let removedTextList = [];
|
45730
45734
|
while (iterator.moveNext()) {
|
45731
|
-
if (utils_enum/* EnumUtils */.Y.isAnyOf(iterator.currentRun.getType(), RunType.AnchoredPictureRun, RunType.AnchoredTextBoxRun))
|
45732
|
-
|
45735
|
+
if (utils_enum/* EnumUtils */.Y.isAnyOf(iterator.currentRun.getType(), RunType.AnchoredPictureRun, RunType.AnchoredTextBoxRun)) {
|
45736
|
+
const currentRun = iterator.currentRun;
|
45737
|
+
const position = iterator.currentInterval().start;
|
45738
|
+
const change = new AnchorObjectRemovedSubDocumentChange(this.subDocument.id, currentRun.anchoredObjectID, position);
|
45739
|
+
if (currentRun instanceof AnchoredTextBoxRun)
|
45740
|
+
this.modelManipulator.model.subDocumentsCollection.replace(currentRun.subDocId, subDocument.id);
|
45741
|
+
this.modelManipulator.notifyModelChanged(change);
|
45742
|
+
}
|
45733
45743
|
if (iterator.currentChunk !== subDocument.chunks[this.currentChunkIndex]) {
|
45734
45744
|
this.removeAccumulatedInterval(accumulatedInterval, this.position, 0, removedTextList);
|
45735
45745
|
this.currentChunkIndex++;
|
@@ -53435,6 +53445,7 @@ function createConditionalStylesTable() {
|
|
53435
53445
|
|
53436
53446
|
|
53437
53447
|
|
53448
|
+
|
53438
53449
|
class RtfExportHelper {
|
53439
53450
|
constructor() {
|
53440
53451
|
this.colorCollection = [];
|
@@ -53470,11 +53481,11 @@ class RtfExportHelper {
|
|
53470
53481
|
return DXColor.blend(color, DXColor.white);
|
53471
53482
|
}
|
53472
53483
|
getUserIndex(rangePermission) {
|
53473
|
-
let index = this.userCollection.
|
53484
|
+
let index = this.userCollection.findIndex((userName) => comparers.Comparers.stringIgnoreCase(userName, rangePermission.userName) == 0);
|
53474
53485
|
if (index >= 0)
|
53475
53486
|
return index + 1;
|
53476
53487
|
const predefinedUserGroups = RtfContentExporter.predefinedUserGroups;
|
53477
|
-
const id = number/* NumberMapUtils */.j.keyBy(predefinedUserGroups, (g) => g
|
53488
|
+
const id = number/* NumberMapUtils */.j.keyBy(predefinedUserGroups, (g) => comparers.Comparers.stringIgnoreCase(g, rangePermission.group) == 0);
|
53478
53489
|
return id != null ? id : 0;
|
53479
53490
|
}
|
53480
53491
|
}
|
@@ -68715,9 +68726,7 @@ class HtmlListTagImporterBase extends HtmlTagImporterBase {
|
|
68715
68726
|
this.importer.addCurrLevelParagraphRunIfNeeded();
|
68716
68727
|
const listIndex = this.importer.listIndex;
|
68717
68728
|
const parentList = utils_list.ListUtils.last(this.importer.listInfos);
|
68718
|
-
const listLevel = parentList
|
68719
|
-
? parentList.listLevel + 1
|
68720
|
-
: 0;
|
68729
|
+
const listLevel = parentList ? parentList.listLevel + 1 : 0;
|
68721
68730
|
if (listLevel === 9) {
|
68722
68731
|
this._ignored = true;
|
68723
68732
|
return;
|
@@ -68733,7 +68742,9 @@ class HtmlListTagImporterBase extends HtmlTagImporterBase {
|
|
68733
68742
|
if (this._ignored)
|
68734
68743
|
return;
|
68735
68744
|
this.importer.listInfos.pop();
|
68736
|
-
this.importer.
|
68745
|
+
const parentList = utils_list.ListUtils.last(this.importer.listInfos);
|
68746
|
+
if (!parentList)
|
68747
|
+
this.importer.listIndex++;
|
68737
68748
|
}
|
68738
68749
|
}
|
68739
68750
|
|
@@ -70449,6 +70460,7 @@ class HtmlBuilder {
|
|
70449
70460
|
|
70450
70461
|
|
70451
70462
|
|
70463
|
+
|
70452
70464
|
|
70453
70465
|
|
70454
70466
|
class HtmlExporter {
|
@@ -70882,42 +70894,27 @@ class HtmlExporter {
|
|
70882
70894
|
}
|
70883
70895
|
getListsByParagraphs(paragraphs) {
|
70884
70896
|
const listsInInterval = [];
|
70897
|
+
let previousList = null;
|
70885
70898
|
for (let i = 0, paragraph; paragraph = paragraphs[i]; i++) {
|
70886
70899
|
if (paragraph.isInList()) {
|
70887
|
-
const
|
70888
|
-
const
|
70889
|
-
const
|
70890
|
-
const
|
70891
|
-
let
|
70892
|
-
|
70893
|
-
|
70894
|
-
&&
|
70895
|
-
|
70896
|
-
|
70897
|
-
|
70898
|
-
|
70899
|
-
|
70900
|
-
existingItem.end = paragraphEnd;
|
70901
|
-
}
|
70902
|
-
else {
|
70903
|
-
listsInInterval.push({
|
70904
|
-
numberingListIndex: paragraphNumberingListIndex,
|
70905
|
-
listLevelIndex: paragraphListLevelIndex,
|
70906
|
-
start: paragraphStart,
|
70907
|
-
end: paragraphEnd,
|
70908
|
-
});
|
70909
|
-
}
|
70910
|
-
let listLevelIndex = paragraphListLevelIndex;
|
70911
|
-
while (listLevelIndex > 0) {
|
70912
|
-
let parentItem = null;
|
70913
|
-
for (let j = 0; j < listsInInterval.length; j++) {
|
70914
|
-
if (listsInInterval[j].listLevelIndex == listLevelIndex - 1)
|
70915
|
-
parentItem = listsInInterval[j];
|
70916
|
-
}
|
70917
|
-
if (parentItem)
|
70918
|
-
parentItem.end = paragraphEnd;
|
70919
|
-
listLevelIndex--;
|
70900
|
+
const numberingListIndex = paragraph.getNumberingListIndex();
|
70901
|
+
const listLevelIndex = paragraph.getListLevelIndex();
|
70902
|
+
const start = paragraph.startLogPosition.value;
|
70903
|
+
const end = paragraph.getEndPosition();
|
70904
|
+
let list = utils_list.ListUtils.reverseElementBy(listsInInterval, (list) => {
|
70905
|
+
return list.listLevelIndex <= (previousList === null || previousList === void 0 ? void 0 : previousList.listLevelIndex)
|
70906
|
+
&& list.numberingListIndex === numberingListIndex
|
70907
|
+
&& list.listLevelIndex === listLevelIndex;
|
70908
|
+
});
|
70909
|
+
if (!list) {
|
70910
|
+
const parentList = (previousList === null || previousList === void 0 ? void 0 : previousList.numberingListIndex) === numberingListIndex ? previousList : null;
|
70911
|
+
list = { parentList, numberingListIndex, listLevelIndex, start, end };
|
70912
|
+
listsInInterval.push(list);
|
70920
70913
|
}
|
70914
|
+
previousList = list;
|
70915
|
+
do {
|
70916
|
+
list.end = end;
|
70917
|
+
} while (list = list.parentList);
|
70921
70918
|
}
|
70922
70919
|
}
|
70923
70920
|
return listsInInterval;
|
@@ -72142,6 +72139,7 @@ class DeleteRangePermissionHistoryItem extends RangePermissionHistoryItemBase {
|
|
72142
72139
|
;// CONCATENATED MODULE: ./src/client/model-api/api-utils/range-permission-finder.ts
|
72143
72140
|
|
72144
72141
|
|
72142
|
+
|
72145
72143
|
function findRangePermissionsByIntervals(sourceCollection, intervals) {
|
72146
72144
|
const permissions = [];
|
72147
72145
|
algorithms.IntervalAlgorithms.handleAffectedObjects(sourceCollection, algorithms.IntervalAlgorithms.getMergedIntervals(intervals, true), (permission, _index, interval, intersection) => {
|
@@ -72161,7 +72159,8 @@ function findRangePermissions(sourceCollection, check) {
|
|
72161
72159
|
}
|
72162
72160
|
function findRangePermission(sourceCollection, coreInterval, userName, group) {
|
72163
72161
|
const intervals = findRangePermissionsByIntervals(sourceCollection, [coreInterval]);
|
72164
|
-
return utils_list.ListUtils.elementBy(intervals, (permission) => permission.userName ==
|
72162
|
+
return utils_list.ListUtils.elementBy(intervals, (permission) => comparers.Comparers.stringIgnoreCase(permission.userName, userName) == 0 &&
|
72163
|
+
comparers.Comparers.stringIgnoreCase(permission.group, group) == 0);
|
72165
72164
|
}
|
72166
72165
|
|
72167
72166
|
;// CONCATENATED MODULE: ./src/client/model-api/range-permission.ts
|
@@ -72204,6 +72203,7 @@ class RangePermissionApi {
|
|
72204
72203
|
|
72205
72204
|
|
72206
72205
|
|
72206
|
+
|
72207
72207
|
class RangePermissionCollection extends Collection {
|
72208
72208
|
constructor(processor, subDocument) {
|
72209
72209
|
super(processor);
|
@@ -72275,13 +72275,13 @@ function findByPosition(position, canBeUndefined, sourceCollection) {
|
|
72275
72275
|
}
|
72276
72276
|
function findByUserName(value, permissions) {
|
72277
72277
|
return utils_list.ListUtils.map(ApiParametersChecker.check(value, 1, true, [
|
72278
|
-
ApiParametersChecker.stringDescriptor("userName", (userName) => findRangePermissions(permissions, permission => permission.userName ==
|
72278
|
+
ApiParametersChecker.stringDescriptor("userName", (userName) => findRangePermissions(permissions, permission => comparers.Comparers.stringIgnoreCase(permission.userName, userName) == 0), false),
|
72279
72279
|
ApiParametersChecker.regExpDescriptor('regexp', (regexp) => findRangePermissions(permissions, permission => regexp.test(permission.userName)))
|
72280
72280
|
]), (b) => b);
|
72281
72281
|
}
|
72282
72282
|
function findByGroup(value, permissions) {
|
72283
72283
|
return utils_list.ListUtils.map(ApiParametersChecker.check(value, 1, true, [
|
72284
|
-
ApiParametersChecker.stringDescriptor("group", (group) => findRangePermissions(permissions, permission => permission.group ==
|
72284
|
+
ApiParametersChecker.stringDescriptor("group", (group) => findRangePermissions(permissions, permission => comparers.Comparers.stringIgnoreCase(permission.group, group) == 0), false),
|
72285
72285
|
ApiParametersChecker.regExpDescriptor('regexp', (regexp) => findRangePermissions(permissions, permission => regexp.test(permission.group)))
|
72286
72286
|
]), (b) => b);
|
72287
72287
|
}
|
@@ -72821,8 +72821,9 @@ class Selection extends batch_updatable/* BatchUpdatableObject */.IS {
|
|
72821
72821
|
this.resetInputPositionIfNeeded();
|
72822
72822
|
}
|
72823
72823
|
shouldResetInputPosition() {
|
72824
|
+
var _a;
|
72824
72825
|
const currentState = this.getState();
|
72825
|
-
return currentState.intervalsInfo.subDocument.id != this.prevState.intervalsInfo.subDocument.id ||
|
72826
|
+
return currentState.intervalsInfo.subDocument.id != ((_a = this.prevState.intervalsInfo.subDocument) === null || _a === void 0 ? void 0 : _a.id) ||
|
72826
72827
|
!utils_list.ListUtils.equals(currentState.intervalsInfo.intervals, this.prevState.intervalsInfo.intervals);
|
72827
72828
|
}
|
72828
72829
|
resetInputPositionIfNeeded() {
|
@@ -72860,7 +72861,7 @@ class AnchorObjectsPositionInfo {
|
|
72860
72861
|
}
|
72861
72862
|
add(obj, modelPosition) {
|
72862
72863
|
this.delete(obj.objectId);
|
72863
|
-
this.cache[obj.objectId] = new ModelPositionHolder(modelPosition, this.model.
|
72864
|
+
this.cache[obj.objectId] = new ModelPositionHolder(modelPosition, this.model.subDocumentsCollection.collection[obj.belongsToSubDocId].positionManager);
|
72864
72865
|
}
|
72865
72866
|
delete(id) {
|
72866
72867
|
const info = this.cache[id];
|
@@ -91971,13 +91972,20 @@ class ContentTypesExporter extends ExporterBaseWithRootElement {
|
|
91971
91972
|
|
91972
91973
|
|
91973
91974
|
class StylesExporter extends ExporterBaseWithRootElement {
|
91975
|
+
constructor() {
|
91976
|
+
super(...arguments);
|
91977
|
+
this.styleNameToIndex = new Map();
|
91978
|
+
this.sortedStyleIndexes = [];
|
91979
|
+
this.processedStyleNames = new Set();
|
91980
|
+
}
|
91974
91981
|
get filePath() { return 'word/styles.xml'; }
|
91975
91982
|
get rootElement() { return 'styles'; }
|
91976
91983
|
get rootNSPrefix() { return this.data.constants.namespaces[DocxNsType.WordProcessing].prefix; }
|
91977
91984
|
get rootNSValue() { return this.data.constants.namespaces[DocxNsType.WordProcessing].namespace; }
|
91978
91985
|
fillWriter() {
|
91979
91986
|
this.exportDocumentDefaults();
|
91980
|
-
|
91987
|
+
const paragraphStyleIndexes = this.getSortedStyleIndexes();
|
91988
|
+
utils_list.ListUtils.forEach(paragraphStyleIndexes, (index) => this.data.parStyleExporter.export(this.data.model.paragraphStyles[index], index));
|
91981
91989
|
utils_list.ListUtils.forEach(this.data.model.characterStyles, (style, index) => this.data.charStyleExporter.export(style, index));
|
91982
91990
|
utils_list.ListUtils.forEach(this.data.model.tableStyles, (style, index) => this.data.tblStyleExporter.export(style, index));
|
91983
91991
|
}
|
@@ -92001,6 +92009,28 @@ class StylesExporter extends ExporterBaseWithRootElement {
|
|
92001
92009
|
this.writer.endElement();
|
92002
92010
|
this.writer.endElement();
|
92003
92011
|
}
|
92012
|
+
getSortedStyleIndexes() {
|
92013
|
+
this.styleNameToIndex = new Map();
|
92014
|
+
this.sortedStyleIndexes = [];
|
92015
|
+
this.processedStyleNames = new Set();
|
92016
|
+
const styles = this.data.model.paragraphStyles;
|
92017
|
+
styles.forEach((style, index) => this.styleNameToIndex.set(style.styleName, index));
|
92018
|
+
for (let index = 0; index < styles.length; index++)
|
92019
|
+
this.sortStyleIndexRecursive(index);
|
92020
|
+
return this.sortedStyleIndexes;
|
92021
|
+
}
|
92022
|
+
sortStyleIndexRecursive(index) {
|
92023
|
+
const styles = this.data.model.paragraphStyles;
|
92024
|
+
const style = styles[index];
|
92025
|
+
if (this.processedStyleNames.has(style.styleName))
|
92026
|
+
return;
|
92027
|
+
this.processedStyleNames.add(style.styleName);
|
92028
|
+
if (style.parent) {
|
92029
|
+
const parentIndex = this.styleNameToIndex.get(style.parent.styleName);
|
92030
|
+
this.sortStyleIndexRecursive(parentIndex);
|
92031
|
+
}
|
92032
|
+
this.sortedStyleIndexes.push(index);
|
92033
|
+
}
|
92004
92034
|
}
|
92005
92035
|
|
92006
92036
|
;// CONCATENATED MODULE: ./src/common/utils/relative-rect.ts
|
@@ -95959,7 +95989,7 @@ class LayoutSpaceBox extends layout_box_LayoutBox {
|
|
95959
95989
|
return LayoutBoxType.Space;
|
95960
95990
|
}
|
95961
95991
|
pushInfoForMeasure(info, showHiddenSymbols) {
|
95962
|
-
info.push(new MeasureInfoNonText(
|
95992
|
+
info.push(new MeasureInfoNonText(RichUtils.specialCharacters.Space, this.characterProperties));
|
95963
95993
|
if (showHiddenSymbols)
|
95964
95994
|
info.push(new MeasureInfoNonText(RichUtils.specialCharacters.HiddenSpace, this.characterProperties));
|
95965
95995
|
}
|
@@ -107501,7 +107531,6 @@ class SwitchTextBoxSubDocumentsStateHistoryItem extends history_item_HistoryItem
|
|
107501
107531
|
this.position = position;
|
107502
107532
|
}
|
107503
107533
|
redo() {
|
107504
|
-
this.oldSubDocument = this.oldSubDocument.getActualSubDocument();
|
107505
107534
|
const newRun = this.textBoxParentSubDocument.getRunAndIndexesByPosition(this.position).run;
|
107506
107535
|
this.newSubDocument = this.modelManipulator.model.subDocuments[newRun.subDocId];
|
107507
107536
|
this.modelManipulator.model.subDocumentsCollection.replace(this.oldSubDocument.id, this.newSubDocument.id);
|
@@ -107720,7 +107749,7 @@ class FloatingObjectDragDropChangePositionCommand extends CommandBase {
|
|
107720
107749
|
const newRun = this.activeSubDocument.getRunAndIndexesByPosition(position).run;
|
107721
107750
|
if (newRun.getType() == RunType.AnchoredTextBoxRun) {
|
107722
107751
|
const oldTextBoxRun = oldRun;
|
107723
|
-
const originalSubDocument = this.control.modelManager.model.
|
107752
|
+
const originalSubDocument = this.control.modelManager.model.subDocumentsCollection.collection[oldTextBoxRun.subDocId];
|
107724
107753
|
this.history.addAndRedo(new SwitchTextBoxSubDocumentsStateHistoryItem(this.modelManipulator, originalSubDocument, this.activeSubDocument, position));
|
107725
107754
|
}
|
107726
107755
|
}
|
@@ -112656,9 +112685,16 @@ const INPUT_CLASS_NAME = "dxreInputTarget";
|
|
112656
112685
|
const EMPTY_KEYCODE = 229;
|
112657
112686
|
const TAB_KEYCODE = 9;
|
112658
112687
|
const IDEOGRAPHIC_SPACE_CHARCODE = 12288;
|
112688
|
+
var IMEState;
|
112689
|
+
(function (IMEState) {
|
112690
|
+
IMEState[IMEState["None"] = 0] = "None";
|
112691
|
+
IMEState[IMEState["Start"] = 1] = "Start";
|
112692
|
+
IMEState[IMEState["Process"] = 2] = "Process";
|
112693
|
+
})(IMEState || (IMEState = {}));
|
112659
112694
|
class InputEditorBase {
|
112660
112695
|
constructor(control, eventManager, parent) {
|
112661
112696
|
this.newLineRegexp = /(\r\n|\n|\r)/gm;
|
112697
|
+
this.IMEState = IMEState.None;
|
112662
112698
|
this.processTextOnKeyPress = false;
|
112663
112699
|
this.evtHandlersHolder = new event_handlers_holder/* DomEventHandlersHolder */.$();
|
112664
112700
|
this.control = control;
|
@@ -112666,7 +112702,6 @@ class InputEditorBase {
|
|
112666
112702
|
this.canInsertTextOnInputEvent = this.canUseInputEvent();
|
112667
112703
|
this.createHierarchy(parent);
|
112668
112704
|
this.initialize();
|
112669
|
-
this.isIME = false;
|
112670
112705
|
this.inputWithAlt = false;
|
112671
112706
|
}
|
112672
112707
|
dispose() {
|
@@ -112739,7 +112774,7 @@ class InputEditorBase {
|
|
112739
112774
|
}
|
112740
112775
|
onKeyDown(evt) {
|
112741
112776
|
if (!this.control.clientSideEvents.raiseKeyDown(evt)) {
|
112742
|
-
if (
|
112777
|
+
if (this.IMEState === IMEState.None) {
|
112743
112778
|
evt = this.getNormalizedEvent(evt);
|
112744
112779
|
const keyCode = key/* KeyUtils */.LN.getEventKeyCode(evt);
|
112745
112780
|
this.needProcessShortcut = !keyCode || keyCode == EMPTY_KEYCODE;
|
@@ -112904,6 +112939,9 @@ class DivInputEditor extends InputEditorBase {
|
|
112904
112939
|
dispose() {
|
112905
112940
|
super.dispose();
|
112906
112941
|
clearTimeout(this.clearInputTimerId);
|
112942
|
+
clearTimeout(this.composUpdateTimerId);
|
112943
|
+
clearTimeout(this.composEndTimerId);
|
112944
|
+
clearTimeout(this.onTextInputTimerId);
|
112907
112945
|
}
|
112908
112946
|
initializeIfNotReadOnlyCore() {
|
112909
112947
|
this.inputElement.contentEditable = "true";
|
@@ -112914,14 +112952,21 @@ class DivInputEditor extends InputEditorBase {
|
|
112914
112952
|
}
|
112915
112953
|
createInputElement() {
|
112916
112954
|
const element = document.createElement("DIV");
|
112917
|
-
|
112918
|
-
element.autocapitalize = "off";
|
112955
|
+
element.autocapitalize = "off";
|
112919
112956
|
if (browser.Browser.MacOSMobilePlatform && (Number(browser.Browser.PlaformMajorVersion) >= 16
|
112920
112957
|
|| browser.Browser.Safari && browser.Browser.MajorVersion >= 16)) {
|
112921
112958
|
element.classList.add('dxreiOS16');
|
112922
112959
|
}
|
112923
112960
|
return element;
|
112924
112961
|
}
|
112962
|
+
initEvents() {
|
112963
|
+
super.initEvents();
|
112964
|
+
this.evtHandlersHolder.addListener(this.getEditableDocument(), "compositionstart", this.onCompositionStart.bind(this));
|
112965
|
+
this.evtHandlersHolder.addListener(this.getEditableDocument(), "compositionupdate", (evt) => browser.Browser.IE || browser.Browser.Edge ?
|
112966
|
+
this.onCompositionUpdate(evt) : this.composUpdateTimerId = setTimeout(() => this.onCompositionUpdate(evt), 0));
|
112967
|
+
this.evtHandlersHolder.addListener(this.getEditableDocument(), "compositionend", (evt) => !browser.Browser.Safari ?
|
112968
|
+
this.onCompositionEnd(evt) : this.composEndTimerId = setTimeout(() => this.onCompositionEnd(evt), 0));
|
112969
|
+
}
|
112925
112970
|
onKeyDown(evt) {
|
112926
112971
|
var _a;
|
112927
112972
|
this.handled = false;
|
@@ -112990,21 +113035,15 @@ class DivInputEditor extends InputEditorBase {
|
|
112990
113035
|
this.onTextReplace(text.substr(lastWordStartIndex), text);
|
112991
113036
|
else
|
112992
113037
|
super.onTextInput(data);
|
112993
|
-
if (this.previousText && text.length < this.previousText.length || !text.length) {
|
112994
|
-
let deletedCharacterCount = this.previousText ? this.previousText.length - text.length : 1;
|
112995
|
-
for (let i = 0; i < deletedCharacterCount; i++)
|
112996
|
-
this.eventManager.onShortcut(key/* KeyCode */.VD.Backspace);
|
112997
|
-
this.previousText = text;
|
112998
|
-
}
|
112999
113038
|
this.cursorWasSetOnLastPosition = true;
|
113000
113039
|
}
|
113001
113040
|
this.handled = true;
|
113002
|
-
if (
|
113041
|
+
if (text[text.length - 1] == " ")
|
113003
113042
|
this.clearInputElement();
|
113004
113043
|
}
|
113005
113044
|
}
|
113006
113045
|
tryHandleShortcutByInputString(data) {
|
113007
|
-
if (data &&
|
113046
|
+
if (data && this.IMEState === IMEState.None) {
|
113008
113047
|
let enteredChar = data.charAt(data.length - 1);
|
113009
113048
|
const keyCode = this.tryObtainCodeFromChar(enteredChar);
|
113010
113049
|
if (keyCode != EMPTY_KEYCODE) {
|
@@ -113095,6 +113134,31 @@ class DivInputEditor extends InputEditorBase {
|
|
113095
113134
|
selection.selectAllChildren(this.inputElement);
|
113096
113135
|
super.selectEditableDocumentContent();
|
113097
113136
|
}
|
113137
|
+
onCompositionStart(_evt) {
|
113138
|
+
this.IMEState = IMEState.Start;
|
113139
|
+
this.needProcessShortcut = false;
|
113140
|
+
this.clearInputElement();
|
113141
|
+
}
|
113142
|
+
onCompositionUpdate(_evt) {
|
113143
|
+
const text = this.getEditableDocumentText();
|
113144
|
+
if (text.length && this.previousText != text) {
|
113145
|
+
if (this.IMEState === IMEState.Start)
|
113146
|
+
this.onText(text, text, this.previousText.length > 0);
|
113147
|
+
else if (this.IMEState === IMEState.Process)
|
113148
|
+
this.onTextReplace(text, text);
|
113149
|
+
}
|
113150
|
+
this.IMEState = IMEState.Process;
|
113151
|
+
}
|
113152
|
+
onCompositionEnd(_evt) {
|
113153
|
+
const text = this.getEditableDocumentText();
|
113154
|
+
if (this.previousText != text) {
|
113155
|
+
if (text.length > 0)
|
113156
|
+
this.onTextReplace(text, text);
|
113157
|
+
else
|
113158
|
+
this.onShortcutCore(_evt, key/* KeyCode */.VD.Backspace);
|
113159
|
+
}
|
113160
|
+
this.IMEState = IMEState.None;
|
113161
|
+
}
|
113098
113162
|
}
|
113099
113163
|
class IFrameInputEditor extends InputEditorBase {
|
113100
113164
|
constructor(control, eventManager, parent) {
|
@@ -113198,7 +113262,7 @@ class IFrameInputEditor extends InputEditorBase {
|
|
113198
113262
|
}
|
113199
113263
|
setEditableDocumentContent(content) {
|
113200
113264
|
super.setEditableDocumentContent(content);
|
113201
|
-
this.
|
113265
|
+
this.IMEState = IMEState.None;
|
113202
113266
|
this.editableDocument.body.innerHTML = "";
|
113203
113267
|
if (typeof content === "string")
|
113204
113268
|
this.editableDocument.body.innerHTML = content;
|
@@ -113246,7 +113310,7 @@ class IFrameInputEditor extends InputEditorBase {
|
|
113246
113310
|
}
|
113247
113311
|
onBlur(evt) {
|
113248
113312
|
super.onBlur(evt);
|
113249
|
-
this.
|
113313
|
+
this.IMEState = IMEState.None;
|
113250
113314
|
this.endInputIME();
|
113251
113315
|
}
|
113252
113316
|
onShortcutCore(evt, shortcutCode) {
|
@@ -113275,7 +113339,7 @@ class IFrameInputEditor extends InputEditorBase {
|
|
113275
113339
|
}
|
113276
113340
|
}
|
113277
113341
|
onCompositionStart(_evt) {
|
113278
|
-
this.
|
113342
|
+
this.IMEState = IMEState.Start;
|
113279
113343
|
this.needProcessShortcut = false;
|
113280
113344
|
if (!browser.Browser.IE && !browser.Browser.Edge)
|
113281
113345
|
this.clearInputElement();
|
@@ -113283,10 +113347,11 @@ class IFrameInputEditor extends InputEditorBase {
|
|
113283
113347
|
}
|
113284
113348
|
onCompositionUpdate(_evt) {
|
113285
113349
|
const text = this.getEditableDocumentText();
|
113286
|
-
if (this.
|
113350
|
+
if (this.IMEState !== IMEState.None && text.length && this.previousText != text) {
|
113287
113351
|
this.onTextReplace(text, text);
|
113288
113352
|
this.updateInputIME();
|
113289
113353
|
}
|
113354
|
+
this.IMEState = IMEState.Process;
|
113290
113355
|
}
|
113291
113356
|
onCompositionEnd(_evt) {
|
113292
113357
|
const text = this.getEditableDocumentText();
|
@@ -113296,7 +113361,7 @@ class IFrameInputEditor extends InputEditorBase {
|
|
113296
113361
|
this.clearInputElement();
|
113297
113362
|
if (text.charCodeAt(text.length - 1) == IDEOGRAPHIC_SPACE_CHARCODE)
|
113298
113363
|
this.clearInputElement();
|
113299
|
-
this.
|
113364
|
+
this.IMEState = IMEState.None;
|
113300
113365
|
this.endInputIME();
|
113301
113366
|
}
|
113302
113367
|
startInputIME() {
|
@@ -113430,9 +113495,8 @@ class InputController {
|
|
113430
113495
|
if (typeof html === 'string')
|
113431
113496
|
el.innerHTML = html;
|
113432
113497
|
});
|
113433
|
-
if (typeof html !== "string")
|
113498
|
+
if (typeof html !== "string")
|
113434
113499
|
builder.assignFrom(html);
|
113435
|
-
}
|
113436
113500
|
builder.endChild('b');
|
113437
113501
|
builder.endChild('span');
|
113438
113502
|
builder.endChild('a');
|
@@ -131045,7 +131109,7 @@ class InsertAnchoredTextBoxCommand extends CommandBase {
|
|
131045
131109
|
anchorInfo.zOrder = this.modelManipulator.floatingObject.zOrder.getNewZOrder(options.subDocument);
|
131046
131110
|
anchorInfo.layoutTableCell = true;
|
131047
131111
|
history.addTransaction(() => {
|
131048
|
-
this.modelManipulator.textBox.
|
131112
|
+
this.modelManipulator.textBox.insertAnchoredTextBoxViaHistory(new SubDocumentPosition(this.selection.activeSubDocument, this.selection.lastSelectedInterval.start), this.inputPosition.charPropsBundle, new BaseTextBoxInfo(null, size, new Shape(utils_color/* ColorUtils */.i.fromString(utils_color/* ColorUtils */.i.colorNames.white), ColorHelper.BLACK_COLOR, unit_converter/* UnitConverter */.u.pointsToTwips(3.0 / 4)), anchorInfo, textBoxProperties, new NonVisualDrawingObjectInfo()));
|
131049
131113
|
this.history.addAndRedo(new SelectionHistoryItem(this.modelManipulator, this.selection, this.selection.getState(), this.selection.getState().setInterval(new fixed.FixedInterval(this.selection.lastSelectedInterval.start, 1))));
|
131050
131114
|
this.control.commandManager.getCommand(RichEditClientCommand.ChangeActiveSubDocumentToTextBox)
|
131051
131115
|
.execute(this.control.commandManager.isPublicApiCall, options);
|