Skip to content

Customizable DecoratorBlockNode via theme - #2387

Merged
zurfyx merged 4 commits into
mainfrom
decorator-theme
Jun 16, 2022
Merged

zurfyx merged 4 commits into
mainfrom
decorator-theme

Conversation

@zurfyx

@zurfyx zurfyx commented Jun 10, 2022 •

Copy link
Copy Markdown
Member

Decorator now has an additional config parameter like createDOM. Do we strictly need DOM like in createDOM? The answer is we don't, we can't potentially build a good abstraction on top that extract the styles. However, it's reality, it's annoying, usually these nodes are tied with the component itself, so for the user having to create an additional abstract to pass their own styles in a different way it's not convenient.

This way we can pass theme.embedBlock and the component will automatically be rendered correctly without any further modifications.

@vercel

vercel Bot commented Jun 10, 2022 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
lexical ✅ Ready (Inspect) Visit Preview Jun 15, 2022 at 8:35AM (UTC)
lexical-playground ✅ Ready (Inspect) Visit Preview Jun 15, 2022 at 8:35AM (UTC)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 10, 2022
@fantactuka

Copy link
Copy Markdown
Contributor

Should it go as a breaking change?

@zurfyx

zurfyx commented Jun 10, 2022

Copy link
Copy Markdown
Member Author

Should it go as a breaking change?

Potentially, it's unfortunate we just released 0.3

@fantactuka

Copy link
Copy Markdown
Contributor

Potentially, it's unfortunate we just released 0.3
Maybe change order of arguments or will it make API inconsistent with other methods?

@trueadm

trueadm commented Jun 13, 2022

Copy link
Copy Markdown
Collaborator

It's a breaking change if it's changing the 1st argument, but not a breaking change if adding as 2nd argument. So let's swap the arguments around, problem solved!

@zurfyx

zurfyx commented Jun 15, 2022

Copy link
Copy Markdown
Member Author

It was nice to have editor as the second param to keep it consistent with createDOM but I guess we can go down this route for now

This branch was successfully deployed

2 active deployments
Preview – lexical-playground — 813e2c96 Deployed Jun 15, 2022 by vercel[bot]
Preview – lexical — 813e2c96 Deployed Jun 15, 2022 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants