github xdan/jodit 4.0.1
4.0

latest releases: 4.2.41, 4.2.40, 4.2.39...
10 months ago

4.0

💥 Breaking Change

  • All static methods of the Jodit.modules.Table module have been removed and replaced with methods of an instance of the Table class with the same name.

    const jodit = Jodit.make('#editor');
    
    // Before
    Jodit.modules.Table.mergeSelected(jodit.editor.firstChild, jodit);
    
    // Now
    jodit.getInstance('Table').mergeSelected(jodit.editor.firstChild);
  • .jodit-filebrowser class prefix was renamed to .jodit-file-browser

  • CSS key --color-background-filebrowser-folders was removed from global scope.

  • Removed deprecated selection.applyStyle method

  • Changed Create.sandbox signature to return body,iframe tuple

  • In the plugin system, the requires field has been removed from instances,
    only the field in the constructor has been left

    class somePlugin extends Jodit.modulules.Plugin {
    	static requires = ['hotkeys']; // It still works
    	requires = ['hotkeys']; // Now it does not work
    }
  • Deprecated were removed

  • Dom.isTag does not support array

  • Select.applyStyle method was removed

  • history.observer was removed

  • editorCssClass removed

  • wrapNodes.exclude changed from array to set

  • allowResizeTags changed from array to set

  • resizer.useAspectRatio changed from array to set

  • All css variables renamed to kebab-case

  • Remove all languages from lang/index.js for ESM build

  • Only base plugins list in plugins/index.js for ESM build

  • Remove polyfills from ESM build

  • Remove composer.json

  • !!! Build files removed from repository and only available in npm package !!!

  • !!! bowers.json was removed !!!

  • server.js was removed

  • All build js files was rewritten to typescript

  • build-system was renamed as tools

  • Removed exludeLangs build option. Instead use --includeLanguages=en option.

  • Default target for build was changed to es2015

  • Build in es2018 target was removed, instead es2021 was added

  • Event getIcon was removed. Use option getIcon instead

Jodit.make('#editor', {
	getIcon: (name: string, clearName: string) => {
		if (name === 'bold') {
			return '<svg>...</svg>';
		}

		return null;
	}
});
  • Removed errorMessage event. Use module.messages instead

    Jodit.make('#editor').message.info('Hello world');
  • Removed Jodit.modules.Helpers.val method

🚀 New Feature

  • Improved UX of dialog boxes. Added two options closeOnEsc defaulting to true and closeOnClickOverlay defaulting to false.

    Jodit.make('#editor', {
    	dialog: {
    		closeOnEsc: true,
    		closeOnClickOverlay: false
    	}
    });
    // or
    const editor = Jodit.make('#editor');
    editor.alert('Hello world'); // closeOnEsc = true, closeOnClickOverlay = true
    editor
    	.dlg({
    		closeOnEsc: false,
    		closeOnClickOverlay: true
    	})
    	.open();
  • The Jodit.getInstance method can accept a module constructor instead of its name:

    const jodit = Jodit.make('#editor');
    const table = jodit.getInstance(Jodit.modules.Table);
    const table2 = jodit.getInstance('Table'); // It still works
    console.log(table === table2); // true
  • Even though I disable some editor plugins, they are displayed on mobile #243

  • Introduced the pasteExcludeStripTags option. This is a list of tags that won't be removed from the pasted HTML
    when in INSERT_AS_TEXT mode. By default, it includes ['br', 'hr'].
    See #1033 for more details.

    Jodit.make('#editor', {
    	pasteExcludeStripTags: ['br', 'style']
    });
  • copy pasting twitter or istagram or etc not as expected #1032

  • When cursor is not in view and paste is done, editor doesn't scroll to the pasted content automatically #983
    Added scrollToPastedContent

  • After inserting the HTML, the cursor will be inserted inside the block element

  • Added Jodit.modules.Dom.isList method

  • Added Jodit.modules.Dom.isLeaf method

  • Added plugin delete for correct delete content with command delete

🐛 Bug Fix

🏠 Internal

  • Fixed colors for selected toolbar elements in the dark theme
@types/ace                         ^0.0.50  →   ^0.0.52
@types/fs-extra                    ^11.0.3  →   ^11.0.4
@types/karma                        ^6.3.6  →    ^6.3.8
@types/node                        ^20.8.7  →  ^20.10.3
@types/postcss-css-variables       ^0.18.2  →   ^0.18.3
@types/yargs                      ^17.0.29  →  ^17.0.32
@typescript-eslint/eslint-plugin    ^6.8.0  →   ^6.13.2
@typescript-eslint/parser           ^6.8.0  →   ^6.13.2
axios                               ^1.5.1  →    ^1.6.2
core-js                            ^3.33.1  →   ^3.34.0
eslint                             ^8.52.0  →   ^8.55.0
eslint-config-prettier              ^9.0.0  →    ^9.1.0
eslint-plugin-import               ^2.28.1  →   ^2.29.0
node-jq                             ^4.0.1  →    ^4.2.2
postcss                           >=8.4.31  →  >=8.4.32
prettier                            ^3.0.3  →    ^3.1.0
stylelint-prettier                  ^4.0.2  →    ^4.1.0
ts-loader                           ^9.5.0  →    ^9.5.1
typescript                          ^5.2.2  →    ^5.3.2
  • Fixed a bug in the UITextArea UI component. Instead of adding a textarea element, it was incorrectly adding an input element.

  • Calls to setTimout without the async module have been removed from autotests, and most of the asynchronous tests have been rewritten from done to async/await

  • Update dependencies

     stylelint-config-idiomatic-order    v9.0.0  →   v10.0.0
     stylelint-config-standard          ^34.0.0  →   ^36.0.0
     stylelint-prettier                  ^4.1.0  →    ^4.4.0
     terser-webpack-plugin               ^5.3.9  →   ^5.3.10
     ts-node                            ^10.9.1  →   ^10.9.2
     typescript                          ^5.3.2  →    ^5.3.3
     webpack-dev-middleware              ^6.1.1  →    ^7.0.0
     webpack-hot-middleware             ^2.25.4  →   ^2.26.0
    
@types/node                       ^18.13.0  →  ^18.15.12
@typescript-eslint/eslint-plugin   ^5.50.0  →    ^5.59.0
@typescript-eslint/parser          ^5.50.0  →    ^5.59.0
autoprefixer                      ^10.4.13  →   ^10.4.14
axios                               ^1.3.3  →     ^1.3.6
core-js                            ^3.28.0  →    ^3.30.1
css-minimizer-webpack-plugin        ^4.2.2  →     ^5.0.0
cssnano-preset-advanced             ^5.3.9  →     ^6.0.0
eslint                             ^8.34.0  →    ^8.38.0
eslint-config-prettier              ^8.6.0  →     ^8.8.0
expect-mocha-image-snapshot         ^3.0.1  →    ^3.0.13
glob                                ^8.1.0  →    ^10.2.1
karma-chrome-launcher               ^3.1.1  →     ^3.2.0
lint-staged                        ^13.1.2  →    ^13.2.1
mini-css-extract-plugin             ^2.7.2  →     ^2.7.5
postcss                           >=8.4.21  →   >=8.4.23
postcss-css-variables              ^0.18.0  →    ^0.19.0
postcss-loader                      ^7.0.2  →     ^7.2.4
prettier                            ^2.8.4  →     ^2.8.7
puppeteer                          ^19.7.0  →   ^19.10.0
style-loader                        ^3.3.1  →     ^3.3.2
stylelint                          ^15.1.0  →    ^15.5.0
stylelint-config-standard          ^30.0.1  →    ^33.0.0
stylelint-prettier                  ^2.0.0  →     ^3.0.0
terser-webpack-plugin               ^5.3.6  →     ^5.3.7
tsc-alias                           ^1.8.2  →     ^1.8.5
typescript                          ^4.9.5  →     ^5.0.4
webpack                             5.76.0  →     5.80.0
webpack-dev-middleware              ^6.0.1  →     ^6.0.2
webpack-dev-server                 ^4.11.1  →    ^4.13.3
yargs                              ^17.6.2  →    ^17.7.1

Don't miss a new jodit release

NewReleases is sending notifications on new releases.