Skip to content

Conversation

@TRomesh
Copy link
Contributor

@TRomesh TRomesh commented Nov 3, 2025

  • Add support for CSS styles (Some basic styling options) for content created from Integration API.
  • Add support HTML Table attributes.
  • Add unit test for css conversion.
  • Update readme with the information about what we support and what we don't.

@TRomesh TRomesh requested a review from Copilot November 3, 2025 09:11
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the RichText component's attribute handling by adding comprehensive support for HTML-to-React attribute conversion and CSS property management. The changes enable proper rendering of table elements with their attributes and automatic conversion of CSS properties to React style objects.

  • Added TableElement type and createTableComponent function for type-safe table rendering
  • Implemented comprehensive HTML attribute to React prop conversion via HTML_TO_REACT_ATTRS mapping
  • Added CSS property detection and automatic conversion to React style objects
  • Enhanced documentation with detailed attribute and CSS property support reference

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/optimizely-cms-sdk/src/react/richText/lib.ts Core implementation of attribute conversion logic, TableElement renderer, and CSS property handling
packages/optimizely-cms-sdk/src/react/richText/index.ts Exported new TableElement types and createTableComponent function
packages/optimizely-cms-sdk/src/react/test/table-attributes.test.tsx Tests for table attribute rendering (contains incorrect expectations)
packages/optimizely-cms-sdk/src/react/test/attribute-conversion.test.tsx Tests for HTML attribute to React prop conversion
packages/optimizely-cms-sdk/src/components/richText/renderer.ts Added TableElement interface and attribute mapping
packages/optimizely-cms-sdk/src/components/richText/index.ts Exported TableElement and related types
docs/6.1-richtext-component-react.md Comprehensive documentation of attribute and CSS property support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 8 out of 8 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…nd improve CSS properties handling in the library
@TRomesh TRomesh merged commit ef08cfb into main Nov 4, 2025
3 of 4 checks passed
@TRomesh TRomesh deleted the bugfix/CMS-46481-fix-attributes-parsing branch November 4, 2025 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants