@griddo/ax 11.12.1-rc.10 → 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.10",
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": "eb32fff3cb2388110e448459eca5a251580ffc77"
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);
@@ -45,18 +33,14 @@ const HeadingsOverlay = ({ headingFilter }: IHeadingsOverlayProps) => {
45
33
  rafRef.current = requestAnimationFrame(() => {
46
34
  const selector = headingFilter || "h1, h2, h3, h4, h5, h6";
47
35
  const headings = Array.from(document.querySelectorAll<HTMLElement>(selector));
36
+ const scrollX = window.scrollX;
37
+ const scrollY = window.scrollY;
48
38
  const boxes: HeadingBox[] = [];
49
39
  for (let i = 0; i < headings.length; i++) {
50
40
  const el = headings[i];
51
41
  const rect = el.getBoundingClientRect();
52
42
  if (rect.width === 0 && rect.height === 0) continue;
53
43
  if (!isEffectivelyVisible(el)) continue;
54
-
55
- // Para headings dentro de sticky/fixed, no sumar scroll de página
56
- const inStickyOrFixed = isInStickyOrFixed(el);
57
- const scrollX = inStickyOrFixed ? 0 : window.scrollX;
58
- const scrollY = inStickyOrFixed ? 0 : window.scrollY;
59
-
60
44
  boxes.push({
61
45
  id: el.dataset.griddoid || `heading-${i}`,
62
46
  tag: el.tagName.toLowerCase(),