@nanisoft/prism-llms 0.4.0 → 0.5.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 (175) hide show
  1. package/README.md +88 -0
  2. package/THIRD-PARTY-NOTICES.md +48 -0
  3. package/dist/data.json +3996 -387
  4. package/dist/demo-graph.d.ts +21 -12
  5. package/dist/demo-graph.js +37 -21
  6. package/dist/extractor.d.ts +24 -17
  7. package/dist/extractor.js +269 -153
  8. package/dist/index.d.ts +12 -7
  9. package/dist/index.js +9 -7
  10. package/dist/llms-full.txt +7968 -2013
  11. package/dist/llms.txt +97 -93
  12. package/dist/markdown.d.ts +69 -23
  13. package/dist/markdown.js +131 -72
  14. package/dist/md/blocks/app-shell-01.md +135 -0
  15. package/dist/md/blocks/auth-form-01.md +135 -0
  16. package/dist/md/blocks/cta-01.md +88 -0
  17. package/dist/md/blocks/data-table-01.md +196 -0
  18. package/dist/md/blocks/feature-grid-01.md +92 -0
  19. package/dist/md/blocks/hero-01.md +90 -0
  20. package/dist/md/blocks/instrument-panel-01.md +109 -0
  21. package/dist/md/blocks/logo-strip-01.md +97 -0
  22. package/dist/md/blocks/note-grid-01.md +102 -0
  23. package/dist/md/blocks/page-header-01.md +97 -0
  24. package/dist/md/blocks/pricing-01.md +91 -0
  25. package/dist/md/blocks/process-rail-01.md +106 -0
  26. package/dist/md/blocks/product-grid-01.md +113 -0
  27. package/dist/md/blocks/settings-panel-01.md +148 -0
  28. package/dist/md/blocks/site-footer.md +103 -11
  29. package/dist/md/blocks/site-header.md +111 -11
  30. package/dist/md/blocks/stack-grid-01.md +108 -0
  31. package/dist/md/blocks/stats-01.md +89 -0
  32. package/dist/md/blocks/status-ledger-01.md +121 -0
  33. package/dist/md/changelogs/prism-llms.md +206 -0
  34. package/dist/md/changelogs/prism-mcp-server.md +88 -0
  35. package/dist/md/changelogs/prism-tokens.md +126 -0
  36. package/dist/md/changelogs/prism-ui.md +429 -0
  37. package/dist/md/components/accordion.md +108 -0
  38. package/dist/md/components/alert.md +90 -7
  39. package/dist/md/components/avatar.md +89 -7
  40. package/dist/md/components/badge.md +74 -7
  41. package/dist/md/components/breadcrumb.md +84 -7
  42. package/dist/md/components/button.md +90 -7
  43. package/dist/md/components/card.md +90 -7
  44. package/dist/md/components/checkbox.md +101 -7
  45. package/dist/md/components/cta-link.md +98 -0
  46. package/dist/md/components/diagram.md +124 -0
  47. package/dist/md/components/dialog.md +128 -0
  48. package/dist/md/components/dropdown-menu.md +125 -0
  49. package/dist/md/components/fact-list.md +85 -0
  50. package/dist/md/components/field.md +116 -0
  51. package/dist/md/components/input.md +86 -7
  52. package/dist/md/components/kbd.md +77 -0
  53. package/dist/md/components/pagination.md +95 -7
  54. package/dist/md/components/popover.md +95 -7
  55. package/dist/md/components/product-mark.md +123 -0
  56. package/dist/md/components/product-switcher.md +88 -0
  57. package/dist/md/components/progress.md +88 -7
  58. package/dist/md/components/prose.md +91 -0
  59. package/dist/md/components/radio-group.md +111 -0
  60. package/dist/md/components/section.md +91 -0
  61. package/dist/md/components/select.md +143 -7
  62. package/dist/md/components/separator.md +77 -0
  63. package/dist/md/components/skeleton.md +71 -7
  64. package/dist/md/components/slider.md +90 -7
  65. package/dist/md/components/switch.md +104 -7
  66. package/dist/md/components/table.md +104 -7
  67. package/dist/md/components/tabs.md +105 -7
  68. package/dist/md/components/textarea.md +101 -0
  69. package/dist/md/components/tooltip.md +95 -7
  70. package/dist/md/components/typography.md +82 -7
  71. package/dist/md/content/about-content.md +36 -0
  72. package/dist/md/content/audience.md +43 -0
  73. package/dist/md/content/glossary.md +69 -0
  74. package/dist/md/content/product-vocabulary.md +53 -0
  75. package/dist/md/content/voice.md +52 -0
  76. package/dist/md/content/writing-mechanics.md +58 -0
  77. package/dist/md/foundation/colors.md +10 -0
  78. package/dist/md/foundation/iconography.md +14 -0
  79. package/dist/md/foundation/motion.md +10 -0
  80. package/dist/md/foundation/radii.md +9 -0
  81. package/dist/md/foundation/shadows.md +9 -0
  82. package/dist/md/foundation/spacings.md +8 -0
  83. package/dist/md/foundation/typography.md +9 -0
  84. package/dist/md/foundation/variables.md +9 -0
  85. package/dist/md/overview/architecture.md +76 -0
  86. package/dist/md/overview/brand.md +41 -0
  87. package/dist/md/overview/composition.md +77 -0
  88. package/dist/md/overview/quickstart.md +97 -0
  89. package/dist/md/overview/theming.md +89 -0
  90. package/dist/md/overview/using-llms.md +83 -0
  91. package/dist/md/pages/auth-page.md +149 -0
  92. package/dist/md/pages/blog-post-page.md +136 -0
  93. package/dist/md/pages/dashboard-page.md +241 -0
  94. package/dist/md/pages/marketing-page.md +199 -0
  95. package/dist/md/pages/not-found-page.md +105 -0
  96. package/dist/md/pages/settings-page.md +206 -0
  97. package/dist/prism-skill.md +50 -0
  98. package/dist/store.d.ts +203 -0
  99. package/dist/store.js +317 -0
  100. package/package.json +29 -26
  101. package/dist/demo-graph.d.ts.map +0 -1
  102. package/dist/demo-graph.js.map +0 -1
  103. package/dist/extractor.d.ts.map +0 -1
  104. package/dist/extractor.js.map +0 -1
  105. package/dist/index.d.ts.map +0 -1
  106. package/dist/index.js.map +0 -1
  107. package/dist/markdown.d.ts.map +0 -1
  108. package/dist/markdown.js.map +0 -1
  109. package/dist/md/blocks/component-demo.md +0 -19
  110. package/dist/md/blocks/page-header.md +0 -19
  111. package/dist/md/components/affix.md +0 -14
  112. package/dist/md/components/anchor.md +0 -14
  113. package/dist/md/components/auto-complete.md +0 -14
  114. package/dist/md/components/back-top.md +0 -14
  115. package/dist/md/components/border-beam.md +0 -14
  116. package/dist/md/components/calendar.md +0 -14
  117. package/dist/md/components/carousel.md +0 -14
  118. package/dist/md/components/cascader.md +0 -14
  119. package/dist/md/components/col.md +0 -14
  120. package/dist/md/components/collapse.md +0 -14
  121. package/dist/md/components/color-picker.md +0 -14
  122. package/dist/md/components/date-picker.md +0 -14
  123. package/dist/md/components/descriptions.md +0 -14
  124. package/dist/md/components/display-title.md +0 -20
  125. package/dist/md/components/divider.md +0 -14
  126. package/dist/md/components/drawer.md +0 -14
  127. package/dist/md/components/dropdown.md +0 -14
  128. package/dist/md/components/empty.md +0 -14
  129. package/dist/md/components/flex.md +0 -14
  130. package/dist/md/components/float-button.md +0 -14
  131. package/dist/md/components/form.md +0 -14
  132. package/dist/md/components/grid.md +0 -14
  133. package/dist/md/components/image.md +0 -14
  134. package/dist/md/components/input-number.md +0 -14
  135. package/dist/md/components/layout.md +0 -14
  136. package/dist/md/components/list.md +0 -14
  137. package/dist/md/components/listy.md +0 -14
  138. package/dist/md/components/masonry.md +0 -14
  139. package/dist/md/components/mentions.md +0 -14
  140. package/dist/md/components/menu.md +0 -14
  141. package/dist/md/components/modal.md +0 -14
  142. package/dist/md/components/popconfirm.md +0 -14
  143. package/dist/md/components/qrcode.md +0 -14
  144. package/dist/md/components/radio.md +0 -14
  145. package/dist/md/components/rate.md +0 -14
  146. package/dist/md/components/result.md +0 -14
  147. package/dist/md/components/row.md +0 -14
  148. package/dist/md/components/segmented.md +0 -14
  149. package/dist/md/components/space.md +0 -14
  150. package/dist/md/components/spin.md +0 -14
  151. package/dist/md/components/splitter.md +0 -14
  152. package/dist/md/components/statistic.md +0 -14
  153. package/dist/md/components/steps.md +0 -14
  154. package/dist/md/components/tag.md +0 -14
  155. package/dist/md/components/time-picker.md +0 -14
  156. package/dist/md/components/timeline.md +0 -14
  157. package/dist/md/components/tour.md +0 -14
  158. package/dist/md/components/transfer.md +0 -14
  159. package/dist/md/components/tree-select.md +0 -14
  160. package/dist/md/components/tree.md +0 -14
  161. package/dist/md/components/upload.md +0 -14
  162. package/dist/md/components/watermark.md +0 -14
  163. package/dist/md/docs/brand.md +0 -41
  164. package/dist/md/pages/blog-layout.md +0 -19
  165. package/dist/md/pages/docs-shell.md +0 -23
  166. package/dist/md/theme/blue-dark.md +0 -127
  167. package/dist/md/theme/blue-light.md +0 -129
  168. package/dist/md/theme/green-dark.md +0 -127
  169. package/dist/md/theme/green-light.md +0 -129
  170. package/dist/md/theme/lavender-dark.md +0 -127
  171. package/dist/md/theme/lavender-light.md +0 -129
  172. package/dist/md/theme/peach-dark.md +0 -127
  173. package/dist/md/theme/peach-light.md +0 -129
  174. package/dist/md/theme/rose-dark.md +0 -127
  175. package/dist/md/theme/rose-light.md +0 -129
package/dist/llms.txt CHANGED
@@ -1,106 +1,110 @@
1
1
  # Prism
2
2
 
3
- > One design language, many expressions — Ant Design v6 components, blocks, and pages under the Prism theme. Apps always import from '@nanisoft/prism-ui', never from antd directly.
3
+ > Prism is NaniSoft's design system: a token pipeline, a React component library, a documentation site and an agent surface. Import from '@nanisoft/prism-ui'; internal dependencies are never consumer imports.
4
4
 
5
- ## Guides
5
+ - [Full reference](https://prism.nanisoft.com/llms-full.txt): every page in this index expanded to its full specification.
6
+ - [Agent skill](https://prism.nanisoft.com/prism-skill.md): the one-screen fast path.
6
7
 
7
- - [Brand policy](https://prism.nanisoft.com/md/docs/brand.md): What the MIT license covers, what it doesn't, and how the Prism and NaniSoft names may be used.
8
+ ## Overview
9
+
10
+ - [Architecture](https://prism.nanisoft.com/overview/architecture.md): How Prism keeps tokens, the component library, the docs site and the agent surface on one source of truth.
11
+ - [Brand policy](https://prism.nanisoft.com/overview/brand.md): What the MIT licence covers, what it does not, and how the Prism and NaniSoft names may be used.
12
+ - [Composition](https://prism.nanisoft.com/overview/composition.md): Choose the smallest Prism layer that owns the job, and promote repetition upward only when it earns it.
13
+ - [Quickstart](https://prism.nanisoft.com/overview/quickstart.md): Install Prism, load one stylesheet, choose a pack, and render your first Component and Block.
14
+ - [Theming](https://prism.nanisoft.com/overview/theming.md): Packs and modes are two independent axes, delivered as markup attributes with no override path.
15
+ - [Using LLMs](https://prism.nanisoft.com/overview/using-llms.md): Using LLMs against Prism: the corpus, the Markdown mirror and the read-only MCP endpoint, so an agent reads the same source the human documentation does.
16
+
17
+ ## Foundation
18
+
19
+ - [Colors](https://prism.nanisoft.com/foundation/colors.md): The semantic colour contract and the foundation ramps behind it.
20
+ - [Iconography](https://prism.nanisoft.com/foundation/iconography.md): Prism uses Lucide for interface icons, sized on the spacing scale.
21
+ - [Motion](https://prism.nanisoft.com/foundation/motion.md): State feedback only, by token, with no entrance or scroll animation.
22
+ - [Radii](https://prism.nanisoft.com/foundation/radii.md): One base radius drives the whole scale, derived as calc() multipliers.
23
+ - [Shadows](https://prism.nanisoft.com/foundation/shadows.md): Exactly three authored elevation steps, all mode-independent.
24
+ - [Spacings](https://prism.nanisoft.com/foundation/spacings.md): The authored spacing scale both layout and section rhythm use.
25
+ - [Typography](https://prism.nanisoft.com/foundation/typography.md): Inter for the interface, the platform monospace stack for machine values.
26
+ - [Variables](https://prism.nanisoft.com/foundation/variables.md): The full token browser: every semantic custom property and every foundation group.
27
+
28
+ ## Content
29
+
30
+ - [About content](https://prism.nanisoft.com/content/about-content.md): What "content" means at NaniSoft, and the scope of this section.
31
+ - [Audience](https://prism.nanisoft.com/content/audience.md): The three people NaniSoft product copy serves, and what each one needs from a sentence.
32
+ - [Glossary](https://prism.nanisoft.com/content/glossary.md): Definitions for the terms used across Prism. The terms come from CONTEXT.md and this page hosts them.
33
+ - [Product vocabulary](https://prism.nanisoft.com/content/product-vocabulary.md): The preferred spelling and casing of NaniSoft product terms, and the terms to avoid.
34
+ - [Voice](https://prism.nanisoft.com/content/voice.md): NaniSoft's fixed voice qualities, and how tone shifts by context.
35
+ - [Writing mechanics](https://prism.nanisoft.com/content/writing-mechanics.md): Capitalisation, punctuation, grammar and structure rules for NaniSoft product copy.
8
36
 
9
37
  ## Components
10
38
 
11
- - [Affix](https://prism.nanisoft.com/md/components/affix.md): antd Affix, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
12
- - [Alert](https://prism.nanisoft.com/md/components/alert.md): antd Alert, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
13
- - [Anchor](https://prism.nanisoft.com/md/components/anchor.md): antd Anchor, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
14
- - [AutoComplete](https://prism.nanisoft.com/md/components/auto-complete.md): antd AutoComplete, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
15
- - [Avatar](https://prism.nanisoft.com/md/components/avatar.md): antd Avatar, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
16
- - [BackTop](https://prism.nanisoft.com/md/components/back-top.md): antd BackTop, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
17
- - [Badge](https://prism.nanisoft.com/md/components/badge.md): antd Badge, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
18
- - [BorderBeam](https://prism.nanisoft.com/md/components/border-beam.md): antd BorderBeam, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
19
- - [Breadcrumb](https://prism.nanisoft.com/md/components/breadcrumb.md): antd Breadcrumb, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
20
- - [Button](https://prism.nanisoft.com/md/components/button.md): antd Button, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
21
- - [Calendar](https://prism.nanisoft.com/md/components/calendar.md): antd Calendar, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
22
- - [Card](https://prism.nanisoft.com/md/components/card.md): antd Card, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
23
- - [Carousel](https://prism.nanisoft.com/md/components/carousel.md): antd Carousel, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
24
- - [Cascader](https://prism.nanisoft.com/md/components/cascader.md): antd Cascader, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
25
- - [Checkbox](https://prism.nanisoft.com/md/components/checkbox.md): antd Checkbox, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
26
- - [Col](https://prism.nanisoft.com/md/components/col.md): antd Col, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
27
- - [Collapse](https://prism.nanisoft.com/md/components/collapse.md): antd Collapse, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
28
- - [ColorPicker](https://prism.nanisoft.com/md/components/color-picker.md): antd ColorPicker, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
29
- - [DatePicker](https://prism.nanisoft.com/md/components/date-picker.md): antd DatePicker, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
30
- - [Descriptions](https://prism.nanisoft.com/md/components/descriptions.md): antd Descriptions, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
31
- - [DisplayTitle](https://prism.nanisoft.com/md/components/display-title.md): Prism wrapper around antd Typography.Title (brand-behavior).
32
- - [Divider](https://prism.nanisoft.com/md/components/divider.md): antd Divider, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
33
- - [Drawer](https://prism.nanisoft.com/md/components/drawer.md): antd Drawer, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
34
- - [Dropdown](https://prism.nanisoft.com/md/components/dropdown.md): antd Dropdown, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
35
- - [Empty](https://prism.nanisoft.com/md/components/empty.md): antd Empty, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
36
- - [Flex](https://prism.nanisoft.com/md/components/flex.md): antd Flex, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
37
- - [FloatButton](https://prism.nanisoft.com/md/components/float-button.md): antd FloatButton, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
38
- - [Form](https://prism.nanisoft.com/md/components/form.md): antd Form, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
39
- - [Grid](https://prism.nanisoft.com/md/components/grid.md): antd Grid, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
40
- - [Image](https://prism.nanisoft.com/md/components/image.md): antd Image, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
41
- - [Input](https://prism.nanisoft.com/md/components/input.md): antd Input, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
42
- - [InputNumber](https://prism.nanisoft.com/md/components/input-number.md): antd InputNumber, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
43
- - [Layout](https://prism.nanisoft.com/md/components/layout.md): antd Layout, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
44
- - [List](https://prism.nanisoft.com/md/components/list.md): antd List, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
45
- - [Listy](https://prism.nanisoft.com/md/components/listy.md): antd Listy, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
46
- - [Masonry](https://prism.nanisoft.com/md/components/masonry.md): antd Masonry, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
47
- - [Mentions](https://prism.nanisoft.com/md/components/mentions.md): antd Mentions, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
48
- - [Menu](https://prism.nanisoft.com/md/components/menu.md): antd Menu, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
49
- - [Modal](https://prism.nanisoft.com/md/components/modal.md): antd Modal, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
50
- - [Pagination](https://prism.nanisoft.com/md/components/pagination.md): antd Pagination, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
51
- - [Popconfirm](https://prism.nanisoft.com/md/components/popconfirm.md): antd Popconfirm, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
52
- - [Popover](https://prism.nanisoft.com/md/components/popover.md): antd Popover, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
53
- - [Progress](https://prism.nanisoft.com/md/components/progress.md): antd Progress, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
54
- - [QRCode](https://prism.nanisoft.com/md/components/qrcode.md): antd QRCode, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
55
- - [Radio](https://prism.nanisoft.com/md/components/radio.md): antd Radio, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
56
- - [Rate](https://prism.nanisoft.com/md/components/rate.md): antd Rate, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
57
- - [Result](https://prism.nanisoft.com/md/components/result.md): antd Result, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
58
- - [Row](https://prism.nanisoft.com/md/components/row.md): antd Row, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
59
- - [Segmented](https://prism.nanisoft.com/md/components/segmented.md): antd Segmented, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
60
- - [Select](https://prism.nanisoft.com/md/components/select.md): antd Select, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
61
- - [Skeleton](https://prism.nanisoft.com/md/components/skeleton.md): antd Skeleton, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
62
- - [Slider](https://prism.nanisoft.com/md/components/slider.md): antd Slider, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
63
- - [Space](https://prism.nanisoft.com/md/components/space.md): antd Space, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
64
- - [Spin](https://prism.nanisoft.com/md/components/spin.md): antd Spin, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
65
- - [Splitter](https://prism.nanisoft.com/md/components/splitter.md): antd Splitter, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
66
- - [Statistic](https://prism.nanisoft.com/md/components/statistic.md): antd Statistic, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
67
- - [Steps](https://prism.nanisoft.com/md/components/steps.md): antd Steps, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
68
- - [Switch](https://prism.nanisoft.com/md/components/switch.md): antd Switch, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
69
- - [Table](https://prism.nanisoft.com/md/components/table.md): antd Table, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
70
- - [Tabs](https://prism.nanisoft.com/md/components/tabs.md): antd Tabs, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
71
- - [Tag](https://prism.nanisoft.com/md/components/tag.md): antd Tag, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
72
- - [Timeline](https://prism.nanisoft.com/md/components/timeline.md): antd Timeline, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
73
- - [TimePicker](https://prism.nanisoft.com/md/components/time-picker.md): antd TimePicker, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
74
- - [Tooltip](https://prism.nanisoft.com/md/components/tooltip.md): antd Tooltip, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
75
- - [Tour](https://prism.nanisoft.com/md/components/tour.md): antd Tour, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
76
- - [Transfer](https://prism.nanisoft.com/md/components/transfer.md): antd Transfer, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
77
- - [Tree](https://prism.nanisoft.com/md/components/tree.md): antd Tree, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
78
- - [TreeSelect](https://prism.nanisoft.com/md/components/tree-select.md): antd TreeSelect, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
79
- - [Typography](https://prism.nanisoft.com/md/components/typography.md): antd Typography, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
80
- - [Upload](https://prism.nanisoft.com/md/components/upload.md): antd Upload, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
81
- - [Watermark](https://prism.nanisoft.com/md/components/watermark.md): antd Watermark, unchanged — a pass-through re-export. Import from '@nanisoft/prism-ui'.
39
+ - [Accordion](https://prism.nanisoft.com/components/accordion.md): The stack of headers that each reveal a panel in place.
40
+ - [Alert](https://prism.nanisoft.com/components/alert.md): A static callout that carries an important message to the reader.
41
+ - [Avatar](https://prism.nanisoft.com/components/avatar.md): The person or entity image with an initials fallback.
42
+ - [Badge](https://prism.nanisoft.com/components/badge.md): A compact status or category label.
43
+ - [Breadcrumb](https://prism.nanisoft.com/components/breadcrumb.md): The trail of ancestor links that shows where the current page sits.
44
+ - [Button](https://prism.nanisoft.com/components/button.md): The action control for commands, links and loading states.
45
+ - [Card](https://prism.nanisoft.com/components/card.md): A bordered surface for a small group of related content.
46
+ - [Checkbox](https://prism.nanisoft.com/components/checkbox.md): The control for an independent yes-or-no choice, with an optional mixed state.
47
+ - [CtaLink](https://prism.nanisoft.com/components/cta-link.md): The call to action that goes somewhere: a native link carrying the weight of a button.
48
+ - [Diagram](https://prism.nanisoft.com/components/diagram.md): Named things and the labelled relations between them, drawn as inline vector markup whose every stroke and fill is a token.
49
+ - [Dialog](https://prism.nanisoft.com/components/dialog.md): The modal surface for a decision or a short task, with a side-anchored sheet variant.
50
+ - [DropdownMenu](https://prism.nanisoft.com/components/dropdown-menu.md): The menu of actions and choices opened from one trigger.
51
+ - [FactList](https://prism.nanisoft.com/components/fact-list.md): A short list of named facts as a definition list, where a value may be a link and the term column stays aligned down its length.
52
+ - [Field](https://prism.nanisoft.com/components/field.md): The labelled wrapper that pairs a form control with its label, description and error.
53
+ - [Input](https://prism.nanisoft.com/components/input.md): The single-line text control for a form.
54
+ - [Kbd](https://prism.nanisoft.com/components/kbd.md): The inline label for a keyboard key or shortcut.
55
+ - [Pagination](https://prism.nanisoft.com/components/pagination.md): The control that moves between pages of a paged collection.
56
+ - [Popover](https://prism.nanisoft.com/components/popover.md): The anchored floating surface for content richer than a tooltip.
57
+ - [ProductMark](https://prism.nanisoft.com/components/product-mark.md): A product's two-part colour mark: a brand-ink ring around the pack's own fill, beside the product's name in the brand ink.
58
+ - [ProductSwitcher](https://prism.nanisoft.com/components/product-switcher.md): A switch between the members of a set of products, each drawn with its own ProductMark and the current one marked aria-current.
59
+ - [Progress](https://prism.nanisoft.com/components/progress.md): The bar that reports how far a task has progressed.
60
+ - [Prose](https://prism.nanisoft.com/components/prose.md): Consumer-authored body copy held to the reading measure and to the block rhythm, so a document does not restate either.
61
+ - [RadioGroup](https://prism.nanisoft.com/components/radio-group.md): The control that chooses exactly one option from a small visible set.
62
+ - [Section](https://prism.nanisoft.com/components/section.md): The container and heading primitives every Block composes for rhythm.
63
+ - [Select](https://prism.nanisoft.com/components/select.md): The control that chooses one option from a list that opens on demand.
64
+ - [Separator](https://prism.nanisoft.com/components/separator.md): A hairline rule that divides content, horizontally or vertically.
65
+ - [Skeleton](https://prism.nanisoft.com/components/skeleton.md): A placeholder surface that mirrors the shape of content while it loads.
66
+ - [Slider](https://prism.nanisoft.com/components/slider.md): The control that chooses a number along a range.
67
+ - [Switch](https://prism.nanisoft.com/components/switch.md): The control that turns a setting on or off immediately.
68
+ - [Table](https://prism.nanisoft.com/components/table.md): The semantic table components for rows, columns and captions.
69
+ - [Tabs](https://prism.nanisoft.com/components/tabs.md): The set of peer views shown one at a time.
70
+ - [Textarea](https://prism.nanisoft.com/components/textarea.md): The multi-line text control for a form.
71
+ - [Tooltip](https://prism.nanisoft.com/components/tooltip.md): The short label shown on hover or focus beside a control.
72
+ - [Typography](https://prism.nanisoft.com/components/typography.md): The text and heading components that apply the type scale.
82
73
 
83
74
  ## Blocks
84
75
 
85
- - [ComponentDemo](https://prism.nanisoft.com/md/blocks/component-demo.md): Prism block — full documentation pending.
86
- - [PageHeader](https://prism.nanisoft.com/md/blocks/page-header.md): Prism block — full documentation pending.
87
- - [SiteFooter](https://prism.nanisoft.com/md/blocks/site-footer.md): Prism block — full documentation pending.
88
- - [SiteHeader](https://prism.nanisoft.com/md/blocks/site-header.md): Prism block — full documentation pending.
76
+ - [AppShell01](https://prism.nanisoft.com/blocks/app-shell-01.md): A navigation shell with a desktop rail, a top bar and a mobile navigation sheet.
77
+ - [AuthForm01](https://prism.nanisoft.com/blocks/auth-form-01.md): A sign-in card with labelled credential fields, a remember control and an error slot.
78
+ - [Cta01](https://prism.nanisoft.com/blocks/cta-01.md): A closing call to action on a filled primary surface.
79
+ - [DataTable01](https://prism.nanisoft.com/blocks/data-table-01.md): A table section with a toolbar, filters, row selection and pagination.
80
+ - [FeatureGrid01](https://prism.nanisoft.com/blocks/feature-grid-01.md): A feature grid with optional icon tiles and a section heading.
81
+ - [Hero01](https://prism.nanisoft.com/blocks/hero-01.md): A centered marketing hero with an optional eyebrow and one or two actions.
82
+ - [InstrumentPanel01](https://prism.nanisoft.com/blocks/instrument-panel-01.md): A bordered panel with a titled bar, a state dot with the words beside it, and a slot for the instrument.
83
+ - [LogoStrip01](https://prism.nanisoft.com/blocks/logo-strip-01.md): A single line of short phrases: the transition band between a hero and the section that follows it.
84
+ - [NoteGrid01](https://prism.nanisoft.com/blocks/note-grid-01.md): A grid of short points: a title and a sentence or two, with no tile and no icon.
85
+ - [PageHeader01](https://prism.nanisoft.com/blocks/page-header-01.md): A page title band with a breadcrumb trail, a supporting line and a row of actions.
86
+ - [Pricing01](https://prism.nanisoft.com/blocks/pricing-01.md): A plan comparison with one highlighted tier.
87
+ - [ProcessRail01](https://prism.nanisoft.com/blocks/process-rail-01.md): A process drawn as a rail: two, three or four steps on one line, each with an ordinal, a name and one caption.
88
+ - [ProductGrid01](https://prism.nanisoft.com/blocks/product-grid-01.md): A set of products as hairline rows: a two-part ProductMark, a name, one tagline and a destination per row.
89
+ - [SettingsPanel01](https://prism.nanisoft.com/blocks/settings-panel-01.md): A settings form grouped into sections of text, select and switch fields.
90
+ - [SiteFooter](https://prism.nanisoft.com/blocks/site-footer.md): The block at the foot of a product site: a brand lockup, grouped destinations, the links that leave the site and a slot for the legal line.
91
+ - [SiteHeader](https://prism.nanisoft.com/blocks/site-header.md): The bar at the top of a product site: a brand lockup, an optional product switcher, the site navigation and a slot for application controls.
92
+ - [StackGrid01](https://prism.nanisoft.com/blocks/stack-grid-01.md): A survey of what a product is assembled from, and a second grid of what it built itself.
93
+ - [Stats01](https://prism.nanisoft.com/blocks/stats-01.md): A KPI row with optional directional deltas.
94
+ - [StatusLedger01](https://prism.nanisoft.com/blocks/status-ledger-01.md): A ledger of things and the state each is in: a name, one of four status tiers and the words for that tier.
89
95
 
90
96
  ## Pages
91
97
 
92
- - [BlogLayout](https://prism.nanisoft.com/md/pages/blog-layout.md): Prism page — full documentation pending.
93
- - [DocsShell](https://prism.nanisoft.com/md/pages/docs-shell.md): Prism page — full documentation pending.
94
-
95
- ## Theming
96
-
97
- - [Blue pack · beam-dark](https://prism.nanisoft.com/md/theme/blue-dark.md): Theming reference for the blue pack in dark mode — the createPrismTheme snippet, token tiers, and the antd token lane.
98
- - [Blue pack · light](https://prism.nanisoft.com/md/theme/blue-light.md): Theming reference for the blue pack in light mode — the createPrismTheme snippet, token tiers, and the antd token lane.
99
- - [Green pack · beam-dark](https://prism.nanisoft.com/md/theme/green-dark.md): Theming reference for the green pack in dark mode — the createPrismTheme snippet, token tiers, and the antd token lane.
100
- - [Green pack · light](https://prism.nanisoft.com/md/theme/green-light.md): Theming reference for the green pack in light mode — the createPrismTheme snippet, token tiers, and the antd token lane.
101
- - [Lavender pack · beam-dark](https://prism.nanisoft.com/md/theme/lavender-dark.md): Theming reference for the lavender pack in dark mode — the createPrismTheme snippet, token tiers, and the antd token lane.
102
- - [Lavender pack · light](https://prism.nanisoft.com/md/theme/lavender-light.md): Theming reference for the lavender pack in light mode — the createPrismTheme snippet, token tiers, and the antd token lane.
103
- - [Peach pack · beam-dark](https://prism.nanisoft.com/md/theme/peach-dark.md): Theming reference for the peach pack in dark mode — the createPrismTheme snippet, token tiers, and the antd token lane.
104
- - [Peach pack · light](https://prism.nanisoft.com/md/theme/peach-light.md): Theming reference for the peach pack in light mode — the createPrismTheme snippet, token tiers, and the antd token lane.
105
- - [Rose pack · beam-dark](https://prism.nanisoft.com/md/theme/rose-dark.md): Theming reference for the rose pack in dark mode — the createPrismTheme snippet, token tiers, and the antd token lane.
106
- - [Rose pack · light](https://prism.nanisoft.com/md/theme/rose-light.md): Theming reference for the rose pack in light mode — the createPrismTheme snippet, token tiers, and the antd token lane.
98
+ - [AuthPage](https://prism.nanisoft.com/pages/auth-page.md): A full authentication screen composing a sign-in form with an optional supporting card.
99
+ - [BlogPostPage](https://prism.nanisoft.com/pages/blog-post-page.md): A complete blog post screen: title, standfirst, byline with both the display and the machine date, the body at the measure and the trail to the neighbouring posts.
100
+ - [DashboardPage](https://prism.nanisoft.com/pages/dashboard-page.md): A full dashboard screen composing the app shell, a page header, a KPI row and a data table.
101
+ - [MarketingPage](https://prism.nanisoft.com/pages/marketing-page.md): A complete marketing page composing a hero, a feature grid, a KPI row, a plan comparison and a closing call to action.
102
+ - [NotFoundPage](https://prism.nanisoft.com/pages/not-found-page.md): A complete not-found screen: the status code as the heading of the page, one sentence about what happened, and the ways out.
103
+ - [SettingsPage](https://prism.nanisoft.com/pages/settings-page.md): A full settings screen composing the app shell, a page header and tabs of grouped settings forms.
104
+
105
+ ## Changelogs
106
+
107
+ - [@nanisoft/prism-llms](https://prism.nanisoft.com/changelogs/prism-llms.md): 0.5.0, 0.2.0, 0.1.0
108
+ - [@nanisoft/prism-mcp-server](https://prism.nanisoft.com/changelogs/prism-mcp-server.md): 0.4.0, 0.2.0, 0.1.0
109
+ - [@nanisoft/prism-tokens](https://prism.nanisoft.com/changelogs/prism-tokens.md): 0.6.0, 0.5.1, 0.5.0
110
+ - [@nanisoft/prism-ui](https://prism.nanisoft.com/changelogs/prism-ui.md): 0.6.0, 0.5.1, 0.5.0
@@ -1,11 +1,16 @@
1
1
  /**
2
- * The MDX → Markdown lane (ticket 16 §2): the docs MDX is authoritative prose,
3
- * emitted to `.md` by stripping frontmatter and MDX machinery and replacing
4
- * each `ComponentDemo` element with that example's fenced TSX — lossless
5
- * because ticket 12's self-contained contract makes every demo one file.
2
+ * The MDX to Markdown lane and the fixed per-item spec renderers.
3
+ *
4
+ * The corpus reads raw MDX (ticket 12 section 2), strips mechanics itself, and
5
+ * emits one generated item spec into both the mirror file and `llms-full.txt`.
6
+ * The `## Props` body is a line-oriented definition list, not a table, because
7
+ * the MCP server's regular expression keys on the literal `## Props` heading.
8
+ *
9
+ * The separator between the definition-list fields is an em dash, which ticket
10
+ * 12 fixes as format. It is written as an escape so the source stays free of the
11
+ * typographic dash the repository bans in reader-facing copy.
6
12
  */
7
13
  import type { ExtractedInterface } from './extractor.js';
8
- /** Frontmatter prism-llms consumes — fumadocs defaults only (ticket 12 §3). */
9
14
  export interface DocMeta {
10
15
  title?: string;
11
16
  description?: string;
@@ -14,29 +19,70 @@ export interface ParsedMdx {
14
19
  data: DocMeta;
15
20
  body: string;
16
21
  }
17
- /** Parse `---`-delimited `key: value` frontmatter (the fumadocs default schema — no nesting). */
22
+ /** Parse `---`-delimited `key: value` frontmatter (the fumadocs default schema). */
18
23
  export declare function parseMdx(raw: string): ParsedMdx;
19
- /** Inline code fences in the emitted Markdown. */
24
+ /** A fenced code block; the trailing newline of the source is normalised away. */
20
25
  export declare function fence(code: string, language: string): string;
21
26
  /**
22
- * Replace every `<ComponentDemo id="…" [title="…"] />` element outside code
23
- * fences with that example's fenced TSX. `readDemo` returns the example source
24
- * (or undefined for an unknown id — a hard error: the cross-ref would be dead).
27
+ * Strip MDX machinery: top-level import statements and JSX comment markers.
28
+ * Fence-aware: a fenced import line is content (the page's own snippet), an
29
+ * MDX top-level import is machinery.
25
30
  */
26
- export declare function renderComponentDemos(body: string, readDemo: (id: string) => string | undefined): string;
31
+ export declare function stripMdxMechanics(body: string): string;
27
32
  /**
28
- * Strip MDX machinery for the `.md` lane: import statements and JSX comment
29
- * markers. Fence-aware — fenced import lines are content (the copyable import
30
- * line of the page skeleton), MDX top-level imports are machinery.
33
+ * Drop one `## <heading>` section from a body, up to the next H2 heading. The
34
+ * `## Usage` section is dropped from the prose body because the import fence
35
+ * and the demo replace it in the fixed spec shape.
31
36
  */
32
- export declare function stripMdxMechanics(body: string): string;
33
- /** Render a Markdown table; cells are pipe-escaped and flattened. */
34
- export declare function renderTable(headers: readonly string[], rows: readonly (readonly string[])[]): string;
37
+ export declare function stripSection(body: string, heading: string): string;
38
+ /** The demo section: the title line, then the verbatim source in a `tsx` fence. */
39
+ export declare function renderDemoSection(title: string, code: string): string;
40
+ /**
41
+ * The `## Props` definition-list line, the fixed shape the MCP server parses:
42
+ * a bold-backtick prop name, its type in backticks, middle-dot separated
43
+ * `optional` or `required`, the default in backticks or an em dash, then a
44
+ * prose description.
45
+ */
46
+ export declare function renderPropLine(prop: ExtractedInterface['props'][number]): string;
47
+ export interface ParsedPropLine {
48
+ name: string;
49
+ typeText: string;
50
+ required: boolean;
51
+ defaultValue?: string;
52
+ description?: string;
53
+ }
54
+ /** Parse one definition-list line back into its four fields (the round-trip). */
55
+ export declare function parsePropLine(line: string): ParsedPropLine | null;
56
+ /**
57
+ * The aggregated definition-list body for an item's exports, one entry per
58
+ * line, de-duplicated by prop name across compound parts, with no blank lines.
59
+ */
60
+ export declare function renderPropsBody(interfaces: readonly ExtractedInterface[]): string;
61
+ /**
62
+ * The literal `## Props` section. When the item declares no own props, the
63
+ * documented seam line is emitted instead of an empty list.
64
+ */
65
+ export declare function renderPropsSection(interfaces: readonly ExtractedInterface[], seam: string): string;
66
+ export interface CompositionField {
67
+ key: string;
68
+ value: string;
69
+ description: string;
70
+ }
71
+ /** The `## Composition` section for a Block or a Page. */
72
+ export declare function renderCompositionSection(fields: readonly CompositionField[]): string;
73
+ export interface CrossReference {
74
+ heading: 'Blocks' | 'Pages';
75
+ links: ReadonlyArray<{
76
+ name: string;
77
+ href: string;
78
+ }>;
79
+ }
80
+ /** The `## Blocks` / `## Pages` cross-references, emitted last. */
81
+ export declare function renderCrossReferences(references: readonly CrossReference[]): string;
35
82
  /**
36
- * The generated props section (ticket 12: API tables from the extractor, never
37
- * hand-written). Interfaces with no own props collapse to the antd seam line —
38
- * which is what a wrapper that adds nothing documents. Pass-throughs never
39
- * reach this function; their MDX carries the Extends pointer instead.
83
+ * The first line of the JSDoc block immediately preceding the default export,
84
+ * used as the demo's title. Falls back to a stable generated title.
40
85
  */
41
- export declare function renderPropsSection(interfaces: readonly ExtractedInterface[]): string;
42
- //# sourceMappingURL=markdown.d.ts.map
86
+ export declare function demoTitle(source: string, fallback: string): string;
87
+ /** Join the fixed per-item sections with the stable blank-line separator. */
88
+ export declare function assembleDoc(sections: readonly (string | undefined)[]): string;
package/dist/markdown.js CHANGED
@@ -1,4 +1,6 @@
1
- /** Parse `---`-delimited `key: value` frontmatter (the fumadocs default schema — no nesting). */
1
+ const FIELD_SEPARATOR = ' \u2014 ';
2
+ const NO_DEFAULT = '\u2014';
3
+ /** Parse `---`-delimited `key: value` frontmatter (the fumadocs default schema). */
2
4
  export function parseMdx(raw) {
3
5
  const normalized = raw.replace(/\r\n/g, '\n');
4
6
  if (!normalized.startsWith('---\n'))
@@ -12,57 +14,23 @@ export function parseMdx(raw) {
12
14
  const match = /^(\w+):\s*(.*)$/.exec(line);
13
15
  if (!match)
14
16
  continue;
15
- const value = (match[2] ?? '').replace(/^['"]|['"]$/g, '');
17
+ const value = (match[2] ?? '')
18
+ .replace(/^['"]|['"]$/g, '')
19
+ .replace(/\\"/g, '"')
20
+ .replace(/\\'/g, "'");
16
21
  if (match[1] === 'title' || match[1] === 'description')
17
22
  data[match[1]] = value;
18
23
  }
19
24
  return { data, body: normalized.slice(close + 4).replace(/^\n+/, '') };
20
25
  }
21
- /** Inline code fences in the emitted Markdown. */
26
+ /** A fenced code block; the trailing newline of the source is normalised away. */
22
27
  export function fence(code, language) {
23
28
  return `\`\`\`${language}\n${code.replace(/\r\n/g, '\n').replace(/\n$/, '')}\n\`\`\``;
24
29
  }
25
30
  /**
26
- * Replace every `<ComponentDemo id="…" [title="…"] />` element outside code
27
- * fences with that example's fenced TSX. `readDemo` returns the example source
28
- * (or undefined for an unknown id — a hard error: the cross-ref would be dead).
29
- */
30
- export function renderComponentDemos(body, readDemo) {
31
- const lines = body.replace(/\r\n/g, '\n').split('\n');
32
- const out = [];
33
- let inFence = false;
34
- for (const line of lines) {
35
- if (/^\s*```/.test(line)) {
36
- inFence = !inFence;
37
- out.push(line);
38
- continue;
39
- }
40
- if (inFence) {
41
- out.push(line);
42
- continue;
43
- }
44
- const demo = /^\s*<ComponentDemo\s+([^>]*?)\/>\s*$/.exec(line);
45
- if (!demo) {
46
- out.push(line);
47
- continue;
48
- }
49
- const id = /\bid=["']([^"']+)["']/.exec(demo[1] ?? '')?.[1];
50
- if (!id)
51
- throw new Error(`ComponentDemo element without an id attribute: ${line.trim()}`);
52
- const code = readDemo(id);
53
- if (code === undefined)
54
- throw new Error(`ComponentDemo references unknown example id '${id}'`);
55
- const title = /\btitle=["']([^"']+)["']/.exec(demo[1] ?? '')?.[1];
56
- if (title)
57
- out.push(`**${title}**`);
58
- out.push(fence(code, 'tsx'));
59
- }
60
- return out.join('\n');
61
- }
62
- /**
63
- * Strip MDX machinery for the `.md` lane: import statements and JSX comment
64
- * markers. Fence-aware — fenced import lines are content (the copyable import
65
- * line of the page skeleton), MDX top-level imports are machinery.
31
+ * Strip MDX machinery: top-level import statements and JSX comment markers.
32
+ * Fence-aware: a fenced import line is content (the page's own snippet), an
33
+ * MDX top-level import is machinery.
66
34
  */
67
35
  export function stripMdxMechanics(body) {
68
36
  const kept = [];
@@ -82,37 +50,128 @@ export function stripMdxMechanics(body) {
82
50
  .replace(/^\n+/, '')
83
51
  .replace(/\s+$/, '');
84
52
  }
85
- /** Render a Markdown table; cells are pipe-escaped and flattened. */
86
- export function renderTable(headers, rows) {
87
- const escape = (cell) => cell.replace(/\|/g, '\\|').replace(/\n+/g, ' ').trim();
88
- const head = `| ${headers.map(escape).join(' | ')} |`;
89
- const rule = `| ${headers.map(() => '---').join(' | ')} |`;
90
- const body = rows.map((row) => `| ${row.map(escape).join(' | ')} |`);
91
- return [head, rule, ...body].join('\n');
53
+ /**
54
+ * Drop one `## <heading>` section from a body, up to the next H2 heading. The
55
+ * `## Usage` section is dropped from the prose body because the import fence
56
+ * and the demo replace it in the fixed spec shape.
57
+ */
58
+ export function stripSection(body, heading) {
59
+ const lines = body.replace(/\r\n/g, '\n').split('\n');
60
+ const target = new RegExp(`^##\\s+${escapeRegExp(heading)}\\s*$`);
61
+ const kept = [];
62
+ let skipping = false;
63
+ for (const line of lines) {
64
+ if (target.test(line)) {
65
+ skipping = true;
66
+ continue;
67
+ }
68
+ if (skipping && /^##\s+/.test(line))
69
+ skipping = false;
70
+ if (!skipping)
71
+ kept.push(line);
72
+ }
73
+ return kept
74
+ .join('\n')
75
+ .replace(/\n{3,}/g, '\n\n')
76
+ .replace(/^\n+/, '')
77
+ .replace(/\s+$/, '');
78
+ }
79
+ function escapeRegExp(text) {
80
+ return text.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
81
+ }
82
+ /** The demo section: the title line, then the verbatim source in a `tsx` fence. */
83
+ export function renderDemoSection(title, code) {
84
+ return `**${title}**\n\n${fence(code, 'tsx')}`;
92
85
  }
93
- const NO_ADDITIONAL_PROPS = '_No additional props beyond the antd base component._';
94
86
  /**
95
- * The generated props section (ticket 12: API tables from the extractor, never
96
- * hand-written). Interfaces with no own props collapse to the antd seam line —
97
- * which is what a wrapper that adds nothing documents. Pass-throughs never
98
- * reach this function; their MDX carries the Extends pointer instead.
87
+ * The `## Props` definition-list line, the fixed shape the MCP server parses:
88
+ * a bold-backtick prop name, its type in backticks, middle-dot separated
89
+ * `optional` or `required`, the default in backticks or an em dash, then a
90
+ * prose description.
99
91
  */
100
- export function renderPropsSection(interfaces) {
101
- const withProps = interfaces.filter((iface) => iface.props.length > 0);
102
- if (withProps.length === 0)
103
- return `## Props\n\n${NO_ADDITIONAL_PROPS}`;
104
- const parts = ['## Props'];
105
- for (const iface of withProps) {
106
- if (withProps.length > 1)
107
- parts.push(`### ${iface.typeName}`);
108
- const rows = iface.props.map((prop) => [
109
- `\`${prop.name}\`${prop.required ? '' : ' (optional)'}`,
110
- prop.typeText,
111
- prop.defaultValue ? `\`${prop.defaultValue}\`` : '—',
112
- prop.description ?? '—',
113
- ]);
114
- parts.push(renderTable(['Prop', 'Type', 'Default', 'Description'], rows));
92
+ export function renderPropLine(prop) {
93
+ const requirement = prop.required ? 'required' : 'optional';
94
+ const defaultValue = prop.defaultValue ? `\`${prop.defaultValue}\`` : NO_DEFAULT;
95
+ const description = prop.description ? `${FIELD_SEPARATOR}${prop.description}` : '';
96
+ return `**\`${prop.name}\`** \`${prop.typeText}\` · ${requirement} · default: ${defaultValue}${description}`;
97
+ }
98
+ /** Parse one definition-list line back into its four fields (the round-trip). */
99
+ export function parsePropLine(line) {
100
+ const match = /^\*\*`([^`]+)`\*\* `([^`]+)` · (required|optional) · default: (?:`([^`]*)`|\u2014)(?:\s+\u2014\s+(.*))?$/.exec(line);
101
+ if (!match)
102
+ return null;
103
+ return {
104
+ name: match[1] ?? '',
105
+ typeText: match[2] ?? '',
106
+ required: match[3] === 'required',
107
+ ...(match[4] !== undefined ? { defaultValue: match[4] } : {}),
108
+ ...(match[5] !== undefined ? { description: match[5] } : {}),
109
+ };
110
+ }
111
+ /**
112
+ * The aggregated definition-list body for an item's exports, one entry per
113
+ * line, de-duplicated by prop name across compound parts, with no blank lines.
114
+ */
115
+ export function renderPropsBody(interfaces) {
116
+ const seen = new Set();
117
+ const lines = [];
118
+ for (const iface of interfaces) {
119
+ for (const prop of iface.props) {
120
+ if (seen.has(prop.name))
121
+ continue;
122
+ seen.add(prop.name);
123
+ lines.push(renderPropLine(prop));
124
+ }
115
125
  }
116
- return parts.join('\n\n');
126
+ return lines.join('\n');
127
+ }
128
+ /**
129
+ * The literal `## Props` section. When the item declares no own props, the
130
+ * documented seam line is emitted instead of an empty list.
131
+ */
132
+ export function renderPropsSection(interfaces, seam) {
133
+ const body = renderPropsBody(interfaces);
134
+ return `## Props\n\n${body || seam}`;
135
+ }
136
+ /** The `## Composition` section for a Block or a Page. */
137
+ export function renderCompositionSection(fields) {
138
+ const lines = fields.map((field) => `**\`${field.key}\`** \`${field.value}\`${FIELD_SEPARATOR}${field.description}`);
139
+ return `## Composition\n\n${lines.join('\n')}`;
140
+ }
141
+ /** The `## Blocks` / `## Pages` cross-references, emitted last. */
142
+ export function renderCrossReferences(references) {
143
+ return references
144
+ .filter((reference) => reference.links.length > 0)
145
+ .map((reference) => `## ${reference.heading}\n\n${reference.links
146
+ .map((link) => `- [${link.name}](${link.href})`)
147
+ .join('\n')}`)
148
+ .join('\n\n');
149
+ }
150
+ /**
151
+ * The first line of the JSDoc block immediately preceding the default export,
152
+ * used as the demo's title. Falls back to a stable generated title.
153
+ */
154
+ export function demoTitle(source, fallback) {
155
+ const exportIndex = source.search(/export\s+default/);
156
+ const before = source.slice(0, exportIndex >= 0 ? exportIndex : source.length);
157
+ const blocks = [...before.matchAll(/\/\*\*([\s\S]*?)\*\//g)];
158
+ const block = blocks.at(-1);
159
+ if (block) {
160
+ const first = (block[1] ?? '')
161
+ .split('\n')
162
+ .map((line) => line.replace(/^\s*\*?\s?/, '').trim())
163
+ .find(Boolean);
164
+ if (first)
165
+ return first;
166
+ }
167
+ return fallback;
168
+ }
169
+ /** Join the fixed per-item sections with the stable blank-line separator. */
170
+ export function assembleDoc(sections) {
171
+ const joined = sections
172
+ .filter((section) => Boolean(section && section.trim()))
173
+ .join('\n\n')
174
+ .replace(/\n{3,}/g, '\n\n')
175
+ .replace(/\s+$/, '');
176
+ return joined ? `${joined}\n` : '';
117
177
  }
118
- //# sourceMappingURL=markdown.js.map