@worktile/theia 2.3.0-next.2 → 2.3.1

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.
@@ -2644,8 +2644,10 @@
2644
2644
  var editableElement = i1.EDITOR_TO_ELEMENT.get(editor);
2645
2645
  var rectEditable = editableElement.getBoundingClientRect();
2646
2646
  if (x > rectEditable.x && x < rectEditable.x + rectEditable.width) {
2647
- var centerX = rectEditable.x + rectEditable.width / 2;
2648
- var relativeElement = document.elementFromPoint(mode === 'highest' ? centerX : x, y);
2647
+ var paddingLeft = window.getComputedStyle(editableElement, null).paddingLeft;
2648
+ var paddingLeftPixels = coercePixelsFromCssValue(paddingLeft);
2649
+ var startX = rectEditable.left + paddingLeftPixels;
2650
+ var relativeElement = document.elementFromPoint(mode === 'highest' ? startX : x, y);
2649
2651
  return relativeElement;
2650
2652
  }
2651
2653
  return null;
@@ -3136,13 +3138,13 @@
3136
3138
  {
3137
3139
  key: exports.LayoutTypes.wrapLeft,
3138
3140
  icon: 'wrap-left',
3139
- name: '隐藏左边',
3141
+ name: '图片居左',
3140
3142
  handle: function (e, key) { return _this.setImageNode(e, { layout: key }); }
3141
3143
  },
3142
3144
  {
3143
3145
  key: exports.LayoutTypes.wrapRight,
3144
3146
  icon: 'wrap-right',
3145
- name: '隐藏右边',
3147
+ name: '图片居右',
3146
3148
  handle: function (e, key) { return _this.setImageNode(e, { layout: key }); }
3147
3149
  },
3148
3150
  {
@@ -3364,10 +3366,11 @@
3364
3366
  return this.isOpen && ((this === null || this === void 0 ? void 0 : this.readonly) || !(this === null || this === void 0 ? void 0 : this.isCollapsed) || this.uploading);
3365
3367
  };
3366
3368
  TheImageComponent.prototype.openLayoutToolbar = function () {
3369
+ var _this = this;
3367
3370
  var _a;
3368
3371
  this.layoutToolbarRef = this.thyPopover.open(this.layoutToolbar, {
3369
3372
  origin: this.imageContent,
3370
- panelClass: ['the-image-toolbar'],
3373
+ panelClass: ['the-block-toolbar'],
3371
3374
  placement: 'bottom',
3372
3375
  insideClosable: false,
3373
3376
  backdropClosable: true,
@@ -3377,6 +3380,10 @@
3377
3380
  scrollStrategy: this.overlay.scrollStrategies.reposition()
3378
3381
  });
3379
3382
  (_a = this.layoutToolbarRef) === null || _a === void 0 ? void 0 : _a.getOverlayRef().updatePositionStrategy(this.createPositionStrategy());
3383
+ setTimeout(function () {
3384
+ var _a;
3385
+ (_a = _this.layoutToolbarRef) === null || _a === void 0 ? void 0 : _a.getOverlayRef().updatePosition();
3386
+ }, 150);
3380
3387
  };
3381
3388
  TheImageComponent.prototype.closeLayoutToolbar = function () {
3382
3389
  var _a;
@@ -13275,7 +13282,7 @@
13275
13282
  TheQuickInsertComponent.prototype.checkStatus = function () {
13276
13283
  var _a;
13277
13284
  var editor = this.editor;
13278
- if (this.isVisible && isCleanEmptyParagraph(editor) && !this.hasExcludeAttribute() && !this.isRichMediaScope()) {
13285
+ if (this.isVisible && isCleanEmptyParagraph(editor) && !this.hasExcludeAttribute()) {
13279
13286
  var block = slate.Node.ancestor(editor, [(_a = editor === null || editor === void 0 ? void 0 : editor.selection) === null || _a === void 0 ? void 0 : _a.anchor.path[0]]);
13280
13287
  var rootNode = i1.AngularEditor.toDOMNode(editor, block);
13281
13288
  this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
@@ -13752,8 +13759,17 @@
13752
13759
  if (event.target === editableElement) {
13753
13760
  var rectEditable = editableElement.getBoundingClientRect();
13754
13761
  var centerX = rectEditable.x + rectEditable.width / 2;
13755
- var relativeElement = document.elementFromPoint(centerX, event.y);
13762
+ var _g = window.getComputedStyle(editableElement, null), paddingLeft = _g.paddingLeft, paddingRight = _g.paddingRight;
13763
+ var paddingLeftPixels = coercePixelsFromCssValue(paddingLeft);
13764
+ var paddingRightPixels = coercePixelsFromCssValue(paddingRight);
13765
+ var fakeLeftX = rectEditable.x + paddingLeftPixels + 50;
13766
+ var fakeRightX = rectEditable.right - paddingRightPixels - 50;
13767
+ var relativeElement = document.elementFromPoint(fakeLeftX, event.y);
13756
13768
  var relativeBlockCardElement = relativeElement.closest('.slate-block-card');
13769
+ if (!relativeBlockCardElement) {
13770
+ relativeElement = document.elementFromPoint(fakeRightX, event.y);
13771
+ relativeBlockCardElement = relativeElement.closest('.slate-block-card');
13772
+ }
13757
13773
  if (relativeBlockCardElement) {
13758
13774
  var blockCardEntry = i1.AngularEditor.toSlateCardEntry(this.editor, relativeBlockCardElement.firstElementChild);
13759
13775
  if (blockCardEntry && blockCardEntry[1]) {