@mintlify/msft-sdk 1.1.41 → 1.1.43
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/components/content-components/tabs/tabs.js +10 -6
- package/dist/components/content-components/tabs/tabs.js.map +1 -1
- package/dist/components/nav-tree/index.js +170 -161
- package/dist/components/nav-tree/index.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
|
@@ -6,7 +6,14 @@ const A = o.createContext({
|
|
|
6
6
|
setActiveTab: () => {
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
|
-
function T({
|
|
9
|
+
function T({
|
|
10
|
+
children: y,
|
|
11
|
+
defaultTab: w = 0,
|
|
12
|
+
defaultTabIndex: x,
|
|
13
|
+
className: _,
|
|
14
|
+
onClickTab: f,
|
|
15
|
+
onChange: c
|
|
16
|
+
}) {
|
|
10
17
|
const [a, b] = v(x ?? w), l = $([]), [h, N] = v({ left: 0, width: 0 }), i = o.Children.toArray(y);
|
|
11
18
|
g(() => {
|
|
12
19
|
l.current = l.current.slice(0, i.length);
|
|
@@ -44,7 +51,7 @@ function T({ children: y, defaultTab: w = 0, defaultTabIndex: x, className: _, o
|
|
|
44
51
|
{
|
|
45
52
|
role: "tablist",
|
|
46
53
|
"aria-label": "Content tabs",
|
|
47
|
-
className: "mint:relative mint:flex mint:gap-1 mint:mb-4 mint:overflow-x-auto mint:pb-[3px] mint:before:content-[''] mint:before:absolute mint:before:left-0 mint:before:right-0 mint:before:bottom-0 mint:before:h-[2px] mint:before:bg-[#f2f3f3] mint:before:
|
|
54
|
+
className: "mint:relative mint:flex mint:gap-1 mint:mb-4 mint:overflow-x-auto mint:pb-[3px] mint:before:content-[''] mint:before:absolute mint:before:left-0 mint:before:right-0 mint:before:bottom-0 mint:before:h-[2px] mint:before:bg-[#f2f3f3] mint:dark:before:bg-[#222223] mint:before:rounded-full",
|
|
48
55
|
children: [
|
|
49
56
|
i.map((e, t) => {
|
|
50
57
|
if (!o.isValidElement(e)) return null;
|
|
@@ -100,10 +107,7 @@ function T({ children: y, defaultTab: w = 0, defaultTabIndex: x, className: _, o
|
|
|
100
107
|
"aria-labelledby": `tab-${t}`,
|
|
101
108
|
tabIndex: 0,
|
|
102
109
|
hidden: a !== t,
|
|
103
|
-
className: p(
|
|
104
|
-
"mint:outline-none",
|
|
105
|
-
a !== t && "mint:hidden"
|
|
106
|
-
),
|
|
110
|
+
className: p("mint:outline-none", a !== t && "mint:hidden"),
|
|
107
111
|
children: o.isValidElement(e) ? e.props.children : null
|
|
108
112
|
},
|
|
109
113
|
t
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tabs.js","sources":["../../../../src/components/content-components/tabs/tabs.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from
|
|
1
|
+
{"version":3,"file":"tabs.js","sources":["../../../../src/components/content-components/tabs/tabs.tsx"],"sourcesContent":["import React, { useState, useRef, useEffect } from 'react';\n\nimport { cn } from '../../../utils/cn';\n\ninterface TabsProps {\n children: React.ReactNode;\n defaultTab?: number;\n defaultTabIndex?: number;\n className?: string;\n onClickTab?: (index: number) => void;\n onChange?: (index: number) => void;\n}\n\ninterface TabsContextValue {\n activeTab: number;\n setActiveTab: (index: number) => void;\n}\n\nexport const TabsContext = React.createContext<TabsContextValue>({\n activeTab: 0,\n setActiveTab: () => {},\n});\n\nexport function Tabs({\n children,\n defaultTab = 0,\n defaultTabIndex,\n className,\n onClickTab,\n onChange,\n}: TabsProps) {\n const [activeTab, setActiveTab] = useState(defaultTabIndex ?? defaultTab);\n const tabRefs = useRef<(HTMLButtonElement | null)[]>([]);\n const [indicatorStyle, setIndicatorStyle] = useState({ left: 0, width: 0 });\n\n const tabs = React.Children.toArray(children);\n\n useEffect(() => {\n tabRefs.current = tabRefs.current.slice(0, tabs.length);\n }, [tabs.length]);\n\n useEffect(() => {\n const activeTabElement = tabRefs.current[activeTab];\n if (activeTabElement) {\n setIndicatorStyle({\n left: activeTabElement.offsetLeft,\n width: activeTabElement.offsetWidth,\n });\n }\n }, [activeTab]);\n\n const handleKeyDown = (event: React.KeyboardEvent, currentIndex: number) => {\n let newIndex = currentIndex;\n\n switch (event.key) {\n case 'ArrowRight':\n event.preventDefault();\n newIndex = (currentIndex + 1) % tabs.length;\n break;\n case 'ArrowLeft':\n event.preventDefault();\n newIndex = (currentIndex - 1 + tabs.length) % tabs.length;\n break;\n case 'Home':\n event.preventDefault();\n newIndex = 0;\n break;\n case 'End':\n event.preventDefault();\n newIndex = tabs.length - 1;\n break;\n default:\n return;\n }\n\n setActiveTab(newIndex);\n tabRefs.current[newIndex]?.focus();\n };\n\n return (\n <TabsContext.Provider value={{ activeTab, setActiveTab }}>\n <div className={cn('mint:my-6', className)}>\n <div\n role=\"tablist\"\n aria-label=\"Content tabs\"\n className=\"mint:relative mint:flex mint:gap-1 mint:mb-4 mint:overflow-x-auto mint:pb-[3px] mint:before:content-[''] mint:before:absolute mint:before:left-0 mint:before:right-0 mint:before:bottom-0 mint:before:h-[2px] mint:before:bg-[#f2f3f3] mint:dark:before:bg-[#222223] mint:before:rounded-full\"\n >\n {tabs.map((tab, index) => {\n if (!React.isValidElement(tab)) return null;\n const title = tab.props.title || `Tab ${index + 1}`;\n const icon = tab.props.icon;\n const isActive = activeTab === index;\n\n return (\n <button\n key={index}\n ref={(el) => {\n tabRefs.current[index] = el;\n }}\n role=\"tab\"\n aria-selected={isActive}\n aria-controls={`tabpanel-${index}`}\n id={`tab-${index}`}\n tabIndex={isActive ? 0 : -1}\n onClick={() => {\n setActiveTab(index);\n onClickTab?.(index);\n onChange?.(index);\n }}\n onKeyDown={(e) => handleKeyDown(e, index)}\n className={cn(\n 'mint:relative mint:px-4 mint:py-2 mint:text-sm mint:font-medium mint:border-0 mint:bg-transparent mint:cursor-pointer mint:focus:outline-none mint:focus-visible:shadow-[0_0_0_2px_#fff,0_0_0_4px_#75b6e7] mint:focus-visible:outline-offset-2',\n isActive\n ? 'mint:text-[#242424] mint:dark:text-[#ffffff] mint:font-semibold'\n : 'mint:text-gray-600 mint:hover:text-gray-900 mint:dark:text-gray-400 mint:dark:hover:text-gray-200'\n )}\n >\n <span className=\"mint:flex mint:items-center mint:gap-2\">\n {icon && <span aria-hidden=\"true\">{icon}</span>}\n <span className=\"mint:relative\">\n <span className=\"mint:invisible mint:font-semibold\" aria-hidden=\"true\">\n {title}\n </span>\n <span className=\"mint:absolute mint:inset-0\">{title}</span>\n </span>\n </span>\n </button>\n );\n })}\n <div\n className=\"mint:absolute mint:bottom-0 mint:h-[3px] mint:rounded-full mint:bg-[#8251ee] mint:dark:bg-[#9263f1] mint:transition-all mint:duration-300 mint:ease-out mint:z-10\"\n style={{\n left: `${indicatorStyle.left}px`,\n width: `${indicatorStyle.width}px`,\n }}\n />\n </div>\n\n <div>\n {tabs.map((tab, index) => (\n <div\n key={index}\n role=\"tabpanel\"\n id={`tabpanel-${index}`}\n aria-labelledby={`tab-${index}`}\n tabIndex={0}\n hidden={activeTab !== index}\n className={cn('mint:outline-none', activeTab !== index && 'mint:hidden')}\n >\n {React.isValidElement(tab) ? tab.props.children : null}\n </div>\n ))}\n </div>\n </div>\n </TabsContext.Provider>\n );\n}\n"],"names":["TabsContext","React","Tabs","children","defaultTab","defaultTabIndex","className","onClickTab","onChange","activeTab","setActiveTab","useState","tabRefs","useRef","indicatorStyle","setIndicatorStyle","tabs","useEffect","activeTabElement","handleKeyDown","event","currentIndex","newIndex","_a","jsx","cn","jsxs","tab","index","title","icon","isActive","el","e"],"mappings":";;;AAkBO,MAAMA,IAAcC,EAAM,cAAgC;AAAA,EAC/D,WAAW;AAAA,EACX,cAAc,MAAM;AAAA,EAAC;AACvB,CAAC;AAEM,SAASC,EAAK;AAAA,EACnB,UAAAC;AAAA,EACA,YAAAC,IAAa;AAAA,EACb,iBAAAC;AAAA,EACA,WAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AACF,GAAc;AACZ,QAAM,CAACC,GA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iCX,CAAC;AAAA,UACD,gBAAAJ;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAU;AAAA,cACV,OAAO;AAAA,gBACL,MAAM,GAAGV,EAAe,IAAI;AAAA,gBAC5B,OAAO,GAAGA,EAAe,KAAK;AAAA,cAAA;AAAA,YAChC;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA;AAAA,sBAGD,OAAA,EACE,UAAAE,EAAK,IAAI,CAACW,GAAKC,MACd,gBAAAJ;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,MAAK;AAAA,QACL,IAAI,YAAYI,CAAK;AAAA,QACrB,mBAAiB,OAAOA,CAAK;AAAA,QAC7B,UAAU;AAAA,QACV,QAAQnB,MAAcmB;AAAA,QACtB,WAAWH,EAAG,qBAAqBhB,MAAcmB,KAAS,aAAa;AAAA,QAEtE,YAAM,eAAeD,CAAG,IAAIA,EAAI,MAAM,WAAW;AAAA,MAAA;AAAA,MAR7CC;AAAA,IAAA,CAUR,EAAA,CACH;AAAA,EAAA,EAAA,CACF,EAAA,CACF;AAEJ;"}
|
|
@@ -1,288 +1,297 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import C, { useRef as
|
|
3
|
-
import { useComponents as
|
|
1
|
+
import { jsxs as a, jsx as e, Fragment as I } from "react/jsx-runtime";
|
|
2
|
+
import C, { useRef as M, useEffect as z, useState as W } from "react";
|
|
3
|
+
import { useComponents as L } from "../../context/components-context.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import { cn as
|
|
6
|
-
import { MethodPill as
|
|
7
|
-
function _({ isExpanded:
|
|
8
|
-
return /* @__PURE__ */
|
|
5
|
+
import { cn as p } from "../../utils/cn.js";
|
|
6
|
+
import { MethodPill as j } from "../Api/MethodPill.js";
|
|
7
|
+
function _({ isExpanded: n }) {
|
|
8
|
+
return /* @__PURE__ */ e(
|
|
9
9
|
"svg",
|
|
10
10
|
{
|
|
11
|
-
className:
|
|
11
|
+
className: p(
|
|
12
12
|
"mint:w-[16px] mint:h-[16px] mint:shrink-0 mint:text-[#6b7280] mint:dark:text-[#adadad]",
|
|
13
|
-
|
|
13
|
+
n ? "mint:rotate-90" : "mint:rotate-0"
|
|
14
14
|
),
|
|
15
15
|
fill: "none",
|
|
16
16
|
stroke: "currentColor",
|
|
17
17
|
viewBox: "0 0 24 24",
|
|
18
18
|
"aria-hidden": "true",
|
|
19
|
-
children: /* @__PURE__ */
|
|
19
|
+
children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 5l7 7-7 7" })
|
|
20
20
|
}
|
|
21
21
|
);
|
|
22
22
|
}
|
|
23
|
-
const
|
|
24
|
-
function
|
|
25
|
-
const
|
|
26
|
-
if (!i || !
|
|
27
|
-
const
|
|
28
|
-
return
|
|
29
|
-
}, k = (i) =>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}, [
|
|
33
|
-
const { LinkComponent:
|
|
34
|
-
if (
|
|
35
|
-
return /* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
38
|
-
/* @__PURE__ */
|
|
23
|
+
const S = "mint:bg-[#e6e6e6] mint:dark:bg-[#2e2e2e] mint:text-[#242424] mint:dark:text-[#ffffff] mint:font-semibold";
|
|
24
|
+
function E({ item: n, activeId: g, level: u = 0, activeHref: s }) {
|
|
25
|
+
const b = n.children && n.children.length > 0, v = (i) => i ? i.startsWith("/") ? i : `/${i}` : "", x = (i, r) => {
|
|
26
|
+
if (!i || !r) return !1;
|
|
27
|
+
const o = v(i), N = v(r);
|
|
28
|
+
return o === N || o.replace("/docs/", "/") === N.replace("/docs/", "/") || o === N.replace("/docs/", "/") || o.replace("/docs/", "/") === N;
|
|
29
|
+
}, k = (i) => x(i.href, s) ? !0 : i.children ? i.children.some(k) : !1, $ = u === 0 ? !0 : (n.expanded ?? !1) || b && k(n), [c, t] = W($);
|
|
30
|
+
z(() => {
|
|
31
|
+
b && k(n) && t(!0);
|
|
32
|
+
}, [s]);
|
|
33
|
+
const { LinkComponent: f } = L(), d = !n.href, m = n.href && (x(n.href, g) || x(n.href, s)), h = n.icon;
|
|
34
|
+
if (d && u === 0)
|
|
35
|
+
return /* @__PURE__ */ a("div", { id: "nav-group", role: "group", "aria-label": n.toc_title, children: [
|
|
36
|
+
/* @__PURE__ */ a("div", { className: "mint:text-sm mint:font-semibold mint:text-[#141414] mint:dark:text-white mint:mb-3 mint:flex mint:items-start mint:gap-2 mint:pl-2.5", children: [
|
|
37
|
+
h && /* @__PURE__ */ e(h, { className: "mint:w-5 mint:h-5", "aria-hidden": "true" }),
|
|
38
|
+
/* @__PURE__ */ e("span", { children: n.toc_title })
|
|
39
39
|
] }),
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
b && n.children && /* @__PURE__ */ e("ul", { className: "mint:flex mint:flex-col mint:pl-0", role: "list", children: n.children.map((i, r) => /* @__PURE__ */ e(
|
|
41
|
+
E,
|
|
42
42
|
{
|
|
43
43
|
item: i,
|
|
44
44
|
activeId: g,
|
|
45
|
-
level:
|
|
46
|
-
activeHref:
|
|
45
|
+
level: u + 1,
|
|
46
|
+
activeHref: s
|
|
47
47
|
},
|
|
48
|
-
`${i.href}-${
|
|
48
|
+
`${i.href}-${r}`
|
|
49
49
|
)) })
|
|
50
50
|
] });
|
|
51
|
-
if (
|
|
52
|
-
return /* @__PURE__ */
|
|
53
|
-
/* @__PURE__ */
|
|
51
|
+
if (d && u > 0)
|
|
52
|
+
return /* @__PURE__ */ a("li", { className: "mint:list-none", children: [
|
|
53
|
+
/* @__PURE__ */ a(
|
|
54
54
|
"button",
|
|
55
55
|
{
|
|
56
56
|
id: "nav-group-toggle",
|
|
57
|
-
onClick: () =>
|
|
58
|
-
"aria-expanded":
|
|
59
|
-
"aria-label": `${
|
|
57
|
+
onClick: () => t(!c),
|
|
58
|
+
"aria-expanded": c,
|
|
59
|
+
"aria-label": `${c ? "Collapse" : "Expand"} ${n.toc_title} section`,
|
|
60
60
|
className: "mint:relative mint:text-left mint:w-full mint:flex mint:items-center mint:justify-between mint:py-2 mint:px-3 mint:text-sm mint:rounded-lg mint:bg-transparent mint:border-none mint:cursor-pointer mint:text-[#4b5563] mint:dark:text-[#adadad] mint:hover:bg-[rgba(75,85,99,0.05)] mint:hover:text-[#141414] mint:dark:hover:bg-[rgba(75,85,99,0.05)] mint:dark:hover:text-[#e5e7eb] mint:focus-visible:outline-2 mint:focus-visible:outline-[#643fb2] mint:focus-visible:outline-offset-2",
|
|
61
61
|
children: [
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ e("span", { className: "mint:flex-1 mint:min-w-0", children: n.toc_title }),
|
|
63
|
+
/* @__PURE__ */ e(_, { isExpanded: !!c })
|
|
64
64
|
]
|
|
65
65
|
}
|
|
66
66
|
),
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
b && c && n.children && /* @__PURE__ */ e("ul", { className: "mint:ml-3 mint:flex mint:flex-col mint:pl-0", role: "group", children: n.children.map((i, r) => /* @__PURE__ */ e(
|
|
68
|
+
E,
|
|
69
69
|
{
|
|
70
70
|
item: i,
|
|
71
71
|
activeId: g,
|
|
72
|
-
level:
|
|
73
|
-
activeHref:
|
|
72
|
+
level: u + 1,
|
|
73
|
+
activeHref: s
|
|
74
74
|
},
|
|
75
|
-
`${i.href}-${
|
|
75
|
+
`${i.href}-${r}`
|
|
76
76
|
)) })
|
|
77
77
|
] });
|
|
78
|
-
const
|
|
79
|
-
return
|
|
80
|
-
/* @__PURE__ */
|
|
78
|
+
const l = f || "a";
|
|
79
|
+
return b ? /* @__PURE__ */ a("li", { className: "mint:list-none", children: [
|
|
80
|
+
/* @__PURE__ */ a(
|
|
81
81
|
"button",
|
|
82
82
|
{
|
|
83
83
|
id: "nav-item-toggle",
|
|
84
|
-
onClick: () =>
|
|
85
|
-
"aria-expanded":
|
|
86
|
-
"aria-label": `${
|
|
87
|
-
className:
|
|
84
|
+
onClick: () => t(!c),
|
|
85
|
+
"aria-expanded": c,
|
|
86
|
+
"aria-label": `${c ? "Collapse" : "Expand"} ${n.toc_title} section`,
|
|
87
|
+
className: p(
|
|
88
88
|
"mint:relative mint:text-left mint:w-full mint:flex mint:items-center mint:justify-between mint:gap-2 mint:py-2 mint:px-3 mint:text-[14px] mint:font-normal mint:rounded-xl mint:bg-transparent mint:border-none mint:cursor-pointer mint:text-[#424242] mint:dark:text-[#adadad] mint:focus-visible:outline-2 mint:focus-visible:outline-[#643fb2] mint:focus-visible:outline-offset-2",
|
|
89
|
-
|
|
89
|
+
m ? S : "mint:hover:bg-[rgba(75,85,99,0.05)] mint:hover:text-[#141414] mint:dark:hover:bg-[rgba(75,85,99,0.05)] mint:dark:hover:text-[#e5e7eb]"
|
|
90
90
|
),
|
|
91
91
|
children: [
|
|
92
|
-
/* @__PURE__ */
|
|
93
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ e("span", { className: "mint:flex-1 mint:min-w-0", children: n.toc_title }),
|
|
93
|
+
/* @__PURE__ */ e(_, { isExpanded: !!c })
|
|
94
94
|
]
|
|
95
95
|
}
|
|
96
96
|
),
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
c && n.children && /* @__PURE__ */ e("ul", { className: "mint:ml-3 mint:flex mint:flex-col mint:pl-0", role: "group", children: n.children.map((i, r) => /* @__PURE__ */ e(
|
|
98
|
+
E,
|
|
99
99
|
{
|
|
100
100
|
item: i,
|
|
101
101
|
activeId: g,
|
|
102
|
-
level:
|
|
103
|
-
activeHref:
|
|
102
|
+
level: u + 1,
|
|
103
|
+
activeHref: s
|
|
104
104
|
},
|
|
105
|
-
`${i.href}-${
|
|
105
|
+
`${i.href}-${r}`
|
|
106
106
|
)) })
|
|
107
|
-
] }) : /* @__PURE__ */
|
|
108
|
-
|
|
107
|
+
] }) : /* @__PURE__ */ e("li", { className: "mint:list-none", children: /* @__PURE__ */ a(
|
|
108
|
+
l,
|
|
109
109
|
{
|
|
110
110
|
id: "nav-item",
|
|
111
|
-
href:
|
|
112
|
-
"aria-current":
|
|
113
|
-
className:
|
|
111
|
+
href: n.href,
|
|
112
|
+
"aria-current": m ? "page" : void 0,
|
|
113
|
+
className: p(
|
|
114
114
|
"mint:relative mint:flex mint:items-center mint:gap-2 mint:py-2 mint:px-3 mint:text-[14px] mint:font-normal mint:rounded-xl mint:no-underline mint:text-[#424242] mint:dark:text-[#adadad] mint:focus-visible:outline-2 mint:focus-visible:outline-[#643fb2] mint:focus-visible:outline-offset-2 mint:[&_span]:flex-1",
|
|
115
|
-
|
|
115
|
+
m ? S : "mint:hover:bg-[rgba(75,85,99,0.05)] mint:hover:text-[#141414] mint:dark:hover:bg-[rgba(75,85,99,0.05)] mint:dark:hover:text-[#e5e7eb]"
|
|
116
116
|
),
|
|
117
117
|
children: [
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
m && /* @__PURE__ */ e("div", { className: "mint:absolute mint:left-0 mint:my-2.5 mint:rounded-full mint:w-[3px] mint:top-0 mint:bottom-0 mint:bg-[#8251ee] mint:dark:bg-[#9263f1]" }),
|
|
119
|
+
n.method && /* @__PURE__ */ e(j, { isActive: !!m, method: n.method, shortMethod: !0 }),
|
|
120
|
+
n.toc_title
|
|
121
121
|
]
|
|
122
122
|
}
|
|
123
123
|
) });
|
|
124
124
|
}
|
|
125
|
-
function
|
|
126
|
-
navTree:
|
|
125
|
+
function G({
|
|
126
|
+
navTree: n,
|
|
127
127
|
activeId: g,
|
|
128
|
-
className:
|
|
129
|
-
activeHref:
|
|
130
|
-
theme:
|
|
128
|
+
className: u = "",
|
|
129
|
+
activeHref: s,
|
|
130
|
+
theme: b,
|
|
131
131
|
bottomLinks: v,
|
|
132
|
-
anchors:
|
|
132
|
+
anchors: x
|
|
133
133
|
}) {
|
|
134
|
-
const { LinkComponent: k } =
|
|
135
|
-
if (
|
|
136
|
-
const
|
|
137
|
-
if (!
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
134
|
+
const { LinkComponent: k } = L(), $ = M(null);
|
|
135
|
+
if (z(() => {
|
|
136
|
+
const t = $.current;
|
|
137
|
+
if (!t || !s) return;
|
|
138
|
+
const f = sessionStorage.getItem("nav-tree-scroll-position");
|
|
139
|
+
if (f)
|
|
140
|
+
t.scrollTop = parseInt(f, 10);
|
|
141
|
+
else {
|
|
142
|
+
const m = (l) => l ? l.startsWith("/") ? l : `/${l}` : "", h = (l, i) => {
|
|
143
|
+
const r = m(l), o = m(i);
|
|
144
|
+
return r === o || r.replace("/docs/", "/") === o.replace("/docs/", "/") || r === o.replace("/docs/", "/") || r.replace("/docs/", "/") === o;
|
|
145
|
+
};
|
|
146
|
+
requestAnimationFrame(() => {
|
|
147
|
+
const l = t.querySelectorAll("a[href]");
|
|
148
|
+
let i = null;
|
|
149
|
+
for (const r of Array.from(l)) {
|
|
150
|
+
const o = r.getAttribute("href");
|
|
151
|
+
if (o && h(o, s)) {
|
|
152
|
+
i = r;
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
150
155
|
}
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
i && i.scrollIntoView({
|
|
157
|
+
behavior: "instant",
|
|
158
|
+
block: "center",
|
|
159
|
+
inline: "nearest"
|
|
160
|
+
});
|
|
156
161
|
});
|
|
157
|
-
}
|
|
158
|
-
|
|
162
|
+
}
|
|
163
|
+
const d = () => {
|
|
164
|
+
sessionStorage.setItem("nav-tree-scroll-position", t.scrollTop.toString());
|
|
165
|
+
};
|
|
166
|
+
return t.addEventListener("scroll", d), () => t.removeEventListener("scroll", d);
|
|
167
|
+
}, [s]), !n || n.items.length === 0)
|
|
159
168
|
return null;
|
|
160
|
-
const
|
|
161
|
-
return /* @__PURE__ */
|
|
169
|
+
const c = k || "a";
|
|
170
|
+
return /* @__PURE__ */ a(
|
|
162
171
|
"nav",
|
|
163
172
|
{
|
|
164
173
|
id: "nav-tree",
|
|
165
|
-
className:
|
|
174
|
+
className: p(
|
|
166
175
|
"mint:flex mint:flex-col mint:h-full mint:min-h-0",
|
|
167
|
-
|
|
168
|
-
|
|
176
|
+
u,
|
|
177
|
+
b === "dark" && "dark"
|
|
169
178
|
),
|
|
170
179
|
"aria-label": "Documentation navigation",
|
|
171
180
|
children: [
|
|
172
|
-
/* @__PURE__ */
|
|
181
|
+
/* @__PURE__ */ a(
|
|
173
182
|
"div",
|
|
174
183
|
{
|
|
175
184
|
id: "nav-tree-content",
|
|
176
185
|
ref: $,
|
|
177
|
-
className:
|
|
186
|
+
className: p(
|
|
178
187
|
"mint:flex-1 mint:overflow-y-auto mint:overflow-x-hidden mint:min-h-0 mint:[scrollbar-gutter:stable] mint:md:px-4 mint:[scrollbar-width:thin] mint:[scrollbar-color:rgba(0,0,0,0.2)_transparent] mint:dark:[scrollbar-color:rgba(255,255,255,0.2)_transparent] mint:[&::-webkit-scrollbar]:w-1 mint:[&::-webkit-scrollbar-track]:bg-transparent mint:[&::-webkit-scrollbar-thumb]:bg-black/20 mint:dark:[&::-webkit-scrollbar-thumb]:bg-white/20 mint:[&::-webkit-scrollbar-thumb]:rounded mint:[&::-webkit-scrollbar-thumb:hover]:bg-black/30 mint:dark:[&::-webkit-scrollbar-thumb:hover]:bg-white/30 mint:space-y-6 mint:py-4"
|
|
179
188
|
),
|
|
180
189
|
children: [
|
|
181
|
-
|
|
182
|
-
const
|
|
183
|
-
if (!
|
|
184
|
-
const
|
|
185
|
-
return
|
|
190
|
+
x && x.length > 0 && /* @__PURE__ */ e("div", { id: "nav-anchors", className: "mint:shrink-0 mint:w-full mint:mb-3", children: /* @__PURE__ */ e("div", { className: "mint:flex mint:flex-col", children: x.map((t, f) => {
|
|
191
|
+
const d = t.icon, m = (l) => l ? l.startsWith("/") ? l : `/${l}` : "", h = (() => {
|
|
192
|
+
if (!s || !t.href) return !1;
|
|
193
|
+
const l = m(s), i = m(t.href), r = l.replace(/\/$/, ""), o = i.replace(/\/$/, "");
|
|
194
|
+
return r === o || r.startsWith(o + "/") ? x.filter((w) => {
|
|
186
195
|
if (!w.href) return !1;
|
|
187
|
-
const A =
|
|
188
|
-
return
|
|
189
|
-
}).reduce((w,
|
|
190
|
-
const A =
|
|
196
|
+
const A = m(w.href).replace(/\/$/, "");
|
|
197
|
+
return r === A || r.startsWith(A + "/");
|
|
198
|
+
}).reduce((w, y) => {
|
|
199
|
+
const A = m(w.href || "").replace(
|
|
191
200
|
/\/$/,
|
|
192
201
|
""
|
|
193
202
|
);
|
|
194
|
-
return
|
|
203
|
+
return m(y.href || "").replace(
|
|
195
204
|
/\/$/,
|
|
196
205
|
""
|
|
197
|
-
).length > A.length ?
|
|
198
|
-
},
|
|
206
|
+
).length > A.length ? y : w;
|
|
207
|
+
}, t) === t : !1;
|
|
199
208
|
})();
|
|
200
|
-
return /* @__PURE__ */
|
|
201
|
-
|
|
209
|
+
return /* @__PURE__ */ a(
|
|
210
|
+
c,
|
|
202
211
|
{
|
|
203
|
-
href:
|
|
204
|
-
"aria-current":
|
|
205
|
-
className:
|
|
212
|
+
href: t.href,
|
|
213
|
+
"aria-current": h ? "page" : void 0,
|
|
214
|
+
className: p(
|
|
206
215
|
"mint:group mint:relative mint:flex mint:items-start mint:gap-2 mint:py-2 mint:px-3 mint:text-sm mint:rounded-lg mint:no-underline mint:focus-visible:outline-2 mint:focus-visible:outline-[#643fb2] mint:focus-visible:outline-offset-2 mint:hover:text-[#141414] mint:dark:hover:text-[#e5e7eb]",
|
|
207
|
-
|
|
216
|
+
h ? "mint:text-[#141414] mint:dark:text-[#ffffff]" : "mint:text-[#424242] mint:dark:text-[#adadad]"
|
|
208
217
|
),
|
|
209
218
|
children: [
|
|
210
|
-
|
|
211
|
-
|
|
219
|
+
d && /* @__PURE__ */ e(
|
|
220
|
+
d,
|
|
212
221
|
{
|
|
213
|
-
className:
|
|
222
|
+
className: p(
|
|
214
223
|
"mint:w-5 mint:h-5 mint:shrink-0",
|
|
215
|
-
|
|
224
|
+
h ? "mint:text-[#8251ee] mint:dark:text-[#9263f1]" : "mint:text-[#6b7280] mint:dark:text-[#adadad] mint:group-hover:text-[#8251ee] mint:dark:group-hover:text-[#9263f1]"
|
|
216
225
|
)
|
|
217
226
|
}
|
|
218
227
|
),
|
|
219
|
-
/* @__PURE__ */
|
|
220
|
-
/* @__PURE__ */
|
|
228
|
+
/* @__PURE__ */ a("div", { className: "mint:flex mint:flex-col mint:gap-0.5 mint:min-w-0", children: [
|
|
229
|
+
/* @__PURE__ */ e(
|
|
221
230
|
"span",
|
|
222
231
|
{
|
|
223
|
-
className:
|
|
232
|
+
className: p(
|
|
224
233
|
"mint:font-medium",
|
|
225
|
-
|
|
234
|
+
h ? "mint:text-[#8251ee] mint:dark:text-[#9263f1] mint:font-semibold" : "mint:text-[#141414] mint:dark:text-[#ffffff] mint:group-hover:text-[#8251ee] mint:dark:group-hover:text-[#9263f1]"
|
|
226
235
|
),
|
|
227
|
-
children:
|
|
236
|
+
children: t.title
|
|
228
237
|
}
|
|
229
238
|
),
|
|
230
|
-
|
|
239
|
+
t.description && /* @__PURE__ */ e("span", { className: "mint:text-xs mint:text-[#6b7280] mint:dark:text-[#adadad] mint:leading-snug", children: t.description })
|
|
231
240
|
] })
|
|
232
241
|
]
|
|
233
242
|
},
|
|
234
|
-
|
|
243
|
+
f
|
|
235
244
|
);
|
|
236
245
|
}) }) }),
|
|
237
|
-
|
|
238
|
-
|
|
246
|
+
n.items.map((t, f) => /* @__PURE__ */ e(
|
|
247
|
+
E,
|
|
239
248
|
{
|
|
240
|
-
item:
|
|
249
|
+
item: t,
|
|
241
250
|
activeId: g,
|
|
242
|
-
activeHref:
|
|
251
|
+
activeHref: s
|
|
243
252
|
},
|
|
244
|
-
`${
|
|
253
|
+
`${t.href}-${f}`
|
|
245
254
|
))
|
|
246
255
|
]
|
|
247
256
|
}
|
|
248
257
|
),
|
|
249
|
-
v && v.length > 0 && /* @__PURE__ */
|
|
258
|
+
v && v.length > 0 && /* @__PURE__ */ a(
|
|
250
259
|
"div",
|
|
251
260
|
{
|
|
252
261
|
id: "nav-tree-bottom-links",
|
|
253
262
|
className: "mint:shrink-0 mint:w-full mint:bg-[#f0f0f0] mint:dark:bg-[#0f0f0f] mint:mt-auto",
|
|
254
263
|
children: [
|
|
255
|
-
/* @__PURE__ */
|
|
256
|
-
/* @__PURE__ */
|
|
257
|
-
var
|
|
258
|
-
const
|
|
259
|
-
return
|
|
260
|
-
...
|
|
261
|
-
className:
|
|
264
|
+
/* @__PURE__ */ e("div", { className: "mint:h-[0.5px] mint:w-full mint:bg-[#d1d1d1] mint:dark:bg-[#666666]" }),
|
|
265
|
+
/* @__PURE__ */ e("div", { className: "mint:flex mint:flex-col mint:py-3 mint:px-4", children: v.map((t, f) => {
|
|
266
|
+
var m;
|
|
267
|
+
const d = t.icon;
|
|
268
|
+
return t.component ? /* @__PURE__ */ e("div", { children: C.isValidElement(t.component) ? C.cloneElement(t.component, {
|
|
269
|
+
...t.component.props,
|
|
270
|
+
className: p(
|
|
262
271
|
"mint:flex mint:items-center mint:py-2 mint:gap-2 mint:text-sm mint:text-[#424242] mint:dark:text-[#adadad] mint:hover:text-[#141414] mint:dark:hover:text-[#e5e7eb] mint:px-2 mint:cursor-pointer",
|
|
263
|
-
(
|
|
272
|
+
(m = t.component.props) == null ? void 0 : m.className
|
|
264
273
|
),
|
|
265
|
-
children: /* @__PURE__ */
|
|
266
|
-
/* @__PURE__ */
|
|
267
|
-
/* @__PURE__ */
|
|
274
|
+
children: /* @__PURE__ */ a(I, { children: [
|
|
275
|
+
/* @__PURE__ */ e(d, { className: "mint:w-5 mint:h-5 mint:shrink-0" }),
|
|
276
|
+
/* @__PURE__ */ e("span", { children: t.label })
|
|
268
277
|
] })
|
|
269
|
-
}) : /* @__PURE__ */
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
/* @__PURE__ */
|
|
272
|
-
|
|
273
|
-
] }) },
|
|
274
|
-
|
|
278
|
+
}) : /* @__PURE__ */ a("div", { className: "mint:flex mint:items-center mint:py-2 mint:gap-2 mint:text-sm mint:text-[#424242] mint:dark:text-[#adadad] mint:hover:text-[#141414] mint:dark:hover:text-[#e5e7eb] mint:px-2 mint:cursor-pointer", children: [
|
|
279
|
+
/* @__PURE__ */ e(d, { className: "mint:w-5 mint:h-5 mint:shrink-0" }),
|
|
280
|
+
/* @__PURE__ */ e("span", { children: t.label }),
|
|
281
|
+
t.component
|
|
282
|
+
] }) }, f) : /* @__PURE__ */ a(
|
|
283
|
+
c,
|
|
275
284
|
{
|
|
276
|
-
href:
|
|
285
|
+
href: t.href,
|
|
277
286
|
target: "_blank",
|
|
278
287
|
rel: "noopener noreferrer",
|
|
279
288
|
className: "mint:flex mint:items-center mint:py-2 mint:gap-2 mint:text-sm mint:no-underline mint:text-[#424242] mint:dark:text-[#adadad] mint:hover:text-[#141414] mint:dark:hover:text-[#e5e7eb] mint:px-2 mint:[&>span]:flex mint:[&>span]:items-center mint:[&>span]:gap-2 mint:[&>svg:last-child]:hidden",
|
|
280
289
|
children: [
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
/* @__PURE__ */
|
|
290
|
+
/* @__PURE__ */ e(d, { className: "mint:w-5 mint:h-5 mint:shrink-0" }),
|
|
291
|
+
/* @__PURE__ */ e("span", { children: t.label })
|
|
283
292
|
]
|
|
284
293
|
},
|
|
285
|
-
|
|
294
|
+
f
|
|
286
295
|
);
|
|
287
296
|
}) })
|
|
288
297
|
]
|
|
@@ -293,6 +302,6 @@ function H({
|
|
|
293
302
|
);
|
|
294
303
|
}
|
|
295
304
|
export {
|
|
296
|
-
|
|
305
|
+
G as NavTree
|
|
297
306
|
};
|
|
298
307
|
//# sourceMappingURL=index.js.map
|