@nanisoft/prism-llms 0.3.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.
- package/README.md +88 -0
- package/THIRD-PARTY-NOTICES.md +48 -0
- package/dist/data.json +3998 -375
- package/dist/demo-graph.d.ts +21 -12
- package/dist/demo-graph.js +37 -21
- package/dist/extractor.d.ts +24 -17
- package/dist/extractor.js +269 -153
- package/dist/index.d.ts +12 -7
- package/dist/index.js +9 -7
- package/dist/llms-full.txt +7988 -1989
- package/dist/llms.txt +97 -91
- package/dist/markdown.d.ts +69 -23
- package/dist/markdown.js +131 -72
- package/dist/md/blocks/app-shell-01.md +135 -0
- package/dist/md/blocks/auth-form-01.md +135 -0
- package/dist/md/blocks/cta-01.md +88 -0
- package/dist/md/blocks/data-table-01.md +196 -0
- package/dist/md/blocks/feature-grid-01.md +92 -0
- package/dist/md/blocks/hero-01.md +90 -0
- package/dist/md/blocks/instrument-panel-01.md +109 -0
- package/dist/md/blocks/logo-strip-01.md +97 -0
- package/dist/md/blocks/note-grid-01.md +102 -0
- package/dist/md/blocks/page-header-01.md +97 -0
- package/dist/md/blocks/pricing-01.md +91 -0
- package/dist/md/blocks/process-rail-01.md +106 -0
- package/dist/md/blocks/product-grid-01.md +113 -0
- package/dist/md/blocks/settings-panel-01.md +148 -0
- package/dist/md/blocks/site-footer.md +111 -0
- package/dist/md/blocks/site-header.md +119 -0
- package/dist/md/blocks/stack-grid-01.md +108 -0
- package/dist/md/blocks/stats-01.md +89 -0
- package/dist/md/blocks/status-ledger-01.md +121 -0
- package/dist/md/changelogs/prism-llms.md +206 -0
- package/dist/md/changelogs/prism-mcp-server.md +88 -0
- package/dist/md/changelogs/prism-tokens.md +126 -0
- package/dist/md/changelogs/prism-ui.md +429 -0
- package/dist/md/components/accordion.md +108 -0
- package/dist/md/components/alert.md +90 -7
- package/dist/md/components/avatar.md +89 -7
- package/dist/md/components/badge.md +74 -7
- package/dist/md/components/breadcrumb.md +84 -7
- package/dist/md/components/button.md +90 -7
- package/dist/md/components/card.md +90 -7
- package/dist/md/components/checkbox.md +101 -7
- package/dist/md/components/cta-link.md +98 -0
- package/dist/md/components/diagram.md +124 -0
- package/dist/md/components/dialog.md +128 -0
- package/dist/md/components/dropdown-menu.md +125 -0
- package/dist/md/components/fact-list.md +85 -0
- package/dist/md/components/field.md +116 -0
- package/dist/md/components/input.md +86 -7
- package/dist/md/components/kbd.md +77 -0
- package/dist/md/components/pagination.md +95 -7
- package/dist/md/components/popover.md +95 -7
- package/dist/md/components/product-mark.md +123 -0
- package/dist/md/components/product-switcher.md +88 -0
- package/dist/md/components/progress.md +88 -7
- package/dist/md/components/prose.md +91 -0
- package/dist/md/components/radio-group.md +111 -0
- package/dist/md/components/section.md +91 -0
- package/dist/md/components/select.md +143 -7
- package/dist/md/components/separator.md +77 -0
- package/dist/md/components/skeleton.md +71 -7
- package/dist/md/components/slider.md +90 -7
- package/dist/md/components/switch.md +104 -7
- package/dist/md/components/table.md +104 -7
- package/dist/md/components/tabs.md +105 -7
- package/dist/md/components/textarea.md +101 -0
- package/dist/md/components/tooltip.md +95 -7
- package/dist/md/components/typography.md +82 -7
- package/dist/md/content/about-content.md +36 -0
- package/dist/md/content/audience.md +43 -0
- package/dist/md/content/glossary.md +69 -0
- package/dist/md/content/product-vocabulary.md +53 -0
- package/dist/md/content/voice.md +52 -0
- package/dist/md/content/writing-mechanics.md +58 -0
- package/dist/md/foundation/colors.md +10 -0
- package/dist/md/foundation/iconography.md +14 -0
- package/dist/md/foundation/motion.md +10 -0
- package/dist/md/foundation/radii.md +9 -0
- package/dist/md/foundation/shadows.md +9 -0
- package/dist/md/foundation/spacings.md +8 -0
- package/dist/md/foundation/typography.md +9 -0
- package/dist/md/foundation/variables.md +9 -0
- package/dist/md/overview/architecture.md +76 -0
- package/dist/md/overview/brand.md +41 -0
- package/dist/md/overview/composition.md +77 -0
- package/dist/md/overview/quickstart.md +97 -0
- package/dist/md/overview/theming.md +89 -0
- package/dist/md/overview/using-llms.md +83 -0
- package/dist/md/pages/auth-page.md +149 -0
- package/dist/md/pages/blog-post-page.md +136 -0
- package/dist/md/pages/dashboard-page.md +241 -0
- package/dist/md/pages/marketing-page.md +199 -0
- package/dist/md/pages/not-found-page.md +105 -0
- package/dist/md/pages/settings-page.md +206 -0
- package/dist/prism-skill.md +50 -0
- package/dist/store.d.ts +203 -0
- package/dist/store.js +317 -0
- package/package.json +29 -26
- package/dist/demo-graph.d.ts.map +0 -1
- package/dist/demo-graph.js.map +0 -1
- package/dist/extractor.d.ts.map +0 -1
- package/dist/extractor.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/markdown.d.ts.map +0 -1
- package/dist/markdown.js.map +0 -1
- package/dist/md/blocks/component-demo.md +0 -19
- package/dist/md/blocks/page-header.md +0 -19
- package/dist/md/components/affix.md +0 -14
- package/dist/md/components/anchor.md +0 -14
- package/dist/md/components/auto-complete.md +0 -14
- package/dist/md/components/back-top.md +0 -14
- package/dist/md/components/border-beam.md +0 -14
- package/dist/md/components/calendar.md +0 -14
- package/dist/md/components/carousel.md +0 -14
- package/dist/md/components/cascader.md +0 -14
- package/dist/md/components/col.md +0 -14
- package/dist/md/components/collapse.md +0 -14
- package/dist/md/components/color-picker.md +0 -14
- package/dist/md/components/date-picker.md +0 -14
- package/dist/md/components/descriptions.md +0 -14
- package/dist/md/components/display-title.md +0 -20
- package/dist/md/components/divider.md +0 -14
- package/dist/md/components/drawer.md +0 -14
- package/dist/md/components/dropdown.md +0 -14
- package/dist/md/components/empty.md +0 -14
- package/dist/md/components/flex.md +0 -14
- package/dist/md/components/float-button.md +0 -14
- package/dist/md/components/form.md +0 -14
- package/dist/md/components/grid.md +0 -14
- package/dist/md/components/image.md +0 -14
- package/dist/md/components/input-number.md +0 -14
- package/dist/md/components/layout.md +0 -14
- package/dist/md/components/list.md +0 -14
- package/dist/md/components/listy.md +0 -14
- package/dist/md/components/masonry.md +0 -14
- package/dist/md/components/mentions.md +0 -14
- package/dist/md/components/menu.md +0 -14
- package/dist/md/components/modal.md +0 -14
- package/dist/md/components/popconfirm.md +0 -14
- package/dist/md/components/qrcode.md +0 -14
- package/dist/md/components/radio.md +0 -14
- package/dist/md/components/rate.md +0 -14
- package/dist/md/components/result.md +0 -14
- package/dist/md/components/row.md +0 -14
- package/dist/md/components/segmented.md +0 -14
- package/dist/md/components/space.md +0 -14
- package/dist/md/components/spin.md +0 -14
- package/dist/md/components/splitter.md +0 -14
- package/dist/md/components/statistic.md +0 -14
- package/dist/md/components/steps.md +0 -14
- package/dist/md/components/tag.md +0 -14
- package/dist/md/components/time-picker.md +0 -14
- package/dist/md/components/timeline.md +0 -14
- package/dist/md/components/tour.md +0 -14
- package/dist/md/components/transfer.md +0 -14
- package/dist/md/components/tree-select.md +0 -14
- package/dist/md/components/tree.md +0 -14
- package/dist/md/components/upload.md +0 -14
- package/dist/md/components/watermark.md +0 -14
- package/dist/md/docs/brand.md +0 -41
- package/dist/md/pages/blog-layout.md +0 -19
- package/dist/md/pages/docs-shell.md +0 -23
- package/dist/md/theme/blue-dark.md +0 -127
- package/dist/md/theme/blue-light.md +0 -129
- package/dist/md/theme/green-dark.md +0 -127
- package/dist/md/theme/green-light.md +0 -129
- package/dist/md/theme/lavender-dark.md +0 -127
- package/dist/md/theme/lavender-light.md +0 -129
- package/dist/md/theme/peach-dark.md +0 -127
- package/dist/md/theme/peach-light.md +0 -129
- package/dist/md/theme/rose-dark.md +0 -127
- package/dist/md/theme/rose-light.md +0 -129
package/dist/llms.txt
CHANGED
|
@@ -1,104 +1,110 @@
|
|
|
1
1
|
# Prism
|
|
2
2
|
|
|
3
|
-
>
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
- [
|
|
12
|
-
- [Alert](https://prism.nanisoft.com/
|
|
13
|
-
- [
|
|
14
|
-
- [
|
|
15
|
-
- [
|
|
16
|
-
- [
|
|
17
|
-
- [
|
|
18
|
-
- [
|
|
19
|
-
- [
|
|
20
|
-
- [
|
|
21
|
-
- [
|
|
22
|
-
- [
|
|
23
|
-
- [
|
|
24
|
-
- [
|
|
25
|
-
- [
|
|
26
|
-
- [
|
|
27
|
-
- [
|
|
28
|
-
- [
|
|
29
|
-
- [
|
|
30
|
-
- [
|
|
31
|
-
- [
|
|
32
|
-
- [
|
|
33
|
-
- [
|
|
34
|
-
- [
|
|
35
|
-
- [
|
|
36
|
-
- [
|
|
37
|
-
- [
|
|
38
|
-
- [
|
|
39
|
-
- [
|
|
40
|
-
- [
|
|
41
|
-
- [
|
|
42
|
-
- [
|
|
43
|
-
- [
|
|
44
|
-
- [
|
|
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
|
-
- [
|
|
86
|
-
- [
|
|
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.
|
|
87
95
|
|
|
88
96
|
## Pages
|
|
89
97
|
|
|
90
|
-
- [
|
|
91
|
-
- [
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
- [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
- [
|
|
100
|
-
- [
|
|
101
|
-
- [
|
|
102
|
-
- [
|
|
103
|
-
- [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.
|
|
104
|
-
- [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
|
package/dist/markdown.d.ts
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The MDX
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
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
|
|
22
|
+
/** Parse `---`-delimited `key: value` frontmatter (the fumadocs default schema). */
|
|
18
23
|
export declare function parseMdx(raw: string): ParsedMdx;
|
|
19
|
-
/**
|
|
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
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
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
|
|
31
|
+
export declare function stripMdxMechanics(body: string): string;
|
|
27
32
|
/**
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
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
|
|
33
|
-
/**
|
|
34
|
-
export declare function
|
|
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
|
|
37
|
-
*
|
|
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
|
|
42
|
-
|
|
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
|
-
|
|
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] ?? '')
|
|
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
|
-
/**
|
|
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
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
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
|
-
/**
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
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
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
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
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
]
|
|
114
|
-
|
|
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
|
|
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
|