@themarioga/grid-editor 7.1.0 → 7.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,28 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
5
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
 
8
+ ## [7.2.0] - 2026-09-29
9
+
10
+ ### Changed
11
+ - **BREAKING:** The CKEditor integration is CKEditor 5, and the example and
12
+ the tests use CKEditor 48.5.2, the latest release and one with no known
13
+ advisories. CKEditor 4.22.1 has five (GHSA-fq6h-4g8v-qqvm,
14
+ GHSA-6v96-m24v-f58j, GHSA-7r32-vfj5-c2jv, GHSA-wh5w-82f3-wrxh,
15
+ GHSA-mw2c-vx6j-mg76), and every CKEditor 4 with them fixed is commercial.
16
+ CKEditor 5 is GPL-2.0-or-later, and does not start without a `licenseKey`
17
+ in `ckeditor.config`: `'GPL'`, or a commercial key. `ckeditor.config` is
18
+ CKEditor 5's; the plugin gives it plugins, a toolbar and h1 to h6 headings
19
+ when the config has none, and still calls `on.instanceReady`. The content
20
+ type is still `ckeditor`, so saved markup loads as it is, and the `ck-*`
21
+ classes CKEditor 5 puts on a content area stay out of it. See
22
+ [UPGRADING.md](UPGRADING.md).
23
+
24
+ ### Added
25
+ - `error.ckeditor_start`, logged when CKEditor 5 cannot start, and
26
+ `warning.ckeditor_plugin`, for a plugin name the config gives that CKEditor
27
+ does not have.
28
+
29
+
8
30
  ## [7.1.0] - 2026-09-29
9
31
 
10
32
  ### Changed
package/README.md CHANGED
@@ -48,7 +48,7 @@ Installation
48
48
  * __Dependencies:__ Grid Editor depends on [SortableJS](https://sortablejs.github.io/Sortable/), Bootstrap Icons, and Bootstrap 5, so make sure you have included those in the page. It does not need jQuery since 7.0.
49
49
  * If you want to use the tinyMCE integration, include tinyMCE 7 (7.9.3 or later) as well, and `dist/plugins/grideditor.tinymce.min.js` after the editor.
50
50
  * If you want to use the summernote integration, include summernote and `dist/plugins/grideditor.summernote.min.js`. Summernote needs jQuery itself, so that page loads jQuery too; nothing else does.
51
- * If you want to use the CKEditor integration... you get the point: CKEditor and `dist/plugins/grideditor.ckeditor.min.js`.
51
+ * If you want to use the CKEditor integration... you get the point: CKEditor 5's browser build (`ckeditor5.umd.js` and `ckeditor5.css`) and `dist/plugins/grideditor.ckeditor.min.js`. CKEditor 4 is no longer supported.
52
52
  * Up to 5.x the main bundle carried a copy of the three; since 6.0 the plugin of the editor you use has to be loaded, as above. See [UPGRADING.md](UPGRADING.md).
53
53
  * From npm:
54
54
 
@@ -825,7 +825,7 @@ same way, `codemirror.config` included, and a textarea without it.
825
825
  Grid editor comes with support for the following rich text editors (RTEs), each a plugin of its own to load after the editor:
826
826
  * [TinyMCE](http://www.tinymce.com/) 7 - `dist/plugins/grideditor.tinymce.min.js` - [(example)](example/basic.html)
827
827
  * [summernote](http://summernote.org/) 0.9 - `dist/plugins/grideditor.summernote.min.js` - [(example)](example/summernote.html)
828
- * [CKEditor](http://ckeditor.com/) 4 - `dist/plugins/grideditor.ckeditor.min.js` - [(example)](example/ckeditor.html)
828
+ * [CKEditor](http://ckeditor.com/) 5 - `dist/plugins/grideditor.ckeditor.min.js` - [(example)](example/ckeditor.html)
829
829
 
830
830
  A text editor is chosen by `content_types`, not by the `plugins` setting: a page
831
831
  that names its containers in `plugins` still has its editor. Summernote 0.9.1
@@ -842,18 +842,47 @@ new GridEditor('#myGrid', {
842
842
  });
843
843
  ```
844
844
 
845
- __`ckeditor.config`:__ Specify ckeditor config, when using the `ckeditor` `content_types`.
846
- See the [CKEditor documentation](http://docs.ckeditor.com/).
845
+ __`ckeditor.config`:__ Specify CKEditor 5 config, when using the `ckeditor` `content_types`:
846
+ anything `InlineEditor.create` takes. See the [CKEditor documentation](https://ckeditor.com/docs/ckeditor5/latest/).
847
847
  Also check out the [ckeditor example](example/ckeditor.html).
848
848
 
849
+ Load CKEditor 5's browser build, which puts it on the page as `window.CKEDITOR`:
850
+
851
+ ```html
852
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ckeditor5@48.5.2/dist/browser/ckeditor5.css">
853
+ <script src="https://cdn.jsdelivr.net/npm/ckeditor5@48.5.2/dist/browser/ckeditor5.umd.js"></script>
854
+ ```
855
+
856
+ CKEditor 5 does not start without a `licenseKey`: pass `'GPL'` to accept its
857
+ GPL-2.0-or-later licence, or your own key if you have a commercial licence.
858
+ Grid editor does not pass one for you, since the licence is yours to choose,
859
+ and logs `CKEditor could not start: license-key-missing` when there is none.
860
+ CKEditor's cloud CDN is for commercial keys: with `'GPL'`, load it from npm,
861
+ as above, or host it yourself.
862
+
863
+ CKEditor 5 has no plugins of its own, so grid editor gives it a set - the basic
864
+ styles, headings h1 to h6, links, lists, block quotes, tables and horizontal
865
+ lines - and a toolbar for them. `plugins` and `toolbar` in your config replace
866
+ those; a plugin can be given by its name on `window.CKEDITOR`. Markup that no
867
+ loaded plugin knows is dropped as the editor opens, a class included: add
868
+ `'GeneralHtmlSupport'` and its `htmlSupport` option to keep it.
869
+
849
870
  ```javascript
850
871
  new GridEditor('#myGrid', {
851
872
  ckeditor: {
852
- config: { language: 'fr' }
873
+ config: {
874
+ licenseKey: 'GPL',
875
+ plugins: ['Essentials', 'Paragraph', 'Heading', 'Bold', 'Italic', 'Link', 'GeneralHtmlSupport'],
876
+ toolbar: ['heading', 'bold', 'italic', 'link'],
877
+ htmlSupport: { allow: [{ name: /^(p|h[1-6]|a|strong|i)$/, classes: true }] },
878
+ }
853
879
  }
854
880
  });
855
881
  ```
856
882
 
883
+ `config.on.instanceReady`, CKEditor 4's, is still called once the editor is
884
+ ready, with the editor as `this` and as `evt.editor`.
885
+
857
886
  __`summernote.config`:__ Specify summernote config, when using the `summernote` `content_types`.
858
887
  See the [summernote documentation](http://summernote.org/deep-dive/).
859
888
  Also check out the [summernote example](example/summernote.html).
package/UPGRADING.md CHANGED
@@ -1,3 +1,44 @@
1
+ Upgrading from grid-editor `7.1` to `7.2`
2
+ =========================================
3
+
4
+ Only for a page that uses the CKEditor plugin: **the CKEditor integration is
5
+ CKEditor 5**. It breaks such a page, and it is a minor all the same, because
6
+ it is a change in a plugin, not in the core.
7
+
8
+ CKEditor 4.22.1, the last open source CKEditor 4, has known cross-site
9
+ scripting vulnerabilities and gets no more fixes; every CKEditor 4 after it is
10
+ commercial. A page that does not use CKEditor has nothing to change. Markup
11
+ saved with a CKEditor text loads as it is: the content type is still
12
+ `ckeditor`.
13
+
14
+ * __Load CKEditor 5 instead of CKEditor 4.__ Its browser build, and its
15
+ stylesheet:
16
+
17
+ ```html
18
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ckeditor5@48.5.2/dist/browser/ckeditor5.css">
19
+ <script src="https://cdn.jsdelivr.net/npm/ckeditor5@48.5.2/dist/browser/ckeditor5.umd.js"></script>
20
+ ```
21
+
22
+ With CKEditor 4 on the page, the plugin says CKEditor 5 is not available.
23
+ * __Pass a `licenseKey`.__ CKEditor 5 does not start without one: `'GPL'`
24
+ accepts its GPL-2.0-or-later licence, or pass your commercial key.
25
+
26
+ ```javascript
27
+ new GridEditor('#myGrid', {
28
+ content_types: ['ckeditor'],
29
+ ckeditor: { config: { licenseKey: 'GPL' } },
30
+ });
31
+ ```
32
+ * __Rewrite the rest of `ckeditor.config` for CKEditor 5.__ It is what
33
+ `InlineEditor.create` takes, and CKEditor 4's options mean nothing to it:
34
+ `toolbar` has another shape, `extraPlugins`, `removePlugins` and
35
+ `allowedContent` are gone, and `plugins` lists every plugin. grid-editor
36
+ gives it a set of plugins and a toolbar when the config has none; see the
37
+ README. `on.instanceReady` is still called, with the editor as `this` and
38
+ as `evt.editor`.
39
+ * __Markup no plugin knows is dropped__ as the editor opens, as CKEditor 4's
40
+ content filter did: add `GeneralHtmlSupport` to keep classes and elements.
41
+
1
42
  Upgrading from grid-editor `6.*` to `7.*`
2
43
  =========================================
3
44