@mintlify/msft-sdk 1.1.33 → 1.1.35

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,68 +1,78 @@
1
- import { jsx as d, jsxs as S } from "react/jsx-runtime";
2
- import { useState as y, useRef as w, useEffect as B } from "react";
3
- import { cn as A } from "../../utils/cn.js";
4
- function j({ toc: i }) {
5
- const [x, c] = y(""), o = w(!1), t = w();
6
- return B(() => {
7
- var g;
1
+ import { jsx as w, jsxs as k } from "react/jsx-runtime";
2
+ import { useState as I, useRef as R, useEffect as L } from "react";
3
+ import { cn as z } from "../../utils/cn.js";
4
+ function $({ toc: i }) {
5
+ const [y, u] = I(""), l = R(!1), r = R();
6
+ return L(() => {
7
+ var c;
8
8
  if (i.length === 0) return;
9
- o.current = !1, t.current && clearTimeout(t.current);
10
- const n = window.location.hash.slice(1);
11
- n ? (c(n), o.current = !0, t.current = setTimeout(() => {
12
- o.current = !1;
13
- }, 1e3)) : c(((g = i[0]) == null ? void 0 : g.slug) || "");
14
- const m = () => {
15
- const r = window.location.hash.slice(1);
16
- r && (c(r), o.current = !0, t.current && clearTimeout(t.current), t.current = setTimeout(() => {
17
- o.current = !1;
9
+ l.current = !1, r.current && clearTimeout(r.current);
10
+ const t = window.location.hash.slice(1);
11
+ t ? (u(t), l.current = !0, r.current = setTimeout(() => {
12
+ l.current = !1;
13
+ }, 1e3)) : u(((c = i[0]) == null ? void 0 : c.slug) || "");
14
+ const f = () => {
15
+ const o = window.location.hash.slice(1);
16
+ o && (u(o), l.current = !0, r.current && clearTimeout(r.current), r.current = setTimeout(() => {
17
+ l.current = !1;
18
18
  }, 1e3));
19
- }, e = document.getElementById("main-content"), T = () => {
20
- var p, b;
21
- if (!e) return (p = i[0]) == null ? void 0 : p.slug;
22
- const r = window.getComputedStyle(document.documentElement), E = parseFloat(
23
- r.getPropertyValue("--scroll-mt") || "0"
24
- ), k = parseFloat(r.fontSize), R = E * k + 100, h = e.scrollTop, f = i.map((s) => {
25
- const v = document.getElementById(s.slug);
26
- if (!v) return null;
27
- const C = v.getBoundingClientRect(), I = e.getBoundingClientRect(), L = C.top - I.top + h;
28
- return { id: s.slug, top: L };
19
+ }, e = document.getElementById("main-content"), g = () => {
20
+ var x, E;
21
+ if (!e) return (x = i[0]) == null ? void 0 : x.slug;
22
+ const o = window.getComputedStyle(document.documentElement), p = parseFloat(o.getPropertyValue("--scroll-mt") || "0"), h = parseFloat(o.fontSize), b = p * h + 100, v = e.scrollTop, m = i.map((a) => {
23
+ const T = document.getElementById(a.slug);
24
+ if (!T) return null;
25
+ const C = T.getBoundingClientRect(), S = e.getBoundingClientRect(), B = C.top - S.top + v;
26
+ return { id: a.slug, top: B };
29
27
  }).filter(Boolean);
30
- if (f.length === 0) return (b = i[0]) == null ? void 0 : b.slug;
31
- let a = f[0];
32
- for (const s of f)
33
- h + R >= s.top && (a = s);
34
- return a == null ? void 0 : a.id;
35
- }, l = () => {
36
- if (o.current) return;
37
- const r = T();
38
- r && c(r);
28
+ if (m.length === 0) return (E = i[0]) == null ? void 0 : E.slug;
29
+ let d = m[0];
30
+ for (const a of m)
31
+ v + b >= a.top && (d = a);
32
+ return d == null ? void 0 : d.id;
33
+ }, n = () => {
34
+ if (l.current) return;
35
+ const o = g();
36
+ o && u(o);
39
37
  };
40
- window.addEventListener("hashchange", m), e ? e.addEventListener("scroll", l, {
38
+ window.addEventListener("hashchange", f), e ? e.addEventListener("scroll", n, {
41
39
  passive: !0
42
- }) : window.addEventListener("scroll", l, { passive: !0 });
43
- let u;
44
- return n || (u = setTimeout(l, 100)), () => {
45
- u && clearTimeout(u), t.current && clearTimeout(t.current), window.removeEventListener("hashchange", m), e ? e.removeEventListener("scroll", l) : window.removeEventListener("scroll", l);
40
+ }) : window.addEventListener("scroll", n, { passive: !0 });
41
+ let s;
42
+ return t || (s = setTimeout(n, 100)), () => {
43
+ s && clearTimeout(s), r.current && clearTimeout(r.current), window.removeEventListener("hashchange", f), e ? e.removeEventListener("scroll", n) : window.removeEventListener("scroll", n);
46
44
  };
47
- }, [i]), /* @__PURE__ */ d("ul", { className: "mint:list-none mint:flex mint:flex-col mint:gap-2 mint:text-sm mint:text-[#6b7280] mint:dark:text-[#9ca3af] mint:font-medium mint:relative mint:pl-[0.15rem] mint:before:content-[''] mint:before:absolute mint:before:left-[0.15rem] mint:before:top-0 mint:before:bottom-0 mint:before:w-[3px] mint:before:bg-[#f2f3f3] mint:dark:before:bg-[#222223] mint:before:rounded-full", children: i.map((n, m) => {
48
- const e = x === n.slug;
49
- return /* @__PURE__ */ S("li", { className: "mint:relative", children: [
50
- e && /* @__PURE__ */ d("div", { className: "mint:absolute mint:left-0 mint:top-0 mint:bottom-0 mint:w-[3px] mint:rounded-full mint:bg-[#643fb2] mint:dark:bg-[#c9aaf9] mint:z-1" }),
51
- /* @__PURE__ */ d(
45
+ }, [i]), /* @__PURE__ */ w("ul", { className: "mint:list-none mint:flex mint:flex-col mint:gap-2 mint:text-sm mint:text-[#6b7280] mint:dark:text-[#9ca3af] mint:font-medium mint:relative mint:pl-[0.15rem] mint:before:content-[''] mint:before:absolute mint:before:left-[0.15rem] mint:before:top-0 mint:before:bottom-0 mint:before:w-[3px] mint:before:bg-[#f2f3f3] mint:dark:before:bg-[#222223] mint:before:rounded-full", children: i.map((t, f) => {
46
+ const e = y === t.slug;
47
+ return /* @__PURE__ */ k("li", { className: "mint:relative", children: [
48
+ e && /* @__PURE__ */ w("div", { className: "mint:absolute mint:left-0 mint:top-0 mint:bottom-0 mint:w-[3px] mint:rounded-full mint:bg-[#643fb2] mint:dark:bg-[#c9aaf9] mint:z-1" }),
49
+ /* @__PURE__ */ w(
52
50
  "a",
53
51
  {
54
- href: `#${n.slug}`,
55
- className: A(
52
+ href: `#${t.slug}`,
53
+ onClick: (g) => {
54
+ g.preventDefault();
55
+ const n = document.getElementById("main-content"), s = document.getElementById(t.slug);
56
+ if (n && s) {
57
+ const c = window.getComputedStyle(document.documentElement), o = parseFloat(c.getPropertyValue("--scroll-mt") || "0"), p = parseFloat(c.fontSize), h = o * p, b = n.getBoundingClientRect(), m = s.getBoundingClientRect().top - b.top + n.scrollTop - h;
58
+ n.scrollTo({
59
+ top: m,
60
+ behavior: "instant"
61
+ });
62
+ }
63
+ history.replaceState(null, "", `#${t.slug}`);
64
+ },
65
+ className: z(
56
66
  "mint:block mint:pl-6 mint:leading-relaxed mint:no-underline",
57
67
  e ? "mint:text-[#643fb2] mint:dark:text-[#c9aaf9] mint:font-semibold" : "mint:text-[#424242] mint:dark:text-[#d6d6d6] mint:dark:hover:text-[#d1d5db] mint:hover:text-[#111827]"
58
68
  ),
59
- children: n.title
69
+ children: t.title
60
70
  }
61
71
  )
62
- ] }, `${n.slug}-${m}`);
72
+ ] }, `${t.slug}-${f}`);
63
73
  }) });
64
74
  }
65
75
  export {
66
- j as TableOfContents
76
+ $ as TableOfContents
67
77
  };
68
78
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/toc/index.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\nimport type { TocItem } from \"../../types\";\nimport { cn } from \"../../utils/cn\";\n\ninterface TableOfContentsProps {\n toc: TocItem[];\n}\n\nexport function TableOfContents({ toc }: TableOfContentsProps) {\n const [activeId, setActiveId] = useState(\"\");\n const ignoreScrollRef = useRef(false);\n const ignoreTimeoutRef = useRef<NodeJS.Timeout>();\n\n useEffect(() => {\n if (toc.length === 0) return;\n\n ignoreScrollRef.current = false;\n if (ignoreTimeoutRef.current) {\n clearTimeout(ignoreTimeoutRef.current);\n }\n\n const hash = window.location.hash.slice(1);\n if (hash) {\n setActiveId(hash);\n ignoreScrollRef.current = true;\n ignoreTimeoutRef.current = setTimeout(() => {\n ignoreScrollRef.current = false;\n }, 1000);\n } else {\n setActiveId(toc[0]?.slug || \"\");\n }\n\n const handleHashChange = () => {\n const hash = window.location.hash.slice(1);\n if (hash) {\n setActiveId(hash);\n ignoreScrollRef.current = true;\n if (ignoreTimeoutRef.current) {\n clearTimeout(ignoreTimeoutRef.current);\n }\n ignoreTimeoutRef.current = setTimeout(() => {\n ignoreScrollRef.current = false;\n }, 1000);\n }\n };\n\n const scrollContainer = document.getElementById(\"main-content\");\n\n const getActiveHeading = () => {\n if (!scrollContainer) return toc[0]?.slug;\n\n const style = window.getComputedStyle(document.documentElement);\n const scrollMtRem = parseFloat(\n style.getPropertyValue(\"--scroll-mt\") || \"0\"\n );\n const fontSize = parseFloat(style.fontSize);\n const scrollOffset = scrollMtRem * fontSize + 100;\n\n const scrollY = scrollContainer.scrollTop;\n\n const headingPositions = toc\n .map((item) => {\n const element = document.getElementById(item.slug);\n if (!element) return null;\n\n const rect = element.getBoundingClientRect();\n const containerRect = scrollContainer.getBoundingClientRect();\n const relativeTop = rect.top - containerRect.top + scrollY;\n\n return { id: item.slug, top: relativeTop };\n })\n .filter(Boolean) as Array<{ id: string; top: number }>;\n\n if (headingPositions.length === 0) return toc[0]?.slug;\n\n let currentHeading = headingPositions[0];\n for (const heading of headingPositions) {\n if (scrollY + scrollOffset >= heading.top) {\n currentHeading = heading;\n }\n }\n\n return currentHeading?.id;\n };\n\n const handleScroll = () => {\n if (ignoreScrollRef.current) return;\n\n const newActiveId = getActiveHeading();\n if (newActiveId) {\n setActiveId(newActiveId);\n }\n };\n\n window.addEventListener(\"hashchange\", handleHashChange);\n\n if (scrollContainer) {\n scrollContainer.addEventListener(\"scroll\", handleScroll, {\n passive: true,\n });\n } else {\n window.addEventListener(\"scroll\", handleScroll, { passive: true });\n }\n\n let timeoutId: NodeJS.Timeout | undefined;\n if (!hash) {\n timeoutId = setTimeout(handleScroll, 100);\n }\n\n return () => {\n if (timeoutId) clearTimeout(timeoutId);\n if (ignoreTimeoutRef.current) clearTimeout(ignoreTimeoutRef.current);\n window.removeEventListener(\"hashchange\", handleHashChange);\n if (scrollContainer) {\n scrollContainer.removeEventListener(\"scroll\", handleScroll);\n } else {\n window.removeEventListener(\"scroll\", handleScroll);\n }\n };\n }, [toc]);\n\n return (\n <ul className=\"mint:list-none mint:flex mint:flex-col mint:gap-2 mint:text-sm mint:text-[#6b7280] mint:dark:text-[#9ca3af] mint:font-medium mint:relative mint:pl-[0.15rem] mint:before:content-[''] mint:before:absolute mint:before:left-[0.15rem] mint:before:top-0 mint:before:bottom-0 mint:before:w-[3px] mint:before:bg-[#f2f3f3] mint:dark:before:bg-[#222223] mint:before:rounded-full\">\n {toc.map((item, index) => {\n const isActive = activeId === item.slug;\n return (\n <li key={`${item.slug}-${index}`} className=\"mint:relative\">\n {isActive && (\n <div className=\"mint:absolute mint:left-0 mint:top-0 mint:bottom-0 mint:w-[3px] mint:rounded-full mint:bg-[#643fb2] mint:dark:bg-[#c9aaf9] mint:z-1\" />\n )}\n <a\n href={`#${item.slug}`}\n className={cn(\n \"mint:block mint:pl-6 mint:leading-relaxed mint:no-underline\",\n isActive\n ? \"mint:text-[#643fb2] mint:dark:text-[#c9aaf9] mint:font-semibold\"\n : \"mint:text-[#424242] mint:dark:text-[#d6d6d6] mint:dark:hover:text-[#d1d5db] mint:hover:text-[#111827]\"\n )}\n >\n {item.title}\n </a>\n </li>\n );\n })}\n </ul>\n );\n}\n"],"names":["TableOfContents","toc","activeId","setActiveId","useState","ignoreScrollRef","useRef","ignoreTimeoutRef","useEffect","hash","_a","handleHashChange","scrollContainer","getActiveHeading","style","scrollMtRem","fontSize","scrollOffset","scrollY","headingPositions","item","element","rect","containerRect","relativeTop","_b","currentHeading","heading","handleScroll","newActiveId","timeoutId","jsx","index","isActive","jsxs","cn"],"mappings":";;;AAQO,SAASA,EAAgB,EAAE,KAAAC,KAA6B;AAC7D,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS,EAAE,GACrCC,IAAkBC,EAAO,EAAK,GAC9BC,IAAmBD,EAAA;AAEzB,SAAAE,EAAU,MAAM;;AACd,QAAIP,EAAI,WAAW,EAAG;AAEtB,IAAAI,EAAgB,UAAU,IACtBE,EAAiB,WACn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AdO,GAAGA,EAAK,IAAI,IAAIY,CAAK,EAe9B;AAAA,EAEJ,CAAC,EAAA,CACH;AAEJ;"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/toc/index.tsx"],"sourcesContent":["import { useEffect, useRef, useState } from 'react';\n\nimport type { TocItem } from '../../types';\nimport { cn } from '../../utils/cn';\n\ninterface TableOfContentsProps {\n toc: TocItem[];\n}\n\nexport function TableOfContents({ toc }: TableOfContentsProps) {\n const [activeId, setActiveId] = useState('');\n const ignoreScrollRef = useRef(false);\n const ignoreTimeoutRef = useRef<NodeJS.Timeout>();\n\n useEffect(() => {\n if (toc.length === 0) return;\n\n ignoreScrollRef.current = false;\n if (ignoreTimeoutRef.current) {\n clearTimeout(ignoreTimeoutRef.current);\n }\n\n const hash = window.location.hash.slice(1);\n if (hash) {\n setActiveId(hash);\n ignoreScrollRef.current = true;\n ignoreTimeoutRef.current = setTimeout(() => {\n ignoreScrollRef.current = false;\n }, 1000);\n } else {\n setActiveId(toc[0]?.slug || '');\n }\n\n const handleHashChange = () => {\n const hash = window.location.hash.slice(1);\n if (hash) {\n setActiveId(hash);\n ignoreScrollRef.current = true;\n if (ignoreTimeoutRef.current) {\n clearTimeout(ignoreTimeoutRef.current);\n }\n ignoreTimeoutRef.current = setTimeout(() => {\n ignoreScrollRef.current = false;\n }, 1000);\n }\n };\n\n const scrollContainer = document.getElementById('main-content');\n\n const getActiveHeading = () => {\n if (!scrollContainer) return toc[0]?.slug;\n\n const style = window.getComputedStyle(document.documentElement);\n const scrollMtRem = parseFloat(style.getPropertyValue('--scroll-mt') || '0');\n const fontSize = parseFloat(style.fontSize);\n const scrollOffset = scrollMtRem * fontSize + 100;\n\n const scrollY = scrollContainer.scrollTop;\n\n const headingPositions = toc\n .map((item) => {\n const element = document.getElementById(item.slug);\n if (!element) return null;\n\n const rect = element.getBoundingClientRect();\n const containerRect = scrollContainer.getBoundingClientRect();\n const relativeTop = rect.top - containerRect.top + scrollY;\n\n return { id: item.slug, top: relativeTop };\n })\n .filter(Boolean) as Array<{ id: string; top: number }>;\n\n if (headingPositions.length === 0) return toc[0]?.slug;\n\n let currentHeading = headingPositions[0];\n for (const heading of headingPositions) {\n if (scrollY + scrollOffset >= heading.top) {\n currentHeading = heading;\n }\n }\n\n return currentHeading?.id;\n };\n\n const handleScroll = () => {\n if (ignoreScrollRef.current) return;\n\n const newActiveId = getActiveHeading();\n if (newActiveId) {\n setActiveId(newActiveId);\n }\n };\n\n window.addEventListener('hashchange', handleHashChange);\n\n if (scrollContainer) {\n scrollContainer.addEventListener('scroll', handleScroll, {\n passive: true,\n });\n } else {\n window.addEventListener('scroll', handleScroll, { passive: true });\n }\n\n let timeoutId: NodeJS.Timeout | undefined;\n if (!hash) {\n timeoutId = setTimeout(handleScroll, 100);\n }\n\n return () => {\n if (timeoutId) clearTimeout(timeoutId);\n if (ignoreTimeoutRef.current) clearTimeout(ignoreTimeoutRef.current);\n window.removeEventListener('hashchange', handleHashChange);\n if (scrollContainer) {\n scrollContainer.removeEventListener('scroll', handleScroll);\n } else {\n window.removeEventListener('scroll', handleScroll);\n }\n };\n }, [toc]);\n\n return (\n <ul className=\"mint:list-none mint:flex mint:flex-col mint:gap-2 mint:text-sm mint:text-[#6b7280] mint:dark:text-[#9ca3af] mint:font-medium mint:relative mint:pl-[0.15rem] mint:before:content-[''] mint:before:absolute mint:before:left-[0.15rem] mint:before:top-0 mint:before:bottom-0 mint:before:w-[3px] mint:before:bg-[#f2f3f3] mint:dark:before:bg-[#222223] mint:before:rounded-full\">\n {toc.map((item, index) => {\n const isActive = activeId === item.slug;\n return (\n <li key={`${item.slug}-${index}`} className=\"mint:relative\">\n {isActive && (\n <div className=\"mint:absolute mint:left-0 mint:top-0 mint:bottom-0 mint:w-[3px] mint:rounded-full mint:bg-[#643fb2] mint:dark:bg-[#c9aaf9] mint:z-1\" />\n )}\n <a\n href={`#${item.slug}`}\n onClick={(e) => {\n e.preventDefault();\n const scrollContainer = document.getElementById('main-content');\n const targetElement = document.getElementById(item.slug);\n\n if (scrollContainer && targetElement) {\n const style = window.getComputedStyle(document.documentElement);\n const scrollMtRem = parseFloat(style.getPropertyValue('--scroll-mt') || '0');\n const fontSize = parseFloat(style.fontSize);\n const scrollOffset = scrollMtRem * fontSize;\n\n const containerRect = scrollContainer.getBoundingClientRect();\n const targetRect = targetElement.getBoundingClientRect();\n const relativeTop =\n targetRect.top - containerRect.top + scrollContainer.scrollTop - scrollOffset;\n\n scrollContainer.scrollTo({\n top: relativeTop,\n behavior: 'instant',\n });\n }\n\n history.replaceState(null, '', `#${item.slug}`);\n }}\n className={cn(\n 'mint:block mint:pl-6 mint:leading-relaxed mint:no-underline',\n isActive\n ? 'mint:text-[#643fb2] mint:dark:text-[#c9aaf9] mint:font-semibold'\n : 'mint:text-[#424242] mint:dark:text-[#d6d6d6] mint:dark:hover:text-[#d1d5db] mint:hover:text-[#111827]'\n )}\n >\n {item.title}\n </a>\n </li>\n );\n })}\n </ul>\n );\n}\n"],"names":["TableOfContents","toc","activeId","setActiveId","useState","ignoreScrollRef","useRef","ignoreTimeoutRef","useEffect","hash","_a","handleHashChange","scrollContainer","getActiveHeading","style","scrollMtRem","fontSize","scrollOffset","scrollY","headingPositions","item","element","rect","containerRect","relativeTop","_b","currentHeading","heading","handleScroll","newActiveId","timeoutId","jsx","index","isActive","jsxs","e","targetElement","cn"],"mappings":";;;AASO,SAASA,EAAgB,EAAE,KAAAC,KAA6B;AAC7D,QAAM,CAACC,GAAUC,CAAW,IAAIC,EAAS,EAAE,GACrCC,IAAkBC,EAAO,EAAK,GAC9BC,IAAmBD,EAAA;AAEzB,SAAAE,EAAU,MAAM;;AACd,QAAIP,EAAI,WAAW,EAAG;AAEtB,IAAAI,EAAgB,UAAU,IACtBE,EAAiB,WACnB,aAAaA,EAAiB,OAAO;AAGvC,UAAME,IAAO,OAAO,SAAS,KAAK,MAAM,CAAC;AACzC,IAAIA,KACFN,EAAYM,CAAI,GAChBJ,EAAgB,UAAU,IAC1BE,E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,WAAWF,EAAM,QAAQ,GACpCG,IAAeF,IAAcC,GAE7BO,IAAgBX,EAAgB,sBAAA,GAEhCY,IADaY,EAAc,sBAAA,EAEpB,MAAMb,EAAc,MAAMX,EAAgB,YAAYK;AAEnE,cAAAL,EAAgB,SAAS;AAAA,gBACvB,KAAKY;AAAA,gBACL,UAAU;AAAA,cAAA,CACX;AAAA,YACH;AAEA,oBAAQ,aAAa,MAAM,IAAI,IAAIJ,EAAK,IAAI,EAAE;AAAA,UAChD;AAAA,UACA,WAAWiB;AAAA,YACT;AAAA,YACAJ,IACI,oEACA;AAAA,UAAA;AAAA,UAGL,UAAAb,EAAK;AAAA,QAAA;AAAA,MAAA;AAAA,IACR,EAAA,GAtCO,GAAGA,EAAK,IAAI,IAAIY,CAAK,EAuC9B;AAAA,EAEJ,CAAC,EAAA,CACH;AAEJ;"}
package/dist/index.d.ts CHANGED
@@ -59,7 +59,7 @@ export declare const addApiReferenceDataFromMdxAndDocsConfig: ({ pageMetadata, a
59
59
 
60
60
  export declare const allComponents: {
61
61
  CodeBlock: typeof CodeBlock;
62
- Heading: ({ id, level, children, className, }: HeadingProps) => JSX_2.Element;
62
+ Heading: ({ id, level, children, className }: HeadingProps) => JSX_2.Element;
63
63
  Link: typeof Link;
64
64
  Callout: typeof Callout;
65
65
  ZonePivot: typeof ZonePivot;
@@ -537,7 +537,7 @@ export declare function getPageMarkdown(pathname: string): Promise<string>;
537
537
 
538
538
  export declare function getTextContent(node: Element_2 | Text_2): string;
539
539
 
540
- export declare const Heading: ({ id, level, children, className, }: HeadingProps) => JSX_2.Element;
540
+ export declare const Heading: ({ id, level, children, className }: HeadingProps) => JSX_2.Element;
541
541
 
542
542
  declare interface HeadingProps {
543
543
  id: string;
@@ -658,7 +658,7 @@ export declare interface NavItem {
658
658
  method?: string;
659
659
  }
660
660
 
661
- export declare function NavTree({ navTree, activeId, className, activeHref, theme, bottomLinks, anchors, styling, }: NavTreeProps): JSX_2.Element | null;
661
+ export declare function NavTree({ navTree, activeId, className, activeHref, theme, bottomLinks, anchors, }: NavTreeProps): JSX_2.Element | null;
662
662
 
663
663
  export declare interface NavTreeData {
664
664
  items: NavItem[];
@@ -672,9 +672,6 @@ declare interface NavTreeProps {
672
672
  theme?: 'light' | 'dark' | 'system';
673
673
  bottomLinks?: BottomLinkConfig[];
674
674
  anchors?: AnchorConfig[];
675
- styling?: {
676
- navTreeContentClassName?: string;
677
- };
678
675
  }
679
676
 
680
677
  export declare const OperationPage: ({ apiReferenceData, operation, children, }: {