@talrace/ngx-noder 0.0.29 → 0.0.31

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.
@@ -113,8 +113,8 @@ const DEFAULT_TOOLBAR_STYLES = () => ({
113
113
  highlightColor: DEFAULT_BACKGROUND_COLOR
114
114
  });
115
115
  const DEFAULT_BACKGROUND_COLOR = 'transparent';
116
- const DEFAULT_FONT_FAMILY = 'Roboto';
117
- const DEFAULT_FONT_SIZE = 14;
116
+ const DEFAULT_FONT_FAMILY = 'Times New Roman';
117
+ const DEFAULT_FONT_SIZE = 11;
118
118
  const DEFAULT_FONT_COLOR = '#000';
119
119
  const HYPERLINK_FONT_COLOR = '#0000EE';
120
120
  const DEFAULT_HEADING_STYLE_ID = 'Default';
@@ -460,6 +460,7 @@ class EditorService {
460
460
  this._insertTableColumns$ = new Subject();
461
461
  this._removeTableRows$ = new Subject();
462
462
  this._removeTableColumns$ = new Subject();
463
+ this._removeTable$ = new Subject();
463
464
  this._removeRight$ = new Subject();
464
465
  this._resizeTableColumns$ = new Subject();
465
466
  this._insertTable$ = new Subject();
@@ -596,6 +597,9 @@ class EditorService {
596
597
  get removeTableColumns$() {
597
598
  return this._removeTableColumns$.asObservable();
598
599
  }
600
+ get removeTable$() {
601
+ return this._removeTable$.asObservable();
602
+ }
599
603
  get removeRight$() {
600
604
  return this._removeRight$.asObservable();
601
605
  }
@@ -750,6 +754,9 @@ class EditorService {
750
754
  removeTableColumns(insertIndex, startIndex, endIndex, sessionId) {
751
755
  this._removeTableColumns$.next({ insertIndex, startIndex, endIndex, sessionId });
752
756
  }
757
+ removeTable(insertIndex, sessionId) {
758
+ this._removeTable$.next({ insertIndex, sessionId });
759
+ }
753
760
  removeRight() {
754
761
  this._removeRight$.next();
755
762
  }
@@ -961,6 +968,7 @@ var CommandType;
961
968
  CommandType[CommandType["RemoveParagraphAndAddNumbering"] = 29] = "RemoveParagraphAndAddNumbering";
962
969
  CommandType[CommandType["RestoreParagraphAndAddNumbering"] = 30] = "RestoreParagraphAndAddNumbering";
963
970
  CommandType[CommandType["MoveRange"] = 31] = "MoveRange";
971
+ CommandType[CommandType["RemoveTable"] = 32] = "RemoveTable";
964
972
  })(CommandType || (CommandType = {}));
965
973
 
966
974
  class PageNumbersModel {
@@ -1096,6 +1104,194 @@ class ContentHelper {
1096
1104
  }
1097
1105
  }
1098
1106
 
1107
+ class BreakModel {
1108
+ constructor(fields) {
1109
+ if (fields) {
1110
+ Object.assign(this, fields);
1111
+ }
1112
+ }
1113
+ }
1114
+
1115
+ class ElementModel {
1116
+ constructor(fields) {
1117
+ if (fields) {
1118
+ Object.assign(this, fields);
1119
+ }
1120
+ }
1121
+ }
1122
+
1123
+ class FormatHelper {
1124
+ static sliceSection(formats, startIndex, endIndex) {
1125
+ let result = [];
1126
+ for (const format of formats) {
1127
+ if (format.startIndex >= startIndex && format.endIndex <= endIndex) {
1128
+ result.push(new FormatModel({ ...format }));
1129
+ }
1130
+ else if (format.startIndex < startIndex && format.endIndex > endIndex) {
1131
+ result.push(new FormatModel({ startIndex, endIndex, textStyle: new TextStyleModel(format.textStyle) }));
1132
+ }
1133
+ else if (format.startIndex < startIndex && format.endIndex >= startIndex) {
1134
+ result.push(new FormatModel({ startIndex, endIndex: format.endIndex, textStyle: new TextStyleModel(format.textStyle) }));
1135
+ }
1136
+ else if (format.startIndex <= endIndex && format.endIndex > endIndex) {
1137
+ result.push(new FormatModel({ startIndex: format.startIndex, endIndex, textStyle: new TextStyleModel(format.textStyle) }));
1138
+ }
1139
+ }
1140
+ return result;
1141
+ }
1142
+ static shiftIndexes(formats, offset) {
1143
+ for (const format of formats) {
1144
+ format.startIndex += offset;
1145
+ format.endIndex += offset;
1146
+ }
1147
+ }
1148
+ }
1149
+
1150
+ class BordersStyleModel {
1151
+ constructor(fields) {
1152
+ if (fields) {
1153
+ Object.assign(this, fields);
1154
+ }
1155
+ }
1156
+ }
1157
+
1158
+ class ImageModel {
1159
+ constructor(fields) {
1160
+ if (fields) {
1161
+ if (fields.border) {
1162
+ fields.border = new BordersStyleModel(fields.border);
1163
+ }
1164
+ Object.assign(this, fields);
1165
+ }
1166
+ }
1167
+ }
1168
+
1169
+ class IndexedElementHelper {
1170
+ static sliceSection(elements, startIndex, endIndex) {
1171
+ return elements.filter(x => x.insertIndex >= startIndex && x.insertIndex < endIndex);
1172
+ }
1173
+ static shiftIndexes(elements, offset) {
1174
+ for (const element of elements) {
1175
+ element.insertIndex += offset;
1176
+ }
1177
+ }
1178
+ }
1179
+
1180
+ class LinkModel {
1181
+ constructor(fields) {
1182
+ if (fields) {
1183
+ Object.assign(this, fields);
1184
+ }
1185
+ }
1186
+ }
1187
+
1188
+ class LinkHelper {
1189
+ static sliceSection(links, start, end) {
1190
+ return links.map(link => LinkHelper.getPartialLink(link, start, end)).filter((link) => link !== null);
1191
+ }
1192
+ static shiftIndexes(links, offset) {
1193
+ for (const link of links) {
1194
+ link.startIndex += offset;
1195
+ link.endIndex += offset;
1196
+ }
1197
+ }
1198
+ static sliceFormats(links, startIndex, endIndex) {
1199
+ const result = [];
1200
+ for (const link of links) {
1201
+ const absoluteFormats = link.formats.map(x => ({
1202
+ ...x,
1203
+ startIndex: x.startIndex + link.startIndex,
1204
+ endIndex: x.endIndex + link.startIndex
1205
+ }));
1206
+ const slicedLinkFormats = FormatHelper.sliceSection(absoluteFormats, startIndex, endIndex);
1207
+ result.push(...slicedLinkFormats);
1208
+ }
1209
+ return result;
1210
+ }
1211
+ static getPartialLink(link, selectionStart, selectionEnd) {
1212
+ if (link.endIndex < selectionStart || link.startIndex > selectionEnd) {
1213
+ return null;
1214
+ }
1215
+ const newStart = Math.max(link.startIndex, selectionStart);
1216
+ const newEnd = Math.min(link.endIndex, selectionEnd);
1217
+ const newFormats = link.formats
1218
+ .map(format => {
1219
+ const formatStart = link.startIndex + format.startIndex;
1220
+ const formatEnd = link.startIndex + format.endIndex;
1221
+ if (formatEnd < newStart || formatStart > newEnd) {
1222
+ return null;
1223
+ }
1224
+ const newFormatStart = Math.max(formatStart, newStart) - newStart;
1225
+ const newFormatEnd = Math.min(formatEnd, newEnd) - newStart;
1226
+ return new FormatModel({ ...format, startIndex: newFormatStart, endIndex: newFormatEnd });
1227
+ })
1228
+ .filter((format) => format !== null);
1229
+ return new LinkModel({ ...link, startIndex: newStart, endIndex: newEnd, formats: newFormats });
1230
+ }
1231
+ }
1232
+
1233
+ class ParagraphModel {
1234
+ constructor(fields) {
1235
+ if (fields) {
1236
+ if (fields.paragraphStyle) {
1237
+ fields.paragraphStyle = new ParagraphStyleModel(fields.paragraphStyle);
1238
+ }
1239
+ Object.assign(this, fields);
1240
+ }
1241
+ }
1242
+ }
1243
+
1244
+ class RestoreModel {
1245
+ constructor(fields) {
1246
+ if (fields) {
1247
+ Object.assign(this, fields);
1248
+ }
1249
+ }
1250
+ }
1251
+
1252
+ class MarginsModel {
1253
+ constructor(fields) {
1254
+ if (fields) {
1255
+ Object.assign(this, fields);
1256
+ }
1257
+ }
1258
+ }
1259
+
1260
+ class TableModel {
1261
+ constructor(fields) {
1262
+ if (fields) {
1263
+ if (fields.margins) {
1264
+ fields.margins = new MarginsModel(fields.margins);
1265
+ }
1266
+ Object.assign(this, fields);
1267
+ }
1268
+ }
1269
+ }
1270
+
1271
+ class TabModel {
1272
+ constructor(fields) {
1273
+ if (fields) {
1274
+ Object.assign(this, fields);
1275
+ }
1276
+ }
1277
+ }
1278
+
1279
+ class ContentsOperationsHelper {
1280
+ static GetRestoreFromSlice(contents, startIndex, count) {
1281
+ const endIndex = startIndex + count;
1282
+ const text = contents.content.slice(startIndex, endIndex);
1283
+ const formats = FormatHelper.sliceSection(contents.formats, startIndex, endIndex);
1284
+ const paragraphs = IndexedElementHelper.sliceSection(contents.paragraphs, startIndex, endIndex).map(x => new ParagraphModel(x));
1285
+ const images = IndexedElementHelper.sliceSection(contents.images, startIndex, endIndex).map(x => new ImageModel(x));
1286
+ const tables = IndexedElementHelper.sliceSection(contents.tables, startIndex, endIndex).map(x => new TableModel(x));
1287
+ const elements = IndexedElementHelper.sliceSection(contents.elements, startIndex, endIndex).map(x => new ElementModel({ ...x, id: 0, guid: '' }));
1288
+ const breaks = IndexedElementHelper.sliceSection(contents.breaks, startIndex, endIndex).map(x => new BreakModel(x));
1289
+ const tabs = IndexedElementHelper.sliceSection(contents.tabs, startIndex, endIndex).map(x => new TabModel(x));
1290
+ const links = LinkHelper.sliceSection(contents.links, startIndex, endIndex).map(x => new LinkModel(x));
1291
+ return new RestoreModel({ startIndex, endIndex, text, formats, paragraphs, images, tables, elements, breaks, tabs, links });
1292
+ }
1293
+ }
1294
+
1099
1295
  class CreateEdgesModel {
1100
1296
  constructor(fields) {
1101
1297
  if (fields) {
@@ -1202,41 +1398,6 @@ var EdgeType;
1202
1398
  EdgeType[EdgeType["Footer"] = 1] = "Footer";
1203
1399
  })(EdgeType || (EdgeType = {}));
1204
1400
 
1205
- class ElementModel {
1206
- constructor(fields) {
1207
- if (fields) {
1208
- Object.assign(this, fields);
1209
- }
1210
- }
1211
- }
1212
-
1213
- class FormatHelper {
1214
- static sliceSection(formats, startIndex, endIndex) {
1215
- let result = [];
1216
- for (const format of formats) {
1217
- if (format.startIndex >= startIndex && format.endIndex <= endIndex) {
1218
- result.push(new FormatModel({ ...format }));
1219
- }
1220
- else if (format.startIndex < startIndex && format.endIndex > endIndex) {
1221
- result.push(new FormatModel({ startIndex, endIndex, textStyle: new TextStyleModel(format.textStyle) }));
1222
- }
1223
- else if (format.startIndex < startIndex && format.endIndex >= startIndex) {
1224
- result.push(new FormatModel({ startIndex, endIndex: format.endIndex, textStyle: new TextStyleModel(format.textStyle) }));
1225
- }
1226
- else if (format.startIndex <= endIndex && format.endIndex > endIndex) {
1227
- result.push(new FormatModel({ startIndex: format.startIndex, endIndex, textStyle: new TextStyleModel(format.textStyle) }));
1228
- }
1229
- }
1230
- return result;
1231
- }
1232
- static shiftIndexes(formats, offset) {
1233
- for (const format of formats) {
1234
- format.startIndex += offset;
1235
- format.endIndex += offset;
1236
- }
1237
- }
1238
- }
1239
-
1240
1401
  class ImageDataModel {
1241
1402
  constructor(fields) {
1242
1403
  if (fields) {
@@ -1256,17 +1417,6 @@ class ImageHelper {
1256
1417
  }
1257
1418
  }
1258
1419
 
1259
- class IndexedElementHelper {
1260
- static sliceSection(elements, startIndex, endIndex) {
1261
- return elements.filter(x => x.insertIndex >= startIndex && x.insertIndex <= endIndex);
1262
- }
1263
- static shiftIndexes(elements, offset) {
1264
- for (const element of elements) {
1265
- element.insertIndex += offset;
1266
- }
1267
- }
1268
- }
1269
-
1270
1420
  class InputHandler extends BaseHandler {
1271
1421
  constructor(textarea, editor) {
1272
1422
  super();
@@ -1531,59 +1681,6 @@ class InsertTabModel {
1531
1681
  }
1532
1682
  }
1533
1683
 
1534
- class LinkModel {
1535
- constructor(fields) {
1536
- if (fields) {
1537
- Object.assign(this, fields);
1538
- }
1539
- }
1540
- }
1541
-
1542
- class LinkHelper {
1543
- static sliceSection(links, start, end) {
1544
- return links.map(link => LinkHelper.getPartialLink(link, start, end)).filter((link) => link !== null);
1545
- }
1546
- static shiftIndexes(links, offset) {
1547
- for (const link of links) {
1548
- link.startIndex += offset;
1549
- link.endIndex += offset;
1550
- }
1551
- }
1552
- static sliceFormats(links, startIndex, endIndex) {
1553
- const result = [];
1554
- for (const link of links) {
1555
- const absoluteFormats = link.formats.map(x => ({
1556
- ...x,
1557
- startIndex: x.startIndex + link.startIndex,
1558
- endIndex: x.endIndex + link.startIndex
1559
- }));
1560
- const slicedLinkFormats = FormatHelper.sliceSection(absoluteFormats, startIndex, endIndex);
1561
- result.push(...slicedLinkFormats);
1562
- }
1563
- return result;
1564
- }
1565
- static getPartialLink(link, selectionStart, selectionEnd) {
1566
- if (link.endIndex < selectionStart || link.startIndex > selectionEnd) {
1567
- return null;
1568
- }
1569
- const newStart = Math.max(link.startIndex, selectionStart);
1570
- const newEnd = Math.min(link.endIndex, selectionEnd);
1571
- const newFormats = link.formats
1572
- .map(format => {
1573
- const formatStart = link.startIndex + format.startIndex;
1574
- const formatEnd = link.startIndex + format.endIndex;
1575
- if (formatEnd < newStart || formatStart > newEnd) {
1576
- return null;
1577
- }
1578
- const newFormatStart = Math.max(formatStart, newStart) - newStart;
1579
- const newFormatEnd = Math.min(formatEnd, newEnd) - newStart;
1580
- return new FormatModel({ ...format, startIndex: newFormatStart, endIndex: newFormatEnd });
1581
- })
1582
- .filter((format) => format !== null);
1583
- return new LinkModel({ ...link, startIndex: newStart, endIndex: newEnd, formats: newFormats });
1584
- }
1585
- }
1586
-
1587
1684
  var MouseButton;
1588
1685
  (function (MouseButton) {
1589
1686
  MouseButton[MouseButton["Left"] = 0] = "Left";
@@ -2861,7 +2958,7 @@ class RemoveTableColumnsModel {
2861
2958
  }
2862
2959
  }
2863
2960
 
2864
- class RemoveTableRowsModel {
2961
+ class RemoveTableModel {
2865
2962
  constructor(fields) {
2866
2963
  if (fields) {
2867
2964
  Object.assign(this, fields);
@@ -2869,15 +2966,7 @@ class RemoveTableRowsModel {
2869
2966
  }
2870
2967
  }
2871
2968
 
2872
- class ResizeTableColumnsModel {
2873
- constructor(fields) {
2874
- if (fields) {
2875
- Object.assign(this, fields);
2876
- }
2877
- }
2878
- }
2879
-
2880
- class RestoreNumberingsModel {
2969
+ class RemoveTableRowsModel {
2881
2970
  constructor(fields) {
2882
2971
  if (fields) {
2883
2972
  Object.assign(this, fields);
@@ -2885,7 +2974,7 @@ class RestoreNumberingsModel {
2885
2974
  }
2886
2975
  }
2887
2976
 
2888
- class RestoreParagraphStylesModel {
2977
+ class ResizeTableColumnsModel {
2889
2978
  constructor(fields) {
2890
2979
  if (fields) {
2891
2980
  Object.assign(this, fields);
@@ -2893,7 +2982,7 @@ class RestoreParagraphStylesModel {
2893
2982
  }
2894
2983
  }
2895
2984
 
2896
- class MarginsModel {
2985
+ class RestoreNumberingsModel {
2897
2986
  constructor(fields) {
2898
2987
  if (fields) {
2899
2988
  Object.assign(this, fields);
@@ -2901,12 +2990,9 @@ class MarginsModel {
2901
2990
  }
2902
2991
  }
2903
2992
 
2904
- class TableModel {
2993
+ class RestoreParagraphStylesModel {
2905
2994
  constructor(fields) {
2906
2995
  if (fields) {
2907
- if (fields.margins) {
2908
- fields.margins = new MarginsModel(fields.margins);
2909
- }
2910
2996
  Object.assign(this, fields);
2911
2997
  }
2912
2998
  }
@@ -3016,6 +3102,10 @@ class OperationHistory {
3016
3102
  const undoStep = new RestoreTableModel({ insertIndex, oldTable });
3017
3103
  this.addToHistory(undoStep, redoStep);
3018
3104
  }
3105
+ pushRemoveTable(insertIndex, restoreModel) {
3106
+ const redoStep = new RemoveTableModel({ insertIndex });
3107
+ this.addToHistory(restoreModel, redoStep);
3108
+ }
3019
3109
  pushResizeTableColumns(resizeTableColumns) {
3020
3110
  const redoStep = new ResizeTableColumnsModel({
3021
3111
  cellIndex: resizeTableColumns.cellIndex,
@@ -3136,17 +3226,6 @@ class PageHelper {
3136
3226
  }
3137
3227
  }
3138
3228
 
3139
- class ParagraphModel {
3140
- constructor(fields) {
3141
- if (fields) {
3142
- if (fields.paragraphStyle) {
3143
- fields.paragraphStyle = new ParagraphStyleModel(fields.paragraphStyle);
3144
- }
3145
- Object.assign(this, fields);
3146
- }
3147
- }
3148
- }
3149
-
3150
3229
  const DisplayValue = {
3151
3230
  char: 1,
3152
3231
  customContent: 3,
@@ -3445,6 +3524,9 @@ class RenderingHelper {
3445
3524
  // eslint-disable-next-line prettier/prettier
3446
3525
  `padding-left:${paddingLeft}px;height:${lineInfo.height + lineInfo.offsetAfter}px;margin-top:${lineInfo.offsetBefore}px;margin-bottom:${lineInfo.endPageOffset}px;margin-left:${marginLeft}px;background-color:${lineInfo.backgroundColor}`);
3447
3526
  lineEl.setAttribute('screen-index', `${lineInfo.screenLine}`);
3527
+ if (lineInfo.wordSpacing) {
3528
+ lineEl.style.wordSpacing = `${lineInfo.wordSpacing}px`;
3529
+ }
3448
3530
  }
3449
3531
  return lineEl;
3450
3532
  }
@@ -4528,14 +4610,6 @@ class ReplaceModel {
4528
4610
  }
4529
4611
  }
4530
4612
 
4531
- class RestoreModel {
4532
- constructor(fields) {
4533
- if (fields) {
4534
- Object.assign(this, fields);
4535
- }
4536
- }
4537
- }
4538
-
4539
4613
  class RestoreParagraphAndAddNumberingModel {
4540
4614
  constructor(fields) {
4541
4615
  if (fields) {
@@ -4621,6 +4695,9 @@ class CommandModel {
4621
4695
  if (fields.removeParagraphAndAddNumbering) {
4622
4696
  fields.removeParagraphAndAddNumbering = new RemoveParagraphAndAddNumberingModel(fields.removeParagraphAndAddNumbering);
4623
4697
  }
4698
+ if (fields.removeTable) {
4699
+ fields.removeTable = new RemoveTableModel(fields.removeTable);
4700
+ }
4624
4701
  if (fields.removeTableColumns) {
4625
4702
  fields.removeTableColumns = new RemoveTableColumnsModel(fields.removeTableColumns);
4626
4703
  }
@@ -4732,6 +4809,10 @@ class SaveCommandsHelper {
4732
4809
  const removeTableRows = new RemoveTableRowsModel({ startIndex, endIndex, insertIndex });
4733
4810
  return new CommandModel({ commandType: CommandType.RemoveTableRows, removeTableRows, targets });
4734
4811
  }
4812
+ static getRemoveTableCommand(insertIndex, targets) {
4813
+ const removeTable = new RemoveTableModel({ insertIndex });
4814
+ return new CommandModel({ commandType: CommandType.RemoveTable, removeTable, targets });
4815
+ }
4735
4816
  static getRestoreTextStylesCommand(formats, targets) {
4736
4817
  const restoreTextStyles = new RestoreTextStylesModel({ formats });
4737
4818
  return new CommandModel({ commandType: CommandType.RestoreTextStyles, restoreTextStyles, targets });
@@ -5479,7 +5560,7 @@ class Editor {
5479
5560
  this.session.applyToolbarStyles();
5480
5561
  this.search = new Search();
5481
5562
  this.search.set({ wrap: true });
5482
- this.subscriptions.push(this.changedEdgeSizeSubscription(), this.changedEdgeSubscription(), this.changedTableSizeSubscription(), this.clipboardDataSubscription(), this.copySelectedSubscription(), this.createCustomComponentSubscription(), this.cutSelectedSubscription(), this.disableSelectionSubscription(), this.endMousePressSubscription(), this.imageLoadedSubscription(), this.insertBreakSubscription(), this.insertImageSubscription(), this.insertLinkSubscription(), this.insertTableColumnsSubscription(), this.insertTableRowsSubscription(), this.insertTableSubscription(), this.insertTextSubscription(), this.pasteFromClipboardSubscription(), this.printSubscription(), this.redoSubscription(), this.removeLeftSubscription(), this.removeNumberingsSubscription(), this.removeRightSubscription(), this.removeSelectedSubscription(), this.removeTableColumnsSubscription(), this.removeTableRowsSubscription(), this.replaceSubscription(), this.rerenderSubscription(), this.resizeTableColumnsSubscription(), this.searchOptionSubscription(), this.selectAllSubscription(), this.setImageStyleSubscription(), this.setNumberingTemplateTypeSubscription(), this.setParagraphStylesSubscription(), this.setTextStylesSubscription(), this.undoSubscription(), this.updateEdgeSubscription(), this.viewOnlyModeSubscription(), this.dragMoveSubscription(), this.dragDropSubscription());
5563
+ this.subscriptions.push(this.changedEdgeSizeSubscription(), this.changedEdgeSubscription(), this.changedTableSizeSubscription(), this.clipboardDataSubscription(), this.copySelectedSubscription(), this.createCustomComponentSubscription(), this.cutSelectedSubscription(), this.disableSelectionSubscription(), this.endMousePressSubscription(), this.imageLoadedSubscription(), this.insertBreakSubscription(), this.insertImageSubscription(), this.insertLinkSubscription(), this.insertTableColumnsSubscription(), this.insertTableRowsSubscription(), this.insertTableSubscription(), this.insertTextSubscription(), this.pasteFromClipboardSubscription(), this.printSubscription(), this.redoSubscription(), this.removeLeftSubscription(), this.removeNumberingsSubscription(), this.removeRightSubscription(), this.removeSelectedSubscription(), this.removeTableColumnsSubscription(), this.removeTableRowsSubscription(), this.removeTableSubscription(), this.replaceSubscription(), this.rerenderSubscription(), this.resizeTableColumnsSubscription(), this.searchOptionSubscription(), this.selectAllSubscription(), this.setImageStyleSubscription(), this.setNumberingTemplateTypeSubscription(), this.setParagraphStylesSubscription(), this.setTextStylesSubscription(), this.undoSubscription(), this.updateEdgeSubscription(), this.viewOnlyModeSubscription(), this.dragMoveSubscription(), this.dragDropSubscription());
5483
5564
  }
5484
5565
  destroy() {
5485
5566
  this.subscriptions.forEach(s => s?.unsubscribe());
@@ -5885,9 +5966,8 @@ class Editor {
5885
5966
  command = SaveCommandsHelper.getInsertStyledTextCommand(text, insertIndex, textStyle, this.targets);
5886
5967
  }
5887
5968
  else if (operation instanceof RestoreModel) {
5888
- const deepCopy = structuredClone(operation);
5889
- this.session.restore(deepCopy);
5890
- command = SaveCommandsHelper.getRestoreCommand(deepCopy, this.targets);
5969
+ this.session.restore(structuredClone(operation));
5970
+ command = SaveCommandsHelper.getRestoreCommand(structuredClone(operation), this.targets);
5891
5971
  }
5892
5972
  else if (operation instanceof ApplyTextStyleModel) {
5893
5973
  this.session.applyTextStyle(operation.startIndex, operation.endIndex, new TextStyleModel(operation.textStyle));
@@ -6011,6 +6091,10 @@ class Editor {
6011
6091
  this.moveRange(operation);
6012
6092
  command = SaveCommandsHelper.getMoveRangeCommand(operation, []);
6013
6093
  }
6094
+ else if (operation instanceof RemoveTableModel) {
6095
+ this.session.removeTable(operation.insertIndex);
6096
+ command = SaveCommandsHelper.getRemoveTableCommand(operation.insertIndex, this.targets);
6097
+ }
6014
6098
  else {
6015
6099
  throw new Error('Undo/redo is not implemented for the Operation');
6016
6100
  }
@@ -6054,6 +6138,12 @@ class Editor {
6054
6138
  this.history.pushInsertStyledText(index, text, style);
6055
6139
  this.commandsService.createCommand(SaveCommandsHelper.getInsertStyledTextCommand(text, index, style, this.targets));
6056
6140
  }
6141
+ saveRemoveTableToHistory(insertIndex) {
6142
+ const restoreModel = ContentsOperationsHelper.GetRestoreFromSlice(this.session.model, insertIndex, 1);
6143
+ restoreModel.endIndex = insertIndex;
6144
+ this.history.pushRemoveTable(insertIndex, restoreModel);
6145
+ this.commandsService.createCommand(SaveCommandsHelper.getRemoveTableCommand(insertIndex, this.targets));
6146
+ }
6057
6147
  saveInsertElementToHistory(model) {
6058
6148
  this.history.pushInsertElement(model);
6059
6149
  this.commandsService.createCommand(SaveCommandsHelper.getInsertElementCommand(model, this.targets));
@@ -6335,7 +6425,7 @@ class Editor {
6335
6425
  this.regulatorService.setCustomSessionAsCurrent(elementSessionId);
6336
6426
  }
6337
6427
  else {
6338
- const edgeType = this.getClickedEdgeType(event.clientY);
6428
+ const edgeType = this.getEdgeTypeByPosition(event.clientY);
6339
6429
  if (edgeType !== null) {
6340
6430
  this.createEdges(edgeType, PageType.Default);
6341
6431
  }
@@ -6398,7 +6488,15 @@ class Editor {
6398
6488
  this.onSelectionChange();
6399
6489
  }
6400
6490
  onDragMove(event) {
6401
- this.setCurrentSession(event.target);
6491
+ const target = document.elementFromPoint(event.clientX, event.clientY);
6492
+ const customElement = this.getCustomElement(target);
6493
+ if (customElement) {
6494
+ const elementSessionId = +customElement.attributes.getNamedItem('data-session-id').value;
6495
+ this.regulatorService.setCustomSessionAsCurrent(elementSessionId);
6496
+ }
6497
+ else {
6498
+ this.regulatorService.setMainSessionAsCurrent();
6499
+ }
6402
6500
  const cursorPosition = this.renderer.screenToTextCoordinatesUsingMidpoint(event.clientX, event.clientY);
6403
6501
  if (cursorPosition.row === this.selection.cursor.row && cursorPosition.column === this.selection.cursor.column) {
6404
6502
  return;
@@ -6615,6 +6713,14 @@ class Editor {
6615
6713
  this.session.removeTableColumns(insertIndex, startIndex, endIndex);
6616
6714
  this.changedTableSize(insertIndex, sessionId);
6617
6715
  }
6716
+ removeTable(insertIndex, sessionId) {
6717
+ this.regulatorService.setCustomSessionAsCurrent(sessionId);
6718
+ const beforeTable = ContentHelper.documentIndexToParagraphIndex(this.session.displayData.paragraphs, insertIndex);
6719
+ this.selection.placeCursor(beforeTable);
6720
+ this.saveRemoveTableToHistory(insertIndex);
6721
+ this.session.removeTable(insertIndex);
6722
+ this.onSelectionChange();
6723
+ }
6618
6724
  resizeTableColumns(resizeTableColumns, sessionId) {
6619
6725
  this.regulatorService.setCustomSessionAsCurrent(sessionId);
6620
6726
  const beforeTable = ContentHelper.documentIndexToParagraphIndex(this.session.displayData.paragraphs, resizeTableColumns.insertIndex);
@@ -6638,7 +6744,7 @@ class Editor {
6638
6744
  const format = session.model.formats.find(x => x.startIndex <= component.insertIndex && x.endIndex >= component.insertIndex);
6639
6745
  component.receiveStyle(format.textStyle);
6640
6746
  }
6641
- getClickedEdgeType(mousePosition) {
6747
+ getEdgeTypeByPosition(mousePosition) {
6642
6748
  const positionY = mousePosition + this.mainSession.scrollTop - this.mainRenderer.container.getBoundingClientRect().top;
6643
6749
  const fullPageHeight = this.mainSession.displayData.pagesSpace + this.mainSession.displayData.pageHeight;
6644
6750
  const clickedPage = Math.floor(positionY / fullPageHeight) + 1;
@@ -6775,6 +6881,11 @@ class Editor {
6775
6881
  this.removeTableColumns(data.insertIndex, data.startIndex, data.endIndex, data.sessionId);
6776
6882
  });
6777
6883
  }
6884
+ removeTableSubscription() {
6885
+ return this.editorService.removeTable$.subscribe(data => {
6886
+ this.removeTable(data.insertIndex, data.sessionId);
6887
+ });
6888
+ }
6778
6889
  removeRightSubscription() {
6779
6890
  return this.editorService.removeRight$.subscribe(() => this.removeRight());
6780
6891
  }
@@ -7545,8 +7656,9 @@ class TableOverlayMenuComponent {
7545
7656
  const removeColumnsMessage = this.selectedRowsCount > 1
7546
7657
  ? this.translateService.instant('NODER.COMPLEX_LABEL.REMOVE_COLUMNS', { count: this.selectedColumnsCount })
7547
7658
  : this.translateService.instant('NODER.LABEL.REMOVE_COLUMN');
7659
+ const removeTableMessage = this.translateService.instant('NODER.LABEL.REMOVE_TABLE');
7548
7660
  this.insertMessages = { insertRowsAboveMessage, insertRowsBelowMessage, insertColumnsLeftMessage, insertColumnsRightMessage };
7549
- this.removeMessages = { removeRowsMessage, removeColumnsMessage };
7661
+ this.removeMessages = { removeRowsMessage, removeColumnsMessage, removeTableMessage };
7550
7662
  }
7551
7663
  onInsertRowsAbove() {
7552
7664
  this.editorService.insertTableRows(this.tableInsertIndex, this.selectedRowsCount, this.targets.rowIndexes.startIndex, this.selectionRange.rowIndexes.startIndex, this.sessionId);
@@ -7572,12 +7684,16 @@ class TableOverlayMenuComponent {
7572
7684
  this.editorService.removeTableColumns(this.tableInsertIndex, this.selectionRange.cellIndexes.startIndex, this.selectionRange.cellIndexes.endIndex, this.sessionId);
7573
7685
  this.overlayService.close();
7574
7686
  }
7687
+ onRemoveTable() {
7688
+ this.editorService.removeTable(this.tableInsertIndex, this.sessionId);
7689
+ this.overlayService.close();
7690
+ }
7575
7691
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TableOverlayMenuComponent, deps: [{ token: EditorService }, { token: OverlayService }, { token: i4.TranslateService }], target: i0.ɵɵFactoryTarget.Component }); }
7576
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: TableOverlayMenuComponent, isStandalone: false, selector: "app-nod-table-overlay-menu", inputs: { selectionRange: "selectionRange", targets: "targets", canRemoveRows: "canRemoveRows", canRemoveColumns: "canRemoveColumns", tableInsertIndex: "tableInsertIndex", sessionId: "sessionId" }, ngImport: i0, template: "<div\n class=\"menu-item\"\n (click)=\"onInsertRowsAbove()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n {{ insertMessages.insertRowsAboveMessage }}\n</div>\n<div\n class=\"menu-item\"\n (click)=\"onInsertRowsBelow()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n {{ insertMessages.insertRowsBelowMessage }}\n</div>\n<div\n class=\"menu-item\"\n (click)=\"onInsertColumnsLeft()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n {{ insertMessages.insertColumnsLeftMessage }}\n</div>\n<div\n class=\"menu-item\"\n (click)=\"onInsertColumnsRight()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n {{ insertMessages.insertColumnsRightMessage }}\n</div>\n<ng-container *ngIf=\"canRemoveRows || canRemoveColumns\">\n <div class=\"menu-separator\">\n <div class=\"menu-separator-top\"></div>\n <div class=\"menu-separator-bottom\"></div>\n </div>\n <div\n *ngIf=\"canRemoveRows\"\n class=\"menu-item\"\n (click)=\"onRemoveRows()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-delete\"></mat-icon>\n {{ removeMessages.removeRowsMessage }}\n </div>\n <div\n *ngIf=\"canRemoveColumns\"\n class=\"menu-item\"\n (click)=\"onRemoveColumns()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-delete\"></mat-icon>\n {{ removeMessages.removeColumnsMessage }}\n </div>\n</ng-container>\n", styles: [":host{position:absolute;border:1px solid transparent;border-radius:4px;box-shadow:0 2px 6px 2px #3c404326;overflow-y:auto;background:#fff;cursor:default;font-size:13px;margin:0;padding:6px 0}.menu-item{display:flex;flex-direction:row;align-items:center;cursor:pointer;min-height:20px;color:#202124;font-size:16px;letter-spacing:.2px;line-height:20px;padding:6px}.menu-item:hover{background-color:#0000001a}.mat-icon{margin-right:6px;width:20px;height:20px;font-size:20px}.menu-separator{-webkit-user-select:none;user-select:none}.menu-separator .menu-separator-top{padding:4px}.menu-separator .menu-separator-bottom{border-top:1px solid #dadce0;padding:4px}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7692
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: TableOverlayMenuComponent, isStandalone: false, selector: "app-nod-table-overlay-menu", inputs: { selectionRange: "selectionRange", targets: "targets", canRemoveRows: "canRemoveRows", canRemoveColumns: "canRemoveColumns", tableInsertIndex: "tableInsertIndex", sessionId: "sessionId" }, ngImport: i0, template: "<div\n class=\"menu-item\"\n (click)=\"onInsertRowsAbove()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n {{ insertMessages.insertRowsAboveMessage }}\n</div>\n<div\n class=\"menu-item\"\n (click)=\"onInsertRowsBelow()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n {{ insertMessages.insertRowsBelowMessage }}\n</div>\n<div\n class=\"menu-item\"\n (click)=\"onInsertColumnsLeft()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n {{ insertMessages.insertColumnsLeftMessage }}\n</div>\n<div\n class=\"menu-item\"\n (click)=\"onInsertColumnsRight()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n {{ insertMessages.insertColumnsRightMessage }}\n</div>\n<ng-container *ngIf=\"canRemoveRows || canRemoveColumns\">\n <div class=\"menu-separator\">\n <div class=\"menu-separator-top\"></div>\n <div class=\"menu-separator-bottom\"></div>\n </div>\n <div\n *ngIf=\"canRemoveRows\"\n class=\"menu-item\"\n (click)=\"onRemoveRows()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-delete\"></mat-icon>\n {{ removeMessages.removeRowsMessage }}\n </div>\n <div\n *ngIf=\"canRemoveColumns\"\n class=\"menu-item\"\n (click)=\"onRemoveColumns()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-delete\"></mat-icon>\n {{ removeMessages.removeColumnsMessage }}\n </div>\n <div\n class=\"menu-item\"\n (click)=\"onRemoveTable()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-delete\"></mat-icon>\n {{ removeMessages.removeTableMessage }}\n </div>\n</ng-container>\n", styles: [":host{position:absolute;border:1px solid transparent;border-radius:4px;box-shadow:0 2px 6px 2px #3c404326;overflow-y:auto;background:#fff;cursor:default;font-size:13px;margin:0;padding:6px 0}.menu-item{display:flex;flex-direction:row;align-items:center;cursor:pointer;min-height:20px;color:#202124;font-size:16px;letter-spacing:.2px;line-height:20px;padding:6px}.menu-item:hover{background-color:#0000001a}.mat-icon{margin-right:6px;width:20px;height:20px;font-size:20px}.menu-separator{-webkit-user-select:none;user-select:none}.menu-separator .menu-separator-top{padding:4px}.menu-separator .menu-separator-bottom{border-top:1px solid #dadce0;padding:4px}\n"], dependencies: [{ kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i5.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
7577
7693
  }
7578
7694
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: TableOverlayMenuComponent, decorators: [{
7579
7695
  type: Component,
7580
- args: [{ selector: 'app-nod-table-overlay-menu', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div\n class=\"menu-item\"\n (click)=\"onInsertRowsAbove()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n {{ insertMessages.insertRowsAboveMessage }}\n</div>\n<div\n class=\"menu-item\"\n (click)=\"onInsertRowsBelow()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n {{ insertMessages.insertRowsBelowMessage }}\n</div>\n<div\n class=\"menu-item\"\n (click)=\"onInsertColumnsLeft()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n {{ insertMessages.insertColumnsLeftMessage }}\n</div>\n<div\n class=\"menu-item\"\n (click)=\"onInsertColumnsRight()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n {{ insertMessages.insertColumnsRightMessage }}\n</div>\n<ng-container *ngIf=\"canRemoveRows || canRemoveColumns\">\n <div class=\"menu-separator\">\n <div class=\"menu-separator-top\"></div>\n <div class=\"menu-separator-bottom\"></div>\n </div>\n <div\n *ngIf=\"canRemoveRows\"\n class=\"menu-item\"\n (click)=\"onRemoveRows()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-delete\"></mat-icon>\n {{ removeMessages.removeRowsMessage }}\n </div>\n <div\n *ngIf=\"canRemoveColumns\"\n class=\"menu-item\"\n (click)=\"onRemoveColumns()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-delete\"></mat-icon>\n {{ removeMessages.removeColumnsMessage }}\n </div>\n</ng-container>\n", styles: [":host{position:absolute;border:1px solid transparent;border-radius:4px;box-shadow:0 2px 6px 2px #3c404326;overflow-y:auto;background:#fff;cursor:default;font-size:13px;margin:0;padding:6px 0}.menu-item{display:flex;flex-direction:row;align-items:center;cursor:pointer;min-height:20px;color:#202124;font-size:16px;letter-spacing:.2px;line-height:20px;padding:6px}.menu-item:hover{background-color:#0000001a}.mat-icon{margin-right:6px;width:20px;height:20px;font-size:20px}.menu-separator{-webkit-user-select:none;user-select:none}.menu-separator .menu-separator-top{padding:4px}.menu-separator .menu-separator-bottom{border-top:1px solid #dadce0;padding:4px}\n"] }]
7696
+ args: [{ selector: 'app-nod-table-overlay-menu', changeDetection: ChangeDetectionStrategy.OnPush, standalone: false, template: "<div\n class=\"menu-item\"\n (click)=\"onInsertRowsAbove()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n {{ insertMessages.insertRowsAboveMessage }}\n</div>\n<div\n class=\"menu-item\"\n (click)=\"onInsertRowsBelow()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n {{ insertMessages.insertRowsBelowMessage }}\n</div>\n<div\n class=\"menu-item\"\n (click)=\"onInsertColumnsLeft()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n {{ insertMessages.insertColumnsLeftMessage }}\n</div>\n<div\n class=\"menu-item\"\n (click)=\"onInsertColumnsRight()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-add\"></mat-icon>\n {{ insertMessages.insertColumnsRightMessage }}\n</div>\n<ng-container *ngIf=\"canRemoveRows || canRemoveColumns\">\n <div class=\"menu-separator\">\n <div class=\"menu-separator-top\"></div>\n <div class=\"menu-separator-bottom\"></div>\n </div>\n <div\n *ngIf=\"canRemoveRows\"\n class=\"menu-item\"\n (click)=\"onRemoveRows()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-delete\"></mat-icon>\n {{ removeMessages.removeRowsMessage }}\n </div>\n <div\n *ngIf=\"canRemoveColumns\"\n class=\"menu-item\"\n (click)=\"onRemoveColumns()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-delete\"></mat-icon>\n {{ removeMessages.removeColumnsMessage }}\n </div>\n <div\n class=\"menu-item\"\n (click)=\"onRemoveTable()\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-delete\"></mat-icon>\n {{ removeMessages.removeTableMessage }}\n </div>\n</ng-container>\n", styles: [":host{position:absolute;border:1px solid transparent;border-radius:4px;box-shadow:0 2px 6px 2px #3c404326;overflow-y:auto;background:#fff;cursor:default;font-size:13px;margin:0;padding:6px 0}.menu-item{display:flex;flex-direction:row;align-items:center;cursor:pointer;min-height:20px;color:#202124;font-size:16px;letter-spacing:.2px;line-height:20px;padding:6px}.menu-item:hover{background-color:#0000001a}.mat-icon{margin-right:6px;width:20px;height:20px;font-size:20px}.menu-separator{-webkit-user-select:none;user-select:none}.menu-separator .menu-separator-top{padding:4px}.menu-separator .menu-separator-bottom{border-top:1px solid #dadce0;padding:4px}\n"] }]
7581
7697
  }], ctorParameters: () => [{ type: EditorService }, { type: OverlayService }, { type: i4.TranslateService }], propDecorators: { selectionRange: [{
7582
7698
  type: Input
7583
7699
  }], targets: [{
@@ -7622,6 +7738,7 @@ class TableSelection {
7622
7738
  if (this.session.isEdgeOrWithinEdge() && !this.regulatorService.mainSession.session.customComponents.edges.isEdit) {
7623
7739
  return;
7624
7740
  }
7741
+ event.stopPropagation();
7625
7742
  event.preventDefault();
7626
7743
  if (this.editorService.isViewOnly) {
7627
7744
  return;
@@ -9084,7 +9201,26 @@ class DisplayData extends EventEmitting {
9084
9201
  }
9085
9202
  const isAfterPageBreak = !rowInfos.length ? false : rowInfos[rowInfos.length - 1].isEndedByPageBreak;
9086
9203
  const lineInfo = DisplayTokenHelper.getLineInfoFromToken(prevToken, wrapTokens[0], wrapTokens, isAfterPageBreak);
9087
- lineInfo.backgroundColor = model.paragraphs[paragraphIndex].paragraphStyle.backgroundColor;
9204
+ const paragraphStyle = model.paragraphs[paragraphIndex].paragraphStyle;
9205
+ lineInfo.backgroundColor = paragraphStyle.backgroundColor;
9206
+ const isLastLineOfParagraph = !wrapLimit || prevToken.isLineBreak;
9207
+ if (paragraphStyle.alignment === Alignment$1.justify && !isLastLineOfParagraph && wrapTokens.length > 1) {
9208
+ let currentLineWidth = 0;
9209
+ let spaceCount = 0;
9210
+ for (const token of wrapTokens) {
9211
+ currentLineWidth += token.width;
9212
+ if (token.displayValue === DisplayValue.space) {
9213
+ spaceCount++;
9214
+ }
9215
+ }
9216
+ const { left, right, firstLine, hanging } = lineInfo.indent;
9217
+ const indent = left + right + firstLine - hanging || 0;
9218
+ const availableWidth = this.contentWidth - indent;
9219
+ const whitespaceDeficit = availableWidth - currentLineWidth;
9220
+ if (spaceCount > 0 && whitespaceDeficit > 0) {
9221
+ lineInfo.wordSpacing = whitespaceDeficit / spaceCount;
9222
+ }
9223
+ }
9088
9224
  rowInfos.push(lineInfo);
9089
9225
  if (!wrapLimit) {
9090
9226
  break;
@@ -9807,57 +9943,6 @@ class EdgeSessionSourceModel {
9807
9943
  }
9808
9944
  }
9809
9945
 
9810
- class BreakModel {
9811
- constructor(fields) {
9812
- if (fields) {
9813
- Object.assign(this, fields);
9814
- }
9815
- }
9816
- }
9817
-
9818
- class BordersStyleModel {
9819
- constructor(fields) {
9820
- if (fields) {
9821
- Object.assign(this, fields);
9822
- }
9823
- }
9824
- }
9825
-
9826
- class ImageModel {
9827
- constructor(fields) {
9828
- if (fields) {
9829
- if (fields.border) {
9830
- fields.border = new BordersStyleModel(fields.border);
9831
- }
9832
- Object.assign(this, fields);
9833
- }
9834
- }
9835
- }
9836
-
9837
- class TabModel {
9838
- constructor(fields) {
9839
- if (fields) {
9840
- Object.assign(this, fields);
9841
- }
9842
- }
9843
- }
9844
-
9845
- class ContentsOperationsHelper {
9846
- static GetRestoreFromSlice(contents, startIndex, count) {
9847
- const endIndex = startIndex + count;
9848
- const text = contents.content.slice(startIndex, endIndex);
9849
- const formats = FormatHelper.sliceSection(contents.formats, startIndex, endIndex);
9850
- const paragraphs = IndexedElementHelper.sliceSection(contents.paragraphs, startIndex, endIndex).map(x => new ParagraphModel(x));
9851
- const images = IndexedElementHelper.sliceSection(contents.images, startIndex, endIndex).map(x => new ImageModel(x));
9852
- const tables = IndexedElementHelper.sliceSection(contents.tables, startIndex, endIndex).map(x => new TableModel(x));
9853
- const elements = IndexedElementHelper.sliceSection(contents.elements, startIndex, endIndex).map(x => new ElementModel({ ...x, id: 0, guid: '' }));
9854
- const breaks = IndexedElementHelper.sliceSection(contents.breaks, startIndex, endIndex).map(x => new BreakModel(x));
9855
- const tabs = IndexedElementHelper.sliceSection(contents.tabs, startIndex, endIndex).map(x => new TabModel(x));
9856
- const links = LinkHelper.sliceSection(contents.links, startIndex, endIndex).map(x => new LinkModel(x));
9857
- return new RestoreModel({ startIndex, endIndex, text, formats, paragraphs, images, tables, elements, breaks, tabs, links });
9858
- }
9859
- }
9860
-
9861
9946
  class CustomComponentHelper {
9862
9947
  static applyRemovingComponents(components, startIndex, endIndex) {
9863
9948
  let firstRemovingIndex = null;
@@ -11350,6 +11435,11 @@ class OperationsHelper {
11350
11435
  this.moveRange(document, model);
11351
11436
  break;
11352
11437
  }
11438
+ case CommandType.RemoveTable: {
11439
+ const model = command.removeTable;
11440
+ this.removeTable(contents, model.insertIndex);
11441
+ break;
11442
+ }
11353
11443
  }
11354
11444
  });
11355
11445
  }
@@ -11646,6 +11736,9 @@ class OperationsHelper {
11646
11736
  static removeTableColumns(document, insertIndex, startIndex, endIndex, contentWidth) {
11647
11737
  TableOperationsHelper.removeTableColumns(document.tables, insertIndex, startIndex, endIndex, contentWidth);
11648
11738
  }
11739
+ static removeTable(document, insertIndex) {
11740
+ this.delete(document, insertIndex, 1);
11741
+ }
11649
11742
  static restoreTable(document, insertIndex, oldTable) {
11650
11743
  TableOperationsHelper.restoreTable(document.tables, insertIndex, oldTable);
11651
11744
  }
@@ -12187,7 +12280,7 @@ class EditSession {
12187
12280
  createRestoreFromSlice(paragraphStart, indexInStart, paragraphEnd, indexInEnd) {
12188
12281
  const startIndex = ContentHelper.paragraphToDocumentIndex(this.displayData.paragraphs, paragraphStart, indexInStart);
12189
12282
  const endIndex = ContentHelper.paragraphToDocumentIndex(this.displayData.paragraphs, paragraphEnd, indexInEnd);
12190
- return ContentsOperationsHelper.GetRestoreFromSlice(this.model, startIndex, endIndex);
12283
+ return ContentsOperationsHelper.GetRestoreFromSlice(this.model, startIndex, endIndex - startIndex);
12191
12284
  }
12192
12285
  addComponent(customElements, model, componentType) {
12193
12286
  const customElement = this.customContentService.componentService.createComponent(componentType, {
@@ -12318,6 +12411,20 @@ class EditSession {
12318
12411
  OperationsHelper.removeTableColumns(this.model, insertIndex, startIndex, endIndex, this.displayData.contentWidth);
12319
12412
  table.instance.updateTable();
12320
12413
  }
12414
+ removeTable(insertIndex) {
12415
+ const position = this.displayData.indexToPosition(insertIndex, 0);
12416
+ const endPosition = this.displayData.indexToPosition(insertIndex + 1, 0);
12417
+ this.displayData.removeRange(new Range(position, endPosition));
12418
+ CustomComponentHelper.applyRemovingComponents(this.customComponents.tables, insertIndex, insertIndex);
12419
+ OperationsHelper.removeTable(this.model, insertIndex);
12420
+ this.selection.placeCursor(position);
12421
+ this.displayData.resetAllNumberingInfo(position.row);
12422
+ this.displayData.updateNextLineIndexes(position.row, position.row);
12423
+ if (endPosition.row - position.row && this.type !== 'cell') {
12424
+ this.displayData.updateNumberingsDataOnChange(position.row + 1);
12425
+ }
12426
+ this.applyToolbarStyles();
12427
+ }
12321
12428
  resizeTableColumns(resizeTableColumns) {
12322
12429
  const table = this.customComponents.tables.find(x => x.instance.insertIndex === resizeTableColumns.insertIndex);
12323
12430
  this.displayData.resetNumberingInfoByTableCell(table);
@@ -14514,7 +14621,7 @@ class FontComponent {
14514
14621
  constructor() {
14515
14622
  this.isDisabled = false;
14516
14623
  this.selectFont = new EventEmitter();
14517
- this.fonts = ['Arial', DEFAULT_FONT_FAMILY, 'Times New Roman', 'Verdana'];
14624
+ this.fonts = ['Arial', DEFAULT_FONT_FAMILY, 'Roboto', 'Verdana'];
14518
14625
  this.font = DEFAULT_FONT_FAMILY;
14519
14626
  }
14520
14627
  set styles(value) {
@@ -14552,7 +14659,7 @@ class FontSizeComponent {
14552
14659
  constructor() {
14553
14660
  this.selectFontSize = new EventEmitter();
14554
14661
  this.fontSizeControl = new FormControl(0);
14555
- this.fontSizes = [8, 9, 10, 11, 12, DEFAULT_FONT_SIZE, 18, 24, 30, 36, 48, 60, 72, 96];
14662
+ this.fontSizes = [8, 9, 10, DEFAULT_FONT_SIZE, 12, 14, 18, 24, 30, 36, 48, 60, 72, 96];
14556
14663
  }
14557
14664
  set isDisabled(value) {
14558
14665
  this._isDisabled = value;
@@ -14743,11 +14850,11 @@ class FormatComponent {
14743
14850
  this.selectAlignment.emit(format);
14744
14851
  }
14745
14852
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FormatComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
14746
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: FormatComponent, isStandalone: false, selector: "app-nod-format", inputs: { isDisabled: "isDisabled", alignment: "alignment" }, outputs: { selectAlignment: "selectAlignment" }, ngImport: i0, template: "<mat-button-toggle-group\n name=\"format\"\n [hideMultipleSelectionIndicator]=\"true\"\n [hideSingleSelectionIndicator]=\"true\"\n [disabled]=\"isDisabled\"\n [value]=\"alignment\"\n (change)=\"onSelectFormat($event.value)\">\n <mat-button-toggle\n [value]=\"alignments.Left\"\n [matTooltip]=\"'NODER.TOOLTIP.LEFT' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-alignleft\"></mat-icon>\n </mat-button-toggle>\n <mat-button-toggle\n [value]=\"alignments.Center\"\n [matTooltip]=\"'NODER.TOOLTIP.CENTER' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-aligncenter\"></mat-icon>\n </mat-button-toggle>\n <mat-button-toggle\n [value]=\"alignments.Right\"\n [matTooltip]=\"'NODER.TOOLTIP.RIGHT' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-alignright\"></mat-icon>\n </mat-button-toggle>\n</mat-button-toggle-group>\n", styles: [":host{display:flex;align-items:center}mat-button-toggle{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}\n"], dependencies: [{ 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: "directive", type: i5$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
14853
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.0.5", type: FormatComponent, isStandalone: false, selector: "app-nod-format", inputs: { isDisabled: "isDisabled", alignment: "alignment" }, outputs: { selectAlignment: "selectAlignment" }, ngImport: i0, template: "<mat-button-toggle-group\n name=\"format\"\n [hideMultipleSelectionIndicator]=\"true\"\n [hideSingleSelectionIndicator]=\"true\"\n [disabled]=\"isDisabled\"\n [value]=\"alignment\"\n (change)=\"onSelectFormat($event.value)\">\n <mat-button-toggle\n [value]=\"alignments.Left\"\n [matTooltip]=\"'NODER.TOOLTIP.LEFT' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-alignleft\"></mat-icon>\n </mat-button-toggle>\n <mat-button-toggle\n [value]=\"alignments.Center\"\n [matTooltip]=\"'NODER.TOOLTIP.CENTER' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-aligncenter\"></mat-icon>\n </mat-button-toggle>\n <mat-button-toggle\n [value]=\"alignments.Right\"\n [matTooltip]=\"'NODER.TOOLTIP.RIGHT' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-alignright\"></mat-icon>\n </mat-button-toggle>\n <mat-button-toggle\n [value]=\"alignments.Justify\"\n [matTooltip]=\"'NODER.TOOLTIP.JUSTIFY' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-align\"></mat-icon>\n </mat-button-toggle>\n</mat-button-toggle-group>\n", styles: [":host{display:flex;align-items:center}mat-button-toggle{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}\n"], dependencies: [{ 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: "directive", type: i5$2.MatTooltip, selector: "[matTooltip]", inputs: ["matTooltipPosition", "matTooltipPositionAtOrigin", "matTooltipDisabled", "matTooltipShowDelay", "matTooltipHideDelay", "matTooltipTouchGestures", "matTooltip", "matTooltipClass"], exportAs: ["matTooltip"] }, { kind: "pipe", type: i4.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
14747
14854
  }
14748
14855
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.5", ngImport: i0, type: FormatComponent, decorators: [{
14749
14856
  type: Component,
14750
- args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'app-nod-format', standalone: false, template: "<mat-button-toggle-group\n name=\"format\"\n [hideMultipleSelectionIndicator]=\"true\"\n [hideSingleSelectionIndicator]=\"true\"\n [disabled]=\"isDisabled\"\n [value]=\"alignment\"\n (change)=\"onSelectFormat($event.value)\">\n <mat-button-toggle\n [value]=\"alignments.Left\"\n [matTooltip]=\"'NODER.TOOLTIP.LEFT' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-alignleft\"></mat-icon>\n </mat-button-toggle>\n <mat-button-toggle\n [value]=\"alignments.Center\"\n [matTooltip]=\"'NODER.TOOLTIP.CENTER' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-aligncenter\"></mat-icon>\n </mat-button-toggle>\n <mat-button-toggle\n [value]=\"alignments.Right\"\n [matTooltip]=\"'NODER.TOOLTIP.RIGHT' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-alignright\"></mat-icon>\n </mat-button-toggle>\n</mat-button-toggle-group>\n", styles: [":host{display:flex;align-items:center}mat-button-toggle{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}\n"] }]
14857
+ args: [{ changeDetection: ChangeDetectionStrategy.OnPush, selector: 'app-nod-format', standalone: false, template: "<mat-button-toggle-group\n name=\"format\"\n [hideMultipleSelectionIndicator]=\"true\"\n [hideSingleSelectionIndicator]=\"true\"\n [disabled]=\"isDisabled\"\n [value]=\"alignment\"\n (change)=\"onSelectFormat($event.value)\">\n <mat-button-toggle\n [value]=\"alignments.Left\"\n [matTooltip]=\"'NODER.TOOLTIP.LEFT' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-alignleft\"></mat-icon>\n </mat-button-toggle>\n <mat-button-toggle\n [value]=\"alignments.Center\"\n [matTooltip]=\"'NODER.TOOLTIP.CENTER' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-aligncenter\"></mat-icon>\n </mat-button-toggle>\n <mat-button-toggle\n [value]=\"alignments.Right\"\n [matTooltip]=\"'NODER.TOOLTIP.RIGHT' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-alignright\"></mat-icon>\n </mat-button-toggle>\n <mat-button-toggle\n [value]=\"alignments.Justify\"\n [matTooltip]=\"'NODER.TOOLTIP.JUSTIFY' | translate\"\n matTooltipPosition=\"below\">\n <mat-icon\n fontSet=\"noder-icon\"\n fontIcon=\"icon-format-align\"></mat-icon>\n </mat-button-toggle>\n</mat-button-toggle-group>\n", styles: [":host{display:flex;align-items:center}mat-button-toggle{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}\n"] }]
14751
14858
  }], propDecorators: { isDisabled: [{
14752
14859
  type: Input
14753
14860
  }], alignment: [{