silverstripe / silverstripe-admin

Silverstripe Admin Component
BSD 3-Clause "New" or "Revised" License
25 stars 92 forks source link

Upgrade to TinyMCE 5 #675

Closed chillu closed 1 year ago

chillu commented 5 years ago

Overview

As at the time of writing, the CMS is running version 4.6.5 of TinyMCE while there is a new major version (v5).

https://www.tiny.cloud/docs/general-configuration-guide/system-requirements/#supportedtinymceversions

Notes

robbieaverill commented 5 years ago

Looks awesome. I might finally start to like WYSIWYG editors =D

TheSpyder commented 5 years ago

Glad you like it! We released the dev preview to get some early API feedback as early as we can, I’m anticipating we will reach beta in a few weeks.

Let us know if there’s anything we can help with!

robbieaverill commented 5 years ago

Noting that we should start looking at implementing the official TinyMCE React library at some point, and this seems like a sensible ticket to attach that upgrade to.

The example storybook looks like it's running a version of v5 already. @TheSpyder are you able to confirm whether the tinymce-react library is running TinyMCE v5? The package.json version is 2.4, which doesn't help me much =)

TheSpyder commented 5 years ago

@robbieaverill that storybook is still running v4.

Our react library, out of the box, loads from the TinyMCE cloud and v5 isn't the default there yet. It should be possible to use v5 with the react library (the documentation explains how to use your own TinyMCE version). Full testing of the library with v5 is scheduled closer to the release, but the library doesn't have a large API surface so it should work fine.

christopherdarling commented 5 years ago

Just a heads up, TinyMCE v5 is now stable - https://go.tiny.cloud/blog/tinymce-5-power-meets-beauty/

TheSpyder commented 5 years ago

Stable, and we’ve done three bug fix releases already :)

wilr commented 5 years ago

@chillu any progress on this one and if it's likely to hit in SilverStripe 4 or would be targeted at SilverStripe 4?

Running into a few issues with the outdated version of TinyMCE within SilverStripe (e.g https://github.com/tinymce/tinymce/issues/3276)

ScopeyNZ commented 5 years ago

Provided it can be implemented in a non-breaking way with the PHP API (pretty certain this is doable) then there's no reason it can't be in 4.5. We're not due to release that for a few months yet though. Happy to receive contributions - I don't think this is on our radar...

wilr commented 5 years ago

Thanks @ScopeyNZ happy to contribute it. I think the issue above will be a blocker for our go-live on SS4 so didn't want to wait. I'll give it a crack 💪

wilr commented 5 years ago

WIP is on my fork. Screenshot of what it looks out of the box @clarkepaul happy with this or do we want to theme to fit into SilverStripe styles now.

Screen Shot 2019-08-06 at 2 10 45 PM

clarkepaul commented 5 years ago

Na doesn't need theming, I think its more important to get the right default actions in place (ensure there is a like for like). I see a few actions that I'm not familiar with in there. Really good to see the full-screen edit in there and might be a few to remove by default. Do you know if we can re-arrange or limit actions in smaller views @wilr ?

TheSpyder commented 5 years ago

Which action is showing the bomb (in between image and code on the second toolbar line)? That's our placeholder for unknown icon.

wilr commented 5 years ago

@TheSpyder "Insert new media from the web" our custom plugin for oembed. I'll need to see why our icon isn't displaying.

TheSpyder commented 5 years ago

Oh, it's custom. Of course. I expect it's because we only support SVG icons in v5 - but we have had plenty of requests to allow other image formats (particularly since v4 didn't restrict this) so our designer has agreed to plan for opening that up.

ScopeyNZ commented 5 years ago

I'm completely in favour of limiting the supported icon format to SVG. It's nice to encourage people not to use PNGs or some icon font. @silverstripeux might be able to provide any required SVGs.

patricknelson commented 4 years ago

Big +1 on finally moving forward with SVG's and ensuring we have backward compatibility with existing SS v4 API. Only minor issue with that might be the icons and reconciling that with backward compatibility in the CMS since this isn't a major version change on our end.

I'm more for graceful degradation in this respect. For example, say you're working on upgrading SS v4.4 to SS v4.5 and you find that now custom icons are now missing and didn't realize it until after you went into production. I'd rather have those ugly old school pixelated icons there and working, find out later and queue it up as a hotfix later than have it effectively break for end users.

chillu commented 4 years ago

@wilr Are you still working on this? How far away from a PR are ya? I'm assuming it's intended as a replacement in core, as opposed to an opt-in module, given how much core UI is tied around TinyMCE?

wilr commented 4 years ago

Yep it's intended to replace the current TinyMCE 4. Will aim to finish this off next week for review (WIP is at https://github.com/silverstripe/silverstripe-admin/pull/923) I had it at enough a working state for our use case but that didn't include some of the media things.

GuySartorelli commented 1 year ago

CMS 5 uses tinymce 6