Implementation of the split text (split paragraph) functionality for CKEditor5.
Based on the ckeditor5_plugin_starter_template, and as such has the same dependencies.
Uses a custom split function instead of SplitOperation, and the "Add in-between" button from the previous (8.x) version of this project instead of it's own modal.
As such it will need some adjustment to work with version 2.x, but the functionality itself is tested and working.
Comments
Comment #1
Anonymous (not verified) commentedSzabocs Páll created an issue. See original summary.
Comment #2
a.milkovskyLooks good and works nice with CKEditor 5.
Comment #3
volkerk commentedTested this in drupal 10.1 standard profile and chrome:
* Create paragraph type text with text, formatted long field
* Add paragraphs field to article
* Add Split Paragraph Button to Basic HTML Input filter
On the create article (node/add/article) route I get js warning in console
Pasting some text into the text paragraph, position cursor somewhere in the text and clicking the
split paragraph buttton in ck toolbar I get
Additionaly there is not build step config for rebuilding the js in build dir.
Add .nvmrc to specify node version used.
Comment #4
Anonymous (not verified) commentedThe issues above should be fixed now, also added an extra README for CKEditor5.
Also it no longer uses the Add-in-between, but the add more modal (like did the previous version).
Comment #5
googletorp commentedThe patch at github seems to have a lot of issues.
Trying to execute the button I get: Uncaught CKEditorError: t.closest(...).querySelector(...) is null
When using same editor outside paragraphs you also get a similar error on load about querySelector which crashes editors if you have multiple on the same page. In general seems like checks are missing for the different selectors. Example
document.querySelector('XX').something
will cause JavaScript TypeError if XX is not present on the page, so you always need to check the output of querySelector and act accordingly if what you expected is not on the page.
Comment #6
Anonymous (not verified) commentedComment #7
dima.iluschenkoAny updates there?
Comment #8
a.milkovsky@dima.iluschenko as a temporary solution, we have created a custom module and added the code from the PR there.
The solution works for us.
Comment #9
foreveryo commented@a.milkovsky would mind to share the custom module? :-)
I tried merging the PR on my side but the button does not appear :-(
Thanks!
Comment #10
foreveryo commentedI managed to run it on my side but I had to make several changes mainly to the query selectors as for instance ".paragraphs-container" is not an standard css selector or at least is not existing in Gin theme. Which admin theme do you use?
Comment #11
greenskin commentedPull request #76 was closed in favor of #80.
Comment #12
greenskin commentedI'm looking for a compatible solution with Layout Paragraphs. Pull request #80 does not seem to work with layout paragraphs.
Comment #13
volkerk commented@greenSkin Please add a follow-up for layout paragraphs support.
Comment #14
daniel.bosenI reviewed it on GitHub, the issues I found with the PR have been fixed. lgtm.
Comment #15
volkerk commentedComment #17
a.milkovskyIt is nice to have this feature back!
Note: I would give a credit to Szabocs Páll for the initiative and the initial development.
Comment #18
volkerk commentedComment #19
greenskin commentedTested latest and still not working with Layout Paragraphs widget. The button shows but is disabled. I'm still seeing use of
.field--widget-paragraphswhereas Layout Paragraphs widget has class. field--widget-layout-paragraphs.Comment #20
volkerk commented@greenSkin Please do not reopen fixed issues. Support of layout_paragraphs is a feature request.
Please open a new issue.
Comment #22
capellicGreat to see this functionality returned! Thanks!!