@orangecheck/app-design 0.3.0 → 0.3.1

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.
@@ -175,7 +175,7 @@ function useActiveHeading(ids) {
175
175
  const key = ids.join("|");
176
176
  react.useEffect(() => {
177
177
  const els = key.split("|").map((id) => document.getElementById(id)).filter((el) => el !== null);
178
- if (els.length === 0) return;
178
+ if (els.length === 0 || typeof IntersectionObserver === "undefined") return;
179
179
  const io = new IntersectionObserver(
180
180
  (entries) => {
181
181
  const hit = entries.filter((e) => e.isIntersecting).sort((a, b) => a.boundingClientRect.top - b.boundingClientRect.top)[0];
@@ -336,6 +336,7 @@ function ScrollFade({ fade = "var(--card)", className, innerClassName, children,
336
336
  const el = ref.current;
337
337
  if (!el) return;
338
338
  measure();
339
+ if (typeof ResizeObserver === "undefined") return;
339
340
  const ro = new ResizeObserver(measure);
340
341
  ro.observe(el);
341
342
  if (el.firstElementChild) ro.observe(el.firstElementChild);