@public-ui/hydrate 2.2.11-rc.2 → 2.2.11-rc.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.
package/dist/index.js CHANGED
@@ -12687,16 +12687,21 @@ const flip$1 = function (options) {
12687
12687
  const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
12688
12688
  const nextPlacement = placements[nextIndex];
12689
12689
  if (nextPlacement) {
12690
- // Try next placement and re-run the lifecycle.
12691
- return {
12692
- data: {
12693
- index: nextIndex,
12694
- overflows: overflowsData
12695
- },
12696
- reset: {
12697
- placement: nextPlacement
12698
- }
12699
- };
12690
+ var _overflowsData$;
12691
+ const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
12692
+ const hasInitialMainAxisOverflow = ((_overflowsData$ = overflowsData[0]) == null ? void 0 : _overflowsData$.overflows[0]) > 0;
12693
+ if (!ignoreCrossAxisOverflow || hasInitialMainAxisOverflow) {
12694
+ // Try next placement and re-run the lifecycle.
12695
+ return {
12696
+ data: {
12697
+ index: nextIndex,
12698
+ overflows: overflowsData
12699
+ },
12700
+ reset: {
12701
+ placement: nextPlacement
12702
+ }
12703
+ };
12704
+ }
12700
12705
  }
12701
12706
 
12702
12707
  // First, find the candidates that fit on the mainAxis side of overflow,
@@ -13778,6 +13783,12 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
13778
13783
  scrollTop: 0
13779
13784
  };
13780
13785
  const offsets = createCoords(0);
13786
+
13787
+ // If the <body> scrollbar appears on the left (e.g. RTL systems). Use
13788
+ // Firefox with layout.scrollbar.side = 3 in about:config to test this.
13789
+ function setLeftRTLScrollbarOffset() {
13790
+ offsets.x = getWindowScrollBarX(documentElement);
13791
+ }
13781
13792
  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
13782
13793
  if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
13783
13794
  scroll = getNodeScroll(offsetParent);
@@ -13787,11 +13798,12 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
13787
13798
  offsets.x = offsetRect.x + offsetParent.clientLeft;
13788
13799
  offsets.y = offsetRect.y + offsetParent.clientTop;
13789
13800
  } else if (documentElement) {
13790
- // If the <body> scrollbar appears on the left (e.g. RTL systems). Use
13791
- // Firefox with layout.scrollbar.side = 3 in about:config to test this.
13792
- offsets.x = getWindowScrollBarX(documentElement);
13801
+ setLeftRTLScrollbarOffset();
13793
13802
  }
13794
13803
  }
13804
+ if (isFixed && !isOffsetParentAnElement && documentElement) {
13805
+ setLeftRTLScrollbarOffset();
13806
+ }
13795
13807
  const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
13796
13808
  const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
13797
13809
  const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
@@ -13968,7 +13980,7 @@ function observeMove(element, onMove) {
13968
13980
  // Handle <iframe>s
13969
13981
  root: root.ownerDocument
13970
13982
  });
13971
- } catch (e) {
13983
+ } catch (_e) {
13972
13984
  io = new IntersectionObserver(handleObserve, options);
13973
13985
  }
13974
13986
  io.observe(element);
package/dist/index.mjs CHANGED
@@ -12683,16 +12683,21 @@ const flip$1 = function (options) {
12683
12683
  const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
12684
12684
  const nextPlacement = placements[nextIndex];
12685
12685
  if (nextPlacement) {
12686
- // Try next placement and re-run the lifecycle.
12687
- return {
12688
- data: {
12689
- index: nextIndex,
12690
- overflows: overflowsData
12691
- },
12692
- reset: {
12693
- placement: nextPlacement
12694
- }
12695
- };
12686
+ var _overflowsData$;
12687
+ const ignoreCrossAxisOverflow = checkCrossAxis === 'alignment' ? initialSideAxis !== getSideAxis(nextPlacement) : false;
12688
+ const hasInitialMainAxisOverflow = ((_overflowsData$ = overflowsData[0]) == null ? void 0 : _overflowsData$.overflows[0]) > 0;
12689
+ if (!ignoreCrossAxisOverflow || hasInitialMainAxisOverflow) {
12690
+ // Try next placement and re-run the lifecycle.
12691
+ return {
12692
+ data: {
12693
+ index: nextIndex,
12694
+ overflows: overflowsData
12695
+ },
12696
+ reset: {
12697
+ placement: nextPlacement
12698
+ }
12699
+ };
12700
+ }
12696
12701
  }
12697
12702
 
12698
12703
  // First, find the candidates that fit on the mainAxis side of overflow,
@@ -13774,6 +13779,12 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
13774
13779
  scrollTop: 0
13775
13780
  };
13776
13781
  const offsets = createCoords(0);
13782
+
13783
+ // If the <body> scrollbar appears on the left (e.g. RTL systems). Use
13784
+ // Firefox with layout.scrollbar.side = 3 in about:config to test this.
13785
+ function setLeftRTLScrollbarOffset() {
13786
+ offsets.x = getWindowScrollBarX(documentElement);
13787
+ }
13777
13788
  if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
13778
13789
  if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
13779
13790
  scroll = getNodeScroll(offsetParent);
@@ -13783,11 +13794,12 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
13783
13794
  offsets.x = offsetRect.x + offsetParent.clientLeft;
13784
13795
  offsets.y = offsetRect.y + offsetParent.clientTop;
13785
13796
  } else if (documentElement) {
13786
- // If the <body> scrollbar appears on the left (e.g. RTL systems). Use
13787
- // Firefox with layout.scrollbar.side = 3 in about:config to test this.
13788
- offsets.x = getWindowScrollBarX(documentElement);
13797
+ setLeftRTLScrollbarOffset();
13789
13798
  }
13790
13799
  }
13800
+ if (isFixed && !isOffsetParentAnElement && documentElement) {
13801
+ setLeftRTLScrollbarOffset();
13802
+ }
13791
13803
  const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
13792
13804
  const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
13793
13805
  const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
@@ -13964,7 +13976,7 @@ function observeMove(element, onMove) {
13964
13976
  // Handle <iframe>s
13965
13977
  root: root.ownerDocument
13966
13978
  });
13967
- } catch (e) {
13979
+ } catch (_e) {
13968
13980
  io = new IntersectionObserver(handleObserve, options);
13969
13981
  }
13970
13982
  io.observe(element);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@public-ui/hydrate",
3
- "version": "2.2.11-rc.2",
3
+ "version": "2.2.11-rc.3",
4
4
  "license": "EUPL-1.2",
5
5
  "homepage": "https://public-ui.github.io",
6
6
  "repository": {
@@ -46,10 +46,10 @@
46
46
  ],
47
47
  "devDependencies": {
48
48
  "rimraf": "6.0.1",
49
- "@public-ui/components": "2.2.11-rc.2"
49
+ "@public-ui/components": "2.2.11-rc.3"
50
50
  },
51
51
  "peerDependencies": {
52
- "@public-ui/components": "2.2.11-rc.2"
52
+ "@public-ui/components": "2.2.11-rc.3"
53
53
  },
54
54
  "sideEffects": false,
55
55
  "type": "commonjs",