@worktile/theia 2.2.3 → 2.2.7
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 +57 -13
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/esm2015/components/column-resize/resizing.store.js +2 -2
- package/esm2015/plugins/code/code.component.js +35 -4
- package/esm2015/plugins/indent/indent.editor.js +2 -2
- package/esm2015/plugins/indent/on-keydown-indent.js +4 -4
- package/esm2015/plugins/inline-code/inline-code.component.js +3 -3
- package/esm2015/plugins/link/link.component.js +2 -2
- package/esm2015/plugins/table/components/td/td.component.js +18 -5
- package/fesm2015/worktile-theia.js +58 -14
- 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
|
@@ -7172,10 +7172,41 @@
|
|
|
7172
7172
|
}
|
|
7173
7173
|
i1.AngularEditor.focus(this.editor);
|
|
7174
7174
|
slate.Transforms.select(this.editor, i1.AngularEditor.findPath(this.editor, this.element));
|
|
7175
|
-
|
|
7176
|
-
|
|
7175
|
+
if (i1.IS_SAFARI) {
|
|
7176
|
+
this.safariCopy();
|
|
7177
|
+
return;
|
|
7178
|
+
}
|
|
7179
|
+
document.execCommand('copy') ? this.thyNotifyService.success('复制成功') : this.thyNotifyService.error('复制失败');
|
|
7177
7180
|
i1.AngularEditor.deselect(this.editor);
|
|
7178
7181
|
};
|
|
7182
|
+
TheCodeComponent.prototype.safariCopy = function () {
|
|
7183
|
+
var currentElement = i1.AngularEditor.toDOMNode(this.editor, this.element);
|
|
7184
|
+
var blockCard = currentElement.closest('.slate-block-card');
|
|
7185
|
+
var span = document.createElement('pre');
|
|
7186
|
+
span.appendChild(blockCard.cloneNode(true));
|
|
7187
|
+
span.textContent = this.element.content;
|
|
7188
|
+
if (this.element.language) {
|
|
7189
|
+
span.setAttribute('data-language', this.element.language);
|
|
7190
|
+
}
|
|
7191
|
+
if (this.element.autoWrap) {
|
|
7192
|
+
span.setAttribute('data-auto-wrap', String(this.element.autoWrap));
|
|
7193
|
+
}
|
|
7194
|
+
if (this.element.height) {
|
|
7195
|
+
span.setAttribute('data-height', String(this.element.height));
|
|
7196
|
+
}
|
|
7197
|
+
document.body.appendChild(span);
|
|
7198
|
+
var selection = window.getSelection();
|
|
7199
|
+
var range = document.createRange();
|
|
7200
|
+
if (selection) {
|
|
7201
|
+
selection.removeAllRanges();
|
|
7202
|
+
range.selectNode(span);
|
|
7203
|
+
selection.addRange(range);
|
|
7204
|
+
document.execCommand('copy') ? this.thyNotifyService.success('复制成功') : this.thyNotifyService.error('复制失败');
|
|
7205
|
+
selection.removeAllRanges();
|
|
7206
|
+
document.body.removeChild(span);
|
|
7207
|
+
i1.AngularEditor.deselect(this.editor);
|
|
7208
|
+
}
|
|
7209
|
+
};
|
|
7179
7210
|
TheCodeComponent.prototype.focusChange = function (codeMirrorFocused) {
|
|
7180
7211
|
if (codeMirrorFocused) {
|
|
7181
7212
|
this.isHightLight = false;
|
|
@@ -7621,7 +7652,7 @@
|
|
|
7621
7652
|
var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
|
|
7622
7653
|
// Put this at the start and end of an inline component to work around this Chromium bug:
|
|
7623
7654
|
// https://bugs.chromium.org/p/chromium/issues/detail?id=1249405
|
|
7624
|
-
_this.inlineChromiumBugfix =
|
|
7655
|
+
_this.inlineChromiumBugfix = String.fromCodePoint(160);
|
|
7625
7656
|
return _this;
|
|
7626
7657
|
}
|
|
7627
7658
|
return TheLinkComponent;
|
|
@@ -9913,7 +9944,7 @@
|
|
|
9913
9944
|
ColumnResizingStore.prototype.restoreTopRows = function (deltaY) {
|
|
9914
9945
|
var index = this.resizeRows.length - 1;
|
|
9915
9946
|
while (index >= 0 && deltaY > 0) {
|
|
9916
|
-
var currentHeight =
|
|
9947
|
+
var currentHeight = this.resizeRows[index].rowElement.getBoundingClientRect().height;
|
|
9917
9948
|
if (this.resizeRows[index].baseHeight > currentHeight) {
|
|
9918
9949
|
if (this.resizeRows[index].baseHeight > currentHeight + deltaY) {
|
|
9919
9950
|
this.resizeRows[index].rowElement.style.height = coercion.coerceCssPixelValue(currentHeight + deltaY);
|
|
@@ -10574,10 +10605,23 @@
|
|
|
10574
10605
|
.pipe(takeUntilDestroyed, operators.filter(function (columnSize) { return columnSize.tableCell === _this.elementRef.nativeElement; }))
|
|
10575
10606
|
.subscribe(function (_c) {
|
|
10576
10607
|
var deltaSize = _c.deltaSize, previousSize = _c.previousSize, completeImmediately = _c.completeImmediately;
|
|
10577
|
-
_this.elementRef.nativeElement.
|
|
10578
|
-
|
|
10579
|
-
|
|
10580
|
-
|
|
10608
|
+
var _d = _this.elementRef.nativeElement.getBoundingClientRect(), top = _d.top, left = _d.left, height = _d.height, width = _d.width;
|
|
10609
|
+
var clientY = event.clientY, clientX = event.clientX;
|
|
10610
|
+
var isApplySize = false;
|
|
10611
|
+
if (_this.isXAxisHover) {
|
|
10612
|
+
var cellWidth = _this.hoverdDirection === 'left' ? 0 : width;
|
|
10613
|
+
isApplySize = deltaSize > 0 && left + cellWidth - clientX <= 0;
|
|
10614
|
+
}
|
|
10615
|
+
else {
|
|
10616
|
+
var cellHeight = _this.hoverdDirection === 'bottom' ? 0 : height;
|
|
10617
|
+
isApplySize = deltaSize > 0 && top + cellHeight - clientY <= 0;
|
|
10618
|
+
}
|
|
10619
|
+
if (isApplySize || deltaSize < 0) {
|
|
10620
|
+
_this.elementRef.nativeElement.classList.add(OVERLAY_ACTIVE_CLASS);
|
|
10621
|
+
_this.applySize(deltaSize, previousSize);
|
|
10622
|
+
if (completeImmediately) {
|
|
10623
|
+
_this._completeResizeOperation();
|
|
10624
|
+
}
|
|
10581
10625
|
}
|
|
10582
10626
|
});
|
|
10583
10627
|
rxjs.merge(this.resizeNotifier.resizeCanceled, this.resizeNotifier.resizeCompleted)
|
|
@@ -12034,12 +12078,12 @@
|
|
|
12034
12078
|
return TheInlineCodeComponent;
|
|
12035
12079
|
}(TheBaseElementComponent));
|
|
12036
12080
|
TheInlineCodeComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheInlineCodeComponent, deps: null, target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
12037
|
-
TheInlineCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheInlineCodeComponent, selector: "span[theInlineCode]", usesInheritance: true, ngImport: i0__namespace, template: "
|
|
12081
|
+
TheInlineCodeComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheInlineCodeComponent, selector: "span[theInlineCode]", usesInheritance: true, ngImport: i0__namespace, template: "<span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>", isInline: true, components: [{ type: i1__namespace.SlateChildrenComponent, selector: "slate-children", inputs: ["children", "context", "viewContext"] }] });
|
|
12038
12082
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheInlineCodeComponent, decorators: [{
|
|
12039
12083
|
type: i0.Component,
|
|
12040
12084
|
args: [{
|
|
12041
12085
|
selector: 'span[theInlineCode]',
|
|
12042
|
-
template: "
|
|
12086
|
+
template: "<span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>\n <slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n <span contenteditable=\"false\" style=\"font-size: 0;\">{{ inlineChromiumBugfix }}</span>"
|
|
12043
12087
|
}]
|
|
12044
12088
|
}] });
|
|
12045
12089
|
|
|
@@ -12199,7 +12243,7 @@
|
|
|
12199
12243
|
args: ['class.disabled']
|
|
12200
12244
|
}] } });
|
|
12201
12245
|
|
|
12202
|
-
var MaxIndent =
|
|
12246
|
+
var MaxIndent = 11;
|
|
12203
12247
|
var includesIndentTypes = __spreadArray([
|
|
12204
12248
|
exports.ElementKinds.checkItem,
|
|
12205
12249
|
exports.ElementKinds.numberedList,
|
|
@@ -12320,7 +12364,7 @@
|
|
|
12320
12364
|
var currentPath = [path[0]];
|
|
12321
12365
|
var isStart = slate.Editor.isStart(editor, selection.anchor, currentPath);
|
|
12322
12366
|
var textIndentDisable = [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList, exports.ElementKinds.checkItem];
|
|
12323
|
-
if (
|
|
12367
|
+
if (isHotkey.isKeyHotkey('Tab', event)) {
|
|
12324
12368
|
event.preventDefault();
|
|
12325
12369
|
if (startBlock && (isExpanded || isStart)) {
|
|
12326
12370
|
if (!editor.isVoid(block)) {
|
|
@@ -12341,7 +12385,7 @@
|
|
|
12341
12385
|
return true;
|
|
12342
12386
|
}
|
|
12343
12387
|
}
|
|
12344
|
-
if (
|
|
12388
|
+
if (isHotkey.isKeyHotkey('shift+Tab', event)) {
|
|
12345
12389
|
if (startBlock && (isExpanded || isStart)) {
|
|
12346
12390
|
if (!editor.isVoid(block)) {
|
|
12347
12391
|
return IndentEditor.cancelTextIntent(editor, event, block, kinds);
|