@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.
package/dist/index.mjs CHANGED
@@ -674,6 +674,7 @@ function ScrollFade({ fade = "var(--card)", className, innerClassName, children,
674
674
  const el = ref.current;
675
675
  if (!el) return;
676
676
  measure();
677
+ if (typeof ResizeObserver === "undefined") return;
677
678
  const ro = new ResizeObserver(measure);
678
679
  ro.observe(el);
679
680
  if (el.firstElementChild) ro.observe(el.firstElementChild);
@@ -1030,7 +1031,7 @@ function useActiveHeading(ids) {
1030
1031
  const key = ids.join("|");
1031
1032
  useEffect(() => {
1032
1033
  const els = key.split("|").map((id) => document.getElementById(id)).filter((el) => el !== null);
1033
- if (els.length === 0) return;
1034
+ if (els.length === 0 || typeof IntersectionObserver === "undefined") return;
1034
1035
  const io = new IntersectionObserver(
1035
1036
  (entries) => {
1036
1037
  const hit = entries.filter((e) => e.isIntersecting).sort((a, b) => a.boundingClientRect.top - b.boundingClientRect.top)[0];