Skip to content

parttio/tinymce-for-flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

187 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinyMCE for Flow

A Vaadin 25 Java integration for TinyMCE 7, a popular open-source rich text editor. The component implements HasValue and works with Vaadin's data binding. Content value is plain HTML.

Usage

Add the dependency to your pom.xml:

<dependency>
    <groupId>org.parttio</groupId>
    <artifactId>tinymce-for-flow</artifactId>
    <version>5.0.0</version>
</dependency>

Create and use the editor:

TinyMce editor = new TinyMce();
editor.setValue("<p>Hello, world</p>");

// Or use a preconfigured setup
TinyMce basicEditor = new TinyMce()
    .configureToolbar(true, Toolbar.BOLD, Toolbar.ITALIC, Toolbar.UNDERLINE)
    .configurePlugin(true, Plugin.LISTS);

Limitations

TinyMCE 7 defaults to sandboxing any iframes in editor content with sandbox_iframes: true. If your content includes iframes and they appear broken, disable sandboxing:

editor.configure("sandbox_iframes", false);

If you cannot trust your users' HTML input, apply a converter that filters it (e.g., using the JSOUP library) before storing or displaying it.

Upgrade Guide

When upgrading to version 5.x (Vaadin 25 / TinyMCE 7):

  • Java 21 and Vaadin 25 are now required
  • Plugin.ADVLIST is no longer needed — the lists plugin handles it automatically
  • Plugin.TEMPLATE and Plugin.TABFOCUS are removed in TinyMCE 7
  • Toolbar.FONTNAME has been renamed to Toolbar.FONT_FAMILY; new Toolbar.FONT_SIZE_INPUT is available
  • sandbox_iframes defaults to true — note if iframe content looks broken
  • Dialog usage: no special configuration needed anymore

Development

Starting the demo server

mvn spring-boot:run -pl . -Dspring-boot.run.main-class=org.vaadin.tinymce.Application

Demo views are @Route-annotated classes in src/test/java. Access them at http://localhost:8080.

Running tests

mvn test                                   # Run all tests
mvn test -Dtest=MopoSmokeTest              # Run a specific test class

Tests use Spring Boot with Playwright (via Mopo) for browser-based E2E testing.

Release Process

To tag a release and increment versions:

mvn release:prepare release:clean

Answer the prompts (defaults are usually fine). A GitHub Action automatically builds and deploys the release to Maven Central.

Tiny 6 support

TinyMCE 6 is gone for a while now, so we decided to move on, too.

If you need Tiny 6 for license reasons, please have a look at HugeRTE, which is a fork of Tiny 6 and community maintained. Check out the Flow Addon for HugeRTE.

If HugeRTE is not an option, you can create your own version of this addon based on the v25_tiny6 branch.

About

TinyMCE wrapper for Vaadin 10+

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors