pb-sxp-ui 1.19.19 → 1.19.20

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.
@@ -31,10 +31,30 @@ export function useVisibleHeight() {
31
31
  const ratio = visibleHeight / screenHeight;
32
32
  const threshold = 0.9;
33
33
  const h = screenHeight >= 900 ? screenHeight * 0.8 : screenHeight * 0.79;
34
- const isRatio = ratio >= threshold && ratio !== 1;
34
+ const isRatio = ratio >= threshold;
35
35
  const finalHeight = isRatio ? Math.round(h) : visibleHeight;
36
+ const b = screenHeight - Math.round(h);
36
37
  if (isRatio) {
37
- setBottomHeight(screenHeight - Math.round(h));
38
+ const banner = document.querySelector('#onetrust-banner-sdk');
39
+ if (banner) {
40
+ banner.style.bottom = `${b}px`;
41
+ }
42
+ const styleElement = document.createElement('style');
43
+ styleElement.id = 'onetrust-pc-sdk';
44
+ styleElement.setAttribute('type', 'text/css');
45
+ document.head.appendChild(styleElement);
46
+ const css = `
47
+ #onetrust-pc-sdk {
48
+ height: ${finalHeight}px !important;
49
+ }
50
+ #onetrust-pc-sdk #ot-pc-content{
51
+ bottom: ${b}px !important;
52
+ }
53
+ `;
54
+ styleElement.textContent = css;
55
+ }
56
+ if (isRatio) {
57
+ setBottomHeight(b);
38
58
  }
39
59
  else {
40
60
  setBottomHeight(0);
@@ -34,10 +34,30 @@ function useVisibleHeight() {
34
34
  const ratio = visibleHeight / screenHeight;
35
35
  const threshold = 0.9;
36
36
  const h = screenHeight >= 900 ? screenHeight * 0.8 : screenHeight * 0.79;
37
- const isRatio = ratio >= threshold && ratio !== 1;
37
+ const isRatio = ratio >= threshold;
38
38
  const finalHeight = isRatio ? Math.round(h) : visibleHeight;
39
+ const b = screenHeight - Math.round(h);
39
40
  if (isRatio) {
40
- setBottomHeight(screenHeight - Math.round(h));
41
+ const banner = document.querySelector('#onetrust-banner-sdk');
42
+ if (banner) {
43
+ banner.style.bottom = `${b}px`;
44
+ }
45
+ const styleElement = document.createElement('style');
46
+ styleElement.id = 'onetrust-pc-sdk';
47
+ styleElement.setAttribute('type', 'text/css');
48
+ document.head.appendChild(styleElement);
49
+ const css = `
50
+ #onetrust-pc-sdk {
51
+ height: ${finalHeight}px !important;
52
+ }
53
+ #onetrust-pc-sdk #ot-pc-content{
54
+ bottom: ${b}px !important;
55
+ }
56
+ `;
57
+ styleElement.textContent = css;
58
+ }
59
+ if (isRatio) {
60
+ setBottomHeight(b);
41
61
  }
42
62
  else {
43
63
  setBottomHeight(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pb-sxp-ui",
3
- "version": "1.19.19",
3
+ "version": "1.19.20",
4
4
  "description": "React enterprise-class UI components",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",