From 81e21e08e3ca831efed616eca50cf76c5a195701 Mon Sep 17 00:00:00 2001 From: Fabian Braun Date: Tue, 19 Mar 2024 01:26:10 +0100 Subject: [PATCH] Update readme --- CHANGELOG.rst | 317 +------------------------------------ README.rst | 18 ++- djangocms_text/__init__.py | 2 - gulpfile.js | 179 --------------------- 4 files changed, 13 insertions(+), 503 deletions(-) delete mode 100644 gulpfile.js diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 5275137a..842da2c1 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,319 +2,8 @@ Changelog ========= -5.1.5 (2023-11-30) -================== - -* fix(settings): Extend ALLOW_TOKEN_PARSERS if custom one is provided by @DmytroLitvinov in `#654 `_ -* fix: Support djangocms-picture 2.0.0 and higher in create_picture_plugin by @leture in `#660 `_ -* Remove Flash plugin in the default settings by @MacLake in `#656 `_ -* fix: Allow for request-free context objects for testing purposes by @fsbraun in `#659 `_ -* Update test matrix to include Django 5 by @protoroto in `#662 `_ - - -5.1.4 (2023-10-03) -================== - -* fix: Issue #641 which lead to disappearing content after adding child plugins and cancelling the edit by @fsbraun in `#652 `_ -* Feature/issue 648 unable to unlink by @jrief in `#649 `_ -* fix: Remove legacy code from Django pre 1.4 by @fsbraun in `#651 `_ -* fix: test suite for Django 2.2 by @fsbraun in `#650 `_ - -5.1.3 (2022-06-21) -================== - -* Upgrade Ckeditor to 4.21.0 via `#640 `_ - - -5.1.2 (2022-12-27) -================== - -* Add suport for django CMS 4.1 -* Fix `#468 `_ via `#637 `_: Delay importing models.CmsPlugin in utils to allow adding an HTMLField to a custom user model. - - -5.1.1 (2022-06-22) -================== - -* Removed inline editing toggle button from touch devices (where it is inactive anyways) and collapsed menus -* Add workaround for toolbar bug in django CMS < 3.10: Reload page after change in inline editor -* Fix `578 `_: If parent plugins to not set body css class the default from CKEDITOR_SETTINGS is used - -5.1.0 (2022-03-24) -================== - -* Added inline editing in `#606 `_ -* fix: Update skin patch to avoid @media query in `#614 `_ - -5.0.1 (2022-03-24) -================== - -* Generated new static bundle. - -5.0.0 (2022-03-24) -================== - -* Drop support for Python 3.5 and 3.6 -* Drop support for django 3.0 -* Added support for Python 3.9 and 3.10 -* Added support for django 3.2 -* Added support for django-cms 3.9 and 3.10 - -New features ------------- -* Upgrade ckeditor to 4.17.2 in `595 `_ -* Dark mode support for standard editor UI (a.k.a. "skin") moono-lisa in `592 `_ -* Basic dark mode compatibility and fix for source edit bug in `590 `_ - -Fixes and other changes ------------------------ -* Copying plugins inside ckeditor creates a child plugin copy in `569 `_ -* 504 copy paste plugins inside ckeditor refer to same instance in `572 `_ -* Use assertEqual instead of assertEquals for Python 3.11 compatibility in `580 `_ -* fix breaking tests in `585 `_ -* Update Node.js to version 16 LTS and Gulpfile upgrade as well in `593 `_ -* Replace ``force_text`` with ``force_str`` in `546 `_ -* Fix django 3.2 tests, pypi release actions and pre-commit in `594 `_ -* Remove excessive spaces (`#531 `_) in `597 `_ - -4.0.0 (2020-09-15) -================== - -* Added support for Django 3.1 -* Dropped support for Python 2.7 and Python 3.4 -* Dropped support for Django < 2.2 -* Ensure that correct urls are generated when static files are hosted on a CDN -* Allow to style WYSIWYG content based on parent plugins, by adding - ``CMSPluginBase.child_ckeditor_body_css_class`` to a parent (#520) -* Upgrade to CKeditor version to 4.14.1 - - -3.10.0 (2020-08-04) +0.1.0 (First alpha) =================== -* Upgrade to CKeditor version 4.14.0. -* Replace icon for CMS plugins with nicer looking SVG puzzle piece. -* Prevent ``clean_html`` from sanitizing when TEXT_HTML_SANITIZE is False. - - -3.9.1 (2020-05-20) -================== - -* Fix compatibility issue with Django-3.0 in ``Field.from_db_value()``. - - -3.9.0 (2020-02-20) -================== - -* Added support for Django 3.0 -* Added support for Python 3.8 -* Removed Aldryn Boilerplate support - - -3.8.0 (2019-05-23) -================== - -* Added support for Django 2.2 and django CMS 3.7 -* Removed support for Django 2.0 -* Extended test matrix -* Added isort and adapted imports -* Adapted code base to align with other supported addons -* Updated translations - - -3.7.0 (2018-12-05) -================== - -* Added support for Django 1.11, 2.0 and 2.1 -* Removed support for Django < 1.11 -* Adapted testing infrastructure (tox/travis) to incorporate - django CMS 3.5 and 3.6 - - -3.6.1 (2018-11-08) -================== - -* Added Django 2.0 & 2.1 support -* Updated setup.py to use html5lib>=0.999999999 -* Fixed ValueError on static file resolution at import time - - -3.6.0 (2018-04-11) -================== - -* Changed the way ckeditor widget is initialized - - -3.5.3 (2018-01-29) -================== - -* Updated CKEditor to 4.7.3 -* Added context to translation payload when dealing with TextPlugin instances - - -3.5.1 (2017-10-17) -================== - -* Introduced support for django CMS 3.5.0 -* Fixed a regression which prevented multiple HTMLFields - from having different configurations. -* Fixed a bug where text coming from ``HtmlField`` was escaped - when using it with other third party apps like django-parler. -* Fixed a bug where dialog backdrop would've been incorrectly removed allowing - for disallowed actions. -* Fixed a bug when a dialog would open underneath maximized editor. - - -3.5.0 (2017-05-03) -================== - -* Fixed an issue where the rendered HTML of plugins nested in text plugins - leaked and became editable in some cases. -* Updated CKEditor to 4.6.2 - - -3.4.0 (2017-01-23) -================== - -* Introduced support for the djangocms-history app. -* Fixed an issue when CKEditor was triggering unnecessary `delete-on-cancel` - requests after editing a plugin. -* Fixed a bug which raised an exception when using a lazy object on the plugin - configuration. - - -3.3.1 (2016-11-02) -================== - -* Fixed an issue with maximized CKEditor inside of maximized CMS modal in FF -* Fixed path to the icon in the context menu -* Fixed JavaScript error happening when certain fields wouldn't exist in child - plugin -* Fixed an issue with CKEditor dialogs going outside of the ckeditor area, which - was making them unusable -* Fixed an issue when only the first selected text would be populated to the - title field in supported child plugins - - -3.3.0 (2016-10-04) -================== - -* Fixed a problem with editing links that are not CMS plugins -* Fixed a problem with prefilling fields when editing CMS plugins -* Fixed a bug with extra whitespace appearing around plugin rendered inside of - the text plugin -* Updated CKEditor to 4.5.11 -* Fixed JavaScript error thrown when multiple instances of TextField are used on - the page -* Fixed CKEditor not initializing inside of the ``inline``. - - -3.2.1 (2016-09-14) -================== - -* Changed the way ckeditor js is loaded, everything is now loaded in one bundle -* Changed the way ckeditor loads must-have external plugins, so user config - would have no effect on the settings -* Fixed error which prevented plugins extending TextPlugin to work -* Fixed a regression where CKEditor would create unnecessary ``

`` tags around - CMS plugins -* Fixed a bug when child plugin cannot be edited while text plugin is not - completely created -* Fixed a bug where plugins rendered via the real-preview would not trigger - the context processors. - - -3.2.0 (2016-09-07) -================== - -* Introduced support for djangoCMS 3.4.0 -* Fixed a JavaScript issue when using TextEditorWidget or HTMLField -* Added native Aldryn support -* Fixed a bug where invalid markup created by previous versions of the plugin - would result in a broken markup after upgrading -* Fixed a bug where whitespace would be incorrectly removed before the child - plugin on save of the text plugin - - -3.1.0 (2016-08-18) -================== - -* Added support for inline preview of text enabled CMS plugins -* Added support for plugins to declare "text_editor_preview=False" in order for - them to be rendered with old-style label (useful for plugins with no valuable - visual representation, such as snippet, spacer, etc). - - -3.0.1 (2016-07-15) -================== - -* Replace remaining CMS base module with CMS admin bundle that was missed in - 2.8.0 -* Updated ckeditor to 4.5.9 -* Freeze html5lib-python<0.99999999/1.0b9 - - -3.0.0 (2016-05-26) -================== - -* Added support for django CMS 3.3 -* Backwards incompatible with django CMS < 3.3 - - -2.9.3 (2016-04-27) -================== - -* Adds work-around for Django Parler internal caching - - -2.9.2 (2016-04-26) -================== - -* Adds HtmlFormField -* Moves text sanitation logic to the HtmlFormField -* Text coming from an HTMLField is now marked safe by default. - - -2.9.1 (2015-03-29) -================== - -* Fixes backwards compatibility with Django 1.6 -* Fixes bug on Text.objects.create() - - -2.9.0 (2015-03-04) -================== - -* fix field name clashes with in Django 1.9 - - -2.8.1 (2015-12-30) -================== - -* Fixes DatabaseError on newer CMS releases. -* Adds setting to override Text plugin name -* Adds setting to override Text plugin module name. - - -2.8.0 (2015-11-19) -================== - -* Add touch support for CKEditor dialogs -* Add possibility to edit nested plugins on touch devices -* Replace CMS base module with CMS admin bundle (will only work with CMS 3.2+) -* Update CKEditor to 4.5.4 -* Set the property `disable_child_plugins` to the Plugin class, deprecate the - existing property on the model class. - - -2.7.0 (2015-11-03) -================== - -* Plugin is now only compatible with Django 1.6+, for Django 1.4 and 1.5 use - ``djangocms-text-ckeditor`` < 2.7 - - -2.0.0 (2013-07-10) -================== - -* Plugin is now only compatible with djangoCMS 3+ +* Initial release for testing +* Basic functionality for TipTap editor diff --git a/README.rst b/README.rst index bfa484b6..584c90b7 100644 --- a/README.rst +++ b/README.rst @@ -48,8 +48,8 @@ Add an editor frontend to your installed apps, and set the editor you want to us .. code-block:: python - INSTALLED_APPS = [..., "djangocms_text.contrib.text_tiptap", ...] - DJANGOCMS_TEXT_EDITOR = "djangocms_text.contrib.text_tiptap.tiptap" + INSTALLED_APPS = [..., "djangocms_text.contrib.text_ckeditor5", ...] + DJANGOCMS_TEXT_EDITOR = "djangocms_text.contrib.text_ckeditor5.ckeditor5" Usage ----- @@ -65,14 +65,16 @@ Editors ``djangocms-text`` supports multiple rich text editors, which can be swapped out as needed. The following editors are currently supported: +- **TipTap**: A modern rich text editor with a modular architecture, TipTap is currently + in development and is the default editor. TipTap does not allow the user to edit + HTML directly, which means that some formating options are lost when switching from + CKEditor 4 to TipTap. - **CKEditor 4**: The initial version of ``djangocms-text`` includes a port of the CKEditor 4 interface and child plugin functionality. This editor is compatible with the ``djangocms-text-ckeditor`` plugin, and can be used as a drop-in replacement. -- **TipTap**: A modern rich text editor with a modular architecture, TipTap is currently - in development and might be supported in a future release of ``djangocms-text`` or as - a separate package. - **CKEditor 5** (currently no text-enabled plugins): The current version of CKEditor might be - supported in a future release of ``djangocms-text`` or as a separate package. + supported in a future release of ``djangocms-text`` or as a separate package. Its current + imlementation does not support text-enabled plugins or dynamic attributes. - **TinyMCE** (currently no text-enabled plugins): A popular open-source rich text editor, TinyMCE is currently in development and might be supported in a future release of ``djangocms-text`` or as a separate package. @@ -207,8 +209,8 @@ Building the JavaScript ``djangocms-text`` distributes a javascript bundle required for the plugin to work, which contains frontend editors themselves and all the necessary plugins for functioning -within CMS. To build the bundle you need to have to install dependencies with ``nvm -use``, ``npm install`` and then to run ``webpack``. +within CMS. To build the bundle you need to have to install dependencies with +``nvm use``, ``npm install`` and then to run ``webpack``. Acknowledgments --------------- diff --git a/djangocms_text/__init__.py b/djangocms_text/__init__.py index b567e1a4..5e587b08 100644 --- a/djangocms_text/__init__.py +++ b/djangocms_text/__init__.py @@ -17,5 +17,3 @@ 11. Github actions will publish the new package to pypi """ __version__ = "0.1.0" - -default_app_config = "djangocms_text.apps.TextConfig" diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index ab384ec9..00000000 --- a/gulpfile.js +++ /dev/null @@ -1,179 +0,0 @@ -'use strict'; - -const gulp = require('gulp'); -const gulpif = require('gulp-if'); -const sourcemaps = require('gulp-sourcemaps'); -const concat = require('gulp-concat'); -const uglify = require('gulp-uglify'); -const eslint = require('gulp-eslint'); -const plumber = require('gulp-plumber'); -const replace = require('gulp-replace'); -const revReplace = require('gulp-rev-replace'); -const rev = require('gulp-rev'); -const runSequence = require('run-sequence'); -const filter = require('gulp-filter'); -const del = require('del'); -const integrationTests = require('djangocms-casper-helpers/gulp'); -const path = require('path'); -const child_process = require('child_process'); -const execSync = child_process.execSync; -const browserSync = require('browser-sync').create(); - - -const argv = require('minimist')(process.argv.slice(2)); - -const options = { - debug: argv.debug -}; -const PROJECT_ROOT = __dirname + '/djangocms_text_ckeditor/static/djangocms_text_ckeditor'; -const PROJECT_PATH = { - js: PROJECT_ROOT + '/js', - tests: __dirname + '/djangocms_text_ckeditor/tests/frontend' -}; - -const PROJECT_PATTERNS = { - js: [ - PROJECT_PATH.js + '/**/*.js', - PROJECT_PATH.js + '/../ckeditor_plugins/**/*.js', - '!' + PROJECT_PATH.js + '/pre.js', - '!' + PROJECT_PATH.js + '/post.js', - '!' + PROJECT_PATH.js + '/../ckeditor_plugins/cmsresize/*.js', - '!' + PROJECT_PATH.js + '/../ckeditor_plugins/cmsdialog/*.js', - '!' + PROJECT_PATH.js + '/../ckeditor/**/*.js', - '!' + PROJECT_PATH.js + '/dist/*.js' - ] -}; - -/* - * Object keys are filenames of bundles that will be compiled - * from array of paths that are the value. - */ -const JS_BUNDLE = [ - PROJECT_PATH.js + '/pre.js', - PROJECT_PATH.js + '/cms.ckeditor.js', - PROJECT_PATH.js + '/../ckeditor/ckeditor.js', - PROJECT_PATH.js + '/../ckeditor_plugins/cmswidget/plugin.js', - PROJECT_PATH.js + '/../ckeditor_plugins/cmsdialog/plugin.js', - PROJECT_PATH.js + '/../ckeditor_plugins/cmsresize/plugin.js', - PROJECT_PATH.js + '/../ckeditor_plugins/cmsplugins/plugin.js', - PROJECT_PATH.js + '/post.js' -]; - -const lint = () => { - return ( - gulp - .src(PROJECT_PATTERNS.js) - .pipe(gulpif(!process.env.CI, plumber())) - .pipe(eslint()) - .pipe(eslint.format()) - .pipe(eslint.failAfterError()) - .pipe(gulpif(!process.env.CI, plumber.stop())) - ); -}; - -const INTEGRATION_TESTS = [ - ['smoke'] -]; - -// gulp tests:integration [--clean] [--screenshots] [--tests=loginAdmin,toolbar] -const pathToBin = child_process.execSync('npm bin').toString().trim(); -const pathToCasper = path.join(pathToBin, 'casperjs'); - -gulp.task('tests:integration', integrationTests({ - tests: INTEGRATION_TESTS, - pathToTests: PROJECT_PATH.tests, - argv: argv, - dbPath: 'testdb.sqlite', - serverCommand: 'tests/settings.py', - logger: console.log.bind(console), // eslint-disable-line no-console - waitForMigrations: 10, - pathToCasper: pathToCasper -})); - -gulp.task('bundle', function (done) { - runSequence('bundle:cleanup:before', 'bundle:js', 'bundle:template', 'bundle:cleanup', done); -}); - - -// gulp.task('bundle:cleanup:before', function () { -const bundleCleanUpBefore = () => { - return ( - del([PROJECT_PATH.js + '/dist/']) - ); -}; - -const bundleJS = () => { - const f = filter([ - '**', - '!**/ckeditor/ckeditor.js', - '!**/pre.js', - '!**/post.js' - ], { restore: true }); - - return ( - gulp - .src(JS_BUNDLE) - .pipe(gulpif(options.debug, sourcemaps.init())) - .pipe(f) - .pipe(gulpif(!options.debug, uglify({ - preserveComments: 'some' - }))) - .pipe(f.restore) - .pipe(concat('bundle.cms.ckeditor.min.js', { - newLine: '\n' - })) - .pipe(rev()) - .pipe(gulpif(options.debug, sourcemaps.write())) - .pipe(gulp.dest(PROJECT_PATH.js + '/dist/')) - .pipe(rev.manifest()) - .pipe(gulp.dest(PROJECT_PATH.js + '/dist/')) - ); -}; - - -const bundleTemplate = () => { - - const manifest = gulp.src(PROJECT_PATH.js + '/dist/rev-manifest.json'); - - return ( - gulp - .src([PROJECT_ROOT + '/../../widgets.py']) - .pipe(replace( - /bundle\-*.cms.ckeditor.min.js/, - 'bundle.cms.ckeditor.min.js' - )) - .pipe(gulp.dest(PROJECT_ROOT + '/../../')) - .pipe(revReplace({ - manifest: manifest, - replaceInExtensions: ['.py'] - })) - .pipe(gulp.dest(PROJECT_ROOT + '/../../')) - ); -}; - -const patchForDarkmode = async function(){ - console.log( execSync('cd private && python3 ./patch_moono_lisa.py').toString()); -}; - - -const bundleCleanup = () => { - return ( - del([PROJECT_PATH.js + '/dist/rev-manifest.json']) - ); - -}; - -const watchFiles = () => { - browserSync.init(); - gulp.watch(PROJECT_PATTERNS.js, lint); - gulp.watch(JS_BUNDLE, gulp.series(bundleCleanUpBefore, bundleJS, bundleTemplate, bundleCleanup)); -}; - -gulp.task('ci', lint); -// gulp.task('default', ['lint', 'bundle', 'watch']); - -gulp.task("lint", lint); -gulp.task("watch", watchFiles); -gulp.task("darkmode", patchForDarkmode); -gulp.task("bundle", gulp.series(bundleCleanUpBefore, bundleJS, bundleTemplate, bundleCleanup)); -gulp.task("build", gulp.series(bundleCleanUpBefore, bundleJS, bundleTemplate, patchForDarkmode, bundleCleanup));