feat: content primitives : Callout, Card, Steps, FileTree, CodeGroup + stable razor:preview - #11
Merged
Merged
Conversation
…oup, and FileTree with corresponding styles, enhancing content presentation and organization
…nd Steps, enhancing documentation structure and user navigation
…nt for auto-registered components in ShellDocs
…ntegrating SlotRenderer for parameter handling and removing unused code, enhancing maintainability and performance
…ponents in ServiceCollectionExtensions, improving component accessibility in markdown previews
…oved rendering of non-self-closing tags in markdown
…et, ensuring accurate component registration in TypeRegistry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ships the six markdown-authorable content primitives fumadocs-style docs need, and stabilises the
razor:previewblock so nested-component previews stop rendering as literal HTML.New primitives (auto-registered by
AddShellDocs, so<Callout>/<Card>/ etc. work in any.mdfile with zero wiring):<Callout Variant="info|warning|danger|tip"><Card Title Description Href IconSvg><a>whenHrefis set<CardGrid Columns="1|2|3"><Card>/<LinkCard><LinkCard Title Description Href><Steps>/<Step Title><FileTree>/<FileTreeItem Name IsFolder Highlight Comment><CodeGroup SyncKey>/<CodeTab Label>CodeGroupSyncStatePreview infrastructure fixes — the tab UI in
PreviewFramewas replaced with a shadcn-style stacked layout:DynamicComponent, so component state survives, and Shiki's one-shot DOM mutation on the code element is never re-diffed. Kills the whole class of tab-switch bugs.PreviewSlotnow carriesChildContentRaw, extracted between the opening/closing tags of arazor:previewblock. A sharedSlotRenderer.FromMarkuphelper recursively renders that raw markup as real nestedDynamicComponents.SlotRenderer.BuildParametersreflects on the target component type and coerces string attribute values to the declared[Parameter]type —IsFolder="true"→bool true,Columns="2"→int,Variant="info"→ enum, all cached per-type via aPropertyInfomap. FixesInvalidCastExceptionon<FileTreeItem IsFolder="true">.SlotRenderer.Dedentstrips common leading whitespace before feeding nested markup back through Markdig — otherwise 4-space-indented children of<Steps>/<FileTree>were treated as indented code blocks and rendered as<pre>around placeholder divs.Docs — added
card.md,steps.md,filetree.md,code-group.mdto the preview app; updatedmeta.jsonsidebar order.Tests — renamed the local
Callouttest double toCustomWidgetinAddShellDocsTeststo avoid resolution collision with the newly auto-registered productionCallout.