-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TextColorFeature not working #2
Comments
Hey, thanks for spotting the issue with colors property. i've fixed that, About the html rendering issue, how are you rendering the json to html? |
ah thanks for your answer, I was using |
I've added converters to the plugin, you should edit the RichText component to add the JSXConverters as defined in usage step 4 of the README. Let me know if it works for you |
I also just noticed the regex to get the colors includes the semicolon |
Thanks for helping me testing the JSX Converters, i'm not using RichText component and it's being hard for me to properly test that part. I've released the fixes for the issues you've found |
I tried the new versions ( |
Seems like there were some issue while building the code, i've re-built and published a 0.5.0 version. It should be fine now. Thank you! |
Hey, I think it's still something wrong with the JSXConverter import { JSXConvertersFunction, RichText as RichTextWithoutBlocks } from "@payloadcms/richtext-lexical/react";
import { JSXConverters } from "payloadcms-lexical-ext";
import { CodeBlock, CodeBlockProps } from "@/blocks/Code/Component";
import type { CallToActionBlock as CTABlockProps, MediaBlock as MediaBlockProps } from "@/payload-types";
// import { BannerBlock } from "@/blocks/Banner/Component";
import { CallToActionBlock } from "@/blocks/CallToAction/Component";
import { cn } from "@/utils/cn";
type NodeTypes = DefaultNodeTypes | SerializedBlockNode<CTABlockProps | MediaBlockProps | CodeBlockProps>;
const jsxConverters: JSXConvertersFunction<NodeTypes> = ({ defaultConverters }) => ({
...defaultConverters,
...JSXConverters,
blocks: {
// banner: ({ node }) => <BannerBlock className="col-start-2 mb-4" {...node.fields} />,
mediaBlock: ({ node }) => (
<MediaBlock
className="col-span-3 col-start-1"
imgClassName="m-0"
{...node.fields}
captionClassName="mx-auto max-w-[48rem]"
enableGutter={false}
disableInnerContainer={true}
/>
),
code: ({ node }) => <CodeBlock className="col-start-2" {...node.fields} />,
cta: ({ node }) => <CallToActionBlock {...node.fields} />,
},
}); Got it like that, and like the person above, I got the "Can't resolve 'fs'" error. |
Hi @AdrianMaj i released version 0.5.1, this should be fixed |
Thanks for fast update, but I still don't find it working. When I use source code and manually add the converters it works, but when using |
I released a beta version, you should be able to install it like |
Unfortunately no, here is the full error message, maybe it will help you out:
|
Status
I have added TextColorFeature to the editor and imported the css
this is working fine except that if you don't give it an
object { colors: [...] }
it gives an errorIssue
on the frontend the colors are not showing, in the html I just see empty comments
I appreciate the plugin! thanks for making it
The text was updated successfully, but these errors were encountered: