Repository navigation
feat(core/chat): ix-markdown and ix-code-block - #2912
danielleroux wants to merge 32 commits into
Conversation
Add `ix-markdown`, a scoped light-DOM component that renders Markdown (CommonMark, GFM, directives via unified/remark) with iX tokens on the client only. Raw HTML renders as text except `<br>`; links are limited to http(s), mailto and relative URLs and images to http(s) URLs. Add `ix-code-block` with filename, language label, copy button with a temporary Copied state, localizable labels and an optional `highlight` hook that returns a DOM node. Refs: IX-2, IX-3
Add Example/Markdown (Default, InChatMessage, Security, Empty) and Example/Code Block (Default, WithFilename, LongLines, Localized, CustomHighlight) stories for review. Fix ix-code-block collapsing whitespace and line breaks of highlighted output. Refs: IX-2, IX-3
# Conflicts: # .changeset/add-markdown-and-code-block.md # packages/core/src/components/markdown/markdown-renderer.ts # packages/core/src/components/markdown/markdown.tsx
…nents Refs: IX-10
…ributes, restrict actionClick payload Refs: IX-1
… tests Refs: IX-1
…rkdown renderer Refs: IX-1
…onent stories Add Example/Markdown stories that demonstrate: - Streaming: a replayable simulated LLM stream inside ix-chat-ai-message with Settled blocks, tables, code, task lists, callouts, Directive buttons and Custom components. - Directives: all built-in Directives with a visible Markdown action log. - CustomComponents: tag-name and factory Component mappings, a nested ix-markdown, emitAction and overriding a built-in node type. Each story has a play function so the storybook vitest run checks it. Refs: IX-1
Runs the real ix-markdown element in Jest and checks mount, in-place update, destroy and injection of an app-provided service. Refs IX-11
Adds markdown, markdown-custom-component and code-block examples for HTML, Angular (module and standalone), React and Vue, with shared aria snapshots and axe smoke tests. Refs IX-13
✅ Deploy Preview for ix-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🦋 Changeset detectedLatest commit: f395128 The changes in this PR will be included in the next version bump. This PR includes changesets to release 4 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The browser build of decode-named-character-reference created a DOM element at module load, so importing ix-markdown failed during Next.js prerendering. Resolve it to a local copy that creates the element on first use. Mark the React createMarkdownComponent helper as a client module because it uses react-dom/client. Refs IX-13
Narrow node offsets and directive names explicitly so the core lint passes. Refs IX-13
|



🆕 What is the new behavior?
🏁 Checklist
A pull request can only be merged if all of these conditions are met (where applicable):
pnpm test)pnpm lint)pnpm build, changes pushed)👨💻 Help & support