fumadocs-ui 12.5.5 → 12.5.6
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.
|
@@ -166,17 +166,17 @@ function PageNode({
|
|
|
166
166
|
);
|
|
167
167
|
}
|
|
168
168
|
function FolderNode({
|
|
169
|
-
item
|
|
169
|
+
item,
|
|
170
170
|
level
|
|
171
171
|
}) {
|
|
172
172
|
const { defaultOpenLevel, prefetch } = useContext(Context);
|
|
173
173
|
const pathname = usePathname();
|
|
174
|
-
const active = index !== void 0 && isActive(index.url, pathname, false);
|
|
174
|
+
const active = item.index !== void 0 && isActive(item.index.url, pathname, false);
|
|
175
175
|
const childActive = useMemo(
|
|
176
|
-
() => hasActive(children, pathname),
|
|
177
|
-
[children, pathname]
|
|
176
|
+
() => hasActive(item.children, pathname),
|
|
177
|
+
[item.children, pathname]
|
|
178
178
|
);
|
|
179
|
-
const shouldExtend = active || childActive || defaultOpenLevel >= level
|
|
179
|
+
const shouldExtend = active || childActive || (item.defaultOpen ?? defaultOpenLevel >= level);
|
|
180
180
|
const [open, setOpen] = useState(shouldExtend);
|
|
181
181
|
useOnChange(shouldExtend, (v) => {
|
|
182
182
|
if (v) setOpen(v);
|
|
@@ -194,8 +194,8 @@ function FolderNode({
|
|
|
194
194
|
[active]
|
|
195
195
|
);
|
|
196
196
|
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
197
|
-
icon,
|
|
198
|
-
name,
|
|
197
|
+
item.icon,
|
|
198
|
+
item.name,
|
|
199
199
|
/* @__PURE__ */ jsx(
|
|
200
200
|
ChevronDown,
|
|
201
201
|
{
|
|
@@ -205,11 +205,11 @@ function FolderNode({
|
|
|
205
205
|
)
|
|
206
206
|
] });
|
|
207
207
|
return /* @__PURE__ */ jsxs(Collapsible, { open, onOpenChange: setOpen, children: [
|
|
208
|
-
index ? /* @__PURE__ */ jsx(
|
|
208
|
+
item.index ? /* @__PURE__ */ jsx(
|
|
209
209
|
Link,
|
|
210
210
|
{
|
|
211
211
|
className: twMerge(itemVariants({ active })),
|
|
212
|
-
href: index.url,
|
|
212
|
+
href: item.index.url,
|
|
213
213
|
onClick,
|
|
214
214
|
prefetch,
|
|
215
215
|
children: content
|
|
@@ -219,7 +219,7 @@ function FolderNode({
|
|
|
219
219
|
NodeList,
|
|
220
220
|
{
|
|
221
221
|
className: "ms-2 flex flex-col border-s py-2 ps-2",
|
|
222
|
-
items: children,
|
|
222
|
+
items: item.children,
|
|
223
223
|
level
|
|
224
224
|
}
|
|
225
225
|
) })
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { HTMLAttributes, ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
declare const Callout: React.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "
|
|
4
|
+
declare const Callout: React.ForwardRefExoticComponent<Omit<HTMLAttributes<HTMLDivElement>, "title" | "icon" | "type"> & {
|
|
5
5
|
title?: ReactNode;
|
|
6
6
|
/**
|
|
7
7
|
* @defaultValue info
|
package/dist/layout.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-ui",
|
|
3
|
-
"version": "12.5.
|
|
3
|
+
"version": "12.5.6",
|
|
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.4.0",
|
|
106
|
-
"fumadocs-core": "12.5.
|
|
106
|
+
"fumadocs-core": "12.5.6"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@algolia/client-search": "^4.24.0",
|