@worktile/theia 2.1.14 → 2.1.15
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.
- package/bundles/worktile-theia.umd.js +64 -18
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/components/toolbar/toolbar.component.d.ts +3 -2
- package/components/toolbar-item/toolbar-item.component.d.ts +3 -4
- package/esm2015/components/column-resize/resizing.store.js +2 -2
- package/esm2015/components/toolbar/toolbar.component.js +6 -4
- package/esm2015/components/toolbar-item/toolbar-item.component.js +4 -4
- package/esm2015/plugins/code/code.component.js +35 -4
- package/esm2015/plugins/inline-code/inline-code.component.js +4 -4
- package/esm2015/plugins/link/link.component.js +2 -2
- package/esm2015/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.js +1 -1
- package/esm2015/plugins/table/components/td/td.component.js +18 -5
- package/fesm2015/worktile-theia.js +64 -18
- package/fesm2015/worktile-theia.js.map +1 -1
- package/package.json +1 -1
- package/plugins/code/code.component.d.ts +1 -0
- package/plugins/inline-code/inline-code.component.scss +0 -1
|
@@ -6736,10 +6736,41 @@ class TheCodeComponent extends TheBaseElementComponent {
|
|
|
6736
6736
|
}
|
|
6737
6737
|
AngularEditor.focus(this.editor);
|
|
6738
6738
|
Transforms.select(this.editor, AngularEditor.findPath(this.editor, this.element));
|
|
6739
|
-
|
|
6740
|
-
|
|
6739
|
+
if (IS_SAFARI) {
|
|
6740
|
+
this.safariCopy();
|
|
6741
|
+
return;
|
|
6742
|
+
}
|
|
6743
|
+
document.execCommand('copy') ? this.thyNotifyService.success('复制成功') : this.thyNotifyService.error('复制失败');
|
|
6741
6744
|
AngularEditor.deselect(this.editor);
|
|
6742
6745
|
}
|
|
6746
|
+
safariCopy() {
|
|
6747
|
+
const currentElement = AngularEditor.toDOMNode(this.editor, this.element);
|
|
6748
|
+
const blockCard = currentElement.closest('.slate-block-card');
|
|
6749
|
+
const span = document.createElement('pre');
|
|
6750
|
+
span.appendChild(blockCard.cloneNode(true));
|
|
6751
|
+
span.textContent = this.element.content;
|
|
6752
|
+
if (this.element.language) {
|
|
6753
|
+
span.setAttribute('data-language', this.element.language);
|
|
6754
|
+
}
|
|
6755
|
+
if (this.element.autoWrap) {
|
|
6756
|
+
span.setAttribute('data-auto-wrap', String(this.element.autoWrap));
|
|
6757
|
+
}
|
|
6758
|
+
if (this.element.height) {
|
|
6759
|
+
span.setAttribute('data-height', String(this.element.height));
|
|
6760
|
+
}
|
|
6761
|
+
document.body.appendChild(span);
|
|
6762
|
+
const selection = window.getSelection();
|
|
6763
|
+
const range = document.createRange();
|
|
6764
|
+
if (selection) {
|
|
6765
|
+
selection.removeAllRanges();
|
|
6766
|
+
range.selectNode(span);
|
|
6767
|
+
selection.addRange(range);
|
|
6768
|
+
document.execCommand('copy') ? this.thyNotifyService.success('复制成功') : this.thyNotifyService.error('复制失败');
|
|
6769
|
+
selection.removeAllRanges();
|
|
6770
|
+
document.body.removeChild(span);
|
|
6771
|
+
AngularEditor.deselect(this.editor);
|
|
6772
|
+
}
|
|
6773
|
+
}
|
|
6743
6774
|
focusChange(codeMirrorFocused) {
|
|
6744
6775
|
if (codeMirrorFocused) {
|
|
6745
6776
|
this.isHightLight = false;
|
|
@@ -7163,7 +7194,7 @@ class TheLinkComponent extends TheBaseLinkComponent {
|
|
|
7163
7194
|
super(...arguments);
|
|
7164
7195
|
// Put this at the start and end of an inline component to work around this Chromium bug:
|
|
7165
7196
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=1249405
|
|
7166
|
-
this.inlineChromiumBugfix =
|
|
7197
|
+
this.inlineChromiumBugfix = String.fromCodePoint(160);
|
|
7167
7198
|
}
|
|
7168
7199
|
}
|
|
7169
7200
|
TheLinkComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheLinkComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -9265,7 +9296,7 @@ class ColumnResizingStore {
|
|
|
9265
9296
|
restoreTopRows(deltaY) {
|
|
9266
9297
|
let index = this.resizeRows.length - 1;
|
|
9267
9298
|
while (index >= 0 && deltaY > 0) {
|
|
9268
|
-
const currentHeight =
|
|
9299
|
+
const currentHeight = this.resizeRows[index].rowElement.getBoundingClientRect().height;
|
|
9269
9300
|
if (this.resizeRows[index].baseHeight > currentHeight) {
|
|
9270
9301
|
if (this.resizeRows[index].baseHeight > currentHeight + deltaY) {
|
|
9271
9302
|
this.resizeRows[index].rowElement.style.height = coerceCssPixelValue(currentHeight + deltaY);
|
|
@@ -9851,10 +9882,23 @@ class TheTdComponent extends TheBaseElementComponent {
|
|
|
9851
9882
|
merge(this.resizeNotifier.resizeCanceled, this.resizeNotifier.triggerResize)
|
|
9852
9883
|
.pipe(takeUntilDestroyed, filter(columnSize => columnSize.tableCell === this.elementRef.nativeElement))
|
|
9853
9884
|
.subscribe(({ deltaSize, previousSize, completeImmediately }) => {
|
|
9854
|
-
this.elementRef.nativeElement.
|
|
9855
|
-
|
|
9856
|
-
|
|
9857
|
-
|
|
9885
|
+
const { top, left, height, width } = this.elementRef.nativeElement.getBoundingClientRect();
|
|
9886
|
+
const { clientY, clientX } = event;
|
|
9887
|
+
let isApplySize = false;
|
|
9888
|
+
if (this.isXAxisHover) {
|
|
9889
|
+
const cellWidth = this.hoverdDirection === 'left' ? 0 : width;
|
|
9890
|
+
isApplySize = deltaSize > 0 && left + cellWidth - clientX <= 0;
|
|
9891
|
+
}
|
|
9892
|
+
else {
|
|
9893
|
+
const cellHeight = this.hoverdDirection === 'bottom' ? 0 : height;
|
|
9894
|
+
isApplySize = deltaSize > 0 && top + cellHeight - clientY <= 0;
|
|
9895
|
+
}
|
|
9896
|
+
if (isApplySize || deltaSize < 0) {
|
|
9897
|
+
this.elementRef.nativeElement.classList.add(OVERLAY_ACTIVE_CLASS);
|
|
9898
|
+
this.applySize(deltaSize, previousSize);
|
|
9899
|
+
if (completeImmediately) {
|
|
9900
|
+
this._completeResizeOperation();
|
|
9901
|
+
}
|
|
9858
9902
|
}
|
|
9859
9903
|
});
|
|
9860
9904
|
merge(this.resizeNotifier.resizeCanceled, this.resizeNotifier.resizeCompleted)
|
|
@@ -10934,7 +10978,7 @@ class TheToolbarItemComponent extends TheToolbarBaseItemComponent {
|
|
|
10934
10978
|
}
|
|
10935
10979
|
}
|
|
10936
10980
|
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 });
|
|
10937
|
-
TheToolbarItemComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheToolbarItemComponent, selector: "the-toolbar-item", inputs: {
|
|
10981
|
+
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: `
|
|
10938
10982
|
<ng-container *ngIf="itemMode === ToolbarItemMode.horizontal; else selectionItem">
|
|
10939
10983
|
<a
|
|
10940
10984
|
thyIconNavLink
|
|
@@ -10984,9 +11028,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
10984
11028
|
class: 'the-toolbar-item'
|
|
10985
11029
|
}
|
|
10986
11030
|
}]
|
|
10987
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ComponentFactoryResolver }]; }, propDecorators: {
|
|
11031
|
+
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i0.ComponentFactoryResolver }]; }, propDecorators: { editor: [{
|
|
10988
11032
|
type: Input
|
|
10989
|
-
}],
|
|
11033
|
+
}], item: [{
|
|
10990
11034
|
type: Input
|
|
10991
11035
|
}], itemMode: [{
|
|
10992
11036
|
type: Input
|
|
@@ -11047,7 +11091,7 @@ class TheQuickToolbarComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
11047
11091
|
}
|
|
11048
11092
|
}
|
|
11049
11093
|
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 });
|
|
11050
|
-
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: ["
|
|
11094
|
+
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"] }] });
|
|
11051
11095
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheQuickToolbarComponent, decorators: [{
|
|
11052
11096
|
type: Component,
|
|
11053
11097
|
args: [{
|
|
@@ -11279,18 +11323,18 @@ class TheInlineCodeComponent extends TheBaseElementComponent {
|
|
|
11279
11323
|
super(...arguments);
|
|
11280
11324
|
// Put this at the start and end of an inline component to work around this Chromium bug:
|
|
11281
11325
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=1249405
|
|
11282
|
-
this.inlineChromiumBugfix =
|
|
11326
|
+
this.inlineChromiumBugfix = String.fromCodePoint(160);
|
|
11283
11327
|
}
|
|
11284
11328
|
}
|
|
11285
11329
|
TheInlineCodeComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheInlineCodeComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
11286
|
-
TheInlineCodeComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheInlineCodeComponent, selector: "span[theInlineCode]", usesInheritance: true, ngImport: i0, template:
|
|
11330
|
+
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>
|
|
11287
11331
|
<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>
|
|
11288
11332
|
<span contenteditable="false" style="font-size: 0;">{{ inlineChromiumBugfix }}</span>`, isInline: true, components: [{ type: i1.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
|
|
11289
11333
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheInlineCodeComponent, decorators: [{
|
|
11290
11334
|
type: Component,
|
|
11291
11335
|
args: [{
|
|
11292
11336
|
selector: 'span[theInlineCode]',
|
|
11293
|
-
template:
|
|
11337
|
+
template: `<span contenteditable="false" style="font-size: 0;">{{ inlineChromiumBugfix }}</span>
|
|
11294
11338
|
<slate-children [children]="children" [context]="childrenContext" [viewContext]="viewContext"></slate-children>
|
|
11295
11339
|
<span contenteditable="false" style="font-size: 0;">{{ inlineChromiumBugfix }}</span>`
|
|
11296
11340
|
}]
|
|
@@ -11523,8 +11567,9 @@ const autoScrollViewHandle = (editor, scrollContainer) => {
|
|
|
11523
11567
|
};
|
|
11524
11568
|
|
|
11525
11569
|
class TheToolbarComponent {
|
|
11526
|
-
constructor(cfr, elementRef, ngZone, toolbarGroupComponent) {
|
|
11570
|
+
constructor(cfr, cdr, elementRef, ngZone, toolbarGroupComponent) {
|
|
11527
11571
|
this.cfr = cfr;
|
|
11572
|
+
this.cdr = cdr;
|
|
11528
11573
|
this.elementRef = elementRef;
|
|
11529
11574
|
this.ngZone = ngZone;
|
|
11530
11575
|
this.toolbarGroupComponent = toolbarGroupComponent;
|
|
@@ -11599,6 +11644,7 @@ class TheToolbarComponent {
|
|
|
11599
11644
|
}
|
|
11600
11645
|
this.createMoreGroup(group);
|
|
11601
11646
|
});
|
|
11647
|
+
this.cdr.markForCheck();
|
|
11602
11648
|
}
|
|
11603
11649
|
/**
|
|
11604
11650
|
* calculation display toolbar and more grouped toolbars
|
|
@@ -11737,7 +11783,7 @@ class TheToolbarComponent {
|
|
|
11737
11783
|
return (_c = item === null || item === void 0 ? void 0 : item.includes) === null || _c === void 0 ? void 0 : _c.find((item) => item.key === dropdownKey);
|
|
11738
11784
|
}
|
|
11739
11785
|
}
|
|
11740
|
-
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 });
|
|
11786
|
+
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 });
|
|
11741
11787
|
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"] }] });
|
|
11742
11788
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheToolbarComponent, decorators: [{
|
|
11743
11789
|
type: Component,
|
|
@@ -11748,7 +11794,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
11748
11794
|
class: 'the-toolbar-container'
|
|
11749
11795
|
}
|
|
11750
11796
|
}]
|
|
11751
|
-
}], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
|
11797
|
+
}], ctorParameters: function () { return [{ type: i0.ComponentFactoryResolver }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i0.NgZone }, { type: undefined, decorators: [{
|
|
11752
11798
|
type: Inject,
|
|
11753
11799
|
args: [TheToolbarGroupToken]
|
|
11754
11800
|
}] }]; }, propDecorators: { editor: [{
|