- Issue created by @slucero
- First commit to issue fork.
- Merge request !108Issue #3386854: Attach JSON Editor Theme Assets Using Library Attachments β (Open) created by krisahil
- πΊπΈUnited States krisahil
@slucero, I started work to support these changes. The MR, as it stands now, loads the JSON Editor theme assets as a Drupal library, using
#attached
, instead of manually adding the scripts and styles to the DOM. On one site, this change has made loading the CSS and JS much more reliable (the manual method loaded CSS and JS in unpredictable order, which led to race conditions, evidenced in CKEditor 5 integration). - πΊπΈUnited States slucero Arkansas
Thanks for getting this started @krisahil! I looked over the code so far and it all looks good. One thing I'd look into as part of this as well is whether we can remove the shadow dom versions and related checks altogether now that we've removed shadow dom support in the beta 9 release.
- Status changed to Active
26 days ago 4:41pm 3 June 2024 - Status changed to Needs review
12 days ago 5:54pm 17 June 2024 - πΊπΈUnited States slucero Arkansas
@krisahil, thanks for the heads up on the regression. I'll have to look into that more closely.
What is the back-story for renaming this scope to #patternkit-editor-target ? Does Patternkit allow for opening the editor in a context other than #drupal-off-canvas? If so, how?
Regarding this, yes the block form may also be opened in a full-page view instead of in the sidebar tray. The simplest way to do this that I've found for testing is to right-click the link for one of the block edit forms and select to open it in a new tab. This will open up the full-page form and redirect you back to the layout edit page upon submission.
Applying the
#patternkit-editor-target
ID is a shortcut that was used to have a consistent target for the form to instantiate within and to allow the cygnet theme styles to target more directly without being reliant specifically on the markup for the sidebar tray. This would of course conflict if multiple editors are instantiated on a page at once, but I suspect we'll have a few additional issues in that scenario to overcome as well.