@worktile/theia 21.0.0-next.1 → 21.0.0-next.2

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.
@@ -7159,10 +7159,11 @@ class TheCode extends TheBaseElement {
7159
7159
  if (this.options().mode !== this.element.language) {
7160
7160
  this.useMode();
7161
7161
  }
7162
- if (this.options().lineWrapping !== this.element.autoWrap) {
7162
+ const lineWrapping = this.element.autoWrap || false;
7163
+ if (this.options().lineWrapping !== lineWrapping) {
7163
7164
  this.useAutoWrap();
7164
7165
  }
7165
- if (this.resizeHeight !== this.element.height) {
7166
+ if (this.element.height && this.resizeHeight && this.resizeHeight !== this.element.height) {
7166
7167
  this.useHeight();
7167
7168
  }
7168
7169
  }
@@ -7258,6 +7259,7 @@ class TheCode extends TheBaseElement {
7258
7259
  useAutoWrap() {
7259
7260
  const isPrint = isPrintMode(this.editor);
7260
7261
  const lineWrapping = isPrint ? true : this.element.autoWrap || false;
7262
+ console.log('options', { ...this.options(), lineWrapping });
7261
7263
  this.options.set({ ...this.options(), lineWrapping });
7262
7264
  }
7263
7265
  useHeight() {
@@ -13542,9 +13544,9 @@ const withMoveSelection = (editor) => {
13542
13544
  editor.onClick = (event) => {
13543
13545
  const domSelection = window.getSelection();
13544
13546
  if (domSelection && !domSelection.isCollapsed && event.detail >= 2 && editor.selection) {
13545
- const slateSelection = AngularEditor.toSlateRange(editor, domSelection, { exactMatch: false, suppressThrow: false });
13546
- const isNextStart = slateSelection.focus.offset === 0;
13547
- if (Range.isExpanded(slateSelection) && Range.isForward(slateSelection) && isNextStart) {
13547
+ const slateSelection = AngularEditor.toSlateRange(editor, domSelection, { exactMatch: false, suppressThrow: true });
13548
+ const isNextStart = slateSelection && slateSelection.focus.offset === 0;
13549
+ if (slateSelection && Range.isExpanded(slateSelection) && Range.isForward(slateSelection) && isNextStart) {
13548
13550
  const beforePoint = Editor.before(editor, slateSelection.focus);
13549
13551
  const changedRange = Editor.range(editor, slateSelection.anchor, beforePoint);
13550
13552
  // slate-angular throttle 80ms, so wait selectionchange complete
@@ -17527,15 +17529,17 @@ const withTable = (editor) => {
17527
17529
  if (event.detail === 3) {
17528
17530
  const isMergedCell = isSelectedCellMerged(editor);
17529
17531
  const domSelection = window.getSelection();
17530
- if (domSelection && !domSelection.isCollapsed && editor.selection) {
17531
- const slateSelection = AngularEditor.toSlateRange(editor, domSelection, { exactMatch: false, suppressThrow: false });
17532
- const opts = new TableOptions();
17533
- const startPosition = TablePosition.create(opts, editor, slateSelection.anchor.path);
17534
- const endPosition = TablePosition.create(opts, editor, slateSelection.focus.path);
17535
- if (isMergedCell && startPosition.cell !== endPosition.cell) {
17536
- timer(81).subscribe(() => {
17537
- Transforms.select(editor, slateSelection.anchor.path);
17538
- });
17532
+ if (domSelection && isMergedCell && !domSelection.isCollapsed && editor.selection) {
17533
+ const slateSelection = AngularEditor.toSlateRange(editor, domSelection, { exactMatch: false, suppressThrow: true });
17534
+ if (slateSelection) {
17535
+ const opts = new TableOptions();
17536
+ const startPosition = TablePosition.create(opts, editor, slateSelection.anchor.path);
17537
+ const endPosition = TablePosition.create(opts, editor, slateSelection.focus.path);
17538
+ if (startPosition.cell !== endPosition.cell) {
17539
+ timer(81).subscribe(() => {
17540
+ Transforms.select(editor, slateSelection.anchor.path);
17541
+ });
17542
+ }
17539
17543
  }
17540
17544
  }
17541
17545
  }