@themarioga/grid-editor 7.0.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +61 -8
  3. package/UPGRADING.md +41 -0
  4. package/dist/grideditor.bundle.min.js +3 -3
  5. package/dist/grideditor.esm.js +2 -2
  6. package/dist/grideditor.js +2 -2
  7. package/dist/grideditor.min.js +2 -2
  8. package/dist/grideditor.min.js.map +2 -2
  9. package/dist/locales/grideditor.es.esm.js +3 -1
  10. package/dist/locales/grideditor.es.js +3 -1
  11. package/dist/locales/grideditor.es.min.js +1 -1
  12. package/dist/locales/grideditor.es.min.js.map +2 -2
  13. package/dist/plugins/grideditor.ckeditor.esm.js +123 -48
  14. package/dist/plugins/grideditor.ckeditor.js +123 -48
  15. package/dist/plugins/grideditor.ckeditor.min.js +1 -1
  16. package/dist/plugins/grideditor.ckeditor.min.js.map +3 -3
  17. package/dist/plugins/grideditor.summernote.esm.js +1 -1
  18. package/dist/plugins/grideditor.summernote.js +1 -1
  19. package/dist/plugins/grideditor.summernote.min.js +1 -1
  20. package/dist/plugins/grideditor.summernote.min.js.map +2 -2
  21. package/dist/plugins/grideditor.tinymce.esm.js +1 -1
  22. package/dist/plugins/grideditor.tinymce.js +1 -1
  23. package/dist/plugins/grideditor.tinymce.min.js +1 -1
  24. package/dist/plugins/grideditor.tinymce.min.js.map +2 -2
  25. package/docs/locale-keys.md +3 -1
  26. package/example/attributes.html +4 -1
  27. package/example/autosave.html +5 -2
  28. package/example/basic.html +4 -1
  29. package/example/ckeditor.html +9 -4
  30. package/example/clipboard.html +4 -1
  31. package/example/codemirror.html +4 -1
  32. package/example/containers.html +4 -1
  33. package/example/elements.html +4 -1
  34. package/example/index.html +1 -1
  35. package/example/wrap_content.html +4 -1
  36. package/package.json +2 -1
  37. package/src/js/grideditor.js +1 -1
  38. package/src/js/locales/grideditor.es.js +3 -1
  39. package/src/js/plugins/grideditor.ckeditor.js +129 -65
  40. package/src/js/plugins/grideditor.tinymce.js +1 -1
  41. package/src/js/text/grideditor.text.js +1 -1
package/CHANGELOG.md CHANGED
@@ -5,6 +5,40 @@ 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
+
30
+ ## [7.1.0] - 2026-09-29
31
+
32
+ ### Changed
33
+ - The tinyMCE integration now targets tinyMCE 7, and the examples, the
34
+ Angular app and the tests use TinyMCE 7.9.3. 6.8.6 has five known
35
+ cross-site scripting advisories (GHSA-5359-pvf2-pw78, GHSA-mh5m-5hw4-5c69,
36
+ GHSA-vg35-5wq7-3x7w, GHSA-q742-qvgc-gc2f, GHSA-v98h-vmpc-fpqv), and 7.9.3
37
+ is the first release with none. This changes tinyMCE's licence from MIT to
38
+ GPL-2.0-or-later: the examples pass `license_key: 'gpl'`, and a page that
39
+ uses tinyMCE 7 passes that or its own commercial key in `tinymce.config`.
40
+ grid-editor stays MIT. The integration still works with tinyMCE 6.
41
+
8
42
  ## [7.0.0] - 2026-09-28
9
43
  grid-editor is plain DOM: no jQuery. See [UPGRADING.md](UPGRADING.md).
10
44
 
package/README.md CHANGED
@@ -39,13 +39,16 @@ from any web server, or from GitHub Pages, with no build step.
39
39
  | [example/autosave.html](example/autosave.html) | Saving the html as the user edits | [live](https://themarioga.github.io/grid-editor/example/autosave.html) |
40
40
  | [example/adapter.html](example/adapter.html) | A page written for 6.x, with jQuery, running unchanged through the adapter | [live](https://themarioga.github.io/grid-editor/example/adapter.html) |
41
41
 
42
+ [example/angular](example/angular) is the editor in an Angular app, from the npm
43
+ package: an Angular CLI project, with a build step, unlike the pages above.
44
+
42
45
  Installation
43
46
  ------------
44
47
 
45
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.
46
- * If you want to use the tinyMCE integration, include tinyMCE 6 as well, and `dist/plugins/grideditor.tinymce.min.js` after the editor.
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.
47
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.
48
- * 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.
49
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).
50
53
  * From npm:
51
54
 
@@ -99,6 +102,9 @@ confirmed with the browser's `confirm()` and the modal settings panel opens
99
102
  with a backdrop of the editor's own. Types for the public API come with the
100
103
  package (`dist/grideditor.d.ts`).
101
104
 
105
+ [example/angular](example/angular) is a whole app that does this, with the
106
+ editor as an Angular component.
107
+
102
108
  Load the classic script *or* the module build on a page, never both.
103
109
 
104
110
  ### A page written for 6.x
@@ -817,9 +823,9 @@ same way, `codemirror.config` included, and a textarea without it.
817
823
  ### Rich text editor options
818
824
 
819
825
  Grid editor comes with support for the following rich text editors (RTEs), each a plugin of its own to load after the editor:
820
- * [TinyMCE](http://www.tinymce.com/) 6 - `dist/plugins/grideditor.tinymce.min.js` - [(example)](example/basic.html)
826
+ * [TinyMCE](http://www.tinymce.com/) 7 - `dist/plugins/grideditor.tinymce.min.js` - [(example)](example/basic.html)
821
827
  * [summernote](http://summernote.org/) 0.9 - `dist/plugins/grideditor.summernote.min.js` - [(example)](example/summernote.html)
822
- * [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)
823
829
 
824
830
  A text editor is chosen by `content_types`, not by the `plugins` setting: a page
825
831
  that names its containers in `plugins` still has its editor. Summernote 0.9.1
@@ -836,18 +842,47 @@ new GridEditor('#myGrid', {
836
842
  });
837
843
  ```
838
844
 
839
- __`ckeditor.config`:__ Specify ckeditor config, when using the `ckeditor` `content_types`.
840
- 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/).
841
847
  Also check out the [ckeditor example](example/ckeditor.html).
842
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
+
843
870
  ```javascript
844
871
  new GridEditor('#myGrid', {
845
872
  ckeditor: {
846
- 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
+ }
847
879
  }
848
880
  });
849
881
  ```
850
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
+
851
886
  __`summernote.config`:__ Specify summernote config, when using the `summernote` `content_types`.
852
887
  See the [summernote documentation](http://summernote.org/deep-dive/).
853
888
  Also check out the [summernote example](example/summernote.html).
@@ -861,7 +896,7 @@ new GridEditor('#myGrid', {
861
896
  ```
862
897
 
863
898
  __`tinymce.config`:__ Specify tinyMCE config, when using the `tinymce` `content_types`.
864
- See the [tinyMCE documentation](https://www.tiny.cloud/docs/tinymce/6/).
899
+ See the [tinyMCE documentation](https://www.tiny.cloud/docs/tinymce/7/).
865
900
  Also check out the [tinymce example](example/basic.html).
866
901
 
867
902
  ```javascript
@@ -876,6 +911,24 @@ Grid editor passes `promotion: false`, so tinyMCE's "Upgrade" badge does not
876
911
  appear in the menubar of an inline editor sitting in someone's page. Pass
877
912
  `promotion: true` in your own config to get it back.
878
913
 
914
+ tinyMCE 7 is licensed GPL-2.0-or-later, and asks for a `license_key`: pass
915
+ `license_key: 'gpl'` to accept the GPL, or your own key if you have a
916
+ commercial licence. Without one it runs in evaluation mode and says so in the
917
+ console. Grid editor does not pass one for you, since the licence is yours to
918
+ choose.
919
+
920
+ ```javascript
921
+ new GridEditor('#myGrid', {
922
+ tinymce: {
923
+ config: { license_key: 'gpl' }
924
+ }
925
+ });
926
+ ```
927
+
928
+ Use 7.9.3 or later: every tinyMCE 6 release, and 7.x before 7.9.3, has known
929
+ cross-site scripting vulnerabilities. The integration still works with
930
+ tinyMCE 6, but the examples and tests run on 7.9.3.
931
+
879
932
 
880
933
  Upgrading
881
934
  ---------
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