@talrace/ngx-noder 19.0.38 → 19.0.39
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/fesm2022/talrace-ngx-noder.mjs +347 -315
- package/fesm2022/talrace-ngx-noder.mjs.map +1 -1
- package/lib/editor/content/display-data/display-data.d.ts +1 -1
- package/lib/editor/display/layers/highlight.layer.d.ts +2 -1
- package/lib/editor/display/renderer.d.ts +1 -8
- package/lib/editor/display/virtual.renderer.d.ts +1 -2
- package/lib/editor/execution/edit.session.d.ts +2 -3
- package/lib/editor/execution/editor.d.ts +4 -3
- package/lib/editor/execution/regulator.service.d.ts +1 -4
- package/lib/editor/gadgets/history/operation-history.d.ts +2 -2
- package/lib/editor/gadgets/numbering/numbering.helper.d.ts +7 -2
- package/lib/editor/interaction/editor.service.d.ts +3 -2
- package/lib/editor/operations/helpers/paragraph-operations.helper.d.ts +3 -2
- package/lib/editor/operations/operations-helper.helper.d.ts +4 -4
- package/lib/editor/operations/save-commands.helper.d.ts +2 -2
- package/lib/editor/positioning/position.helper.d.ts +20 -36
- package/lib/editor/positioning/range.d.ts +1 -7
- package/lib/models/generated/apply-paragraph-style.model.d.ts +2 -2
- package/lib/models/generated/paragraph-style-ext.model.d.ts +8 -0
- package/lib/models/generated/remove-with-paragraph.model.d.ts +2 -2
- package/lib/models/generated/restore-with-paragraph.model.d.ts +2 -2
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/lib/editor/content/display-data/paragraph-info.interface.d.ts +0 -7
|
@@ -1450,6 +1450,8 @@ class BaseCommentComponent {
|
|
|
1450
1450
|
constructor(elementRef, editorService) {
|
|
1451
1451
|
this.elementRef = elementRef;
|
|
1452
1452
|
this.editorService = editorService;
|
|
1453
|
+
this.editing = false;
|
|
1454
|
+
this.isNew = false;
|
|
1453
1455
|
this.resizeObserver = new ResizeObserver(entries => {
|
|
1454
1456
|
const height = entries[0].borderBoxSize[0].blockSize;
|
|
1455
1457
|
if (!height || this.height === height) {
|
|
@@ -1693,11 +1695,20 @@ class ApplyParagraphsModel {
|
|
|
1693
1695
|
}
|
|
1694
1696
|
}
|
|
1695
1697
|
|
|
1698
|
+
class ParagraphStyleExtModel extends ParagraphStyleModel {
|
|
1699
|
+
constructor(fields) {
|
|
1700
|
+
super(fields);
|
|
1701
|
+
if (fields) {
|
|
1702
|
+
Object.assign(this, fields);
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1696
1707
|
class ApplyParagraphStyleModel {
|
|
1697
1708
|
constructor(fields) {
|
|
1698
1709
|
if (fields) {
|
|
1699
1710
|
if (fields.paragraphStyle) {
|
|
1700
|
-
fields.paragraphStyle = new
|
|
1711
|
+
fields.paragraphStyle = new ParagraphStyleExtModel(fields.paragraphStyle);
|
|
1701
1712
|
}
|
|
1702
1713
|
Object.assign(this, fields);
|
|
1703
1714
|
}
|
|
@@ -2199,9 +2210,9 @@ class InputHandler extends BaseHandler {
|
|
|
2199
2210
|
this.actionsWithScroll['Ctrl-Alt-Backspace'] = () => editor.removeWordLeft();
|
|
2200
2211
|
this.actionsWithScroll['Ctrl-Delete'] = () => editor.removeWordRight();
|
|
2201
2212
|
this.actionsWithScroll['Ctrl-Alt-Delete'] = () => editor.removeWordRight();
|
|
2202
|
-
this.actionsWithScroll['Ctrl-KeyL'] = () => editor.applyParagraphStyles(new
|
|
2203
|
-
this.actionsWithScroll['Ctrl-KeyE'] = () => editor.applyParagraphStyles(new
|
|
2204
|
-
this.actionsWithScroll['Ctrl-KeyR'] = () => editor.applyParagraphStyles(new
|
|
2213
|
+
this.actionsWithScroll['Ctrl-KeyL'] = () => editor.applyParagraphStyles(new ParagraphStyleExtModel({ alignment: Alignment$1.left }));
|
|
2214
|
+
this.actionsWithScroll['Ctrl-KeyE'] = () => editor.applyParagraphStyles(new ParagraphStyleExtModel({ alignment: Alignment$1.center }));
|
|
2215
|
+
this.actionsWithScroll['Ctrl-KeyR'] = () => editor.applyParagraphStyles(new ParagraphStyleExtModel({ alignment: Alignment$1.right }));
|
|
2205
2216
|
this.actionsWithScroll['Ctrl-KeyB'] = () => editor.applyTextStyleBold();
|
|
2206
2217
|
this.actionsWithScroll['Ctrl-KeyI'] = () => editor.applyTextStyleItalic();
|
|
2207
2218
|
this.actionsWithScroll['Ctrl-KeyU'] = () => editor.applyTextStyleUnderline();
|
|
@@ -4742,10 +4753,10 @@ class ParagraphOperationsHelper {
|
|
|
4742
4753
|
target.alignment = value.alignment ?? target.alignment;
|
|
4743
4754
|
target.backgroundColor = value.backgroundColor ?? target.backgroundColor;
|
|
4744
4755
|
target.headingStyleId = value.headingStyleId ?? target.headingStyleId;
|
|
4745
|
-
target.indentFirstLine = value.indentFirstLine
|
|
4746
|
-
target.indentHanging = value.indentHanging
|
|
4747
|
-
target.indentLeft = value.indentLeft
|
|
4748
|
-
target.indentRight = value.indentRight
|
|
4756
|
+
target.indentFirstLine = value.hasIndentFirstLine ? value.indentFirstLine : target.indentFirstLine;
|
|
4757
|
+
target.indentHanging = value.hasIndentHanging ? value.indentHanging : target.indentHanging;
|
|
4758
|
+
target.indentLeft = value.hasIndentLeft ? value.indentLeft : target.indentLeft;
|
|
4759
|
+
target.indentRight = value.hasIndentRight ? value.indentRight : target.indentRight;
|
|
4749
4760
|
target.lineSpacing = value.lineSpacing ?? target.lineSpacing;
|
|
4750
4761
|
target.numberingId = value.numberingId ?? target.numberingId;
|
|
4751
4762
|
target.numberingLevel = value.numberingLevel ?? target.numberingLevel;
|
|
@@ -6022,6 +6033,21 @@ class NumberingParagraphStyleModel extends ParagraphStyleModel {
|
|
|
6022
6033
|
}
|
|
6023
6034
|
|
|
6024
6035
|
class NumberingHelper {
|
|
6036
|
+
static { this.romanMap = new Map([
|
|
6037
|
+
[1000, 'm'],
|
|
6038
|
+
[900, 'cm'],
|
|
6039
|
+
[500, 'd'],
|
|
6040
|
+
[400, 'cd'],
|
|
6041
|
+
[100, 'c'],
|
|
6042
|
+
[90, 'xc'],
|
|
6043
|
+
[50, 'l'],
|
|
6044
|
+
[40, 'xl'],
|
|
6045
|
+
[10, 'x'],
|
|
6046
|
+
[9, 'ix'],
|
|
6047
|
+
[5, 'v'],
|
|
6048
|
+
[4, 'iv'],
|
|
6049
|
+
[1, 'i']
|
|
6050
|
+
]); }
|
|
6025
6051
|
static addValueToNumberingInfo(numberingId, numberingInfo, numberingLevels) {
|
|
6026
6052
|
if (numberingInfo[numberingId]) {
|
|
6027
6053
|
return;
|
|
@@ -6092,13 +6118,13 @@ class NumberingHelper {
|
|
|
6092
6118
|
}
|
|
6093
6119
|
}
|
|
6094
6120
|
static getMarker(levelModels, level, numberingId, numberingInfo) {
|
|
6095
|
-
let
|
|
6096
|
-
let index =
|
|
6121
|
+
let levelModel = levelModels[level];
|
|
6122
|
+
let index = levelModel.marker.indexOf('%');
|
|
6097
6123
|
if (index === -1) {
|
|
6098
|
-
return
|
|
6124
|
+
return levelModel.marker;
|
|
6099
6125
|
}
|
|
6100
|
-
const splittedMarker =
|
|
6101
|
-
return this.createMarkerString(numberingInfo, numberingId, splittedMarker);
|
|
6126
|
+
const splittedMarker = levelModel.marker.split('.');
|
|
6127
|
+
return this.createMarkerString(numberingInfo, numberingId, splittedMarker, levelModel.markerType);
|
|
6102
6128
|
}
|
|
6103
6129
|
static createDataModel(numberings, paragraphs, paragraphIndex, numberingInfo) {
|
|
6104
6130
|
const paragraph = paragraphs[paragraphIndex];
|
|
@@ -6147,13 +6173,7 @@ class NumberingHelper {
|
|
|
6147
6173
|
numberingInfo[numberingId][level].markerIndex = markerLevels[lastMarkerLevel];
|
|
6148
6174
|
numberingInfo[numberingId][level].needToRecalculate = true;
|
|
6149
6175
|
}
|
|
6150
|
-
static
|
|
6151
|
-
return input
|
|
6152
|
-
.split('.')
|
|
6153
|
-
.filter(x => !!x)
|
|
6154
|
-
.map(x => parseInt(x));
|
|
6155
|
-
}
|
|
6156
|
-
static createMarkerString(numberingInfo, numberingId, splittedMarker) {
|
|
6176
|
+
static createMarkerString(numberingInfo, numberingId, splittedMarker, markerType) {
|
|
6157
6177
|
const markers = splittedMarker.map(x => {
|
|
6158
6178
|
if (x === '') {
|
|
6159
6179
|
return '';
|
|
@@ -6161,9 +6181,19 @@ class NumberingHelper {
|
|
|
6161
6181
|
if (x.indexOf('%') === -1) {
|
|
6162
6182
|
return x;
|
|
6163
6183
|
}
|
|
6184
|
+
let prefix = '';
|
|
6185
|
+
if (x.startsWith('(')) {
|
|
6186
|
+
x = x.slice(1);
|
|
6187
|
+
prefix = '(';
|
|
6188
|
+
}
|
|
6189
|
+
let suffix = '';
|
|
6190
|
+
if (x.endsWith(')')) {
|
|
6191
|
+
x = x.slice(0, -1);
|
|
6192
|
+
suffix = ')';
|
|
6193
|
+
}
|
|
6164
6194
|
const markerLevel = parseInt(x.slice(1));
|
|
6165
6195
|
const markerIndex = numberingInfo[numberingId][markerLevel - 1]?.markerIndex;
|
|
6166
|
-
return `${markerIndex}`;
|
|
6196
|
+
return `${prefix}${this.markerTypeToMarker(markerType, markerIndex)}${suffix}`;
|
|
6167
6197
|
});
|
|
6168
6198
|
return markers.join('.');
|
|
6169
6199
|
}
|
|
@@ -6186,198 +6216,191 @@ class NumberingHelper {
|
|
|
6186
6216
|
const offset = numberingData.width + numberingData.paddingLeft - info.indentLeft;
|
|
6187
6217
|
return info.indentFirstLine !== null || (offset > 0 && offset <= info.indent.markerWidth) ? info.indent.markerWidth : 0;
|
|
6188
6218
|
}
|
|
6219
|
+
static markerTypeToMarker(markerType, sequence) {
|
|
6220
|
+
switch (markerType) {
|
|
6221
|
+
case NumberingMarkerType.Decimal:
|
|
6222
|
+
return `${sequence}`;
|
|
6223
|
+
case NumberingMarkerType.LowerLetter:
|
|
6224
|
+
return this.numberToLetters(sequence);
|
|
6225
|
+
case NumberingMarkerType.UpperLetter:
|
|
6226
|
+
return this.numberToLetters(sequence).toUpperCase();
|
|
6227
|
+
case NumberingMarkerType.LowerRoman:
|
|
6228
|
+
return this.numberToRoman(sequence);
|
|
6229
|
+
case NumberingMarkerType.UpperRoman:
|
|
6230
|
+
return this.numberToRoman(sequence).toUpperCase();
|
|
6231
|
+
default: {
|
|
6232
|
+
return `${sequence}`;
|
|
6233
|
+
}
|
|
6234
|
+
}
|
|
6235
|
+
}
|
|
6236
|
+
static getLevelInfo(input) {
|
|
6237
|
+
return input
|
|
6238
|
+
.split('.')
|
|
6239
|
+
.filter(x => !!x)
|
|
6240
|
+
.map(x => parseInt(x));
|
|
6241
|
+
}
|
|
6242
|
+
static numberToLetters(sequence) {
|
|
6243
|
+
let result = '';
|
|
6244
|
+
while (sequence > 0) {
|
|
6245
|
+
sequence--;
|
|
6246
|
+
const charCode = (sequence % 26) + 97;
|
|
6247
|
+
result = String.fromCharCode(charCode) + result;
|
|
6248
|
+
sequence = Math.floor(sequence / 26);
|
|
6249
|
+
}
|
|
6250
|
+
return result;
|
|
6251
|
+
}
|
|
6252
|
+
static numberToRoman(sequence) {
|
|
6253
|
+
sequence = sequence % 4000; // there are no Roman numerals for values greater than 3999
|
|
6254
|
+
let result = '';
|
|
6255
|
+
for (const [num, roman] of this.romanMap) {
|
|
6256
|
+
while (sequence >= num) {
|
|
6257
|
+
result += roman;
|
|
6258
|
+
sequence -= num;
|
|
6259
|
+
}
|
|
6260
|
+
}
|
|
6261
|
+
return result;
|
|
6262
|
+
}
|
|
6189
6263
|
}
|
|
6190
6264
|
|
|
6191
6265
|
class PositionHelper {
|
|
6192
|
-
|
|
6193
|
-
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
|
|
6197
|
-
|
|
6266
|
+
static getLineTopOffset(paragraphLines, paragraphLine) {
|
|
6267
|
+
let result = 0;
|
|
6268
|
+
for (let i = 0; i < paragraphLine; i++) {
|
|
6269
|
+
const info = paragraphLines[i];
|
|
6270
|
+
result += info.height + info.endPageOffset + info.offsetBefore + info.offsetAfter;
|
|
6271
|
+
}
|
|
6272
|
+
return result + paragraphLines[paragraphLine].offsetBefore;
|
|
6198
6273
|
}
|
|
6199
|
-
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
}
|
|
6209
|
-
const
|
|
6210
|
-
|
|
6211
|
-
return {
|
|
6212
|
-
paragraphIndex,
|
|
6213
|
-
lineIndex,
|
|
6214
|
-
lineTopOffset,
|
|
6215
|
-
lineHeight: paragraphLineInfo.height,
|
|
6216
|
-
lineAscent: paragraphLineInfo.ascent
|
|
6217
|
-
};
|
|
6274
|
+
static documentLineToParagraphLine(paragraphs, documentLine) {
|
|
6275
|
+
let index = 0;
|
|
6276
|
+
let paragraph = 0;
|
|
6277
|
+
while (paragraph < paragraphs.length) {
|
|
6278
|
+
if (index + paragraphs[paragraph].paragraphSettings.textLinesInfo.length > documentLine) {
|
|
6279
|
+
break;
|
|
6280
|
+
}
|
|
6281
|
+
index += paragraphs[paragraph].paragraphSettings.textLinesInfo.length;
|
|
6282
|
+
paragraph++;
|
|
6283
|
+
}
|
|
6284
|
+
const paragraphLine = documentLine - index;
|
|
6285
|
+
return { paragraph, paragraphLine };
|
|
6218
6286
|
}
|
|
6219
|
-
static
|
|
6287
|
+
static paragraphToParagraphLine(nextLineIndexes, indexInParagraph) {
|
|
6288
|
+
if (!nextLineIndexes.length || nextLineIndexes[0] > indexInParagraph) {
|
|
6289
|
+
return { paragraphLine: 0, indexInLine: indexInParagraph };
|
|
6290
|
+
}
|
|
6291
|
+
let index = nextLineIndexes.findLastIndex(x => x <= indexInParagraph);
|
|
6292
|
+
const indexInLine = indexInParagraph - nextLineIndexes[index];
|
|
6293
|
+
return { paragraphLine: index + 1, indexInLine };
|
|
6294
|
+
}
|
|
6295
|
+
static paragraphToDocumentLine(session, paragraph, indexInParagraph) {
|
|
6220
6296
|
const paragraphLine = session.displayData.paragraphs[paragraph].lineNumber;
|
|
6221
|
-
|
|
6222
|
-
|
|
6297
|
+
const nextLineIndexes = session.displayData.paragraphs[paragraph].nextLineIndexes;
|
|
6298
|
+
if (!nextLineIndexes.length || nextLineIndexes[0] > indexInParagraph) {
|
|
6223
6299
|
return new CursorParagraph(paragraphLine, indexInParagraph);
|
|
6224
6300
|
}
|
|
6225
6301
|
let line = 0;
|
|
6226
|
-
while (
|
|
6227
|
-
line < session.displayData.paragraphs[paragraph].nextLineIndexes.length) {
|
|
6302
|
+
while (nextLineIndexes[line] <= indexInParagraph && line < nextLineIndexes.length) {
|
|
6228
6303
|
line++;
|
|
6229
6304
|
}
|
|
6230
|
-
|
|
6231
|
-
return new CursorParagraph(paragraphLine + line, index);
|
|
6305
|
+
return new CursorParagraph(paragraphLine + line, indexInParagraph - nextLineIndexes[line - 1]);
|
|
6232
6306
|
}
|
|
6233
|
-
static
|
|
6234
|
-
let
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
}
|
|
6241
|
-
let lineInParagraph = line - session.displayData.paragraphs[paragraph].lineNumber;
|
|
6242
|
-
if (!session.displayData.paragraphs[paragraph].nextLineIndexes.length || lineInParagraph === 0) {
|
|
6243
|
-
return new CursorParagraph(paragraph, indexInLine);
|
|
6244
|
-
}
|
|
6245
|
-
const index = indexInLine + session.displayData.paragraphs[paragraph].nextLineIndexes[lineInParagraph - 1];
|
|
6246
|
-
return new CursorParagraph(paragraph, index);
|
|
6307
|
+
static documentLineToParagraph(session, documentLine, indexInLine) {
|
|
6308
|
+
let paragraphIndex = session.displayData.paragraphs.findIndex(x => x.lineNumber > documentLine);
|
|
6309
|
+
paragraphIndex = paragraphIndex === -1 ? session.displayData.paragraphs.length - 1 : paragraphIndex - 1;
|
|
6310
|
+
const paragraph = session.displayData.paragraphs[paragraphIndex];
|
|
6311
|
+
let paragraphLine = documentLine - paragraph.lineNumber;
|
|
6312
|
+
const indexInParagraph = paragraphLine === 0 ? indexInLine : indexInLine + paragraph.nextLineIndexes[paragraphLine - 1];
|
|
6313
|
+
return new CursorParagraph(paragraphIndex, indexInParagraph);
|
|
6247
6314
|
}
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
|
|
6315
|
+
static paragraphToPixel(session, paragraph, indexInParagraph) {
|
|
6316
|
+
const line = this.paragraphToParagraphLine(session.displayData.paragraphs[paragraph].nextLineIndexes, indexInParagraph);
|
|
6317
|
+
return this.paragraphLineToPixel(session, paragraph, line.paragraphLine, line.indexInLine);
|
|
6318
|
+
}
|
|
6319
|
+
static documentLineToPixel(session, documentLine, indexInLine) {
|
|
6320
|
+
const { paragraph, paragraphLine } = this.documentLineToParagraphLine(session.displayData.paragraphs, documentLine);
|
|
6321
|
+
return this.paragraphLineToPixel(session, paragraph, paragraphLine, indexInLine);
|
|
6322
|
+
}
|
|
6323
|
+
static paragraphLineToPixel(session, paragraph, paragraphLine, indexInLine) {
|
|
6324
|
+
const marginLeft = session.displayData.pagesFormat[0].pageFormatModel.marginLeft; // this value is the same for all page formats.
|
|
6252
6325
|
const paragraphs = session.displayData.paragraphs;
|
|
6253
|
-
const
|
|
6254
|
-
|
|
6255
|
-
let tokenIndex = column > 0 ? column - 1 : column;
|
|
6326
|
+
const tokens = session.displayData.getParagraphLineTokens(paragraph, paragraphLine);
|
|
6327
|
+
let tokenIndex = indexInLine > 0 ? indexInLine - 1 : indexInLine;
|
|
6256
6328
|
let sizeMax = { ...tokens[tokenIndex] };
|
|
6257
|
-
let lineWidthToPosition =
|
|
6258
|
-
for (let
|
|
6259
|
-
const currentToken = tokens[
|
|
6260
|
-
if (
|
|
6329
|
+
let lineWidthToPosition = marginLeft;
|
|
6330
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
6331
|
+
const currentToken = tokens[i];
|
|
6332
|
+
if (i < indexInLine) {
|
|
6261
6333
|
lineWidthToPosition += currentToken.width;
|
|
6262
6334
|
}
|
|
6263
6335
|
if (sizeMax.ascent < currentToken.ascent) {
|
|
6264
6336
|
sizeMax = currentToken;
|
|
6265
6337
|
}
|
|
6266
6338
|
}
|
|
6267
|
-
|
|
6268
|
-
|
|
6269
|
-
|
|
6270
|
-
const
|
|
6271
|
-
const paragraphTop = paragraph.paragraphSettings.distanceFromTop || 0;
|
|
6272
|
-
const info = paragraph.paragraphSettings.textLinesInfo[paragraphInfo.lineIndex];
|
|
6273
|
-
const markerOffset = NumberingHelper.getOffsetCausedByMarker(paragraph.paragraphSettings.numberingData, info); // todo: verify (case - 1) numbering paragraph with multi-lines; 2) marker is moved far left so it not affect line offset)
|
|
6339
|
+
const lineTopOffset = this.getLineTopOffset(paragraphs[paragraph].paragraphSettings.textLinesInfo, paragraphLine);
|
|
6340
|
+
const paragraphTop = paragraphs[paragraph].paragraphSettings.distanceFromTop || 0;
|
|
6341
|
+
const info = paragraphs[paragraph].paragraphSettings.textLinesInfo[paragraphLine];
|
|
6342
|
+
const markerOffset = NumberingHelper.getOffsetCausedByMarker(paragraphs[paragraph].paragraphSettings.numberingData, info);
|
|
6274
6343
|
return {
|
|
6275
6344
|
pageX: lineWidthToPosition + info.paddingLeft + info.offsetMargin + markerOffset,
|
|
6276
|
-
pageY: paragraphTop +
|
|
6345
|
+
pageY: paragraphTop + lineTopOffset - session.scrollTop,
|
|
6277
6346
|
width: tokens[tokenIndex].width,
|
|
6278
|
-
height:
|
|
6279
|
-
ascent:
|
|
6347
|
+
height: info.height,
|
|
6348
|
+
ascent: info.ascent
|
|
6280
6349
|
};
|
|
6281
6350
|
}
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
|
|
6285
|
-
|
|
6286
|
-
const { displayData, scrollTop } = session;
|
|
6287
|
-
yPosition += scrollTop - top;
|
|
6288
|
-
let paragraphIndex = displayData.paragraphs.findIndex(paragraph => paragraph.paragraphSettings.distanceFromTop > yPosition);
|
|
6289
|
-
if (paragraphIndex < 0) {
|
|
6290
|
-
paragraphIndex = displayData.paragraphs.length - 1;
|
|
6291
|
-
}
|
|
6292
|
-
else if (paragraphIndex > 0) {
|
|
6293
|
-
paragraphIndex--;
|
|
6294
|
-
}
|
|
6295
|
-
const paragraphSettings = displayData.paragraphs[paragraphIndex].paragraphSettings;
|
|
6296
|
-
yPosition -= paragraphSettings.distanceFromTop;
|
|
6297
|
-
let lineIndex = 0;
|
|
6298
|
-
while (yPosition > 0 && lineIndex < paragraphSettings.textLinesInfo.length - 1) {
|
|
6299
|
-
const lineInfo = paragraphSettings.textLinesInfo[lineIndex];
|
|
6300
|
-
const lineHeight = lineInfo.height + lineInfo.endPageOffset + lineInfo.offsetBefore + lineInfo.offsetAfter;
|
|
6301
|
-
if (yPosition <= lineHeight) {
|
|
6302
|
-
break;
|
|
6303
|
-
}
|
|
6304
|
-
lineIndex++;
|
|
6305
|
-
yPosition -= lineHeight;
|
|
6351
|
+
static pixelToParagraphLine(paragraphs, pageY) {
|
|
6352
|
+
let paragraph = paragraphs.findIndex(x => x.paragraphSettings.distanceFromTop > pageY);
|
|
6353
|
+
if (paragraph < 0) {
|
|
6354
|
+
paragraph = paragraphs.length - 1;
|
|
6306
6355
|
}
|
|
6307
|
-
|
|
6308
|
-
|
|
6309
|
-
/**
|
|
6310
|
-
* Maps a pixel position to a screen position using half-token width comparison.
|
|
6311
|
-
*/
|
|
6312
|
-
static mapPixelToClosestTokenMidpoint(session, xPixel, paragraphIndex, lineIndex, leftOffset) {
|
|
6313
|
-
const paragraphSettings = session.displayData.paragraphs[paragraphIndex].paragraphSettings;
|
|
6314
|
-
const marginLeft = session.displayData.pagesFormat[0].pageFormatModel.marginLeft; // this value is the same for all page formats.
|
|
6315
|
-
const tokens = session.displayData.getParagraphLineTokens(paragraphIndex, lineIndex);
|
|
6316
|
-
const lineInfo = paragraphSettings.textLinesInfo[lineIndex];
|
|
6317
|
-
const line = lineInfo.screenLine;
|
|
6318
|
-
if (tokens[0].isParagraph) {
|
|
6319
|
-
return { line, indexInLine: 0 };
|
|
6320
|
-
}
|
|
6321
|
-
let indexInLine = 0;
|
|
6322
|
-
const markerOffset = NumberingHelper.getOffsetCausedByMarker(paragraphSettings.numberingData, lineInfo);
|
|
6323
|
-
let relativeX = xPixel - leftOffset - marginLeft - lineInfo.paddingLeft - lineInfo.offsetMargin - markerOffset;
|
|
6324
|
-
while (indexInLine < tokens.length && relativeX >= tokens[indexInLine].width / 2) {
|
|
6325
|
-
relativeX -= tokens[indexInLine].width;
|
|
6326
|
-
indexInLine++;
|
|
6327
|
-
}
|
|
6328
|
-
return { line, indexInLine };
|
|
6329
|
-
}
|
|
6330
|
-
/**
|
|
6331
|
-
* Maps a pixel position to a screen position using full-token width comparison.
|
|
6332
|
-
*/
|
|
6333
|
-
static mapPixelToNextTokenBoundary(session, xPixel, paragraphIndex, lineIndex, leftOffset) {
|
|
6334
|
-
const paragraphSettings = session.displayData.paragraphs[paragraphIndex].paragraphSettings;
|
|
6335
|
-
const marginLeft = session.displayData.pagesFormat[0].pageFormatModel.marginLeft; // this value is the same for all page formats.
|
|
6336
|
-
const tokens = session.displayData.getParagraphLineTokens(paragraphIndex, lineIndex);
|
|
6337
|
-
const lineInfo = paragraphSettings.textLinesInfo[lineIndex];
|
|
6338
|
-
const line = lineInfo.screenLine;
|
|
6339
|
-
if (tokens[0].isParagraph) {
|
|
6340
|
-
return { line, indexInLine: 0 };
|
|
6341
|
-
}
|
|
6342
|
-
let indexInLine = 0;
|
|
6343
|
-
const markerOffset = NumberingHelper.getOffsetCausedByMarker(paragraphSettings.numberingData, lineInfo);
|
|
6344
|
-
let relativeX = xPixel - leftOffset - marginLeft - lineInfo.paddingLeft - lineInfo.offsetMargin - markerOffset;
|
|
6345
|
-
while (indexInLine < tokens.length && relativeX >= tokens[indexInLine].width) {
|
|
6346
|
-
relativeX -= tokens[indexInLine].width;
|
|
6347
|
-
indexInLine++;
|
|
6356
|
+
else if (paragraph > 0) {
|
|
6357
|
+
paragraph--;
|
|
6348
6358
|
}
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
if (
|
|
6359
|
+
const paragraphSettings = paragraphs[paragraph].paragraphSettings;
|
|
6360
|
+
pageY -= paragraphSettings.distanceFromTop;
|
|
6361
|
+
let paragraphLine = 0;
|
|
6362
|
+
while (pageY > 0 && paragraphLine < paragraphSettings.textLinesInfo.length - 1) {
|
|
6363
|
+
const lineInfo = paragraphSettings.textLinesInfo[paragraphLine];
|
|
6364
|
+
const lineHeight = lineInfo.height + lineInfo.endPageOffset + lineInfo.offsetBefore + lineInfo.offsetAfter;
|
|
6365
|
+
if (pageY <= lineHeight) {
|
|
6356
6366
|
break;
|
|
6357
6367
|
}
|
|
6358
|
-
|
|
6359
|
-
|
|
6368
|
+
paragraphLine++;
|
|
6369
|
+
pageY -= lineHeight;
|
|
6360
6370
|
}
|
|
6361
|
-
|
|
6362
|
-
return { paragraphIndex, lineIndex };
|
|
6371
|
+
return { paragraph, paragraphLine };
|
|
6363
6372
|
}
|
|
6364
|
-
static
|
|
6373
|
+
static pixelToParagraph(session, pageX, pageY, tokenDivider) {
|
|
6374
|
+
const marginLeft = session.displayData.pagesFormat[0].pageFormatModel.marginLeft; // this value is the same for all page formats.
|
|
6365
6375
|
const paragraphs = session.displayData.paragraphs;
|
|
6376
|
+
const { paragraph, paragraphLine } = this.pixelToParagraphLine(paragraphs, pageY);
|
|
6377
|
+
const settings = paragraphs[paragraph].paragraphSettings;
|
|
6378
|
+
const tokens = session.displayData.getParagraphLineTokens(paragraph, paragraphLine);
|
|
6379
|
+
const lineInfo = settings.textLinesInfo[paragraphLine];
|
|
6380
|
+
const indexInLine = this.getIndexInLine(tokens, lineInfo, settings.numberingData, marginLeft, pageX, tokenDivider);
|
|
6381
|
+
const indexInParagraph = paragraphLine === 0 ? indexInLine : indexInLine + paragraphs[paragraph].nextLineIndexes[paragraphLine - 1];
|
|
6382
|
+
return { paragraph, indexInParagraph };
|
|
6383
|
+
}
|
|
6384
|
+
static pixelToIndexInLine(session, documentLine, pageX, tokenDivider) {
|
|
6366
6385
|
const marginLeft = session.displayData.pagesFormat[0].pageFormatModel.marginLeft; // this value is the same for all page formats.
|
|
6367
|
-
const {
|
|
6368
|
-
const
|
|
6386
|
+
const { paragraph, paragraphLine } = this.documentLineToParagraphLine(session.displayData.paragraphs, documentLine);
|
|
6387
|
+
const settings = session.displayData.paragraphs[paragraph].paragraphSettings;
|
|
6388
|
+
const tokens = session.displayData.getParagraphLineTokens(paragraph, paragraphLine);
|
|
6389
|
+
const lineInfo = settings.textLinesInfo[paragraphLine];
|
|
6390
|
+
return this.getIndexInLine(tokens, lineInfo, settings.numberingData, marginLeft, pageX, tokenDivider);
|
|
6391
|
+
}
|
|
6392
|
+
static getIndexInLine(tokens, lineInfo, numberingData, marginLeft, pageX, tokenDivider) {
|
|
6369
6393
|
if (tokens[0].isParagraph) {
|
|
6370
6394
|
return 0;
|
|
6371
6395
|
}
|
|
6372
|
-
let
|
|
6373
|
-
const
|
|
6374
|
-
|
|
6375
|
-
|
|
6376
|
-
|
|
6377
|
-
|
|
6378
|
-
index++;
|
|
6396
|
+
let indexInLine = 0;
|
|
6397
|
+
const markerOffset = NumberingHelper.getOffsetCausedByMarker(numberingData, lineInfo);
|
|
6398
|
+
let width = pageX - marginLeft - lineInfo.paddingLeft - lineInfo.offsetMargin - markerOffset;
|
|
6399
|
+
while (indexInLine < tokens.length && width >= tokens[indexInLine].width / tokenDivider) {
|
|
6400
|
+
width -= tokens[indexInLine].width;
|
|
6401
|
+
indexInLine++;
|
|
6379
6402
|
}
|
|
6380
|
-
return
|
|
6403
|
+
return indexInLine;
|
|
6381
6404
|
}
|
|
6382
6405
|
}
|
|
6383
6406
|
|
|
@@ -6467,15 +6490,16 @@ class RenderingHelper {
|
|
|
6467
6490
|
if (wordSpacing) {
|
|
6468
6491
|
const lineStart = lineIndex > 0 ? paragraph.nextLineIndexes[lineIndex - 1] : 0;
|
|
6469
6492
|
const lineStartIndex = start + lineStart;
|
|
6493
|
+
const renderedInLine = renderedCount - lineStart;
|
|
6470
6494
|
const wordSpacingStart = lineInfos[lineIndex].wordSpacingStart;
|
|
6471
6495
|
const wordSpacingEnd = lineInfos[lineIndex].wordSpacingEnd;
|
|
6472
|
-
if (
|
|
6496
|
+
if (renderedInLine < wordSpacingStart && lineStartIndex + wordSpacingStart < fragmentEnd) {
|
|
6473
6497
|
fragmentEnd = lineStartIndex + wordSpacingStart;
|
|
6474
6498
|
}
|
|
6475
|
-
else if (
|
|
6499
|
+
else if (renderedInLine < wordSpacingEnd && lineStartIndex + wordSpacingEnd < fragmentEnd) {
|
|
6476
6500
|
fragmentEnd = lineStartIndex + wordSpacingEnd;
|
|
6477
6501
|
}
|
|
6478
|
-
if (
|
|
6502
|
+
if (renderedInLine < wordSpacingStart || renderedInLine > wordSpacingEnd) {
|
|
6479
6503
|
wordSpacing = null;
|
|
6480
6504
|
}
|
|
6481
6505
|
}
|
|
@@ -7387,15 +7411,9 @@ class Range {
|
|
|
7387
7411
|
const compare = this.compareSingleLine(position);
|
|
7388
7412
|
return compare ?? this.compareMultiLine(position);
|
|
7389
7413
|
}
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
* @param {EditSession} session The `EditSession` to retrieve coordinates from
|
|
7394
|
-
* @returns {Range}
|
|
7395
|
-
**/
|
|
7396
|
-
toScreenRange(session) {
|
|
7397
|
-
const screenPosStart = PositionHelper.documentToScreen(session, this.start.row, this.start.column);
|
|
7398
|
-
const screenPosEnd = PositionHelper.documentToScreen(session, this.end.row, this.end.column);
|
|
7414
|
+
paragraphToDocumentLine(session) {
|
|
7415
|
+
const screenPosStart = PositionHelper.paragraphToDocumentLine(session, this.start.row, this.start.column);
|
|
7416
|
+
const screenPosEnd = PositionHelper.paragraphToDocumentLine(session, this.end.row, this.end.column);
|
|
7399
7417
|
return new Range(screenPosStart, screenPosEnd);
|
|
7400
7418
|
}
|
|
7401
7419
|
/**
|
|
@@ -7467,7 +7485,7 @@ class RemoveWithParagraphModel {
|
|
|
7467
7485
|
constructor(fields) {
|
|
7468
7486
|
if (fields) {
|
|
7469
7487
|
if (fields.paragraphStyle) {
|
|
7470
|
-
fields.paragraphStyle = new
|
|
7488
|
+
fields.paragraphStyle = new ParagraphStyleExtModel(fields.paragraphStyle);
|
|
7471
7489
|
}
|
|
7472
7490
|
Object.assign(this, fields);
|
|
7473
7491
|
}
|
|
@@ -7518,7 +7536,7 @@ class RestoreWithParagraphModel {
|
|
|
7518
7536
|
constructor(fields) {
|
|
7519
7537
|
if (fields) {
|
|
7520
7538
|
if (fields.paragraphStyle) {
|
|
7521
|
-
fields.paragraphStyle = new
|
|
7539
|
+
fields.paragraphStyle = new ParagraphStyleExtModel(fields.paragraphStyle);
|
|
7522
7540
|
}
|
|
7523
7541
|
if (fields.restore) {
|
|
7524
7542
|
fields.restore = new RestoreModel(fields.restore);
|
|
@@ -8329,7 +8347,7 @@ class Selection {
|
|
|
8329
8347
|
this.placeCursor(position);
|
|
8330
8348
|
}
|
|
8331
8349
|
moveCursorUp(session, position) {
|
|
8332
|
-
const line = PositionHelper.
|
|
8350
|
+
const line = PositionHelper.paragraphToDocumentLine(session, position.row, position.column);
|
|
8333
8351
|
if (line.row === 0) {
|
|
8334
8352
|
this.selectLineStart(session);
|
|
8335
8353
|
}
|
|
@@ -8338,7 +8356,7 @@ class Selection {
|
|
|
8338
8356
|
}
|
|
8339
8357
|
}
|
|
8340
8358
|
moveCursorDown(session, position) {
|
|
8341
|
-
const line = PositionHelper.
|
|
8359
|
+
const line = PositionHelper.paragraphToDocumentLine(session, position.row, position.column);
|
|
8342
8360
|
const lastParagraphsIndex = session.displayData.paragraphs.length - 1;
|
|
8343
8361
|
const lastParagraph = session.displayData.getParagraphSettings(lastParagraphsIndex);
|
|
8344
8362
|
const lastParagraphLine = lastParagraph.textLinesInfo[lastParagraph.textLinesInfo.length - 1].screenLine;
|
|
@@ -8351,10 +8369,10 @@ class Selection {
|
|
|
8351
8369
|
}
|
|
8352
8370
|
moveToLine(session, line, fromLine) {
|
|
8353
8371
|
if (!this.keepLinePositionX) {
|
|
8354
|
-
this.keepLinePositionX = PositionHelper.
|
|
8372
|
+
this.keepLinePositionX = PositionHelper.documentLineToPixel(session, fromLine.row, fromLine.column).pageX;
|
|
8355
8373
|
}
|
|
8356
|
-
const
|
|
8357
|
-
this.cursor = PositionHelper.
|
|
8374
|
+
const indexInLine = PositionHelper.pixelToIndexInLine(session, line, this.keepLinePositionX, 2);
|
|
8375
|
+
this.cursor = PositionHelper.documentLineToParagraph(session, line, indexInLine);
|
|
8358
8376
|
this.overlayService.close();
|
|
8359
8377
|
}
|
|
8360
8378
|
getCursorLeft(session) {
|
|
@@ -8373,30 +8391,29 @@ class Selection {
|
|
|
8373
8391
|
return ContentHelper.documentIndexToParagraphIndex(session.displayData.paragraphs, index + 1);
|
|
8374
8392
|
}
|
|
8375
8393
|
getLineStart(session, position) {
|
|
8376
|
-
const line = PositionHelper.
|
|
8377
|
-
return PositionHelper.
|
|
8394
|
+
const line = PositionHelper.paragraphToDocumentLine(session, position.row, position.column);
|
|
8395
|
+
return PositionHelper.documentLineToParagraph(session, line.row, 0);
|
|
8378
8396
|
}
|
|
8379
8397
|
getLineEnd(session, position) {
|
|
8380
|
-
const line = PositionHelper.
|
|
8398
|
+
const line = PositionHelper.paragraphToDocumentLine(session, position.row, position.column);
|
|
8381
8399
|
const paragraphLength = session.displayData.getParagraphContent(position.row).length;
|
|
8382
8400
|
const linesCount = session.displayData.getParagraphSettings(position.row).textLinesInfo.length;
|
|
8383
8401
|
if (linesCount === 1) {
|
|
8384
|
-
return PositionHelper.
|
|
8402
|
+
return PositionHelper.documentLineToParagraph(session, line.row, paragraphLength);
|
|
8385
8403
|
}
|
|
8386
8404
|
const paragraphLine = line.row - session.displayData.paragraphs[position.row].lineNumber;
|
|
8405
|
+
const nextLineIndexes = session.displayData.paragraphs[position.row].nextLineIndexes;
|
|
8387
8406
|
let index;
|
|
8388
8407
|
if (paragraphLine === 0) {
|
|
8389
|
-
index =
|
|
8408
|
+
index = nextLineIndexes[0];
|
|
8390
8409
|
}
|
|
8391
8410
|
else if (paragraphLine === linesCount - 1) {
|
|
8392
|
-
index = paragraphLength -
|
|
8411
|
+
index = paragraphLength - nextLineIndexes[paragraphLine - 1];
|
|
8393
8412
|
}
|
|
8394
8413
|
else {
|
|
8395
|
-
index =
|
|
8396
|
-
session.displayData.paragraphs[position.row].nextLineIndexes[paragraphLine] -
|
|
8397
|
-
session.displayData.paragraphs[position.row].nextLineIndexes[paragraphLine - 1];
|
|
8414
|
+
index = nextLineIndexes[paragraphLine] - nextLineIndexes[paragraphLine - 1];
|
|
8398
8415
|
}
|
|
8399
|
-
return PositionHelper.
|
|
8416
|
+
return PositionHelper.documentLineToParagraph(session, line.row, index);
|
|
8400
8417
|
}
|
|
8401
8418
|
getWordRight(session, position) {
|
|
8402
8419
|
let row = position.row;
|
|
@@ -8639,7 +8656,7 @@ class Editor {
|
|
|
8639
8656
|
this.session.applyToolbarStyles();
|
|
8640
8657
|
this.onSetCommentsVisibility(!!this.model.comments.length);
|
|
8641
8658
|
this.search = new Search(editorService);
|
|
8642
|
-
this.subscriptions.push(this.changedEdgeSizeSubscription(), this.changedEdgeSubscription(), this.changedTableSizeSubscription(), this.clipboardDataSubscription(), this.copySelectedSubscription(), this.createCustomComponentSubscription(), this.replaceByCustomComponentSubscription(), this.cutSelectedSubscription(), this.disableSelectionSubscription(), this.endMousePressSubscription(), this.imageLoadedSubscription(), this.insertBreakSubscription(), this.insertImageSubscription(), this.insertLinkSubscription(), this.insertTableColumnsSubscription(), this.insertTableRowsSubscription(), this.insertTableSubscription(), this.updateTableBorderStyleSubscription(), this.updateTableBorderWidthSubscription(), this.updateTableBordersSubscription(), this.selectSpacingSubscription(), this.selectBeforeSubscription(), this.selectAfterSubscription(), this.insertTextSubscription(), this.pasteFromClipboardSubscription(), this.printSubscription(), this.redoSubscription(), this.removeLeftSubscription(), this.removeNumberingsSubscription(), this.removeRightSubscription(), this.removeSelectedSubscription(), this.removeTableColumnsSubscription(), this.removeTableRowsSubscription(), this.removeTableSubscription(), this.rerenderSubscription(), this.resizeTableColumnsSubscription(), ...this.searchOptionSubscriptions(), ...this.replaceSubscription(), this.grammarReplaceSubscription(), this.ignoreGrammarErrorSubscription(), this.selectAllSubscription(), this.setImageStyleSubscription(), this.setNumberingTemplateTypeSubscription(), this.setParagraphStylesSubscription(), this.setTextStylesSubscription(), this.undoSubscription(), this.updateEdgeSubscription(), this.viewOnlyModeSubscription(), this.applyPageFormatSubscription(), this.applyRightMarginPageFormatSubscription(), this.applyLeftMarginPageFormatSubscription(), this.insertPageFormatSubscription(), this.applyDocumentPageFormatSubscription(), this.dragMoveSubscription(), this.dragDropSubscription(), this.applyFirstLinePositionSubscription(), this.applyRightIndentParagraphSubscription(), this.applyLeftIndentParagraphSubscription(), this.applyTabSettingsSubscription(), this.commandCreatedForEdges(), ...this.commentCreationSubscriptions(), this.
|
|
8659
|
+
this.subscriptions.push(this.changedEdgeSizeSubscription(), this.changedEdgeSubscription(), this.changedTableSizeSubscription(), this.clipboardDataSubscription(), this.copySelectedSubscription(), this.createCustomComponentSubscription(), this.replaceByCustomComponentSubscription(), this.cutSelectedSubscription(), this.disableSelectionSubscription(), this.endMousePressSubscription(), this.imageLoadedSubscription(), this.insertBreakSubscription(), this.insertImageSubscription(), this.insertLinkSubscription(), this.insertTableColumnsSubscription(), this.insertTableRowsSubscription(), this.insertTableSubscription(), this.updateTableBorderStyleSubscription(), this.updateTableBorderWidthSubscription(), this.updateTableBordersSubscription(), this.selectSpacingSubscription(), this.selectBeforeSubscription(), this.selectAfterSubscription(), this.insertTextSubscription(), this.pasteFromClipboardSubscription(), this.printSubscription(), this.redoSubscription(), this.removeLeftSubscription(), this.removeNumberingsSubscription(), this.removeRightSubscription(), this.removeSelectedSubscription(), this.removeTableColumnsSubscription(), this.removeTableRowsSubscription(), this.removeTableSubscription(), this.rerenderSubscription(), this.resizeTableColumnsSubscription(), ...this.searchOptionSubscriptions(), ...this.replaceSubscription(), this.grammarReplaceSubscription(), this.ignoreGrammarErrorSubscription(), this.selectAllSubscription(), this.setImageStyleSubscription(), this.setNumberingTemplateTypeSubscription(), this.setParagraphStylesSubscription(), this.setTextStylesSubscription(), this.undoSubscription(), this.updateEdgeSubscription(), this.viewOnlyModeSubscription(), this.applyPageFormatSubscription(), this.applyRightMarginPageFormatSubscription(), this.applyLeftMarginPageFormatSubscription(), this.insertPageFormatSubscription(), this.applyDocumentPageFormatSubscription(), this.dragMoveSubscription(), this.dragDropSubscription(), this.applyFirstLinePositionSubscription(), this.applyRightIndentParagraphSubscription(), this.applyLeftIndentParagraphSubscription(), this.applyTabSettingsSubscription(), this.commandCreatedForEdges(), ...this.commentCreationSubscriptions(), this.removeCommentSubscriptions(), this.rerenderCommentsSubscription(), this.selectCommentSubscription(), this.setComentsVisibilitySubscription(), this.getCommentTextSubscription(), this.replaceCommentTextSubscription());
|
|
8643
8660
|
}
|
|
8644
8661
|
destroy() {
|
|
8645
8662
|
this.subscriptions.forEach(s => s?.unsubscribe());
|
|
@@ -8654,7 +8671,7 @@ class Editor {
|
|
|
8654
8671
|
selectPageDown() {
|
|
8655
8672
|
const config = this.mainRenderer.layerConfig;
|
|
8656
8673
|
const line = config.visibleRange.endScreenLine;
|
|
8657
|
-
const position = PositionHelper.
|
|
8674
|
+
const position = PositionHelper.documentLineToParagraph(this.mainSession, line, 0);
|
|
8658
8675
|
this.selection.moveSelection(position);
|
|
8659
8676
|
this.mainRenderer.scrollBy(config.height);
|
|
8660
8677
|
this.scrollCursorIntoMainView(0.5);
|
|
@@ -8663,7 +8680,7 @@ class Editor {
|
|
|
8663
8680
|
selectPageUp() {
|
|
8664
8681
|
const config = this.mainRenderer.layerConfig;
|
|
8665
8682
|
const line = config.visibleRange.startScreenLine;
|
|
8666
|
-
const position = PositionHelper.
|
|
8683
|
+
const position = PositionHelper.documentLineToParagraph(this.mainSession, line, 0);
|
|
8667
8684
|
this.selection.moveSelection(position);
|
|
8668
8685
|
this.mainRenderer.scrollBy(-config.height);
|
|
8669
8686
|
this.scrollCursorIntoMainView(0.5);
|
|
@@ -8672,7 +8689,7 @@ class Editor {
|
|
|
8672
8689
|
gotoPageDown() {
|
|
8673
8690
|
const config = this.mainRenderer.layerConfig;
|
|
8674
8691
|
const line = config.visibleRange.endScreenLine;
|
|
8675
|
-
const position = PositionHelper.
|
|
8692
|
+
const position = PositionHelper.documentLineToParagraph(this.mainSession, line, 0);
|
|
8676
8693
|
this.selection.placeCursor(position);
|
|
8677
8694
|
this.mainRenderer.scrollBy(config.height);
|
|
8678
8695
|
this.scrollCursorIntoMainView(0.5);
|
|
@@ -8681,7 +8698,7 @@ class Editor {
|
|
|
8681
8698
|
gotoPageUp() {
|
|
8682
8699
|
const config = this.mainRenderer.layerConfig;
|
|
8683
8700
|
const line = config.visibleRange.startScreenLine;
|
|
8684
|
-
const position = PositionHelper.
|
|
8701
|
+
const position = PositionHelper.documentLineToParagraph(this.mainSession, line, 0);
|
|
8685
8702
|
this.selection.placeCursor(position);
|
|
8686
8703
|
this.mainRenderer.scrollBy(-config.height);
|
|
8687
8704
|
this.scrollCursorIntoMainView(0.5);
|
|
@@ -8692,7 +8709,8 @@ class Editor {
|
|
|
8692
8709
|
if (!component) {
|
|
8693
8710
|
return;
|
|
8694
8711
|
}
|
|
8695
|
-
const
|
|
8712
|
+
const paragraphPos = this.session.selection.cursor;
|
|
8713
|
+
const cursor = PositionHelper.paragraphToPixel(this.session, paragraphPos.row, paragraphPos.column);
|
|
8696
8714
|
const rect = this.renderer.container.getBoundingClientRect();
|
|
8697
8715
|
const x = rect.left + cursor.pageX;
|
|
8698
8716
|
const y = rect.top + cursor.pageY + cursor.height;
|
|
@@ -8784,11 +8802,14 @@ class Editor {
|
|
|
8784
8802
|
}
|
|
8785
8803
|
if (this.selection.range.start.column === 0) {
|
|
8786
8804
|
const paragraph = this.session.displayData.paragraphs[this.selection.range.start.row];
|
|
8787
|
-
if (paragraph.paragraphSettings.numberingData.numberingId && paragraph.paragraphSettings.numberingData.level <=
|
|
8788
|
-
this.applyParagraphStyles(new
|
|
8805
|
+
if (paragraph.paragraphSettings.numberingData.numberingId && paragraph.paragraphSettings.numberingData.level <= 7) {
|
|
8806
|
+
this.applyParagraphStyles(new ParagraphStyleExtModel({
|
|
8789
8807
|
numberingLevel: paragraph.paragraphSettings.numberingData.level + 1,
|
|
8808
|
+
hasIndentLeft: true,
|
|
8790
8809
|
indentLeft: null,
|
|
8810
|
+
hasIndentFirstLine: true,
|
|
8791
8811
|
indentFirstLine: null,
|
|
8812
|
+
hasIndentHanging: true,
|
|
8792
8813
|
indentHanging: null
|
|
8793
8814
|
}));
|
|
8794
8815
|
return;
|
|
@@ -8813,10 +8834,13 @@ class Editor {
|
|
|
8813
8834
|
if (paragraph.paragraphSettings.numberingData.level === 0) {
|
|
8814
8835
|
return;
|
|
8815
8836
|
}
|
|
8816
|
-
this.applyParagraphStyles(new
|
|
8837
|
+
this.applyParagraphStyles(new ParagraphStyleExtModel({
|
|
8817
8838
|
numberingLevel: paragraph.paragraphSettings.numberingData.level - 1,
|
|
8839
|
+
hasIndentLeft: true,
|
|
8818
8840
|
indentLeft: null,
|
|
8841
|
+
hasIndentFirstLine: true,
|
|
8819
8842
|
indentFirstLine: null,
|
|
8843
|
+
hasIndentHanging: true,
|
|
8820
8844
|
indentHanging: null
|
|
8821
8845
|
}));
|
|
8822
8846
|
return;
|
|
@@ -9135,7 +9159,7 @@ class Editor {
|
|
|
9135
9159
|
command = SaveCommandsHelper.getApplyTextStyleCommand(startIndex, endIndex, textStyle, this.targets);
|
|
9136
9160
|
}
|
|
9137
9161
|
else if (operation instanceof ApplyParagraphStyleModel) {
|
|
9138
|
-
const copy = new
|
|
9162
|
+
const copy = new ParagraphStyleExtModel(operation.paragraphStyle);
|
|
9139
9163
|
this.session.applyParagraphStyle(operation.startIndex, operation.endIndex, copy);
|
|
9140
9164
|
const { startIndex, endIndex, paragraphStyle } = operation;
|
|
9141
9165
|
command = SaveCommandsHelper.getApplyParagraphStyleCommand(startIndex, endIndex, paragraphStyle, this.targets);
|
|
@@ -9505,11 +9529,23 @@ class Editor {
|
|
|
9505
9529
|
const operation = new RemoveWithParagraphModel({
|
|
9506
9530
|
startIndex: restoreModel.insertIndex,
|
|
9507
9531
|
count: restoreModel.text.length,
|
|
9508
|
-
paragraphStyle: new
|
|
9532
|
+
paragraphStyle: new ParagraphStyleExtModel({
|
|
9533
|
+
...firstParagraph.paragraphStyle,
|
|
9534
|
+
hasIndentFirstLine: true,
|
|
9535
|
+
hasIndentHanging: true,
|
|
9536
|
+
hasIndentLeft: true,
|
|
9537
|
+
hasIndentRight: true
|
|
9538
|
+
})
|
|
9509
9539
|
});
|
|
9510
9540
|
const reversed = new RestoreWithParagraphModel({
|
|
9511
9541
|
restore: restoreModel,
|
|
9512
|
-
paragraphStyle: new
|
|
9542
|
+
paragraphStyle: new ParagraphStyleExtModel({
|
|
9543
|
+
...lastParagraph.paragraphStyle,
|
|
9544
|
+
hasIndentFirstLine: true,
|
|
9545
|
+
hasIndentHanging: true,
|
|
9546
|
+
hasIndentLeft: true,
|
|
9547
|
+
hasIndentRight: true
|
|
9548
|
+
})
|
|
9513
9549
|
});
|
|
9514
9550
|
this.saveRemoveWithParagraphToHistory(operation, reversed);
|
|
9515
9551
|
this.removeExternalData();
|
|
@@ -9530,7 +9566,15 @@ class Editor {
|
|
|
9530
9566
|
}
|
|
9531
9567
|
removeOrLowerNestingNumbering(paragraph) {
|
|
9532
9568
|
if (paragraph.paragraphSettings.numberingData.level > 0) {
|
|
9533
|
-
this.applyParagraphStyles(new
|
|
9569
|
+
this.applyParagraphStyles(new ParagraphStyleExtModel({
|
|
9570
|
+
numberingLevel: paragraph.paragraphSettings.numberingData.level - 1,
|
|
9571
|
+
hasIndentFirstLine: true,
|
|
9572
|
+
indentFirstLine: null,
|
|
9573
|
+
hasIndentHanging: true,
|
|
9574
|
+
indentHanging: null,
|
|
9575
|
+
hasIndentLeft: true,
|
|
9576
|
+
indentLeft: null
|
|
9577
|
+
}));
|
|
9534
9578
|
}
|
|
9535
9579
|
else {
|
|
9536
9580
|
this.removeNumberingsFromParagraphs();
|
|
@@ -9592,9 +9636,9 @@ class Editor {
|
|
|
9592
9636
|
this.saveAttachCommentToHistory(commentModel);
|
|
9593
9637
|
}
|
|
9594
9638
|
onCommentRemoved(id) {
|
|
9595
|
-
const
|
|
9639
|
+
const session = this.regulatorService.getCommentSessionModel(id);
|
|
9596
9640
|
const comment = session.session.removeComment(id);
|
|
9597
|
-
this.saveRemoveCommentToHistory(comment,
|
|
9641
|
+
this.saveRemoveCommentToHistory(comment, session.source.getTarget());
|
|
9598
9642
|
this.editorService.removeCommentData([id]);
|
|
9599
9643
|
session.renderer.loop.schedule({ comments: true });
|
|
9600
9644
|
}
|
|
@@ -9656,7 +9700,7 @@ class Editor {
|
|
|
9656
9700
|
}
|
|
9657
9701
|
}
|
|
9658
9702
|
onLeftClick(event) {
|
|
9659
|
-
const position = this.renderer.
|
|
9703
|
+
const position = this.renderer.screenToParagraph(event.clientX, event.clientY);
|
|
9660
9704
|
if (!this.selection.isEmpty && this.session.isPositionInRange(position, this.selection.selectedRange)) {
|
|
9661
9705
|
this.onSelectionLeftClick(event);
|
|
9662
9706
|
}
|
|
@@ -9683,7 +9727,7 @@ class Editor {
|
|
|
9683
9727
|
this.focusCustomComponent(customElement);
|
|
9684
9728
|
return;
|
|
9685
9729
|
}
|
|
9686
|
-
const position = this.renderer.
|
|
9730
|
+
const position = this.renderer.screenToParagraph(event.clientX, event.clientY, 2);
|
|
9687
9731
|
if (event.shiftKey) {
|
|
9688
9732
|
this.selection.moveSelection(position);
|
|
9689
9733
|
}
|
|
@@ -9695,7 +9739,8 @@ class Editor {
|
|
|
9695
9739
|
const paragraph = this.session.displayData.paragraphs[position.row];
|
|
9696
9740
|
const error = this.grammarChecker.getError(this.session.sessionId, paragraph.id, position.column);
|
|
9697
9741
|
if (!this.editorService.isViewOnly && error) {
|
|
9698
|
-
const
|
|
9742
|
+
const paragraphPos = this.session.selection.cursor;
|
|
9743
|
+
const cursor = PositionHelper.paragraphToPixel(this.session, paragraphPos.row, paragraphPos.column);
|
|
9699
9744
|
const rect = this.renderer.container.getBoundingClientRect();
|
|
9700
9745
|
const hintLeft = rect.left + cursor.pageX;
|
|
9701
9746
|
const hintTop = rect.top + cursor.pageY - POPUP_HEIGHT;
|
|
@@ -9736,7 +9781,7 @@ class Editor {
|
|
|
9736
9781
|
return;
|
|
9737
9782
|
}
|
|
9738
9783
|
event.preventDefault();
|
|
9739
|
-
const position = this.renderer.
|
|
9784
|
+
const position = this.renderer.screenToParagraph(event.clientX, event.clientY, 2);
|
|
9740
9785
|
if (!isEdgeEdit && this.mainSession.customComponents.edges.isEdit) {
|
|
9741
9786
|
this.selection.placeCursor(position);
|
|
9742
9787
|
}
|
|
@@ -9754,7 +9799,7 @@ class Editor {
|
|
|
9754
9799
|
return;
|
|
9755
9800
|
}
|
|
9756
9801
|
event.preventDefault();
|
|
9757
|
-
const position = this.renderer.
|
|
9802
|
+
const position = this.renderer.screenToParagraph(event.clientX, event.clientY, 2);
|
|
9758
9803
|
const start = new CursorParagraph(position.row, 0);
|
|
9759
9804
|
const end = new CursorParagraph(position.row, this.session.displayData.getParagraphContent(position.row).length);
|
|
9760
9805
|
this.selection.placeSelection(start, end);
|
|
@@ -9813,7 +9858,7 @@ class Editor {
|
|
|
9813
9858
|
else {
|
|
9814
9859
|
this.regulatorService.setMainSessionAsCurrent();
|
|
9815
9860
|
}
|
|
9816
|
-
const cursorPosition = this.renderer.
|
|
9861
|
+
const cursorPosition = this.renderer.screenToParagraph(event.clientX, event.clientY, 2);
|
|
9817
9862
|
if (cursorPosition.row === this.selection.cursor.row && cursorPosition.column === this.selection.cursor.column) {
|
|
9818
9863
|
return;
|
|
9819
9864
|
}
|
|
@@ -9858,13 +9903,13 @@ class Editor {
|
|
|
9858
9903
|
const isInsideEdge = this.isInsideEdge(event.target);
|
|
9859
9904
|
const isEdgeEdit = this.mainSession.customComponents.edges.isEdit;
|
|
9860
9905
|
if (!isInsideEdge || isEdgeEdit) {
|
|
9861
|
-
const position = this.renderer.
|
|
9906
|
+
const position = this.renderer.screenToParagraph(event.clientX, event.clientY);
|
|
9862
9907
|
return this.session.getLinkModel(position);
|
|
9863
9908
|
}
|
|
9864
9909
|
const customElement = this.getCustomElement(event.target);
|
|
9865
9910
|
const sessionId = +customElement.attributes.getNamedItem('data-session-id').value;
|
|
9866
9911
|
const session = this.regulatorService.getSessionModel(sessionId);
|
|
9867
|
-
const position = session.renderer.
|
|
9912
|
+
const position = session.renderer.screenToParagraph(event.clientX, event.clientY, 1, customElement.getBoundingClientRect());
|
|
9868
9913
|
return session.session.getLinkModel(position);
|
|
9869
9914
|
}
|
|
9870
9915
|
setCurrentSession(element) {
|
|
@@ -9953,7 +9998,8 @@ class Editor {
|
|
|
9953
9998
|
this.rerenderMarker();
|
|
9954
9999
|
this.updateSelectedComment();
|
|
9955
10000
|
if (!this.selection.isEmpty && this.commentsVisible) {
|
|
9956
|
-
const
|
|
10001
|
+
const paragraphPos = this.session.selection.cursor;
|
|
10002
|
+
const cursor = PositionHelper.paragraphToPixel(this.session, paragraphPos.row, paragraphPos.column);
|
|
9957
10003
|
const mainRect = this.mainRenderer.container.getBoundingClientRect();
|
|
9958
10004
|
const rect = this.renderer.container.getBoundingClientRect();
|
|
9959
10005
|
const hintX = mainRect.right - 20;
|
|
@@ -10062,7 +10108,7 @@ class Editor {
|
|
|
10062
10108
|
this.onContentChange();
|
|
10063
10109
|
}
|
|
10064
10110
|
onMousePressedMove(event) {
|
|
10065
|
-
const position = this.renderer.
|
|
10111
|
+
const position = this.renderer.screenToParagraph(event.clientX, event.clientY, 2);
|
|
10066
10112
|
const cursor = this.selection.cursor;
|
|
10067
10113
|
this.selection.moveSelection(position);
|
|
10068
10114
|
if (cursor.column !== this.selection.cursor.column || cursor.row !== this.selection.cursor.row) {
|
|
@@ -10364,13 +10410,13 @@ class Editor {
|
|
|
10364
10410
|
return this.editorService.updateTableBorders$.subscribe(x => this.applyTableCellsStyles(x, (data, table, selection) => TableOperationsHelper.getApplyTableCellsBorders(data, table, selection)));
|
|
10365
10411
|
}
|
|
10366
10412
|
selectSpacingSubscription() {
|
|
10367
|
-
return this.editorService.selectSpacing$.subscribe(x => this.applyParagraphStyles(new
|
|
10413
|
+
return this.editorService.selectSpacing$.subscribe(x => this.applyParagraphStyles(new ParagraphStyleExtModel({ lineSpacing: x })));
|
|
10368
10414
|
}
|
|
10369
10415
|
selectBeforeSubscription() {
|
|
10370
|
-
return this.editorService.selectBefore$.subscribe(x => this.applyParagraphStyles(new
|
|
10416
|
+
return this.editorService.selectBefore$.subscribe(x => this.applyParagraphStyles(new ParagraphStyleExtModel({ spaceBefore: x })));
|
|
10371
10417
|
}
|
|
10372
10418
|
selectAfterSubscription() {
|
|
10373
|
-
return this.editorService.selectAfter$.subscribe(x => this.applyParagraphStyles(new
|
|
10419
|
+
return this.editorService.selectAfter$.subscribe(x => this.applyParagraphStyles(new ParagraphStyleExtModel({ spaceAfter: x })));
|
|
10374
10420
|
}
|
|
10375
10421
|
insertTextSubscription() {
|
|
10376
10422
|
return this.editorService.insertText$.subscribe(x => {
|
|
@@ -10498,10 +10544,11 @@ class Editor {
|
|
|
10498
10544
|
return this.editorService.setCommentSelected$.subscribe(x => {
|
|
10499
10545
|
for (const session of this.regulatorService.sessions) {
|
|
10500
10546
|
session.renderer.setSelectedComment(x);
|
|
10547
|
+
session.renderer.loop.schedule({ comments: true });
|
|
10501
10548
|
}
|
|
10502
10549
|
});
|
|
10503
10550
|
}
|
|
10504
|
-
|
|
10551
|
+
removeCommentSubscriptions() {
|
|
10505
10552
|
return this.editorService.removeComment$.subscribe(x => this.onCommentRemoved(x));
|
|
10506
10553
|
}
|
|
10507
10554
|
setComentsVisibilitySubscription() {
|
|
@@ -10562,7 +10609,8 @@ class Editor {
|
|
|
10562
10609
|
if (this.selection.range.isEmpty || !this.commentsVisible) {
|
|
10563
10610
|
return;
|
|
10564
10611
|
}
|
|
10565
|
-
const
|
|
10612
|
+
const paragraphPos = this.session.selection.cursor;
|
|
10613
|
+
const cursor = PositionHelper.paragraphToPixel(this.session, paragraphPos.row, paragraphPos.column);
|
|
10566
10614
|
const mainRect = this.mainRenderer.container.getBoundingClientRect();
|
|
10567
10615
|
const rect = this.renderer.container.getBoundingClientRect();
|
|
10568
10616
|
const hintX = mainRect.right - 20;
|
|
@@ -11328,7 +11376,7 @@ class TableSelection {
|
|
|
11328
11376
|
!this.canStartSelection(event.target)) {
|
|
11329
11377
|
return;
|
|
11330
11378
|
}
|
|
11331
|
-
const position = this.regulatorService.currentSession.renderer.
|
|
11379
|
+
const position = this.regulatorService.currentSession.renderer.screenToParagraph(event.clientX, event.clientY);
|
|
11332
11380
|
if (!this.session.selection.isEmpty && this.session.isPositionInRange(position, this.session.selection.selectedRange)) {
|
|
11333
11381
|
return;
|
|
11334
11382
|
}
|
|
@@ -12842,20 +12890,20 @@ class DisplayData extends EventEmitting {
|
|
|
12842
12890
|
const { tokens, paragraphToken } = this.getTokens(paragraphInfo.startIndex, paragraphInfo.content, paragraphSymbolIndex);
|
|
12843
12891
|
return { paragraphTokens: tokens, paragraphToken };
|
|
12844
12892
|
}
|
|
12845
|
-
getParagraphLineTokens(paragraphIndex,
|
|
12893
|
+
getParagraphLineTokens(paragraphIndex, paragraphLine) {
|
|
12846
12894
|
const paragraph = this.paragraphs[paragraphIndex];
|
|
12847
|
-
const lineStart =
|
|
12848
|
-
const lineEnd = paragraph.nextLineIndexes[
|
|
12895
|
+
const lineStart = paragraphLine > 0 ? paragraph.nextLineIndexes[paragraphLine - 1] : 0;
|
|
12896
|
+
const lineEnd = paragraph.nextLineIndexes[paragraphLine] ? paragraph.nextLineIndexes[paragraphLine] : paragraph.content.length;
|
|
12849
12897
|
const lineContent = paragraph.content.substring(lineStart, lineEnd);
|
|
12850
12898
|
const paragraphSymbolIndex = paragraph.paragraphSettings.startInsertIndex + paragraph.content.length;
|
|
12851
12899
|
const { tokens } = this.getTokens(lineStart + paragraph.startIndex, lineContent, paragraphSymbolIndex);
|
|
12852
12900
|
const pageFormat = this.getPageFormatAtPosition(this.paragraphs[paragraphIndex].startIndex);
|
|
12853
12901
|
const paragraphStyle = this.model.paragraphs[paragraphIndex].paragraphStyle;
|
|
12854
|
-
const lineInfo = paragraph.paragraphSettings.textLinesInfo[
|
|
12902
|
+
const lineInfo = paragraph.paragraphSettings.textLinesInfo[paragraphLine];
|
|
12855
12903
|
const maxWidth = pageFormat.contentWidth - lineInfo.indent.right - lineInfo.indent.markerWidth;
|
|
12856
12904
|
const startWidth = lineInfo.indentLeft + lineInfo.indentFirstLine - lineInfo.indent.hanging || 0;
|
|
12857
12905
|
this.computeWrapIndex(tokens, startWidth, maxWidth, paragraphStyle.tabSettings ?? []); // needed to proceed a tab width correction according to the tabs complex positioning
|
|
12858
|
-
const isLast =
|
|
12906
|
+
const isLast = paragraphLine === paragraph.nextLineIndexes.length;
|
|
12859
12907
|
LineInfoHelper.get(tokens, false, isLast, paragraphStyle, lineInfo.indent, lineInfo.isNumbering, pageFormat.contentWidth, 0, 0); // needed to proceed a space width correction according to the wordSpacing in case of justify alignment
|
|
12860
12908
|
return tokens;
|
|
12861
12909
|
}
|
|
@@ -13860,12 +13908,6 @@ class EditSession {
|
|
|
13860
13908
|
destroy() {
|
|
13861
13909
|
this.displayData.destroy();
|
|
13862
13910
|
}
|
|
13863
|
-
getRowLength(row) {
|
|
13864
|
-
if (!this.displayData.paragraphs[row].nextLineIndexes) {
|
|
13865
|
-
return 1;
|
|
13866
|
-
}
|
|
13867
|
-
return this.displayData.paragraphs[row].nextLineIndexes.length + 1;
|
|
13868
|
-
}
|
|
13869
13911
|
getRowCacheIndex(cacheArray, value) {
|
|
13870
13912
|
let start = 0;
|
|
13871
13913
|
let end = cacheArray.length - 1;
|
|
@@ -14644,12 +14686,16 @@ class HighlightLayer {
|
|
|
14644
14686
|
selectionElement.className = cssClass;
|
|
14645
14687
|
return selectionElement;
|
|
14646
14688
|
}
|
|
14647
|
-
|
|
14648
|
-
const
|
|
14649
|
-
const
|
|
14650
|
-
|
|
14651
|
-
|
|
14652
|
-
|
|
14689
|
+
getTopByDocumentLine(documentLine) {
|
|
14690
|
+
const { paragraph, paragraphLine } = PositionHelper.documentLineToParagraphLine(this.session.displayData.paragraphs, documentLine);
|
|
14691
|
+
const settings = this.session.displayData.paragraphs[paragraph].paragraphSettings;
|
|
14692
|
+
const lineTopOffset = PositionHelper.getLineTopOffset(settings.textLinesInfo, paragraphLine);
|
|
14693
|
+
return settings.distanceFromTop + lineTopOffset - this.session.scrollTop;
|
|
14694
|
+
}
|
|
14695
|
+
getTopByParagraphLine(paragraph, paragraphLine) {
|
|
14696
|
+
const settings = this.session.displayData.paragraphs[paragraph].paragraphSettings;
|
|
14697
|
+
const lineTopOffset = PositionHelper.getLineTopOffset(settings.textLinesInfo, paragraphLine);
|
|
14698
|
+
return settings.distanceFromTop + lineTopOffset - this.session.scrollTop;
|
|
14653
14699
|
}
|
|
14654
14700
|
// Draws a multi line marker, where lines span the full width
|
|
14655
14701
|
drawMultiLineMarker(range, cssClass) {
|
|
@@ -14660,13 +14706,10 @@ class HighlightLayer {
|
|
|
14660
14706
|
const visibleParagraphs = paragraphs.filter(x => x.paragraphSettings.lastScreenLine >= start && x.paragraphSettings.firstScreenLine <= end);
|
|
14661
14707
|
const textLinesInfo = visibleParagraphs
|
|
14662
14708
|
.map(x => x.paragraphSettings.textLinesInfo
|
|
14663
|
-
.filter(
|
|
14709
|
+
.filter(y => start <= y.screenLine && y.screenLine <= end)
|
|
14664
14710
|
.map(y => ({ textLinesInfo: y, paragraphSettings: x.paragraphSettings })))
|
|
14665
14711
|
.flat();
|
|
14666
|
-
|
|
14667
|
-
let top = paragraphs[paragraphInfo.paragraphIndex].paragraphSettings.distanceFromTop +
|
|
14668
|
-
paragraphInfo.lineTopOffset -
|
|
14669
|
-
this.session.scrollTop;
|
|
14712
|
+
let top = this.getTopByDocumentLine(start);
|
|
14670
14713
|
const padding = this.session.displayData.pagesFormat[this.session.displayData.pagesFormat.length - 1].pageFormatModel.marginLeft;
|
|
14671
14714
|
const results = [];
|
|
14672
14715
|
for (let i = 0; i < textLinesInfo.length; i++) {
|
|
@@ -14679,13 +14722,13 @@ class HighlightLayer {
|
|
|
14679
14722
|
const left = lineInfo.paddingLeft + padding + lineInfo.offsetMargin + markerOffset;
|
|
14680
14723
|
let style;
|
|
14681
14724
|
if (i === 0) {
|
|
14682
|
-
const rangeInfo = this.getRangeInfo(
|
|
14725
|
+
const rangeInfo = this.getRangeInfo(range);
|
|
14683
14726
|
const width = lineInfo.width - rangeInfo.leftPos + left;
|
|
14684
14727
|
style = this.getMarkerStyle(lineInfo.height, width, top, rangeInfo.leftPos);
|
|
14685
14728
|
}
|
|
14686
14729
|
else if (i === textLinesInfo.length - 1) {
|
|
14687
14730
|
const lastRowRange = new Range(new CursorParagraph(range.end.row, 0), range.end);
|
|
14688
|
-
const rangeInfo = this.getRangeInfo(
|
|
14731
|
+
const rangeInfo = this.getRangeInfo(lastRowRange);
|
|
14689
14732
|
style = this.getMarkerStyle(lineInfo.height, rangeInfo.screenWidth, top, left);
|
|
14690
14733
|
}
|
|
14691
14734
|
else {
|
|
@@ -14700,32 +14743,34 @@ class HighlightLayer {
|
|
|
14700
14743
|
}
|
|
14701
14744
|
// Draws a marker which covers part or whole width of a single screen line
|
|
14702
14745
|
drawSingleLineMarker(range, cssClass) {
|
|
14703
|
-
const rangeInfo = this.getRangeInfo(
|
|
14704
|
-
const
|
|
14705
|
-
const
|
|
14706
|
-
const
|
|
14707
|
-
const
|
|
14708
|
-
const
|
|
14709
|
-
|
|
14746
|
+
const rangeInfo = this.getRangeInfo(range);
|
|
14747
|
+
const paragraphs = this.session.displayData.paragraphs;
|
|
14748
|
+
const { paragraph, paragraphLine } = PositionHelper.documentLineToParagraphLine(paragraphs, range.start.row);
|
|
14749
|
+
const lineHeight = paragraphs[paragraph].paragraphSettings.textLinesInfo[paragraphLine].height;
|
|
14750
|
+
const height = rangeInfo.screenHeight || lineHeight;
|
|
14751
|
+
const top = this.getTopByParagraphLine(paragraph, paragraphLine);
|
|
14752
|
+
const markerStyle = this.getMarkerStyle(height, rangeInfo.screenWidth, top, rangeInfo.leftPos);
|
|
14753
|
+
return this.renderHighlight(markerStyle, cssClass);
|
|
14710
14754
|
}
|
|
14711
14755
|
drawCustomElementHighlight(elementInfo, cssClass, screenParentRange) {
|
|
14712
|
-
const
|
|
14713
|
-
const
|
|
14714
|
-
const
|
|
14715
|
-
const
|
|
14756
|
+
const paragraphPos = elementInfo.parentRange.start;
|
|
14757
|
+
const documentLine = PositionHelper.paragraphToDocumentLine(this.session, paragraphPos.row, paragraphPos.column);
|
|
14758
|
+
const paragraph = this.session.displayData.paragraphs[paragraphPos.row];
|
|
14759
|
+
const lineInfo = paragraph.paragraphSettings.textLinesInfo.find(x => x.screenLine === documentLine.column);
|
|
14760
|
+
const elementIndex = paragraph.startIndex + paragraphPos.column;
|
|
14716
14761
|
const element = this.session.customComponents.customElements.find(x => x.instance.content.insertIndex === elementIndex);
|
|
14717
14762
|
if (!element) {
|
|
14718
14763
|
return;
|
|
14719
14764
|
}
|
|
14720
|
-
const top = this.
|
|
14721
|
-
const
|
|
14722
|
-
this.renderHighlight(this.getMarkerStyle(elementInfo.location.height, elementInfo.location.width, top + lineInfo.ascent - elementInfo.location.height + elementInfo.location.top,
|
|
14765
|
+
const top = this.getTopByDocumentLine(screenParentRange.start.row);
|
|
14766
|
+
const startPos = PositionHelper.documentLineToPixel(this.session, screenParentRange.start.row, screenParentRange.start.column);
|
|
14767
|
+
this.renderHighlight(this.getMarkerStyle(elementInfo.location.height, elementInfo.location.width, top + lineInfo.ascent - elementInfo.location.height + elementInfo.location.top, startPos.pageX + elementInfo.location.left), cssClass);
|
|
14723
14768
|
}
|
|
14724
|
-
getRangeInfo(
|
|
14725
|
-
const
|
|
14726
|
-
const
|
|
14727
|
-
const startPos = PositionHelper.
|
|
14728
|
-
const endPos = PositionHelper.
|
|
14769
|
+
getRangeInfo(range) {
|
|
14770
|
+
const startLine = range.start;
|
|
14771
|
+
const endLine = range.end;
|
|
14772
|
+
const startPos = PositionHelper.documentLineToPixel(this.session, startLine.row, startLine.column);
|
|
14773
|
+
const endPos = PositionHelper.documentLineToPixel(this.session, endLine.row, endLine.column);
|
|
14729
14774
|
return {
|
|
14730
14775
|
screenWidth: Math.abs(endPos.pageX - startPos.pageX),
|
|
14731
14776
|
screenHeight: Math.abs(endPos.pageY - startPos.pageY),
|
|
@@ -14759,7 +14804,7 @@ class CommentHighlightLayer extends HighlightLayer {
|
|
|
14759
14804
|
const startPosition = ContentHelper.documentIndexToParagraphIndex(this.session.displayData.paragraphs, comment.startIndex);
|
|
14760
14805
|
const endPosition = ContentHelper.documentIndexToParagraphIndex(this.session.displayData.paragraphs, comment.endIndex + 1);
|
|
14761
14806
|
const range = new Range(startPosition, endPosition);
|
|
14762
|
-
const screenRange = range.
|
|
14807
|
+
const screenRange = range.paragraphToDocumentLine(this.session);
|
|
14763
14808
|
if (config.visibleRange &&
|
|
14764
14809
|
(screenRange.end.row < config.visibleRange.startScreenLine || screenRange.start.row > config.visibleRange.endScreenLine)) {
|
|
14765
14810
|
this.commentService.removeCommentFromRender(this.session.sessionId, comment.commentId);
|
|
@@ -14841,7 +14886,7 @@ class CursorLayer {
|
|
|
14841
14886
|
if (!position) {
|
|
14842
14887
|
position = this.session.selection.cursor;
|
|
14843
14888
|
}
|
|
14844
|
-
return PositionHelper.
|
|
14889
|
+
return PositionHelper.paragraphToPixel(this.session, position.row, position.column);
|
|
14845
14890
|
}
|
|
14846
14891
|
addTextStylesToCursor() {
|
|
14847
14892
|
const textStyle = this.session.editorService.styles;
|
|
@@ -14909,7 +14954,7 @@ class GrammarHighlightLayer extends HighlightLayer {
|
|
|
14909
14954
|
continue;
|
|
14910
14955
|
}
|
|
14911
14956
|
for (const error of grammarErrors) {
|
|
14912
|
-
const range = new Range(new CursorParagraph(index, error.offset), new CursorParagraph(index, error.offset + error.length)).
|
|
14957
|
+
const range = new Range(new CursorParagraph(index, error.offset), new CursorParagraph(index, error.offset + error.length)).paragraphToDocumentLine(this.session);
|
|
14913
14958
|
if (config.visibleRange &&
|
|
14914
14959
|
(range.end.row < config.visibleRange.startScreenLine || range.start.row > config.visibleRange.endScreenLine)) {
|
|
14915
14960
|
continue;
|
|
@@ -15039,7 +15084,7 @@ class SearchHighlightLayer extends HighlightLayer {
|
|
|
15039
15084
|
this.getVisibleCustomElementResults(config);
|
|
15040
15085
|
if (this.active) {
|
|
15041
15086
|
if (this.active instanceof Range) {
|
|
15042
|
-
const screenRange = this.active.
|
|
15087
|
+
const screenRange = this.active.paragraphToDocumentLine(this.session);
|
|
15043
15088
|
if (!screenRange.isEmpty &&
|
|
15044
15089
|
(!config.visibleRange ||
|
|
15045
15090
|
(screenRange.start.row >= config.visibleRange.startScreenLine &&
|
|
@@ -15054,13 +15099,13 @@ class SearchHighlightLayer extends HighlightLayer {
|
|
|
15054
15099
|
}
|
|
15055
15100
|
else {
|
|
15056
15101
|
this.updateActiveResult();
|
|
15057
|
-
const screenParentRange = this.active.parentRange.
|
|
15102
|
+
const screenParentRange = this.active.parentRange.paragraphToDocumentLine(this.session);
|
|
15058
15103
|
this.drawCustomElementHighlight(this.active, this.selectedClassName, screenParentRange);
|
|
15059
15104
|
}
|
|
15060
15105
|
}
|
|
15061
15106
|
if (this.markers?.length) {
|
|
15062
15107
|
const ranges = this.markers
|
|
15063
|
-
.map(x => x.
|
|
15108
|
+
.map(x => x.paragraphToDocumentLine(this.session))
|
|
15064
15109
|
.filter(x => !x.isEmpty &&
|
|
15065
15110
|
(!config.visibleRange ||
|
|
15066
15111
|
(x.start.row >= config.visibleRange.startScreenLine && x.end.row <= config.visibleRange.endScreenLine)) &&
|
|
@@ -15085,7 +15130,7 @@ class SearchHighlightLayer extends HighlightLayer {
|
|
|
15085
15130
|
this.active.location.isEqual(element.location))) {
|
|
15086
15131
|
continue;
|
|
15087
15132
|
}
|
|
15088
|
-
const screenParentRange = element.parentRange.
|
|
15133
|
+
const screenParentRange = element.parentRange.paragraphToDocumentLine(this.session);
|
|
15089
15134
|
if (!config.visibleRange ||
|
|
15090
15135
|
(screenParentRange.start.row >= config.visibleRange.startScreenLine &&
|
|
15091
15136
|
screenParentRange.end.row <= config.visibleRange.endScreenLine)) {
|
|
@@ -15123,7 +15168,7 @@ class SearchHighlightLayer extends HighlightLayer {
|
|
|
15123
15168
|
return;
|
|
15124
15169
|
}
|
|
15125
15170
|
for (const group of groupedByParentRange) {
|
|
15126
|
-
const screenParentRange = group.range.
|
|
15171
|
+
const screenParentRange = group.range.paragraphToDocumentLine(this.session);
|
|
15127
15172
|
if (config.visibleRange &&
|
|
15128
15173
|
(screenParentRange.start.row < config.visibleRange.startScreenLine ||
|
|
15129
15174
|
screenParentRange.end.row > config.visibleRange.endScreenLine)) {
|
|
@@ -15167,7 +15212,7 @@ class SelectionLayer extends HighlightLayer {
|
|
|
15167
15212
|
if (this.marker) {
|
|
15168
15213
|
let range = this.marker.clipRows(config.contentRange.start, config.contentRange.end);
|
|
15169
15214
|
if (!range.isEmpty) {
|
|
15170
|
-
range = range.
|
|
15215
|
+
range = range.paragraphToDocumentLine(this.session);
|
|
15171
15216
|
if (range.isSingleLine) {
|
|
15172
15217
|
this.drawSingleLineMarker(range, this.className);
|
|
15173
15218
|
}
|
|
@@ -15393,23 +15438,13 @@ class Renderer extends EventEmitting {
|
|
|
15393
15438
|
updateCursor() {
|
|
15394
15439
|
this.loop.schedule({ cursor: true });
|
|
15395
15440
|
}
|
|
15396
|
-
|
|
15397
|
-
|
|
15398
|
-
*/
|
|
15399
|
-
screenToTextCoordinatesUsingMidpoint(x, y, rect) {
|
|
15400
|
-
const { left, top } = rect ?? this.container.getBoundingClientRect();
|
|
15401
|
-
const { paragraphIndex, lineIndex } = PositionHelper.getParagraphAndLineIndexFromYPosition(this.session, y, top);
|
|
15402
|
-
const { line, indexInLine } = PositionHelper.mapPixelToClosestTokenMidpoint(this.session, x, paragraphIndex, lineIndex, left);
|
|
15403
|
-
return PositionHelper.screenToDocument(this.session, line, indexInLine);
|
|
15404
|
-
}
|
|
15405
|
-
/**
|
|
15406
|
-
* Converts screen coordinates to text coordinates by mapping to the next token boundary.
|
|
15407
|
-
*/
|
|
15408
|
-
screenToTextCoordinatesUsingBoundary(x, y, rect) {
|
|
15441
|
+
// tokenDivider - used to measure if token fits (1 - should be fully fit, 2 - half of token, 3 - third part, ...) to be included
|
|
15442
|
+
screenToParagraph(x, y, tokenDivider = 1, rect) {
|
|
15409
15443
|
const { left, top } = rect ?? this.container.getBoundingClientRect();
|
|
15410
|
-
const
|
|
15411
|
-
const
|
|
15412
|
-
|
|
15444
|
+
const pageX = x - left;
|
|
15445
|
+
const pageY = y + this.session.scrollTop - top;
|
|
15446
|
+
const { paragraph, indexInParagraph } = PositionHelper.pixelToParagraph(this.session, pageX, pageY, tokenDivider);
|
|
15447
|
+
return new CursorParagraph(paragraph, indexInParagraph);
|
|
15413
15448
|
}
|
|
15414
15449
|
showCursor() {
|
|
15415
15450
|
this.cursorLayer.showCursor();
|
|
@@ -15459,7 +15494,6 @@ class Renderer extends EventEmitting {
|
|
|
15459
15494
|
}
|
|
15460
15495
|
setSelectedComment(comment) {
|
|
15461
15496
|
this.commentsLayer.setSelectedComment(comment);
|
|
15462
|
-
this.commentsLayer.update(this.layerConfig);
|
|
15463
15497
|
}
|
|
15464
15498
|
setCommentsVisibility(value) {
|
|
15465
15499
|
this.commentsLayer.enabled = value;
|
|
@@ -15968,11 +16002,9 @@ class VirtualRenderer {
|
|
|
15968
16002
|
this.commentLayer.scrollComments(deltaY);
|
|
15969
16003
|
this.loop.schedule({ scroll: true });
|
|
15970
16004
|
}
|
|
15971
|
-
|
|
15972
|
-
|
|
15973
|
-
|
|
15974
|
-
screenToTextCoordinatesUsingBoundary(x, y, rect) {
|
|
15975
|
-
return this.renderer.screenToTextCoordinatesUsingBoundary(x, y, rect);
|
|
16005
|
+
// tokenDivider - used to measure if token fits (1 - should be fully fit, 2 - half of token, 3 - third part, ...) to be included
|
|
16006
|
+
screenToParagraph(x, y, tokenDivider = 1, rect) {
|
|
16007
|
+
return this.renderer.screenToParagraph(x, y, tokenDivider, rect);
|
|
15976
16008
|
}
|
|
15977
16009
|
showCursor() {
|
|
15978
16010
|
this.renderer.showCursor();
|
|
@@ -16428,10 +16460,10 @@ class RegulatorService {
|
|
|
16428
16460
|
}
|
|
16429
16461
|
return result;
|
|
16430
16462
|
}
|
|
16431
|
-
|
|
16463
|
+
getCommentSessionModel(commentId) {
|
|
16432
16464
|
for (const session of this.sessions) {
|
|
16433
16465
|
if (session.session.model.comments.some(x => x.commentId === commentId)) {
|
|
16434
|
-
return
|
|
16466
|
+
return session;
|
|
16435
16467
|
}
|
|
16436
16468
|
}
|
|
16437
16469
|
return null;
|
|
@@ -18184,11 +18216,11 @@ class NumberingComponent {
|
|
|
18184
18216
|
this.selectNumberingTemplate.emit(numberingTemplateType);
|
|
18185
18217
|
}
|
|
18186
18218
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NumberingComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
18187
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: NumberingComponent, isStandalone: false, selector: "app-nod-numbering", inputs: { isDisabled: "isDisabled", selectedNumberingType: "selectedNumberingType", selectedNumberingTemplate: "selectedNumberingTemplate" }, outputs: { selectNumberingTemplate: "selectNumberingTemplate", removeNumberings: "removeNumberings" }, ngImport: i0, template: "<mat-button-toggle-group\n name=\"format\"\n [hideMultipleSelectionIndicator]=\"true\"\n [hideSingleSelectionIndicator]=\"true\"\n [disabled]=\"isDisabled\">\n <mat-button-toggle\n (click)=\"onToggleBulletedNumbering()\"\n [value]=\"numberingType.Bullet\"\n [checked]=\"selectedNumberingType === numberingType.Bullet\"\n [matTooltip]=\"'NODER.TOOLTIP.BULLETED_LIST' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-bulleted\"></mat-icon>\n </mat-button-toggle>\n <button\n mat-button\n [matMenuTriggerFor]=\"listBulletedMenu\"\n [matMenuTriggerRestoreFocus]=\"false\"\n [disabled]=\"isDisabled\"\n [matTooltip]=\"'NODER.TOOLTIP.BULLETED_MENU' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-arrow-dropdown\"></mat-icon>\n </button>\n <mat-menu\n #listBulletedMenu=\"matMenu\"\n class=\"dropdown-numbering-overlay noder-modal\"\n yPosition=\"below\">\n <div class=\"list-icon list-marker\">\n <mat-icon\n svgIcon=\"marker-1\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList1)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList1\"></mat-icon>\n <mat-icon\n svgIcon=\"marker-2\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList2)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList2\"></mat-icon>\n <mat-icon\n svgIcon=\"marker-3\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList3)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList3\"></mat-icon>\n </div>\n <div class=\"list-icon list-marker\">\n <mat-icon\n svgIcon=\"marker-4\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList4)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList4\"></mat-icon>\n <mat-icon\n svgIcon=\"marker-5\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList5)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList5\"></mat-icon>\n <mat-icon\n svgIcon=\"marker-6\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList6)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList6\"></mat-icon>\n </div>\n </mat-menu>\n <mat-button-toggle\n (click)=\"onToggleNumberedNumbering()\"\n [value]=\"numberingType.Number\"\n [checked]=\"selectedNumberingType === numberingType.Number\"\n [matTooltip]=\"'NODER.TOOLTIP.NUMBERED_LIST' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-numbered\"></mat-icon>\n </mat-button-toggle>\n <button\n mat-button\n [matMenuTriggerFor]=\"listNumberedMenu\"\n [matMenuTriggerRestoreFocus]=\"false\"\n [disabled]=\"isDisabled\"
|
|
18219
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: NumberingComponent, isStandalone: false, selector: "app-nod-numbering", inputs: { isDisabled: "isDisabled", selectedNumberingType: "selectedNumberingType", selectedNumberingTemplate: "selectedNumberingTemplate" }, outputs: { selectNumberingTemplate: "selectNumberingTemplate", removeNumberings: "removeNumberings" }, ngImport: i0, template: "<mat-button-toggle-group\n name=\"format\"\n [hideMultipleSelectionIndicator]=\"true\"\n [hideSingleSelectionIndicator]=\"true\"\n [disabled]=\"isDisabled\">\n <mat-button-toggle\n (click)=\"onToggleBulletedNumbering()\"\n [value]=\"numberingType.Bullet\"\n [checked]=\"selectedNumberingType === numberingType.Bullet\"\n [matTooltip]=\"'NODER.TOOLTIP.BULLETED_LIST' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-bulleted\"></mat-icon>\n </mat-button-toggle>\n <button\n mat-button\n [matMenuTriggerFor]=\"listBulletedMenu\"\n [matMenuTriggerRestoreFocus]=\"false\"\n [disabled]=\"isDisabled\"\n [matTooltip]=\"'NODER.TOOLTIP.BULLETED_MENU' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-arrow-dropdown\"></mat-icon>\n </button>\n <mat-menu\n #listBulletedMenu=\"matMenu\"\n class=\"dropdown-numbering-overlay noder-modal\"\n yPosition=\"below\">\n <div class=\"list-icon list-marker\">\n <mat-icon\n svgIcon=\"marker-1\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList1)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList1\"></mat-icon>\n <mat-icon\n svgIcon=\"marker-2\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList2)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList2\"></mat-icon>\n <mat-icon\n svgIcon=\"marker-3\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList3)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList3\"></mat-icon>\n </div>\n <div class=\"list-icon list-marker\">\n <mat-icon\n svgIcon=\"marker-4\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList4)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList4\"></mat-icon>\n <mat-icon\n svgIcon=\"marker-5\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList5)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList5\"></mat-icon>\n <mat-icon\n svgIcon=\"marker-6\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList6)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList6\"></mat-icon>\n </div>\n </mat-menu>\n <mat-button-toggle\n (click)=\"onToggleNumberedNumbering()\"\n [value]=\"numberingType.Number\"\n [checked]=\"selectedNumberingType === numberingType.Number\"\n [matTooltip]=\"'NODER.TOOLTIP.NUMBERED_LIST' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-numbered\"></mat-icon>\n </mat-button-toggle>\n <button\n mat-button\n [matMenuTriggerFor]=\"listNumberedMenu\"\n [matMenuTriggerRestoreFocus]=\"false\"\n [disabled]=\"isDisabled\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-arrow-dropdown\"></mat-icon>\n </button>\n <mat-menu\n #listNumberedMenu=\"matMenu\"\n class=\"dropdown-numbering-overlay noder-modal\"\n yPosition=\"below\">\n <div class=\"list-icon list-number\">\n <mat-icon\n svgIcon=\"number-1\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.NumberList1)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.NumberList1\"></mat-icon>\n <mat-icon\n svgIcon=\"number-2\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.NumberList2)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.NumberList2\"></mat-icon>\n <mat-icon\n svgIcon=\"number-3\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.NumberList3)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.NumberList3\"></mat-icon>\n </div>\n <div class=\"list-icon list-number\">\n <mat-icon\n svgIcon=\"number-4\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.NumberList4)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.NumberList4\"></mat-icon>\n <mat-icon\n svgIcon=\"number-5\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.NumberList5)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.NumberList5\"></mat-icon>\n <mat-icon\n svgIcon=\"number-6\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.NumberList6)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.NumberList6\"></mat-icon>\n </div>\n </mat-menu>\n</mat-button-toggle-group>\n", styles: [":host{display:flex;align-items:center}mat-button-toggle-group,button{margin:0 3px}.mat-button-toggle-group-appearance-standard .mat-button-toggle+.mat-button-toggle{border-left:0}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border:0}.mdc-button{min-width:32px;min-height:32px;padding:0}.mat-mdc-button>.mat-icon{margin-right:0}.mat-button-toggle-group{align-items:center}.mat-button-toggle-group .mdc-button{min-width:20px;height:32px;padding:0}.list-marker,.list-number{margin:0 5px}.list-marker mat-icon,.list-number mat-icon{width:70px;height:80px;margin:0 5px}.list-marker mat-icon:hover,.list-number mat-icon:hover{border:none!important}.list-icon .selected,.list-icon .selected:hover{border-width:2px;border-style:solid}\n"], dependencies: [{ kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i3$2.MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "disabledInteractive", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "component", type: i3$2.MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled", "disabledInteractive"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i4$1.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "directive", type: i4$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i5$1.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: i6.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
18188
18220
|
}
|
|
18189
18221
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: NumberingComponent, decorators: [{
|
|
18190
18222
|
type: Component,
|
|
18191
|
-
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'app-nod-numbering', standalone: false, template: "<mat-button-toggle-group\n name=\"format\"\n [hideMultipleSelectionIndicator]=\"true\"\n [hideSingleSelectionIndicator]=\"true\"\n [disabled]=\"isDisabled\">\n <mat-button-toggle\n (click)=\"onToggleBulletedNumbering()\"\n [value]=\"numberingType.Bullet\"\n [checked]=\"selectedNumberingType === numberingType.Bullet\"\n [matTooltip]=\"'NODER.TOOLTIP.BULLETED_LIST' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-bulleted\"></mat-icon>\n </mat-button-toggle>\n <button\n mat-button\n [matMenuTriggerFor]=\"listBulletedMenu\"\n [matMenuTriggerRestoreFocus]=\"false\"\n [disabled]=\"isDisabled\"\n [matTooltip]=\"'NODER.TOOLTIP.BULLETED_MENU' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-arrow-dropdown\"></mat-icon>\n </button>\n <mat-menu\n #listBulletedMenu=\"matMenu\"\n class=\"dropdown-numbering-overlay noder-modal\"\n yPosition=\"below\">\n <div class=\"list-icon list-marker\">\n <mat-icon\n svgIcon=\"marker-1\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList1)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList1\"></mat-icon>\n <mat-icon\n svgIcon=\"marker-2\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList2)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList2\"></mat-icon>\n <mat-icon\n svgIcon=\"marker-3\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList3)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList3\"></mat-icon>\n </div>\n <div class=\"list-icon list-marker\">\n <mat-icon\n svgIcon=\"marker-4\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList4)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList4\"></mat-icon>\n <mat-icon\n svgIcon=\"marker-5\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList5)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList5\"></mat-icon>\n <mat-icon\n svgIcon=\"marker-6\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList6)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList6\"></mat-icon>\n </div>\n </mat-menu>\n <mat-button-toggle\n (click)=\"onToggleNumberedNumbering()\"\n [value]=\"numberingType.Number\"\n [checked]=\"selectedNumberingType === numberingType.Number\"\n [matTooltip]=\"'NODER.TOOLTIP.NUMBERED_LIST' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-numbered\"></mat-icon>\n </mat-button-toggle>\n <button\n mat-button\n [matMenuTriggerFor]=\"listNumberedMenu\"\n [matMenuTriggerRestoreFocus]=\"false\"\n [disabled]=\"isDisabled\"
|
|
18223
|
+
args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'app-nod-numbering', standalone: false, template: "<mat-button-toggle-group\n name=\"format\"\n [hideMultipleSelectionIndicator]=\"true\"\n [hideSingleSelectionIndicator]=\"true\"\n [disabled]=\"isDisabled\">\n <mat-button-toggle\n (click)=\"onToggleBulletedNumbering()\"\n [value]=\"numberingType.Bullet\"\n [checked]=\"selectedNumberingType === numberingType.Bullet\"\n [matTooltip]=\"'NODER.TOOLTIP.BULLETED_LIST' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-bulleted\"></mat-icon>\n </mat-button-toggle>\n <button\n mat-button\n [matMenuTriggerFor]=\"listBulletedMenu\"\n [matMenuTriggerRestoreFocus]=\"false\"\n [disabled]=\"isDisabled\"\n [matTooltip]=\"'NODER.TOOLTIP.BULLETED_MENU' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-arrow-dropdown\"></mat-icon>\n </button>\n <mat-menu\n #listBulletedMenu=\"matMenu\"\n class=\"dropdown-numbering-overlay noder-modal\"\n yPosition=\"below\">\n <div class=\"list-icon list-marker\">\n <mat-icon\n svgIcon=\"marker-1\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList1)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList1\"></mat-icon>\n <mat-icon\n svgIcon=\"marker-2\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList2)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList2\"></mat-icon>\n <mat-icon\n svgIcon=\"marker-3\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList3)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList3\"></mat-icon>\n </div>\n <div class=\"list-icon list-marker\">\n <mat-icon\n svgIcon=\"marker-4\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList4)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList4\"></mat-icon>\n <mat-icon\n svgIcon=\"marker-5\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList5)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList5\"></mat-icon>\n <mat-icon\n svgIcon=\"marker-6\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.BulletList6)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.BulletList6\"></mat-icon>\n </div>\n </mat-menu>\n <mat-button-toggle\n (click)=\"onToggleNumberedNumbering()\"\n [value]=\"numberingType.Number\"\n [checked]=\"selectedNumberingType === numberingType.Number\"\n [matTooltip]=\"'NODER.TOOLTIP.NUMBERED_LIST' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-numbered\"></mat-icon>\n </mat-button-toggle>\n <button\n mat-button\n [matMenuTriggerFor]=\"listNumberedMenu\"\n [matMenuTriggerRestoreFocus]=\"false\"\n [disabled]=\"isDisabled\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-arrow-dropdown\"></mat-icon>\n </button>\n <mat-menu\n #listNumberedMenu=\"matMenu\"\n class=\"dropdown-numbering-overlay noder-modal\"\n yPosition=\"below\">\n <div class=\"list-icon list-number\">\n <mat-icon\n svgIcon=\"number-1\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.NumberList1)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.NumberList1\"></mat-icon>\n <mat-icon\n svgIcon=\"number-2\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.NumberList2)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.NumberList2\"></mat-icon>\n <mat-icon\n svgIcon=\"number-3\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.NumberList3)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.NumberList3\"></mat-icon>\n </div>\n <div class=\"list-icon list-number\">\n <mat-icon\n svgIcon=\"number-4\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.NumberList4)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.NumberList4\"></mat-icon>\n <mat-icon\n svgIcon=\"number-5\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.NumberList5)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.NumberList5\"></mat-icon>\n <mat-icon\n svgIcon=\"number-6\"\n (click)=\"onSelectNumberingTemplate(numberingTemplateType.NumberList6)\"\n [class.selected]=\"selectedNumberingTemplate === numberingTemplateType.NumberList6\"></mat-icon>\n </div>\n </mat-menu>\n</mat-button-toggle-group>\n", styles: [":host{display:flex;align-items:center}mat-button-toggle-group,button{margin:0 3px}.mat-button-toggle-group-appearance-standard .mat-button-toggle+.mat-button-toggle{border-left:0}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border:0}.mdc-button{min-width:32px;min-height:32px;padding:0}.mat-mdc-button>.mat-icon{margin-right:0}.mat-button-toggle-group{align-items:center}.mat-button-toggle-group .mdc-button{min-width:20px;height:32px;padding:0}.list-marker,.list-number{margin:0 5px}.list-marker mat-icon,.list-number mat-icon{width:70px;height:80px;margin:0 5px}.list-marker mat-icon:hover,.list-number mat-icon:hover{border:none!important}.list-icon .selected,.list-icon .selected:hover{border-width:2px;border-style:solid}\n"] }]
|
|
18192
18224
|
}], propDecorators: { isDisabled: [{
|
|
18193
18225
|
type: Input
|
|
18194
18226
|
}], selectedNumberingType: [{
|
|
@@ -18631,7 +18663,7 @@ class TextFormatMobileComponent {
|
|
|
18631
18663
|
onApply() {
|
|
18632
18664
|
const textStyles = new TextStyleModel(this.styles);
|
|
18633
18665
|
this.editorService.setTextStyles(textStyles);
|
|
18634
|
-
const paragraphStyles = new
|
|
18666
|
+
const paragraphStyles = new ParagraphStyleExtModel({ alignment: this.styles.alignment });
|
|
18635
18667
|
this.editorService.setParagraphStyles(paragraphStyles);
|
|
18636
18668
|
if (this.selectedNumberingTemplate !== null) {
|
|
18637
18669
|
const templateLevels = NumberingTemplates.find(x => x.templateType === this.selectedNumberingTemplate).levels;
|
|
@@ -19542,5 +19574,5 @@ class OperationModel {
|
|
|
19542
19574
|
* Generated bundle index. Do not edit.
|
|
19543
19575
|
*/
|
|
19544
19576
|
|
|
19545
|
-
export { AddLinkDialogComponent, AddLinkMobileComponent, Alignment, BaseCommentComponent, BaseNoderComponent, Borders, BreakTypes, CommandModel, CommandType, CommandsService, CommentTypeModel, ConfirmDialogComponent, DEFAULT_BACKGROUND_COLOR, DEFAULT_EDGE_MAX_HEIGHT_MULTIPLIER, DEFAULT_FONT_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_HEADINGS, DEFAULT_HEADING_STYLE_ID, DEFAULT_OFFSET_AFTER_NUMBERING_MARKER, DEFAULT_PARAGRAPH_STYLE, DEFAULT_TABLE_MARGINS, DEFAULT_TAB_WIDTH, DEFAULT_TEXT_STYLE, DEFAULT_TOOLBAR_STYLES, DefaultImageApiService, DestroyComponent, DocumentInfo, DocumentModel, DocumentNameModel, DocxModel, DomHelper, EditorComponent, EditorMobileToolbarComponent, EditorModule, EditorService, EditorTitleComponent, EditorTitleMobileComponent, EditorToolbarComponent, EditorToolbarMode, EditorToolbarModule, EditorToolbarService, ElementDataModel, ElementModel, ExternalComponent, ExternalElementModel, ExternalElementService, FileSourceModel, FontMetrics, FormatStyleHelper, GrammarService, HYPERLINK_FONT_COLOR, HYPERLINK_HEADING_STYLE_ID, ImageApiService, ImageDataModel, LastDocumentRevisionModel, LineStyles, MenuDropdownsComponent, MenuDropdownsMobileComponent, Mode, NEW_LINE_MARKUP, NoderTranslateLoader, NumberingLevelModel, OperationModel, OperationsHistoryInfoModel, PageSetupComponent, PageType, ParagraphStyleModel, RevisionHelper, RevisionModel, SearchResultLocation, TextFormatMobileComponent, TextStyleModel, ToolbarActionsComponent };
|
|
19577
|
+
export { AddLinkDialogComponent, AddLinkMobileComponent, Alignment, BaseCommentComponent, BaseNoderComponent, Borders, BreakTypes, CommandModel, CommandType, CommandsService, CommentTypeModel, ConfirmDialogComponent, DEFAULT_BACKGROUND_COLOR, DEFAULT_EDGE_MAX_HEIGHT_MULTIPLIER, DEFAULT_FONT_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_HEADINGS, DEFAULT_HEADING_STYLE_ID, DEFAULT_OFFSET_AFTER_NUMBERING_MARKER, DEFAULT_PARAGRAPH_STYLE, DEFAULT_TABLE_MARGINS, DEFAULT_TAB_WIDTH, DEFAULT_TEXT_STYLE, DEFAULT_TOOLBAR_STYLES, DefaultImageApiService, DestroyComponent, DocumentInfo, DocumentModel, DocumentNameModel, DocxModel, DomHelper, EditorComponent, EditorMobileToolbarComponent, EditorModule, EditorService, EditorTitleComponent, EditorTitleMobileComponent, EditorToolbarComponent, EditorToolbarMode, EditorToolbarModule, EditorToolbarService, ElementDataModel, ElementModel, ExternalComponent, ExternalElementModel, ExternalElementService, FileSourceModel, FontMetrics, FormatStyleHelper, GrammarService, HYPERLINK_FONT_COLOR, HYPERLINK_HEADING_STYLE_ID, ImageApiService, ImageDataModel, LastDocumentRevisionModel, LineStyles, MenuDropdownsComponent, MenuDropdownsMobileComponent, Mode, NEW_LINE_MARKUP, NoderTranslateLoader, NumberingLevelModel, OperationModel, OperationsHistoryInfoModel, PageSetupComponent, PageType, ParagraphStyleExtModel, ParagraphStyleModel, RevisionHelper, RevisionModel, SearchResultLocation, TextFormatMobileComponent, TextStyleModel, ToolbarActionsComponent };
|
|
19546
19578
|
//# sourceMappingURL=talrace-ngx-noder.mjs.map
|