fumadocs-ui 13.3.0 → 13.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.
@@ -1,11 +1,10 @@
1
1
  // src/utils/use-toc-thumb.ts
2
- import { useState } from "react";
2
+ import { useLayoutEffect, useState } from "react";
3
3
  import * as Primitive from "fumadocs-core/toc";
4
- import { useOnChange } from "fumadocs-core/utils/use-on-change";
5
4
  function useTocThumb(containerRef) {
6
5
  const active = Primitive.useActiveAnchors();
7
6
  const [pos, setPos] = useState([0, 0]);
8
- useOnChange(active, () => {
7
+ useLayoutEffect(() => {
9
8
  const container = containerRef.current;
10
9
  if (active.length === 0 || !container || container.clientHeight === 0) {
11
10
  setPos([0, 0]);
@@ -28,7 +27,7 @@ function useTocThumb(containerRef) {
28
27
  );
29
28
  }
30
29
  setPos([upper, lower - upper]);
31
- });
30
+ }, [active, containerRef]);
32
31
  return pos;
33
32
  }
34
33
 
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useTocThumb
4
- } from "./chunk-QDCOD7BQ.js";
4
+ } from "./chunk-P4HLRHHV.js";
5
5
  import {
6
6
  useTreeContext
7
7
  } from "./chunk-LSTPTAZ5.js";
package/dist/page.js CHANGED
@@ -23,7 +23,7 @@ import { forwardRef } from "react";
23
23
  import dynamic from "next/dynamic";
24
24
  import { AnchorProvider } from "fumadocs-core/toc";
25
25
  import { jsx, jsxs } from "react/jsx-runtime";
26
- var ClerkTOCItems = dynamic(() => import("./toc-clerk-5OPLPRKO.js"));
26
+ var ClerkTOCItems = dynamic(() => import("./toc-clerk-RXJ32UXT.js"));
27
27
  function DocsPage({
28
28
  toc = [],
29
29
  tableOfContent = {},
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import {
3
3
  useTocThumb
4
- } from "./chunk-QDCOD7BQ.js";
4
+ } from "./chunk-P4HLRHHV.js";
5
5
  import {
6
6
  ScrollArea,
7
7
  ScrollViewport
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fumadocs-ui",
3
- "version": "13.3.0",
3
+ "version": "13.3.1",
4
4
  "description": "The framework for building a documentation website in Next.js",
5
5
  "keywords": [
6
6
  "NextJs",
@@ -103,7 +103,7 @@
103
103
  "react-medium-image-zoom": "^5.2.8",
104
104
  "swr": "^2.2.5",
105
105
  "tailwind-merge": "^2.5.2",
106
- "fumadocs-core": "13.3.0"
106
+ "fumadocs-core": "13.3.1"
107
107
  },
108
108
  "devDependencies": {
109
109
  "@algolia/client-search": "^4.24.0",