@docubook/markdown 2.0.0-alpha.1 → 2.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +16 -16
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1587,7 +1587,7 @@ function TooltipMdx({ text, tip }) {
|
|
|
1587
1587
|
const tailCenter = trigger.left + trigger.width / 2 - left;
|
|
1588
1588
|
setTailStyle({
|
|
1589
1589
|
left: Math.min(Math.max(tailCenter - TAIL_SIZE / 2, 2), bubble.width - TAIL_SIZE - 2),
|
|
1590
|
-
top: flip ? -TAIL_PROTRUSION + TAIL_PAD : bubble.height - TAIL_PAD
|
|
1590
|
+
top: flip ? -TAIL_PROTRUSION + TAIL_PAD + 1 : bubble.height - TAIL_PAD - 1
|
|
1591
1591
|
});
|
|
1592
1592
|
}, [open]);
|
|
1593
1593
|
const content = tip ?? "";
|
|
@@ -1598,13 +1598,13 @@ function TooltipMdx({ text, tip }) {
|
|
|
1598
1598
|
const shoulderY = TAIL_PAD;
|
|
1599
1599
|
const tipX = TAIL_TIP_X + TAIL_PAD;
|
|
1600
1600
|
const midY = (shoulderY + tipY) / 2;
|
|
1601
|
-
const
|
|
1601
|
+
const curveIn = 2.5;
|
|
1602
1602
|
const leftMid = (TAIL_PAD + tipX) / 2;
|
|
1603
1603
|
const rightMid = (tipX + TAIL_SIZE + TAIL_PAD) / 2;
|
|
1604
|
-
const curveLeft = leftMid
|
|
1605
|
-
const curveRight = rightMid
|
|
1604
|
+
const curveLeft = leftMid + curveIn;
|
|
1605
|
+
const curveRight = rightMid - curveIn;
|
|
1606
1606
|
const rightX = TAIL_SIZE + TAIL_PAD;
|
|
1607
|
-
const tailPath = below ? `M ${TAIL_PAD} ${tipY} Q ${curveLeft} ${midY} ${tipX} ${shoulderY} Q ${curveRight} ${midY} ${rightX} ${tipY}
|
|
1607
|
+
const tailPath = below ? `M ${TAIL_PAD} ${tipY} Q ${curveLeft} ${midY} ${tipX} ${shoulderY} Q ${curveRight} ${midY} ${rightX} ${tipY}` : `M ${TAIL_PAD} ${shoulderY} Q ${curveLeft} ${midY} ${tipX} ${tipY} Q ${curveRight} ${midY} ${rightX} ${shoulderY}`;
|
|
1608
1608
|
return /* @__PURE__ */ jsxs11(
|
|
1609
1609
|
"span",
|
|
1610
1610
|
{
|
|
@@ -1643,17 +1643,6 @@ function TooltipMdx({ text, tip }) {
|
|
|
1643
1643
|
role: "tooltip",
|
|
1644
1644
|
style: { position: "fixed", ...bubbleStyle, zIndex: 9999 },
|
|
1645
1645
|
children: [
|
|
1646
|
-
/* @__PURE__ */ jsx16(
|
|
1647
|
-
"svg",
|
|
1648
|
-
{
|
|
1649
|
-
"aria-hidden": "true",
|
|
1650
|
-
width: TAIL_SIZE,
|
|
1651
|
-
height: TAIL_PROTRUSION,
|
|
1652
|
-
viewBox: `0 0 ${TAIL_W} ${TAIL_H}`,
|
|
1653
|
-
style: { position: "absolute", ...tailStyle, display: "block" },
|
|
1654
|
-
children: /* @__PURE__ */ jsx16("path", { d: tailPath, fill: bubbleColor, stroke: borderColor, strokeWidth: 1 })
|
|
1655
|
-
}
|
|
1656
|
-
),
|
|
1657
1646
|
/* @__PURE__ */ jsx16(
|
|
1658
1647
|
"span",
|
|
1659
1648
|
{
|
|
@@ -1674,6 +1663,17 @@ function TooltipMdx({ text, tip }) {
|
|
|
1674
1663
|
},
|
|
1675
1664
|
children: content
|
|
1676
1665
|
}
|
|
1666
|
+
),
|
|
1667
|
+
/* @__PURE__ */ jsx16(
|
|
1668
|
+
"svg",
|
|
1669
|
+
{
|
|
1670
|
+
"aria-hidden": "true",
|
|
1671
|
+
width: TAIL_SIZE,
|
|
1672
|
+
height: TAIL_PROTRUSION,
|
|
1673
|
+
viewBox: `0 0 ${TAIL_W} ${TAIL_H}`,
|
|
1674
|
+
style: { position: "absolute", ...tailStyle, display: "block" },
|
|
1675
|
+
children: /* @__PURE__ */ jsx16("path", { d: tailPath, fill: bubbleColor, stroke: borderColor, strokeWidth: 1 })
|
|
1676
|
+
}
|
|
1677
1677
|
)
|
|
1678
1678
|
]
|
|
1679
1679
|
}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/registry/index.ts","../src/utils/Icon.tsx","../src/components/Callout.tsx","../src/components/AccordionMdx.tsx","../src/utils/AccordionGroupContext.tsx","../src/components/AccordionsMdx.tsx","../src/components/CardMdx.tsx","../src/components/LinkMdx.tsx","../src/components/CardsMdx.tsx","../src/components/CodeBlockMdx.tsx","../src/utils/CopyButton.tsx","../src/utils/ExpandableCode.tsx","../src/components/TreeMdx.tsx","../src/components/ImageMdx.tsx","../src/components/StepperMdx.tsx","../src/components/TabsMdx.tsx","../src/components/TableMdx.tsx","../src/components/TooltipMdx.tsx","../src/components/YoutubeMdx.tsx","../src/components/MermaidMdx.tsx"],"sourcesContent":["import { createElement, type ComponentType } from \"react\";\nimport { Callout, type CalloutType } from \"../components/Callout\";\nimport {\n AccordionMdx,\n AccordionsMdx,\n CardsMdx,\n CardMdx,\n CodeBlock,\n TreeMdx,\n ImageMdx,\n LinkMdx,\n StepMdx,\n StepsMdx,\n TableMdx,\n TableHeaderMdx,\n TableBodyMdx,\n TableFooterMdx,\n TableRowMdx,\n TableHeadMdx,\n TableCellMdx,\n TabMdx,\n TabsMdx,\n TooltipMdx,\n YoutubeMdx,\n MermaidMdx,\n} from \"../components\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type MdxComponentMap = Record<string, ComponentType<any>>;\n\nfunction callout(type: CalloutType): ComponentType<Record<string, unknown>> {\n return (props) => createElement(Callout, { type, ...props });\n}\n\nexport function createMdxComponents(customComponents: MdxComponentMap = {}): MdxComponentMap {\n return {\n Tabs: TabsMdx,\n Tab: TabMdx,\n table: TableMdx,\n thead: TableHeaderMdx,\n tbody: TableBodyMdx,\n tfoot: TableFooterMdx,\n tr: TableRowMdx,\n th: TableHeadMdx,\n td: TableCellMdx,\n pre: CodeBlock,\n a: LinkMdx,\n Link: LinkMdx,\n Card: CardMdx,\n Tip: callout(\"tip\"),\n Info: callout(\"info\"),\n Danger: callout(\"danger\"),\n Warning: callout(\"warning\"),\n Success: callout(\"success\"),\n Steps: StepsMdx,\n Step: StepMdx,\n Accordion: AccordionMdx,\n Accordions: AccordionsMdx,\n Cards: CardsMdx,\n Tree: TreeMdx,\n Image: ImageMdx,\n img: ImageMdx,\n Youtube: YoutubeMdx,\n Tooltip: TooltipMdx,\n Mermaid: MermaidMdx,\n ...customComponents,\n };\n}\n","import * as LucideIcons from \"lucide-react\";\nimport type { LucideProps } from \"lucide-react\";\nimport type { ReactNode, ComponentType } from \"react\";\n\nexport type IconName = keyof typeof LucideIcons;\nexport type IconProp = IconName | string;\n\nconst DEFAULT_ICON_SIZE = 20;\n\nexport function resolveLucideIcon(icon?: IconProp): ReactNode {\n const normalized = typeof icon === \"string\" ? icon.trim() : icon;\n if (!normalized || !Object.hasOwn(LucideIcons, normalized)) {\n return undefined;\n }\n\n const IconComponent = LucideIcons[normalized as IconName] as ComponentType<LucideProps>;\n\n return <IconComponent size={DEFAULT_ICON_SIZE} />;\n}\n","\"use client\";\n\nimport type { CSSProperties, HTMLAttributes, ReactNode } from \"react\";\nimport { type IconName, resolveLucideIcon } from \"../utils/Icon\";\n\nexport type CalloutType = \"tip\" | \"info\" | \"danger\" | \"warning\" | \"success\";\n\ntype CalloutProps = HTMLAttributes<HTMLElement> & {\n /** Internal — set by the registry variant (Tip/Info/Danger/Warning/Success). */\n type: CalloutType;\n /** Optional; falls back to the callout label (Tip, Info, …). */\n title?: string;\n children?: ReactNode;\n style?: CSSProperties;\n};\n\nconst palette: Record<\n CalloutType,\n {\n border: string;\n bg: string;\n text: string;\n header: string;\n content: string;\n defaultIcon: IconName;\n }\n> = {\n danger: {\n border: \"hsl(var(--destructive, 0 85% 60%))\",\n bg: \"hsl(var(--destructive, 0 85% 60%) / 0.16)\",\n text: \"hsl(var(--foreground, 220 30% 15%))\",\n header: \"hsl(var(--destructive, 0 85% 60%))\",\n content: \"hsl(var(--destructive, 0 85% 60%) / 0.75)\",\n defaultIcon: \"Siren\",\n },\n warning: {\n border: \"hsl(36 100% 56%)\",\n bg: \"rgba(249, 115, 22, 0.14)\",\n text: \"hsl(var(--foreground, 220 30% 15%))\",\n header: \"hsl(36 100% 56%)\",\n content: \"rgba(249, 115, 22, 0.9)\",\n defaultIcon: \"TriangleAlert\",\n },\n success: {\n border: \"hsl(137 50% 35%)\",\n bg: \"hsl(137 50% 35% / 0.16)\",\n text: \"hsl(var(--foreground, 220 30% 15%))\",\n header: \"hsl(137 50% 35%)\",\n content: \"hsl(137 50% 35% / 0.75)\",\n defaultIcon: \"CircleCheck\",\n },\n info: {\n border: \"hsl(var(--primary, 210 81% 56%))\",\n bg: \"hsl(var(--primary, 210 81% 56%) / 0.16)\",\n text: \"hsl(var(--foreground, 220 30% 15%))\",\n header: \"hsl(var(--primary, 210 81% 56%))\",\n content: \"hsl(var(--primary, 210 81% 56%) / 0.75)\",\n defaultIcon: \"Info\",\n },\n tip: {\n border: \"hsl(137 50% 35%)\",\n bg: \"hsl(137 50% 35% / 0.16)\",\n text: \"hsl(var(--foreground, 220 30% 15%))\",\n header: \"hsl(137 50% 35%)\",\n content: \"hsl(137 50% 35% / 0.75)\",\n defaultIcon: \"Lightbulb\",\n },\n};\n\nconst LABEL: Record<CalloutType, string> = {\n tip: \"Tip\",\n info: \"Info\",\n danger: \"Danger\",\n warning: \"Warning\",\n success: \"Success\",\n};\n\nexport function Callout({ type, title, children, style, className, ...props }: CalloutProps) {\n const token = palette[type];\n if (!token) return null;\n const resolvedIcon = resolveLucideIcon(token.defaultIcon);\n const normalizedTitle = typeof title === \"string\" ? title.trim() : title;\n const fallbackTitle = normalizedTitle || LABEL[type];\n\n return (\n <aside\n role=\"note\"\n className={className}\n {...props}\n style={{\n border: \"1px solid transparent\",\n borderLeft: `4px solid ${token.border}`,\n borderRadius: 10,\n background: token.bg,\n color: token.text,\n padding: \"0.5rem 1rem\",\n margin: \"1rem 0\",\n boxShadow: \"0 1px 2px rgba(15, 23, 42, 0.08)\",\n ...style,\n }}\n >\n {fallbackTitle || resolvedIcon ? (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: \"0.5rem\",\n fontWeight: 700,\n marginBottom: \"0.35rem\",\n color: token.header,\n }}\n >\n {resolvedIcon ? (\n <span\n aria-hidden=\"true\"\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 20,\n height: 20,\n color: token.header,\n }}\n >\n {resolvedIcon}\n </span>\n ) : null}\n <span style={{ color: token.header }}>{fallbackTitle}</span>\n </div>\n ) : null}\n <div style={{ color: token.content, lineHeight: 1.5 }}>{children}</div>\n </aside>\n );\n}\n","\"use client\";\n\nimport { useContext, useId, useState, type KeyboardEvent, type ReactNode } from \"react\";\nimport { AccordionGroupContext } from \"../utils/AccordionGroupContext\";\nimport { IconProp, resolveLucideIcon } from \"../utils/Icon\";\nimport { ChevronRight } from \"lucide-react\";\n\ntype AccordionMdxProps = {\n title: string;\n icon?: IconProp;\n className?: string;\n children?: ReactNode;\n};\n\nexport function AccordionMdx({ title, icon, className, children }: AccordionMdxProps) {\n const groupContext = useContext(AccordionGroupContext);\n const [localOpen, setLocalOpen] = useState(false);\n const panelId = useId();\n const triggerId = `${panelId}-trigger`;\n\n const isGroup = groupContext?.inGroup === true;\n const isOpen = isGroup ? groupContext?.openTitle === title : localOpen;\n const resolvedIcon = resolveLucideIcon(icon);\n\n function onToggle() {\n if (isGroup && groupContext) {\n groupContext.setOpenTitle(groupContext.openTitle === title ? null : title);\n return;\n }\n setLocalOpen((prev) => !prev);\n }\n\n return (\n <div\n className={`mdx-accordion ${isGroup ? \"mdx-accordion-group-item\" : \"\"} ${className ?? \"\"}`}\n style={{\n border: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n borderRadius: 10,\n overflow: \"hidden\",\n background: \"hsl(var(--card, 0 0% 100%))\",\n }}\n >\n <button\n className=\"mdx-accordion-header\"\n type=\"button\"\n onClick={onToggle}\n aria-expanded={isOpen}\n aria-controls={panelId}\n id={triggerId}\n onKeyDown={(event: KeyboardEvent<HTMLButtonElement>) => {\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n onToggle();\n }\n }}\n style={{\n width: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n gap: \"0.5rem\",\n textAlign: \"left\",\n border: 0,\n cursor: \"pointer\",\n background: \"hsl(var(--muted, 210 20% 92%))\",\n color: \"hsl(var(--foreground, 220 30% 15%))\",\n fontWeight: 600,\n padding: \"0.95rem 1rem\",\n }}\n >\n <ChevronRight\n className=\"mdx-accordion-chevron\"\n aria-hidden=\"true\"\n size={16}\n style={{\n transform: isOpen ? \"rotate(90deg)\" : \"rotate(0deg)\",\n transition: \"transform 0.2s ease\",\n flexShrink: 0,\n color: \"hsl(var(--foreground, 220 30% 15%) / 0.74)\",\n marginRight: \"0.4rem\",\n }}\n />\n <span style={{ display: \"inline-flex\", alignItems: \"center\", gap: \"0.5rem\", flex: 1 }}>\n {resolvedIcon ? (\n <span\n aria-hidden=\"true\"\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n minWidth: \"1.45rem\",\n height: \"1.45rem\",\n color: \"hsl(var(--foreground, 220 30% 15%))\",\n }}\n >\n {resolvedIcon}\n </span>\n ) : null}\n <span>{title}</span>\n </span>\n </button>\n <div\n id={panelId}\n role=\"region\"\n aria-labelledby={triggerId}\n hidden={!isOpen}\n className=\"mdx-accordion-content\"\n style={{\n padding: \"0.75rem 0.8rem\",\n background: \"hsl(var(--card, 0 0% 100%))\",\n color: \"hsl(var(--card-foreground, 220 30% 15%))\",\n }}\n >\n {children}\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport { createContext } from \"react\";\n\ntype AccordionGroupContextType = {\n inGroup: boolean;\n openTitle: string | null;\n setOpenTitle: (title: string | null) => void;\n};\n\nexport const AccordionGroupContext = createContext<AccordionGroupContextType | null>(null);\n","\"use client\";\n\nimport { useMemo, useState, type ReactNode } from \"react\";\nimport { AccordionGroupContext } from \"../utils/AccordionGroupContext\";\n\ntype AccordionsMdxProps = {\n children?: ReactNode;\n};\n\nexport function AccordionsMdx({ children }: AccordionsMdxProps) {\n const [openTitle, setOpenTitle] = useState<string | null>(null);\n\n const value = useMemo(() => ({ inGroup: true, openTitle, setOpenTitle }), [openTitle]);\n\n return (\n <AccordionGroupContext.Provider value={value}>\n <div\n className=\"mdx-accordion-group\"\n style={{\n margin: \"1rem 0\",\n display: \"grid\",\n gap: \"0.85rem\",\n }}\n >\n {children}\n </div>\n </AccordionGroupContext.Provider>\n );\n}\n","\"use client\";\n\nimport {\n cloneElement,\n useId,\n useState,\n type ComponentType,\n type CSSProperties,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport type { LucideProps } from \"lucide-react\";\nimport { LinkMdx } from \"./LinkMdx\";\nimport { IconProp, resolveLucideIcon } from \"../utils/Icon\";\nimport type { LinkMdxProps } from \"./LinkMdx\";\n\ntype LinkRenderer = ComponentType<LinkMdxProps>;\n\nexport type CardMdxProps = HTMLAttributes<HTMLDivElement> & {\n title: string;\n icon?: IconProp;\n href?: string;\n horizontal?: boolean;\n children?: ReactNode;\n style?: CSSProperties;\n /** Internal adapter hook: inject framework link component without duplicating styles. */\n __LinkComponent?: LinkRenderer;\n};\n\n// Styling follows the home Features card\n// (packages/flame/.docu/components/home/Features.tsx): rounded-2xl, p-6,\n// icon in a 12×12 primary/10 rounded box, grid-pattern backdrop, hover\n// border-primary/40 + shadow-lg.\nconst baseStyle: CSSProperties = {\n position: \"relative\",\n display: \"block\",\n border: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n borderRadius: 16, // rounded-2xl\n background: \"hsl(var(--card, 0 0% 100%))\", // bg-base-100\n color: \"hsl(var(--foreground, 220 30% 15%))\",\n textDecoration: \"none\",\n padding: \"1.5rem\", // p-6\n overflow: \"hidden\",\n transition: \"border-color 0.2s ease, box-shadow 0.24s ease, transform 0.24s ease\",\n};\n\nconst hoverStyle: CSSProperties = {\n borderColor: \"hsla(var(--primary, 210 81% 56%) / 0.4)\", // hover:border-primary/40\n boxShadow: \"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)\", // shadow-lg\n};\n\nconst iconBoxStyle: CSSProperties = {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 48, // h-12\n height: 48,\n borderRadius: 8, // rounded-lg\n background: \"hsla(var(--primary, 210 81% 56%) / 0.1)\", // bg-primary/10\n color: \"hsl(var(--primary, 210 81% 56%))\",\n flexShrink: 0,\n};\n\nexport function CardMdx({\n title,\n icon,\n href,\n horizontal,\n children,\n style,\n className,\n __LinkComponent,\n ...props\n}: CardMdxProps) {\n const patternId = `card-${useId().replace(/[:.]/g, \"-\")}`;\n const [hovered, setHovered] = useState(false);\n const resolvedIcon = resolveLucideIcon(icon);\n const LinkComponent = __LinkComponent ?? LinkMdx;\n\n const iconNode = resolvedIcon\n ? (cloneElement(resolvedIcon as ReactElement<LucideProps>, { size: 24 }) as ReactNode)\n : null;\n\n const content = (\n <>\n {/* Grid-pattern backdrop — fills the whole card (behind the padding).\n The card element (div or link) is position:relative, so absolute\n inset:0 here covers the full box edge to edge. */}\n <svg\n aria-hidden=\"true\"\n style={{\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n color: \"hsl(var(--primary, 210 81% 56%))\",\n pointerEvents: \"none\",\n }}\n >\n <defs>\n <pattern id={patternId} width=\"40\" height=\"40\" patternUnits=\"userSpaceOnUse\">\n <path\n d=\"M 40 0 L 0 0 0 40\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"0.5\"\n opacity=\"0.15\"\n />\n </pattern>\n </defs>\n <rect width=\"100%\" height=\"100%\" fill={`url(#${patternId})`} />\n </svg>\n\n <div style={{ position: \"relative\", zIndex: 10 }}>\n <div\n style={\n horizontal\n ? {\n display: \"grid\",\n gridTemplateColumns: \"auto 1fr\",\n gap: \"1rem\",\n alignItems: \"flex-start\",\n }\n : undefined\n }\n >\n {iconNode ? (\n <span\n aria-hidden=\"true\"\n data-card-icon=\"\"\n style={{\n ...iconBoxStyle,\n marginBottom: horizontal ? 0 : \"1rem\",\n }}\n >\n {iconNode}\n </span>\n ) : null}\n <div>\n <div\n style={{\n fontWeight: 600, // font-semibold\n fontSize: \"1.125rem\", // text-lg\n lineHeight: 1.4,\n marginBottom: children ? \"0.5rem\" : 0, // mb-2\n color: \"hsl(var(--foreground, 220 30% 15%))\",\n }}\n >\n {title}\n </div>\n {children ? (\n <div\n style={{\n color: \"hsl(var(--muted-foreground, 220 15% 50%))\", // text-muted-foreground\n fontSize: \"0.875rem\", // text-sm\n lineHeight: 1.5,\n }}\n >\n {children}\n </div>\n ) : null}\n </div>\n </div>\n </div>\n </>\n );\n\n const combinedStyle = {\n ...baseStyle,\n ...(hovered ? hoverStyle : null),\n ...style,\n };\n\n const handlers = {\n onMouseEnter: () => setHovered(true),\n onMouseLeave: () => setHovered(false),\n };\n\n if (href) {\n return (\n <LinkComponent\n href={href}\n data-card-hover=\"\"\n data-card-link=\"\"\n style={combinedStyle}\n {...handlers}\n {...(className ? { className } : {})}\n {...(props as React.ComponentProps<typeof LinkComponent>)}\n >\n {content}\n </LinkComponent>\n );\n }\n\n return (\n <div style={combinedStyle} {...handlers} {...(className ? { className } : {})} {...props}>\n {content}\n </div>\n );\n}\n","import type { ComponentProps } from \"react\";\n\nexport type LinkMdxProps = ComponentProps<\"a\">;\n\nexport function LinkMdx({ href, rel, target, ...props }: LinkMdxProps) {\n if (!href) return null;\n\n const external = /^https?:\\/\\//.test(href);\n const computedTarget = target ?? (external ? \"_blank\" : undefined);\n const computedRel = rel ?? (external ? \"noopener noreferrer\" : undefined);\n\n return <a href={href} target={computedTarget} rel={computedRel} {...props} />;\n}\n","import type { CSSProperties, ReactNode } from \"react\";\n\ntype CardsMdxProps = {\n cols?: number;\n children?: ReactNode;\n style?: CSSProperties;\n};\n\nexport function CardsMdx({ cols = 2, children, style }: CardsMdxProps) {\n const columnCount = Math.max(1, Math.min(4, cols));\n\n return (\n <div\n className=\"docubook-card-group\"\n style={\n {\n \"--docubook-card-group-template\": `repeat(${columnCount}, minmax(240px, 1fr))`,\n ...style,\n } as CSSProperties\n }\n >\n {children}\n </div>\n );\n}\n","import { isValidElement, type ComponentProps, type ReactNode } from \"react\";\nimport {\n SiJavascript,\n SiTypescript,\n SiReact,\n SiPython,\n SiGo,\n SiPhp,\n SiRuby,\n SiSwift,\n SiKotlin,\n SiHtml5,\n SiCss,\n SiSass,\n SiPostgresql,\n SiGraphql,\n SiYaml,\n SiToml,\n SiDocker,\n SiNginx,\n SiGit,\n SiGnubash,\n SiMarkdown,\n} from \"react-icons/si\";\nimport { FaJava, FaCode, FaRegFileAlt } from \"react-icons/fa\";\nimport { TbJson } from \"react-icons/tb\";\nimport { CopyButton } from \"../utils/CopyButton\";\nimport { ExpandableCode } from \"../utils/ExpandableCode\";\n\ntype CodeBlockProps = ComponentProps<\"pre\"> & {\n raw?: string;\n \"data-title\"?: string;\n \"data-language\"?: string;\n \"data-expandable\"?: string;\n \"data-expandable-lines\"?: string;\n};\n\nfunction getLanguage(className: string = \"\") {\n const match = className.match(/language-(\\w+)/);\n return match ? match[1] : \"text\";\n}\n\nfunction resolveLanguage(\n preClassName: string | undefined,\n dataLanguage: string | undefined,\n children: ReactNode\n) {\n if (typeof dataLanguage === \"string\" && dataLanguage.trim().length > 0) {\n return dataLanguage.trim().toLowerCase();\n }\n\n const languageFromPre = getLanguage(preClassName ?? \"\");\n if (languageFromPre !== \"text\") return languageFromPre;\n\n if (isValidElement(children)) {\n const childProps = children.props as { className?: string };\n if (typeof childProps.className === \"string\") {\n const languageFromCode = getLanguage(childProps.className);\n if (languageFromCode !== \"text\") return languageFromCode;\n }\n }\n\n return \"text\";\n}\n\nfunction getLanguageIcon(language: string) {\n const normalized = language.toLowerCase();\n const iconProps = { size: 14 };\n\n const map: Record<string, ReactNode> = {\n gitignore: <SiGit {...iconProps} />,\n docker: <SiDocker {...iconProps} />,\n dockerfile: <SiDocker {...iconProps} />,\n nginx: <SiNginx {...iconProps} />,\n sql: <SiPostgresql {...iconProps} />,\n graphql: <SiGraphql {...iconProps} />,\n yaml: <SiYaml {...iconProps} />,\n yml: <SiYaml {...iconProps} />,\n toml: <SiToml {...iconProps} />,\n json: <TbJson {...iconProps} />,\n md: <SiMarkdown {...iconProps} />,\n markdown: <SiMarkdown {...iconProps} />,\n bash: <SiGnubash {...iconProps} />,\n sh: <SiGnubash {...iconProps} />,\n shell: <SiGnubash {...iconProps} />,\n swift: <SiSwift {...iconProps} />,\n kotlin: <SiKotlin {...iconProps} />,\n kt: <SiKotlin {...iconProps} />,\n kts: <SiKotlin {...iconProps} />,\n rb: <SiRuby {...iconProps} />,\n ruby: <SiRuby {...iconProps} />,\n php: <SiPhp {...iconProps} />,\n go: <SiGo {...iconProps} />,\n py: <SiPython {...iconProps} />,\n python: <SiPython {...iconProps} />,\n java: <FaJava {...iconProps} />,\n tsx: <SiReact {...iconProps} />,\n typescript: <SiTypescript {...iconProps} />,\n ts: <SiTypescript {...iconProps} />,\n jsx: <SiReact {...iconProps} />,\n js: <SiJavascript {...iconProps} />,\n javascript: <SiJavascript {...iconProps} />,\n html: <SiHtml5 {...iconProps} />,\n css: <SiCss {...iconProps} />,\n scss: <SiSass {...iconProps} />,\n sass: <SiSass {...iconProps} />,\n text: <FaRegFileAlt {...iconProps} />,\n plaintext: <FaRegFileAlt {...iconProps} />,\n };\n\n return map[normalized] || <FaCode {...iconProps} />;\n}\n\nfunction countCodeLines(raw: string) {\n let normalized = raw.replace(/\\r\\n/g, \"\\n\");\n if (normalized.startsWith(\"\\n\")) normalized = normalized.slice(1);\n if (normalized.endsWith(\"\\n\")) normalized = normalized.slice(0, -1);\n\n if (normalized.length === 0) return 0;\n return normalized.split(\"\\n\").length;\n}\n\nexport function CodeBlock({ children, raw, ...rest }: CodeBlockProps) {\n const {\n className,\n \"data-title\": title,\n \"data-language\": dataLanguage,\n \"data-expandable\": isExpandable,\n \"data-expandable-lines\": totalLinesStr,\n ...props\n } = rest;\n\n const language = resolveLanguage(\n typeof className === \"string\" ? className : undefined,\n dataLanguage,\n children\n );\n const totalLinesFromMeta = parseInt(totalLinesStr as string, 10) || 0;\n const totalLinesFromRaw = raw ? countCodeLines(raw) : 0;\n const totalLines = totalLinesFromRaw || totalLinesFromMeta;\n const hasExpandableClass =\n typeof className === \"string\" && className.split(\" \").includes(\"mdx-expandable-code\");\n const shouldExpand = isExpandable === \"true\" || hasExpandableClass;\n const preProps = {\n ...props,\n \"data-expandable\": isExpandable,\n \"data-expandable-lines\": totalLinesStr,\n };\n\n return (\n <div\n className=\"code-block-container not-prose\"\n style={{\n position: \"relative\",\n margin: \"1.5rem 0\",\n border: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n overflow: \"hidden\",\n fontSize: \"0.875rem\",\n borderRadius: \"0.75rem\",\n }}\n >\n <div\n className=\"code-block-header\"\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: \"0.75rem\",\n background: \"hsl(var(--muted, 210 20% 92%))\",\n padding: \"0.5rem 1rem\",\n borderBottom: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n color: \"hsl(var(--muted-foreground, 220 15% 50%))\",\n fontFamily: \"monospace\",\n fontSize: \"0.8rem\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n fontSize: \"0.78rem\",\n color: \"hsl(var(--muted-foreground, 220 15% 50%))\",\n }}\n >\n {getLanguageIcon(language)}\n <span>{title || language}</span>\n </div>\n {raw ? (\n <div\n className=\"code-block-actions\"\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n marginLeft: \"auto\",\n }}\n >\n <div\n style={{\n color: \"hsl(var(--muted-foreground, 220 15% 50%))\",\n transition: \"color 0.2s ease-in-out\",\n }}\n >\n <CopyButton content={raw} />\n </div>\n </div>\n ) : null}\n </div>\n <div\n className=\"code-block-body\"\n style={\n {\n overflowY: \"visible\",\n backgroundColor: \"hsl(var(--background, 210 40% 98%))\",\n willChange: \"transform\",\n borderBottom: \"none\",\n } as React.CSSProperties\n }\n >\n <ExpandableCode\n isExpandable={shouldExpand}\n totalLines={totalLines}\n preContent={children}\n preProps={preProps}\n className={className}\n />\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport { useEffect, useId, useRef, useState } from \"react\";\n\ntype CopyButtonProps = {\n content: string;\n};\n\nexport function CopyButton({ content }: CopyButtonProps) {\n const [copied, setCopied] = useState(false);\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const statusId = useId();\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, []);\n\n async function onCopy() {\n try {\n await navigator.clipboard.writeText(content);\n setCopied(true);\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n timeoutRef.current = setTimeout(() => setCopied(false), 1600);\n } catch {\n setCopied(false);\n }\n }\n\n return (\n <button\n type=\"button\"\n onClick={onCopy}\n aria-label={copied ? \"Copied\" : \"Copy code\"}\n aria-describedby={statusId}\n style={{\n position: \"relative\",\n border: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n borderRadius: 8,\n background: \"hsl(var(--card, 0 0% 100%))\",\n color: \"hsl(var(--foreground, 220 30% 15%))\",\n fontSize: \"0.78rem\",\n padding: \"0.35rem 0.55rem\",\n cursor: \"copy\",\n }}\n >\n {copied ? \"Copied\" : \"Copy\"}\n <span\n id={statusId}\n aria-live=\"polite\"\n style={{ position: \"absolute\", left: -9999, top: \"auto\" }}\n >\n {copied ? \"Code copied to clipboard\" : \"Ready to copy code\"}\n </span>\n </button>\n );\n}\n","\"use client\";\n\nimport { useEffect, useState, useRef, type ReactNode } from \"react\";\nimport { Ellipsis } from \"lucide-react\";\n\ntype ExpandableCodeProps = {\n isExpandable: boolean;\n totalLines: number;\n preContent: ReactNode;\n preProps: Record<string, unknown>;\n className?: string;\n};\n\nconst DEFAULT_VISIBLE_LINES = 20;\nconst FALLBACK_LINE_HEIGHT_PX = 24;\n\nexport function ExpandableCode({\n isExpandable,\n totalLines,\n preContent,\n preProps,\n className,\n}: ExpandableCodeProps) {\n const [isOpen, setIsOpen] = useState(false);\n const [collapsedMaxHeight, setCollapsedMaxHeight] = useState(\n `${DEFAULT_VISIBLE_LINES * FALLBACK_LINE_HEIGHT_PX}px`\n );\n const preRef = useRef<HTMLPreElement>(null);\n\n const shouldShow = isExpandable && totalLines > DEFAULT_VISIBLE_LINES;\n const isCollapsed = shouldShow && !isOpen;\n\n useEffect(() => {\n const pre = preRef.current;\n if (!pre) return;\n\n const calculateCollapsedHeight = () => {\n const styles = window.getComputedStyle(pre);\n const paddingTop = Number.parseFloat(styles.paddingTop) || 0;\n const paddingBottom = Number.parseFloat(styles.paddingBottom) || 0;\n const contentHeight = Math.max(pre.scrollHeight - paddingTop - paddingBottom, 0);\n\n if (totalLines > 0 && contentHeight > 0) {\n const lineHeight = contentHeight / totalLines;\n setCollapsedMaxHeight(\n `${DEFAULT_VISIBLE_LINES * lineHeight + paddingTop + paddingBottom}px`\n );\n return;\n }\n\n let lineHeight = Number.parseFloat(styles.lineHeight);\n if (!Number.isFinite(lineHeight) || lineHeight === 0) {\n const fontSize = Number.parseFloat(styles.fontSize);\n lineHeight = Number.isFinite(fontSize) ? fontSize * 1.5 : FALLBACK_LINE_HEIGHT_PX;\n }\n\n setCollapsedMaxHeight(`${DEFAULT_VISIBLE_LINES * lineHeight + paddingTop + paddingBottom}px`);\n };\n\n const frame = requestAnimationFrame(calculateCollapsedHeight);\n const timeout = window.setTimeout(calculateCollapsedHeight, 50);\n window.addEventListener(\"resize\", calculateCollapsedHeight);\n\n return () => {\n cancelAnimationFrame(frame);\n window.clearTimeout(timeout);\n window.removeEventListener(\"resize\", calculateCollapsedHeight);\n };\n }, [preContent, totalLines]);\n\n return (\n <>\n <div className=\"mdx-expandable-code-container\">\n <pre\n ref={preRef}\n {...preProps}\n className={`${className || \"\"} mdx-expandable-code`}\n style={{\n margin: 0,\n padding: \"0.9rem\",\n overflowX: \"auto\",\n minWidth: \"100%\",\n maxHeight: isCollapsed ? collapsedMaxHeight : \"none\",\n overflowY: isCollapsed ? \"hidden\" : \"visible\",\n transition: \"max-height 0.3s ease\",\n scrollbarWidth: \"thin\",\n }}\n >\n {preContent}\n </pre>\n </div>\n\n {shouldShow && (\n <div\n className=\"code-block-expandable-footer\"\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"0.6rem\",\n background: \"hsl(var(--muted, 210 20% 92%))\",\n borderTop: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n }}\n >\n <button\n className=\"code-block-expandable-toggle\"\n onClick={() => setIsOpen(!isOpen)}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: \"0.5rem\",\n padding: \"0.4rem 0.8rem\",\n border: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n borderRadius: 6,\n background: \"hsl(var(--background, 210 40% 98%))\",\n color: \"hsl(var(--foreground, 220 30% 15%))\",\n fontSize: \"0.85rem\",\n fontWeight: 500,\n cursor: \"pointer\",\n transition: \"all 0.2s ease\",\n fontFamily: \"inherit\",\n }}\n >\n <Ellipsis\n size={16}\n style={{\n transform: isOpen ? \"rotate(180deg)\" : \"rotate(0deg)\",\n transition: \"transform 0.2s ease\",\n }}\n />\n <span>{isOpen ? \"Collapse\" : `See all ${totalLines} lines`}</span>\n </button>\n </div>\n )}\n </>\n );\n}\n","\"use client\";\n\nimport React, {\n useId,\n useState,\n type CSSProperties,\n type KeyboardEvent,\n type ReactNode,\n} from \"react\";\nimport { ChevronRight, File as FileIcon, Folder as FolderIcon, FolderOpen } from \"lucide-react\";\n\ntype TreeMdxProps = {\n className?: string;\n style?: CSSProperties;\n children?: ReactNode;\n};\n\ninterface TreeNode {\n name: string;\n children: TreeNode[];\n}\n\n/** Collect all text (and inline code) from the rendered children tree. */\nfunction collectText(node: ReactNode, out: string[]): void {\n if (typeof node === \"string\" || typeof node === \"number\") {\n out.push(String(node));\n } else if (Array.isArray(node)) {\n node.forEach((n) => collectText(n, out));\n } else if (React.isValidElement(node)) {\n const kids = (node.props as { children?: ReactNode } | undefined)?.children;\n if (kids !== undefined && kids !== null) collectText(kids, out);\n }\n}\n\n/**\n * Parse ASCII tree lines into a node tree.\n * - first line = root (never popped)\n * - depth = count of \"│\" pipes before the connector (leading spaces are\n * stripped by the markdown parser, so indentation MUST use pipes)\n * - folder: name ends with \"/\" (trailing slash)\n */\nfunction parseTree(text: string): TreeNode[] {\n const root: TreeNode[] = [];\n const stack: { node: TreeNode; depth: number }[] = [];\n let first = true;\n for (const raw of text.split(\"\\n\")) {\n const line = raw.replace(/\\t/g, \" \");\n if (!line.trim()) continue;\n const connectorIdx = line.search(/[├└]/);\n const prefix = connectorIdx >= 0 ? line.slice(0, connectorIdx) : \"\";\n const name = line.replace(/^[\\s│├└─]+/, \"\").trim();\n if (!name) continue;\n const depth = (prefix.match(/│/g) || []).length;\n const node: TreeNode = { name: name.replace(/\\/+$/, \"\"), children: [] };\n if (first) {\n root.push(node);\n stack.push({ node, depth });\n first = false;\n continue;\n }\n // root is never popped (stack.length > 1 guard)\n while (stack.length > 1 && stack[stack.length - 1].depth >= depth) stack.pop();\n stack[stack.length - 1].node.children.push(node);\n stack.push({ node, depth });\n }\n return root;\n}\n\nexport function TreeMdx({ className, style, children }: TreeMdxProps) {\n const parts: string[] = [];\n collectText(children, parts);\n const tree = parseTree(parts.join(\"\"));\n if (tree.length === 0) return null;\n\n return (\n <div\n className={className}\n role=\"tree\"\n aria-label=\"Tree\"\n style={{\n border: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n borderRadius: 12,\n padding: \"0.5rem\",\n margin: \"1rem 0\",\n background: \"hsla(var(--card, 0 0% 100%) / 0.9)\",\n backdropFilter: \"blur(8px)\",\n boxShadow: \"0 10px 20px rgba(0,0,0,0.05)\",\n ...style,\n }}\n >\n {tree.map((node) => (\n <TreeRow key={node.name} node={node} />\n ))}\n </div>\n );\n}\n\nfunction TreeRow({ node }: { node: TreeNode }) {\n const [isOpen, setIsOpen] = useState(true);\n const [isHovered, setIsHovered] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n const hasChildren = node.children.length > 0;\n const groupId = useId();\n\n const handleKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (!hasChildren) return;\n if (event.key === \"ArrowRight\") {\n event.preventDefault();\n setIsOpen(true);\n return;\n }\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n setIsOpen(false);\n return;\n }\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n setIsOpen((prev) => !prev);\n }\n };\n\n return (\n <div\n role=\"treeitem\"\n aria-expanded={hasChildren ? isOpen : undefined}\n style={{ marginLeft: \"0.35rem\" }}\n >\n <button\n type=\"button\"\n className=\"flex items-center gap-2 rounded-md px-2 py-1.5 transition-colors duration-150\"\n onClick={() => hasChildren && setIsOpen((prev) => !prev)}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n onKeyDown={handleKeyDown}\n aria-label={`${isOpen ? \"Collapse\" : \"Expand\"} ${node.name}`}\n aria-expanded={hasChildren ? isOpen : undefined}\n aria-controls={hasChildren ? groupId : undefined}\n style={{\n cursor: hasChildren ? \"pointer\" : \"default\",\n width: \"100%\",\n border: \"none\",\n textAlign: \"left\",\n background:\n isHovered || isFocused ? \"hsla(var(--muted, 210 20% 92%) / 0.45)\" : \"transparent\",\n }}\n >\n {hasChildren ? (\n <ChevronRight\n className=\"h-3.5 w-3.5 transition-transform duration-200\"\n style={{\n transform: isOpen ? \"rotate(90deg)\" : \"rotate(0deg)\",\n color:\n isHovered || isFocused\n ? \"hsl(var(--primary, 210 81% 56%))\"\n : \"hsl(var(--muted-foreground, 220 15% 50%))\",\n }}\n />\n ) : (\n <FileIcon\n className=\"h-3.5 w-3.5\"\n style={{\n color:\n isHovered || isFocused\n ? \"hsl(var(--primary, 210 81% 56%))\"\n : \"hsl(var(--muted-foreground, 220 15% 50%))\",\n }}\n />\n )}\n {hasChildren && isOpen ? (\n <FolderOpen\n className=\"h-4 w-4\"\n style={{\n color:\n isHovered || isFocused\n ? \"hsl(var(--primary, 210 81% 56%))\"\n : \"hsl(var(--muted-foreground, 220 15% 50%))\",\n }}\n />\n ) : (\n hasChildren && (\n <FolderIcon\n className=\"h-4 w-4\"\n style={{\n color:\n isHovered || isFocused\n ? \"hsl(var(--primary, 210 81% 56%))\"\n : \"hsl(var(--muted-foreground, 220 15% 50%))\",\n }}\n />\n )\n )}\n <span\n style={{\n fontWeight: 600,\n fontFamily: hasChildren\n ? \"inherit\"\n : \"SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace\",\n fontSize: \"0.9rem\",\n color:\n isHovered || isFocused\n ? \"hsl(var(--primary, 210 81% 56%))\"\n : \"hsl(var(--foreground, 220 30% 15%))\",\n }}\n >\n {node.name}\n </span>\n </button>\n {hasChildren && isOpen && (\n <div\n id={groupId}\n role=\"group\"\n style={{\n marginLeft: \"1rem\",\n borderLeft: \"2px solid hsl(var(--border-color, 210 20% 85%))\",\n paddingLeft: \"0.6rem\",\n }}\n >\n {node.children.map((child) => (\n <TreeRow key={child.name} node={child} />\n ))}\n </div>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport { createPortal } from \"react-dom\";\nimport { useEffect, useId, useRef, useState, type ComponentProps, type ComponentType } from \"react\";\n\nexport type ImageMdxProps = Omit<ComponentProps<\"img\">, \"src\"> & {\n src?: any;\n zoom?: boolean;\n ImageComponent?: ComponentType<any>;\n};\n\nexport function ImageMdx({\n src,\n alt = \"image\",\n width = 800,\n height = 350,\n zoom = true,\n style,\n ImageComponent,\n ...props\n}: ImageMdxProps) {\n const Image: any = ImageComponent ?? \"img\";\n const [isOpen, setIsOpen] = useState(false);\n const scrollYRef = useRef(0);\n const closeButtonRef = useRef<HTMLButtonElement | null>(null);\n const dialogId = useId();\n\n useEffect(() => {\n if (!isOpen) return;\n\n scrollYRef.current = window.scrollY;\n document.body.style.position = \"fixed\";\n document.body.style.top = `-${scrollYRef.current}px`;\n document.body.style.width = \"100%\";\n\n closeButtonRef.current?.focus();\n\n const onEsc = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") setIsOpen(false);\n };\n\n const onFocusTrap = (e: KeyboardEvent) => {\n if (e.key !== \"Tab\") return;\n\n const dialog = document.getElementById(dialogId);\n const focusable = dialog?.querySelectorAll<HTMLElement>(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n\n if (!focusable || focusable.length === 0) return;\n\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n\n if (!e.shiftKey && document.activeElement === last) {\n e.preventDefault();\n first.focus();\n }\n\n if (e.shiftKey && document.activeElement === first) {\n e.preventDefault();\n last.focus();\n }\n };\n\n window.addEventListener(\"keydown\", onEsc);\n window.addEventListener(\"keydown\", onFocusTrap);\n\n return () => {\n document.body.style.position = \"\";\n document.body.style.top = \"\";\n document.body.style.width = \"\";\n window.scrollTo(0, scrollYRef.current);\n window.removeEventListener(\"keydown\", onEsc);\n window.removeEventListener(\"keydown\", onFocusTrap);\n };\n }, [dialogId, isOpen]);\n\n if (!src) return null;\n\n const canZoom = zoom;\n\n return (\n <>\n <button\n type=\"button\"\n onClick={() => canZoom && setIsOpen(true)}\n aria-label={canZoom ? \"Zoom image\" : \"Image\"}\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n position: \"relative\",\n width: \"100%\",\n border: \"none\",\n background: \"transparent\",\n padding: 0,\n margin: \"1rem 0\",\n cursor: canZoom ? \"zoom-in\" : \"default\",\n }}\n >\n <Image\n src={src}\n alt={alt}\n width={typeof width === \"number\" ? width : parseInt(width as string, 10)}\n height={typeof height === \"number\" ? height : parseInt(height as string, 10)}\n style={{\n maxWidth: \"100%\",\n height: \"auto\",\n borderRadius: 10,\n ...style,\n }}\n {...props}\n />\n </button>\n\n {canZoom && isOpen ? (\n <Portal>\n <div\n id={dialogId}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Image preview\"\n onClick={() => setIsOpen(false)}\n style={{\n position: \"fixed\",\n inset: 0,\n zIndex: 99999,\n background: \"rgba(0,0,0,0.88)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"1rem\",\n }}\n >\n <button\n ref={closeButtonRef}\n type=\"button\"\n aria-label=\"Close image preview\"\n onClick={(e) => {\n e.stopPropagation();\n setIsOpen(false);\n }}\n style={{\n position: \"absolute\",\n top: 16,\n right: 16,\n border: \"1px solid rgba(255,255,255,0.24)\",\n borderRadius: 8,\n background: \"rgba(0,0,0,0.45)\",\n color: \"#fff\",\n padding: \"0.4rem 0.55rem\",\n cursor: \"pointer\",\n }}\n >\n Close\n </button>\n\n <div\n onClick={(e) => e.stopPropagation()}\n style={{\n maxWidth: \"92vw\",\n maxHeight: \"90vh\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <Image\n src={src}\n alt={alt}\n width={1920}\n height={1080}\n style={{\n width: \"auto\",\n height: \"auto\",\n maxWidth: \"92vw\",\n maxHeight: \"90vh\",\n objectFit: \"contain\",\n borderRadius: 10,\n }}\n />\n </div>\n </div>\n </Portal>\n ) : null}\n </>\n );\n}\n\nfunction Portal({ children }: { children: React.ReactNode }) {\n if (typeof window === \"undefined\") return null;\n return createPortal(children, document.body);\n}\n","import {\n Children,\n cloneElement,\n isValidElement,\n type CSSProperties,\n type HTMLAttributes,\n type LiHTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from \"react\";\n\ntype StepsMdxProps = HTMLAttributes<HTMLOListElement> & {\n children?: ReactNode;\n style?: CSSProperties;\n};\n\ntype StepMdxProps = LiHTMLAttributes<HTMLLIElement> & {\n title: string;\n children?: ReactNode;\n style?: CSSProperties;\n};\n\n// Internal props including stepNumber (auto-injected)\ntype InternalStepProps = StepMdxProps & {\n stepNumber?: number;\n};\n\nexport function StepsMdx({ children, style, className, ...props }: StepsMdxProps) {\n const items = Children.toArray(children);\n\n return (\n <ol\n className={className}\n {...props}\n style={{\n listStyle: \"none\",\n position: \"relative\",\n margin: \"1.2rem 0\",\n padding: 0,\n display: \"grid\",\n gap: 0,\n ...style,\n }}\n >\n {items.map((child, index) => {\n if (!isValidElement(child)) {\n return child;\n }\n\n const item = child as ReactElement<InternalStepProps>;\n\n return cloneElement(item, {\n stepNumber: index + 1,\n });\n })}\n\n {items.length > 1 ? (\n <span\n aria-hidden=\"true\"\n style={{\n position: \"absolute\",\n left: \"1.05rem\",\n top: \"0.8rem\",\n bottom: \"0.8rem\",\n width: 1,\n background: \"hsl(var(--border-color, 210 20% 85%))\",\n pointerEvents: \"none\",\n }}\n />\n ) : null}\n </ol>\n );\n}\n\nexport function StepMdx({ title, children, style, className, ...props }: InternalStepProps) {\n const { stepNumber, ...liProps } = props as InternalStepProps;\n\n return (\n <li\n className={className}\n {...liProps}\n style={{\n position: \"relative\",\n zIndex: 1,\n width: \"100%\",\n minWidth: 0,\n boxSizing: \"border-box\",\n marginLeft: \"0.25rem\",\n paddingLeft: \"2.6rem\",\n paddingBottom: \"1.15rem\",\n ...style,\n }}\n >\n <span\n aria-hidden=\"true\"\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: stepNumber && stepNumber >= 10 ? \"1.9rem\" : \"1.6rem\",\n height: \"1.6rem\",\n borderRadius: 10,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: \"0.82rem\",\n fontWeight: 600,\n color: \"hsl(var(--muted-foreground, 220 15% 50%))\",\n background: \"hsl(var(--muted, 210 12% 92%))\",\n border: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n }}\n >\n {stepNumber ?? \"-\"}\n </span>\n\n <div\n style={{\n fontWeight: 700,\n fontSize: \"1.02rem\",\n lineHeight: 1.35,\n marginBottom: children ? \"0.55rem\" : 0,\n color: \"hsl(var(--foreground, 220 30% 15%))\",\n }}\n >\n {title}\n </div>\n {children ? (\n <div\n style={{\n color: \"hsl(var(--muted-foreground, 220 15% 50%))\",\n display: \"flow-root\",\n width: \"100%\",\n minWidth: 0,\n maxWidth: \"100%\",\n overflowX: \"auto\",\n overflowY: \"hidden\",\n }}\n >\n {children}\n </div>\n ) : null}\n </li>\n );\n}\n","\"use client\";\n\nimport {\n Children,\n isValidElement,\n useId,\n useState,\n type ReactElement,\n type ReactNode,\n} from \"react\";\n\ntype TabMdxProps = {\n title: string;\n children?: ReactNode;\n};\n\nexport function TabMdx({ children }: TabMdxProps) {\n return <>{children}</>;\n}\n\ntype TabsMdxProps = {\n className?: string;\n children: ReactNode;\n};\n\nfunction titleToValue(title: string) {\n return title\n .trim()\n .toLowerCase()\n .replace(/\\s+/g, \"-\")\n .replace(/[^a-z0-9-_]/g, \"\");\n}\n\nexport function TabsMdx({ className, children }: TabsMdxProps) {\n const id = useId();\n const childArray = Children.toArray(children);\n\n const tabItems = childArray\n .filter(\n (child): child is ReactElement<TabMdxProps> =>\n isValidElement(child) && typeof (child.props as { title?: unknown }).title === \"string\"\n )\n .map((child, index) => {\n const title = child.props.title;\n const fallback = `tab-${index + 1}`;\n const slug = titleToValue(title) || fallback;\n return {\n value: `${slug}-${index + 1}`,\n title,\n children: child.props.children,\n };\n });\n\n const [activeValue, setActiveValue] = useState(tabItems[0]?.value ?? \"\");\n\n const activeItem = tabItems.find((item) => item.value === activeValue) ?? tabItems[0];\n\n return (\n <div className={className} style={{ margin: \"1rem 0\" }}>\n <div\n role=\"tablist\"\n aria-orientation=\"horizontal\"\n style={{\n display: \"flex\",\n flexWrap: \"nowrap\",\n gap: \"0.75rem\",\n alignItems: \"center\",\n overflowX: \"auto\",\n borderBottom: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n }}\n >\n {tabItems.map((item) => {\n const active = item.value === activeItem?.value;\n const triggerId = `${id}-tab-${item.value}`;\n const panelId = `${id}-panel-${item.value}`;\n return (\n <button\n key={item.value}\n id={triggerId}\n type=\"button\"\n role=\"tab\"\n aria-selected={active}\n aria-controls={panelId}\n tabIndex={active ? 0 : -1}\n onClick={() => setActiveValue(item.value)}\n style={{\n border: \"none\",\n borderBottom: active\n ? \"2px solid hsl(var(--primary, 210 81% 56%))\"\n : \"2px solid transparent\",\n background: \"transparent\",\n color: active\n ? \"hsl(var(--primary, 210 81% 56%))\"\n : \"hsl(var(--foreground, 220 30% 15%))\",\n fontSize: \"0.875rem\",\n fontWeight: 600,\n lineHeight: 1.2,\n padding: \"0.7rem 0.15rem\",\n cursor: \"pointer\",\n whiteSpace: \"nowrap\",\n }}\n >\n {item.title}\n </button>\n );\n })}\n </div>\n\n {tabItems.map((item) => {\n const active = item.value === activeItem?.value;\n const triggerId = `${id}-tab-${item.value}`;\n const panelId = `${id}-panel-${item.value}`;\n return (\n <div\n key={item.value}\n role=\"tabpanel\"\n id={panelId}\n aria-labelledby={triggerId}\n hidden={!active}\n tabIndex={0}\n style={{\n marginTop: \"1rem\",\n }}\n >\n {item.children}\n </div>\n );\n })}\n </div>\n );\n}\n","import type {\n CSSProperties,\n HTMLAttributes,\n TableHTMLAttributes,\n TdHTMLAttributes,\n ThHTMLAttributes,\n} from \"react\";\n\nconst tableShellStyle: CSSProperties = {\n position: \"relative\",\n width: \"100%\",\n overflowX: \"auto\",\n overflowY: \"hidden\",\n border: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n borderRadius: 10,\n margin: \"1rem 0\",\n};\n\nconst cellBaseStyle: CSSProperties = {\n padding: \"0.6rem 0.75rem\",\n verticalAlign: \"middle\",\n borderBottom: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n};\n\nexport function TableMdx({ style, ...props }: TableHTMLAttributes<HTMLTableElement>) {\n return (\n <div style={{ ...tableShellStyle }}>\n <table\n {...props}\n style={{\n width: \"100%\",\n fontSize: \"0.925rem\",\n borderCollapse: \"collapse\",\n margin: 0,\n ...style,\n }}\n />\n </div>\n );\n}\n\nexport function TableHeaderMdx(props: HTMLAttributes<HTMLTableSectionElement>) {\n return (\n <thead\n {...props}\n style={{\n background: \"hsl(var(--muted, 210 20% 92%))\",\n ...props.style,\n }}\n />\n );\n}\n\nexport function TableBodyMdx(props: HTMLAttributes<HTMLTableSectionElement>) {\n return <tbody {...props} />;\n}\n\nexport function TableFooterMdx(props: HTMLAttributes<HTMLTableSectionElement>) {\n return (\n <tfoot\n {...props}\n style={{\n background: \"hsl(var(--muted, 210 20% 92%))\",\n borderTop: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n ...props.style,\n }}\n />\n );\n}\n\nexport function TableRowMdx(props: HTMLAttributes<HTMLTableRowElement>) {\n return <tr {...props} />;\n}\n\nexport function TableHeadMdx(props: ThHTMLAttributes<HTMLTableCellElement>) {\n return (\n <th\n scope={props.scope ?? \"col\"}\n {...props}\n style={{\n ...cellBaseStyle,\n textAlign: \"left\",\n color: \"hsl(var(--muted-foreground, 220 15% 50%))\",\n fontWeight: 600,\n ...props.style,\n }}\n />\n );\n}\n\nexport function TableCellMdx(props: TdHTMLAttributes<HTMLTableCellElement>) {\n return <td {...props} style={{ ...cellBaseStyle, ...props.style }} />;\n}\n","\"use client\";\n\nimport {\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type ReactNode,\n} from \"react\";\n\ntype TooltipMdxProps = {\n /** Visible trigger text (dotted underline). */\n text?: ReactNode;\n /** Bubble content shown on hover/focus. */\n tip?: ReactNode;\n};\n\nconst GAP = 10;\nconst EDGE = 8;\n\n// Notched tail — an SVG quadratic Bézier path, computed (not hardcoded):\n// the tail box is TAIL_SIZE wide and protrudes TAIL_PROTRUSION past the\n// bubble edge. Two `Q` segments sweep from the shoulders to the tip, so the\n// notch curves like a chat bubble instead of a triangle. The path lives in a\n// 1px-padded viewBox so the 1px stroke is never clipped.\nconst TAIL_SIZE = 26;\nconst TAIL_PROTRUSION = 12;\nconst TAIL_PAD = 1;\nconst TAIL_TIP_X = TAIL_SIZE / 2;\nconst TAIL_W = TAIL_SIZE + TAIL_PAD * 2;\nconst TAIL_H = TAIL_PROTRUSION + TAIL_PAD * 2;\n\n/**\n * Auto-positioned tooltip: the bubble is `position: fixed` and, on hover,\n * measured against the trigger and the window — it flips to the side with\n * more room and clamps to the viewport, so no `side` prop is needed.\n */\nexport function TooltipMdx({ text, tip }: TooltipMdxProps) {\n const [open, setOpen] = useState(false);\n const id = useId();\n const triggerRef = useRef<HTMLSpanElement>(null);\n const bubbleRef = useRef<HTMLSpanElement>(null);\n const [bubbleStyle, setBubbleStyle] = useState<CSSProperties>({});\n const [tailStyle, setTailStyle] = useState<CSSProperties>({});\n const [below, setBelow] = useState(true);\n\n useLayoutEffect(() => {\n if (!open || !triggerRef.current || !bubbleRef.current) return;\n const trigger = triggerRef.current.getBoundingClientRect();\n const bubble = bubbleRef.current.getBoundingClientRect();\n const viewW = window.innerWidth;\n const viewH = window.innerHeight;\n\n // Chat-bubble geometry: align the bubble's edge with the trigger (not\n // center it) and hug the tail to the corner near the trigger. Flip\n // vertically to the side with more room; clamp to the window.\n const flip = viewH - trigger.bottom >= trigger.top;\n const rightOverflow = trigger.left + bubble.width > viewW - EDGE;\n const left = rightOverflow\n ? Math.max(EDGE, viewW - bubble.width - EDGE)\n : Math.min(Math.max(trigger.left, EDGE), viewW - bubble.width - EDGE);\n const top = flip\n ? Math.min(trigger.bottom + GAP, viewH - bubble.height - EDGE)\n : Math.max(trigger.top - GAP - bubble.height, EDGE);\n\n setBubbleStyle({ left, top });\n setBelow(flip);\n\n // Tail: horizontal center tracks the trigger; vertical edge depends on\n // the flip — bubble below trigger → tail at the TOP (tip up), bubble\n // above → tail at the BOTTOM (tip down). TAIL_PAD of overlap lets the\n // body cover the closing edge.\n const tailCenter = trigger.left + trigger.width / 2 - left;\n setTailStyle({\n left: Math.min(Math.max(tailCenter - TAIL_SIZE / 2, 2), bubble.width - TAIL_SIZE - 2),\n top: flip ? -TAIL_PROTRUSION + TAIL_PAD : bubble.height - TAIL_PAD,\n });\n }, [open]);\n\n const content = tip ?? \"\";\n const show = open && Boolean(content);\n const bubbleColor = \"hsl(var(--card, 0 0% 100%))\";\n const borderColor = \"hsl(var(--border-color, 210 20% 85%))\";\n\n // Quadratic Bézier tail path (tip points down when the bubble sits above\n // the trigger, up otherwise). Each control point sits at the midpoint of\n // the shoulder→tip segment, pulled slightly OUTWARD (concave side) — the\n // taper stays almost straight, so the notch narrows sharply from wide to\n // point instead of bulging.\n const tipY = TAIL_PROTRUSION + TAIL_PAD;\n const shoulderY = TAIL_PAD;\n const tipX = TAIL_TIP_X + TAIL_PAD;\n const midY = (shoulderY + tipY) / 2;\n const curveOut = 1.4; // outward pull (px) — smaller = straighter, sharper\n const leftMid = (TAIL_PAD + tipX) / 2;\n const rightMid = (tipX + TAIL_SIZE + TAIL_PAD) / 2;\n const curveLeft = leftMid - curveOut;\n const curveRight = rightMid + curveOut;\n const rightX = TAIL_SIZE + TAIL_PAD;\n const tailPath = below\n ? `M ${TAIL_PAD} ${tipY} Q ${curveLeft} ${midY} ${tipX} ${shoulderY} Q ${curveRight} ${midY} ${rightX} ${tipY} Z`\n : `M ${TAIL_PAD} ${shoulderY} Q ${curveLeft} ${midY} ${tipX} ${tipY} Q ${curveRight} ${midY} ${rightX} ${shoulderY} Z`;\n\n return (\n <span\n style={{ position: \"relative\", display: \"inline-block\" }}\n onMouseEnter={() => setOpen(true)}\n onMouseLeave={() => setOpen(false)}\n onFocus={() => setOpen(true)}\n onBlur={() => setOpen(false)}\n >\n <span\n ref={triggerRef}\n tabIndex={0}\n aria-describedby={id}\n style={{\n cursor: \"help\",\n color: \"hsl(var(--primary, 210 81% 56%))\",\n textDecorationLine: \"underline\",\n textDecorationStyle: \"dotted\",\n textDecorationColor: \"hsl(var(--primary, 210 81% 56%))\",\n textUnderlineOffset: \"0.18em\",\n }}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n setOpen(false);\n }\n }}\n >\n {text ?? \"?\"}\n </span>\n {show ? (\n <span\n ref={bubbleRef}\n role=\"tooltip\"\n style={{ position: \"fixed\", ...bubbleStyle, zIndex: 9999 }}\n >\n {/* Notched tail — rendered behind the bubble body so the body covers\n the closing edge; only the curved notch and its stroke show. */}\n <svg\n aria-hidden=\"true\"\n width={TAIL_SIZE}\n height={TAIL_PROTRUSION}\n viewBox={`0 0 ${TAIL_W} ${TAIL_H}`}\n style={{ position: \"absolute\", ...tailStyle, display: \"block\" }}\n >\n <path d={tailPath} fill={bubbleColor} stroke={borderColor} strokeWidth={1} />\n </svg>\n <span\n style={{\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\n maxWidth: \"min(70vw, 22rem)\",\n background: bubbleColor,\n color: \"hsl(var(--foreground, 220 30% 15%))\",\n border: `1px solid ${borderColor}`,\n borderRadius: 16,\n boxShadow: \"0 8px 28px -6px rgb(0 0 0 / 0.18), 0 2px 8px -2px rgb(0 0 0 / 0.08)\",\n padding: \"0.5rem 0.9rem\",\n fontSize: \"0.8125rem\",\n lineHeight: 1.5,\n overflowWrap: \"anywhere\",\n }}\n >\n {content}\n </span>\n </span>\n ) : null}\n </span>\n );\n}\n","type YoutubeMdxProps = {\n videoId: string;\n title?: string;\n};\n\nexport function YoutubeMdx({ videoId, title = \"YouTube video\" }: YoutubeMdxProps) {\n const src = `https://www.youtube-nocookie.com/embed/${videoId}`;\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n paddingBottom: \"56.25%\",\n height: 0,\n overflow: \"hidden\",\n background: \"#000\",\n borderRadius: 8,\n boxShadow: \"0 4px 20px rgba(0, 0, 0, 0.2)\",\n margin: \"1rem 0\",\n }}\n >\n <iframe\n src={src}\n title={title}\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n border: \"none\",\n borderRadius: 8,\n }}\n />\n </div>\n );\n}\n","\"use client\";\n\nimport {\n useId,\n useRef,\n useEffect,\n useState,\n type CSSProperties,\n type KeyboardEvent,\n type ReactNode,\n} from \"react\";\nimport type { Mermaid } from \"mermaid\";\n\n// Module-level singleton — one dynamic import regardless of diagram count\nlet mermaidPromise: Promise<typeof import(\"mermaid\")> | null = null;\n// One-time onboarding — help panel auto-opens on first fullscreen entry per\n// page load (not per diagram); re-openable via the help button\nlet hintSeen = false;\n\ninterface MermaidMdxProps {\n /** Mermaid diagram definition (from rehype plugin or programmatic) */\n chart: string;\n /** Custom DOM id (auto-generated if omitted) */\n id?: string;\n /** Additional CSS class on container */\n className?: string;\n}\n\nfunction getTheme(): \"dark\" | \"default\" {\n return document.documentElement.classList.contains(\"dark\") ? \"dark\" : \"default\";\n}\n\n// Pan/zoom tuning — drag/wheel/touch pan; zoom via the fullscreen control bar\nconst PAN_STEP = 50;\nconst ZOOM_STEP = 1.2;\nconst MIN_SCALE = 0.4;\nconst MAX_SCALE = 4;\n\nconst clampScale = (scale: number) => Math.min(MAX_SCALE, Math.max(MIN_SCALE, scale));\n\nconst controlButtonStyle: CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 28,\n height: 28,\n padding: 0,\n border: \"1px solid rgba(127,127,127,0.35)\",\n borderRadius: 6,\n background: \"rgba(127,127,127,0.12)\",\n color: \"currentcolor\",\n cursor: \"pointer\",\n};\n\n// Top-right chrome (ESC badge / help button) — pill look matching the zoom bar\nconst topBarButtonStyle: CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 6,\n padding: \"6px 10px\",\n border: \"1px solid rgba(127,127,127,0.25)\",\n borderRadius: 8,\n background: \"rgba(127,127,127,0.12)\",\n backdropFilter: \"blur(8px)\",\n color: \"currentcolor\",\n fontSize: 12,\n lineHeight: 1.4,\n cursor: \"pointer\",\n};\n\nfunction ControlButton({\n label,\n onClick,\n cell,\n children,\n}: {\n label: string;\n onClick: () => void;\n cell: { col: number; row: number };\n children: ReactNode;\n}) {\n return (\n <button\n type=\"button\"\n aria-label={label}\n title={label}\n onClick={onClick}\n style={{ ...controlButtonStyle, gridColumn: cell.col, gridRow: cell.row }}\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n {children}\n </svg>\n </button>\n );\n}\n\nexport function MermaidMdx({ chart, id, className }: MermaidMdxProps) {\n const generatedId = useId();\n const domId = id ?? `mermaid-${generatedId.replace(/[:.]/g, \"-\")}`;\n const ref = useRef<HTMLPreElement>(null);\n const chartRef = useRef(chart);\n const mermaidRef = useRef<Mermaid | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [rendered, setRendered] = useState(false);\n const [view, setView] = useState({ x: 0, y: 0, scale: 1 });\n const [fullscreen, setFullscreen] = useState(false);\n const [isPanning, setIsPanning] = useState(false);\n const [showHelp, setShowHelp] = useState(false);\n const dragRef = useRef({ dragging: false, lastX: 0, lastY: 0 });\n const viewportRef = useRef<HTMLDivElement>(null);\n\n // Keep chartRef in sync so theme-change re-render (T-005) can restore text\n chartRef.current = chart;\n\n useEffect(() => {\n if (typeof window === \"undefined\") return;\n if (!chart) return;\n\n let cancelled = false;\n let lazyObserver: IntersectionObserver | null = null;\n let syncObserver: MutationObserver | null = null;\n let themeTimer: ReturnType<typeof setTimeout> | null = null;\n let lastTheme = getTheme();\n // Serialize mermaid.run calls — overlapping runs on the same node detach\n // in-flight SVG and crash inside d3's dispatchEvent (issue #268)\n let runChain: Promise<void> = Promise.resolve();\n\n function enqueueRun(run: () => Promise<void>): Promise<void> {\n const next = runChain.then(() => {\n if (cancelled || !ref.current?.isConnected) return;\n return run();\n });\n // Keep the chain alive after a failure; the caller handles rejection\n runChain = next.catch(() => {});\n return next;\n }\n\n async function init(): Promise<void> {\n try {\n // Invariant 6: singleton dynamic import\n if (!mermaidPromise) {\n mermaidPromise = import(\"mermaid\");\n }\n const mod = await mermaidPromise;\n const mermaid = (mermaidRef.current = mod.default);\n\n mermaid.initialize({ startOnLoad: false, theme: getTheme() });\n\n // Validate syntax early — show error before attempting render\n try {\n await mermaid.parse(chart);\n } catch {\n if (!cancelled) setError(\"Invalid Mermaid syntax\");\n return;\n }\n\n if (cancelled || !ref.current) return;\n\n // T-009: lazy rendering via IntersectionObserver\n lazyObserver = new IntersectionObserver(\n ([entry]) => {\n if (!entry.isIntersecting || cancelled || !ref.current) return;\n enqueueRun(() => {\n const node = ref.current;\n if (!node) return Promise.resolve();\n return mermaid.run({ nodes: [node] });\n })\n .then(() => {\n if (!cancelled) setRendered(true);\n })\n .catch(() => {\n if (!cancelled) setError(\"Failed to render diagram\");\n });\n lazyObserver?.disconnect();\n },\n { rootMargin: \"200px\" }\n );\n lazyObserver.observe(ref.current);\n } catch {\n if (!cancelled) setError(\"Failed to load Mermaid renderer\");\n }\n }\n\n init();\n\n // T-005: theme sync via MutationObserver on <html class>\n syncObserver = new MutationObserver(() => {\n if (themeTimer) clearTimeout(themeTimer);\n themeTimer = setTimeout(() => {\n if (cancelled || !mermaidRef.current || !ref.current) return;\n // Mount effects toggle the class without changing the theme — skip\n // so a spurious mutation cannot race the initial render (issue #268)\n if (getTheme() === lastTheme) return;\n enqueueRun(() => {\n const mermaid = mermaidRef.current;\n const node = ref.current;\n if (!mermaid || !node) return Promise.resolve();\n lastTheme = getTheme();\n // Mermaid replaces innerHTML — restore original chart text before re-render\n node.textContent = chartRef.current;\n // Remove data-processed so mermaid v11 does not skip this node\n node.removeAttribute(\"data-processed\");\n mermaid.initialize({ startOnLoad: false, theme: lastTheme });\n return mermaid.run({ nodes: [node] });\n }).catch((e) => {\n // Warn, not error state — the previously rendered diagram is still on screen\n console.warn(\"[mermaid] diagram render error:\", e);\n });\n }, 200);\n });\n syncObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"class\"],\n });\n\n return () => {\n cancelled = true;\n if (themeTimer) clearTimeout(themeTimer);\n lazyObserver?.disconnect();\n syncObserver?.disconnect();\n };\n // chart string is static from MDX — this only fires on mount\n }, []);\n\n const pan = (dx: number, dy: number) => setView((v) => ({ ...v, x: v.x + dx, y: v.y + dy }));\n const zoom = (factor: number) => setView((v) => ({ ...v, scale: clampScale(v.scale * factor) }));\n const resetView = () => setView({ x: 0, y: 0, scale: 1 });\n\n // Lock page scroll while the fullscreen lightbox is open\n useEffect(() => {\n if (!fullscreen) return;\n const previous = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n return () => {\n document.body.style.overflow = previous;\n };\n }, [fullscreen]);\n\n // Onboarding — auto-opens the help panel on first fullscreen entry per\n // page load; the help button re-opens it anytime; collapses on exit so a\n // later entry starts clean (one-time onboarding, not \"every entry\")\n useEffect(() => {\n if (fullscreen) {\n if (!hintSeen) {\n hintSeen = true;\n setShowHelp(true);\n }\n } else {\n setShowHelp(false);\n }\n }, [fullscreen]);\n\n // Block native browser gestures (double-tap / pinch / ctrl+wheel zoom).\n // React attaches wheel & touch listeners as passive, so preventDefault\n // needs native non-passive listeners to stop the browser from zooming the\n // whole window while the canvas is in fullscreen.\n useEffect(() => {\n if (!fullscreen || !rendered) return;\n const el = viewportRef.current;\n if (!el) return;\n const blockWheel = (e: WheelEvent) => e.preventDefault();\n const blockTouchStart = (e: TouchEvent) => {\n const target = e.target as HTMLElement | null;\n // Controls must stay clickable on touch devices\n if (target?.closest(\"button\")) return;\n e.preventDefault();\n };\n el.addEventListener(\"wheel\", blockWheel, { passive: false });\n el.addEventListener(\"touchstart\", blockTouchStart, { passive: false });\n return () => {\n el.removeEventListener(\"wheel\", blockWheel);\n el.removeEventListener(\"touchstart\", blockTouchStart);\n };\n }, [fullscreen, rendered]);\n\n // Fullscreen shortcuts live on window so ESC (and pan/zoom keys) keep\n // working regardless of which element holds focus after a click.\n useEffect(() => {\n if (!fullscreen) return;\n const onKeyDown = (e: globalThis.KeyboardEvent) => {\n if (e.ctrlKey || e.metaKey || e.altKey) return;\n const actions: Record<string, () => void> = {\n ArrowUp: () => pan(0, -PAN_STEP),\n ArrowDown: () => pan(0, PAN_STEP),\n ArrowLeft: () => pan(-PAN_STEP, 0),\n ArrowRight: () => pan(PAN_STEP, 0),\n \"+\": () => zoom(ZOOM_STEP),\n \"=\": () => zoom(ZOOM_STEP),\n \"-\": () => zoom(1 / ZOOM_STEP),\n \"0\": resetView,\n Escape: () => setFullscreen(false),\n };\n const action = actions[e.key];\n if (!action) return;\n e.preventDefault();\n action();\n };\n window.addEventListener(\"keydown\", onKeyDown);\n return () => window.removeEventListener(\"keydown\", onKeyDown);\n }, [fullscreen]);\n\n // Guard: empty chart\n if (!chart) return null;\n\n const controlsActive = rendered && fullscreen;\n const showFullscreenBtn = rendered;\n\n const handleKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n // Non-fullscreen: Enter opens fullscreen. Fullscreen shortcuts live on\n // window (see effect above) so they work regardless of focus.\n if (!showFullscreenBtn || controlsActive || e.ctrlKey || e.metaKey || e.altKey) return;\n if (e.key === \"Enter\") {\n e.preventDefault();\n setFullscreen(true);\n }\n };\n\n if (error) {\n return (\n <div\n className={className}\n style={{\n border: \"1px solid hsl(var(--destructive, 0 85% 60%))\",\n borderRadius: 8,\n padding: \"0.75rem 1rem\",\n margin: \"1em 0\",\n }}\n >\n <p\n style={{\n color: \"hsl(var(--destructive, 0 85% 60%))\",\n fontWeight: 600,\n marginBottom: 8,\n fontSize: \"0.875rem\",\n }}\n >\n ⚠️ Diagram rendering error\n </p>\n <pre\n style={{\n fontSize: \"0.875rem\",\n whiteSpace: \"pre-wrap\",\n margin: 0,\n }}\n >\n {chart}\n </pre>\n </div>\n );\n }\n\n return (\n <div\n ref={viewportRef}\n className=\"max-w-full\"\n tabIndex={showFullscreenBtn ? 0 : undefined}\n role={showFullscreenBtn ? \"group\" : undefined}\n aria-label={\n showFullscreenBtn\n ? fullscreen\n ? \"Mermaid diagram. Drag or use arrow keys to pan, + and - to zoom, click the percentage to reset, Esc to exit.\"\n : \"Mermaid diagram. Press Enter to open fullscreen view.\"\n : undefined\n }\n onKeyDown={handleKeyDown}\n onWheel={controlsActive ? (e) => zoom(e.deltaY > 0 ? 1 / ZOOM_STEP : ZOOM_STEP) : undefined}\n onTouchStart={\n controlsActive\n ? (e) => {\n const t = e.touches[0];\n dragRef.current = { dragging: true, lastX: t.clientX, lastY: t.clientY };\n setIsPanning(true);\n }\n : undefined\n }\n onTouchMove={\n controlsActive\n ? (e) => {\n const d = dragRef.current;\n if (!d.dragging) return;\n const t = e.touches[0];\n pan(t.clientX - d.lastX, t.clientY - d.lastY);\n dragRef.current.lastX = t.clientX;\n dragRef.current.lastY = t.clientY;\n }\n : undefined\n }\n onTouchEnd={\n controlsActive\n ? () => {\n dragRef.current.dragging = false;\n setIsPanning(false);\n }\n : undefined\n }\n onTouchCancel={\n controlsActive\n ? () => {\n dragRef.current.dragging = false;\n setIsPanning(false);\n }\n : undefined\n }\n onMouseDown={\n controlsActive\n ? (e) => {\n dragRef.current = { dragging: true, lastX: e.clientX, lastY: e.clientY };\n setIsPanning(true);\n }\n : undefined\n }\n onMouseMove={\n controlsActive\n ? (e) => {\n const d = dragRef.current;\n if (!d.dragging) return;\n pan(e.clientX - d.lastX, e.clientY - d.lastY);\n dragRef.current.lastX = e.clientX;\n dragRef.current.lastY = e.clientY;\n }\n : undefined\n }\n onMouseUp={\n controlsActive\n ? () => {\n dragRef.current.dragging = false;\n setIsPanning(false);\n }\n : undefined\n }\n onMouseLeave={\n controlsActive\n ? () => {\n dragRef.current.dragging = false;\n setIsPanning(false);\n }\n : undefined\n }\n style={{\n ...(fullscreen\n ? {\n position: \"fixed\",\n inset: 0,\n zIndex: 50,\n background: \"hsl(var(--background, 0 0% 100%))\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }\n : { position: \"relative\" }),\n ...(controlsActive\n ? {\n overflow: \"hidden\",\n touchAction: \"none\",\n userSelect: \"none\",\n cursor: isPanning ? \"grabbing\" : \"grab\",\n }\n : { overflow: \"auto\" }),\n }}\n >\n <div\n style={\n controlsActive\n ? {\n transform: `translate(${view.x}px, ${view.y}px) scale(${view.scale})`,\n transformOrigin: \"center center\",\n transition: isPanning ? \"none\" : \"transform 150ms ease\",\n }\n : undefined\n }\n >\n <pre\n ref={ref}\n id={domId}\n className={`mermaid not-prose${className ? ` ${className}` : \"\"}`}\n style={{ margin: \"1em auto\", width: \"fit-content\", maxWidth: \"100%\" }}\n >\n {chart}\n </pre>\n </div>\n\n {showFullscreenBtn ? (\n controlsActive ? (\n <div\n role=\"group\"\n aria-label=\"Pan and zoom controls\"\n style={{ position: \"absolute\", inset: 0, pointerEvents: \"none\" }}\n >\n {/* Top-right chrome: ESC badge + help toggle, panel drops below */}\n <div\n style={{\n position: \"absolute\",\n top: 12,\n right: 12,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-end\",\n gap: 8,\n pointerEvents: \"auto\",\n }}\n >\n <div style={{ display: \"flex\", gap: 8 }}>\n <button\n type=\"button\"\n aria-label=\"Exit full screen\"\n onClick={() => setFullscreen(false)}\n style={topBarButtonStyle}\n >\n <kbd\n style={{\n padding: \"1px 5px\",\n borderRadius: 4,\n border: \"1px solid rgba(127,127,127,0.4)\",\n background: \"rgba(127,127,127,0.15)\",\n fontSize: 11,\n fontFamily: \"inherit\",\n lineHeight: 1.4,\n }}\n >\n Esc\n </kbd>\n <span>Exit fullscreen</span>\n </button>\n <button\n type=\"button\"\n aria-label=\"Toggle help\"\n aria-expanded={showHelp}\n title=\"Canvas controls & keyboard shortcuts\"\n onClick={() => setShowHelp((v) => !v)}\n style={{ ...topBarButtonStyle, width: 28, padding: 0, fontSize: 14 }}\n >\n {showHelp ? \"×\" : \"?\"}\n </button>\n </div>\n\n {/* Onboarding / shortcuts — auto-opens once, re-openable via \"?\" */}\n {showHelp ? (\n <div\n role=\"status\"\n style={{\n padding: \"10px 12px\",\n borderRadius: 10,\n border: \"1px solid rgba(127,127,127,0.25)\",\n background: \"rgba(127,127,127,0.12)\",\n backdropFilter: \"blur(8px)\",\n color: \"currentcolor\",\n fontSize: 12,\n lineHeight: 1.7,\n maxWidth: 280,\n }}\n >\n <p style={{ margin: 0, fontWeight: 600 }}>Canvas controls</p>\n <p style={{ margin: 0 }}>Move — hold scroll wheel or tap & drag</p>\n <p style={{ margin: 0 }}>Zoom — + / − keys or scroll</p>\n <p style={{ margin: 0 }}>Reset — 0 or click the zoom %</p>\n <p style={{ margin: 0 }}>Exit — Esc</p>\n </div>\n ) : null}\n </div>\n\n {/* Zoom bar — minus / percentage-reset / plus */}\n <div\n style={{\n position: \"absolute\",\n bottom: 16,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 2,\n padding: 4,\n borderRadius: 10,\n border: \"1px solid rgba(127,127,127,0.25)\",\n background: \"rgba(127,127,127,0.12)\",\n backdropFilter: \"blur(8px)\",\n pointerEvents: \"auto\",\n }}\n >\n <ControlButton\n label=\"Zoom out\"\n onClick={() => zoom(1 / ZOOM_STEP)}\n cell={{ col: 1, row: 1 }}\n >\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m21 21-4-4M8 11h6\" />\n </ControlButton>\n <button\n type=\"button\"\n aria-label=\"Reset view\"\n title=\"Reset zoom to 100%\"\n onClick={resetView}\n style={{\n minWidth: 56,\n height: 28,\n padding: \"0 8px\",\n border: \"none\",\n borderRadius: 6,\n background: \"transparent\",\n color: \"currentcolor\",\n fontSize: 12,\n fontVariantNumeric: \"tabular-nums\",\n cursor: \"pointer\",\n }}\n >\n {Math.round(view.scale * 100)}%\n </button>\n <ControlButton\n label=\"Zoom in\"\n onClick={() => zoom(ZOOM_STEP)}\n cell={{ col: 3, row: 1 }}\n >\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m21 21-4-4M8 11h6M11 8v6\" />\n </ControlButton>\n </div>\n </div>\n ) : (\n <div style={{ position: \"absolute\", bottom: 8, right: 8 }}>\n <ControlButton\n label=\"Enter full screen\"\n onClick={() => setFullscreen(true)}\n cell={{ col: 1, row: 1 }}\n >\n <path d=\"M8 3H5a2 2 0 0 0-2 2v3M21 8V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3M16 21h3a2 2 0 0 0 2-2v-3\" />\n </ControlButton>\n </div>\n )\n ) : null}\n </div>\n );\n}\n"],"mappings":";AAAA,SAAS,qBAAyC;;;ACAlD,YAAY,iBAAiB;AAiBpB;AAVT,IAAM,oBAAoB;AAEnB,SAAS,kBAAkB,MAA4B;AAC5D,QAAM,aAAa,OAAO,SAAS,WAAW,KAAK,KAAK,IAAI;AAC5D,MAAI,CAAC,cAAc,CAAC,OAAO,OAAO,aAAa,UAAU,GAAG;AAC1D,WAAO;AAAA,EACT;AAEA,QAAM,gBAAgB,YAAY,UAAsB;AAExD,SAAO,oBAAC,iBAAc,MAAM,mBAAmB;AACjD;;;ACoFQ,SAWI,OAAAA,MAXJ;AAtFR,IAAM,UAUF;AAAA,EACF,QAAQ;AAAA,IACN,QAAQ;AAAA,IACR,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,SAAS;AAAA,IACP,QAAQ;AAAA,IACR,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,SAAS;AAAA,IACP,QAAQ;AAAA,IACR,IAAI;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,MAAM;AAAA,IACJ,QAAQ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,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,SAAS;AAAA,IACT,SAAS;AAAA,IACT,SAAS;AAAA,IACT,GAAG;AAAA,EACL;AACF;","names":["jsx","jsx","jsxs","useState","jsx","useState","useId","useState","jsx","jsx","jsxs","useId","useState","jsx","useId","useState","jsx","jsxs","useEffect","useState","useRef","Fragment","jsx","jsxs","lineHeight","jsx","jsxs","useId","useState","ChevronRight","jsx","jsxs","useEffect","useId","useRef","useState","Fragment","jsx","jsxs","cloneElement","isValidElement","jsx","jsxs","Children","isValidElement","useId","useState","Fragment","jsx","jsxs","jsx","useId","useRef","useState","jsx","jsxs","jsx","useId","useRef","useEffect","useState","jsx","jsxs"]}
|
|
1
|
+
{"version":3,"sources":["../src/registry/index.ts","../src/utils/Icon.tsx","../src/components/Callout.tsx","../src/components/AccordionMdx.tsx","../src/utils/AccordionGroupContext.tsx","../src/components/AccordionsMdx.tsx","../src/components/CardMdx.tsx","../src/components/LinkMdx.tsx","../src/components/CardsMdx.tsx","../src/components/CodeBlockMdx.tsx","../src/utils/CopyButton.tsx","../src/utils/ExpandableCode.tsx","../src/components/TreeMdx.tsx","../src/components/ImageMdx.tsx","../src/components/StepperMdx.tsx","../src/components/TabsMdx.tsx","../src/components/TableMdx.tsx","../src/components/TooltipMdx.tsx","../src/components/YoutubeMdx.tsx","../src/components/MermaidMdx.tsx"],"sourcesContent":["import { createElement, type ComponentType } from \"react\";\nimport { Callout, type CalloutType } from \"../components/Callout\";\nimport {\n AccordionMdx,\n AccordionsMdx,\n CardsMdx,\n CardMdx,\n CodeBlock,\n TreeMdx,\n ImageMdx,\n LinkMdx,\n StepMdx,\n StepsMdx,\n TableMdx,\n TableHeaderMdx,\n TableBodyMdx,\n TableFooterMdx,\n TableRowMdx,\n TableHeadMdx,\n TableCellMdx,\n TabMdx,\n TabsMdx,\n TooltipMdx,\n YoutubeMdx,\n MermaidMdx,\n} from \"../components\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type MdxComponentMap = Record<string, ComponentType<any>>;\n\nfunction callout(type: CalloutType): ComponentType<Record<string, unknown>> {\n return (props) => createElement(Callout, { type, ...props });\n}\n\nexport function createMdxComponents(customComponents: MdxComponentMap = {}): MdxComponentMap {\n return {\n Tabs: TabsMdx,\n Tab: TabMdx,\n table: TableMdx,\n thead: TableHeaderMdx,\n tbody: TableBodyMdx,\n tfoot: TableFooterMdx,\n tr: TableRowMdx,\n th: TableHeadMdx,\n td: TableCellMdx,\n pre: CodeBlock,\n a: LinkMdx,\n Link: LinkMdx,\n Card: CardMdx,\n Tip: callout(\"tip\"),\n Info: callout(\"info\"),\n Danger: callout(\"danger\"),\n Warning: callout(\"warning\"),\n Success: callout(\"success\"),\n Steps: StepsMdx,\n Step: StepMdx,\n Accordion: AccordionMdx,\n Accordions: AccordionsMdx,\n Cards: CardsMdx,\n Tree: TreeMdx,\n Image: ImageMdx,\n img: ImageMdx,\n Youtube: YoutubeMdx,\n Tooltip: TooltipMdx,\n Mermaid: MermaidMdx,\n ...customComponents,\n };\n}\n","import * as LucideIcons from \"lucide-react\";\nimport type { LucideProps } from \"lucide-react\";\nimport type { ReactNode, ComponentType } from \"react\";\n\nexport type IconName = keyof typeof LucideIcons;\nexport type IconProp = IconName | string;\n\nconst DEFAULT_ICON_SIZE = 20;\n\nexport function resolveLucideIcon(icon?: IconProp): ReactNode {\n const normalized = typeof icon === \"string\" ? icon.trim() : icon;\n if (!normalized || !Object.hasOwn(LucideIcons, normalized)) {\n return undefined;\n }\n\n const IconComponent = LucideIcons[normalized as IconName] as ComponentType<LucideProps>;\n\n return <IconComponent size={DEFAULT_ICON_SIZE} />;\n}\n","\"use client\";\n\nimport type { CSSProperties, HTMLAttributes, ReactNode } from \"react\";\nimport { type IconName, resolveLucideIcon } from \"../utils/Icon\";\n\nexport type CalloutType = \"tip\" | \"info\" | \"danger\" | \"warning\" | \"success\";\n\ntype CalloutProps = HTMLAttributes<HTMLElement> & {\n /** Internal — set by the registry variant (Tip/Info/Danger/Warning/Success). */\n type: CalloutType;\n /** Optional; falls back to the callout label (Tip, Info, …). */\n title?: string;\n children?: ReactNode;\n style?: CSSProperties;\n};\n\nconst palette: Record<\n CalloutType,\n {\n border: string;\n bg: string;\n text: string;\n header: string;\n content: string;\n defaultIcon: IconName;\n }\n> = {\n danger: {\n border: \"hsl(var(--destructive, 0 85% 60%))\",\n bg: \"hsl(var(--destructive, 0 85% 60%) / 0.16)\",\n text: \"hsl(var(--foreground, 220 30% 15%))\",\n header: \"hsl(var(--destructive, 0 85% 60%))\",\n content: \"hsl(var(--destructive, 0 85% 60%) / 0.75)\",\n defaultIcon: \"Siren\",\n },\n warning: {\n border: \"hsl(36 100% 56%)\",\n bg: \"rgba(249, 115, 22, 0.14)\",\n text: \"hsl(var(--foreground, 220 30% 15%))\",\n header: \"hsl(36 100% 56%)\",\n content: \"rgba(249, 115, 22, 0.9)\",\n defaultIcon: \"TriangleAlert\",\n },\n success: {\n border: \"hsl(137 50% 35%)\",\n bg: \"hsl(137 50% 35% / 0.16)\",\n text: \"hsl(var(--foreground, 220 30% 15%))\",\n header: \"hsl(137 50% 35%)\",\n content: \"hsl(137 50% 35% / 0.75)\",\n defaultIcon: \"CircleCheck\",\n },\n info: {\n border: \"hsl(var(--primary, 210 81% 56%))\",\n bg: \"hsl(var(--primary, 210 81% 56%) / 0.16)\",\n text: \"hsl(var(--foreground, 220 30% 15%))\",\n header: \"hsl(var(--primary, 210 81% 56%))\",\n content: \"hsl(var(--primary, 210 81% 56%) / 0.75)\",\n defaultIcon: \"Info\",\n },\n tip: {\n border: \"hsl(137 50% 35%)\",\n bg: \"hsl(137 50% 35% / 0.16)\",\n text: \"hsl(var(--foreground, 220 30% 15%))\",\n header: \"hsl(137 50% 35%)\",\n content: \"hsl(137 50% 35% / 0.75)\",\n defaultIcon: \"Lightbulb\",\n },\n};\n\nconst LABEL: Record<CalloutType, string> = {\n tip: \"Tip\",\n info: \"Info\",\n danger: \"Danger\",\n warning: \"Warning\",\n success: \"Success\",\n};\n\nexport function Callout({ type, title, children, style, className, ...props }: CalloutProps) {\n const token = palette[type];\n if (!token) return null;\n const resolvedIcon = resolveLucideIcon(token.defaultIcon);\n const normalizedTitle = typeof title === \"string\" ? title.trim() : title;\n const fallbackTitle = normalizedTitle || LABEL[type];\n\n return (\n <aside\n role=\"note\"\n className={className}\n {...props}\n style={{\n border: \"1px solid transparent\",\n borderLeft: `4px solid ${token.border}`,\n borderRadius: 10,\n background: token.bg,\n color: token.text,\n padding: \"0.5rem 1rem\",\n margin: \"1rem 0\",\n boxShadow: \"0 1px 2px rgba(15, 23, 42, 0.08)\",\n ...style,\n }}\n >\n {fallbackTitle || resolvedIcon ? (\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: \"0.5rem\",\n fontWeight: 700,\n marginBottom: \"0.35rem\",\n color: token.header,\n }}\n >\n {resolvedIcon ? (\n <span\n aria-hidden=\"true\"\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 20,\n height: 20,\n color: token.header,\n }}\n >\n {resolvedIcon}\n </span>\n ) : null}\n <span style={{ color: token.header }}>{fallbackTitle}</span>\n </div>\n ) : null}\n <div style={{ color: token.content, lineHeight: 1.5 }}>{children}</div>\n </aside>\n );\n}\n","\"use client\";\n\nimport { useContext, useId, useState, type KeyboardEvent, type ReactNode } from \"react\";\nimport { AccordionGroupContext } from \"../utils/AccordionGroupContext\";\nimport { IconProp, resolveLucideIcon } from \"../utils/Icon\";\nimport { ChevronRight } from \"lucide-react\";\n\ntype AccordionMdxProps = {\n title: string;\n icon?: IconProp;\n className?: string;\n children?: ReactNode;\n};\n\nexport function AccordionMdx({ title, icon, className, children }: AccordionMdxProps) {\n const groupContext = useContext(AccordionGroupContext);\n const [localOpen, setLocalOpen] = useState(false);\n const panelId = useId();\n const triggerId = `${panelId}-trigger`;\n\n const isGroup = groupContext?.inGroup === true;\n const isOpen = isGroup ? groupContext?.openTitle === title : localOpen;\n const resolvedIcon = resolveLucideIcon(icon);\n\n function onToggle() {\n if (isGroup && groupContext) {\n groupContext.setOpenTitle(groupContext.openTitle === title ? null : title);\n return;\n }\n setLocalOpen((prev) => !prev);\n }\n\n return (\n <div\n className={`mdx-accordion ${isGroup ? \"mdx-accordion-group-item\" : \"\"} ${className ?? \"\"}`}\n style={{\n border: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n borderRadius: 10,\n overflow: \"hidden\",\n background: \"hsl(var(--card, 0 0% 100%))\",\n }}\n >\n <button\n className=\"mdx-accordion-header\"\n type=\"button\"\n onClick={onToggle}\n aria-expanded={isOpen}\n aria-controls={panelId}\n id={triggerId}\n onKeyDown={(event: KeyboardEvent<HTMLButtonElement>) => {\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n onToggle();\n }\n }}\n style={{\n width: \"100%\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"flex-start\",\n gap: \"0.5rem\",\n textAlign: \"left\",\n border: 0,\n cursor: \"pointer\",\n background: \"hsl(var(--muted, 210 20% 92%))\",\n color: \"hsl(var(--foreground, 220 30% 15%))\",\n fontWeight: 600,\n padding: \"0.95rem 1rem\",\n }}\n >\n <ChevronRight\n className=\"mdx-accordion-chevron\"\n aria-hidden=\"true\"\n size={16}\n style={{\n transform: isOpen ? \"rotate(90deg)\" : \"rotate(0deg)\",\n transition: \"transform 0.2s ease\",\n flexShrink: 0,\n color: \"hsl(var(--foreground, 220 30% 15%) / 0.74)\",\n marginRight: \"0.4rem\",\n }}\n />\n <span style={{ display: \"inline-flex\", alignItems: \"center\", gap: \"0.5rem\", flex: 1 }}>\n {resolvedIcon ? (\n <span\n aria-hidden=\"true\"\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n minWidth: \"1.45rem\",\n height: \"1.45rem\",\n color: \"hsl(var(--foreground, 220 30% 15%))\",\n }}\n >\n {resolvedIcon}\n </span>\n ) : null}\n <span>{title}</span>\n </span>\n </button>\n <div\n id={panelId}\n role=\"region\"\n aria-labelledby={triggerId}\n hidden={!isOpen}\n className=\"mdx-accordion-content\"\n style={{\n padding: \"0.75rem 0.8rem\",\n background: \"hsl(var(--card, 0 0% 100%))\",\n color: \"hsl(var(--card-foreground, 220 30% 15%))\",\n }}\n >\n {children}\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport { createContext } from \"react\";\n\ntype AccordionGroupContextType = {\n inGroup: boolean;\n openTitle: string | null;\n setOpenTitle: (title: string | null) => void;\n};\n\nexport const AccordionGroupContext = createContext<AccordionGroupContextType | null>(null);\n","\"use client\";\n\nimport { useMemo, useState, type ReactNode } from \"react\";\nimport { AccordionGroupContext } from \"../utils/AccordionGroupContext\";\n\ntype AccordionsMdxProps = {\n children?: ReactNode;\n};\n\nexport function AccordionsMdx({ children }: AccordionsMdxProps) {\n const [openTitle, setOpenTitle] = useState<string | null>(null);\n\n const value = useMemo(() => ({ inGroup: true, openTitle, setOpenTitle }), [openTitle]);\n\n return (\n <AccordionGroupContext.Provider value={value}>\n <div\n className=\"mdx-accordion-group\"\n style={{\n margin: \"1rem 0\",\n display: \"grid\",\n gap: \"0.85rem\",\n }}\n >\n {children}\n </div>\n </AccordionGroupContext.Provider>\n );\n}\n","\"use client\";\n\nimport {\n cloneElement,\n useId,\n useState,\n type ComponentType,\n type CSSProperties,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport type { LucideProps } from \"lucide-react\";\nimport { LinkMdx } from \"./LinkMdx\";\nimport { IconProp, resolveLucideIcon } from \"../utils/Icon\";\nimport type { LinkMdxProps } from \"./LinkMdx\";\n\ntype LinkRenderer = ComponentType<LinkMdxProps>;\n\nexport type CardMdxProps = HTMLAttributes<HTMLDivElement> & {\n title: string;\n icon?: IconProp;\n href?: string;\n horizontal?: boolean;\n children?: ReactNode;\n style?: CSSProperties;\n /** Internal adapter hook: inject framework link component without duplicating styles. */\n __LinkComponent?: LinkRenderer;\n};\n\n// Styling follows the home Features card\n// (packages/flame/.docu/components/home/Features.tsx): rounded-2xl, p-6,\n// icon in a 12×12 primary/10 rounded box, grid-pattern backdrop, hover\n// border-primary/40 + shadow-lg.\nconst baseStyle: CSSProperties = {\n position: \"relative\",\n display: \"block\",\n border: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n borderRadius: 16, // rounded-2xl\n background: \"hsl(var(--card, 0 0% 100%))\", // bg-base-100\n color: \"hsl(var(--foreground, 220 30% 15%))\",\n textDecoration: \"none\",\n padding: \"1.5rem\", // p-6\n overflow: \"hidden\",\n transition: \"border-color 0.2s ease, box-shadow 0.24s ease, transform 0.24s ease\",\n};\n\nconst hoverStyle: CSSProperties = {\n borderColor: \"hsla(var(--primary, 210 81% 56%) / 0.4)\", // hover:border-primary/40\n boxShadow: \"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)\", // shadow-lg\n};\n\nconst iconBoxStyle: CSSProperties = {\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 48, // h-12\n height: 48,\n borderRadius: 8, // rounded-lg\n background: \"hsla(var(--primary, 210 81% 56%) / 0.1)\", // bg-primary/10\n color: \"hsl(var(--primary, 210 81% 56%))\",\n flexShrink: 0,\n};\n\nexport function CardMdx({\n title,\n icon,\n href,\n horizontal,\n children,\n style,\n className,\n __LinkComponent,\n ...props\n}: CardMdxProps) {\n const patternId = `card-${useId().replace(/[:.]/g, \"-\")}`;\n const [hovered, setHovered] = useState(false);\n const resolvedIcon = resolveLucideIcon(icon);\n const LinkComponent = __LinkComponent ?? LinkMdx;\n\n const iconNode = resolvedIcon\n ? (cloneElement(resolvedIcon as ReactElement<LucideProps>, { size: 24 }) as ReactNode)\n : null;\n\n const content = (\n <>\n {/* Grid-pattern backdrop — fills the whole card (behind the padding).\n The card element (div or link) is position:relative, so absolute\n inset:0 here covers the full box edge to edge. */}\n <svg\n aria-hidden=\"true\"\n style={{\n position: \"absolute\",\n inset: 0,\n width: \"100%\",\n height: \"100%\",\n color: \"hsl(var(--primary, 210 81% 56%))\",\n pointerEvents: \"none\",\n }}\n >\n <defs>\n <pattern id={patternId} width=\"40\" height=\"40\" patternUnits=\"userSpaceOnUse\">\n <path\n d=\"M 40 0 L 0 0 0 40\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"0.5\"\n opacity=\"0.15\"\n />\n </pattern>\n </defs>\n <rect width=\"100%\" height=\"100%\" fill={`url(#${patternId})`} />\n </svg>\n\n <div style={{ position: \"relative\", zIndex: 10 }}>\n <div\n style={\n horizontal\n ? {\n display: \"grid\",\n gridTemplateColumns: \"auto 1fr\",\n gap: \"1rem\",\n alignItems: \"flex-start\",\n }\n : undefined\n }\n >\n {iconNode ? (\n <span\n aria-hidden=\"true\"\n data-card-icon=\"\"\n style={{\n ...iconBoxStyle,\n marginBottom: horizontal ? 0 : \"1rem\",\n }}\n >\n {iconNode}\n </span>\n ) : null}\n <div>\n <div\n style={{\n fontWeight: 600, // font-semibold\n fontSize: \"1.125rem\", // text-lg\n lineHeight: 1.4,\n marginBottom: children ? \"0.5rem\" : 0, // mb-2\n color: \"hsl(var(--foreground, 220 30% 15%))\",\n }}\n >\n {title}\n </div>\n {children ? (\n <div\n style={{\n color: \"hsl(var(--muted-foreground, 220 15% 50%))\", // text-muted-foreground\n fontSize: \"0.875rem\", // text-sm\n lineHeight: 1.5,\n }}\n >\n {children}\n </div>\n ) : null}\n </div>\n </div>\n </div>\n </>\n );\n\n const combinedStyle = {\n ...baseStyle,\n ...(hovered ? hoverStyle : null),\n ...style,\n };\n\n const handlers = {\n onMouseEnter: () => setHovered(true),\n onMouseLeave: () => setHovered(false),\n };\n\n if (href) {\n return (\n <LinkComponent\n href={href}\n data-card-hover=\"\"\n data-card-link=\"\"\n style={combinedStyle}\n {...handlers}\n {...(className ? { className } : {})}\n {...(props as React.ComponentProps<typeof LinkComponent>)}\n >\n {content}\n </LinkComponent>\n );\n }\n\n return (\n <div style={combinedStyle} {...handlers} {...(className ? { className } : {})} {...props}>\n {content}\n </div>\n );\n}\n","import type { ComponentProps } from \"react\";\n\nexport type LinkMdxProps = ComponentProps<\"a\">;\n\nexport function LinkMdx({ href, rel, target, ...props }: LinkMdxProps) {\n if (!href) return null;\n\n const external = /^https?:\\/\\//.test(href);\n const computedTarget = target ?? (external ? \"_blank\" : undefined);\n const computedRel = rel ?? (external ? \"noopener noreferrer\" : undefined);\n\n return <a href={href} target={computedTarget} rel={computedRel} {...props} />;\n}\n","import type { CSSProperties, ReactNode } from \"react\";\n\ntype CardsMdxProps = {\n cols?: number;\n children?: ReactNode;\n style?: CSSProperties;\n};\n\nexport function CardsMdx({ cols = 2, children, style }: CardsMdxProps) {\n const columnCount = Math.max(1, Math.min(4, cols));\n\n return (\n <div\n className=\"docubook-card-group\"\n style={\n {\n \"--docubook-card-group-template\": `repeat(${columnCount}, minmax(240px, 1fr))`,\n ...style,\n } as CSSProperties\n }\n >\n {children}\n </div>\n );\n}\n","import { isValidElement, type ComponentProps, type ReactNode } from \"react\";\nimport {\n SiJavascript,\n SiTypescript,\n SiReact,\n SiPython,\n SiGo,\n SiPhp,\n SiRuby,\n SiSwift,\n SiKotlin,\n SiHtml5,\n SiCss,\n SiSass,\n SiPostgresql,\n SiGraphql,\n SiYaml,\n SiToml,\n SiDocker,\n SiNginx,\n SiGit,\n SiGnubash,\n SiMarkdown,\n} from \"react-icons/si\";\nimport { FaJava, FaCode, FaRegFileAlt } from \"react-icons/fa\";\nimport { TbJson } from \"react-icons/tb\";\nimport { CopyButton } from \"../utils/CopyButton\";\nimport { ExpandableCode } from \"../utils/ExpandableCode\";\n\ntype CodeBlockProps = ComponentProps<\"pre\"> & {\n raw?: string;\n \"data-title\"?: string;\n \"data-language\"?: string;\n \"data-expandable\"?: string;\n \"data-expandable-lines\"?: string;\n};\n\nfunction getLanguage(className: string = \"\") {\n const match = className.match(/language-(\\w+)/);\n return match ? match[1] : \"text\";\n}\n\nfunction resolveLanguage(\n preClassName: string | undefined,\n dataLanguage: string | undefined,\n children: ReactNode\n) {\n if (typeof dataLanguage === \"string\" && dataLanguage.trim().length > 0) {\n return dataLanguage.trim().toLowerCase();\n }\n\n const languageFromPre = getLanguage(preClassName ?? \"\");\n if (languageFromPre !== \"text\") return languageFromPre;\n\n if (isValidElement(children)) {\n const childProps = children.props as { className?: string };\n if (typeof childProps.className === \"string\") {\n const languageFromCode = getLanguage(childProps.className);\n if (languageFromCode !== \"text\") return languageFromCode;\n }\n }\n\n return \"text\";\n}\n\nfunction getLanguageIcon(language: string) {\n const normalized = language.toLowerCase();\n const iconProps = { size: 14 };\n\n const map: Record<string, ReactNode> = {\n gitignore: <SiGit {...iconProps} />,\n docker: <SiDocker {...iconProps} />,\n dockerfile: <SiDocker {...iconProps} />,\n nginx: <SiNginx {...iconProps} />,\n sql: <SiPostgresql {...iconProps} />,\n graphql: <SiGraphql {...iconProps} />,\n yaml: <SiYaml {...iconProps} />,\n yml: <SiYaml {...iconProps} />,\n toml: <SiToml {...iconProps} />,\n json: <TbJson {...iconProps} />,\n md: <SiMarkdown {...iconProps} />,\n markdown: <SiMarkdown {...iconProps} />,\n bash: <SiGnubash {...iconProps} />,\n sh: <SiGnubash {...iconProps} />,\n shell: <SiGnubash {...iconProps} />,\n swift: <SiSwift {...iconProps} />,\n kotlin: <SiKotlin {...iconProps} />,\n kt: <SiKotlin {...iconProps} />,\n kts: <SiKotlin {...iconProps} />,\n rb: <SiRuby {...iconProps} />,\n ruby: <SiRuby {...iconProps} />,\n php: <SiPhp {...iconProps} />,\n go: <SiGo {...iconProps} />,\n py: <SiPython {...iconProps} />,\n python: <SiPython {...iconProps} />,\n java: <FaJava {...iconProps} />,\n tsx: <SiReact {...iconProps} />,\n typescript: <SiTypescript {...iconProps} />,\n ts: <SiTypescript {...iconProps} />,\n jsx: <SiReact {...iconProps} />,\n js: <SiJavascript {...iconProps} />,\n javascript: <SiJavascript {...iconProps} />,\n html: <SiHtml5 {...iconProps} />,\n css: <SiCss {...iconProps} />,\n scss: <SiSass {...iconProps} />,\n sass: <SiSass {...iconProps} />,\n text: <FaRegFileAlt {...iconProps} />,\n plaintext: <FaRegFileAlt {...iconProps} />,\n };\n\n return map[normalized] || <FaCode {...iconProps} />;\n}\n\nfunction countCodeLines(raw: string) {\n let normalized = raw.replace(/\\r\\n/g, \"\\n\");\n if (normalized.startsWith(\"\\n\")) normalized = normalized.slice(1);\n if (normalized.endsWith(\"\\n\")) normalized = normalized.slice(0, -1);\n\n if (normalized.length === 0) return 0;\n return normalized.split(\"\\n\").length;\n}\n\nexport function CodeBlock({ children, raw, ...rest }: CodeBlockProps) {\n const {\n className,\n \"data-title\": title,\n \"data-language\": dataLanguage,\n \"data-expandable\": isExpandable,\n \"data-expandable-lines\": totalLinesStr,\n ...props\n } = rest;\n\n const language = resolveLanguage(\n typeof className === \"string\" ? className : undefined,\n dataLanguage,\n children\n );\n const totalLinesFromMeta = parseInt(totalLinesStr as string, 10) || 0;\n const totalLinesFromRaw = raw ? countCodeLines(raw) : 0;\n const totalLines = totalLinesFromRaw || totalLinesFromMeta;\n const hasExpandableClass =\n typeof className === \"string\" && className.split(\" \").includes(\"mdx-expandable-code\");\n const shouldExpand = isExpandable === \"true\" || hasExpandableClass;\n const preProps = {\n ...props,\n \"data-expandable\": isExpandable,\n \"data-expandable-lines\": totalLinesStr,\n };\n\n return (\n <div\n className=\"code-block-container not-prose\"\n style={{\n position: \"relative\",\n margin: \"1.5rem 0\",\n border: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n overflow: \"hidden\",\n fontSize: \"0.875rem\",\n borderRadius: \"0.75rem\",\n }}\n >\n <div\n className=\"code-block-header\"\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"space-between\",\n gap: \"0.75rem\",\n background: \"hsl(var(--muted, 210 20% 92%))\",\n padding: \"0.5rem 1rem\",\n borderBottom: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n color: \"hsl(var(--muted-foreground, 220 15% 50%))\",\n fontFamily: \"monospace\",\n fontSize: \"0.8rem\",\n }}\n >\n <div\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: 6,\n fontSize: \"0.78rem\",\n color: \"hsl(var(--muted-foreground, 220 15% 50%))\",\n }}\n >\n {getLanguageIcon(language)}\n <span>{title || language}</span>\n </div>\n {raw ? (\n <div\n className=\"code-block-actions\"\n style={{\n display: \"inline-flex\",\n alignItems: \"center\",\n marginLeft: \"auto\",\n }}\n >\n <div\n style={{\n color: \"hsl(var(--muted-foreground, 220 15% 50%))\",\n transition: \"color 0.2s ease-in-out\",\n }}\n >\n <CopyButton content={raw} />\n </div>\n </div>\n ) : null}\n </div>\n <div\n className=\"code-block-body\"\n style={\n {\n overflowY: \"visible\",\n backgroundColor: \"hsl(var(--background, 210 40% 98%))\",\n willChange: \"transform\",\n borderBottom: \"none\",\n } as React.CSSProperties\n }\n >\n <ExpandableCode\n isExpandable={shouldExpand}\n totalLines={totalLines}\n preContent={children}\n preProps={preProps}\n className={className}\n />\n </div>\n </div>\n );\n}\n","\"use client\";\n\nimport { useEffect, useId, useRef, useState } from \"react\";\n\ntype CopyButtonProps = {\n content: string;\n};\n\nexport function CopyButton({ content }: CopyButtonProps) {\n const [copied, setCopied] = useState(false);\n const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);\n const statusId = useId();\n\n useEffect(() => {\n return () => {\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n };\n }, []);\n\n async function onCopy() {\n try {\n await navigator.clipboard.writeText(content);\n setCopied(true);\n if (timeoutRef.current) {\n clearTimeout(timeoutRef.current);\n }\n timeoutRef.current = setTimeout(() => setCopied(false), 1600);\n } catch {\n setCopied(false);\n }\n }\n\n return (\n <button\n type=\"button\"\n onClick={onCopy}\n aria-label={copied ? \"Copied\" : \"Copy code\"}\n aria-describedby={statusId}\n style={{\n position: \"relative\",\n border: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n borderRadius: 8,\n background: \"hsl(var(--card, 0 0% 100%))\",\n color: \"hsl(var(--foreground, 220 30% 15%))\",\n fontSize: \"0.78rem\",\n padding: \"0.35rem 0.55rem\",\n cursor: \"copy\",\n }}\n >\n {copied ? \"Copied\" : \"Copy\"}\n <span\n id={statusId}\n aria-live=\"polite\"\n style={{ position: \"absolute\", left: -9999, top: \"auto\" }}\n >\n {copied ? \"Code copied to clipboard\" : \"Ready to copy code\"}\n </span>\n </button>\n );\n}\n","\"use client\";\n\nimport { useEffect, useState, useRef, type ReactNode } from \"react\";\nimport { Ellipsis } from \"lucide-react\";\n\ntype ExpandableCodeProps = {\n isExpandable: boolean;\n totalLines: number;\n preContent: ReactNode;\n preProps: Record<string, unknown>;\n className?: string;\n};\n\nconst DEFAULT_VISIBLE_LINES = 20;\nconst FALLBACK_LINE_HEIGHT_PX = 24;\n\nexport function ExpandableCode({\n isExpandable,\n totalLines,\n preContent,\n preProps,\n className,\n}: ExpandableCodeProps) {\n const [isOpen, setIsOpen] = useState(false);\n const [collapsedMaxHeight, setCollapsedMaxHeight] = useState(\n `${DEFAULT_VISIBLE_LINES * FALLBACK_LINE_HEIGHT_PX}px`\n );\n const preRef = useRef<HTMLPreElement>(null);\n\n const shouldShow = isExpandable && totalLines > DEFAULT_VISIBLE_LINES;\n const isCollapsed = shouldShow && !isOpen;\n\n useEffect(() => {\n const pre = preRef.current;\n if (!pre) return;\n\n const calculateCollapsedHeight = () => {\n const styles = window.getComputedStyle(pre);\n const paddingTop = Number.parseFloat(styles.paddingTop) || 0;\n const paddingBottom = Number.parseFloat(styles.paddingBottom) || 0;\n const contentHeight = Math.max(pre.scrollHeight - paddingTop - paddingBottom, 0);\n\n if (totalLines > 0 && contentHeight > 0) {\n const lineHeight = contentHeight / totalLines;\n setCollapsedMaxHeight(\n `${DEFAULT_VISIBLE_LINES * lineHeight + paddingTop + paddingBottom}px`\n );\n return;\n }\n\n let lineHeight = Number.parseFloat(styles.lineHeight);\n if (!Number.isFinite(lineHeight) || lineHeight === 0) {\n const fontSize = Number.parseFloat(styles.fontSize);\n lineHeight = Number.isFinite(fontSize) ? fontSize * 1.5 : FALLBACK_LINE_HEIGHT_PX;\n }\n\n setCollapsedMaxHeight(`${DEFAULT_VISIBLE_LINES * lineHeight + paddingTop + paddingBottom}px`);\n };\n\n const frame = requestAnimationFrame(calculateCollapsedHeight);\n const timeout = window.setTimeout(calculateCollapsedHeight, 50);\n window.addEventListener(\"resize\", calculateCollapsedHeight);\n\n return () => {\n cancelAnimationFrame(frame);\n window.clearTimeout(timeout);\n window.removeEventListener(\"resize\", calculateCollapsedHeight);\n };\n }, [preContent, totalLines]);\n\n return (\n <>\n <div className=\"mdx-expandable-code-container\">\n <pre\n ref={preRef}\n {...preProps}\n className={`${className || \"\"} mdx-expandable-code`}\n style={{\n margin: 0,\n padding: \"0.9rem\",\n overflowX: \"auto\",\n minWidth: \"100%\",\n maxHeight: isCollapsed ? collapsedMaxHeight : \"none\",\n overflowY: isCollapsed ? \"hidden\" : \"visible\",\n transition: \"max-height 0.3s ease\",\n scrollbarWidth: \"thin\",\n }}\n >\n {preContent}\n </pre>\n </div>\n\n {shouldShow && (\n <div\n className=\"code-block-expandable-footer\"\n style={{\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"0.6rem\",\n background: \"hsl(var(--muted, 210 20% 92%))\",\n borderTop: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n }}\n >\n <button\n className=\"code-block-expandable-toggle\"\n onClick={() => setIsOpen(!isOpen)}\n style={{\n display: \"flex\",\n alignItems: \"center\",\n gap: \"0.5rem\",\n padding: \"0.4rem 0.8rem\",\n border: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n borderRadius: 6,\n background: \"hsl(var(--background, 210 40% 98%))\",\n color: \"hsl(var(--foreground, 220 30% 15%))\",\n fontSize: \"0.85rem\",\n fontWeight: 500,\n cursor: \"pointer\",\n transition: \"all 0.2s ease\",\n fontFamily: \"inherit\",\n }}\n >\n <Ellipsis\n size={16}\n style={{\n transform: isOpen ? \"rotate(180deg)\" : \"rotate(0deg)\",\n transition: \"transform 0.2s ease\",\n }}\n />\n <span>{isOpen ? \"Collapse\" : `See all ${totalLines} lines`}</span>\n </button>\n </div>\n )}\n </>\n );\n}\n","\"use client\";\n\nimport React, {\n useId,\n useState,\n type CSSProperties,\n type KeyboardEvent,\n type ReactNode,\n} from \"react\";\nimport { ChevronRight, File as FileIcon, Folder as FolderIcon, FolderOpen } from \"lucide-react\";\n\ntype TreeMdxProps = {\n className?: string;\n style?: CSSProperties;\n children?: ReactNode;\n};\n\ninterface TreeNode {\n name: string;\n children: TreeNode[];\n}\n\n/** Collect all text (and inline code) from the rendered children tree. */\nfunction collectText(node: ReactNode, out: string[]): void {\n if (typeof node === \"string\" || typeof node === \"number\") {\n out.push(String(node));\n } else if (Array.isArray(node)) {\n node.forEach((n) => collectText(n, out));\n } else if (React.isValidElement(node)) {\n const kids = (node.props as { children?: ReactNode } | undefined)?.children;\n if (kids !== undefined && kids !== null) collectText(kids, out);\n }\n}\n\n/**\n * Parse ASCII tree lines into a node tree.\n * - first line = root (never popped)\n * - depth = count of \"│\" pipes before the connector (leading spaces are\n * stripped by the markdown parser, so indentation MUST use pipes)\n * - folder: name ends with \"/\" (trailing slash)\n */\nfunction parseTree(text: string): TreeNode[] {\n const root: TreeNode[] = [];\n const stack: { node: TreeNode; depth: number }[] = [];\n let first = true;\n for (const raw of text.split(\"\\n\")) {\n const line = raw.replace(/\\t/g, \" \");\n if (!line.trim()) continue;\n const connectorIdx = line.search(/[├└]/);\n const prefix = connectorIdx >= 0 ? line.slice(0, connectorIdx) : \"\";\n const name = line.replace(/^[\\s│├└─]+/, \"\").trim();\n if (!name) continue;\n const depth = (prefix.match(/│/g) || []).length;\n const node: TreeNode = { name: name.replace(/\\/+$/, \"\"), children: [] };\n if (first) {\n root.push(node);\n stack.push({ node, depth });\n first = false;\n continue;\n }\n // root is never popped (stack.length > 1 guard)\n while (stack.length > 1 && stack[stack.length - 1].depth >= depth) stack.pop();\n stack[stack.length - 1].node.children.push(node);\n stack.push({ node, depth });\n }\n return root;\n}\n\nexport function TreeMdx({ className, style, children }: TreeMdxProps) {\n const parts: string[] = [];\n collectText(children, parts);\n const tree = parseTree(parts.join(\"\"));\n if (tree.length === 0) return null;\n\n return (\n <div\n className={className}\n role=\"tree\"\n aria-label=\"Tree\"\n style={{\n border: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n borderRadius: 12,\n padding: \"0.5rem\",\n margin: \"1rem 0\",\n background: \"hsla(var(--card, 0 0% 100%) / 0.9)\",\n backdropFilter: \"blur(8px)\",\n boxShadow: \"0 10px 20px rgba(0,0,0,0.05)\",\n ...style,\n }}\n >\n {tree.map((node) => (\n <TreeRow key={node.name} node={node} />\n ))}\n </div>\n );\n}\n\nfunction TreeRow({ node }: { node: TreeNode }) {\n const [isOpen, setIsOpen] = useState(true);\n const [isHovered, setIsHovered] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n const hasChildren = node.children.length > 0;\n const groupId = useId();\n\n const handleKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (!hasChildren) return;\n if (event.key === \"ArrowRight\") {\n event.preventDefault();\n setIsOpen(true);\n return;\n }\n if (event.key === \"ArrowLeft\") {\n event.preventDefault();\n setIsOpen(false);\n return;\n }\n if (event.key === \"Enter\" || event.key === \" \") {\n event.preventDefault();\n setIsOpen((prev) => !prev);\n }\n };\n\n return (\n <div\n role=\"treeitem\"\n aria-expanded={hasChildren ? isOpen : undefined}\n style={{ marginLeft: \"0.35rem\" }}\n >\n <button\n type=\"button\"\n className=\"flex items-center gap-2 rounded-md px-2 py-1.5 transition-colors duration-150\"\n onClick={() => hasChildren && setIsOpen((prev) => !prev)}\n onMouseEnter={() => setIsHovered(true)}\n onMouseLeave={() => setIsHovered(false)}\n onFocus={() => setIsFocused(true)}\n onBlur={() => setIsFocused(false)}\n onKeyDown={handleKeyDown}\n aria-label={`${isOpen ? \"Collapse\" : \"Expand\"} ${node.name}`}\n aria-expanded={hasChildren ? isOpen : undefined}\n aria-controls={hasChildren ? groupId : undefined}\n style={{\n cursor: hasChildren ? \"pointer\" : \"default\",\n width: \"100%\",\n border: \"none\",\n textAlign: \"left\",\n background:\n isHovered || isFocused ? \"hsla(var(--muted, 210 20% 92%) / 0.45)\" : \"transparent\",\n }}\n >\n {hasChildren ? (\n <ChevronRight\n className=\"h-3.5 w-3.5 transition-transform duration-200\"\n style={{\n transform: isOpen ? \"rotate(90deg)\" : \"rotate(0deg)\",\n color:\n isHovered || isFocused\n ? \"hsl(var(--primary, 210 81% 56%))\"\n : \"hsl(var(--muted-foreground, 220 15% 50%))\",\n }}\n />\n ) : (\n <FileIcon\n className=\"h-3.5 w-3.5\"\n style={{\n color:\n isHovered || isFocused\n ? \"hsl(var(--primary, 210 81% 56%))\"\n : \"hsl(var(--muted-foreground, 220 15% 50%))\",\n }}\n />\n )}\n {hasChildren && isOpen ? (\n <FolderOpen\n className=\"h-4 w-4\"\n style={{\n color:\n isHovered || isFocused\n ? \"hsl(var(--primary, 210 81% 56%))\"\n : \"hsl(var(--muted-foreground, 220 15% 50%))\",\n }}\n />\n ) : (\n hasChildren && (\n <FolderIcon\n className=\"h-4 w-4\"\n style={{\n color:\n isHovered || isFocused\n ? \"hsl(var(--primary, 210 81% 56%))\"\n : \"hsl(var(--muted-foreground, 220 15% 50%))\",\n }}\n />\n )\n )}\n <span\n style={{\n fontWeight: 600,\n fontFamily: hasChildren\n ? \"inherit\"\n : \"SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace\",\n fontSize: \"0.9rem\",\n color:\n isHovered || isFocused\n ? \"hsl(var(--primary, 210 81% 56%))\"\n : \"hsl(var(--foreground, 220 30% 15%))\",\n }}\n >\n {node.name}\n </span>\n </button>\n {hasChildren && isOpen && (\n <div\n id={groupId}\n role=\"group\"\n style={{\n marginLeft: \"1rem\",\n borderLeft: \"2px solid hsl(var(--border-color, 210 20% 85%))\",\n paddingLeft: \"0.6rem\",\n }}\n >\n {node.children.map((child) => (\n <TreeRow key={child.name} node={child} />\n ))}\n </div>\n )}\n </div>\n );\n}\n","\"use client\";\n\nimport { createPortal } from \"react-dom\";\nimport { useEffect, useId, useRef, useState, type ComponentProps, type ComponentType } from \"react\";\n\nexport type ImageMdxProps = Omit<ComponentProps<\"img\">, \"src\"> & {\n src?: any;\n zoom?: boolean;\n ImageComponent?: ComponentType<any>;\n};\n\nexport function ImageMdx({\n src,\n alt = \"image\",\n width = 800,\n height = 350,\n zoom = true,\n style,\n ImageComponent,\n ...props\n}: ImageMdxProps) {\n const Image: any = ImageComponent ?? \"img\";\n const [isOpen, setIsOpen] = useState(false);\n const scrollYRef = useRef(0);\n const closeButtonRef = useRef<HTMLButtonElement | null>(null);\n const dialogId = useId();\n\n useEffect(() => {\n if (!isOpen) return;\n\n scrollYRef.current = window.scrollY;\n document.body.style.position = \"fixed\";\n document.body.style.top = `-${scrollYRef.current}px`;\n document.body.style.width = \"100%\";\n\n closeButtonRef.current?.focus();\n\n const onEsc = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") setIsOpen(false);\n };\n\n const onFocusTrap = (e: KeyboardEvent) => {\n if (e.key !== \"Tab\") return;\n\n const dialog = document.getElementById(dialogId);\n const focusable = dialog?.querySelectorAll<HTMLElement>(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n );\n\n if (!focusable || focusable.length === 0) return;\n\n const first = focusable[0];\n const last = focusable[focusable.length - 1];\n\n if (!e.shiftKey && document.activeElement === last) {\n e.preventDefault();\n first.focus();\n }\n\n if (e.shiftKey && document.activeElement === first) {\n e.preventDefault();\n last.focus();\n }\n };\n\n window.addEventListener(\"keydown\", onEsc);\n window.addEventListener(\"keydown\", onFocusTrap);\n\n return () => {\n document.body.style.position = \"\";\n document.body.style.top = \"\";\n document.body.style.width = \"\";\n window.scrollTo(0, scrollYRef.current);\n window.removeEventListener(\"keydown\", onEsc);\n window.removeEventListener(\"keydown\", onFocusTrap);\n };\n }, [dialogId, isOpen]);\n\n if (!src) return null;\n\n const canZoom = zoom;\n\n return (\n <>\n <button\n type=\"button\"\n onClick={() => canZoom && setIsOpen(true)}\n aria-label={canZoom ? \"Zoom image\" : \"Image\"}\n style={{\n display: \"flex\",\n justifyContent: \"center\",\n position: \"relative\",\n width: \"100%\",\n border: \"none\",\n background: \"transparent\",\n padding: 0,\n margin: \"1rem 0\",\n cursor: canZoom ? \"zoom-in\" : \"default\",\n }}\n >\n <Image\n src={src}\n alt={alt}\n width={typeof width === \"number\" ? width : parseInt(width as string, 10)}\n height={typeof height === \"number\" ? height : parseInt(height as string, 10)}\n style={{\n maxWidth: \"100%\",\n height: \"auto\",\n borderRadius: 10,\n ...style,\n }}\n {...props}\n />\n </button>\n\n {canZoom && isOpen ? (\n <Portal>\n <div\n id={dialogId}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label=\"Image preview\"\n onClick={() => setIsOpen(false)}\n style={{\n position: \"fixed\",\n inset: 0,\n zIndex: 99999,\n background: \"rgba(0,0,0,0.88)\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n padding: \"1rem\",\n }}\n >\n <button\n ref={closeButtonRef}\n type=\"button\"\n aria-label=\"Close image preview\"\n onClick={(e) => {\n e.stopPropagation();\n setIsOpen(false);\n }}\n style={{\n position: \"absolute\",\n top: 16,\n right: 16,\n border: \"1px solid rgba(255,255,255,0.24)\",\n borderRadius: 8,\n background: \"rgba(0,0,0,0.45)\",\n color: \"#fff\",\n padding: \"0.4rem 0.55rem\",\n cursor: \"pointer\",\n }}\n >\n Close\n </button>\n\n <div\n onClick={(e) => e.stopPropagation()}\n style={{\n maxWidth: \"92vw\",\n maxHeight: \"90vh\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }}\n >\n <Image\n src={src}\n alt={alt}\n width={1920}\n height={1080}\n style={{\n width: \"auto\",\n height: \"auto\",\n maxWidth: \"92vw\",\n maxHeight: \"90vh\",\n objectFit: \"contain\",\n borderRadius: 10,\n }}\n />\n </div>\n </div>\n </Portal>\n ) : null}\n </>\n );\n}\n\nfunction Portal({ children }: { children: React.ReactNode }) {\n if (typeof window === \"undefined\") return null;\n return createPortal(children, document.body);\n}\n","import {\n Children,\n cloneElement,\n isValidElement,\n type CSSProperties,\n type HTMLAttributes,\n type LiHTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from \"react\";\n\ntype StepsMdxProps = HTMLAttributes<HTMLOListElement> & {\n children?: ReactNode;\n style?: CSSProperties;\n};\n\ntype StepMdxProps = LiHTMLAttributes<HTMLLIElement> & {\n title: string;\n children?: ReactNode;\n style?: CSSProperties;\n};\n\n// Internal props including stepNumber (auto-injected)\ntype InternalStepProps = StepMdxProps & {\n stepNumber?: number;\n};\n\nexport function StepsMdx({ children, style, className, ...props }: StepsMdxProps) {\n const items = Children.toArray(children);\n\n return (\n <ol\n className={className}\n {...props}\n style={{\n listStyle: \"none\",\n position: \"relative\",\n margin: \"1.2rem 0\",\n padding: 0,\n display: \"grid\",\n gap: 0,\n ...style,\n }}\n >\n {items.map((child, index) => {\n if (!isValidElement(child)) {\n return child;\n }\n\n const item = child as ReactElement<InternalStepProps>;\n\n return cloneElement(item, {\n stepNumber: index + 1,\n });\n })}\n\n {items.length > 1 ? (\n <span\n aria-hidden=\"true\"\n style={{\n position: \"absolute\",\n left: \"1.05rem\",\n top: \"0.8rem\",\n bottom: \"0.8rem\",\n width: 1,\n background: \"hsl(var(--border-color, 210 20% 85%))\",\n pointerEvents: \"none\",\n }}\n />\n ) : null}\n </ol>\n );\n}\n\nexport function StepMdx({ title, children, style, className, ...props }: InternalStepProps) {\n const { stepNumber, ...liProps } = props as InternalStepProps;\n\n return (\n <li\n className={className}\n {...liProps}\n style={{\n position: \"relative\",\n zIndex: 1,\n width: \"100%\",\n minWidth: 0,\n boxSizing: \"border-box\",\n marginLeft: \"0.25rem\",\n paddingLeft: \"2.6rem\",\n paddingBottom: \"1.15rem\",\n ...style,\n }}\n >\n <span\n aria-hidden=\"true\"\n style={{\n position: \"absolute\",\n left: 0,\n top: 0,\n width: stepNumber && stepNumber >= 10 ? \"1.9rem\" : \"1.6rem\",\n height: \"1.6rem\",\n borderRadius: 10,\n display: \"inline-flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n fontSize: \"0.82rem\",\n fontWeight: 600,\n color: \"hsl(var(--muted-foreground, 220 15% 50%))\",\n background: \"hsl(var(--muted, 210 12% 92%))\",\n border: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n }}\n >\n {stepNumber ?? \"-\"}\n </span>\n\n <div\n style={{\n fontWeight: 700,\n fontSize: \"1.02rem\",\n lineHeight: 1.35,\n marginBottom: children ? \"0.55rem\" : 0,\n color: \"hsl(var(--foreground, 220 30% 15%))\",\n }}\n >\n {title}\n </div>\n {children ? (\n <div\n style={{\n color: \"hsl(var(--muted-foreground, 220 15% 50%))\",\n display: \"flow-root\",\n width: \"100%\",\n minWidth: 0,\n maxWidth: \"100%\",\n overflowX: \"auto\",\n overflowY: \"hidden\",\n }}\n >\n {children}\n </div>\n ) : null}\n </li>\n );\n}\n","\"use client\";\n\nimport {\n Children,\n isValidElement,\n useId,\n useState,\n type ReactElement,\n type ReactNode,\n} from \"react\";\n\ntype TabMdxProps = {\n title: string;\n children?: ReactNode;\n};\n\nexport function TabMdx({ children }: TabMdxProps) {\n return <>{children}</>;\n}\n\ntype TabsMdxProps = {\n className?: string;\n children: ReactNode;\n};\n\nfunction titleToValue(title: string) {\n return title\n .trim()\n .toLowerCase()\n .replace(/\\s+/g, \"-\")\n .replace(/[^a-z0-9-_]/g, \"\");\n}\n\nexport function TabsMdx({ className, children }: TabsMdxProps) {\n const id = useId();\n const childArray = Children.toArray(children);\n\n const tabItems = childArray\n .filter(\n (child): child is ReactElement<TabMdxProps> =>\n isValidElement(child) && typeof (child.props as { title?: unknown }).title === \"string\"\n )\n .map((child, index) => {\n const title = child.props.title;\n const fallback = `tab-${index + 1}`;\n const slug = titleToValue(title) || fallback;\n return {\n value: `${slug}-${index + 1}`,\n title,\n children: child.props.children,\n };\n });\n\n const [activeValue, setActiveValue] = useState(tabItems[0]?.value ?? \"\");\n\n const activeItem = tabItems.find((item) => item.value === activeValue) ?? tabItems[0];\n\n return (\n <div className={className} style={{ margin: \"1rem 0\" }}>\n <div\n role=\"tablist\"\n aria-orientation=\"horizontal\"\n style={{\n display: \"flex\",\n flexWrap: \"nowrap\",\n gap: \"0.75rem\",\n alignItems: \"center\",\n overflowX: \"auto\",\n borderBottom: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n }}\n >\n {tabItems.map((item) => {\n const active = item.value === activeItem?.value;\n const triggerId = `${id}-tab-${item.value}`;\n const panelId = `${id}-panel-${item.value}`;\n return (\n <button\n key={item.value}\n id={triggerId}\n type=\"button\"\n role=\"tab\"\n aria-selected={active}\n aria-controls={panelId}\n tabIndex={active ? 0 : -1}\n onClick={() => setActiveValue(item.value)}\n style={{\n border: \"none\",\n borderBottom: active\n ? \"2px solid hsl(var(--primary, 210 81% 56%))\"\n : \"2px solid transparent\",\n background: \"transparent\",\n color: active\n ? \"hsl(var(--primary, 210 81% 56%))\"\n : \"hsl(var(--foreground, 220 30% 15%))\",\n fontSize: \"0.875rem\",\n fontWeight: 600,\n lineHeight: 1.2,\n padding: \"0.7rem 0.15rem\",\n cursor: \"pointer\",\n whiteSpace: \"nowrap\",\n }}\n >\n {item.title}\n </button>\n );\n })}\n </div>\n\n {tabItems.map((item) => {\n const active = item.value === activeItem?.value;\n const triggerId = `${id}-tab-${item.value}`;\n const panelId = `${id}-panel-${item.value}`;\n return (\n <div\n key={item.value}\n role=\"tabpanel\"\n id={panelId}\n aria-labelledby={triggerId}\n hidden={!active}\n tabIndex={0}\n style={{\n marginTop: \"1rem\",\n }}\n >\n {item.children}\n </div>\n );\n })}\n </div>\n );\n}\n","import type {\n CSSProperties,\n HTMLAttributes,\n TableHTMLAttributes,\n TdHTMLAttributes,\n ThHTMLAttributes,\n} from \"react\";\n\nconst tableShellStyle: CSSProperties = {\n position: \"relative\",\n width: \"100%\",\n overflowX: \"auto\",\n overflowY: \"hidden\",\n border: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n borderRadius: 10,\n margin: \"1rem 0\",\n};\n\nconst cellBaseStyle: CSSProperties = {\n padding: \"0.6rem 0.75rem\",\n verticalAlign: \"middle\",\n borderBottom: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n};\n\nexport function TableMdx({ style, ...props }: TableHTMLAttributes<HTMLTableElement>) {\n return (\n <div style={{ ...tableShellStyle }}>\n <table\n {...props}\n style={{\n width: \"100%\",\n fontSize: \"0.925rem\",\n borderCollapse: \"collapse\",\n margin: 0,\n ...style,\n }}\n />\n </div>\n );\n}\n\nexport function TableHeaderMdx(props: HTMLAttributes<HTMLTableSectionElement>) {\n return (\n <thead\n {...props}\n style={{\n background: \"hsl(var(--muted, 210 20% 92%))\",\n ...props.style,\n }}\n />\n );\n}\n\nexport function TableBodyMdx(props: HTMLAttributes<HTMLTableSectionElement>) {\n return <tbody {...props} />;\n}\n\nexport function TableFooterMdx(props: HTMLAttributes<HTMLTableSectionElement>) {\n return (\n <tfoot\n {...props}\n style={{\n background: \"hsl(var(--muted, 210 20% 92%))\",\n borderTop: \"1px solid hsl(var(--border-color, 210 20% 85%))\",\n ...props.style,\n }}\n />\n );\n}\n\nexport function TableRowMdx(props: HTMLAttributes<HTMLTableRowElement>) {\n return <tr {...props} />;\n}\n\nexport function TableHeadMdx(props: ThHTMLAttributes<HTMLTableCellElement>) {\n return (\n <th\n scope={props.scope ?? \"col\"}\n {...props}\n style={{\n ...cellBaseStyle,\n textAlign: \"left\",\n color: \"hsl(var(--muted-foreground, 220 15% 50%))\",\n fontWeight: 600,\n ...props.style,\n }}\n />\n );\n}\n\nexport function TableCellMdx(props: TdHTMLAttributes<HTMLTableCellElement>) {\n return <td {...props} style={{ ...cellBaseStyle, ...props.style }} />;\n}\n","\"use client\";\n\nimport {\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type CSSProperties,\n type ReactNode,\n} from \"react\";\n\ntype TooltipMdxProps = {\n /** Visible trigger text (dotted underline). */\n text?: ReactNode;\n /** Bubble content shown on hover/focus. */\n tip?: ReactNode;\n};\n\nconst GAP = 10;\nconst EDGE = 8;\n\n// Notched tail — an SVG quadratic Bézier path, computed (not hardcoded):\n// the tail box is TAIL_SIZE wide and protrudes TAIL_PROTRUSION past the\n// bubble edge. Two `Q` segments sweep from the shoulders to the tip, so the\n// notch curves like a chat bubble instead of a triangle. The path lives in a\n// 1px-padded viewBox so the 1px stroke is never clipped.\nconst TAIL_SIZE = 26;\nconst TAIL_PROTRUSION = 12;\nconst TAIL_PAD = 1;\nconst TAIL_TIP_X = TAIL_SIZE / 2;\nconst TAIL_W = TAIL_SIZE + TAIL_PAD * 2;\nconst TAIL_H = TAIL_PROTRUSION + TAIL_PAD * 2;\n\n/**\n * Auto-positioned tooltip: the bubble is `position: fixed` and, on hover,\n * measured against the trigger and the window — it flips to the side with\n * more room and clamps to the viewport, so no `side` prop is needed.\n */\nexport function TooltipMdx({ text, tip }: TooltipMdxProps) {\n const [open, setOpen] = useState(false);\n const id = useId();\n const triggerRef = useRef<HTMLSpanElement>(null);\n const bubbleRef = useRef<HTMLSpanElement>(null);\n const [bubbleStyle, setBubbleStyle] = useState<CSSProperties>({});\n const [tailStyle, setTailStyle] = useState<CSSProperties>({});\n const [below, setBelow] = useState(true);\n\n useLayoutEffect(() => {\n if (!open || !triggerRef.current || !bubbleRef.current) return;\n const trigger = triggerRef.current.getBoundingClientRect();\n const bubble = bubbleRef.current.getBoundingClientRect();\n const viewW = window.innerWidth;\n const viewH = window.innerHeight;\n\n // Chat-bubble geometry: align the bubble's edge with the trigger (not\n // center it) and hug the tail to the corner near the trigger. Flip\n // vertically to the side with more room; clamp to the window.\n const flip = viewH - trigger.bottom >= trigger.top;\n const rightOverflow = trigger.left + bubble.width > viewW - EDGE;\n const left = rightOverflow\n ? Math.max(EDGE, viewW - bubble.width - EDGE)\n : Math.min(Math.max(trigger.left, EDGE), viewW - bubble.width - EDGE);\n const top = flip\n ? Math.min(trigger.bottom + GAP, viewH - bubble.height - EDGE)\n : Math.max(trigger.top - GAP - bubble.height, EDGE);\n\n setBubbleStyle({ left, top });\n setBelow(flip);\n\n // Tail: horizontal center tracks the trigger; vertical edge depends on\n // the flip — bubble below trigger → tail at the TOP (tip up), bubble\n // above → tail at the BOTTOM (tip down). Overlap the body border by\n // TAIL_PAD + 1 (2px) so the tail fill fully covers the body's border at\n // the junction — with only 1px the border's outer half still shows\n // through as a separate line across the tail base.\n const tailCenter = trigger.left + trigger.width / 2 - left;\n setTailStyle({\n left: Math.min(Math.max(tailCenter - TAIL_SIZE / 2, 2), bubble.width - TAIL_SIZE - 2),\n top: flip ? -TAIL_PROTRUSION + TAIL_PAD + 1 : bubble.height - TAIL_PAD - 1,\n });\n }, [open]);\n\n const content = tip ?? \"\";\n const show = open && Boolean(content);\n const bubbleColor = \"hsl(var(--card, 0 0% 100%))\";\n const borderColor = \"hsl(var(--border-color, 210 20% 85%))\";\n\n // Quadratic Bézier tail path (tip points down when the bubble sits above\n // the trigger, up otherwise). OPEN path (no Z close) so the attachment edge\n // has no stroke: it sits under the bubble body, and only the curved sides\n // + tip carry the border stroke — otherwise the closing edge's 1px line\n // shows through at the bubble's border and collides with its rounding.\n // Control points sit at the midpoint of the shoulder→tip segment, pulled\n // INWARD (concave) so the notch reads as a chat-bubble tail, pinched\n // sharply from wide shoulders to a point.\n const tipY = TAIL_PROTRUSION + TAIL_PAD;\n const shoulderY = TAIL_PAD;\n const tipX = TAIL_TIP_X + TAIL_PAD;\n const midY = (shoulderY + tipY) / 2;\n const curveIn = 2.5; // inward pull (px) — concave notch\n const leftMid = (TAIL_PAD + tipX) / 2;\n const rightMid = (tipX + TAIL_SIZE + TAIL_PAD) / 2;\n const curveLeft = leftMid + curveIn;\n const curveRight = rightMid - curveIn;\n const rightX = TAIL_SIZE + TAIL_PAD;\n const tailPath = below\n ? `M ${TAIL_PAD} ${tipY} Q ${curveLeft} ${midY} ${tipX} ${shoulderY} Q ${curveRight} ${midY} ${rightX} ${tipY}`\n : `M ${TAIL_PAD} ${shoulderY} Q ${curveLeft} ${midY} ${tipX} ${tipY} Q ${curveRight} ${midY} ${rightX} ${shoulderY}`;\n\n return (\n <span\n style={{ position: \"relative\", display: \"inline-block\" }}\n onMouseEnter={() => setOpen(true)}\n onMouseLeave={() => setOpen(false)}\n onFocus={() => setOpen(true)}\n onBlur={() => setOpen(false)}\n >\n <span\n ref={triggerRef}\n tabIndex={0}\n aria-describedby={id}\n style={{\n cursor: \"help\",\n color: \"hsl(var(--primary, 210 81% 56%))\",\n textDecorationLine: \"underline\",\n textDecorationStyle: \"dotted\",\n textDecorationColor: \"hsl(var(--primary, 210 81% 56%))\",\n textUnderlineOffset: \"0.18em\",\n }}\n onKeyDown={(event) => {\n if (event.key === \"Escape\") {\n setOpen(false);\n }\n }}\n >\n {text ?? \"?\"}\n </span>\n {show ? (\n <span\n ref={bubbleRef}\n role=\"tooltip\"\n style={{ position: \"fixed\", ...bubbleStyle, zIndex: 9999 }}\n >\n {/* Body first, tail painted ON TOP — the tail's fill (same colour as\n the body) covers the body's border where they meet, so the bubble\n outline flows continuously into the notch instead of showing two\n separate borders. */}\n <span\n style={{\n position: \"relative\",\n display: \"inline-flex\",\n alignItems: \"center\",\n maxWidth: \"min(70vw, 22rem)\",\n background: bubbleColor,\n color: \"hsl(var(--foreground, 220 30% 15%))\",\n border: `1px solid ${borderColor}`,\n borderRadius: 16,\n boxShadow: \"0 8px 28px -6px rgb(0 0 0 / 0.18), 0 2px 8px -2px rgb(0 0 0 / 0.08)\",\n padding: \"0.5rem 0.9rem\",\n fontSize: \"0.8125rem\",\n lineHeight: 1.5,\n overflowWrap: \"anywhere\",\n }}\n >\n {content}\n </span>\n <svg\n aria-hidden=\"true\"\n width={TAIL_SIZE}\n height={TAIL_PROTRUSION}\n viewBox={`0 0 ${TAIL_W} ${TAIL_H}`}\n style={{ position: \"absolute\", ...tailStyle, display: \"block\" }}\n >\n <path d={tailPath} fill={bubbleColor} stroke={borderColor} strokeWidth={1} />\n </svg>\n </span>\n ) : null}\n </span>\n );\n}\n","type YoutubeMdxProps = {\n videoId: string;\n title?: string;\n};\n\nexport function YoutubeMdx({ videoId, title = \"YouTube video\" }: YoutubeMdxProps) {\n const src = `https://www.youtube-nocookie.com/embed/${videoId}`;\n\n return (\n <div\n style={{\n position: \"relative\",\n width: \"100%\",\n paddingBottom: \"56.25%\",\n height: 0,\n overflow: \"hidden\",\n background: \"#000\",\n borderRadius: 8,\n boxShadow: \"0 4px 20px rgba(0, 0, 0, 0.2)\",\n margin: \"1rem 0\",\n }}\n >\n <iframe\n src={src}\n title={title}\n allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\"\n allowFullScreen\n style={{\n position: \"absolute\",\n top: 0,\n left: 0,\n width: \"100%\",\n height: \"100%\",\n border: \"none\",\n borderRadius: 8,\n }}\n />\n </div>\n );\n}\n","\"use client\";\n\nimport {\n useId,\n useRef,\n useEffect,\n useState,\n type CSSProperties,\n type KeyboardEvent,\n type ReactNode,\n} from \"react\";\nimport type { Mermaid } from \"mermaid\";\n\n// Module-level singleton — one dynamic import regardless of diagram count\nlet mermaidPromise: Promise<typeof import(\"mermaid\")> | null = null;\n// One-time onboarding — help panel auto-opens on first fullscreen entry per\n// page load (not per diagram); re-openable via the help button\nlet hintSeen = false;\n\ninterface MermaidMdxProps {\n /** Mermaid diagram definition (from rehype plugin or programmatic) */\n chart: string;\n /** Custom DOM id (auto-generated if omitted) */\n id?: string;\n /** Additional CSS class on container */\n className?: string;\n}\n\nfunction getTheme(): \"dark\" | \"default\" {\n return document.documentElement.classList.contains(\"dark\") ? \"dark\" : \"default\";\n}\n\n// Pan/zoom tuning — drag/wheel/touch pan; zoom via the fullscreen control bar\nconst PAN_STEP = 50;\nconst ZOOM_STEP = 1.2;\nconst MIN_SCALE = 0.4;\nconst MAX_SCALE = 4;\n\nconst clampScale = (scale: number) => Math.min(MAX_SCALE, Math.max(MIN_SCALE, scale));\n\nconst controlButtonStyle: CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n width: 28,\n height: 28,\n padding: 0,\n border: \"1px solid rgba(127,127,127,0.35)\",\n borderRadius: 6,\n background: \"rgba(127,127,127,0.12)\",\n color: \"currentcolor\",\n cursor: \"pointer\",\n};\n\n// Top-right chrome (ESC badge / help button) — pill look matching the zoom bar\nconst topBarButtonStyle: CSSProperties = {\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n gap: 6,\n padding: \"6px 10px\",\n border: \"1px solid rgba(127,127,127,0.25)\",\n borderRadius: 8,\n background: \"rgba(127,127,127,0.12)\",\n backdropFilter: \"blur(8px)\",\n color: \"currentcolor\",\n fontSize: 12,\n lineHeight: 1.4,\n cursor: \"pointer\",\n};\n\nfunction ControlButton({\n label,\n onClick,\n cell,\n children,\n}: {\n label: string;\n onClick: () => void;\n cell: { col: number; row: number };\n children: ReactNode;\n}) {\n return (\n <button\n type=\"button\"\n aria-label={label}\n title={label}\n onClick={onClick}\n style={{ ...controlButtonStyle, gridColumn: cell.col, gridRow: cell.row }}\n >\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n {children}\n </svg>\n </button>\n );\n}\n\nexport function MermaidMdx({ chart, id, className }: MermaidMdxProps) {\n const generatedId = useId();\n const domId = id ?? `mermaid-${generatedId.replace(/[:.]/g, \"-\")}`;\n const ref = useRef<HTMLPreElement>(null);\n const chartRef = useRef(chart);\n const mermaidRef = useRef<Mermaid | null>(null);\n const [error, setError] = useState<string | null>(null);\n const [rendered, setRendered] = useState(false);\n const [view, setView] = useState({ x: 0, y: 0, scale: 1 });\n const [fullscreen, setFullscreen] = useState(false);\n const [isPanning, setIsPanning] = useState(false);\n const [showHelp, setShowHelp] = useState(false);\n const dragRef = useRef({ dragging: false, lastX: 0, lastY: 0 });\n const viewportRef = useRef<HTMLDivElement>(null);\n\n // Keep chartRef in sync so theme-change re-render (T-005) can restore text\n chartRef.current = chart;\n\n useEffect(() => {\n if (typeof window === \"undefined\") return;\n if (!chart) return;\n\n let cancelled = false;\n let lazyObserver: IntersectionObserver | null = null;\n let syncObserver: MutationObserver | null = null;\n let themeTimer: ReturnType<typeof setTimeout> | null = null;\n let lastTheme = getTheme();\n // Serialize mermaid.run calls — overlapping runs on the same node detach\n // in-flight SVG and crash inside d3's dispatchEvent (issue #268)\n let runChain: Promise<void> = Promise.resolve();\n\n function enqueueRun(run: () => Promise<void>): Promise<void> {\n const next = runChain.then(() => {\n if (cancelled || !ref.current?.isConnected) return;\n return run();\n });\n // Keep the chain alive after a failure; the caller handles rejection\n runChain = next.catch(() => {});\n return next;\n }\n\n async function init(): Promise<void> {\n try {\n // Invariant 6: singleton dynamic import\n if (!mermaidPromise) {\n mermaidPromise = import(\"mermaid\");\n }\n const mod = await mermaidPromise;\n const mermaid = (mermaidRef.current = mod.default);\n\n mermaid.initialize({ startOnLoad: false, theme: getTheme() });\n\n // Validate syntax early — show error before attempting render\n try {\n await mermaid.parse(chart);\n } catch {\n if (!cancelled) setError(\"Invalid Mermaid syntax\");\n return;\n }\n\n if (cancelled || !ref.current) return;\n\n // T-009: lazy rendering via IntersectionObserver\n lazyObserver = new IntersectionObserver(\n ([entry]) => {\n if (!entry.isIntersecting || cancelled || !ref.current) return;\n enqueueRun(() => {\n const node = ref.current;\n if (!node) return Promise.resolve();\n return mermaid.run({ nodes: [node] });\n })\n .then(() => {\n if (!cancelled) setRendered(true);\n })\n .catch(() => {\n if (!cancelled) setError(\"Failed to render diagram\");\n });\n lazyObserver?.disconnect();\n },\n { rootMargin: \"200px\" }\n );\n lazyObserver.observe(ref.current);\n } catch {\n if (!cancelled) setError(\"Failed to load Mermaid renderer\");\n }\n }\n\n init();\n\n // T-005: theme sync via MutationObserver on <html class>\n syncObserver = new MutationObserver(() => {\n if (themeTimer) clearTimeout(themeTimer);\n themeTimer = setTimeout(() => {\n if (cancelled || !mermaidRef.current || !ref.current) return;\n // Mount effects toggle the class without changing the theme — skip\n // so a spurious mutation cannot race the initial render (issue #268)\n if (getTheme() === lastTheme) return;\n enqueueRun(() => {\n const mermaid = mermaidRef.current;\n const node = ref.current;\n if (!mermaid || !node) return Promise.resolve();\n lastTheme = getTheme();\n // Mermaid replaces innerHTML — restore original chart text before re-render\n node.textContent = chartRef.current;\n // Remove data-processed so mermaid v11 does not skip this node\n node.removeAttribute(\"data-processed\");\n mermaid.initialize({ startOnLoad: false, theme: lastTheme });\n return mermaid.run({ nodes: [node] });\n }).catch((e) => {\n // Warn, not error state — the previously rendered diagram is still on screen\n console.warn(\"[mermaid] diagram render error:\", e);\n });\n }, 200);\n });\n syncObserver.observe(document.documentElement, {\n attributes: true,\n attributeFilter: [\"class\"],\n });\n\n return () => {\n cancelled = true;\n if (themeTimer) clearTimeout(themeTimer);\n lazyObserver?.disconnect();\n syncObserver?.disconnect();\n };\n // chart string is static from MDX — this only fires on mount\n }, []);\n\n const pan = (dx: number, dy: number) => setView((v) => ({ ...v, x: v.x + dx, y: v.y + dy }));\n const zoom = (factor: number) => setView((v) => ({ ...v, scale: clampScale(v.scale * factor) }));\n const resetView = () => setView({ x: 0, y: 0, scale: 1 });\n\n // Lock page scroll while the fullscreen lightbox is open\n useEffect(() => {\n if (!fullscreen) return;\n const previous = document.body.style.overflow;\n document.body.style.overflow = \"hidden\";\n return () => {\n document.body.style.overflow = previous;\n };\n }, [fullscreen]);\n\n // Onboarding — auto-opens the help panel on first fullscreen entry per\n // page load; the help button re-opens it anytime; collapses on exit so a\n // later entry starts clean (one-time onboarding, not \"every entry\")\n useEffect(() => {\n if (fullscreen) {\n if (!hintSeen) {\n hintSeen = true;\n setShowHelp(true);\n }\n } else {\n setShowHelp(false);\n }\n }, [fullscreen]);\n\n // Block native browser gestures (double-tap / pinch / ctrl+wheel zoom).\n // React attaches wheel & touch listeners as passive, so preventDefault\n // needs native non-passive listeners to stop the browser from zooming the\n // whole window while the canvas is in fullscreen.\n useEffect(() => {\n if (!fullscreen || !rendered) return;\n const el = viewportRef.current;\n if (!el) return;\n const blockWheel = (e: WheelEvent) => e.preventDefault();\n const blockTouchStart = (e: TouchEvent) => {\n const target = e.target as HTMLElement | null;\n // Controls must stay clickable on touch devices\n if (target?.closest(\"button\")) return;\n e.preventDefault();\n };\n el.addEventListener(\"wheel\", blockWheel, { passive: false });\n el.addEventListener(\"touchstart\", blockTouchStart, { passive: false });\n return () => {\n el.removeEventListener(\"wheel\", blockWheel);\n el.removeEventListener(\"touchstart\", blockTouchStart);\n };\n }, [fullscreen, rendered]);\n\n // Fullscreen shortcuts live on window so ESC (and pan/zoom keys) keep\n // working regardless of which element holds focus after a click.\n useEffect(() => {\n if (!fullscreen) return;\n const onKeyDown = (e: globalThis.KeyboardEvent) => {\n if (e.ctrlKey || e.metaKey || e.altKey) return;\n const actions: Record<string, () => void> = {\n ArrowUp: () => pan(0, -PAN_STEP),\n ArrowDown: () => pan(0, PAN_STEP),\n ArrowLeft: () => pan(-PAN_STEP, 0),\n ArrowRight: () => pan(PAN_STEP, 0),\n \"+\": () => zoom(ZOOM_STEP),\n \"=\": () => zoom(ZOOM_STEP),\n \"-\": () => zoom(1 / ZOOM_STEP),\n \"0\": resetView,\n Escape: () => setFullscreen(false),\n };\n const action = actions[e.key];\n if (!action) return;\n e.preventDefault();\n action();\n };\n window.addEventListener(\"keydown\", onKeyDown);\n return () => window.removeEventListener(\"keydown\", onKeyDown);\n }, [fullscreen]);\n\n // Guard: empty chart\n if (!chart) return null;\n\n const controlsActive = rendered && fullscreen;\n const showFullscreenBtn = rendered;\n\n const handleKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n // Non-fullscreen: Enter opens fullscreen. Fullscreen shortcuts live on\n // window (see effect above) so they work regardless of focus.\n if (!showFullscreenBtn || controlsActive || e.ctrlKey || e.metaKey || e.altKey) return;\n if (e.key === \"Enter\") {\n e.preventDefault();\n setFullscreen(true);\n }\n };\n\n if (error) {\n return (\n <div\n className={className}\n style={{\n border: \"1px solid hsl(var(--destructive, 0 85% 60%))\",\n borderRadius: 8,\n padding: \"0.75rem 1rem\",\n margin: \"1em 0\",\n }}\n >\n <p\n style={{\n color: \"hsl(var(--destructive, 0 85% 60%))\",\n fontWeight: 600,\n marginBottom: 8,\n fontSize: \"0.875rem\",\n }}\n >\n ⚠️ Diagram rendering error\n </p>\n <pre\n style={{\n fontSize: \"0.875rem\",\n whiteSpace: \"pre-wrap\",\n margin: 0,\n }}\n >\n {chart}\n </pre>\n </div>\n );\n }\n\n return (\n <div\n ref={viewportRef}\n className=\"max-w-full\"\n tabIndex={showFullscreenBtn ? 0 : undefined}\n role={showFullscreenBtn ? \"group\" : undefined}\n aria-label={\n showFullscreenBtn\n ? fullscreen\n ? \"Mermaid diagram. Drag or use arrow keys to pan, + and - to zoom, click the percentage to reset, Esc to exit.\"\n : \"Mermaid diagram. Press Enter to open fullscreen view.\"\n : undefined\n }\n onKeyDown={handleKeyDown}\n onWheel={controlsActive ? (e) => zoom(e.deltaY > 0 ? 1 / ZOOM_STEP : ZOOM_STEP) : undefined}\n onTouchStart={\n controlsActive\n ? (e) => {\n const t = e.touches[0];\n dragRef.current = { dragging: true, lastX: t.clientX, lastY: t.clientY };\n setIsPanning(true);\n }\n : undefined\n }\n onTouchMove={\n controlsActive\n ? (e) => {\n const d = dragRef.current;\n if (!d.dragging) return;\n const t = e.touches[0];\n pan(t.clientX - d.lastX, t.clientY - d.lastY);\n dragRef.current.lastX = t.clientX;\n dragRef.current.lastY = t.clientY;\n }\n : undefined\n }\n onTouchEnd={\n controlsActive\n ? () => {\n dragRef.current.dragging = false;\n setIsPanning(false);\n }\n : undefined\n }\n onTouchCancel={\n controlsActive\n ? () => {\n dragRef.current.dragging = false;\n setIsPanning(false);\n }\n : undefined\n }\n onMouseDown={\n controlsActive\n ? (e) => {\n dragRef.current = { dragging: true, lastX: e.clientX, lastY: e.clientY };\n setIsPanning(true);\n }\n : undefined\n }\n onMouseMove={\n controlsActive\n ? (e) => {\n const d = dragRef.current;\n if (!d.dragging) return;\n pan(e.clientX - d.lastX, e.clientY - d.lastY);\n dragRef.current.lastX = e.clientX;\n dragRef.current.lastY = e.clientY;\n }\n : undefined\n }\n onMouseUp={\n controlsActive\n ? () => {\n dragRef.current.dragging = false;\n setIsPanning(false);\n }\n : undefined\n }\n onMouseLeave={\n controlsActive\n ? () => {\n dragRef.current.dragging = false;\n setIsPanning(false);\n }\n : undefined\n }\n style={{\n ...(fullscreen\n ? {\n position: \"fixed\",\n inset: 0,\n zIndex: 50,\n background: \"hsl(var(--background, 0 0% 100%))\",\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n }\n : { position: \"relative\" }),\n ...(controlsActive\n ? {\n overflow: \"hidden\",\n touchAction: \"none\",\n userSelect: \"none\",\n cursor: isPanning ? \"grabbing\" : \"grab\",\n }\n : { overflow: \"auto\" }),\n }}\n >\n <div\n style={\n controlsActive\n ? {\n transform: `translate(${view.x}px, ${view.y}px) scale(${view.scale})`,\n transformOrigin: \"center center\",\n transition: isPanning ? \"none\" : \"transform 150ms ease\",\n }\n : undefined\n }\n >\n <pre\n ref={ref}\n id={domId}\n className={`mermaid not-prose${className ? ` ${className}` : \"\"}`}\n style={{ margin: \"1em auto\", width: \"fit-content\", maxWidth: \"100%\" }}\n >\n {chart}\n </pre>\n </div>\n\n {showFullscreenBtn ? (\n controlsActive ? (\n <div\n role=\"group\"\n aria-label=\"Pan and zoom controls\"\n style={{ position: \"absolute\", inset: 0, pointerEvents: \"none\" }}\n >\n {/* Top-right chrome: ESC badge + help toggle, panel drops below */}\n <div\n style={{\n position: \"absolute\",\n top: 12,\n right: 12,\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-end\",\n gap: 8,\n pointerEvents: \"auto\",\n }}\n >\n <div style={{ display: \"flex\", gap: 8 }}>\n <button\n type=\"button\"\n aria-label=\"Exit full screen\"\n onClick={() => setFullscreen(false)}\n style={topBarButtonStyle}\n >\n <kbd\n style={{\n padding: \"1px 5px\",\n borderRadius: 4,\n border: \"1px solid rgba(127,127,127,0.4)\",\n background: \"rgba(127,127,127,0.15)\",\n fontSize: 11,\n fontFamily: \"inherit\",\n lineHeight: 1.4,\n }}\n >\n Esc\n </kbd>\n <span>Exit fullscreen</span>\n </button>\n <button\n type=\"button\"\n aria-label=\"Toggle help\"\n aria-expanded={showHelp}\n title=\"Canvas controls & keyboard shortcuts\"\n onClick={() => setShowHelp((v) => !v)}\n style={{ ...topBarButtonStyle, width: 28, padding: 0, fontSize: 14 }}\n >\n {showHelp ? \"×\" : \"?\"}\n </button>\n </div>\n\n {/* Onboarding / shortcuts — auto-opens once, re-openable via \"?\" */}\n {showHelp ? (\n <div\n role=\"status\"\n style={{\n padding: \"10px 12px\",\n borderRadius: 10,\n border: \"1px solid rgba(127,127,127,0.25)\",\n background: \"rgba(127,127,127,0.12)\",\n backdropFilter: \"blur(8px)\",\n color: \"currentcolor\",\n fontSize: 12,\n lineHeight: 1.7,\n maxWidth: 280,\n }}\n >\n <p style={{ margin: 0, fontWeight: 600 }}>Canvas controls</p>\n <p style={{ margin: 0 }}>Move — hold scroll wheel or tap & drag</p>\n <p style={{ margin: 0 }}>Zoom — + / − keys or scroll</p>\n <p style={{ margin: 0 }}>Reset — 0 or click the zoom %</p>\n <p style={{ margin: 0 }}>Exit — Esc</p>\n </div>\n ) : null}\n </div>\n\n {/* Zoom bar — minus / percentage-reset / plus */}\n <div\n style={{\n position: \"absolute\",\n bottom: 16,\n left: \"50%\",\n transform: \"translateX(-50%)\",\n display: \"flex\",\n alignItems: \"center\",\n gap: 2,\n padding: 4,\n borderRadius: 10,\n border: \"1px solid rgba(127,127,127,0.25)\",\n background: \"rgba(127,127,127,0.12)\",\n backdropFilter: \"blur(8px)\",\n pointerEvents: \"auto\",\n }}\n >\n <ControlButton\n label=\"Zoom out\"\n onClick={() => zoom(1 / ZOOM_STEP)}\n cell={{ col: 1, row: 1 }}\n >\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m21 21-4-4M8 11h6\" />\n </ControlButton>\n <button\n type=\"button\"\n aria-label=\"Reset view\"\n title=\"Reset zoom to 100%\"\n onClick={resetView}\n style={{\n minWidth: 56,\n height: 28,\n padding: \"0 8px\",\n border: \"none\",\n borderRadius: 6,\n background: \"transparent\",\n color: \"currentcolor\",\n fontSize: 12,\n fontVariantNumeric: \"tabular-nums\",\n cursor: \"pointer\",\n }}\n >\n {Math.round(view.scale * 100)}%\n </button>\n <ControlButton\n label=\"Zoom in\"\n onClick={() => zoom(ZOOM_STEP)}\n cell={{ col: 3, row: 1 }}\n >\n <circle cx=\"11\" cy=\"11\" r=\"7\" />\n <path d=\"m21 21-4-4M8 11h6M11 8v6\" />\n </ControlButton>\n </div>\n </div>\n ) : (\n <div style={{ position: \"absolute\", bottom: 8, right: 8 }}>\n <ControlButton\n label=\"Enter full screen\"\n onClick={() => setFullscreen(true)}\n cell={{ col: 1, row: 1 }}\n >\n <path d=\"M8 3H5a2 2 0 0 0-2 2v3M21 8V5a2 2 0 0 0-2-2h-3M3 16v3a2 2 0 0 0 2 2h3M16 21h3a2 2 0 0 0 2-2v-3\" />\n </ControlButton>\n </div>\n )\n ) : null}\n </div>\n );\n}\n"],"mappings":";AAAA,SAAS,qBAAyC;;;ACAlD,YAAY,iBAAiB;AAiBpB;AAVT,IAAM,oBAAoB;AAEnB,SAAS,kBAAkB,MAA4B;AAC5D,QAAM,aAAa,OAAO,SAAS,WAAW,KAAK,KAAK,IAAI;AAC5D,MAAI,CAAC,cAAc,CAAC,OAAO,OAAO,aAAa,UAAU,GAAG;AAC1D,WAAO;AAAA,EACT;AAEA,QAAM,gBAAgB,YAAY,UAAsB;AAExD,SAA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EAAE,MAAM,GAAG,MAAM,CAAC;AAC7D;AAEO,SAAS,oBAAoB,mBAAoC,CAAC,GAAoB;AAC3F,SAAO;AAAA,IACL,MAAM;AAAA,IACN,KAAK;AAAA,IACL,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,OAAO;AAAA,IACP,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,IAAI;AAAA,IACJ,KAAK;AAAA,IACL,GAAG;AAAA,IACH,MAAM;AAAA,IACN,MAAM;AAAA,IACN,KAAK,QAAQ,KAAK;AAAA,IAClB,MAAM,QAAQ,MAAM;AAAA,IACpB,QAAQ,QAAQ,QAAQ;AAAA,IACxB,SAAS,QAAQ,SAAS;AAAA,IAC1B,SAAS,QAAQ,SAAS;AAAA,IAC1B,OAAO;AAAA,IACP,MAAM;AAAA,IACN,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,OAAO;AAAA,IACP,MAAM;AAAA,IACN,OAAO;AAAA,IACP,KAAK;AAAA,IACL,SAAS;AAAA,IACT,SAAS;AAAA,IACT,SAAS;AAAA,IACT,GAAG;AAAA,EACL;AACF;","names":["jsx","jsx","jsxs","useState","jsx","useState","useId","useState","jsx","jsx","jsxs","useId","useState","jsx","useId","useState","jsx","jsxs","useEffect","useState","useRef","Fragment","jsx","jsxs","lineHeight","jsx","jsxs","useId","useState","ChevronRight","jsx","jsxs","useEffect","useId","useRef","useState","Fragment","jsx","jsxs","cloneElement","isValidElement","jsx","jsxs","Children","isValidElement","useId","useState","Fragment","jsx","jsxs","jsx","useId","useRef","useState","jsx","jsxs","jsx","useId","useRef","useEffect","useState","jsx","jsxs"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docubook/markdown",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-beta.0",
|
|
4
4
|
"description": "Portable MDX components and framework adapters for DocuBook",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"react": ">=18",
|
|
44
44
|
"react-dom": ">=18",
|
|
45
45
|
"react-icons": "^5.0.0",
|
|
46
|
-
"@docubook/core": "^2.0.0-
|
|
46
|
+
"@docubook/core": "^2.0.0-beta.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@testing-library/jest-dom": "^6.9.1",
|