@ckeditor/ckeditor5-ui 45.0.0-alpha.6 → 45.0.0-alpha.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/dist/index.js CHANGED
@@ -15660,6 +15660,11 @@ const toPx$3 = /* #__PURE__ */ toUnit('px');
15660
15660
  this.listenTo(this, 'change:isActive', ()=>{
15661
15661
  this.checkIfShouldBeSticky();
15662
15662
  });
15663
+ if (global.window.visualViewport) {
15664
+ this.listenTo(global.window.visualViewport, 'scroll', ()=>this._updateVisualViewport());
15665
+ this.listenTo(global.window.visualViewport, 'resize', ()=>this._updateVisualViewport());
15666
+ this._updateVisualViewport();
15667
+ }
15663
15668
  }
15664
15669
  /**
15665
15670
  * Analyzes the environment to decide whether the panel should be sticky or not.
@@ -15712,7 +15717,8 @@ const toPx$3 = /* #__PURE__ */ toUnit('px');
15712
15717
  // @if CK_DEBUG_STICKYPANEL // );
15713
15718
  // Check if sticking the panel to the bottom of the limiter does not cause it to suddenly
15714
15719
  // move upwards if there's not enough space for it.
15715
- if (limiterRect.bottom - stickyBottomOffset > limiterRect.top + this._contentPanelRect.height) {
15720
+ // Adding 1 avoids rounding problems and toolbar flickering when offset almost equals the height.
15721
+ if (limiterRect.bottom - stickyBottomOffset > limiterRect.top + this._contentPanelRect.height + 1) {
15716
15722
  this._stickToBottomOfLimiter(stickyBottomOffset);
15717
15723
  } else {
15718
15724
  this._unstick();
@@ -15783,6 +15789,12 @@ const toPx$3 = /* #__PURE__ */ toUnit('px');
15783
15789
  */ get _contentPanelRect() {
15784
15790
  return new Rect(this.contentPanelElement);
15785
15791
  }
15792
+ /**
15793
+ * Sets custom CSS properties to the panel element to make it aware of the visual viewport offset.
15794
+ */ _updateVisualViewport() {
15795
+ this.element.style.setProperty('--ck-visual-viewport-left', `${global.window.visualViewport.offsetLeft}px`);
15796
+ this.element.style.setProperty('--ck-visual-viewport-top', `${global.window.visualViewport.offsetTop}px`);
15797
+ }
15786
15798
  }
15787
15799
 
15788
15800
  /**