@mintlify/msft-sdk 1.1.11 → 1.1.12
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/code-block.js +2 -2
- package/dist/components/content-components/code-block.js.map +1 -1
- package/dist/components/content-components/home.js +3 -278
- package/dist/components/content-components/home.js.map +1 -1
- package/dist/components/content-components/zone-pivots/zone-pivot-selector.js +22 -19
- package/dist/components/content-components/zone-pivots/zone-pivot-selector.js.map +1 -1
- package/dist/components/docsLayout.js +60 -0
- package/dist/components/docsLayout.js.map +1 -0
- package/dist/components/docsPage.js +128 -0
- package/dist/components/docsPage.js.map +1 -0
- package/dist/components/nav-tree/index.js +119 -96
- package/dist/components/nav-tree/index.js.map +1 -1
- package/dist/components/page-context-menu.js +47 -53
- package/dist/components/page-context-menu.js.map +1 -1
- package/dist/components/toc/index.js +6 -6
- package/dist/components/toc/index.js.map +1 -1
- package/dist/index.d.ts +180 -2
- package/dist/index.js +114 -112
- package/dist/index.js.map +1 -1
- package/dist/parser/serialize-mdx.js +27 -22
- package/dist/parser/serialize-mdx.js.map +1 -1
- package/dist/plugins/extract-headings.js +23 -17
- package/dist/plugins/extract-headings.js.map +1 -1
- package/dist/plugins/remark/remark-heading-ids.js +21 -14
- package/dist/plugins/remark/remark-heading-ids.js.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
- package/dist/components/page.js +0 -118
- package/dist/components/page.js.map +0 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { jsx as i, jsxs as u } from "react/jsx-runtime";
|
|
2
|
+
import { NavTree as b } from "./nav-tree/index.js";
|
|
3
|
+
import { ComponentsProvider as p } from "../context/components-context.js";
|
|
4
|
+
import { cn as l } from "../utils/cn.js";
|
|
5
|
+
/* empty css */
|
|
6
|
+
const y = ({
|
|
7
|
+
navTree: t,
|
|
8
|
+
children: m,
|
|
9
|
+
activeHref: e,
|
|
10
|
+
activeId: r,
|
|
11
|
+
theme: a = "light",
|
|
12
|
+
className: o = "",
|
|
13
|
+
bottomLinks: d,
|
|
14
|
+
LinkComponent: f,
|
|
15
|
+
localization: s,
|
|
16
|
+
telemetry: v,
|
|
17
|
+
showSidebar: c = !0,
|
|
18
|
+
sidebarClassName: h
|
|
19
|
+
}) => {
|
|
20
|
+
const n = a === "dark" ? "dark" : "light", x = { ...{
|
|
21
|
+
sidebarAriaLabel: "Sidebar navigation"
|
|
22
|
+
}, ...s };
|
|
23
|
+
return /* @__PURE__ */ i(p, { LinkComponent: f, children: /* @__PURE__ */ i(
|
|
24
|
+
"div",
|
|
25
|
+
{
|
|
26
|
+
className: l(
|
|
27
|
+
"mint:flex mint:min-h-0 mint:flex-1",
|
|
28
|
+
n === "dark" && "dark",
|
|
29
|
+
o
|
|
30
|
+
),
|
|
31
|
+
children: /* @__PURE__ */ u("div", { className: "mint:isolate mint:flex mint:flex-row mint:flex-nowrap mint:w-full mint:h-full mint:overflow-hidden mint:bg-[#f0f0f0] mint:dark:bg-[#0f0f0f]", children: [
|
|
32
|
+
c && t && /* @__PURE__ */ i(
|
|
33
|
+
"aside",
|
|
34
|
+
{
|
|
35
|
+
"aria-label": x.sidebarAriaLabel,
|
|
36
|
+
className: l(
|
|
37
|
+
"mint:flex mint:flex-col mint:shrink-0 mint:w-58 mint:h-full mint:[&_ul]:pl-2",
|
|
38
|
+
h ?? "mint:max-lg:hidden"
|
|
39
|
+
),
|
|
40
|
+
children: /* @__PURE__ */ i(
|
|
41
|
+
b,
|
|
42
|
+
{
|
|
43
|
+
navTree: t,
|
|
44
|
+
activeId: r ?? e,
|
|
45
|
+
activeHref: e,
|
|
46
|
+
theme: n,
|
|
47
|
+
bottomLinks: d
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ i("div", { className: "mint:flex mint:flex-1 mint:flex-col mint:min-w-0 mint:h-full mint:overflow-hidden mint:rounded-tl-[var(--borderRadiusXXLarge,1.5rem)]", children: m })
|
|
53
|
+
] })
|
|
54
|
+
}
|
|
55
|
+
) });
|
|
56
|
+
};
|
|
57
|
+
export {
|
|
58
|
+
y as DocsLayout
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=docsLayout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docsLayout.js","sources":["../../src/components/docsLayout.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport type { NavTreeData } from \"../types\";\nimport type { BottomLinkConfig } from \"./nav-tree\";\nimport type { LinkComponent } from \"../types\";\nimport { NavTree } from \"./nav-tree\";\nimport { ComponentsProvider } from \"../context/components-context\";\nimport { cn } from \"../utils/cn\";\nimport \"../styles.css\";\n\n/**\n * Localization strings for DocsLayout\n */\nexport interface DocsLayoutLocalization {\n /** Aria label for the sidebar navigation. Default: \"Sidebar navigation\" */\n sidebarAriaLabel?: string;\n}\n\n/**\n * Telemetry configuration for DocsLayout\n */\nexport interface DocsLayoutTelemetry {\n /** Activity name for bottom link clicks */\n bottomLinkActivity?: string;\n /** Phase for bottom link clicks (e.g., \"Start\", \"Complete\") */\n bottomLinkPhase?: string;\n}\n\n/**\n * Props for the DocsLayout component\n */\nexport interface DocsLayoutProps {\n /** Navigation tree data structure */\n navTree: NavTreeData;\n\n /** The main content to render in the layout */\n children: ReactNode;\n\n /** Currently active href for navigation highlighting */\n activeHref?: string;\n\n /** Currently active ID for navigation highlighting */\n activeId?: string;\n\n /** Theme for the layout */\n theme?: \"light\" | \"dark\";\n\n /** Additional CSS classes for the outer container */\n className?: string;\n\n /** Bottom links configuration (e.g., blog, GitHub, feedback) */\n bottomLinks?: BottomLinkConfig[];\n\n /** Custom Link component for navigation (e.g., React Router Link, Next.js Link) */\n LinkComponent?: LinkComponent;\n\n /** Localization strings */\n localization?: DocsLayoutLocalization;\n\n /** Telemetry configuration */\n telemetry?: DocsLayoutTelemetry;\n\n /** Whether to show the sidebar. Default: true */\n showSidebar?: boolean;\n\n /** Custom className for the sidebar to control responsive behavior.\n * Default: \"mint:max-lg:hidden\" (hidden below lg breakpoint) */\n sidebarClassName?: string;\n}\n\n/**\n * DocsLayout component provides a complete documentation layout with sidebar navigation\n * and main content area. It's designed to be scalable, customizable, and tree-shakable.\n *\n * @example\n * ```tsx\n * <DocsLayout\n * navTree={{ items: [...] }}\n * activeHref=\"/docs/getting-started\"\n * theme=\"dark\"\n * bottomLinks={[\n * { href: \"https://blog.com\", label: \"Blog\", icon: BlogIcon }\n * ]}\n * LinkComponent={Link}\n * >\n * <YourPageContent />\n * </DocsLayout>\n * ```\n */\nexport const DocsLayout = ({\n navTree,\n children,\n activeHref,\n activeId,\n theme = \"light\",\n className = \"\",\n bottomLinks,\n LinkComponent,\n localization,\n telemetry,\n showSidebar = true,\n sidebarClassName,\n}: DocsLayoutProps) => {\n const resolvedTheme = theme === \"dark\" ? \"dark\" : \"light\";\n\n // Default localization\n const defaultLocalization: Required<DocsLayoutLocalization> = {\n sidebarAriaLabel: \"Sidebar navigation\",\n };\n\n const loc = { ...defaultLocalization, ...localization };\n\n return (\n <ComponentsProvider LinkComponent={LinkComponent}>\n <div\n className={cn(\n \"mint:flex mint:min-h-0 mint:flex-1\",\n resolvedTheme === \"dark\" && \"dark\",\n className\n )}\n >\n <div className=\"mint:isolate mint:flex mint:flex-row mint:flex-nowrap mint:w-full mint:h-full mint:overflow-hidden mint:bg-[#f0f0f0] mint:dark:bg-[#0f0f0f]\">\n {showSidebar && navTree && (\n <aside\n aria-label={loc.sidebarAriaLabel}\n className={cn(\n \"mint:flex mint:flex-col mint:shrink-0 mint:w-58 mint:h-full mint:[&_ul]:pl-2\",\n sidebarClassName ?? \"mint:max-lg:hidden\"\n )}\n >\n <NavTree\n navTree={navTree}\n activeId={activeId ?? activeHref}\n activeHref={activeHref}\n theme={resolvedTheme}\n bottomLinks={bottomLinks}\n />\n </aside>\n )}\n\n <div className=\"mint:flex mint:flex-1 mint:flex-col mint:min-w-0 mint:h-full mint:overflow-hidden mint:rounded-tl-[var(--borderRadiusXXLarge,1.5rem)]\">\n {children}\n </div>\n </div>\n </div>\n </ComponentsProvider>\n );\n};\n"],"names":["DocsLayout","navTree","children","activeHref","activeId","theme","className","bottomLinks","LinkComponent","localization","telemetry","showSidebar","sidebarClassName","resolvedTheme","loc","jsx","ComponentsProvider","cn","jsxs","NavTree"],"mappings":";;;;;AAwFO,MAAMA,IAAa,CAAC;AAAA,EACzB,SAAAC;AAAA,EACA,UAAAC;AAAA,EACA,YAAAC;AAAA,EACA,UAAAC;AAAA,EACA,OAAAC,IAAQ;AAAA,EACR,WAAAC,IAAY;AAAA,EACZ,aAAAC;AAAA,EACA,eAAAC;AAAA,EACA,cAAAC;AAAA,EACA,WAAAC;AAAA,EACA,aAAAC,IAAc;AAAA,EACd,kBAAAC;AACF,MAAuB;AACrB,QAAMC,IAAgBR,MAAU,SAAS,SAAS,SAO5CS,IAAM,EAAE,GAJgD;AAAA,IAC5D,kBAAkB;AAAA,EAAA,GAGkB,GAAGL,EAAA;AAEzC,SACE,gBAAAM,EAACC,KAAmB,eAAAR,GAClB,UAAA,gBAAAO;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAWE;AAAA,QACT;AAAA,QACAJ,MAAkB,UAAU;AAAA,QAC5BP;AAAA,MAAA;AAAA,MAGF,UAAA,gBAAAY,EAAC,OAAA,EAAI,WAAU,+IACZ,UAAA;AAAA,QAAAP,KAAeV,KACd,gBAAAc;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,cAAYD,EAAI;AAAA,YAChB,WAAWG;AAAA,cACT;AAAA,cACAL,KAAoB;AAAA,YAAA;AAAA,YAGtB,UAAA,gBAAAG;AAAA,cAACI;AAAA,cAAA;AAAA,gBACC,SAAAlB;AAAA,gBACA,UAAUG,KAAYD;AAAA,gBACtB,YAAAA;AAAA,gBACA,OAAOU;AAAA,gBACP,aAAAN;AAAA,cAAA;AAAA,YAAA;AAAA,UACF;AAAA,QAAA;AAAA,QAIJ,gBAAAQ,EAAC,OAAA,EAAI,WAAU,yIACZ,UAAAb,EAAA,CACH;AAAA,MAAA,EAAA,CACF;AAAA,IAAA;AAAA,EAAA,GAEJ;AAEJ;"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { jsx as t, jsxs as e } from "react/jsx-runtime";
|
|
2
|
+
import { MDXRenderer as N } from "./mdx-renderer.js";
|
|
3
|
+
import { TableOfContents as P } from "./toc/index.js";
|
|
4
|
+
import { PivotAwareTOC as T } from "./toc/pivot-aware-toc.js";
|
|
5
|
+
import { TextAlignLeftFilled as C } from "@fluentui/react-icons";
|
|
6
|
+
import { PageContextMenu as z } from "./page-context-menu.js";
|
|
7
|
+
import { ComponentsProvider as L } from "../context/components-context.js";
|
|
8
|
+
import { cn as o } from "../utils/cn.js";
|
|
9
|
+
/* empty css */
|
|
10
|
+
import { ZonePivotProvider as j } from "./content-components/zone-pivots/zone-pivot-context.js";
|
|
11
|
+
import { ZonePivotSelector as F } from "./content-components/zone-pivots/zone-pivot-selector.js";
|
|
12
|
+
function B({
|
|
13
|
+
payload: i,
|
|
14
|
+
toc: m,
|
|
15
|
+
navTree: O,
|
|
16
|
+
activeHref: E,
|
|
17
|
+
theme: f,
|
|
18
|
+
className: h = "",
|
|
19
|
+
pathname: a,
|
|
20
|
+
markdownContent: b,
|
|
21
|
+
allPages: x,
|
|
22
|
+
baseUrl: g,
|
|
23
|
+
bottomLinks: y,
|
|
24
|
+
LinkComponent: w,
|
|
25
|
+
localization: p,
|
|
26
|
+
telemetry: A,
|
|
27
|
+
contextMenu: n
|
|
28
|
+
}) {
|
|
29
|
+
var s, d;
|
|
30
|
+
const v = i.serializedContent, r = ((s = i.mdxExtracts) == null ? void 0 : s.zonePivotGroups) || [], l = (d = i.mdxExtracts) == null ? void 0 : d.pivotTocItems, k = !i.title, u = { ...{
|
|
31
|
+
onThisPage: "On this page",
|
|
32
|
+
loading: "Loading...",
|
|
33
|
+
errorTitle: "Error",
|
|
34
|
+
errorMessage: "Something went wrong",
|
|
35
|
+
notFoundTitle: "Page not found",
|
|
36
|
+
notFoundMessage: "The page you're looking for doesn't exist"
|
|
37
|
+
}, ...p };
|
|
38
|
+
return /* @__PURE__ */ t(L, { LinkComponent: w, children: /* @__PURE__ */ t(
|
|
39
|
+
"div",
|
|
40
|
+
{
|
|
41
|
+
className: o(
|
|
42
|
+
f === "dark" && "dark",
|
|
43
|
+
h,
|
|
44
|
+
"mint:flex mint:flex-col mint:flex-1 mint:min-h-0 mint:h-full mint:overflow-hidden"
|
|
45
|
+
),
|
|
46
|
+
children: /* @__PURE__ */ t(
|
|
47
|
+
"div",
|
|
48
|
+
{
|
|
49
|
+
id: "page-container",
|
|
50
|
+
className: "mint:bg-[#f0f0f0] mint:dark:bg-[#0f0f0f] mint:flex-1 mint:min-h-0 mint:h-full mint:flex mint:flex-col mint:overflow-hidden",
|
|
51
|
+
children: /* @__PURE__ */ t(
|
|
52
|
+
"div",
|
|
53
|
+
{
|
|
54
|
+
id: "page-wrapper",
|
|
55
|
+
className: "mint:flex mint:rounded-tl-2xl mint:flex-1 mint:min-h-0 mint:h-full mint:overflow-hidden",
|
|
56
|
+
children: /* @__PURE__ */ t(
|
|
57
|
+
"div",
|
|
58
|
+
{
|
|
59
|
+
id: "main-content",
|
|
60
|
+
className: o(
|
|
61
|
+
"mint:flex-1 mint:p-8 mint:overflow-y-auto mint:overflow-x-hidden mint:rounded-tl-2xl mint:bg-white mint:dark:bg-[#1f1f1f] [scrollbar-gutter:stable] mint:overscroll-contain mint:lg:px-16 mint:lg:pt-12 [scrollbar-width:thin] [scrollbar-color:rgba(0,0,0,0.2)_transparent] 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"
|
|
62
|
+
),
|
|
63
|
+
children: /* @__PURE__ */ t(j, { groups: r, children: /* @__PURE__ */ e("div", { className: "mint:flex mint:flex-row-reverse mint:gap-12 mint:justify-center mint:mx-auto mint:w-full", children: [
|
|
64
|
+
m && m.length > 0 && /* @__PURE__ */ t("aside", { className: "mint:w-64 mint:shrink-0 mint:ml-8 mint:max-xl:hidden mint:xl:block", children: /* @__PURE__ */ e("div", { className: "mint:sticky mint:top-2 mint:p-2 mint:pb-6 mint:max-h-[calc(100vh-3.5rem)] mint:overflow-y-auto", children: [
|
|
65
|
+
/* @__PURE__ */ e("div", { className: "mint:flex mint:items-center mint:gap-2 mint:mb-4", children: [
|
|
66
|
+
/* @__PURE__ */ t(C, { className: "mint:w-4 mint:h-4 mint:text-[#4b5563] mint:dark:text-[#9ca3af]" }),
|
|
67
|
+
/* @__PURE__ */ t("h2", { className: "mint:text-sm mint:font-semibold mint:text-[#141414] mint:dark:text-white", children: u.onThisPage })
|
|
68
|
+
] }),
|
|
69
|
+
l && Object.keys(l).length > 0 ? /* @__PURE__ */ t(
|
|
70
|
+
T,
|
|
71
|
+
{
|
|
72
|
+
baseToc: m,
|
|
73
|
+
pivotTocItems: l
|
|
74
|
+
}
|
|
75
|
+
) : /* @__PURE__ */ t(P, { toc: m })
|
|
76
|
+
] }) }),
|
|
77
|
+
/* @__PURE__ */ e(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
className: o(
|
|
81
|
+
"mint:w-full mint:overflow-x-visible mint:max-w-[42rem]",
|
|
82
|
+
k && "!mint:max-w-none"
|
|
83
|
+
),
|
|
84
|
+
children: [
|
|
85
|
+
i.title && /* @__PURE__ */ t("header", { className: "mint:mb-8", children: /* @__PURE__ */ e("div", { className: "mint:mb-4", children: [
|
|
86
|
+
/* @__PURE__ */ e("div", { className: "mint:flex mint:flex-col mint:gap-2 mint:items-start mint:sm:flex-row mint:sm:items-center mint:sm:gap-4", children: [
|
|
87
|
+
/* @__PURE__ */ t("h1", { className: "mint:text-[1.875rem] mint:font-bold mint:text-[#141414] mint:dark:text-white mint:m-0 mint:leading-[1.2]", children: i.title }),
|
|
88
|
+
a && /* @__PURE__ */ t(
|
|
89
|
+
z,
|
|
90
|
+
{
|
|
91
|
+
className: "mint:ml-auto mint:max-sm:ml-0",
|
|
92
|
+
pathname: a,
|
|
93
|
+
markdownContent: b,
|
|
94
|
+
allPages: x,
|
|
95
|
+
baseUrl: g,
|
|
96
|
+
onCopyMarkdown: n == null ? void 0 : n.onCopyMarkdown,
|
|
97
|
+
onViewMarkdown: n == null ? void 0 : n.onViewMarkdown
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
] }),
|
|
101
|
+
i.description && /* @__PURE__ */ t("p", { className: "mint:text-lg mint:text-[#4b5563] mint:dark:text-[#d1d5db]", children: i.description })
|
|
102
|
+
] }) }),
|
|
103
|
+
r.length > 0 && /* @__PURE__ */ t("div", { className: "mint:mb-6 mint:flex mint:flex-wrap mint:gap-4", children: r.map((c) => /* @__PURE__ */ t(
|
|
104
|
+
F,
|
|
105
|
+
{
|
|
106
|
+
group: c,
|
|
107
|
+
className: "mint:flex mint:items-center mint:gap-2 mint:text-sm"
|
|
108
|
+
},
|
|
109
|
+
c.id
|
|
110
|
+
)) }),
|
|
111
|
+
/* @__PURE__ */ t("div", { className: "mint:pt-4", children: /* @__PURE__ */ t(N, { children: /* @__PURE__ */ t(v, {}) }) })
|
|
112
|
+
]
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
] }) })
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
}
|
|
119
|
+
)
|
|
120
|
+
}
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
) });
|
|
124
|
+
}
|
|
125
|
+
export {
|
|
126
|
+
B as DocsPage
|
|
127
|
+
};
|
|
128
|
+
//# sourceMappingURL=docsPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docsPage.js","sources":["../../src/components/docsPage.tsx"],"sourcesContent":["import { MDXRenderer } from \"./mdx-renderer\";\nimport type { DocsPageProps, PayloadData } from \"../types\";\nimport { TableOfContents } from \"./toc\";\nimport { PivotAwareTOC } from \"./toc/pivot-aware-toc\";\nimport { TextAlignLeftFilled } from \"@fluentui/react-icons\";\nimport {\n ZonePivotProvider,\n ZonePivotSelector,\n} from \"./content-components/zone-pivots\";\nimport { PageContextMenu, type ContextualOption } from \"./page-context-menu\";\nimport { ComponentsProvider } from \"../context/components-context\";\nimport { cn } from \"../utils/cn\";\nimport \"../styles.css\";\n\n/**\n * Localization strings for DocsPage component\n */\nexport interface DocsPageLocalization {\n /** Text for \"On this page\" heading. Default: \"On this page\" */\n onThisPage?: string;\n /** Loading message. Default: \"Loading...\" */\n loading?: string;\n /** Error title. Default: \"Error\" */\n errorTitle?: string;\n /** Generic error message. Default: \"Something went wrong\" */\n errorMessage?: string;\n /** Not found title. Default: \"Page not found\" */\n notFoundTitle?: string;\n /** Not found message. Default: \"The page you're looking for doesn't exist\" */\n notFoundMessage?: string;\n}\n\n/**\n * Telemetry configuration for DocsPage\n */\nexport interface DocsPageTelemetry {\n /** Activity name for page context menu interactions */\n contextMenuActivity?: string;\n /** Phase for context menu interactions */\n contextMenuPhase?: string;\n /** Activity name for TOC link clicks */\n tocLinkActivity?: string;\n /** Phase for TOC link clicks */\n tocLinkPhase?: string;\n /** Activity name for zone pivot selector changes */\n zonePivotActivity?: string;\n /** Phase for zone pivot changes */\n zonePivotPhase?: string;\n}\n\n/**\n * Configuration for the page context menu\n */\nexport interface PageContextMenuConfig {\n /** Custom actions for the page context menu. If provided, these will replace the default actions. */\n customActions?: ContextualOption[];\n /** Callback fired after markdown is successfully copied */\n onCopyMarkdown?: () => void;\n /** Custom handler for \"Copy Page\" action. If provided, replaces default copy behavior. */\n onCopyPage?: () => void | Promise<void>;\n /** Custom handler for \"View as Markdown\" action. If provided, replaces default view behavior. */\n onViewMarkdown?: (pathname: string) => void;\n /** Custom handler for \"View llms.txt\" action. If provided, replaces default behavior. */\n onViewLlmsTxt?: () => void;\n /** Custom handler for \"View llms-full.txt\" action. If provided, replaces default behavior. */\n onViewLlmsFullTxt?: () => void;\n}\n\n/**\n * Enhanced DocsPageProps with localization and telemetry support\n */\nexport interface EnhancedDocsPageProps extends DocsPageProps {\n /** Localization strings */\n localization?: DocsPageLocalization;\n /** Telemetry configuration */\n telemetry?: DocsPageTelemetry;\n /** Context menu configuration */\n contextMenu?: PageContextMenuConfig;\n}\n\n/**\n * DocsPage component renders a documentation page with MDX content, table of contents,\n * zone pivot selectors, and page context menu. It supports full customization through\n * props for localization, telemetry, and custom components.\n *\n * @example\n * ```tsx\n * <DocsPage\n * payload={{\n * content: \"...\",\n * serializedContent: Content,\n * title: \"Getting Started\",\n * description: \"Learn how to get started\"\n * }}\n * toc={[{ title: \"Introduction\", slug: \"intro\", level: 2 }]}\n * theme=\"dark\"\n * pathname=\"/docs/getting-started\"\n * LinkComponent={Link}\n * localization={{\n * onThisPage: \"In this article\"\n * }}\n * telemetry={{\n * contextMenuActivity: \"DocsPageContextMenu\",\n * contextMenuPhase: \"Start\"\n * }}\n * />\n * ```\n */\nexport function DocsPage({\n payload,\n toc,\n navTree,\n activeHref,\n theme,\n className = \"\",\n pathname,\n markdownContent,\n allPages,\n baseUrl,\n bottomLinks,\n LinkComponent,\n localization,\n telemetry,\n contextMenu,\n}: EnhancedDocsPageProps) {\n const Content = payload.serializedContent;\n const zonePivotGroups = payload.mdxExtracts?.zonePivotGroups || [];\n const pivotTocItems = payload.mdxExtracts?.pivotTocItems;\n const isFullWidth = !payload.title;\n\n // Default localization\n const defaultLocalization: Required<DocsPageLocalization> = {\n onThisPage: \"On this page\",\n loading: \"Loading...\",\n errorTitle: \"Error\",\n errorMessage: \"Something went wrong\",\n notFoundTitle: \"Page not found\",\n notFoundMessage: \"The page you're looking for doesn't exist\",\n };\n\n const loc = { ...defaultLocalization, ...localization };\n\n return (\n <ComponentsProvider LinkComponent={LinkComponent}>\n <div\n className={cn(\n theme === \"dark\" && \"dark\",\n className,\n \"mint:flex mint:flex-col mint:flex-1 mint:min-h-0 mint:h-full mint:overflow-hidden\"\n )}\n >\n <div\n id=\"page-container\"\n className=\"mint:bg-[#f0f0f0] mint:dark:bg-[#0f0f0f] mint:flex-1 mint:min-h-0 mint:h-full mint:flex mint:flex-col mint:overflow-hidden\"\n >\n <div\n id=\"page-wrapper\"\n className=\"mint:flex mint:rounded-tl-2xl mint:flex-1 mint:min-h-0 mint:h-full mint:overflow-hidden\"\n >\n <div\n id=\"main-content\"\n className={cn(\n \"mint:flex-1 mint:p-8 mint:overflow-y-auto mint:overflow-x-hidden mint:rounded-tl-2xl mint:bg-white mint:dark:bg-[#1f1f1f] [scrollbar-gutter:stable] mint:overscroll-contain mint:lg:px-16 mint:lg:pt-12 [scrollbar-width:thin] [scrollbar-color:rgba(0,0,0,0.2)_transparent] 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\"\n )}\n >\n <ZonePivotProvider groups={zonePivotGroups}>\n <div className=\"mint:flex mint:flex-row-reverse mint:gap-12 mint:justify-center mint:mx-auto mint:w-full\">\n {toc && toc.length > 0 && (\n <aside className=\"mint:w-64 mint:shrink-0 mint:ml-8 mint:max-xl:hidden mint:xl:block\">\n <div className=\"mint:sticky mint:top-2 mint:p-2 mint:pb-6 mint:max-h-[calc(100vh-3.5rem)] mint:overflow-y-auto\">\n <div className=\"mint:flex mint:items-center mint:gap-2 mint:mb-4\">\n <TextAlignLeftFilled className=\"mint:w-4 mint:h-4 mint:text-[#4b5563] mint:dark:text-[#9ca3af]\" />\n <h2 className=\"mint:text-sm mint:font-semibold mint:text-[#141414] mint:dark:text-white\">\n {loc.onThisPage}\n </h2>\n </div>\n {pivotTocItems &&\n Object.keys(pivotTocItems).length > 0 ? (\n <PivotAwareTOC\n baseToc={toc}\n pivotTocItems={pivotTocItems}\n />\n ) : (\n <TableOfContents toc={toc} />\n )}\n </div>\n </aside>\n )}\n\n <div\n className={cn(\n \"mint:w-full mint:overflow-x-visible mint:max-w-[42rem]\",\n isFullWidth && \"!mint:max-w-none\"\n )}\n >\n {payload.title && (\n <header className=\"mint:mb-8\">\n <div className=\"mint:mb-4\">\n <div className=\"mint:flex mint:flex-col mint:gap-2 mint:items-start mint:sm:flex-row mint:sm:items-center mint:sm:gap-4\">\n <h1 className=\"mint:text-[1.875rem] mint:font-bold mint:text-[#141414] mint:dark:text-white mint:m-0 mint:leading-[1.2]\">\n {payload.title}\n </h1>\n {pathname && (\n <PageContextMenu\n className=\"mint:ml-auto mint:max-sm:ml-0\"\n pathname={pathname}\n markdownContent={markdownContent}\n allPages={allPages}\n baseUrl={baseUrl}\n onCopyMarkdown={contextMenu?.onCopyMarkdown}\n onViewMarkdown={contextMenu?.onViewMarkdown}\n />\n )}\n </div>\n {payload.description && (\n <p className=\"mint:text-lg mint:text-[#4b5563] mint:dark:text-[#d1d5db]\">\n {payload.description}\n </p>\n )}\n </div>\n </header>\n )}\n\n {zonePivotGroups.length > 0 && (\n <div className=\"mint:mb-6 mint:flex mint:flex-wrap mint:gap-4\">\n {zonePivotGroups.map((group) => (\n <ZonePivotSelector\n key={group.id}\n group={group}\n className=\"mint:flex mint:items-center mint:gap-2 mint:text-sm\"\n />\n ))}\n </div>\n )}\n\n <div className=\"mint:pt-4\">\n <MDXRenderer>\n <Content />\n </MDXRenderer>\n </div>\n </div>\n </div>\n </ZonePivotProvider>\n </div>\n </div>\n </div>\n </div>\n </ComponentsProvider>\n );\n}\n\nexport type { DocsPageProps, PayloadData } from \"../types\";\n\nexport type { EnhancedDocsPageProps as DocsPagePropsWithCustomization };\n\nexport type { ContextualOption };\n"],"names":["DocsPage","payload","toc","navTree","activeHref","theme","className","pathname","markdownContent","allPages","baseUrl","bottomLinks","LinkComponent","localization","telemetry","contextMenu","Content","zonePivotGroups","_a","pivotTocItems","_b","isFullWidth","loc","jsx","ComponentsProvider","cn","ZonePivotProvider","jsxs","TextAlignLeftFilled","PivotAwareTOC","TableOfContents","PageContextMenu","group","ZonePivotSelector","MDXRenderer"],"mappings":"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"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useComponents as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { MethodPill as
|
|
1
|
+
import { jsxs as s, jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as A, useEffect as y, useState as L } from "react";
|
|
3
|
+
import { useComponents as _ } from "../../context/components-context.js";
|
|
4
|
+
import { cn as N } from "../../utils/cn.js";
|
|
5
|
+
import { MethodPill as j } from "../Api/MethodPill.js";
|
|
6
6
|
/* empty css */
|
|
7
|
-
function
|
|
7
|
+
function E({ isExpanded: t }) {
|
|
8
8
|
return /* @__PURE__ */ n(
|
|
9
9
|
"svg",
|
|
10
10
|
{
|
|
11
|
-
className:
|
|
12
|
-
"mint:w-[16px] mint:h-[16px] mint:shrink-0 mint:
|
|
11
|
+
className: N(
|
|
12
|
+
"mint:w-[16px] mint:h-[16px] mint:shrink-0 mint:text-[#6b7280] mint:dark:text-[#9ca3af]",
|
|
13
13
|
t ? "mint:rotate-90" : "mint:rotate-0"
|
|
14
14
|
),
|
|
15
15
|
fill: "none",
|
|
@@ -28,115 +28,128 @@ function g({ isExpanded: t }) {
|
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
const $ = "mint:bg-[#e6e6e6] mint:dark:bg-[#2e2e2e] mint:text-[#242424] mint:dark:text-[#ffffff] mint:font-semibold";
|
|
32
|
+
function w({ item: t, activeId: h, level: f = 0, activeHref: r }) {
|
|
33
|
+
const u = t.children && t.children.length > 0, b = (i) => i ? i.startsWith("/") ? i : `/${i}` : "", x = (i, d) => {
|
|
34
|
+
if (!i || !d) return !1;
|
|
35
|
+
const k = b(i), v = b(d);
|
|
36
|
+
return k === v || k.replace("/docs/", "/") === v.replace("/docs/", "/") || k === v.replace("/docs/", "/") || k.replace("/docs/", "/") === v;
|
|
37
|
+
}, p = (i) => x(i.href, r) ? !0 : i.children ? i.children.some(p) : !1, C = f === 0 ? !0 : (t.expanded ?? !1) || u && p(t), [e, o] = L(C);
|
|
38
|
+
y(() => {
|
|
39
|
+
u && p(t) && o(!0);
|
|
40
|
+
}, [r]);
|
|
41
|
+
const { LinkComponent: g } = _(), m = !t.href, l = t.href && (x(t.href, h) || x(t.href, r)), a = t.icon;
|
|
42
|
+
if (m && f === 0)
|
|
43
|
+
return /* @__PURE__ */ s(
|
|
35
44
|
"div",
|
|
36
45
|
{
|
|
37
46
|
id: "nav-group",
|
|
38
47
|
role: "group",
|
|
39
48
|
"aria-label": t.toc_title,
|
|
40
49
|
children: [
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
-
|
|
50
|
+
/* @__PURE__ */ s("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-3", children: [
|
|
51
|
+
a && /* @__PURE__ */ n(a, { className: "mint:w-5 mint:h-5", "aria-hidden": "true" }),
|
|
43
52
|
/* @__PURE__ */ n("span", { children: t.toc_title })
|
|
44
53
|
] }),
|
|
45
|
-
|
|
46
|
-
|
|
54
|
+
u && t.children && /* @__PURE__ */ n("ul", { className: "mint:flex mint:flex-col", role: "list", children: t.children.map((i, d) => /* @__PURE__ */ n(
|
|
55
|
+
w,
|
|
47
56
|
{
|
|
48
57
|
item: i,
|
|
49
|
-
activeId:
|
|
50
|
-
level:
|
|
58
|
+
activeId: h,
|
|
59
|
+
level: f + 1,
|
|
60
|
+
activeHref: r
|
|
51
61
|
},
|
|
52
|
-
`${i.href}-${
|
|
62
|
+
`${i.href}-${d}`
|
|
53
63
|
)) })
|
|
54
64
|
]
|
|
55
65
|
}
|
|
56
66
|
);
|
|
57
|
-
if (
|
|
58
|
-
return /* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
67
|
+
if (m && f > 0)
|
|
68
|
+
return /* @__PURE__ */ s("li", { className: "mint:list-none", children: [
|
|
69
|
+
/* @__PURE__ */ s(
|
|
60
70
|
"button",
|
|
61
71
|
{
|
|
62
72
|
id: "nav-group-toggle",
|
|
63
|
-
onClick: () =>
|
|
64
|
-
"aria-expanded":
|
|
65
|
-
"aria-label": `${
|
|
66
|
-
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:
|
|
73
|
+
onClick: () => o(!e),
|
|
74
|
+
"aria-expanded": e,
|
|
75
|
+
"aria-label": `${e ? "Collapse" : "Expand"} ${t.toc_title} section`,
|
|
76
|
+
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-[#9ca3af] 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",
|
|
67
77
|
children: [
|
|
68
78
|
/* @__PURE__ */ n("span", { className: "mint:flex-1 mint:min-w-0", children: t.toc_title }),
|
|
69
|
-
/* @__PURE__ */ n(
|
|
79
|
+
/* @__PURE__ */ n(E, { isExpanded: !!e })
|
|
70
80
|
]
|
|
71
81
|
}
|
|
72
82
|
),
|
|
73
|
-
|
|
83
|
+
u && e && t.children && /* @__PURE__ */ n(
|
|
74
84
|
"ul",
|
|
75
85
|
{
|
|
76
86
|
className: "mint:mt-1 mint:ml-2 mint:flex mint:flex-col mint:gap-1 mint:pl-3",
|
|
77
87
|
role: "group",
|
|
78
|
-
children: t.children.map((i,
|
|
79
|
-
|
|
88
|
+
children: t.children.map((i, d) => /* @__PURE__ */ n(
|
|
89
|
+
w,
|
|
80
90
|
{
|
|
81
91
|
item: i,
|
|
82
|
-
activeId:
|
|
83
|
-
level:
|
|
92
|
+
activeId: h,
|
|
93
|
+
level: f + 1,
|
|
94
|
+
activeHref: r
|
|
84
95
|
},
|
|
85
|
-
`${i.href}-${
|
|
96
|
+
`${i.href}-${d}`
|
|
86
97
|
))
|
|
87
98
|
}
|
|
88
99
|
)
|
|
89
100
|
] });
|
|
90
|
-
const
|
|
91
|
-
return
|
|
92
|
-
/* @__PURE__ */
|
|
101
|
+
const c = g || "a";
|
|
102
|
+
return u ? /* @__PURE__ */ s("li", { className: "mint:list-none", children: [
|
|
103
|
+
/* @__PURE__ */ s(
|
|
93
104
|
"button",
|
|
94
105
|
{
|
|
95
106
|
id: "nav-item-toggle",
|
|
96
|
-
onClick: () =>
|
|
97
|
-
"aria-expanded":
|
|
98
|
-
"aria-label": `${
|
|
99
|
-
className:
|
|
100
|
-
"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-sans mint:font-normal mint:rounded-xl mint:
|
|
101
|
-
|
|
107
|
+
onClick: () => o(!e),
|
|
108
|
+
"aria-expanded": e,
|
|
109
|
+
"aria-label": `${e ? "Collapse" : "Expand"} ${t.toc_title} section`,
|
|
110
|
+
className: N(
|
|
111
|
+
"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-sans mint:font-normal mint:rounded-xl mint:bg-transparent mint:border-none mint:cursor-pointer mint:text-[#424242] mint:dark:text-[#9ca3af] mint:focus-visible:outline-2 mint:focus-visible:outline-[#643fb2] mint:focus-visible:outline-offset-2",
|
|
112
|
+
l ? $ : "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]"
|
|
102
113
|
),
|
|
103
114
|
children: [
|
|
104
115
|
/* @__PURE__ */ n("span", { className: "mint:flex-1 mint:min-w-0", children: t.toc_title }),
|
|
105
|
-
/* @__PURE__ */ n(
|
|
116
|
+
/* @__PURE__ */ n(E, { isExpanded: !!e })
|
|
106
117
|
]
|
|
107
118
|
}
|
|
108
119
|
),
|
|
109
|
-
|
|
120
|
+
e && t.children && /* @__PURE__ */ n(
|
|
110
121
|
"ul",
|
|
111
122
|
{
|
|
112
123
|
className: "mint:mt-1 mint:ml-2 mint:flex mint:flex-col mint:gap-1 mint:pl-3",
|
|
113
124
|
role: "group",
|
|
114
|
-
children: t.children.map((i,
|
|
115
|
-
|
|
125
|
+
children: t.children.map((i, d) => /* @__PURE__ */ n(
|
|
126
|
+
w,
|
|
116
127
|
{
|
|
117
128
|
item: i,
|
|
118
|
-
activeId:
|
|
119
|
-
level:
|
|
129
|
+
activeId: h,
|
|
130
|
+
level: f + 1,
|
|
131
|
+
activeHref: r
|
|
120
132
|
},
|
|
121
|
-
`${i.href}-${
|
|
133
|
+
`${i.href}-${d}`
|
|
122
134
|
))
|
|
123
135
|
}
|
|
124
136
|
)
|
|
125
|
-
] }) : /* @__PURE__ */ n("li", { className: "mint:list-none", children: /* @__PURE__ */
|
|
126
|
-
|
|
137
|
+
] }) : /* @__PURE__ */ n("li", { className: "mint:list-none", children: /* @__PURE__ */ s(
|
|
138
|
+
c,
|
|
127
139
|
{
|
|
128
140
|
id: "nav-item",
|
|
129
141
|
href: t.href,
|
|
130
|
-
"aria-current":
|
|
131
|
-
className:
|
|
132
|
-
"mint:relative mint:flex mint:items-center mint:gap-2 mint:py-2 mint:px-3 mint:text-[14px] mint:font-sans mint:font-normal mint:rounded-xl mint:
|
|
133
|
-
|
|
142
|
+
"aria-current": l ? "page" : void 0,
|
|
143
|
+
className: N(
|
|
144
|
+
"mint:relative mint:flex mint:items-center mint:gap-2 mint:py-2 mint:px-3 mint:text-[14px] mint:font-sans mint:font-normal mint:rounded-xl mint:no-underline mint:text-[#424242] mint:dark:text-[#9ca3af] mint:focus-visible:outline-2 mint:focus-visible:outline-[#643fb2] mint:focus-visible:outline-offset-2",
|
|
145
|
+
l ? $ : "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]"
|
|
134
146
|
),
|
|
135
147
|
children: [
|
|
148
|
+
l && /* @__PURE__ */ n("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]" }),
|
|
136
149
|
t.method && /* @__PURE__ */ n(
|
|
137
|
-
|
|
150
|
+
j,
|
|
138
151
|
{
|
|
139
|
-
isActive: !!
|
|
152
|
+
isActive: !!l,
|
|
140
153
|
method: t.method,
|
|
141
154
|
shortMethod: !0
|
|
142
155
|
}
|
|
@@ -146,40 +159,49 @@ function b({ item: t, activeId: o, level: l = 0 }) {
|
|
|
146
159
|
}
|
|
147
160
|
) });
|
|
148
161
|
}
|
|
149
|
-
function
|
|
162
|
+
function B({
|
|
150
163
|
navTree: t,
|
|
151
|
-
activeId:
|
|
152
|
-
className:
|
|
153
|
-
activeHref:
|
|
154
|
-
theme:
|
|
155
|
-
bottomLinks:
|
|
164
|
+
activeId: h,
|
|
165
|
+
className: f = "",
|
|
166
|
+
activeHref: r,
|
|
167
|
+
theme: u,
|
|
168
|
+
bottomLinks: b
|
|
156
169
|
}) {
|
|
157
|
-
const { LinkComponent:
|
|
158
|
-
if (
|
|
159
|
-
const e =
|
|
160
|
-
if (!e) return;
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
sessionStorage.setItem(
|
|
165
|
-
f,
|
|
166
|
-
e.scrollTop.toString()
|
|
167
|
-
);
|
|
168
|
-
};
|
|
169
|
-
return e.addEventListener("scroll", i), () => {
|
|
170
|
-
e.removeEventListener("scroll", i);
|
|
170
|
+
const { LinkComponent: x } = _(), p = A(null);
|
|
171
|
+
if (y(() => {
|
|
172
|
+
const e = p.current;
|
|
173
|
+
if (!e || !r) return;
|
|
174
|
+
const o = (m) => m ? m.startsWith("/") ? m : `/${m}` : "", g = (m, l) => {
|
|
175
|
+
const a = o(m), c = o(l);
|
|
176
|
+
return a === c || a.replace("/docs/", "/") === c.replace("/docs/", "/") || a === c.replace("/docs/", "/") || a.replace("/docs/", "/") === c;
|
|
171
177
|
};
|
|
172
|
-
|
|
178
|
+
requestAnimationFrame(() => {
|
|
179
|
+
const m = e.querySelectorAll("a[href]");
|
|
180
|
+
let l = null;
|
|
181
|
+
for (const a of Array.from(m)) {
|
|
182
|
+
const c = a.getAttribute("href");
|
|
183
|
+
if (c && g(c, r)) {
|
|
184
|
+
l = a;
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
l && l.scrollIntoView({
|
|
189
|
+
behavior: "instant",
|
|
190
|
+
block: "center",
|
|
191
|
+
inline: "nearest"
|
|
192
|
+
});
|
|
193
|
+
});
|
|
194
|
+
}, [r]), !t || t.items.length === 0)
|
|
173
195
|
return null;
|
|
174
|
-
const
|
|
175
|
-
return /* @__PURE__ */
|
|
196
|
+
const C = x || "a";
|
|
197
|
+
return /* @__PURE__ */ s(
|
|
176
198
|
"nav",
|
|
177
199
|
{
|
|
178
200
|
id: "nav-tree",
|
|
179
|
-
className:
|
|
201
|
+
className: N(
|
|
180
202
|
"mint:flex mint:flex-col mint:h-full mint:min-h-0",
|
|
181
|
-
|
|
182
|
-
|
|
203
|
+
f,
|
|
204
|
+
u === "dark" && "mint:dark"
|
|
183
205
|
),
|
|
184
206
|
"aria-label": "Documentation navigation",
|
|
185
207
|
children: [
|
|
@@ -187,40 +209,41 @@ function I({
|
|
|
187
209
|
"div",
|
|
188
210
|
{
|
|
189
211
|
id: "nav-tree-content",
|
|
190
|
-
ref:
|
|
212
|
+
ref: p,
|
|
191
213
|
className: "mint:flex-1 mint:overflow-y-auto mint:overflow-x-hidden mint:min-h-0 mint:[scrollbar-gutter:stable] mint:px-3 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",
|
|
192
|
-
children: t.items.map((e,
|
|
193
|
-
|
|
214
|
+
children: t.items.map((e, o) => /* @__PURE__ */ n(
|
|
215
|
+
w,
|
|
194
216
|
{
|
|
195
217
|
item: e,
|
|
196
|
-
activeId:
|
|
218
|
+
activeId: h,
|
|
219
|
+
activeHref: r
|
|
197
220
|
},
|
|
198
|
-
`${e.href}-${
|
|
221
|
+
`${e.href}-${o}`
|
|
199
222
|
))
|
|
200
223
|
}
|
|
201
224
|
),
|
|
202
|
-
|
|
225
|
+
b && b.length > 0 && /* @__PURE__ */ s(
|
|
203
226
|
"div",
|
|
204
227
|
{
|
|
205
228
|
id: "nav-tree-bottom-links",
|
|
206
229
|
className: "mint:shrink-0 mint:w-full mint:bg-[#f0f0f0] mint:dark:bg-[#0f0f0f] mint:mt-auto",
|
|
207
230
|
children: [
|
|
208
231
|
/* @__PURE__ */ n("div", { className: "mint:h-[0.5px] mint:w-full mint:bg-[#d1d1d1] mint:dark:bg-[#666666]" }),
|
|
209
|
-
/* @__PURE__ */ n("div", { className: "mint:flex mint:flex-col mint:py-3 mint:px-3", children:
|
|
210
|
-
const
|
|
211
|
-
return /* @__PURE__ */
|
|
212
|
-
|
|
232
|
+
/* @__PURE__ */ n("div", { className: "mint:flex mint:flex-col mint:py-3 mint:px-3", children: b.map((e, o) => {
|
|
233
|
+
const g = e.icon;
|
|
234
|
+
return /* @__PURE__ */ s(
|
|
235
|
+
C,
|
|
213
236
|
{
|
|
214
237
|
href: e.href,
|
|
215
238
|
target: "_blank",
|
|
216
239
|
rel: "noopener noreferrer",
|
|
217
240
|
className: "mint:flex mint:items-center mint:py-2 mint:gap-2 mint:text-sm mint:no-underline mint:text-[#424242] mint:dark:text-[#9ca3af] mint:hover:text-[#141414] mint:dark:hover:text-[#e5e7eb] mint:px-2",
|
|
218
241
|
children: [
|
|
219
|
-
/* @__PURE__ */ n(
|
|
242
|
+
/* @__PURE__ */ n(g, { className: "mint:w-5 mint:h-5 mint:shrink-0" }),
|
|
220
243
|
/* @__PURE__ */ n("span", { children: e.label })
|
|
221
244
|
]
|
|
222
245
|
},
|
|
223
|
-
|
|
246
|
+
o
|
|
224
247
|
);
|
|
225
248
|
}) })
|
|
226
249
|
]
|
|
@@ -231,6 +254,6 @@ function I({
|
|
|
231
254
|
);
|
|
232
255
|
}
|
|
233
256
|
export {
|
|
234
|
-
|
|
257
|
+
B as NavTree
|
|
235
258
|
};
|
|
236
259
|
//# sourceMappingURL=index.js.map
|