v0.25.1
Summary
Introduces the dynamic external component system: articles can embed externally hosted, interactive ESM components (quizzes, parameter explorers, teaching widgets) through a new DynamicNode, loaded at runtime via import(url) into a shadow root with full style isolation, theme awareness, and a zero-CLS height contract. Wired through the whole ecosystem: LiteXML authoring (<dynamic> tag), the AI agent system prompt (catalog-gated usage), rich-compose module with validateUrl allowlisting, headless registry, and the litexml CLI.
(v0.25.1 supersedes the unreleased v0.25.0: it additionally fixes the RendererConfig module augmentation not merging for consumers importing from the package root — same class of bug as 90f0e09.)
Breaking Changes
None.
Features
- @haklex/rich-dynamic-protocol (new): framework-agnostic mount contract (
mount(container, { props, host }) → { update, unmount }) plus adefineDynamicComponent()React helper under./reactfor component authors. - @haklex/rich-ext-dynamic (new):
DynamicNode/DynamicEditNodewith payload{ url, props, initialHeight }; shadow-DOM host renderer with loading/error states, retry, push-based theme updates, andinitialHeightas a permanent height floor (zero CLS); settings popover (URL / height / props JSON) andINSERT_DYNAMIC_COMMAND+ slash-menu entry. - rich-compose: new
modules/dynamic(configurablevalidateUrl), registered inallRendererModules/allEditorModules. - rich-headless: headless
DynamicNodeinallHeadlessNodes. - rich-litexml:
<dynamic url initial-height>writer/reader with props JSON in CDATA; roundtrip-tested; supported by thelitexmlCLI. - rich-ext-ai-agent: document-tool system prompt teaches
<dynamic>with a hard catalog rule (never invent URLs; fall back to static nodes when no cataloged component fits). - Docs:
markdown-flavor-litexml.mdcontract entry;litexml-authoringskill node map + catalog recipe.
Bug Fixes
- rich-ext-dynamic: preserve
RendererConfigaugment side-effects in published dist (dedicatedaugment.ts+ marker export, pattern from rich-ext-chat).
Bump rationale
minor (new packages / new exports) + patch (augment dist fix) → 0.25.1. Published the full set (41 packages) to keep exact workspace peer pins coherent for downstream installs.