@worktile/theia 20.1.0-next.2 → 20.1.0-next.4

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.
@@ -13327,7 +13327,7 @@ const createBlockCardPlugin = createPluginFactory({
13327
13327
  });
13328
13328
 
13329
13329
  const withInternalCommon = (editor) => {
13330
- const { globalMousedown, onKeydown } = editor;
13330
+ const { globalMousedown, onKeydown, selectAll } = editor;
13331
13331
  editor.globalMousedown = (event) => {
13332
13332
  const target = event.target;
13333
13333
  if (isColorIndicator(target)) {
@@ -13350,6 +13350,34 @@ const withInternalCommon = (editor) => {
13350
13350
  }
13351
13351
  onKeydown(event);
13352
13352
  };
13353
+ editor.selectAll = () => {
13354
+ let node = null;
13355
+ if (!editor.selection) {
13356
+ setEndSelection(editor);
13357
+ }
13358
+ const [start, end] = Range.edges(editor.selection);
13359
+ const selectionRange = Editor.range(editor, start, end);
13360
+ const containerBlocks = getContainerBlocks(editor);
13361
+ for (let i = 0; i < containerBlocks.length; i++) {
13362
+ [node] = getNodesByType(editor, containerBlocks[i]);
13363
+ if (node) {
13364
+ const [, path] = node;
13365
+ const isStartParent = Path.equals(path, start.path.slice(0, path.length));
13366
+ const isEndParent = Path.equals(path, end.path.slice(0, path.length));
13367
+ if (isStartParent && isEndParent) {
13368
+ const nodeRange = Editor.range(editor, path);
13369
+ if (!Range.equals(nodeRange, selectionRange)) {
13370
+ Transforms.select(editor, nodeRange);
13371
+ break;
13372
+ }
13373
+ node = null;
13374
+ }
13375
+ }
13376
+ }
13377
+ if (!node) {
13378
+ Transforms.select(editor, []);
13379
+ }
13380
+ };
13353
13381
  return editor;
13354
13382
  };
13355
13383
  const createCommonPlugin = (locale) => createPluginFactory({
@@ -18250,9 +18278,6 @@ class TheEditorComponent {
18250
18278
  event.preventDefault();
18251
18279
  return;
18252
18280
  }
18253
- if (isKeyHotkey('mod+a', event) && !event.defaultPrevented) {
18254
- this.handleSelectAll(event);
18255
- }
18256
18281
  };
18257
18282
  this.onClick = (event) => {
18258
18283
  AngularEditor.onClick(this.editor, event);
@@ -18315,7 +18340,6 @@ class TheEditorComponent {
18315
18340
  }
18316
18341
  }
18317
18342
  ngOnDestroy() {
18318
- this.scrollContainerResizeObserver?.disconnect();
18319
18343
  THE_EDITOR_PREVIOUS_SELECTION.delete(this.editor);
18320
18344
  }
18321
18345
  bindVirtualScrollContainer() {
@@ -18324,10 +18348,6 @@ class TheEditorComponent {
18324
18348
  return;
18325
18349
  }
18326
18350
  this.scrollContainerElement = scrollContainer;
18327
- this.scrollContainerResizeObserver = new ResizeObserver(() => {
18328
- this.syncVirtualConfig();
18329
- });
18330
- this.scrollContainerResizeObserver.observe(scrollContainer);
18331
18351
  this.ngZone.runOutsideAngular(() => {
18332
18352
  fromEvent(scrollContainer, 'scroll')
18333
18353
  .pipe(takeUntilDestroyed(this.destroyRef))
@@ -18342,21 +18362,21 @@ class TheEditorComponent {
18342
18362
  JUST_NOW_UPDATED_VIRTUAL_VIEW.set(this.editor, false);
18343
18363
  }
18344
18364
  });
18365
+ this.syncVirtualConfig();
18345
18366
  });
18346
- this.syncVirtualConfig();
18347
18367
  }
18348
18368
  syncVirtualConfig() {
18349
18369
  if (!this.virtualConfig().enabled || !this.scrollContainerElement) {
18350
18370
  return;
18351
18371
  }
18352
- const { scrollTop, clientHeight } = this.scrollContainerElement;
18372
+ const { scrollTop, offsetHeight } = this.scrollContainerElement;
18353
18373
  if (localStorage.getItem(SLATE_DEBUG_KEY + '__SCROLL_TOP')) {
18354
18374
  console.log(`theia: scroll event fired from user: ${scrollTop}`);
18355
18375
  }
18356
18376
  this.virtualConfig.update(config => ({
18357
18377
  ...config,
18358
18378
  scrollTop,
18359
- viewportHeight: clientHeight
18379
+ viewportHeight: offsetHeight
18360
18380
  }));
18361
18381
  }
18362
18382
  initialize() {
@@ -18558,36 +18578,6 @@ class TheEditorComponent {
18558
18578
  mousedown(event) {
18559
18579
  this.editor.mousedown(event);
18560
18580
  }
18561
- handleSelectAll(event) {
18562
- let node = null;
18563
- if (!this.editor.selection) {
18564
- setEndSelection(this.editor);
18565
- }
18566
- const [start, end] = Range.edges(this.editor.selection);
18567
- const selectionRange = Editor.range(this.editor, start, end);
18568
- const containerBlocks = getContainerBlocks(this.editor);
18569
- for (let i = 0; i < containerBlocks.length; i++) {
18570
- [node] = getNodesByType(this.editor, containerBlocks[i]);
18571
- if (node) {
18572
- const [, path] = node;
18573
- const isStartParent = Path.equals(path, start.path.slice(0, path.length));
18574
- const isEndParent = Path.equals(path, end.path.slice(0, path.length));
18575
- if (isStartParent && isEndParent) {
18576
- const nodeRange = Editor.range(this.editor, path);
18577
- if (!Range.equals(nodeRange, selectionRange)) {
18578
- Transforms.select(this.editor, nodeRange);
18579
- break;
18580
- }
18581
- node = null;
18582
- }
18583
- }
18584
- }
18585
- if (!node) {
18586
- Transforms.select(this.editor, []);
18587
- }
18588
- event.preventDefault();
18589
- return;
18590
- }
18591
18581
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.14", ngImport: i0, type: TheEditorComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.DestroyRef }, { token: i0.ElementRef }, { token: i0.Injector }, { token: i0.NgZone }, { token: i0.ViewContainerRef }, { token: TheContextService }, { token: i2$5.ThyIconRegistry }, { token: THE_PRESET_CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
18592
18582
  static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.14", type: TheEditorComponent, isStandalone: true, selector: "the-editor, theEditor", inputs: { theOptions: "theOptions", thePlugins: "thePlugins", theGlobalToolbar: "theGlobalToolbar", theDecorate: "theDecorate", theOnError: "theOnError" }, outputs: { theOnSave: "theOnSave", theOnDOMEvent: "theOnDOMEvent", theEditorCreated: "theEditorCreated", theUploadingStatus: "theUploadingStatus" }, host: { properties: { "class.the-editor-readonly": "editor.options?.readonly", "class.the-mobile-editor": "isMobileMode" }, classAttribute: "the-editor" }, providers: [
18593
18583
  TheContextService,