@suzumiyaaoba/mdxr 0.1.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.
Files changed (236) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -0
  3. package/dist/cli.d.mts +1 -0
  4. package/dist/cli.mjs +2902 -0
  5. package/dist/components.d.mts +791 -0
  6. package/dist/components.mjs +2 -0
  7. package/dist/config-SI9IyFiC.mjs +184 -0
  8. package/dist/doc-context-CEqzMYKv.d.mts +568 -0
  9. package/dist/index.d.mts +20 -0
  10. package/dist/index.mjs +4 -0
  11. package/dist/ui-GKFD0mx5.mjs +15986 -0
  12. package/package.json +131 -0
  13. package/skill/SKILL.md +49 -0
  14. package/skill/references/components/charts.md +172 -0
  15. package/skill/references/components/document.md +98 -0
  16. package/skill/references/components/forms.md +35 -0
  17. package/skill/references/components/investigation.md +198 -0
  18. package/skill/references/components/layout.md +68 -0
  19. package/skill/references/components/output.md +158 -0
  20. package/skill/references/components/planning.md +155 -0
  21. package/skill/references/components/reports.md +252 -0
  22. package/skill/references/components/shadcn.md +19 -0
  23. package/skill/references/components.md +186 -0
  24. package/skill/references/extending.md +48 -0
  25. package/src/ask-sheet.ts +40 -0
  26. package/src/assets/css.ts +392 -0
  27. package/src/assets/scripts.ts +78 -0
  28. package/src/catalog.ts +287 -0
  29. package/src/cli.ts +178 -0
  30. package/src/client/doc-events.ts +1108 -0
  31. package/src/client/entry.ts +27 -0
  32. package/src/client-js.ts +47 -0
  33. package/src/component-map.ts +47 -0
  34. package/src/components/ui/accordion.tsx +77 -0
  35. package/src/components/ui/alert-dialog.tsx +185 -0
  36. package/src/components/ui/alert.tsx +76 -0
  37. package/src/components/ui/aspect-ratio.tsx +22 -0
  38. package/src/components/ui/attachment.tsx +208 -0
  39. package/src/components/ui/avatar.tsx +106 -0
  40. package/src/components/ui/badge.tsx +52 -0
  41. package/src/components/ui/breadcrumb.tsx +121 -0
  42. package/src/components/ui/bubble.tsx +128 -0
  43. package/src/components/ui/button-group.tsx +88 -0
  44. package/src/components/ui/button.tsx +58 -0
  45. package/src/components/ui/calendar.tsx +226 -0
  46. package/src/components/ui/card.tsx +102 -0
  47. package/src/components/ui/carousel.tsx +246 -0
  48. package/src/components/ui/chart.tsx +379 -0
  49. package/src/components/ui/checkbox.tsx +27 -0
  50. package/src/components/ui/collapsible.tsx +19 -0
  51. package/src/components/ui/combobox.tsx +298 -0
  52. package/src/components/ui/command.tsx +193 -0
  53. package/src/components/ui/context-menu.tsx +271 -0
  54. package/src/components/ui/dialog.tsx +159 -0
  55. package/src/components/ui/direction.tsx +4 -0
  56. package/src/components/ui/drawer.tsx +227 -0
  57. package/src/components/ui/dropdown-menu.tsx +269 -0
  58. package/src/components/ui/empty.tsx +104 -0
  59. package/src/components/ui/field.tsx +237 -0
  60. package/src/components/ui/fieldset.tsx +32 -0
  61. package/src/components/ui/frame.tsx +87 -0
  62. package/src/components/ui/hover-card.tsx +50 -0
  63. package/src/components/ui/input-group.tsx +159 -0
  64. package/src/components/ui/input-otp.tsx +83 -0
  65. package/src/components/ui/input.tsx +19 -0
  66. package/src/components/ui/item.tsx +202 -0
  67. package/src/components/ui/kbd.tsx +26 -0
  68. package/src/components/ui/label.tsx +19 -0
  69. package/src/components/ui/marker.tsx +71 -0
  70. package/src/components/ui/menubar.tsx +284 -0
  71. package/src/components/ui/message-scroller.tsx +128 -0
  72. package/src/components/ui/message.tsx +91 -0
  73. package/src/components/ui/meter.tsx +80 -0
  74. package/src/components/ui/native-select.tsx +64 -0
  75. package/src/components/ui/navigation-menu.tsx +170 -0
  76. package/src/components/ui/pagination.tsx +133 -0
  77. package/src/components/ui/popover.tsx +87 -0
  78. package/src/components/ui/progress.tsx +82 -0
  79. package/src/components/ui/questionnaire.tsx +328 -0
  80. package/src/components/ui/radio-group.tsx +35 -0
  81. package/src/components/ui/resizable.tsx +49 -0
  82. package/src/components/ui/scroll-area.tsx +50 -0
  83. package/src/components/ui/select.tsx +201 -0
  84. package/src/components/ui/separator.tsx +22 -0
  85. package/src/components/ui/sheet.tsx +135 -0
  86. package/src/components/ui/sidebar.tsx +730 -0
  87. package/src/components/ui/skeleton.tsx +13 -0
  88. package/src/components/ui/slider.tsx +51 -0
  89. package/src/components/ui/spinner.tsx +16 -0
  90. package/src/components/ui/switch.tsx +31 -0
  91. package/src/components/ui/table.tsx +113 -0
  92. package/src/components/ui/tabs.tsx +82 -0
  93. package/src/components/ui/textarea.tsx +17 -0
  94. package/src/components/ui/toast.tsx +229 -0
  95. package/src/components/ui/toggle-group.tsx +87 -0
  96. package/src/components/ui/toggle.tsx +43 -0
  97. package/src/components/ui/tooltip.tsx +65 -0
  98. package/src/components.ts +78 -0
  99. package/src/config.ts +56 -0
  100. package/src/define.ts +122 -0
  101. package/src/doc-context.ts +20 -0
  102. package/src/editor.ts +94 -0
  103. package/src/format-error.ts +78 -0
  104. package/src/guards.ts +84 -0
  105. package/src/hooks/use-mobile.ts +21 -0
  106. package/src/html.ts +91 -0
  107. package/src/hydrate/export-index.ts +232 -0
  108. package/src/hydrate/import-scan.ts +169 -0
  109. package/src/hydrate/plugins.ts +118 -0
  110. package/src/hydrate/runtime-module.ts +145 -0
  111. package/src/hydrate-runtime.ts +67 -0
  112. package/src/hydrate.ts +147 -0
  113. package/src/index.ts +16 -0
  114. package/src/init.ts +57 -0
  115. package/src/langs.ts +148 -0
  116. package/src/lines.ts +53 -0
  117. package/src/load-user-module.ts +191 -0
  118. package/src/mdx.ts +248 -0
  119. package/src/paths.ts +36 -0
  120. package/src/rehype/shiki.ts +533 -0
  121. package/src/remark/alerts.ts +53 -0
  122. package/src/remark/ast.ts +96 -0
  123. package/src/remark/callouts.ts +25 -0
  124. package/src/remark/code-file.ts +85 -0
  125. package/src/remark/code-meta.ts +21 -0
  126. package/src/remark/directives.ts +170 -0
  127. package/src/remark/file-paths.ts +64 -0
  128. package/src/remark/headings.ts +131 -0
  129. package/src/remark/no-js.ts +40 -0
  130. package/src/render.ts +337 -0
  131. package/src/serve.ts +322 -0
  132. package/src/styles/globals.css +134 -0
  133. package/src/styles/shadcn.css +641 -0
  134. package/src/tailwind.ts +119 -0
  135. package/src/ui/approvals.tsx +76 -0
  136. package/src/ui/ask-question.tsx +386 -0
  137. package/src/ui/ask.tsx +206 -0
  138. package/src/ui/attrs.ts +51 -0
  139. package/src/ui/audit.tsx +139 -0
  140. package/src/ui/bar-chart.tsx +334 -0
  141. package/src/ui/benchmarks.tsx +143 -0
  142. package/src/ui/bits.tsx +537 -0
  143. package/src/ui/board.tsx +173 -0
  144. package/src/ui/bridge.tsx +207 -0
  145. package/src/ui/bumps.tsx +178 -0
  146. package/src/ui/callout.tsx +106 -0
  147. package/src/ui/changes.tsx +89 -0
  148. package/src/ui/chart-bits.tsx +52 -0
  149. package/src/ui/chart.ts +577 -0
  150. package/src/ui/checks.tsx +203 -0
  151. package/src/ui/child-index.tsx +44 -0
  152. package/src/ui/children.ts +43 -0
  153. package/src/ui/chips.tsx +49 -0
  154. package/src/ui/cmd.tsx +27 -0
  155. package/src/ui/columns.tsx +31 -0
  156. package/src/ui/comments.tsx +544 -0
  157. package/src/ui/compare.tsx +67 -0
  158. package/src/ui/decision.tsx +79 -0
  159. package/src/ui/deps.tsx +78 -0
  160. package/src/ui/details.tsx +43 -0
  161. package/src/ui/diff-parse.ts +307 -0
  162. package/src/ui/diff.tsx +458 -0
  163. package/src/ui/diffstat.tsx +58 -0
  164. package/src/ui/due.tsx +65 -0
  165. package/src/ui/effort.tsx +29 -0
  166. package/src/ui/endpoints.tsx +118 -0
  167. package/src/ui/envvars.tsx +96 -0
  168. package/src/ui/figure.tsx +37 -0
  169. package/src/ui/file-icon.ts +1020 -0
  170. package/src/ui/file-link.ts +32 -0
  171. package/src/ui/file-ref.tsx +39 -0
  172. package/src/ui/files.tsx +112 -0
  173. package/src/ui/findings.tsx +85 -0
  174. package/src/ui/flow.tsx +73 -0
  175. package/src/ui/funnel.tsx +121 -0
  176. package/src/ui/gantt.tsx +443 -0
  177. package/src/ui/gauges.tsx +135 -0
  178. package/src/ui/glossary.tsx +29 -0
  179. package/src/ui/graph-layout.ts +149 -0
  180. package/src/ui/graph-specs.tsx +102 -0
  181. package/src/ui/graph.tsx +278 -0
  182. package/src/ui/grid.tsx +119 -0
  183. package/src/ui/hypothesis.tsx +94 -0
  184. package/src/ui/icon.tsx +80 -0
  185. package/src/ui/incident.tsx +130 -0
  186. package/src/ui/index.ts +342 -0
  187. package/src/ui/ins-del.tsx +41 -0
  188. package/src/ui/json.tsx +190 -0
  189. package/src/ui/layout.ts +9 -0
  190. package/src/ui/line-chart.tsx +251 -0
  191. package/src/ui/matrix.tsx +208 -0
  192. package/src/ui/meta.tsx +73 -0
  193. package/src/ui/option.tsx +64 -0
  194. package/src/ui/owner.tsx +40 -0
  195. package/src/ui/packages.tsx +104 -0
  196. package/src/ui/pathway.tsx +96 -0
  197. package/src/ui/phase.tsx +41 -0
  198. package/src/ui/pie-chart.tsx +170 -0
  199. package/src/ui/plan.tsx +77 -0
  200. package/src/ui/pre.tsx +175 -0
  201. package/src/ui/priority.tsx +51 -0
  202. package/src/ui/props.tsx +77 -0
  203. package/src/ui/quadrant.tsx +172 -0
  204. package/src/ui/radar.tsx +200 -0
  205. package/src/ui/ref.tsx +160 -0
  206. package/src/ui/release.tsx +178 -0
  207. package/src/ui/req.tsx +42 -0
  208. package/src/ui/review.tsx +133 -0
  209. package/src/ui/risk.tsx +67 -0
  210. package/src/ui/sankey.tsx +287 -0
  211. package/src/ui/scatter.tsx +237 -0
  212. package/src/ui/schema.tsx +113 -0
  213. package/src/ui/score.tsx +105 -0
  214. package/src/ui/search.tsx +120 -0
  215. package/src/ui/series.tsx +38 -0
  216. package/src/ui/severity.tsx +69 -0
  217. package/src/ui/shadcn.tsx +216 -0
  218. package/src/ui/spark.tsx +86 -0
  219. package/src/ui/stack.tsx +57 -0
  220. package/src/ui/stats.tsx +63 -0
  221. package/src/ui/status-badge.tsx +66 -0
  222. package/src/ui/statuspage.tsx +238 -0
  223. package/src/ui/steps.tsx +74 -0
  224. package/src/ui/summary.tsx +41 -0
  225. package/src/ui/symbol-ref.tsx +73 -0
  226. package/src/ui/terminal.tsx +117 -0
  227. package/src/ui/tests.tsx +218 -0
  228. package/src/ui/timeline.tsx +63 -0
  229. package/src/ui/toc.tsx +56 -0
  230. package/src/ui/tones.ts +187 -0
  231. package/src/ui/trace.tsx +69 -0
  232. package/src/ui/tree.tsx +281 -0
  233. package/src/ui/treemap.tsx +128 -0
  234. package/src/ui/venn.tsx +258 -0
  235. package/src/ui/verdict.tsx +78 -0
  236. package/src/ui/waterfall.tsx +142 -0
@@ -0,0 +1,2 @@
1
+ import { $ as Tabs, $a as ComboboxGroup, $c as Funnel, $i as Drawer, $l as Bump, $n as NavigationMenuList, $o as BreadcrumbLink, $r as ItemFooter, $s as RISK_LEVELS, $t as SelectContent, A as Stats, Aa as CommandGroup, Ac as LineChart, Ai as FieldTitle, Al as Terminal, An as Progress, Ao as CarouselPrevious, Ar as MenubarGroup, As as AlertDialogFooter, At as SidebarMenuSkeleton, Au as Owner, B as Toast, Ba as DialogFooter, Bc as Cell, Bi as DropdownMenuContent, Bl as Check, Bn as PopoverTrigger, Bo as CalendarDayButton, Br as MenubarSubContent, Bs as AccordionContent, Bt as TooltipContent, Bu as defineComponent, C as DAY_STATUSES, Ca as ContextMenuSub, Cc as Package, Ci as FieldDescription, Cl as After, Cn as QuestionnaireItem, Co as ChartStyle, Cr as MessageScrollerViewport, Cs as AlertDescription, Ct as SidebarInput, Cu as isSeverity, D as StatusPage, Da as Command, Dc as Meta, Di as FieldLegend, Dl as REVIEW_VERDICTS, Dn as QuestionnaireSkip, Do as CarouselContent, Dr as Menubar, Ds as AlertDialogCancel, Dt as SidebarMenuBadge, Du as Question, E as Service, Ea as ContextMenuTrigger, Ec as Option, Ei as FieldLabel, El as Comment, En as QuestionnaireProgress, Eo as Carousel, Er as useMessageScrollerVisibility, Es as AlertDialogAction, Et as SidebarMenuAction, Eu as QUESTION_TYPES, Fa as CommandShortcut, Fc as INCIDENT_STATUSES, Fi as EmptyHeader, Fl as parseDiff, Fn as Popover, Fo as CardDescription, Fr as MenubarRadioGroup, Fs as AlertDialogTitle, Ft as SidebarRail, G as ToastPortal, Ga as DialogTrigger, Gc as Glossary, Gi as DropdownMenuRadioGroup, Gl as formatDuration, Gn as PaginationLink, Go as Separator, Gr as MarkerIcon, Gs as Score, Gt as SheetClose, H as ToastClose, Ha as DialogOverlay, Hc as Graph, Hi as DropdownMenuItem, Hl as TEST_STATUSES, Hn as PaginationContent, Ho as ButtonGroupSeparator, Hr as MenubarTrigger, Hs as AccordionTrigger, Ht as TooltipTrigger, I as ToggleGroup, Ia as Dialog, Ic as Incident, Ii as EmptyMedia, Il as Column, In as PopoverContent, Io as CardFooter, Ir as MenubarRadioItem, Is as AlertDialogTrigger, It as SidebarSeparator, J as ToastViewport, Ja as ComboboxChips, Jc as Gauge, Ji as DropdownMenuShortcut, Jl as Change, Jn as NavigationMenu, Jo as BubbleGroup, Jr as KbdGroup, Js as Schema, Jt as SheetFooter, K as ToastProvider, Ka as Combobox, Kc as Term, Ki as DropdownMenuRadioItem, Kl as parseDuration, Kn as PaginationNext, Ko as Bubble, Kr as markerVariants, Ks as DbField, Kt as SheetContent, L as ToggleGroupItem, La as DialogClose, Lc as HYPOTHESIS_STATUSES, Li as EmptyTitle, Ll as Columns, Ln as PopoverDescription, Lo as CardHeader, Lr as MenubarSeparator, Ls as Button, Lt as SidebarTrigger, M as Stack, Ma as CommandItem, Mc as Json, Mi as Empty, Ml as TERMINAL_LANGS, Mn as ProgressLabel, Mo as Card, Mr as MenubarLabel, Ms as AlertDialogMedia, Mt as SidebarMenuSubButton, Mu as hasIcon, N as SPARK_TONES, Na as CommandList, Nc as Del, Ni as EmptyContent, Nn as ProgressTrack, No as CardAction, Nr as MenubarMenu, Ns as AlertDialogOverlay, Nt as SidebarMenuSubItem, Nu as normalizeIconName, O as Uptime, Oa as CommandDialog, Oc as MetaItem, Oi as FieldSeparator, Ol as Review, On as QuestionnaireSubmit, Oo as CarouselItem, Or as MenubarCheckboxItem, Os as AlertDialogContent, Ot as SidebarMenuButton, Ou as Approval, P as Spark, Pa as CommandSeparator, Pc as Ins, Pi as EmptyDescription, Pl as DiffView, Pn as ProgressValue, Po as CardContent, Pr as MenubarPortal, Ps as AlertDialogPortal, Pt as SidebarProvider, Q as useToastManager, Qa as ComboboxEmpty, Qc as Task, Qi as DropdownMenuTrigger, Ql as BUMP_KINDS, Qn as NavigationMenuLink, Qo as BreadcrumbItem, Qr as ItemDescription, Qs as Sankey, Qt as Select, R as Toggle, Ra as DialogContent, Rc as Hypotheses, Ri as DropdownMenu, Rl as Cmd, Rn as PopoverHeader, Ro as CardTitle, Rr as MenubarShortcut, Rs as buttonVariants, Rt as useSidebar, S as Summary, Sa as ContextMenuShortcut, Sc as PACKAGE_KINDS, Si as FieldContent, Sl as Decision, Sn as QuestionnaireInput, So as ChartLegendContent, Sr as MessageScrollerProvider, Ss as AlertAction, St as SidebarHeader, Su as Severity, T as SERVICE_STATUSES, Ta as ContextMenuSubTrigger, Tc as OPTION_STATUSES, Ti as FieldGroup, Tl as Comments, Tn as QuestionnairePrevious, To as ChartTooltipContent, Tr as useMessageScrollerScrollable, Ts as AlertDialog, Tt as SidebarMenu, Tu as Choice, U as ToastContent, Ua as DialogPortal, Uc as Edge, Ui as DropdownMenuLabel, Ul as Test, Un as PaginationEllipsis, Uo as ButtonGroupText, Ur as Marker, Us as Search, Ut as Skeleton, V as ToastAction, Va as DialogHeader, Vc as Grid, Vi as DropdownMenuGroup, Vl as Checks, Vn as Pagination, Vo as ButtonGroup, Vr as MenubarSubTrigger, Vs as AccordionItem, Vt as TooltipProvider, Vu as textOf, W as ToastDescription, Wa as DialogTitle, Wc as Node, Wi as DropdownMenuPortal, Wl as Tests, Wn as PaginationItem, Wo as buttonGroupVariants, Wr as MarkerContent, Ws as Searches, Wt as Sheet, X as createToastManager, Xa as ComboboxCollection, Xc as Gantt, Xi as DropdownMenuSubContent, Xl as CALLOUT_KINDS, Xn as NavigationMenuIndicator, Xo as Breadcrumb, Xr as ItemActions, Xs as Scatter, Xt as SheetTitle, Y as Toaster, Ya as ComboboxChipsInput, Yc as Gauges, Yi as DropdownMenuSub, Yl as Changes, Yn as NavigationMenuContent, Yo as BubbleReactions, Yr as Item, Ys as Point, Yt as SheetHeader, Z as toast, Za as ComboboxContent, Zc as Milestone, Zi as DropdownMenuSubTrigger, Zl as Callout, Zn as NavigationMenuItem, Zo as BreadcrumbEllipsis, Zr as ItemContent, Zs as Link, Zt as SheetTrigger, _ as Timeline, _a as ContextMenuLabel, _c as PieChart, _i as FrameTitle, _l as Details, _n as QuestionnaireChoice, _o as CollapsibleContent, _r as MessageHeader, _s as AttachmentMedia, _t as SidebarFooter, _u as Bar, a as Verdict, aa as DrawerOverlay, ac as Release, ai as InputOTP, al as Findings, an as SelectSeparator, ao as ComboboxTrigger, ar as NativeSelectOption, as as Avatar, at as TableBody, au as Lane, b as Step, ba as ContextMenuRadioItem, bc as Pathway, bi as FieldsetPrimitive, bl as Deps, bn as QuestionnaireDescription, bo as ChartContainer, br as MessageScrollerContent, bs as AspectRatio, bt as SidebarGroupContent, bu as Vuln, c as Venn, ca as DrawerTitle, cc as PR, ci as InputOTPSlot, cl as Files, cn as ScrollArea, co as InputGroup, cr as MeterLabel, cs as AvatarGroup, ct as TableFooter, d as Tree, da as useDirection, dc as Pin, di as HoverCardTrigger, dl as EnvVar, dn as ResizablePanel, do as InputGroupInput, dr as MeterValue, ds as Attachment, dt as TableRow, du as EFFORT_SIZES, ea as DrawerClose, ec as Risk, ei as ItemGroup, el as Stage, en as SelectGroup, eo as ComboboxInput, er as NavigationMenuPositioner, es as BreadcrumbList, et as TabsContent, eu as Bumps, f as FRAME_KINDS, fa as ContextMenu, fc as Quadrant, fi as Frame, fl as EnvVars, fn as ResizablePanelGroup, fo as InputGroupText, fr as Message, fs as AttachmentAction, ft as Switch, fu as Effort, g as Event, ga as ContextMenuItem, gc as PlanHeader, gi as FramePanel, gl as DiffStat, gn as QuestionnaireActions, go as Collapsible, gr as MessageGroup, gs as AttachmentGroup, gt as SidebarContent, gu as Benchmarks, h as Toc, ha as ContextMenuGroup, hc as Plan, hi as FrameHeader, hl as HTTP_METHODS, hn as Questionnaire, ho as Input, hr as MessageFooter, hs as AttachmentDescription, ht as Sidebar, hu as Bench, i as VERDICTS, ia as DrawerHeader, ic as Entry, ii as ItemTitle, il as Finding, in as SelectScrollUpButton, io as ComboboxSeparator, ir as NativeSelectOptGroup, is as badgeVariants, it as Table, iu as BoardCard, j as Row, ja as CommandInput, jc as Series, ji as Label, jn as ProgressIndicator, jo as useCarousel, jr as MenubarItem, js as AlertDialogHeader, jt as SidebarMenuSub, ju as Icon, k as Stat, ka as CommandEmpty, kc as Matrix, ki as FieldSet, kl as Pre, kn as QuestionnaireTitle, ko as CarouselNext, kr as MenubarContent, ks as AlertDialogDescription, kt as SidebarMenuItem, ku as Approvals, l as Tile, la as DrawerTrigger, lc as Ref, li as HoverCard, ll as FileRef, ln as ScrollBar, lo as InputGroupAddon, lr as MeterPrimitive, ls as AvatarGroupCount, lt as TableHead, lu as PRIORITY_LEVELS, m as TraceFrame, ma as ContextMenuContent, mc as Props, mi as FrameFooter, ml as Endpoints, mn as RadioGroupItem, mo as Textarea, mr as MessageContent, ms as AttachmentContent, mt as Slider, mu as BENCH_BETTER, n as Span, na as DrawerDescription, nc as Reqs, ni as ItemMedia, nl as FlowStep, nn as SelectLabel, no as ComboboxLabel, nr as navigationMenuTriggerStyle, ns as BreadcrumbSeparator, nt as TabsTrigger, nu as Delta, o as Overlap, oa as DrawerPortal, oc as Commit, oi as InputOTPGroup, ol as FILE_KINDS, on as SelectTrigger, oo as ComboboxValue, or as Meter, os as AvatarBadge, ot as TableCaption, ou as STATUSES, p as Trace, pa as ContextMenuCheckboxItem, pc as Prop, pi as FrameDescription, pl as Endpoint, pn as RadioGroup, po as InputGroupTextarea, pr as MessageAvatar, ps as AttachmentActions, pt as Spinner, pu as Due, q as ToastTitle, qa as ComboboxChip, qc as GAUGE_TONES, qi as DropdownMenuSeparator, ql as CHANGE_KINDS, qn as PaginationPrevious, qo as BubbleContent, qr as Kbd, qs as DbTable, qt as SheetDescription, r as Waterfall, ra as DrawerFooter, rc as ENTRY_KINDS, ri as ItemSeparator, rl as CONFIDENCES, rn as SelectScrollDownButton, ro as ComboboxList, rr as NativeSelect, rs as Badge, rt as tabsListVariants, ru as Board, s as Set, sa as DrawerSwipeHandle, sc as Issue, si as InputOTPSeparator, sl as File, sn as SelectValue, so as useComboboxAnchor, sr as MeterIndicator, ss as AvatarFallback, st as TableCell, su as StatusBadge, t as builtinComponents, ta as DrawerContent, tc as Req, ti as ItemHeader, tl as Flow, tn as SelectItem, to as ComboboxItem, tr as NavigationMenuTrigger, ts as BreadcrumbPage, tt as TabsList, tu as Bridge, u as Treemap, ua as DirectionProvider, uc as Radar, ui as HoverCardContent, ul as Figure, un as ResizableHandle, uo as InputGroupButton, ur as MeterTrack, us as AvatarImage, ut as TableHeader, uu as Priority, v as SYMBOL_KINDS, va as ContextMenuPortal, vc as Slice, vi as Fieldset, vl as DEP_KINDS, vn as QuestionnaireChoiceDescription, vo as CollapsibleTrigger, vr as MessageScroller, vs as AttachmentTitle, vt as SidebarGroup, vu as BarChart, w as Day, wa as ContextMenuSubContent, wc as Packages, wi as FieldError, wl as Before, wn as QuestionnaireNext, wo as ChartTooltip, wr as useMessageScroller, ws as AlertTitle, wt as SidebarInset, wu as Ask, x as Steps, xa as ContextMenuSeparator, xc as Stop, xi as Field, xl as DECISION_STATUSES, xn as QuestionnaireError, xo as ChartLegend, xr as MessageScrollerItem, xs as Alert, xt as SidebarGroupLabel, xu as SEVERITY_LEVELS, y as SymbolRef, ya as ContextMenuRadioGroup, yc as Phase, yi as FieldsetLegend, yl as Dep, yn as QuestionnaireChoices, yo as Checkbox, yr as MessageScrollerButton, ys as AttachmentTrigger, yt as SidebarGroupAction, yu as Audit, z as toggleVariants, za as DialogDescription, zc as Hypothesis, zi as DropdownMenuCheckboxItem, zl as CHECK_STATUSES, zn as PopoverTitle, zo as Calendar, zr as MenubarSub, zs as Accordion, zt as Tooltip, zu as DocContext } from "./ui-GKFD0mx5.mjs";
2
+ export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, After, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, Approval, Approvals, Ask, AspectRatio, Attachment, AttachmentAction, AttachmentActions, AttachmentContent, AttachmentDescription, AttachmentGroup, AttachmentMedia, AttachmentTitle, AttachmentTrigger, Audit, Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage, BENCH_BETTER, BUMP_KINDS, Badge, Bar, BarChart, Before, Bench, Benchmarks, Board, BoardCard, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bridge, Bubble, BubbleContent, BubbleGroup, BubbleReactions, Bump, Bumps, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CALLOUT_KINDS, CHANGE_KINDS, CHECK_STATUSES, CONFIDENCES, Calendar, CalendarDayButton, Callout, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Cell, Change, Changes, ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent, Check, Checkbox, Checks, Choice, Cmd, Collapsible, CollapsibleContent, CollapsibleTrigger, Column, Columns, Combobox, ComboboxChip, ComboboxChips, ComboboxChipsInput, ComboboxCollection, ComboboxContent, ComboboxEmpty, ComboboxGroup, ComboboxInput, ComboboxItem, ComboboxLabel, ComboboxList, ComboboxSeparator, ComboboxTrigger, ComboboxValue, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, Comment, Comments, Commit, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuPortal, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuShortcut, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, DAY_STATUSES, DECISION_STATUSES, DEP_KINDS, Day, DbField, DbTable, Decision, Del, Delta, Dep, Deps, Details, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffStat, DiffView, DirectionProvider, DocContext, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerSwipeHandle, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Due, EFFORT_SIZES, ENTRY_KINDS, Edge, Effort, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle, Endpoint, Endpoints, Entry, EnvVar, EnvVars, Event, FILE_KINDS, FRAME_KINDS, Field, FieldContent, FieldDescription, FieldError, FieldGroup, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTitle, Fieldset, FieldsetLegend, FieldsetPrimitive, Figure, File, FileRef, Files, Finding, Findings, Flow, FlowStep, Frame, FrameDescription, FrameFooter, FrameHeader, FramePanel, FrameTitle, Funnel, GAUGE_TONES, Gantt, Gauge, Gauges, Glossary, Graph, Grid, HTTP_METHODS, HYPOTHESIS_STATUSES, HoverCard, HoverCardContent, HoverCardTrigger, Hypotheses, Hypothesis, INCIDENT_STATUSES, Icon, Incident, Input, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Ins, Issue, Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, Json, Kbd, KbdGroup, Label, Lane, LineChart, Link, Marker, MarkerContent, MarkerIcon, Matrix, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarPortal, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarShortcut, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader, MessageScroller, MessageScrollerButton, MessageScrollerContent, MessageScrollerItem, MessageScrollerProvider, MessageScrollerViewport, Meta, MetaItem, Meter, MeterIndicator, MeterLabel, MeterPrimitive, MeterTrack, MeterValue, Milestone, NativeSelect, NativeSelectOptGroup, NativeSelectOption, NavigationMenu, NavigationMenuContent, NavigationMenuIndicator, NavigationMenuItem, NavigationMenuLink, NavigationMenuList, NavigationMenuPositioner, NavigationMenuTrigger, Node, OPTION_STATUSES, Option, Overlap, Owner, PACKAGE_KINDS, PR, PRIORITY_LEVELS, Package, Packages, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, Pathway, Phase, PieChart, Pin, Plan, PlanHeader, Point, Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger, Pre, Priority, Progress, ProgressIndicator, ProgressLabel, ProgressTrack, ProgressValue, Prop, Props, QUESTION_TYPES, Quadrant, Question, Questionnaire, QuestionnaireActions, QuestionnaireChoice, QuestionnaireChoiceDescription, QuestionnaireChoices, QuestionnaireDescription, QuestionnaireError, QuestionnaireInput, QuestionnaireItem, QuestionnaireNext, QuestionnairePrevious, QuestionnaireProgress, QuestionnaireSkip, QuestionnaireSubmit, QuestionnaireTitle, REVIEW_VERDICTS, RISK_LEVELS, Radar, RadioGroup, RadioGroupItem, Ref, Release, Req, Reqs, ResizableHandle, ResizablePanel, ResizablePanelGroup, Review, Risk, Row, SERVICE_STATUSES, SEVERITY_LEVELS, SPARK_TONES, STATUSES, SYMBOL_KINDS, Sankey, Scatter, Schema, Score, ScrollArea, ScrollBar, Search, Searches, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator, Series, Service, Set, Severity, Sheet, SheetClose, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, Skeleton, Slice, Slider, Span, Spark, Spinner, Stack, Stage, Stat, Stats, StatusBadge, StatusPage, Step, Steps, Stop, Summary, Switch, SymbolRef, TERMINAL_LANGS, TEST_STATUSES, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Task, Term, Terminal, Test, Tests, Textarea, Tile, Timeline, Toast, ToastAction, ToastClose, ToastContent, ToastDescription, ToastPortal, ToastProvider, ToastTitle, ToastViewport, Toaster, Toc, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, Trace, TraceFrame, Tree, Treemap, Uptime, VERDICTS, Venn, Verdict, Vuln, Waterfall, badgeVariants, builtinComponents, buttonGroupVariants, buttonVariants, createToastManager, defineComponent, formatDuration, hasIcon, isSeverity, markerVariants, navigationMenuTriggerStyle, normalizeIconName, parseDiff, parseDuration, tabsListVariants, textOf, toast, toggleVariants, useCarousel, useComboboxAnchor, useDirection, useMessageScroller, useMessageScrollerScrollable, useMessageScrollerVisibility, useSidebar, useToastManager };
@@ -0,0 +1,184 @@
1
+ import { Uu as isRecord, Wu as nonEmpty } from "./ui-GKFD0mx5.mjs";
2
+ import module from "node:module";
3
+ import { mkdir, readdir, stat, unlink, writeFile } from "node:fs/promises";
4
+ import path from "node:path";
5
+ import fs, { existsSync, statSync } from "node:fs";
6
+ import { createHash } from "node:crypto";
7
+ import url, { pathToFileURL } from "node:url";
8
+ import { build } from "esbuild";
9
+ //#region src/paths.ts
10
+ const require = module.createRequire(import.meta.url);
11
+ const findPkgRoot = () => {
12
+ try {
13
+ return path.dirname(url.fileURLToPath(require.resolve("@suzumiyaaoba/mdxr/package.json")));
14
+ } catch {
15
+ return url.fileURLToPath(new URL("..", import.meta.url));
16
+ }
17
+ };
18
+ /** Absolute path to this package's root (works bundled, unbundled, and via npx). */
19
+ const pkgRoot = findPkgRoot();
20
+ /**
21
+ * This package's `src/` directory. The hydration bundle is always built from
22
+ * the TypeScript sources — they ship with the package, so packed installs
23
+ * and local dev produce identical bundles. Building from sources (rather
24
+ * than the packed `dist/` chunks) is also what makes tree-shaking effective:
25
+ * every used component is imported from its leaf module, and no barrel file
26
+ * is ever loaded.
27
+ */
28
+ const srcDir = path.join(pkgRoot, "src");
29
+ /** Directory where bundled user modules are cached. Kept inside this package so
30
+ * bare imports (`react`, `valibot`, `@suzumiyaaoba/mdxr`) resolve to *our*
31
+ * copy —
32
+ * guaranteeing a single React instance shared with renderToStaticMarkup. */
33
+ const cacheDir = `${pkgRoot}/.mdxr-cache`;
34
+ //#endregion
35
+ //#region src/load-user-module.ts
36
+ /**
37
+ * Packages that must resolve to *this* package's dependencies — a second React
38
+ * copy would break hooks/context, and `valibot` instances mix across schemas.
39
+ * Shared with hydrate.ts's pinShared plugin (which adds no `@suzumiyaaoba/mdxr`
40
+ * since the runtimeModule plugin maps that specifier onto the catalog).
41
+ */
42
+ const SHARED_PACKAGES = [
43
+ "react",
44
+ "react-dom",
45
+ "valibot"
46
+ ];
47
+ const SHARED_EXTERNALS = new RegExp(`^(?:${[...SHARED_PACKAGES, "@suzumiyaaoba/mdxr"].join("|")})(?:/.*)?$`);
48
+ const sharedExternals = {
49
+ name: "shared-externals",
50
+ setup(b) {
51
+ b.onResolve({ filter: SHARED_EXTERNALS }, (a) => ({
52
+ external: true,
53
+ path: a.path
54
+ }));
55
+ }
56
+ };
57
+ const INDEX_FILES = [
58
+ "index.tsx",
59
+ "index.ts",
60
+ "index.jsx",
61
+ "index.js"
62
+ ];
63
+ /** Files written but not yet imported — a prune must never unlink these. */
64
+ const inFlight = /* @__PURE__ */ new Set();
65
+ /**
66
+ * `mdxr serve` writes a fresh `doc-<hash>.mjs` on every rebuild, so the cache
67
+ * would grow unboundedly over a session. Keep only the newest few files per
68
+ * prefix — imported modules live in the module registry, not on disk, so
69
+ * deleting an already-imported file is safe. Best-effort: failures are fine.
70
+ */
71
+ const pruneCache = async (prefix) => {
72
+ try {
73
+ const KEEP = 8;
74
+ const STALE_MS = 1e4;
75
+ const now = Date.now();
76
+ const mine = (await readdir(cacheDir)).filter((f) => f.startsWith(`${prefix}-`) && f.endsWith(".mjs") && !inFlight.has(path.join(cacheDir, f)));
77
+ if (mine.length <= KEEP) return;
78
+ const withMtime = await Promise.all(mine.map(async (f) => {
79
+ return {
80
+ f,
81
+ mtime: (await stat(path.join(cacheDir, f))).mtimeMs
82
+ };
83
+ }));
84
+ withMtime.sort((a, b) => b.mtime - a.mtime);
85
+ const keep = new Set(withMtime.slice(0, KEEP).map(({ f }) => f));
86
+ await Promise.all(withMtime.filter(({ f, mtime }) => now - mtime > STALE_MS && !keep.has(f)).map(async ({ f, mtime }) => {
87
+ const p = path.join(cacheDir, f);
88
+ const s = await stat(p);
89
+ if (s.mtimeMs !== mtime || now - s.mtimeMs <= STALE_MS) return;
90
+ await unlink(p);
91
+ }));
92
+ } catch {}
93
+ };
94
+ /** `await import` of a missing module: Node's ERR_MODULE_NOT_FOUND, possibly
95
+ * wrapped by a module runner that only preserves the message. */
96
+ const isModuleNotFound = (e) => isRecord(e) && (e.code === "ERR_MODULE_NOT_FOUND" || e.code === "ENOENT" || typeof e.message === "string" && e.message.includes("Cannot find module"));
97
+ /**
98
+ * Write bundled ESM `code` into this package's cache dir (content-hashed, so
99
+ * repeat imports are free) and import it. Living inside the package makes
100
+ * bare imports (`react`, `valibot`, `@suzumiyaaoba/mdxr`) resolve to *our*
101
+ * copies — one React instance shared with renderToStaticMarkup and the
102
+ * hydrate bundle.
103
+ */
104
+ const importBundledCode = async (code, prefix) => {
105
+ await mkdir(cacheDir, { recursive: true });
106
+ const hash = createHash("sha256").update(code).digest("hex").slice(0, 12);
107
+ const out = path.join(cacheDir, `${prefix}-${hash}.mjs`);
108
+ await writeFile(out, code);
109
+ inFlight.add(out);
110
+ let raw;
111
+ try {
112
+ try {
113
+ raw = await import(pathToFileURL(out).href);
114
+ } catch (error) {
115
+ if (!isModuleNotFound(error)) throw error;
116
+ await writeFile(out, code);
117
+ raw = await import(`${pathToFileURL(out).href}?retry`);
118
+ }
119
+ } finally {
120
+ inFlight.delete(out);
121
+ }
122
+ pruneCache(prefix);
123
+ return isRecord(raw) ? raw : {};
124
+ };
125
+ /**
126
+ * Resolve a user module path: directories collapse to their index file.
127
+ * Used both when importing the module (SSR) and when bundling it for the
128
+ * hydration script.
129
+ */
130
+ const resolveModuleEntry = (entryPath) => {
131
+ if (!(existsSync(entryPath) && statSync(entryPath).isDirectory())) return entryPath;
132
+ for (const name of INDEX_FILES) {
133
+ const candidate = path.join(entryPath, name);
134
+ if (existsSync(candidate)) return candidate;
135
+ }
136
+ return entryPath;
137
+ };
138
+ /**
139
+ * Bundle a user-authored TS/TSX module and import it.
140
+ * The result is written inside this package's directory so that externals
141
+ * resolve against our node_modules (single React instance).
142
+ */
143
+ const loadUserModule = async (entryPath) => {
144
+ const code = (await build({
145
+ bundle: true,
146
+ entryPoints: [entryPath],
147
+ format: "esm",
148
+ jsx: "automatic",
149
+ jsxImportSource: "react",
150
+ logLevel: "silent",
151
+ platform: "node",
152
+ plugins: [sharedExternals],
153
+ target: "node20",
154
+ write: false
155
+ })).outputFiles[0].text;
156
+ return {
157
+ code,
158
+ module: await importBundledCode(code, "components")
159
+ };
160
+ };
161
+ //#endregion
162
+ //#region src/config.ts
163
+ const defineConfig = (config) => config;
164
+ const CONFIG_FILES = [
165
+ "mdxr.config.ts",
166
+ "mdxr.config.mts",
167
+ "mdxr.config.js",
168
+ "mdxr.config.mjs"
169
+ ];
170
+ const loadConfig = async (dir) => {
171
+ const name = CONFIG_FILES.find((n) => fs.existsSync(path.join(dir, n)));
172
+ if (name === void 0) return { dir };
173
+ const { module: mod, code } = await loadUserModule(path.join(dir, name));
174
+ const raw = isRecord(mod.default) ? mod.default : {};
175
+ return {
176
+ componentsCode: code,
177
+ componentsPath: nonEmpty(raw.components) ? path.resolve(dir, raw.components) : void 0,
178
+ dir,
179
+ editor: nonEmpty(raw.editor) ? raw.editor : void 0,
180
+ themePath: nonEmpty(raw.theme) ? path.resolve(dir, raw.theme) : void 0
181
+ };
182
+ };
183
+ //#endregion
184
+ export { loadUserModule as a, srcDir as c, importBundledCode as i, loadConfig as n, resolveModuleEntry as o, SHARED_PACKAGES as r, pkgRoot as s, defineConfig as t };