-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(admin-ui): React useProseMirror hook #2675
feat(admin-ui): React useProseMirror hook #2675
Conversation
Hi, Thanks for this great work! Do you think it is best to expose this as a hook, rather than a component? I'm not really a React dev so I'm not familiar with what would be more idiomatic. But to me I would think of this more as a component that you can drop in your template and pass some props to. Is there an advantage to exposing it as a hook? Also I think I'd prefer it to be named more generically, like
Regarding docs: you can run the |
Hello :D. I agree with naming. Will change it today and try with docs. If You would like to have a component too (I can create it). Maybe that is a good case to expose |
The component would just be a thin wrapper around the hook right? Very much like the example component in the doc? If so, then yeah I think it is nice to expose both, and include in the docs for each that there is an option depending on how much control is needed by the developer. |
Yeap exactly it will be like thin wrapper around this hook. I will try to do this today and push it back to review :) |
68e0fa5
into
vendure-ecommerce:minor
Thank you! |
@AleksanderBondar looks like it's not loading default styles when you are using this component inside the widget when the page does not contain an angular component version with styles. |
To be truth, I just copy and paste whole styling from base angular component.
I can try to implement it too in this component. |
I guess makes sense to move these styles to shared or also include them with the react component because for now, this component is not usable. If you will need any help give me know. |
I have a bit of a problem with accessibility. The fastest I can fix it is sometime during the weekend. If You want to do that go ahead. |
I'm also not sure when I'll have time to do it, if I'm free I'll let you know not to do the same things |
+1 here. I will put a message here when I got time for that, but glad to hear some1 is using it :P |
and also probably there is a bug with |
Will check that |
@AleksanderBondar Hello, how can I set the default value on RichTextEditor? |
Hello there :). You should get
Then I am setting default values by
Probably this weekend I will get some time to update this hook with |
@AleksanderBondar Thank you |
Description
Adding
useProseMirror
for React plugins.Screenshots
Checklist
📌 Always:
👍 Most of the time:
PS. I am not pretty sure how to add it into
docs
(not sure about section where it should live) but if someone will pass me some instructions I can add it too :). But we should inform aboutmissing
css which need to be added into plugin to make prosemirror looking like everywhere.