@worktile/theia 2.2.0 → 2.2.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.
- package/bundles/worktile-theia.umd.js +41 -37
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/esm2015/plugins/indent/indent.editor.js +17 -11
- package/esm2015/plugins/indent/indent.plugin.js +1 -22
- package/esm2015/plugins/indent/on-keydown-indent.js +4 -4
- package/esm2015/plugins/indent/options.js +5 -3
- package/esm2015/plugins/indent/toolbar-item.component.js +2 -2
- package/esm2015/plugins/table/components/td/td.component.js +18 -5
- package/esm2015/utils/is-clean-empty-paragraph.js +3 -1
- package/fesm2015/worktile-theia.js +43 -38
- package/fesm2015/worktile-theia.js.map +1 -1
- package/package.json +1 -1
|
@@ -2505,12 +2505,14 @@
|
|
|
2505
2505
|
var align = 'align';
|
|
2506
2506
|
var hasTextIndent = block[textIndent];
|
|
2507
2507
|
var hasAlign = block[align];
|
|
2508
|
+
var hasIndent = block[exports.ElementKinds.indent];
|
|
2508
2509
|
if (slate.Node.string(block) === '' &&
|
|
2509
2510
|
slate.Element.isElement(block) &&
|
|
2510
2511
|
block.type === exports.ElementKinds.paragraph &&
|
|
2511
2512
|
block.children.length === 1 &&
|
|
2512
2513
|
slate.Text.isText(block.children[0]) &&
|
|
2513
2514
|
!slate.Editor.isVoid(editor, block) &&
|
|
2515
|
+
!hasIndent &&
|
|
2514
2516
|
!hasTextIndent &&
|
|
2515
2517
|
!hasAlign) {
|
|
2516
2518
|
return true;
|
|
@@ -10572,10 +10574,23 @@
|
|
|
10572
10574
|
.pipe(takeUntilDestroyed, operators.filter(function (columnSize) { return columnSize.tableCell === _this.elementRef.nativeElement; }))
|
|
10573
10575
|
.subscribe(function (_c) {
|
|
10574
10576
|
var deltaSize = _c.deltaSize, previousSize = _c.previousSize, completeImmediately = _c.completeImmediately;
|
|
10575
|
-
_this.elementRef.nativeElement.
|
|
10576
|
-
|
|
10577
|
-
|
|
10578
|
-
|
|
10577
|
+
var _d = _this.elementRef.nativeElement.getBoundingClientRect(), top = _d.top, left = _d.left;
|
|
10578
|
+
var clientY = event.clientY, clientX = event.clientX;
|
|
10579
|
+
var isApplySize = false;
|
|
10580
|
+
if (_this.isXAxisHover) {
|
|
10581
|
+
var width = _this.hoverdDirection === 'left' ? 0 : _this.tableOptions.minWidthPx;
|
|
10582
|
+
isApplySize = deltaSize > 0 && left + width - clientX <= 0;
|
|
10583
|
+
}
|
|
10584
|
+
else {
|
|
10585
|
+
var height = _this.hoverdDirection === 'bottom' ? 0 : _this.tableOptions.minHeightPx;
|
|
10586
|
+
isApplySize = deltaSize > 0 && top + height - clientY <= 0;
|
|
10587
|
+
}
|
|
10588
|
+
if (isApplySize || deltaSize < 0) {
|
|
10589
|
+
_this.elementRef.nativeElement.classList.add(OVERLAY_ACTIVE_CLASS);
|
|
10590
|
+
_this.applySize(deltaSize, previousSize);
|
|
10591
|
+
if (completeImmediately) {
|
|
10592
|
+
_this._completeResizeOperation();
|
|
10593
|
+
}
|
|
10579
10594
|
}
|
|
10580
10595
|
});
|
|
10581
10596
|
rxjs.merge(this.resizeNotifier.resizeCanceled, this.resizeNotifier.resizeCompleted)
|
|
@@ -12165,7 +12180,7 @@
|
|
|
12165
12180
|
return TheIndentToolbarComponent;
|
|
12166
12181
|
}(TheToolbarBaseItemComponent));
|
|
12167
12182
|
TheIndentToolbarComponent.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheIndentToolbarComponent, deps: [{ token: i0__namespace.ElementRef }, { token: i1__namespace$3.ThyPopover }, { token: i0__namespace.ViewContainerRef }, { token: i2__namespace.Overlay }], target: i0__namespace.ɵɵFactoryTarget.Component });
|
|
12168
|
-
TheIndentToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheIndentToolbarComponent, selector: "the-indent-toolbar-item", inputs: { toolbarItem: "toolbarItem", menus: "menus", mode: "mode", item: "item" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.disabled": "this.disabledState" }, classAttribute: "the-toolbar-dropdown-container" }, viewQueries: [{ propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<a thyIconNavLink class=\"icon-mode link-with-down\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #dropdownTemplate>\n <thy-action-menu class=\"dropdown-menu\">\n <ng-container *ngFor=\"let menu of menus\">\n <a
|
|
12183
|
+
TheIndentToolbarComponent.ɵcmp = i0__namespace.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheIndentToolbarComponent, selector: "the-indent-toolbar-item", inputs: { toolbarItem: "toolbarItem", menus: "menus", mode: "mode", item: "item" }, host: { listeners: { "mousedown": "toggleDropdown($event)", "document: mousedown": "handleDocumentMouseDown($event)" }, properties: { "class.disabled": "this.disabledState" }, classAttribute: "the-toolbar-dropdown-container" }, viewQueries: [{ propertyName: "dropdownTemplate", first: true, predicate: ["dropdownTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0__namespace, template: "<a thyIconNavLink class=\"icon-mode link-with-down\" [thyTooltip]=\"activeMenu?.name\" thyTooltipPlacement=\"top\">\n <thy-icon [thyIconName]=\"activeMenu?.icon\"></thy-icon>\n <thy-icon class=\"caret-down-icon font-size-sm text-desc\" thyIconName=\"caret-down\"></thy-icon>\n</a>\n\n<ng-template #dropdownTemplate>\n <thy-action-menu class=\"dropdown-menu\">\n <ng-container *ngFor=\"let menu of menus\">\n <a\n thyActionMenuItem\n href=\"javascript:;\"\n [thyTooltip]=\"tooltip\"\n [thyTooltipTemplateContext]=\"{ name: menu.name, shortcutKey: menu.shortcutKey }\"\n thyTooltipPlacement=\"right\"\n (mousedown)=\"itemMousedown($event, menu)\"\n >\n <span thyActionMenuItemIcon>\n <thy-icon [thyIconName]=\"menu.icon\"></thy-icon>\n </span>\n <span thyActionMenuItemName>{{ menu.name }}</span>\n </a>\n </ng-container>\n </thy-action-menu>\n</ng-template>\n\n<ng-template #tooltip let-data>{{ data?.shortcutKey }}</ng-template>\n", components: [{ type: i3__namespace.ThyIconNavLinkComponent, selector: "[thyIconNavLink]", inputs: ["thyIconNavLinkIcon", "thyIconNavLinkActive"] }, { type: i4__namespace$1.ThyIconComponent, selector: "thy-icon", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { type: i5__namespace$2.ThyActionMenuComponent, selector: "thy-action-menu", inputs: ["thyTheme", "thyWidth"] }], directives: [{ type: i5__namespace$1.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { type: i6__namespace.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i5__namespace$2.ThyActionMenuItemDirective, selector: "[thyActionMenuItem]", inputs: ["thyDisabled", "thyType"] }, { type: i5__namespace$2.ThyActionMenuItemIconDirective, selector: "[thyActionMenuItemIcon]" }, { type: i5__namespace$2.ThyActionMenuItemNameDirective, selector: "[thyActionMenuItemName]" }] });
|
|
12169
12184
|
i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheIndentToolbarComponent, decorators: [{
|
|
12170
12185
|
type: i0.Component,
|
|
12171
12186
|
args: [{
|
|
@@ -12197,7 +12212,7 @@
|
|
|
12197
12212
|
args: ['class.disabled']
|
|
12198
12213
|
}] } });
|
|
12199
12214
|
|
|
12200
|
-
var MaxIndent =
|
|
12215
|
+
var MaxIndent = 11;
|
|
12201
12216
|
var includesIndentTypes = __spreadArray([
|
|
12202
12217
|
exports.ElementKinds.checkItem,
|
|
12203
12218
|
exports.ElementKinds.numberedList,
|
|
@@ -12246,29 +12261,34 @@
|
|
|
12246
12261
|
},
|
|
12247
12262
|
cancelTextIntent: function (editor, event, anchorBlock, kinds) {
|
|
12248
12263
|
var textIndent = anchorBlock.textIndent, indent = anchorBlock.indent;
|
|
12249
|
-
if (
|
|
12250
|
-
event.preventDefault();
|
|
12251
|
-
IndentEditor.cancelIndent(editor);
|
|
12252
|
-
return true;
|
|
12253
|
-
}
|
|
12254
|
-
if (!indent && textIndent > 2) {
|
|
12264
|
+
if (textIndent > 2) {
|
|
12255
12265
|
event.preventDefault();
|
|
12256
12266
|
textIndent -= 2;
|
|
12257
12267
|
IndentEditor.setTextIndent(editor, kinds, textIndent);
|
|
12258
12268
|
return true;
|
|
12259
12269
|
}
|
|
12260
|
-
if (
|
|
12270
|
+
if (textIndent === 2) {
|
|
12261
12271
|
event.preventDefault();
|
|
12262
12272
|
IndentEditor.setTextIndent(editor, kinds, null);
|
|
12263
12273
|
return true;
|
|
12264
12274
|
}
|
|
12275
|
+
if (indent) {
|
|
12276
|
+
event.preventDefault();
|
|
12277
|
+
IndentEditor.cancelIndent(editor);
|
|
12278
|
+
return true;
|
|
12279
|
+
}
|
|
12265
12280
|
return false;
|
|
12266
12281
|
},
|
|
12267
12282
|
isDisabled: function (editor) {
|
|
12268
12283
|
if (editor.selection) {
|
|
12269
|
-
var
|
|
12284
|
+
var allowGroup = __spreadArray([
|
|
12285
|
+
exports.ElementKinds.paragraph,
|
|
12286
|
+
exports.ElementKinds.numberedList,
|
|
12287
|
+
exports.ElementKinds.bulletedList,
|
|
12288
|
+
exports.ElementKinds.checkItem
|
|
12289
|
+
], __read(HEADING_TYPES));
|
|
12270
12290
|
var anchorBlock$1 = anchorBlock(editor);
|
|
12271
|
-
return anchorBlock$1 &&
|
|
12291
|
+
return anchorBlock$1 && !allowGroup.includes(anchorBlock$1 === null || anchorBlock$1 === void 0 ? void 0 : anchorBlock$1.type);
|
|
12272
12292
|
}
|
|
12273
12293
|
return false;
|
|
12274
12294
|
}
|
|
@@ -12284,13 +12304,15 @@
|
|
|
12284
12304
|
{
|
|
12285
12305
|
key: exports.Indents.indentRight,
|
|
12286
12306
|
name: '增加缩进',
|
|
12287
|
-
icon: '
|
|
12307
|
+
icon: 'float-left',
|
|
12308
|
+
shortcutKey: 'Tab',
|
|
12288
12309
|
execute: function (editor) { return IndentEditor.setIndent(editor); }
|
|
12289
12310
|
},
|
|
12290
12311
|
{
|
|
12291
12312
|
key: exports.Indents.indentLeft,
|
|
12292
12313
|
name: '减少缩进',
|
|
12293
|
-
icon: '
|
|
12314
|
+
icon: 'float-right',
|
|
12315
|
+
shortcutKey: 'Shift+Tab/BackSpace',
|
|
12294
12316
|
type: exports.ToolbarItemType.toolDropdown,
|
|
12295
12317
|
execute: function (editor) { return IndentEditor.cancelIndent(editor); }
|
|
12296
12318
|
}
|
|
@@ -12311,7 +12333,7 @@
|
|
|
12311
12333
|
var currentPath = [path[0]];
|
|
12312
12334
|
var isStart = slate.Editor.isStart(editor, selection.anchor, currentPath);
|
|
12313
12335
|
var textIndentDisable = [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList, exports.ElementKinds.checkItem];
|
|
12314
|
-
if (
|
|
12336
|
+
if (isHotkey.isKeyHotkey('Tab', event)) {
|
|
12315
12337
|
event.preventDefault();
|
|
12316
12338
|
if (startBlock && (isExpanded || isStart)) {
|
|
12317
12339
|
if (!editor.isVoid(block)) {
|
|
@@ -12332,7 +12354,7 @@
|
|
|
12332
12354
|
return true;
|
|
12333
12355
|
}
|
|
12334
12356
|
}
|
|
12335
|
-
if (
|
|
12357
|
+
if (isHotkey.isKeyHotkey('shift+Tab', event)) {
|
|
12336
12358
|
if (startBlock && (isExpanded || isStart)) {
|
|
12337
12359
|
if (!editor.isVoid(block)) {
|
|
12338
12360
|
return IndentEditor.cancelTextIntent(editor, event, block, kinds);
|
|
@@ -12350,24 +12372,6 @@
|
|
|
12350
12372
|
var withIndent = function (kinds) { return function (editor) {
|
|
12351
12373
|
var onKeydown = editor.onKeydown;
|
|
12352
12374
|
editor.onKeydown = function (event) {
|
|
12353
|
-
var HOTKEYS = {
|
|
12354
|
-
'mod+]': exports.Indents.indentRight,
|
|
12355
|
-
'mod+[': exports.Indents.indentLeft
|
|
12356
|
-
};
|
|
12357
|
-
for (var hotkey in HOTKEYS) {
|
|
12358
|
-
if (isHotkey__default["default"](hotkey, event)) {
|
|
12359
|
-
event.preventDefault();
|
|
12360
|
-
var mark = HOTKEYS[hotkey];
|
|
12361
|
-
switch (mark) {
|
|
12362
|
-
case exports.Indents.indentRight:
|
|
12363
|
-
IndentEditor.setIndent(editor);
|
|
12364
|
-
break;
|
|
12365
|
-
case exports.Indents.indentLeft:
|
|
12366
|
-
IndentEditor.cancelIndent(editor);
|
|
12367
|
-
break;
|
|
12368
|
-
}
|
|
12369
|
-
}
|
|
12370
|
-
}
|
|
12371
12375
|
var isContinue = !onKeydownTextIndent(editor, event, kinds);
|
|
12372
12376
|
if (isContinue) {
|
|
12373
12377
|
onKeydown(event);
|