@orangecheck/app-design 0.3.0 → 0.3.2

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.
@@ -153,7 +153,7 @@ function useActiveHeading(ids) {
153
153
  const key = ids.join("|");
154
154
  useEffect(() => {
155
155
  const els = key.split("|").map((id) => document.getElementById(id)).filter((el) => el !== null);
156
- if (els.length === 0) return;
156
+ if (els.length === 0 || typeof IntersectionObserver === "undefined") return;
157
157
  const io = new IntersectionObserver(
158
158
  (entries) => {
159
159
  const hit = entries.filter((e) => e.isIntersecting).sort((a, b) => a.boundingClientRect.top - b.boundingClientRect.top)[0];
@@ -314,6 +314,7 @@ function ScrollFade({ fade = "var(--card)", className, innerClassName, children,
314
314
  const el = ref.current;
315
315
  if (!el) return;
316
316
  measure();
317
+ if (typeof ResizeObserver === "undefined") return;
317
318
  const ro = new ResizeObserver(measure);
318
319
  ro.observe(el);
319
320
  if (el.firstElementChild) ro.observe(el.firstElementChild);