@worktile/theia 16.2.4 → 16.2.6

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.
@@ -2445,7 +2445,7 @@ const isEmptyContent = (children) => {
2445
2445
 
2446
2446
  const isEmptyContentByFilter = (editor, rules) => {
2447
2447
  const { children } = editor;
2448
- if (children.length < 1) {
2448
+ if (!children || children.length < 1) {
2449
2449
  return true;
2450
2450
  }
2451
2451
  const defaultTypes = [ElementKinds.code, ElementKinds.table, ElementKinds.image];
@@ -7215,7 +7215,7 @@ class TheCodeComponent extends TheBaseElementComponent {
7215
7215
  readOnly: false,
7216
7216
  autofocus: false,
7217
7217
  lineWiseCopyCut: true,
7218
- lineWrapping: isPrintMode(this.editor),
7218
+ lineWrapping: false,
7219
7219
  cursorBlinkRate: 500
7220
7220
  };
7221
7221
  this.activeLanguage = this.menus[0];
@@ -7366,7 +7366,9 @@ class TheCodeComponent extends TheBaseElementComponent {
7366
7366
  }
7367
7367
  }
7368
7368
  useAutoWrap() {
7369
- this.options = { ...this.options, lineWrapping: this.element.autoWrap || false };
7369
+ const isPrint = isPrintMode(this.editor);
7370
+ const lineWrapping = isPrint ? true : this.element.autoWrap || false;
7371
+ this.options = { ...this.options, lineWrapping };
7370
7372
  }
7371
7373
  useHeight() {
7372
7374
  if (this.element.height && !isPrintMode(this.editor)) {
@@ -11938,6 +11940,8 @@ class TableStore {
11938
11940
  this.areaSelectRowAndColumn(rangeCells);
11939
11941
  }
11940
11942
  else {
11943
+ const lastColIndex = pos.tableEntry[0].children[index].children.length - 1;
11944
+ this.setAnchorCellPath(pos.tableEntry[1].concat([index, lastColIndex]));
11941
11945
  this.setSelectedCells(rangeCells, pos);
11942
11946
  this.focusCell(pos.tableEntry[1].concat([index, 0]));
11943
11947
  }
@@ -11950,6 +11954,8 @@ class TableStore {
11950
11954
  this.areaSelectRowAndColumn(rangeCells);
11951
11955
  }
11952
11956
  else {
11957
+ const lastRowIndex = pos.tableEntry[0].children.length - 1;
11958
+ this.setAnchorCellPath(pos.tableEntry[1].concat([lastRowIndex, index]));
11953
11959
  this.setSelectedCells(rangeCells, pos);
11954
11960
  this.focusCell(pos.tableEntry[1].concat([0, index]));
11955
11961
  }
@@ -11961,7 +11967,7 @@ class TableStore {
11961
11967
  const anchorCellPath = pos.tableEntry[1].concat([lastCell.row, lastCell.col]);
11962
11968
  this.isSelectedTable = true;
11963
11969
  this.setSelectedCells(cells, pos);
11964
- this.setAreaAnchorCellPath(anchorCellPath);
11970
+ this.setAnchorCellPath(anchorCellPath);
11965
11971
  this.focusCell(pos.tableEntry[1].concat([0, 0]));
11966
11972
  }
11967
11973
  // 拖选开始 || 记录聚焦点
@@ -11969,7 +11975,7 @@ class TableStore {
11969
11975
  const node = AngularEditor.toSlateNode(editor, cell);
11970
11976
  const path = AngularEditor.findPath(editor, node);
11971
11977
  this.isPrepareSelecting = true;
11972
- this.anchorCellPath = path;
11978
+ this.setAnchorCellPath(path);
11973
11979
  this.focusCellPath = path;
11974
11980
  this.focusCellElement = cell;
11975
11981
  this.lastFocusCellPath = path;
@@ -12007,7 +12013,7 @@ class TableStore {
12007
12013
  selectCell(cell, editor) {
12008
12014
  const node = AngularEditor.toSlateNode(editor, cell);
12009
12015
  const path = AngularEditor.findPath(editor, node);
12010
- this.anchorCellPath = path;
12016
+ this.setAnchorCellPath(path);
12011
12017
  this.focusCellPath = path;
12012
12018
  this.focusCellElement = cell;
12013
12019
  const [row, col] = path.slice(-2);
@@ -12203,7 +12209,7 @@ class TableStore {
12203
12209
  this.isPrepareSelecting = true;
12204
12210
  this.lastFocusCellPath = path;
12205
12211
  if (!this?.anchorCellPath) {
12206
- this.anchorCellPath = path;
12212
+ this.setAnchorCellPath(path);
12207
12213
  }
12208
12214
  if (!this?.focusCellPath) {
12209
12215
  this.focusCellPath = path;
@@ -12247,16 +12253,16 @@ class TableStore {
12247
12253
  const endCol = sortRows[sortRows.length - 1];
12248
12254
  const anchorCellPath = pos.tableEntry[1].concat([endCol, endRow]);
12249
12255
  const focusCellPath = pos.tableEntry[1].concat([startRow, startCol]);
12250
- this.setAreaAnchorCellPath(anchorCellPath);
12256
+ this.setAnchorCellPath(anchorCellPath);
12251
12257
  this.focusCell(focusCellPath);
12252
12258
  this.selectCells(this.editor);
12253
12259
  }
12254
12260
  /**
12255
- * 设置区域选择触发时的指定 anchorCellPath
12261
+ * 设置指定 anchorCellPath
12256
12262
  * @param path 路径
12257
12263
  */
12258
- setAreaAnchorCellPath(path) {
12259
- if (this.areaSelection && path) {
12264
+ setAnchorCellPath(path) {
12265
+ if (path) {
12260
12266
  this.anchorCellPath = path;
12261
12267
  }
12262
12268
  }