Skip to content

decoupled styling#2975

Draft
gabrielmfern wants to merge 11 commits intofeat/ai-oss-editorfrom
feat/decoupled-styling
Draft

decoupled styling#2975
gabrielmfern wants to merge 11 commits intofeat/ai-oss-editorfrom
feat/decoupled-styling

Conversation

@gabrielmfern
Copy link
Member

@gabrielmfern gabrielmfern commented Feb 25, 2026


Summary by cubic

Decoupled editor styling from theming by moving all nodes to a single style prop. Replaced RESET_THEMES with DEFAULT_STYLES, added coreExtensions, and expanded plugin styling with depth-aware mapping.

  • New Features

    • coreExtensions export with a configured StarterKit and editor nodes for easy initialization.
    • Plugin interface and createPlugin helper with mapNodeStyles(node, depth, editor) for per-node, depth-aware style mapping.
  • Migration

    • Update renderToReactEmail calls: replace styles with style: React.CSSProperties.
    • Replace uses of RESET_THEMES with DEFAULT_STYLES (utils/default-styles).
    • Remove GlobalContent usage.

Written for commit 358e9b6. Summary will update on new commits.

@gabrielmfern gabrielmfern marked this pull request as draft February 25, 2026 16:02
@vercel
Copy link

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
react-email Ready Ready Preview, Comment Feb 25, 2026 4:55pm
react-email-demo Ready Ready Preview, Comment Feb 25, 2026 4:55pm

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 25, 2026

⚠️ No Changeset found

Latest commit: 358e9b6

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Feb 25, 2026

Open in StackBlitz

npm i https://pkg.pr.new/resend/react-email/@react-email/editor@2975

commit: 358e9b6

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 25 files

Confidence score: 3/5

  • There is a concrete data-handling risk in packages/editor/src/extensions/global-content.tsx: attrs.data is stored as a JSON string but spread like an object, which can corrupt merged attributes when defaults are used.
  • Severity is moderate (6/10) with high confidence, so this isn’t a merge blocker but could cause user-facing content/state inconsistencies.
  • Pay close attention to packages/editor/src/extensions/global-content.tsx - parse attrs.data before merging and serialize when setting to avoid data corruption.
Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/editor/src/extensions/global-content.tsx">

<violation number="1" location="packages/editor/src/extensions/global-content.tsx:86">
P2: `attrs.data` is stored as a JSON string, but it’s spread as if it were an object. This will corrupt merged data when the node uses the default/parsed attribute. Parse the string before merging and serialize when setting the attribute.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

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.

1 participant