fumadocs-ui 12.0.7 → 12.1.0
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/{chunk-E5OQ6FBQ.js → chunk-GQSNSUPR.js} +16 -2
- package/dist/components/codeblock.d.ts +4 -0
- package/dist/components/codeblock.js +1 -1
- package/dist/docs.client.js +3 -2
- package/dist/mdx.client.js +1 -1
- package/dist/provider.d.ts +2 -2
- package/dist/twoslash.css +1 -1
- package/package.json +3 -3
|
@@ -15,7 +15,11 @@ import {
|
|
|
15
15
|
|
|
16
16
|
// src/components/codeblock.tsx
|
|
17
17
|
import { Check, Copy } from "lucide-react";
|
|
18
|
-
import {
|
|
18
|
+
import {
|
|
19
|
+
forwardRef,
|
|
20
|
+
useCallback,
|
|
21
|
+
useRef
|
|
22
|
+
} from "react";
|
|
19
23
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
20
24
|
var Pre = forwardRef(
|
|
21
25
|
({ className, ...props }, ref) => {
|
|
@@ -46,7 +50,17 @@ var CodeBlock = forwardRef(
|
|
|
46
50
|
...props,
|
|
47
51
|
children: [
|
|
48
52
|
title ? /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center gap-2 border-b bg-muted px-4 py-1.5", children: [
|
|
49
|
-
/* @__PURE__ */ jsx(
|
|
53
|
+
icon ? /* @__PURE__ */ jsx(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: "text-muted-foreground [&_svg]:size-3.5",
|
|
57
|
+
...typeof icon === "string" ? {
|
|
58
|
+
dangerouslySetInnerHTML: { __html: icon }
|
|
59
|
+
} : {
|
|
60
|
+
children: icon
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
) : null,
|
|
50
64
|
/* @__PURE__ */ jsx("figcaption", { className: "flex-1 truncate text-muted-foreground", children: title }),
|
|
51
65
|
allowCopy ? /* @__PURE__ */ jsx(CopyButton, { className: "-me-2", onCopy }) : null
|
|
52
66
|
] }) : allowCopy && /* @__PURE__ */ jsx(
|
|
@@ -4,6 +4,8 @@ import { HTMLAttributes, ReactNode } from 'react';
|
|
|
4
4
|
type CodeBlockProps = HTMLAttributes<HTMLElement> & {
|
|
5
5
|
/**
|
|
6
6
|
* Icon of code block
|
|
7
|
+
*
|
|
8
|
+
* When passed as a string, it assumes the value is the HTML of icon
|
|
7
9
|
*/
|
|
8
10
|
icon?: ReactNode;
|
|
9
11
|
allowCopy?: boolean;
|
|
@@ -12,6 +14,8 @@ declare const Pre: React.ForwardRefExoticComponent<HTMLAttributes<HTMLPreElement
|
|
|
12
14
|
declare const CodeBlock: React.ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & {
|
|
13
15
|
/**
|
|
14
16
|
* Icon of code block
|
|
17
|
+
*
|
|
18
|
+
* When passed as a string, it assumes the value is the HTML of icon
|
|
15
19
|
*/
|
|
16
20
|
icon?: ReactNode;
|
|
17
21
|
allowCopy?: boolean | undefined;
|
package/dist/docs.client.js
CHANGED
|
@@ -269,8 +269,9 @@ function DynamicSidebar(props) {
|
|
|
269
269
|
const [hover, setHover] = useState2(false);
|
|
270
270
|
const timerRef = useRef(0);
|
|
271
271
|
const onCollapse = useCallback2(() => {
|
|
272
|
-
setCollapsed(!
|
|
273
|
-
|
|
272
|
+
setCollapsed((v) => !v);
|
|
273
|
+
setHover(false);
|
|
274
|
+
}, [setCollapsed]);
|
|
274
275
|
const onHover = useCallback2((e) => {
|
|
275
276
|
if (e.pointerType === "touch") return;
|
|
276
277
|
window.clearTimeout(timerRef.current);
|
package/dist/mdx.client.js
CHANGED
package/dist/provider.d.ts
CHANGED
|
@@ -53,9 +53,9 @@ declare function useSearchContext(): SearchContextType;
|
|
|
53
53
|
|
|
54
54
|
interface SidebarContext {
|
|
55
55
|
open: boolean;
|
|
56
|
-
setOpen:
|
|
56
|
+
setOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
57
57
|
collapsed: boolean;
|
|
58
|
-
setCollapsed:
|
|
58
|
+
setCollapsed: React.Dispatch<React.SetStateAction<boolean>>;
|
|
59
59
|
/**
|
|
60
60
|
* When set to true, close the sidebar on redirection
|
|
61
61
|
*/
|
package/dist/twoslash.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--twoslash-error-color:#d45656;--twoslash-error-bg:rgba(212,86,86,.125);--twoslash-tag-color:#3772cf;--twoslash-tag-bg:rgba(55,114,207,.125);--twoslash-tag-warn-color:#c37d0d;--twoslash-tag-warn-bg:rgba(195,125,13,.125);--twoslash-tag-annotate-color:#1ba673;--twoslash-tag-annotate-bg:rgba(27,166,115,.125)}.twoslash-query-presisted .twoslash-popup-container,.twoslash-completion-list{-webkit-user-select:none;-ms-user-select:none;user-select:none;white-space:normal;background-color:hsl(var(--popover));color:hsl(var(--popover-foreground));z-index:10;border-width:1px;border-radius:6px;flex-direction:column;width:20rem;padding:8px;display:flex;position:absolute;top:0;left:0;transform:translateY(16px);box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)}.twoslash-query-presisted .twoslash-popup-container:hover,.twoslash-completion-list:hover{-webkit-user-select:auto;-ms-user-select:auto;user-select:auto}.twoslash-popup-arrow{pointer-events:none;background-color:hsl(var(--popover));border-top-width:1px;border-right-width:1px;width:6px;height:6px;position:absolute;top:-4px;left:1em;transform:rotate(-45deg)}.twoslash-popup-docs-tag{flex-direction:column;gap:.5em;display:flex}.twoslash-popup-docs-tag-name{font-weight:600}.twoslash-popup-code{font-size:14px;display:block!important}.twoslash-popup-code .line{padding-left:0!important}.twoslash-popup-docs{color:hsl(var(--muted-foreground))!important;margin-top:8px!important;font-size:14px!important;line-height:20px!important}.twoslash:hover .twoslash-hover{border-color:currentColor}.twoslash .twoslash-hover{border-color:transparent;border-bottom-style:dotted;border-bottom-width:1px;transition:border .3s;position:relative}.twoslash .twoslash-error-line{background-color:var(--twoslash-error-bg);border-left:3px solid var(--twoslash-error-color);color:var(--twoslash-error-color);margin:.2em 0;padding:6px 12px;position:relative}.twoslash .twoslash-error{-webkit-text-decoration:wavy underline var(--twoslash-error-color);text-decoration:wavy underline var(--twoslash-error-color);padding-bottom:2px}.twoslash .twoslash-completion-cursor{position:relative}.twoslash-completion-list:before{content:" ";background-color:hsl(var(--foreground));width:1px;height:1em;position:absolute;top:-1.2em;left:-1px}.twoslash-completion-list li{text-overflow:ellipsis;white-space:nowrap;align-items:center;gap:.5rem;font-size:13px;display:inline-flex;overflow:hidden}.twoslash-completion-list li span.twoslash-completions-unmatched{color:hsl(var(--muted-foreground))}.twoslash-completion-list .deprecated{opacity:.5;text-decoration:line-through}.twoslash-completion-list .twoslash-completions-icon{color:hsl(var(--muted-foreground));flex:none;width:1em}.twoslash .twoslash-tag-line{background-color:var(--twoslash-tag-bg);border-left:3px solid var(--twoslash-tag-color);color:var(--twoslash-tag-color);align-items:center;gap:.3em;margin:.2em 0;padding:6px 10px;display:flex;position:relative}.twoslash .twoslash-tag-line .twoslash-tag-icon{color:inherit;width:1.1em}.twoslash .twoslash-tag-line.twoslash-tag-error-line{background-color:var(--twoslash-error-bg);border-left:3px solid var(--twoslash-error-color);color:var(--twoslash-error-color)}.twoslash .twoslash-tag-line.twoslash-tag-warn-line{background-color:var(--twoslash-tag-warn-bg);border-left:3px solid var(--twoslash-tag-warn-color);color:var(--twoslash-tag-warn-color)}.twoslash .twoslash-tag-line.twoslash-tag-annotate-line{background-color:var(--twoslash-tag-annotate-bg);border-left:3px solid var(--twoslash-tag-annotate-color);color:var(--twoslash-tag-annotate-color)}@media (prefers-reduced-motion:reduce){.twoslash *{transition:none!important}}
|
|
1
|
+
:root{--twoslash-error-color:#d45656;--twoslash-error-bg:rgba(212,86,86,.125);--twoslash-tag-color:#3772cf;--twoslash-tag-bg:rgba(55,114,207,.125);--twoslash-tag-warn-color:#c37d0d;--twoslash-tag-warn-bg:rgba(195,125,13,.125);--twoslash-tag-annotate-color:#1ba673;--twoslash-tag-annotate-bg:rgba(27,166,115,.125)}.twoslash-query-presisted .twoslash-popup-container,.twoslash-completion-list{-webkit-user-select:none;-ms-user-select:none;user-select:none;white-space:normal;background-color:hsl(var(--popover));color:hsl(var(--popover-foreground));z-index:10;border-width:1px;border-radius:6px;flex-direction:column;width:20rem;padding:8px;display:flex;position:absolute;top:0;left:0;transform:translateY(16px);box-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1)}.twoslash-query-presisted .twoslash-popup-container:hover,.twoslash-completion-list:hover{-webkit-user-select:auto;-ms-user-select:auto;user-select:auto}.twoslash-popup-arrow{pointer-events:none;background-color:hsl(var(--popover));border-top-width:1px;border-right-width:1px;width:6px;height:6px;position:absolute;top:-4px;left:1em;transform:rotate(-45deg)}.twoslash-popup-docs-tag{flex-direction:column;gap:.5em;display:flex}.twoslash-popup-docs-tag-name{font-weight:600}.twoslash-popup-code{font-size:14px;display:block!important}.twoslash-popup-code .line{padding-left:0!important}.twoslash-popup-docs,.twoslash-popup-docs-tags{color:hsl(var(--muted-foreground))!important;margin-top:8px!important;font-size:14px!important;line-height:20px!important}.twoslash:hover .twoslash-hover{border-color:currentColor}.twoslash .twoslash-hover{border-color:transparent;border-bottom-style:dotted;border-bottom-width:1px;transition:border .3s;position:relative}.twoslash .twoslash-error-line{background-color:var(--twoslash-error-bg);border-left:3px solid var(--twoslash-error-color);color:var(--twoslash-error-color);margin:.2em 0;padding:6px 12px;position:relative}.twoslash .twoslash-error{-webkit-text-decoration:wavy underline var(--twoslash-error-color);text-decoration:wavy underline var(--twoslash-error-color);padding-bottom:2px}.twoslash .twoslash-completion-cursor{position:relative}.twoslash-completion-list:before{content:" ";background-color:hsl(var(--foreground));width:1px;height:1em;position:absolute;top:-1.2em;left:-1px}.twoslash-completion-list li{text-overflow:ellipsis;white-space:nowrap;align-items:center;gap:.5rem;font-size:13px;display:inline-flex;overflow:hidden}.twoslash-completion-list li span.twoslash-completions-unmatched{color:hsl(var(--muted-foreground))}.twoslash-completion-list .deprecated{opacity:.5;text-decoration:line-through}.twoslash-completion-list .twoslash-completions-icon{color:hsl(var(--muted-foreground));flex:none;width:1em}.twoslash .twoslash-tag-line{background-color:var(--twoslash-tag-bg);border-left:3px solid var(--twoslash-tag-color);color:var(--twoslash-tag-color);align-items:center;gap:.3em;margin:.2em 0;padding:6px 10px;display:flex;position:relative}.twoslash .twoslash-tag-line .twoslash-tag-icon{color:inherit;width:1.1em}.twoslash .twoslash-tag-line.twoslash-tag-error-line{background-color:var(--twoslash-error-bg);border-left:3px solid var(--twoslash-error-color);color:var(--twoslash-error-color)}.twoslash .twoslash-tag-line.twoslash-tag-warn-line{background-color:var(--twoslash-tag-warn-bg);border-left:3px solid var(--twoslash-tag-warn-color);color:var(--twoslash-tag-warn-color)}.twoslash .twoslash-tag-line.twoslash-tag-annotate-line{background-color:var(--twoslash-tag-annotate-bg);border-left:3px solid var(--twoslash-tag-annotate-color);color:var(--twoslash-tag-annotate-color)}@media (prefers-reduced-motion:reduce){.twoslash *{transition:none!important}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fumadocs-ui",
|
|
3
|
-
"version": "12.0
|
|
3
|
+
"version": "12.1.0",
|
|
4
4
|
"description": "The framework for building a documentation website in Next.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"NextJs",
|
|
@@ -91,11 +91,11 @@
|
|
|
91
91
|
"@tailwindcss/typography": "^0.5.13",
|
|
92
92
|
"class-variance-authority": "^0.7.0",
|
|
93
93
|
"cmdk": "^1.0.0",
|
|
94
|
-
"lucide-react": "^0.
|
|
94
|
+
"lucide-react": "^0.395.0",
|
|
95
95
|
"next-themes": "^0.3.0",
|
|
96
96
|
"react-medium-image-zoom": "^5.2.4",
|
|
97
97
|
"tailwind-merge": "^2.3.0",
|
|
98
|
-
"fumadocs-core": "12.0
|
|
98
|
+
"fumadocs-core": "12.1.0"
|
|
99
99
|
},
|
|
100
100
|
"devDependencies": {
|
|
101
101
|
"@algolia/client-search": "^4.23.3",
|