@worktile/theia 2.2.4 → 2.2.8

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.
@@ -6567,10 +6567,41 @@ class TheCodeComponent extends TheBaseElementComponent {
6567
6567
  }
6568
6568
  AngularEditor.focus(this.editor);
6569
6569
  Transforms.select(this.editor, AngularEditor.findPath(this.editor, this.element));
6570
- document.execCommand('copy');
6571
- this.thyNotifyService.success('复制成功');
6570
+ if (IS_SAFARI) {
6571
+ this.safariCopy();
6572
+ return;
6573
+ }
6574
+ document.execCommand('copy') ? this.thyNotifyService.success('复制成功') : this.thyNotifyService.error('复制失败');
6572
6575
  AngularEditor.deselect(this.editor);
6573
6576
  }
6577
+ safariCopy() {
6578
+ const currentElement = AngularEditor.toDOMNode(this.editor, this.element);
6579
+ const blockCard = currentElement.closest('.slate-block-card');
6580
+ const span = document.createElement('pre');
6581
+ span.appendChild(blockCard.cloneNode(true));
6582
+ span.textContent = this.element.content;
6583
+ if (this.element.language) {
6584
+ span.setAttribute('data-language', this.element.language);
6585
+ }
6586
+ if (this.element.autoWrap) {
6587
+ span.setAttribute('data-auto-wrap', String(this.element.autoWrap));
6588
+ }
6589
+ if (this.element.height) {
6590
+ span.setAttribute('data-height', String(this.element.height));
6591
+ }
6592
+ document.body.appendChild(span);
6593
+ const selection = window.getSelection();
6594
+ const range = document.createRange();
6595
+ if (selection) {
6596
+ selection.removeAllRanges();
6597
+ range.selectNode(span);
6598
+ selection.addRange(range);
6599
+ document.execCommand('copy') ? this.thyNotifyService.success('复制成功') : this.thyNotifyService.error('复制失败');
6600
+ selection.removeAllRanges();
6601
+ document.body.removeChild(span);
6602
+ AngularEditor.deselect(this.editor);
6603
+ }
6604
+ }
6574
6605
  focusChange(codeMirrorFocused) {
6575
6606
  if (codeMirrorFocused) {
6576
6607
  this.isHightLight = false;
@@ -6994,7 +7025,7 @@ class TheLinkComponent extends TheBaseLinkComponent {
6994
7025
  super(...arguments);
6995
7026
  // Put this at the start and end of an inline component to work around this Chromium bug:
6996
7027
  // https://bugs.chromium.org/p/chromium/issues/detail?id=1249405
6997
- this.inlineChromiumBugfix = '$' + String.fromCodePoint(160);
7028
+ this.inlineChromiumBugfix = String.fromCodePoint(160);
6998
7029
  }
6999
7030
  }
7000
7031
  TheLinkComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheLinkComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
@@ -9142,7 +9173,7 @@ class ColumnResizingStore {
9142
9173
  restoreTopRows(deltaY) {
9143
9174
  let index = this.resizeRows.length - 1;
9144
9175
  while (index >= 0 && deltaY > 0) {
9145
- const currentHeight = coercePixelsFromCssValue(this.resizeRows[index].rowElement.style.height);
9176
+ const currentHeight = this.resizeRows[index].rowElement.getBoundingClientRect().height;
9146
9177
  if (this.resizeRows[index].baseHeight > currentHeight) {
9147
9178
  if (this.resizeRows[index].baseHeight > currentHeight + deltaY) {
9148
9179
  this.resizeRows[index].rowElement.style.height = coerceCssPixelValue(currentHeight + deltaY);
@@ -9728,16 +9759,16 @@ class TheTdComponent extends TheBaseElementComponent {
9728
9759
  merge(this.resizeNotifier.resizeCanceled, this.resizeNotifier.triggerResize)
9729
9760
  .pipe(takeUntilDestroyed, filter(columnSize => columnSize.tableCell === this.elementRef.nativeElement))
9730
9761
  .subscribe(({ deltaSize, previousSize, completeImmediately }) => {
9731
- const { top, left } = this.elementRef.nativeElement.getBoundingClientRect();
9762
+ const { top, left, height, width } = this.elementRef.nativeElement.getBoundingClientRect();
9732
9763
  const { clientY, clientX } = event;
9733
9764
  let isApplySize = false;
9734
9765
  if (this.isXAxisHover) {
9735
- const width = this.hoverdDirection === 'left' ? 0 : this.tableOptions.minWidthPx;
9736
- isApplySize = deltaSize > 0 && left + width - clientX <= 0;
9766
+ const cellWidth = this.hoverdDirection === 'left' ? 0 : width;
9767
+ isApplySize = deltaSize > 0 && left + cellWidth - clientX <= 0;
9737
9768
  }
9738
9769
  else {
9739
- const height = this.hoverdDirection === 'bottom' ? 0 : this.tableOptions.minHeightPx;
9740
- isApplySize = deltaSize > 0 && top + height - clientY <= 0;
9770
+ const cellHeight = this.hoverdDirection === 'bottom' ? 0 : height;
9771
+ isApplySize = deltaSize > 0 && top + cellHeight - clientY <= 0;
9741
9772
  }
9742
9773
  if (isApplySize || deltaSize < 0) {
9743
9774
  this.elementRef.nativeElement.classList.add(OVERLAY_ACTIVE_CLASS);
@@ -10824,7 +10855,7 @@ class TheToolbarItemComponent extends TheToolbarBaseItemComponent {
10824
10855
  }
10825
10856
  }
10826
10857
  TheToolbarItemComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheToolbarItemComponent, deps: [{ token: i0.NgZone }, { token: i0.ComponentFactoryResolver }], target: i0.ɵɵFactoryTarget.Component });
10827
- TheToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { item: "item", editor: "editor", itemMode: "itemMode" }, host: { listeners: { "mousedown": "toggleDropdown($event)" }, properties: { "class.disabled": "this.disabledState" }, classAttribute: "the-toolbar-item" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0, template: `
10858
+ TheToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: { editor: "editor", item: "item", itemMode: "itemMode" }, host: { listeners: { "mousedown": "toggleDropdown($event)" }, properties: { "class.disabled": "this.disabledState" }, classAttribute: "the-toolbar-item" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, ngImport: i0, template: `
10828
10859
  <ng-container *ngIf="itemMode === ToolbarItemMode.horizontal; else selectionItem">
10829
10860
  <a
10830
10861
  thyIconNavLink
@@ -10874,9 +10905,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
10874
10905
  class: 'the-toolbar-item'
10875
10906
  }
10876
10907
  }]
10877
- }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ComponentFactoryResolver }]; }, propDecorators: { item: [{
10908
+ }], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ComponentFactoryResolver }]; }, propDecorators: { editor: [{
10878
10909
  type: Input
10879
- }], editor: [{
10910
+ }], item: [{
10880
10911
  type: Input
10881
10912
  }], itemMode: [{
10882
10913
  type: Input
@@ -10937,7 +10968,7 @@ class TheQuickToolbarComponent extends mixinUnsubscribe(MixinBase) {
10937
10968
  }
10938
10969
  }
10939
10970
  TheQuickToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheQuickToolbarComponent, deps: [{ token: i1$3.ThyPopoverRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
10940
- TheQuickToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheQuickToolbarComponent, selector: "the-quick-toolbar", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems" }, host: { listeners: { "document: mousedown": "handleMouseDown($event)", "document: keydown.enter": "handleEnter()", "document: keydown.escape": "handleEsc()" } }, usesInheritance: true, ngImport: i0, template: "<thy-selection-list\n class=\"the-quick-toolbar\"\n [thyBindKeyEventContainer]=\"editorElement\"\n (thySelectionChange)=\"selectionChange($event)\"\n [thyMultiple]=\"false\"\n>\n <ng-container *ngFor=\"let item of quickToolbarItems\">\n <ng-container *ngIf=\"item.key !== ToolbarActionTypes.split; else splitLine\">\n <thy-list-option [thyValue]=\"item?.key\" (mousedown)=\"stopPropagation($event)\">\n <the-toolbar-item [editor]=\"editor\" [item]=\"item\" [itemMode]=\"ToolbarItemMode.vertical\"></the-toolbar-item>\n </thy-list-option>\n </ng-container>\n </ng-container>\n</thy-selection-list>\n\n<ng-template #splitLine>\n <nav-split-line [mode]=\"ToolbarItemMode.horizontal\"></nav-split-line>\n</ng-template>\n", components: [{ type: i2$2.ThySelectionListComponent, selector: "thy-selection-list,[thy-selection-list]", inputs: ["thyMultiple", "thyBindKeyEventContainer", "thyScrollContainer", "thyBeforeKeydown", "thyUniqueKey", "thyCompareWith", "thyLayout", "thyAutoActiveFirstItem", "thySize", "thySpaceKeyEnabled"], outputs: ["thySelectionChange"] }, { type: i5$3.ThyListOptionComponent, selector: "thy-list-option,[thy-list-option]", inputs: ["id", "thyValue", "thyDisabled"] }, { type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: ["item", "editor", "itemMode"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
10971
+ TheQuickToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheQuickToolbarComponent, selector: "the-quick-toolbar", inputs: { editor: "editor", quickToolbarItems: "quickToolbarItems" }, host: { listeners: { "document: mousedown": "handleMouseDown($event)", "document: keydown.enter": "handleEnter()", "document: keydown.escape": "handleEsc()" } }, usesInheritance: true, ngImport: i0, template: "<thy-selection-list\n class=\"the-quick-toolbar\"\n [thyBindKeyEventContainer]=\"editorElement\"\n (thySelectionChange)=\"selectionChange($event)\"\n [thyMultiple]=\"false\"\n>\n <ng-container *ngFor=\"let item of quickToolbarItems\">\n <ng-container *ngIf=\"item.key !== ToolbarActionTypes.split; else splitLine\">\n <thy-list-option [thyValue]=\"item?.key\" (mousedown)=\"stopPropagation($event)\">\n <the-toolbar-item [editor]=\"editor\" [item]=\"item\" [itemMode]=\"ToolbarItemMode.vertical\"></the-toolbar-item>\n </thy-list-option>\n </ng-container>\n </ng-container>\n</thy-selection-list>\n\n<ng-template #splitLine>\n <nav-split-line [mode]=\"ToolbarItemMode.horizontal\"></nav-split-line>\n</ng-template>\n", components: [{ type: i2$2.ThySelectionListComponent, selector: "thy-selection-list,[thy-selection-list]", inputs: ["thyMultiple", "thyBindKeyEventContainer", "thyScrollContainer", "thyBeforeKeydown", "thyUniqueKey", "thyCompareWith", "thyLayout", "thyAutoActiveFirstItem", "thySize", "thySpaceKeyEnabled"], outputs: ["thySelectionChange"] }, { type: i5$3.ThyListOptionComponent, selector: "thy-list-option,[thy-list-option]", inputs: ["id", "thyValue", "thyDisabled"] }, { type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: ["editor", "item", "itemMode"] }, { type: NavSplitLineComponent, selector: "nav-split-line", inputs: ["mode"] }], directives: [{ type: i6.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
10941
10972
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheQuickToolbarComponent, decorators: [{
10942
10973
  type: Component,
10943
10974
  args: [{
@@ -11173,14 +11204,14 @@ class TheInlineCodeComponent extends TheBaseElementComponent {
11173
11204
  }
11174
11205
  }
11175
11206
  TheInlineCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheInlineCodeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
11176
- TheInlineCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheInlineCodeComponent, selector: "span[theInlineCode]", usesInheritance: true, ngImport: i0, template: ` <span contenteditable="false" style="font-size: 0;">{{ inlineChromiumBugfix }}</span>
11207
+ TheInlineCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheInlineCodeComponent, selector: "span[theInlineCode]", usesInheritance: true, ngImport: i0, template: `<span contenteditable="false" style="font-size: 0;">{{ inlineChromiumBugfix }}</span>
11177
11208
  <slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>
11178
11209
  <span contenteditable="false" style="font-size: 0;">{{ inlineChromiumBugfix }}</span>`, isInline: true, components: [{ type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
11179
11210
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheInlineCodeComponent, decorators: [{
11180
11211
  type: Component,
11181
11212
  args: [{
11182
11213
  selector: 'span[theInlineCode]',
11183
- template: ` <span contenteditable="false" style="font-size: 0;">{{ inlineChromiumBugfix }}</span>
11214
+ template: `<span contenteditable="false" style="font-size: 0;">{{ inlineChromiumBugfix }}</span>
11184
11215
  <slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>
11185
11216
  <span contenteditable="false" style="font-size: 0;">{{ inlineChromiumBugfix }}</span>`
11186
11217
  }]
@@ -11451,8 +11482,7 @@ const onKeydownTextIndent = (editor, event, kinds) => {
11451
11482
  return false;
11452
11483
  }
11453
11484
  const [block, path] = startBlock;
11454
- const currentPath = [path[0]];
11455
- const isStart = Editor.isStart(editor, selection.anchor, currentPath);
11485
+ const isStart = Editor.isStart(editor, selection.anchor, path);
11456
11486
  const textIndentDisable = [ElementKinds.bulletedList, ElementKinds.numberedList, ElementKinds.checkItem];
11457
11487
  if (isKeyHotkey('Tab', event)) {
11458
11488
  event.preventDefault();
@@ -11688,8 +11718,9 @@ const autoScrollViewHandle = (editor, scrollContainer) => {
11688
11718
  };
11689
11719
 
11690
11720
  class TheToolbarComponent {
11691
- constructor(cfr, elementRef, ngZone, toolbarGroupComponent) {
11721
+ constructor(cfr, cdr, elementRef, ngZone, toolbarGroupComponent) {
11692
11722
  this.cfr = cfr;
11723
+ this.cdr = cdr;
11693
11724
  this.elementRef = elementRef;
11694
11725
  this.ngZone = ngZone;
11695
11726
  this.toolbarGroupComponent = toolbarGroupComponent;
@@ -11764,6 +11795,7 @@ class TheToolbarComponent {
11764
11795
  }
11765
11796
  this.createMoreGroup(group);
11766
11797
  });
11798
+ this.cdr.markForCheck();
11767
11799
  }
11768
11800
  /**
11769
11801
  * calculation display toolbar and more grouped toolbars
@@ -11902,7 +11934,7 @@ class TheToolbarComponent {
11902
11934
  return (_c = item === null || item === void 0 ? void 0 : item.includes) === null || _c === void 0 ? void 0 : _c.find((item) => item.key === dropdownKey);
11903
11935
  }
11904
11936
  }
11905
- TheToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheToolbarComponent, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: TheToolbarGroupToken }], target: i0.ɵɵFactoryTarget.Component });
11937
+ TheToolbarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheToolbarComponent, deps: [{ token: i0.ComponentFactoryResolver }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: TheToolbarGroupToken }], target: i0.ɵɵFactoryTarget.Component });
11906
11938
  TheToolbarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarComponent, selector: "the-toolbar", inputs: { editor: "editor", toolbarItems: "toolbarItems", align: "align", containerClass: "containerClass", isMore: "isMore", afterTemplate: "afterTemplate" }, host: { classAttribute: "the-toolbar-container" }, viewQueries: [{ propertyName: "toolbarContainer", first: true, predicate: ["toolbarContainer"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: "<thy-icon-nav [style.justifyContent]=\"align\">\n <ng-container #toolbarContainer></ng-container>\n <ng-content></ng-content>\n <ng-template *ngIf=\"afterTemplate\" [ngTemplateOutlet]=\"afterTemplate\"></ng-template>\n</thy-icon-nav>\n", components: [{ type: i3.ThyIconNavComponent, selector: "thy-icon-nav", inputs: ["thyType"] }], directives: [{ type: i6.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
11907
11939
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheToolbarComponent, decorators: [{
11908
11940
  type: Component,
@@ -11913,7 +11945,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
11913
11945
  class: 'the-toolbar-container'
11914
11946
  }
11915
11947
  }]
11916
- }], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
11948
+ }], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
11917
11949
  type: Inject,
11918
11950
  args: [TheToolbarGroupToken]
11919
11951
  }] }]; }, propDecorators: { editor: [{