Praxis Rich Content Runtime
Use this skill for the canonical rich content renderer. Treat rich content as structured Praxis document semantics, not as arbitrary HTML, markdown, or a generic visual widget.
Source Audit
Before editing code or guidance, inspect:
projects/praxis-rich-content/README.mdprojects/praxis-rich-content/src/public-api.tsprojects/praxis-rich-content/src/lib/praxis-rich-content.tsprojects/praxis-rich-content/src/lib/praxis-rich-content.metadata.tsprojects/praxis-rich-content/src/lib/rich-content-document-validator.tsprojects/praxis-rich-content/src/lib/rich-content-preset-registry.service.tsprojects/praxis-rich-content/docs/praxis-docs.manifest.jsonprojects/praxis-core/src/lib/models/rich-content/**- focused runtime, metadata, validator, and preset specs
Read projects/praxis-rich-content/AGENTS.md before editing rich-content runtime or authoring-adjacent code. Use praxis-angular-agents-governance if the local AGENTS file is missing, stale, or contradicts this skill.
Canonical Boundary
@praxisui/core owns the shared RichContentDocument and node model. @praxisui/rich-content owns rendering, validation helpers, metadata provider, editor, presets, i18n, and AI authoring surfaces.
Do not introduce local rich-content dialects in consumers. New semantic content should use:
{
kind: 'praxis.rich-content',
version: '1.0.0',
nodes: []
}
Runtime Rules
- Use
PraxisRichContentfor rendering documents and nodes. - Use
layout='inline'only for compact compositions; keep document-style content in block layout. - Prefer semantic nodes such as text, badge, icon, card, callout, key/value list, stats, timeline, media block, record summary, lookup surfaces, action card, decision package, disclosure, accordion, form launcher, and preset references.
- Use
contextand expression fields (valueExpr,labelExpr,titleExpr,subtitleExpr,textExpr,captionExpr) for materialized values. Do not pre-render HTML strings when the document can bind to governed context. BecauseDynamicWidgetLoaderDirectivedefers*Exprfields toPraxisRichContent,resolveValue/resolveStructuredValue/getByPathmust resolve direct paths (activeHeroes), single-token expressions (${activeHeroes}and{{activeHeroes}}emitted by the Page Builder State Binder), composite strings ("${activeHeroes} Heróis"),context./state./state.derived.-prefixed paths, dotted namespace paths (${kpis.readinessRate}) falling back to the flat leaf key (context.readinessRate) when the root namespace object is absent incontext, and declarative formatting pipes (default/coalesce,round[:N],number[:N],percent[:N],currency[:'BRL'|'USD'],uppercase,lowercase) viaapplyDeclarativeValuePipefrom@praxisui/core, while guarding against unresolved upstream template strings (isUnresolvedTemplateToken) sodefaultfallbacks apply cleanly before async dataSources resolve.resolveStructuredValuemust returnnullwhen an expression contains embedded${...}or{{...}}tokens alongside literal text so composite strings with pipes are interpolated token-by-token. - Host-mediated actions must stay actions. The renderer does not execute business behavior by itself. For
timeline(RichTimelineNode), supportitemLayout('stacked' | 'split'), single-sided vertical opposite-column collapse (evaluatinghasTimelineOppositeContent(node)againstresolveAllTimelineItems(node)so expandinginitialLimitnever causes layout shifts),markerStyle('filled' | 'outlined' | 'soft'),badgeTone, inlineavatarwith fallback, nestedchildrensub-steps,initialLimitprogressive disclosure (witharia-expandedandaria-controls), anditemsExpr+itemTemplatedynamic materialization (exposingitem,index,$index, merging parentrowproperties, and evaluating per-itemaction.availabilityExpr,action.payload, andaction.confirmMessage). - Register
providePraxisRichContentMetadata()when dynamic widget loaders or Page Builder need to discover the component. - Use
RichContentPresetRegistryService,PRAXIS_RICH_BLOCK_PRESETS, andprovidePraxisDefaultRichBlockPresets()for governed presets. - For Quick View presets (
validateRichContentForQuickView/QUICK_VIEW_ALLOWED_NODE_TYPES), only compact summary nodes (section,grid,stack,card,recordSummary,keyValueList,statGroup,callout,text,badge,icon,mediaBlock,actionCard,actionButton,presetRef) are permitted up tomaxDepth: 2(maxNodes: 24), rejecting forms, disclosures/accordions, timelines, lookup surfaces, and destructive actions (failureCode: 'QUICK_VIEW_PRESET_REJECTED'). InPraxisRichContent,recordSummary,relatedRecord,recordReference,lookupCard,badge, andlinknodes, as well askeyValueListitems (RichKeyValueItem.quickView),recordSummaryfields (RichRecordSummaryField.quickView), andpropertySheet/dynamicFormitems (RichPropertySheetItem.quickViewor schema-synthesized viaresolveFieldQuickViewBinding(field)), attach[praxisQuickView](PraxisQuickViewTriggerDirective).
Validation
Use the smallest reliable proof:
praxis-rich-content.spec.tspraxis-rich-content.metadata.spec.tsrich-content-document-validator.spec.ts- preset registry specs when preset behavior changes
- docs/playground validation when public rich-content examples change
- focal consumer validation when stepper, page-builder, editorial-forms, or dynamic pages materialize the document
Report exactly what was validated and what remained unvalidated.
Companion Skills
- Use
praxis-rich-content-authoring-settingsfor the config editor, guided editing, preview, JSON tab, and presets. - Use
praxis-rich-content-integration-adapterswhen rich content is embedded in stepper, Page Builder, editorial forms, dynamic forms, or composed widgets. - Use
praxis-rich-content-ai-security-validationfor validator, sanitization, safe URLs/styles, JsonLogic fail-safe behavior, AI manifest, and registry validation. - Use
praxis-core-runtime-contractswhen the shared core rich-content model or public exports change.