@worktile/theia 2.2.2 → 2.2.6

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.
@@ -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
- document.execCommand('copy');
7176
- this.thyNotifyService.success('复制成功');
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;
@@ -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.classList.add(OVERLAY_ACTIVE_CLASS);
10578
- _this.applySize(deltaSize, previousSize);
10579
- if (completeImmediately) {
10580
- _this._completeResizeOperation();
10608
+ var _d = _this.elementRef.nativeElement.getBoundingClientRect(), top = _d.top, left = _d.left;
10609
+ var clientY = event.clientY, clientX = event.clientX;
10610
+ var isApplySize = false;
10611
+ if (_this.isXAxisHover) {
10612
+ var width = _this.hoverdDirection === 'left' ? 0 : _this.tableOptions.minWidthPx;
10613
+ isApplySize = deltaSize > 0 && left + width - clientX <= 0;
10614
+ }
10615
+ else {
10616
+ var height = _this.hoverdDirection === 'bottom' ? 0 : _this.tableOptions.minHeightPx;
10617
+ isApplySize = deltaSize > 0 && top + height - 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)
@@ -12167,7 +12211,7 @@
12167
12211
  return TheIndentToolbarComponent;
12168
12212
  }(TheToolbarBaseItemComponent));
12169
12213
  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 });
12170
- 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 thyActionMenuItem href=\"javascript:;\" (mousedown)=\"itemMousedown($event, menu)\">\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", 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]" }] });
12214
+ 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]" }] });
12171
12215
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0__namespace, type: TheIndentToolbarComponent, decorators: [{
12172
12216
  type: i0.Component,
12173
12217
  args: [{
@@ -12199,7 +12243,7 @@
12199
12243
  args: ['class.disabled']
12200
12244
  }] } });
12201
12245
 
12202
- var MaxIndent = 13;
12246
+ var MaxIndent = 11;
12203
12247
  var includesIndentTypes = __spreadArray([
12204
12248
  exports.ElementKinds.checkItem,
12205
12249
  exports.ElementKinds.numberedList,
@@ -12268,9 +12312,14 @@
12268
12312
  },
12269
12313
  isDisabled: function (editor) {
12270
12314
  if (editor.selection) {
12271
- var disableGroup = HEADING_TYPES;
12315
+ var allowGroup = __spreadArray([
12316
+ exports.ElementKinds.paragraph,
12317
+ exports.ElementKinds.numberedList,
12318
+ exports.ElementKinds.bulletedList,
12319
+ exports.ElementKinds.checkItem
12320
+ ], __read(HEADING_TYPES));
12272
12321
  var anchorBlock$1 = anchorBlock(editor);
12273
- return anchorBlock$1 && disableGroup.includes(anchorBlock$1 === null || anchorBlock$1 === void 0 ? void 0 : anchorBlock$1.type);
12322
+ return anchorBlock$1 && !allowGroup.includes(anchorBlock$1 === null || anchorBlock$1 === void 0 ? void 0 : anchorBlock$1.type);
12274
12323
  }
12275
12324
  return false;
12276
12325
  }
@@ -12287,12 +12336,14 @@
12287
12336
  key: exports.Indents.indentRight,
12288
12337
  name: '增加缩进',
12289
12338
  icon: 'float-left',
12339
+ shortcutKey: 'Tab',
12290
12340
  execute: function (editor) { return IndentEditor.setIndent(editor); }
12291
12341
  },
12292
12342
  {
12293
12343
  key: exports.Indents.indentLeft,
12294
12344
  name: '减少缩进',
12295
12345
  icon: 'float-right',
12346
+ shortcutKey: 'Shift+Tab/BackSpace',
12296
12347
  type: exports.ToolbarItemType.toolDropdown,
12297
12348
  execute: function (editor) { return IndentEditor.cancelIndent(editor); }
12298
12349
  }
@@ -12313,7 +12364,7 @@
12313
12364
  var currentPath = [path[0]];
12314
12365
  var isStart = slate.Editor.isStart(editor, selection.anchor, currentPath);
12315
12366
  var textIndentDisable = [exports.ElementKinds.bulletedList, exports.ElementKinds.numberedList, exports.ElementKinds.checkItem];
12316
- if (isHotkey__default["default"]('Tab', event)) {
12367
+ if (isHotkey.isKeyHotkey('Tab', event)) {
12317
12368
  event.preventDefault();
12318
12369
  if (startBlock && (isExpanded || isStart)) {
12319
12370
  if (!editor.isVoid(block)) {
@@ -12334,7 +12385,7 @@
12334
12385
  return true;
12335
12386
  }
12336
12387
  }
12337
- if (isHotkey__default["default"]('shift+Tab', event)) {
12388
+ if (isHotkey.isKeyHotkey('shift+Tab', event)) {
12338
12389
  if (startBlock && (isExpanded || isStart)) {
12339
12390
  if (!editor.isVoid(block)) {
12340
12391
  return IndentEditor.cancelTextIntent(editor, event, block, kinds);
@@ -12352,24 +12403,6 @@
12352
12403
  var withIndent = function (kinds) { return function (editor) {
12353
12404
  var onKeydown = editor.onKeydown;
12354
12405
  editor.onKeydown = function (event) {
12355
- var HOTKEYS = {
12356
- 'mod+]': exports.Indents.indentRight,
12357
- 'mod+[': exports.Indents.indentLeft
12358
- };
12359
- for (var hotkey in HOTKEYS) {
12360
- if (isHotkey__default["default"](hotkey, event)) {
12361
- event.preventDefault();
12362
- var mark = HOTKEYS[hotkey];
12363
- switch (mark) {
12364
- case exports.Indents.indentRight:
12365
- IndentEditor.setIndent(editor);
12366
- break;
12367
- case exports.Indents.indentLeft:
12368
- IndentEditor.cancelIndent(editor);
12369
- break;
12370
- }
12371
- }
12372
- }
12373
12406
  var isContinue = !onKeydownTextIndent(editor, event, kinds);
12374
12407
  if (isContinue) {
12375
12408
  onKeydown(event);