feat: api-reference primitives : TypeTable + ComponentPreview - #12
Merged
Conversation
…mentation examples and structured prop references
…or improved documentation display and prop management
…umentation capabilities and improve prop management
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 two API-reference primitives from the Phase 2 roadmap so consumers can hand-author prop tables and single-component demos without dropping into full
razor:previewfences.New components
<TypeTable>/<TypeRow>— the props/API reference table.requiredbadge.CascadingValue— same pattern as<CodeGroup>/<CodeTab>. Nothing rendered from<TypeRow>directly; it just hands its data up.Nameare deduped silently.ShellDocs.Xml→<TypeTable Source="ShellUI.Button" />.<ComponentPreview Component="..." ...props>— the declarative-prop cousin ofrazor:preview.stringComponentprop; resolves it through the sameTypeRegistrythat backsrazor:preview.[Parameter(CaptureUnmatchedValues = true)]to receive arbitrary target-component props as attributes on the tag itself — no dictionary syntax, no fenced-block wrapper.[Parameter]types and coerces each string value via the sharedSlotRenderer.Coerce(booleans, ints, enums, etc.).DynamicComponent, plus a fumadocs-style stacked source-view (collapsed teaser + centered View source button, expands to show the reconstructed razor snippet with Copy and Hide). Source string is rebuilt from the resolved prop dict — attributes sorted alphabetically for stability, self-closing form when there's no body.Componentrenders an inlineUnknown component: <code>Foo</code>error instead of throwing.Infrastructure
SlotRenderer.GetParameterPropsandCoerceare nowinternal(wereprivate) soComponentPreviewcan drive the same per-type conversion its parent slot-renderer uses.ChildContentSourcethreading: when the target component declares a[Parameter] public string? ChildContentSource,SlotRenderer.BuildParametersnow passes the raw child markup through unchanged alongside the usualChildContentRenderFragment. That's what lets<ComponentPreview>reconstruct its source-view without asking the author to repeat themselves.Fixes bundled in
<Steps>rail centering. The border-left rail was drawn on the naked<ol>, and the number badge was pushed ~12px right of it — reading as "circle next to line" instead of "spine with beads on it". Whole list is now shifted right by1remso the border sits at globalx = 1rem, and each badge is centered on that line vialeft: calc(-1rem - 0.5px). Badge fill changed from--muted→--cardso it clearly breaks the rail (muted was the same tonal family as--borderand blended into it). Badge bumped 1.85rem → 2rem, number 0.75rem → 0.8125rem.Docs
examples/ShellDocs.Preview/content/docs/components/type-table.md— Basic + Props sectionsexamples/ShellDocs.Preview/content/docs/components/component-preview.md— Basic + self-closing examples, Props sectionmeta.jsonsidebar updated:[..., "type-table", "component-preview"]