zudoku 0.3.0-dev.63 → 0.3.0-dev.64

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.
@@ -15,26 +15,34 @@ const TocItem = ({ item, children, className, isActive, }) => {
15
15
  export const Toc = ({ entries }) => {
16
16
  const { activeAnchor } = useViewportAnchor();
17
17
  const listWrapperRef = useRef(null);
18
- const [indicatorStyle, setIndicatorStyles] = useState({});
18
+ const paintedOnce = useRef(false);
19
+ const [indicatorStyle, setIndicatorStyles] = useState({
20
+ top: 0,
21
+ opacity: 0,
22
+ });
19
23
  // synchronize active anchor indicator with the scroll position
20
24
  useEffect(() => {
21
25
  if (!listWrapperRef.current)
22
26
  return;
23
27
  const activeElement = listWrapperRef.current.querySelector(`[${DATA_ANCHOR_ATTR}='${activeAnchor}']`);
24
28
  if (!activeElement) {
25
- setIndicatorStyles({
26
- "--indicator-top": "0",
27
- "--indicator-opacity": 0,
28
- });
29
+ setIndicatorStyles({ top: 0, opacity: 0 });
29
30
  return;
30
31
  }
31
32
  const topParent = listWrapperRef.current.getBoundingClientRect().top;
32
33
  const topElement = activeElement.getBoundingClientRect().top;
33
34
  setIndicatorStyles({
34
- "--indicator-top": `${topElement - topParent}px`,
35
- "--indicator-opacity": 1,
35
+ opacity: 1,
36
+ top: `${topElement - topParent}px`,
37
+ });
38
+ if (paintedOnce.current)
39
+ return;
40
+ // after all is painted, the indicator should animate
41
+ requestIdleCallback(() => {
42
+ paintedOnce.current = true;
36
43
  });
37
44
  }, [activeAnchor]);
38
- return (_jsxs("aside", { className: "sticky top-[--header-height] h-[calc(100vh-var(--header-height))] pt-[--padding-content-top] pb-[--padding-content-bottom] overflow-y-auto ps-1 text-sm", children: [_jsxs("div", { className: "flex items-center gap-2 font-medium mb-2", children: [_jsx(ListTreeIcon, { size: 16 }), "On this page"] }), _jsx("ul", { ref: listWrapperRef, style: indicatorStyle, className: cn("relative ms-2 ps-4 font-medium list-none mt-0 space-y-2", "before:absolute before:inset-0 before:right-auto before:bg-border before:w-[2px]", "after:absolute after:-left-px after:-translate-y-1 after:top-[--indicator-top] after:opacity-[--indicator-opacity] after:h-6 after:bg-primary after:w-[4px] after:rounded after:ease-out after:[transition:top__150ms,opacity_325ms]"), children: entries.map((item) => (_jsx(TocItem, { isActive: item.id === activeAnchor, item: item, className: "pl-0", children: item.children && (_jsx("ul", { className: "list-none pl-4 pt-2 space-y-2", children: item.children.map((child) => (_jsx(TocItem, { item: child, isActive: child.id === activeAnchor }, child.id))) })) }, item.id))) })] }));
45
+ return (_jsxs("aside", { className: "sticky top-[--header-height] h-[calc(100vh-var(--header-height))] pt-[--padding-content-top] pb-[--padding-content-bottom] overflow-y-auto ps-1 text-sm", children: [_jsxs("div", { className: "flex items-center gap-2 font-medium mb-2", children: [_jsx(ListTreeIcon, { size: 16 }), "On this page"] }), _jsxs("div", { className: "relative ms-2 ps-4", children: [_jsx("div", { className: "absolute inset-0 right-auto bg-border w-[2px]" }), _jsx("div", { className: cn("absolute -left-px -translate-y-1 h-6 w-[4px] rounded bg-primary", paintedOnce.current &&
46
+ "ease-out [transition:top_150ms,opacity_325ms]"), style: indicatorStyle }), _jsx("ul", { ref: listWrapperRef, className: "relative font-medium list-none space-y-2", children: entries.map((item) => (_jsx(TocItem, { isActive: item.id === activeAnchor, item: item, className: "pl-0", children: item.children && (_jsx("ul", { className: "list-none pl-4 pt-2 space-y-2", children: item.children.map((child) => (_jsx(TocItem, { item: child, isActive: child.id === activeAnchor }, child.id))) })) }, item.id))) })] })] }));
39
47
  };
40
48
  //# sourceMappingURL=Toc.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toc.js","sourceRoot":"","sources":["../../../../src/lib/plugins/markdown/Toc.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EACL,SAAS,EACT,MAAM,EACN,QAAQ,GAGT,MAAM,OAAO,CAAC;AACf,OAAO,EAAE,UAAU,E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,EAAC,0CAA0C,YAEnD,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACrB,KAAC,OAAO,IACN,QAAQ,EAAE,IAAI,CAAC,EAAE,KAAK,YAAY,EAElC,IAAI,EAAE,IAAI,EACV,SAAS,EAAC,MAAM,YAEf,IAAI,CAAC,QAAQ,IAAI,CAChB,aAAI,SAAS,EAAC,+BAA+B,YAC1C,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAC5B,KAAC,OAAO,IACN,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,KAAK,CAAC,EAAE,KAAK,YAAY,IAC9B,KAAK,CAAC,EAAE,CACb,CACH,CAAC,GACC,CACN,IAdI,IAAI,CAAC,EAAE,CAeJ,CACX,CAAC,GACC,IACD,IACA,CACT,CAAC;AACJ,CAAC,CAAC"}
@@ -1,9 +1,9 @@
1
- import { j as e, a as I } from "./jsx-runtime-BIr0WBt_.js";
2
- import { A as _, a as E, u as $ } from "./AnchorLink-Bj1hwDuD.js";
3
- import { useRef as q, useState as z, useEffect as B, useMemo as D } from "react";
4
- import { c as F, e as V, a as g, P as W, H as u, L as T } from "./Markdown-BjRJKl_E.js";
1
+ import { j as e, a as E } from "./jsx-runtime-BIr0WBt_.js";
2
+ import { A as _, a as $, u as q } from "./AnchorLink-Bj1hwDuD.js";
3
+ import { useRef as T, useState as z, useEffect as B, useMemo as D } from "react";
4
+ import { c as F, e as V, a as g, P as W, H as v, L as A } from "./Markdown-BjRJKl_E.js";
5
5
  import { C as X } from "./CategoryHeading-DMkTmmBh.js";
6
- import { v as G, z as A, l as M } from "./DevPortalProvider-BBhQ8kgI.js";
6
+ import { v as G, z as M, l as P } from "./DevPortalProvider-BBhQ8kgI.js";
7
7
  import { s as J } from "./slugify-CiPVjteN.js";
8
8
  /**
9
9
  * @license lucide-react v0.378.0 - ISC
@@ -17,119 +17,129 @@ const K = F("ListTree", [
17
17
  ["path", { d: "M21 18h-8", key: "1tm79t" }],
18
18
  ["path", { d: "M3 6v4c0 1.1.9 2 2 2h3", key: "1ywdgy" }],
19
19
  ["path", { d: "M3 10v6c0 1.1.9 2 2 2h3", key: "2wc746" }]
20
- ]), H = "data-active", P = ({
21
- item: s,
20
+ ]), H = "data-active", C = ({
21
+ item: r,
22
22
  children: t,
23
- className: r,
24
- isActive: o
23
+ className: s,
24
+ isActive: a
25
25
  }) => /* @__PURE__ */ e.jsxs(
26
26
  "li",
27
27
  {
28
28
  className: g(
29
29
  "truncate",
30
- o ? "text-primary" : "text-foreground/65 dark:text-foreground/75",
31
- r
30
+ a ? "text-primary" : "text-foreground/65 dark:text-foreground/75",
31
+ s
32
32
  ),
33
- title: s.value,
33
+ title: r.value,
34
34
  children: [
35
35
  /* @__PURE__ */ e.jsx(
36
36
  _,
37
37
  {
38
- to: `#${s.id}`,
39
- [H]: s.id,
38
+ to: `#${r.id}`,
39
+ [H]: r.id,
40
40
  className: g(
41
- o ? "text-primary" : "text-foreground/65 dark:text-foreground/75 hover:text-foreground"
41
+ a ? "text-primary" : "text-foreground/65 dark:text-foreground/75 hover:text-foreground"
42
42
  ),
43
- children: s.value
43
+ children: r.value
44
44
  }
45
45
  ),
46
46
  t
47
47
  ]
48
48
  }
49
- ), Q = ({ entries: s }) => {
50
- const { activeAnchor: t } = V(), r = q(null), [o, n] = z({});
49
+ ), Q = ({ entries: r }) => {
50
+ const { activeAnchor: t } = V(), s = T(null), a = T(!1), [c, d] = z({
51
+ top: 0,
52
+ opacity: 0
53
+ });
51
54
  return B(() => {
52
- if (!r.current) return;
53
- const a = r.current.querySelector(
55
+ if (!s.current) return;
56
+ const i = s.current.querySelector(
54
57
  `[${H}='${t}']`
55
58
  );
56
- if (!a) {
57
- n({
58
- "--indicator-top": "0",
59
- "--indicator-opacity": 0
60
- });
59
+ if (!i) {
60
+ d({ top: 0, opacity: 0 });
61
61
  return;
62
62
  }
63
- const l = r.current.getBoundingClientRect().top, d = a.getBoundingClientRect().top;
64
- n({
65
- "--indicator-top": `${d - l}px`,
66
- "--indicator-opacity": 1
63
+ const n = s.current.getBoundingClientRect().top, u = i.getBoundingClientRect().top;
64
+ d({
65
+ opacity: 1,
66
+ top: `${u - n}px`
67
+ }), !a.current && requestIdleCallback(() => {
68
+ a.current = !0;
67
69
  });
68
70
  }, [t]), /* @__PURE__ */ e.jsxs("aside", { className: "sticky top-[--header-height] h-[calc(100vh-var(--header-height))] pt-[--padding-content-top] pb-[--padding-content-bottom] overflow-y-auto ps-1 text-sm", children: [
69
71
  /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 font-medium mb-2", children: [
70
72
  /* @__PURE__ */ e.jsx(K, { size: 16 }),
71
73
  "On this page"
72
74
  ] }),
73
- /* @__PURE__ */ e.jsx(
74
- "ul",
75
- {
76
- ref: r,
77
- style: o,
78
- className: g(
79
- "relative ms-2 ps-4 font-medium list-none mt-0 space-y-2",
80
- "before:absolute before:inset-0 before:right-auto before:bg-border before:w-[2px]",
81
- "after:absolute after:-left-px after:-translate-y-1 after:top-[--indicator-top] after:opacity-[--indicator-opacity] after:h-6 after:bg-primary after:w-[4px] after:rounded after:ease-out after:[transition:top__150ms,opacity_325ms]"
82
- ),
83
- children: s.map((a) => /* @__PURE__ */ e.jsx(
84
- P,
85
- {
86
- isActive: a.id === t,
87
- item: a,
88
- className: "pl-0",
89
- children: a.children && /* @__PURE__ */ e.jsx("ul", { className: "list-none pl-4 pt-2 space-y-2", children: a.children.map((l) => /* @__PURE__ */ e.jsx(
90
- P,
91
- {
92
- item: l,
93
- isActive: l.id === t
94
- },
95
- l.id
96
- )) })
97
- },
98
- a.id
99
- ))
100
- }
101
- )
75
+ /* @__PURE__ */ e.jsxs("div", { className: "relative ms-2 ps-4", children: [
76
+ /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 right-auto bg-border w-[2px]" }),
77
+ /* @__PURE__ */ e.jsx(
78
+ "div",
79
+ {
80
+ className: g(
81
+ "absolute -left-px -translate-y-1 h-6 w-[4px] rounded bg-primary",
82
+ a.current && "ease-out [transition:top_150ms,opacity_325ms]"
83
+ ),
84
+ style: c
85
+ }
86
+ ),
87
+ /* @__PURE__ */ e.jsx(
88
+ "ul",
89
+ {
90
+ ref: s,
91
+ className: "relative font-medium list-none space-y-2",
92
+ children: r.map((i) => /* @__PURE__ */ e.jsx(
93
+ C,
94
+ {
95
+ isActive: i.id === t,
96
+ item: i,
97
+ className: "pl-0",
98
+ children: i.children && /* @__PURE__ */ e.jsx("ul", { className: "list-none pl-4 pt-2 space-y-2", children: i.children.map((n) => /* @__PURE__ */ e.jsx(
99
+ C,
100
+ {
101
+ item: n,
102
+ isActive: n.id === t
103
+ },
104
+ n.id
105
+ )) })
106
+ },
107
+ i.id
108
+ ))
109
+ }
110
+ )
111
+ ] })
102
112
  ] });
103
113
  }, U = {
104
- h2: ({ children: s, id: t }) => /* @__PURE__ */ e.jsx(u, { level: 2, id: t, registerSidebarAnchor: !0, children: s }),
105
- h3: ({ children: s, id: t }) => /* @__PURE__ */ e.jsxs(u, { level: 3, id: t, registerSidebarAnchor: !0, children: [
114
+ h2: ({ children: r, id: t }) => /* @__PURE__ */ e.jsx(v, { level: 2, id: t, registerSidebarAnchor: !0, children: r }),
115
+ h3: ({ children: r, id: t }) => /* @__PURE__ */ e.jsxs(v, { level: 3, id: t, registerSidebarAnchor: !0, children: [
106
116
  " ",
107
- s
117
+ r
108
118
  ] })
109
119
  }, ae = ({
110
- mdxComponent: s,
120
+ mdxComponent: r,
111
121
  frontmatter: t = {},
112
- defaultOptions: r,
113
- tableOfContents: o
122
+ defaultOptions: s,
123
+ tableOfContents: a
114
124
  }) => {
115
- var y, b;
116
- const n = G(), a = I(), l = n ? A(n, (i, x, m) => {
117
- var c;
118
- if (x === a.pathname)
119
- return (c = m.at(0)) == null ? void 0 : c.label;
120
- }) : void 0, d = t.title, f = t.category ?? l, L = t.toc === !1 || (r == null ? void 0 : r.toc) === !1, R = ((y = o.find((i) => i.depth === 1)) == null ? void 0 : y.value) ?? d, S = t.disablePager ?? (r == null ? void 0 : r.disablePager) ?? !1, v = ((b = o.find((i) => i.depth === 1)) == null ? void 0 : b.children) ?? // if `title` is provided by frontmatter it does not appear in the table of contents
121
- o.filter((i) => i.depth === 2), C = !L && v.length > 0, { prev: p, next: h } = D(() => {
122
- let i = { path: "", label: "" }, x = { path: "", label: "" }, m = !1;
123
- return n ? (A(n, (c, j) => {
125
+ var j, y;
126
+ const c = G(), d = E(), i = c ? M(c, (l, x, m) => {
127
+ var o;
128
+ if (x === d.pathname)
129
+ return (o = m.at(0)) == null ? void 0 : o.label;
130
+ }) : void 0, n = t.title, u = t.category ?? i, I = t.toc === !1 || (s == null ? void 0 : s.toc) === !1, L = ((j = a.find((l) => l.depth === 1)) == null ? void 0 : j.value) ?? n, R = t.disablePager ?? (s == null ? void 0 : s.disablePager) ?? !1, f = ((y = a.find((l) => l.depth === 1)) == null ? void 0 : y.children) ?? // if `title` is provided by frontmatter it does not appear in the table of contents
131
+ a.filter((l) => l.depth === 2), S = !I && f.length > 0, { prev: p, next: h } = D(() => {
132
+ let l = { path: "", label: "" }, x = { path: "", label: "" }, m = !1;
133
+ return c ? (M(c, (o, b) => {
124
134
  var w, k;
125
- const N = { path: j, label: c.label };
126
- if (m && M(c) && !((w = c.children) != null && w.length))
135
+ const N = { path: b, label: o.label };
136
+ if (m && P(o) && !((w = o.children) != null && w.length))
127
137
  return x = N, !0;
128
- j === a.pathname && (m = !0), !m && M(c) && !((k = c.children) != null && k.length) && (i = N);
129
- }), { prev: i, next: x }) : { prev: i, next: x };
130
- }, [n, a.pathname]);
138
+ b === d.pathname && (m = !0), !m && P(o) && !((k = o.children) != null && k.length) && (l = N);
139
+ }), { prev: l, next: x }) : { prev: l, next: x };
140
+ }, [c, d.pathname]);
131
141
  return /* @__PURE__ */ e.jsxs("div", { className: "xl:grid grid-cols-[--sidecar-grid-cols] gap-8 justify-between", children: [
132
- /* @__PURE__ */ e.jsx(E, { children: /* @__PURE__ */ e.jsx("title", { children: R }) }),
142
+ /* @__PURE__ */ e.jsx($, { children: /* @__PURE__ */ e.jsx("title", { children: L }) }),
133
143
  /* @__PURE__ */ e.jsxs(
134
144
  "div",
135
145
  {
@@ -139,21 +149,21 @@ const K = F("ListTree", [
139
149
  ),
140
150
  children: [
141
151
  /* @__PURE__ */ e.jsxs("header", { children: [
142
- f && /* @__PURE__ */ e.jsx(X, { children: f }),
143
- d && /* @__PURE__ */ e.jsx(u, { level: 1, id: J(d, { lower: !0 }), children: d }),
152
+ u && /* @__PURE__ */ e.jsx(X, { children: u }),
153
+ n && /* @__PURE__ */ e.jsx(v, { level: 1, id: J(n, { lower: !0 }), children: n }),
144
154
  t.description && /* @__PURE__ */ e.jsx("p", { className: "prose-lg", children: t.description })
145
155
  ] }),
146
156
  /* @__PURE__ */ e.jsx(
147
- s,
157
+ r,
148
158
  {
149
- components: { ...$(), ...U }
159
+ components: { ...q(), ...U }
150
160
  }
151
161
  ),
152
- !S && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
162
+ !R && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
153
163
  /* @__PURE__ */ e.jsx("hr", {}),
154
164
  /* @__PURE__ */ e.jsxs("div", { className: "not-prose flex items-center justify-between gap-8", children: [
155
165
  p.path ? /* @__PURE__ */ e.jsxs(
156
- T,
166
+ A,
157
167
  {
158
168
  to: p.path,
159
169
  className: "flex flex-col items-stretch gap-2 flex-1 truncate border rounded px-6 py-4 text-start hover:border-primary/85 transition shadow-sm hover:shadow-md",
@@ -165,7 +175,7 @@ const K = F("ListTree", [
165
175
  }
166
176
  ) : /* @__PURE__ */ e.jsx("div", { className: "flex-1" }),
167
177
  h.path ? /* @__PURE__ */ e.jsxs(
168
- T,
178
+ A,
169
179
  {
170
180
  to: h.path,
171
181
  className: "flex flex-col items-stretch gap-2 flex-1 truncate border rounded px-6 py-4 text-end hover:border-primary/85 transition shadow-sm hover:shadow-md",
@@ -181,10 +191,10 @@ const K = F("ListTree", [
181
191
  ]
182
192
  }
183
193
  ),
184
- /* @__PURE__ */ e.jsx("div", { className: "hidden xl:block", children: C && /* @__PURE__ */ e.jsx(Q, { entries: v }) })
194
+ /* @__PURE__ */ e.jsx("div", { className: "hidden xl:block", children: S && /* @__PURE__ */ e.jsx(Q, { entries: f }) })
185
195
  ] });
186
196
  };
187
197
  export {
188
198
  ae as MdxPage
189
199
  };
190
- //# sourceMappingURL=MdxPage-DJTFOCbZ.js.map
200
+ //# sourceMappingURL=MdxPage-BjOLKhCI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MdxPage-BjOLKhCI.js","sources":["../../../node_modules/.pnpm/lucide-react@0.378.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/list-tree.js","../src/lib/plugins/markdown/Toc.tsx","../src/lib/plugins/markdown/MdxPage.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.378.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ListTree = createLucideIcon(\"ListTree\", [\n [\"path\", { d: \"M21 12h-8\", key: \"1bmf0i\" }],\n [\"path\", { d: \"M21 6H8\", key: \"1pqkrb\" }],\n [\"path\", { d: \"M21 18h-8\", key: \"1tm79t\" }],\n [\"path\", { d: \"M3 6v4c0 1.1.9 2 2 2h3\", key: \"1ywdgy\" }],\n [\"path\", { d: \"M3 10v6c0 1.1.9 2 2 2h3\", key: \"2wc746\" }]\n]);\n\nexport { ListTree as default };\n//# sourceMappingURL=list-tree.js.map\n","import type { TocEntry } from \"@stefanprobst/rehype-extract-toc\";\nimport { ListTreeIcon } from \"lucide-react\";\nimport {\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type PropsWithChildren,\n} from \"react\";\nimport { AnchorLink } from \"../../components/AnchorLink.js\";\nimport { useViewportAnchor } from \"../../components/context/ViewportAnchorContext.js\";\nimport { cn } from \"../../util/cn.js\";\n\nconst DATA_ANCHOR_ATTR = \"data-active\";\n\nconst TocItem = ({\n item,\n children,\n className,\n isActive,\n}: PropsWithChildren<{\n item: TocEntry;\n isActive: boolean;\n className?: string;\n}>) => {\n return (\n <li\n className={cn(\n \"truncate\",\n isActive\n ? \"text-primary\"\n : \"text-foreground/65 dark:text-foreground/75\",\n className,\n )}\n title={item.value}\n >\n <AnchorLink\n to={`#${item.id}`}\n {...{ [DATA_ANCHOR_ATTR]: item.id }}\n className={cn(\n isActive\n ? \"text-primary\"\n : \"text-foreground/65 dark:text-foreground/75 hover:text-foreground\",\n )}\n >\n {item.value}\n </AnchorLink>\n {children}\n </li>\n );\n};\n\nexport const Toc = ({ entries }: { entries: TocEntry[] }) => {\n const { activeAnchor } = useViewportAnchor();\n const listWrapperRef = useRef<HTMLUListElement>(null);\n const paintedOnce = useRef(false);\n const [indicatorStyle, setIndicatorStyles] = useState<CSSProperties>({\n top: 0,\n opacity: 0,\n });\n\n // synchronize active anchor indicator with the scroll position\n useEffect(() => {\n if (!listWrapperRef.current) return;\n\n const activeElement = listWrapperRef.current.querySelector(\n `[${DATA_ANCHOR_ATTR}='${activeAnchor}']`,\n );\n\n if (!activeElement) {\n setIndicatorStyles({ top: 0, opacity: 0 });\n return;\n }\n\n const topParent = listWrapperRef.current.getBoundingClientRect().top;\n const topElement = activeElement.getBoundingClientRect().top;\n\n setIndicatorStyles({\n opacity: 1,\n top: `${topElement - topParent}px`,\n });\n\n if (paintedOnce.current) return;\n\n // after all is painted, the indicator should animate\n requestIdleCallback(() => {\n paintedOnce.current = true;\n });\n }, [activeAnchor]);\n\n return (\n <aside className=\"sticky top-[--header-height] h-[calc(100vh-var(--header-height))] pt-[--padding-content-top] pb-[--padding-content-bottom] overflow-y-auto ps-1 text-sm\">\n <div className=\"flex items-center gap-2 font-medium mb-2\">\n <ListTreeIcon size={16} />\n On this page\n </div>\n <div className=\"relative ms-2 ps-4\">\n <div className=\"absolute inset-0 right-auto bg-border w-[2px]\" />\n <div\n className={cn(\n \"absolute -left-px -translate-y-1 h-6 w-[4px] rounded bg-primary\",\n paintedOnce.current &&\n \"ease-out [transition:top_150ms,opacity_325ms]\",\n )}\n style={indicatorStyle}\n />\n <ul\n ref={listWrapperRef}\n className=\"relative font-medium list-none space-y-2\"\n >\n {entries.map((item) => (\n <TocItem\n isActive={item.id === activeAnchor}\n key={item.id}\n item={item}\n className=\"pl-0\"\n >\n {item.children && (\n <ul className=\"list-none pl-4 pt-2 space-y-2\">\n {item.children.map((child) => (\n <TocItem\n item={child}\n isActive={child.id === activeAnchor}\n key={child.id}\n />\n ))}\n </ul>\n )}\n </TocItem>\n ))}\n </ul>\n </div>\n </aside>\n );\n};\n","import { useMDXComponents } from \"@mdx-js/react\";\nimport { Helmet } from \"@zudoku/react-helmet-async\";\nimport { useMemo, type PropsWithChildren, type ReactNode } from \"react\";\nimport { Link, useLocation } from \"react-router-dom\";\nimport { CategoryHeading } from \"../../components/CategoryHeading.js\";\nimport { Heading } from \"../../components/Heading.js\";\nimport { ProseClasses } from \"../../components/Markdown.js\";\nimport { useTopNavigationItem } from \"../../components/context/DevPortalProvider.js\";\nimport { isPathItem } from \"../../components/navigation/util.js\";\nimport type { MdxComponentsType } from \"../../util/MdxComponents.js\";\nimport { cn } from \"../../util/cn.js\";\nimport slugify from \"../../util/slugify.js\";\nimport { traverseNavigation } from \"../../util/traverseNavigation.js\";\nimport { Toc } from \"./Toc.js\";\nimport { MarkdownPluginDefaultOptions, MDXImport } from \"./index.js\";\n\nconst MarkdownHeadings = {\n h2: ({ children, id }) => (\n <Heading level={2} id={id} registerSidebarAnchor>\n {children}\n </Heading>\n ),\n h3: ({ children, id }) => (\n <Heading level={3} id={id} registerSidebarAnchor>\n {\" \"}\n {children}\n </Heading>\n ),\n} satisfies MdxComponentsType;\n\nexport const MdxPage = ({\n mdxComponent: MdxComponent,\n frontmatter = {},\n defaultOptions,\n tableOfContents,\n}: PropsWithChildren<\n Omit<MDXImport, \"default\"> & {\n mdxComponent: MDXImport[\"default\"];\n defaultOptions?: MarkdownPluginDefaultOptions;\n }\n>) => {\n const navItem = useTopNavigationItem();\n const location = useLocation();\n\n const categoryTitle = navItem\n ? traverseNavigation(navItem, (_node, fullPath, parentNodes) => {\n if (fullPath === location.pathname) {\n return parentNodes.at(0)?.label;\n }\n })\n : undefined;\n\n const title = frontmatter.title;\n const category = frontmatter.category ?? categoryTitle;\n const hideToc = frontmatter.toc === false || defaultOptions?.toc === false;\n const pageTitle =\n tableOfContents.find((item) => item.depth === 1)?.value ?? title;\n const hidePager =\n frontmatter.disablePager ?? defaultOptions?.disablePager ?? false;\n\n const tocEntries =\n tableOfContents.find((item) => item.depth === 1)?.children ??\n // if `title` is provided by frontmatter it does not appear in the table of contents\n tableOfContents.filter((item) => item.depth === 2);\n\n const showToc = !hideToc && tocEntries.length > 0;\n\n const { prev, next } = useMemo(() => {\n let prev = { path: \"\", label: \"\" as ReactNode };\n let next = { path: \"\", label: \"\" as ReactNode };\n let shouldStop = false;\n\n if (!navItem) return { prev, next };\n\n traverseNavigation(navItem, (node, fullPath) => {\n const item = { path: fullPath, label: node.label };\n\n if (shouldStop && isPathItem(node) && !node.children?.length) {\n next = item;\n return true;\n }\n if (fullPath === location.pathname) {\n shouldStop = true;\n }\n if (!shouldStop && isPathItem(node) && !node.children?.length) {\n prev = item;\n }\n });\n\n return { prev, next } as const;\n }, [navItem, location.pathname]);\n\n return (\n <div className=\"xl:grid grid-cols-[--sidecar-grid-cols] gap-8 justify-between\">\n <Helmet>\n <title>{pageTitle}</title>\n </Helmet>\n <div\n className={cn(\n ProseClasses,\n \"max-w-full xl:w-full xl:max-w-prose flex-1 flex-shrink pt-[--padding-content-top] pb-[--padding-content-bottom]\",\n )}\n >\n <header>\n {category && <CategoryHeading>{category}</CategoryHeading>}\n {title && (\n <Heading level={1} id={slugify(title, { lower: true })}>\n {title}\n </Heading>\n )}\n {frontmatter.description && (\n <p className=\"prose-lg\">{frontmatter.description}</p>\n )}\n </header>\n <MdxComponent\n components={{ ...useMDXComponents(), ...MarkdownHeadings }}\n />\n {!hidePager && (\n <>\n <hr />\n <div className=\"not-prose flex items-center justify-between gap-8\">\n {prev.path ? (\n <Link\n to={prev.path}\n className=\"flex flex-col items-stretch gap-2 flex-1 truncate border rounded px-6 py-4 text-start hover:border-primary/85 transition shadow-sm hover:shadow-md\"\n title={\n typeof prev.label === \"string\" ? prev.label : undefined\n }\n >\n <div className=\"text-sm text-muted-foreground\">\n ← Previous page\n </div>\n <div className=\"text-lg text-primary truncate\">\n {prev.label}\n </div>\n </Link>\n ) : (\n <div className=\"flex-1\" />\n )}\n {next.path ? (\n <Link\n to={next.path}\n className=\"flex flex-col items-stretch gap-2 flex-1 truncate border rounded px-6 py-4 text-end hover:border-primary/85 transition shadow-sm hover:shadow-md\"\n title={\n typeof next.label === \"string\" ? next.label : undefined\n }\n >\n <div className=\"text-sm text-muted-foreground\">\n Next page →\n </div>\n <div className=\"text-lg text-primary truncate\">\n {next.label}\n </div>\n </Link>\n ) : (\n <div className=\"flex-1\" />\n )}\n </div>\n </>\n )}\n </div>\n <div className=\"hidden xl:block\">\n {showToc && <Toc entries={tocEntries} />}\n </div>\n </div>\n );\n};\n"],"names":["ListTree","createLucideIcon","DATA_ANCHOR_ATTR","TocItem","item","children","className","isActive","jsxs","cn","jsx","AnchorLink","Toc","entries","activeAnchor","useViewportAnchor","listWrapperRef","useRef","paintedOnce","indicatorStyle","setIndicatorStyles","useState","useEffect","activeElement","topParent","topElement","ListTreeIcon","child","MarkdownHeadings","id","Heading","MdxPage","MdxComponent","frontmatter","defaultOptions","tableOfContents","navItem","useTopNavigationItem","location","useLocation","categoryTitle","traverseNavigation","_node","fullPath","parentNodes","_a","title","category","hideToc","pageTitle","hidePager","tocEntries","_b","showToc","prev","next","useMemo","shouldStop","node","isPathItem","Helmet","ProseClasses","CategoryHeading","slugify","useMDXComponents","Fragment","Link"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAWC,E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E,OAAOA,EAAK,SAAU,WAAWA,EAAK,QAAQ;AAAA,kBAGhD,UAAA;AAAA,oBAAC7C,gBAAAA,EAAA,IAAA,OAAA,EAAI,WAAU,iCAAgC,UAE/C,eAAA;AAAA,oBACCA,gBAAAA,EAAA,IAAA,OAAA,EAAI,WAAU,iCACZ,YAAK,OACR;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAGF,IAAAA,gBAAAA,EAAA,IAAC,OAAI,EAAA,WAAU,SAAS,CAAA;AAAA,YAAA,GAE5B;AAAA,UAAA,GACF;AAAA,QAAA;AAAA,MAAA;AAAA,IAEJ;AAAA,IACAA,gBAAAA,EAAAA,IAAC,SAAI,WAAU,mBACZ,eAAYA,gBAAAA,EAAA,IAAAE,GAAA,EAAI,SAASuC,EAAA,CAAY,EACxC,CAAA;AAAA,EACF,EAAA,CAAA;AAEJ;","x_google_ignoreList":[0]}
@@ -9,7 +9,7 @@ const f = (t, e) => {
9
9
  return {
10
10
  path: i.at(-1) === "index" ? i.slice(0, -1).join("/") : s,
11
11
  lazy: async () => {
12
- const { MdxPage: u } = await import("./MdxPage-DJTFOCbZ.js"), { default: c, ...l } = await m();
12
+ const { MdxPage: u } = await import("./MdxPage-BjOLKhCI.js"), { default: c, ...l } = await m();
13
13
  return {
14
14
  element: /* @__PURE__ */ o.jsx(
15
15
  u,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.3.0-dev.63",
3
+ "version": "0.3.0-dev.64",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",
@@ -53,7 +53,11 @@ const TocItem = ({
53
53
  export const Toc = ({ entries }: { entries: TocEntry[] }) => {
54
54
  const { activeAnchor } = useViewportAnchor();
55
55
  const listWrapperRef = useRef<HTMLUListElement>(null);
56
- const [indicatorStyle, setIndicatorStyles] = useState<CSSProperties>({});
56
+ const paintedOnce = useRef(false);
57
+ const [indicatorStyle, setIndicatorStyles] = useState<CSSProperties>({
58
+ top: 0,
59
+ opacity: 0,
60
+ });
57
61
 
58
62
  // synchronize active anchor indicator with the scroll position
59
63
  useEffect(() => {
@@ -64,10 +68,7 @@ export const Toc = ({ entries }: { entries: TocEntry[] }) => {
64
68
  );
65
69
 
66
70
  if (!activeElement) {
67
- setIndicatorStyles({
68
- "--indicator-top": "0",
69
- "--indicator-opacity": 0,
70
- } as CSSProperties);
71
+ setIndicatorStyles({ top: 0, opacity: 0 });
71
72
  return;
72
73
  }
73
74
 
@@ -75,9 +76,16 @@ export const Toc = ({ entries }: { entries: TocEntry[] }) => {
75
76
  const topElement = activeElement.getBoundingClientRect().top;
76
77
 
77
78
  setIndicatorStyles({
78
- "--indicator-top": `${topElement - topParent}px`,
79
- "--indicator-opacity": 1,
80
- } as CSSProperties);
79
+ opacity: 1,
80
+ top: `${topElement - topParent}px`,
81
+ });
82
+
83
+ if (paintedOnce.current) return;
84
+
85
+ // after all is painted, the indicator should animate
86
+ requestIdleCallback(() => {
87
+ paintedOnce.current = true;
88
+ });
81
89
  }, [activeAnchor]);
82
90
 
83
91
  return (
@@ -86,37 +94,42 @@ export const Toc = ({ entries }: { entries: TocEntry[] }) => {
86
94
  <ListTreeIcon size={16} />
87
95
  On this page
88
96
  </div>
89
-
90
- <ul
91
- ref={listWrapperRef}
92
- style={indicatorStyle}
93
- className={cn(
94
- "relative ms-2 ps-4 font-medium list-none mt-0 space-y-2",
95
- "before:absolute before:inset-0 before:right-auto before:bg-border before:w-[2px]",
96
- "after:absolute after:-left-px after:-translate-y-1 after:top-[--indicator-top] after:opacity-[--indicator-opacity] after:h-6 after:bg-primary after:w-[4px] after:rounded after:ease-out after:[transition:top__150ms,opacity_325ms]",
97
- )}
98
- >
99
- {entries.map((item) => (
100
- <TocItem
101
- isActive={item.id === activeAnchor}
102
- key={item.id}
103
- item={item}
104
- className="pl-0"
105
- >
106
- {item.children && (
107
- <ul className="list-none pl-4 pt-2 space-y-2">
108
- {item.children.map((child) => (
109
- <TocItem
110
- item={child}
111
- isActive={child.id === activeAnchor}
112
- key={child.id}
113
- />
114
- ))}
115
- </ul>
116
- )}
117
- </TocItem>
118
- ))}
119
- </ul>
97
+ <div className="relative ms-2 ps-4">
98
+ <div className="absolute inset-0 right-auto bg-border w-[2px]" />
99
+ <div
100
+ className={cn(
101
+ "absolute -left-px -translate-y-1 h-6 w-[4px] rounded bg-primary",
102
+ paintedOnce.current &&
103
+ "ease-out [transition:top_150ms,opacity_325ms]",
104
+ )}
105
+ style={indicatorStyle}
106
+ />
107
+ <ul
108
+ ref={listWrapperRef}
109
+ className="relative font-medium list-none space-y-2"
110
+ >
111
+ {entries.map((item) => (
112
+ <TocItem
113
+ isActive={item.id === activeAnchor}
114
+ key={item.id}
115
+ item={item}
116
+ className="pl-0"
117
+ >
118
+ {item.children && (
119
+ <ul className="list-none pl-4 pt-2 space-y-2">
120
+ {item.children.map((child) => (
121
+ <TocItem
122
+ item={child}
123
+ isActive={child.id === activeAnchor}
124
+ key={child.id}
125
+ />
126
+ ))}
127
+ </ul>
128
+ )}
129
+ </TocItem>
130
+ ))}
131
+ </ul>
132
+ </div>
120
133
  </aside>
121
134
  );
122
135
  };
@@ -1 +0,0 @@
1
- {"version":3,"file":"MdxPage-DJTFOCbZ.js","sources":["../../../node_modules/.pnpm/lucide-react@0.378.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/list-tree.js","../src/lib/plugins/markdown/Toc.tsx","../src/lib/plugins/markdown/MdxPage.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.378.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst ListTree = createLucideIcon(\"ListTree\", [\n [\"path\", { d: \"M21 12h-8\", key: \"1bmf0i\" }],\n [\"path\", { d: \"M21 6H8\", key: \"1pqkrb\" }],\n [\"path\", { d: \"M21 18h-8\", key: \"1tm79t\" }],\n [\"path\", { d: \"M3 6v4c0 1.1.9 2 2 2h3\", key: \"1ywdgy\" }],\n [\"path\", { d: \"M3 10v6c0 1.1.9 2 2 2h3\", key: \"2wc746\" }]\n]);\n\nexport { ListTree as default };\n//# sourceMappingURL=list-tree.js.map\n","import type { TocEntry } from \"@stefanprobst/rehype-extract-toc\";\nimport { ListTreeIcon } from \"lucide-react\";\nimport {\n useEffect,\n useRef,\n useState,\n type CSSProperties,\n type PropsWithChildren,\n} from \"react\";\nimport { AnchorLink } from \"../../components/AnchorLink.js\";\nimport { useViewportAnchor } from \"../../components/context/ViewportAnchorContext.js\";\nimport { cn } from \"../../util/cn.js\";\n\nconst DATA_ANCHOR_ATTR = \"data-active\";\n\nconst TocItem = ({\n item,\n children,\n className,\n isActive,\n}: PropsWithChildren<{\n item: TocEntry;\n isActive: boolean;\n className?: string;\n}>) => {\n return (\n <li\n className={cn(\n \"truncate\",\n isActive\n ? \"text-primary\"\n : \"text-foreground/65 dark:text-foreground/75\",\n className,\n )}\n title={item.value}\n >\n <AnchorLink\n to={`#${item.id}`}\n {...{ [DATA_ANCHOR_ATTR]: item.id }}\n className={cn(\n isActive\n ? \"text-primary\"\n : \"text-foreground/65 dark:text-foreground/75 hover:text-foreground\",\n )}\n >\n {item.value}\n </AnchorLink>\n {children}\n </li>\n );\n};\n\nexport const Toc = ({ entries }: { entries: TocEntry[] }) => {\n const { activeAnchor } = useViewportAnchor();\n const listWrapperRef = useRef<HTMLUListElement>(null);\n const [indicatorStyle, setIndicatorStyles] = useState<CSSProperties>({});\n\n // synchronize active anchor indicator with the scroll position\n useEffect(() => {\n if (!listWrapperRef.current) return;\n\n const activeElement = listWrapperRef.current.querySelector(\n `[${DATA_ANCHOR_ATTR}='${activeAnchor}']`,\n );\n\n if (!activeElement) {\n setIndicatorStyles({\n \"--indicator-top\": \"0\",\n \"--indicator-opacity\": 0,\n } as CSSProperties);\n return;\n }\n\n const topParent = listWrapperRef.current.getBoundingClientRect().top;\n const topElement = activeElement.getBoundingClientRect().top;\n\n setIndicatorStyles({\n \"--indicator-top\": `${topElement - topParent}px`,\n \"--indicator-opacity\": 1,\n } as CSSProperties);\n }, [activeAnchor]);\n\n return (\n <aside className=\"sticky top-[--header-height] h-[calc(100vh-var(--header-height))] pt-[--padding-content-top] pb-[--padding-content-bottom] overflow-y-auto ps-1 text-sm\">\n <div className=\"flex items-center gap-2 font-medium mb-2\">\n <ListTreeIcon size={16} />\n On this page\n </div>\n\n <ul\n ref={listWrapperRef}\n style={indicatorStyle}\n className={cn(\n \"relative ms-2 ps-4 font-medium list-none mt-0 space-y-2\",\n \"before:absolute before:inset-0 before:right-auto before:bg-border before:w-[2px]\",\n \"after:absolute after:-left-px after:-translate-y-1 after:top-[--indicator-top] after:opacity-[--indicator-opacity] after:h-6 after:bg-primary after:w-[4px] after:rounded after:ease-out after:[transition:top__150ms,opacity_325ms]\",\n )}\n >\n {entries.map((item) => (\n <TocItem\n isActive={item.id === activeAnchor}\n key={item.id}\n item={item}\n className=\"pl-0\"\n >\n {item.children && (\n <ul className=\"list-none pl-4 pt-2 space-y-2\">\n {item.children.map((child) => (\n <TocItem\n item={child}\n isActive={child.id === activeAnchor}\n key={child.id}\n />\n ))}\n </ul>\n )}\n </TocItem>\n ))}\n </ul>\n </aside>\n );\n};\n","import { useMDXComponents } from \"@mdx-js/react\";\nimport { Helmet } from \"@zudoku/react-helmet-async\";\nimport { useMemo, type PropsWithChildren, type ReactNode } from \"react\";\nimport { Link, useLocation } from \"react-router-dom\";\nimport { CategoryHeading } from \"../../components/CategoryHeading.js\";\nimport { Heading } from \"../../components/Heading.js\";\nimport { ProseClasses } from \"../../components/Markdown.js\";\nimport { useTopNavigationItem } from \"../../components/context/DevPortalProvider.js\";\nimport { isPathItem } from \"../../components/navigation/util.js\";\nimport type { MdxComponentsType } from \"../../util/MdxComponents.js\";\nimport { cn } from \"../../util/cn.js\";\nimport slugify from \"../../util/slugify.js\";\nimport { traverseNavigation } from \"../../util/traverseNavigation.js\";\nimport { Toc } from \"./Toc.js\";\nimport { MarkdownPluginDefaultOptions, MDXImport } from \"./index.js\";\n\nconst MarkdownHeadings = {\n h2: ({ children, id }) => (\n <Heading level={2} id={id} registerSidebarAnchor>\n {children}\n </Heading>\n ),\n h3: ({ children, id }) => (\n <Heading level={3} id={id} registerSidebarAnchor>\n {\" \"}\n {children}\n </Heading>\n ),\n} satisfies MdxComponentsType;\n\nexport const MdxPage = ({\n mdxComponent: MdxComponent,\n frontmatter = {},\n defaultOptions,\n tableOfContents,\n}: PropsWithChildren<\n Omit<MDXImport, \"default\"> & {\n mdxComponent: MDXImport[\"default\"];\n defaultOptions?: MarkdownPluginDefaultOptions;\n }\n>) => {\n const navItem = useTopNavigationItem();\n const location = useLocation();\n\n const categoryTitle = navItem\n ? traverseNavigation(navItem, (_node, fullPath, parentNodes) => {\n if (fullPath === location.pathname) {\n return parentNodes.at(0)?.label;\n }\n })\n : undefined;\n\n const title = frontmatter.title;\n const category = frontmatter.category ?? categoryTitle;\n const hideToc = frontmatter.toc === false || defaultOptions?.toc === false;\n const pageTitle =\n tableOfContents.find((item) => item.depth === 1)?.value ?? title;\n const hidePager =\n frontmatter.disablePager ?? defaultOptions?.disablePager ?? false;\n\n const tocEntries =\n tableOfContents.find((item) => item.depth === 1)?.children ??\n // if `title` is provided by frontmatter it does not appear in the table of contents\n tableOfContents.filter((item) => item.depth === 2);\n\n const showToc = !hideToc && tocEntries.length > 0;\n\n const { prev, next } = useMemo(() => {\n let prev = { path: \"\", label: \"\" as ReactNode };\n let next = { path: \"\", label: \"\" as ReactNode };\n let shouldStop = false;\n\n if (!navItem) return { prev, next };\n\n traverseNavigation(navItem, (node, fullPath) => {\n const item = { path: fullPath, label: node.label };\n\n if (shouldStop && isPathItem(node) && !node.children?.length) {\n next = item;\n return true;\n }\n if (fullPath === location.pathname) {\n shouldStop = true;\n }\n if (!shouldStop && isPathItem(node) && !node.children?.length) {\n prev = item;\n }\n });\n\n return { prev, next } as const;\n }, [navItem, location.pathname]);\n\n return (\n <div className=\"xl:grid grid-cols-[--sidecar-grid-cols] gap-8 justify-between\">\n <Helmet>\n <title>{pageTitle}</title>\n </Helmet>\n <div\n className={cn(\n ProseClasses,\n \"max-w-full xl:w-full xl:max-w-prose flex-1 flex-shrink pt-[--padding-content-top] pb-[--padding-content-bottom]\",\n )}\n >\n <header>\n {category && <CategoryHeading>{category}</CategoryHeading>}\n {title && (\n <Heading level={1} id={slugify(title, { lower: true })}>\n {title}\n </Heading>\n )}\n {frontmatter.description && (\n <p className=\"prose-lg\">{frontmatter.description}</p>\n )}\n </header>\n <MdxComponent\n components={{ ...useMDXComponents(), ...MarkdownHeadings }}\n />\n {!hidePager && (\n <>\n <hr />\n <div className=\"not-prose flex items-center justify-between gap-8\">\n {prev.path ? (\n <Link\n to={prev.path}\n className=\"flex flex-col items-stretch gap-2 flex-1 truncate border rounded px-6 py-4 text-start hover:border-primary/85 transition shadow-sm hover:shadow-md\"\n title={\n typeof prev.label === \"string\" ? prev.label : undefined\n }\n >\n <div className=\"text-sm text-muted-foreground\">\n ← Previous page\n </div>\n <div className=\"text-lg text-primary truncate\">\n {prev.label}\n </div>\n </Link>\n ) : (\n <div className=\"flex-1\" />\n )}\n {next.path ? (\n <Link\n to={next.path}\n className=\"flex flex-col items-stretch gap-2 flex-1 truncate border rounded px-6 py-4 text-end hover:border-primary/85 transition shadow-sm hover:shadow-md\"\n title={\n typeof next.label === \"string\" ? next.label : undefined\n }\n >\n <div className=\"text-sm text-muted-foreground\">\n Next page →\n </div>\n <div className=\"text-lg text-primary truncate\">\n {next.label}\n </div>\n </Link>\n ) : (\n <div className=\"flex-1\" />\n )}\n </div>\n </>\n )}\n </div>\n <div className=\"hidden xl:block\">\n {showToc && <Toc entries={tocEntries} />}\n </div>\n </div>\n );\n};\n"],"names":["ListTree","createLucideIcon","DATA_ANCHOR_ATTR","TocItem","item","children","className","isActive","jsxs","cn","jsx","AnchorLink","Toc","entries","activeAnchor","useViewportAnchor","listWrapperRef","useRef","indicatorStyle","setIndicatorStyles","useState","useEffect","activeElement","topParent","topElement","ListTreeIcon","child","MarkdownHeadings","id","Heading","MdxPage","MdxComponent","frontmatter","defaultOptions","tableOfContents","navItem","useTopNavigationItem","location","useLocation","categoryTitle","traverseNavigation","_node","fullPath","parentNodes","_a","title","category","hideToc","pageTitle","hidePager","tocEntries","_b","showToc","prev","next","useMemo","shouldStop","node","isPathItem","Helmet","ProseClasses","CategoryHeading","slugify","useMDXComponents","Fragment","Link"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAWC,EAAiB,YAAY;AAAA,EAC5C,CAAC,QAAQ,EAAE,GAAG,aAAa,KAAK,SAAQ,CAAE;AAAA,EAC1C,CAAC,QAAQ,EAAE,GAAG,WAAW,KAAK,SAAQ,CAAE;AAAA,EACxC,CAAC,QAAQ,EAAE,GAAG,aAAa,KAAK,SAAQ,CAAE;AAAA,EAC1C,CAAC,QAAQ,EAAE,GAAG,0BAA0B,KAAK,SAAQ,CAAE;AAAA,EACvD,CAAC,QAAQ,EAAE,GAAG,2BAA2B,KAAK,SAAQ,CAAE;AAC1D,CAAC,GCFKC,IAAmB,eAEnBC,IAAU,CAAC;AAAA,EACf,MAAAC;AAAA,EACA,UAAAC;AAAA,EACA,WAAAC;AAAA,EACA,UAAAC;AACF,MAMIC,gBAAAA,EAAA;AAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC;AAAA,MACT;AAAA,MACAF,IACI,iBACA;AAAA,MACJD;AAAA,IACF;AAAA,IACA,OAAOF,EAAK;AAAA,IAEZ,UAAA;AAAA,MAAAM,gBAAAA,EAAA;AAAA,QAACC;AAAA,QAAA;AAAA,UACC,IAAI,IAAIP,EAAK,EAAE;AAAA,UACT,CAACF,CAAgB,GAAGE,EAAK;AAAA,UAC/B,WAAWK;AAAA,YACTF,IACI,iBACA;AAAA,UACN;AAAA,UAEC,UAAKH,EAAA;AAAA,QAAA;AAAA,MACR;AAAA,MACCC;AAAA,IAAA;AAAA,EAAA;AAAA,GAKMO,IAA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