@griddo/ax 11.12.1-rc.11 → 11.12.1-rc.12

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@griddo/ax",
3
3
  "description": "Griddo Author Experience",
4
- "version": "11.12.1-rc.11",
4
+ "version": "11.12.1-rc.12",
5
5
  "authors": [
6
6
  "Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
7
7
  "Diego M. Béjar <diego.bejar@secuoyas.com>",
@@ -217,5 +217,5 @@
217
217
  "publishConfig": {
218
218
  "access": "public"
219
219
  },
220
- "gitHead": "69e57e648b4070c825ad96e1c81c6cb0af5cc2b9"
220
+ "gitHead": "86183a23195e6152066f4ff0928d1447da3e477c"
221
221
  }
@@ -23,18 +23,6 @@ const isEffectivelyVisible = (el: HTMLElement): boolean => {
23
23
  return true;
24
24
  };
25
25
 
26
- const isInStickyOrFixed = (el: HTMLElement): boolean => {
27
- let parent: HTMLElement | null = el.parentElement;
28
- while (parent && parent !== document.body) {
29
- const style = window.getComputedStyle(parent);
30
- if (style.position === "sticky" || style.position === "fixed") {
31
- return true;
32
- }
33
- parent = parent.parentElement;
34
- }
35
- return false;
36
- };
37
-
38
26
  const HeadingsOverlay = ({ headingFilter }: IHeadingsOverlayProps) => {
39
27
  const [boxes, setBoxes] = useState<HeadingBox[]>([]);
40
28
  const rafRef = useRef<number>(0);
@@ -59,7 +47,6 @@ const HeadingsOverlay = ({ headingFilter }: IHeadingsOverlayProps) => {
59
47
  rect,
60
48
  scrollX,
61
49
  scrollY,
62
- inStickyOrFixed: isInStickyOrFixed(el),
63
50
  });
64
51
  }
65
52
  setBoxes(boxes);
@@ -88,7 +75,7 @@ const HeadingsOverlay = ({ headingFilter }: IHeadingsOverlayProps) => {
88
75
 
89
76
  return createPortal(
90
77
  <div data-testid="headings-overlay">
91
- {boxes.map(({ id, tag, rect, scrollX, scrollY, inStickyOrFixed }) => {
78
+ {boxes.map(({ id, tag, rect, scrollX, scrollY }) => {
92
79
  const color = headColors[tag];
93
80
  if (!color) return null;
94
81
  const labelAbove = rect.left < 30;
@@ -96,10 +83,9 @@ const HeadingsOverlay = ({ headingFilter }: IHeadingsOverlayProps) => {
96
83
  <S.Box
97
84
  key={id}
98
85
  $color={color}
99
- $fixed={inStickyOrFixed}
100
86
  style={{
101
- top: inStickyOrFixed ? rect.top : rect.top + scrollY,
102
- left: inStickyOrFixed ? rect.left : rect.left + scrollX,
87
+ top: rect.top + scrollY,
88
+ left: rect.left + scrollX,
103
89
  width: rect.width,
104
90
  height: rect.height,
105
91
  }}
@@ -121,7 +107,6 @@ interface HeadingBox {
121
107
  rect: DOMRect;
122
108
  scrollX: number;
123
109
  scrollY: number;
124
- inStickyOrFixed: boolean;
125
110
  }
126
111
 
127
112
  export interface IHeadingsOverlayProps {
@@ -1,7 +1,7 @@
1
1
  import styled from "styled-components";
2
2
 
3
- const Box = styled.div<{ $color: string; $fixed?: boolean }>`
4
- position: ${(p) => (p.$fixed ? "fixed" : "absolute")};
3
+ const Box = styled.div<{ $color: string }>`
4
+ position: absolute;
5
5
  outline: 2px solid ${(p) => p.$color};
6
6
  z-index: 1001;
7
7
  pointer-events: none;