Conversation
…perty in dependencies
…rom @demshy - Applied implementation from https://github.com/poslovnimediji/decap-cms/tree/widget-richtext - Based on PR decaporg#7162
e9f1eb6 to
a418dc0
Compare
| <Toolbar | ||
| onLinkClick={handleLinkClick} | ||
| onToggleMode={handleToggleMode} | ||
| buttons={[]} |
There was a problem hiding this comment.
This is hardcoded to be an empty array, I don't think it was meant to be this way?
| <LinkToolbarButton | ||
| type="link" | ||
| label={t('editor.editorWidgets.markdown.link')} | ||
| icon="link" | ||
| disabled={disabled} | ||
| t={t} |
There was a problem hiding this comment.
Is the link button meant to be always visible?
| <ListToolbarButton | ||
| type="ul" | ||
| label={t('editor.editorWidgets.markdown.bulletedList')} | ||
| icon="list-bulleted" | ||
| disabled={disabled} | ||
| /> | ||
| <ListToolbarButton | ||
| type="ol" | ||
| label={t('editor.editorWidgets.markdown.numberedList')} | ||
| icon="list-numbered" | ||
| disabled={disabled} | ||
| /> |
There was a problem hiding this comment.
Same here for the lists, just in case!
packages/decap-cms-widget-richtext/src/RichtextControl/components/Toolbar/Toolbar.js
Show resolved
Hide resolved
| t={t} | ||
| /> | ||
| <HeadingToolbarButton isVisible={isVisible} disabled={disabled} t={t} /> | ||
| {isVisible('blockquote') && ( |
There was a problem hiding this comment.
The schema uses 'quote' instead of 'blockquote', shouldn't these match?
...ges/decap-cms-widget-richtext/src/RichtextControl/components/Toolbar/HeadingToolbarButton.js
Show resolved
Hide resolved
| <Plate editor={editor} onChange={handleChange}> | ||
| <EditorControlBar> | ||
| <Toolbar | ||
| onLinkClick={handleLinkClick} |
There was a problem hiding this comment.
I saw this is being passed but is not used
yanthomasdev
left a comment
There was a problem hiding this comment.
I needed to make a few changes for strikethrough and blockquote to finally work, I can't commit directly so I ported my edits to suggestions.
I'll note that images and the containarized markdown/richtext don't work in the preview, so maybe we could leave these for a follow-up PR with tables and drag-in-drop?
The code block one does work, but has no syntax highlighting nor styling just like blockquote. I guess we would want to add shiki to add styling to it? Not sure how in this context.
packages/decap-cms-widget-richtext/src/serializers/remarkSlate.js
Outdated
Show resolved
Hide resolved
packages/decap-cms-widget-richtext/src/serializers/remarkSlate.js
Outdated
Show resolved
Hide resolved
packages/decap-cms-widget-richtext/src/serializers/slateRemark.js
Outdated
Show resolved
Hide resolved
packages/decap-cms-widget-richtext/src/serializers/slateRemark.js
Outdated
Show resolved
Hide resolved
packages/decap-cms-widget-richtext/src/serializers/slateRemark.js
Outdated
Show resolved
Hide resolved
packages/decap-cms-widget-richtext/src/serializers/slateRemark.js
Outdated
Show resolved
Hide resolved
Co-authored-by: Yan <61414485+yanthomasdev@users.noreply.github.com>
|
I am not sure why unit tests are failing here but not locally, maybe the branch isn't updated? I don't have write access to do that myself. |
This reverts commit b44e3c8.
|
@martinjagodic I think this one is basically good to go. I made a few changes since we last talked:
What I wasn't able to solve to this moment is the images not working. Not sure if it's a local thing, or happens in production as well, would need your experience here. We can remove the image attachment if that makes sense. |
Summary
This is a work-in-progress PR that adds
richtext-widgetas a potential replacement for the markdown in one of the future releases. Discussion where I put some of my thoughts about this here: #6905Digging deeper, there might be another caveat that we haven't considered before - nesting block types (inside lists for example) might make the implementation much more difficult so I did not go down that road yet.
A very rough checklist:
I have copied serializers (and their tests) from the existing markdown widget and am updating them as I go. I copy the renderers one by one as I get to the plugin in question.
Once the basic implementation is done, I plan on going through the e2e tests and update what is needed on the code or tests side, depends on the specific situation.
Note that this is very much in progress but I'm happy of any feedback, especially from someone who dealt with Slate/Plate before.
Test plan
Checklist
Please add a
xinside each checkbox:A picture of a cute animal (not mandatory but encouraged)