@worktile/theia 2.3.0-next.2 → 2.3.0-next.3

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.
@@ -3136,13 +3136,13 @@
3136
3136
  {
3137
3137
  key: exports.LayoutTypes.wrapLeft,
3138
3138
  icon: 'wrap-left',
3139
- name: '隐藏左边',
3139
+ name: '图片居左',
3140
3140
  handle: function (e, key) { return _this.setImageNode(e, { layout: key }); }
3141
3141
  },
3142
3142
  {
3143
3143
  key: exports.LayoutTypes.wrapRight,
3144
3144
  icon: 'wrap-right',
3145
- name: '隐藏右边',
3145
+ name: '图片居右',
3146
3146
  handle: function (e, key) { return _this.setImageNode(e, { layout: key }); }
3147
3147
  },
3148
3148
  {
@@ -3364,10 +3364,11 @@
3364
3364
  return this.isOpen && ((this === null || this === void 0 ? void 0 : this.readonly) || !(this === null || this === void 0 ? void 0 : this.isCollapsed) || this.uploading);
3365
3365
  };
3366
3366
  TheImageComponent.prototype.openLayoutToolbar = function () {
3367
+ var _this = this;
3367
3368
  var _a;
3368
3369
  this.layoutToolbarRef = this.thyPopover.open(this.layoutToolbar, {
3369
3370
  origin: this.imageContent,
3370
- panelClass: ['the-image-toolbar'],
3371
+ panelClass: ['the-block-toolbar'],
3371
3372
  placement: 'bottom',
3372
3373
  insideClosable: false,
3373
3374
  backdropClosable: true,
@@ -3377,6 +3378,10 @@
3377
3378
  scrollStrategy: this.overlay.scrollStrategies.reposition()
3378
3379
  });
3379
3380
  (_a = this.layoutToolbarRef) === null || _a === void 0 ? void 0 : _a.getOverlayRef().updatePositionStrategy(this.createPositionStrategy());
3381
+ setTimeout(function () {
3382
+ var _a;
3383
+ (_a = _this.layoutToolbarRef) === null || _a === void 0 ? void 0 : _a.getOverlayRef().updatePosition();
3384
+ }, 150);
3380
3385
  };
3381
3386
  TheImageComponent.prototype.closeLayoutToolbar = function () {
3382
3387
  var _a;
@@ -13752,8 +13757,17 @@
13752
13757
  if (event.target === editableElement) {
13753
13758
  var rectEditable = editableElement.getBoundingClientRect();
13754
13759
  var centerX = rectEditable.x + rectEditable.width / 2;
13755
- var relativeElement = document.elementFromPoint(centerX, event.y);
13760
+ var _g = window.getComputedStyle(editableElement, null), paddingLeft = _g.paddingLeft, paddingRight = _g.paddingRight;
13761
+ var paddingLeftPixels = coercePixelsFromCssValue(paddingLeft);
13762
+ var paddingRightPixels = coercePixelsFromCssValue(paddingRight);
13763
+ var fakeLeftX = rectEditable.x + paddingLeftPixels + 50;
13764
+ var fakeRightX = rectEditable.right - paddingRightPixels - 50;
13765
+ var relativeElement = document.elementFromPoint(fakeLeftX, event.y);
13756
13766
  var relativeBlockCardElement = relativeElement.closest('.slate-block-card');
13767
+ if (!relativeBlockCardElement) {
13768
+ relativeElement = document.elementFromPoint(fakeRightX, event.y);
13769
+ relativeBlockCardElement = relativeElement.closest('.slate-block-card');
13770
+ }
13757
13771
  if (relativeBlockCardElement) {
13758
13772
  var blockCardEntry = i1.AngularEditor.toSlateCardEntry(this.editor, relativeBlockCardElement.firstElementChild);
13759
13773
  if (blockCardEntry && blockCardEntry[1]) {