@themarioga/grid-editor 6.0.0 → 7.1.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 (147) hide show
  1. package/AUTO_SAVE.md +2 -2
  2. package/BUILDING.md +45 -29
  3. package/CHANGELOG.md +59 -0
  4. package/README.md +163 -87
  5. package/UPGRADING.md +119 -0
  6. package/dist/grideditor.bundle.min.js +14 -0
  7. package/dist/grideditor.d.ts +335 -0
  8. package/dist/grideditor.esm.js +3977 -0
  9. package/dist/grideditor.jquery.js +253 -0
  10. package/dist/grideditor.jquery.min.js +1 -0
  11. package/dist/grideditor.jquery.min.js.map +7 -0
  12. package/dist/grideditor.js +3983 -0
  13. package/dist/grideditor.min.js +6 -0
  14. package/dist/grideditor.min.js.map +7 -0
  15. package/dist/locales/grideditor.es.esm.js +158 -0
  16. package/dist/locales/grideditor.es.js +164 -168
  17. package/dist/locales/grideditor.es.min.js +6 -2
  18. package/dist/locales/grideditor.es.min.js.map +7 -1
  19. package/dist/plugins/grideditor.accordion.esm.js +294 -0
  20. package/dist/plugins/grideditor.accordion.js +286 -180
  21. package/dist/plugins/grideditor.accordion.min.js +1 -2
  22. package/dist/plugins/grideditor.accordion.min.js.map +7 -1
  23. package/dist/plugins/grideditor.alignment.esm.js +55 -0
  24. package/dist/plugins/grideditor.alignment.js +58 -77
  25. package/dist/plugins/grideditor.alignment.min.js +1 -2
  26. package/dist/plugins/grideditor.alignment.min.js.map +7 -1
  27. package/dist/plugins/grideditor.card.esm.js +73 -0
  28. package/dist/plugins/grideditor.card.js +74 -64
  29. package/dist/plugins/grideditor.card.min.js +1 -2
  30. package/dist/plugins/grideditor.card.min.js.map +7 -1
  31. package/dist/plugins/grideditor.ckeditor.esm.js +500 -0
  32. package/dist/plugins/grideditor.ckeditor.js +484 -449
  33. package/dist/plugins/grideditor.ckeditor.min.js +1 -2
  34. package/dist/plugins/grideditor.ckeditor.min.js.map +7 -1
  35. package/dist/plugins/grideditor.clipboard.esm.js +326 -0
  36. package/dist/plugins/grideditor.clipboard.js +298 -235
  37. package/dist/plugins/grideditor.clipboard.min.js +1 -2
  38. package/dist/plugins/grideditor.clipboard.min.js.map +7 -1
  39. package/dist/plugins/grideditor.codemirror-inline.esm.js +205 -0
  40. package/dist/plugins/grideditor.codemirror-inline.js +188 -168
  41. package/dist/plugins/grideditor.codemirror-inline.min.js +1 -2
  42. package/dist/plugins/grideditor.codemirror-inline.min.js.map +7 -1
  43. package/dist/plugins/grideditor.codemirror.esm.js +63 -0
  44. package/dist/plugins/grideditor.codemirror.js +60 -71
  45. package/dist/plugins/grideditor.codemirror.min.js +1 -2
  46. package/dist/plugins/grideditor.codemirror.min.js.map +7 -1
  47. package/dist/plugins/grideditor.elements.esm.js +271 -0
  48. package/dist/plugins/grideditor.elements.js +256 -149
  49. package/dist/plugins/grideditor.elements.min.js +1 -2
  50. package/dist/plugins/grideditor.elements.min.js.map +7 -1
  51. package/dist/plugins/grideditor.float.esm.js +34 -0
  52. package/dist/plugins/grideditor.float.js +37 -52
  53. package/dist/plugins/grideditor.float.min.js +1 -2
  54. package/dist/plugins/grideditor.float.min.js.map +7 -1
  55. package/dist/plugins/grideditor.gutters.esm.js +143 -0
  56. package/dist/plugins/grideditor.gutters.js +134 -131
  57. package/dist/plugins/grideditor.gutters.min.js +1 -2
  58. package/dist/plugins/grideditor.gutters.min.js.map +7 -1
  59. package/dist/plugins/grideditor.order.esm.js +189 -0
  60. package/dist/plugins/grideditor.order.js +170 -182
  61. package/dist/plugins/grideditor.order.min.js +1 -2
  62. package/dist/plugins/grideditor.order.min.js.map +7 -1
  63. package/dist/plugins/grideditor.popup.esm.js +187 -0
  64. package/dist/plugins/grideditor.popup.js +183 -134
  65. package/dist/plugins/grideditor.popup.min.js +1 -2
  66. package/dist/plugins/grideditor.popup.min.js.map +7 -1
  67. package/dist/plugins/grideditor.sections.esm.js +271 -0
  68. package/dist/plugins/grideditor.sections.js +250 -173
  69. package/dist/plugins/grideditor.sections.min.js +1 -2
  70. package/dist/plugins/grideditor.sections.min.js.map +7 -1
  71. package/dist/plugins/grideditor.spacing.esm.js +318 -0
  72. package/dist/plugins/grideditor.spacing.js +296 -272
  73. package/dist/plugins/grideditor.spacing.min.js +1 -2
  74. package/dist/plugins/grideditor.spacing.min.js.map +7 -1
  75. package/dist/plugins/grideditor.summernote.esm.js +509 -0
  76. package/dist/plugins/grideditor.summernote.js +493 -427
  77. package/dist/plugins/grideditor.summernote.min.js +1 -2
  78. package/dist/plugins/grideditor.summernote.min.js.map +7 -1
  79. package/dist/plugins/grideditor.tabs.esm.js +237 -0
  80. package/dist/plugins/grideditor.tabs.js +233 -139
  81. package/dist/plugins/grideditor.tabs.min.js +1 -2
  82. package/dist/plugins/grideditor.tabs.min.js.map +7 -1
  83. package/dist/plugins/grideditor.textalign.esm.js +40 -0
  84. package/dist/plugins/grideditor.textalign.js +43 -56
  85. package/dist/plugins/grideditor.textalign.min.js +1 -2
  86. package/dist/plugins/grideditor.textalign.min.js.map +7 -1
  87. package/dist/plugins/grideditor.tinymce.esm.js +519 -0
  88. package/dist/plugins/grideditor.tinymce.js +502 -490
  89. package/dist/plugins/grideditor.tinymce.min.js +1 -2
  90. package/dist/plugins/grideditor.tinymce.min.js.map +7 -1
  91. package/dist/plugins/grideditor.visibility.esm.js +158 -0
  92. package/dist/plugins/grideditor.visibility.js +140 -149
  93. package/dist/plugins/grideditor.visibility.min.js +1 -2
  94. package/dist/plugins/grideditor.visibility.min.js.map +7 -1
  95. package/docs/events.md +47 -21
  96. package/docs/locale-keys.md +6 -0
  97. package/docs/plugins.md +47 -25
  98. package/example/adapter.html +112 -0
  99. package/example/attributes.html +89 -62
  100. package/example/autocols.html +9 -9
  101. package/example/autosave.html +18 -16
  102. package/example/basic.html +8 -6
  103. package/example/breakpoints.html +5 -6
  104. package/example/ckeditor.html +4 -5
  105. package/example/clipboard.html +15 -11
  106. package/example/codemirror.html +13 -8
  107. package/example/containers.html +11 -9
  108. package/example/custom_editor.html +53 -34
  109. package/example/elements.html +14 -12
  110. package/example/index.html +16 -2
  111. package/example/locale.html +6 -7
  112. package/example/plugins.html +44 -29
  113. package/example/summernote.html +6 -5
  114. package/example/utilities.html +17 -13
  115. package/example/wrap_content.html +13 -10
  116. package/package.json +44 -12
  117. package/src/js/dom.js +401 -0
  118. package/src/js/grideditor.classic.js +16 -0
  119. package/src/js/grideditor.jquery.js +325 -0
  120. package/src/js/{jquery.grideditor.js → grideditor.js} +1284 -1124
  121. package/src/js/locales/grideditor.es.js +163 -156
  122. package/src/js/plugins/grideditor.accordion.js +97 -77
  123. package/src/js/plugins/grideditor.alignment.js +5 -7
  124. package/src/js/plugins/grideditor.card.js +23 -23
  125. package/src/js/plugins/grideditor.ckeditor.js +107 -106
  126. package/src/js/plugins/grideditor.clipboard.js +49 -37
  127. package/src/js/plugins/grideditor.codemirror-inline.js +50 -37
  128. package/src/js/plugins/grideditor.codemirror.js +9 -10
  129. package/src/js/plugins/grideditor.elements.js +57 -33
  130. package/src/js/plugins/grideditor.float.js +4 -6
  131. package/src/js/plugins/grideditor.gutters.js +20 -15
  132. package/src/js/plugins/grideditor.order.js +28 -25
  133. package/src/js/plugins/grideditor.popup.js +63 -51
  134. package/src/js/plugins/grideditor.sections.js +39 -32
  135. package/src/js/plugins/grideditor.spacing.js +42 -45
  136. package/src/js/plugins/grideditor.summernote.js +112 -76
  137. package/src/js/plugins/grideditor.tabs.js +65 -57
  138. package/src/js/plugins/grideditor.textalign.js +4 -6
  139. package/src/js/plugins/grideditor.tinymce.js +148 -140
  140. package/src/js/plugins/grideditor.visibility.js +24 -25
  141. package/src/js/register.js +18 -0
  142. package/src/js/text/grideditor.text.js +77 -56
  143. package/types/grideditor.d.ts +335 -0
  144. package/dist/jquery.grideditor.bundle.min.js +0 -10
  145. package/dist/jquery.grideditor.js +0 -4927
  146. package/dist/jquery.grideditor.min.js +0 -2
  147. package/dist/jquery.grideditor.min.js.map +0 -1
package/AUTO_SAVE.md CHANGED
@@ -1,8 +1,8 @@
1
1
  ## Auto save and layout import/export
2
2
 
3
3
  The `example/autosave.html` demo shows how to add **auto save** and
4
- **import/export** on top of Grid Editor, using only the plugin's existing
5
- public API (`gridEditor('getHtml')` and `gridEditor('remove')`).
4
+ **import/export** on top of Grid Editor, using only the editor's public API
5
+ (`getHtml()` and `destroy()` on the `GridEditor` instance).
6
6
 
7
7
  ### Features
8
8
 
package/BUILDING.md CHANGED
@@ -13,32 +13,43 @@ From then on out, you can build the files in the `dist` directory by running:
13
13
 
14
14
  During development, you can also run `npm run watch` to automatically rebuild on changes.
15
15
 
16
- The build emits the plugin as `dist/jquery.grideditor.js`, the stylesheet as
17
- `dist/grideditor.css`, each with a minified twin and a source map beside it,
18
- and the files in `src/js/locales/` and `src/js/plugins/` one by one under
19
- `dist/locales/` and `dist/plugins/`. Neither of those two directories is part
20
- of the main bundle: the `src/js/*.js` glob does not descend, so a page loads
21
- the languages and the container plugins it actually wants. See
22
- [docs/plugins.md](docs/plugins.md) for what a container plugin is.
23
-
24
- The text editor plugins - tinyMCE, CKEditor and summernote - are built to
25
- `dist/plugins/` like the others, and like them are not part of the main
26
- bundle. Up to 5.x the bundle carried a copy of each. Each one is built as
27
- `src/js/text/grideditor.text.js`, what every text editor shares, followed by
28
- the editor's own file: that shared file is never published on its own.
29
-
30
- One more file comes out of it: `dist/jquery.grideditor.bundle.min.js`, the
31
- minified editor concatenated with the copy of SortableJS in `node_modules`,
32
- for pages that would rather load one file than two. It carries both MIT
33
- notices, it is built after the minified editor because it is made of it, and a
34
- page loads it *or* the editor and SortableJS separately, never both. The
35
- version is pinned in `package.json`, so refreshing it is an `npm update
36
- sortablejs` and a rebuild.
37
-
38
- Locale files are deliberately not part of the main bundle: a page loads only the languages it
39
- offers. English is the exception and lives in the bundle, because it is the
40
- fallback every string lookup ends at. See `docs/locale-keys.md` for the keys,
41
- and `src/js/locales/grideditor.es.js` for what a locale file looks like.
16
+ The sources are ES modules. `build/build.js` turns them into what `dist/`
17
+ ships, with esbuild; Grunt runs the stylesheets and calls it, so `npm run
18
+ build` is the one command either way. Every script comes out twice:
19
+
20
+ | Output | What it is |
21
+ | --- | --- |
22
+ | `dist/grideditor.js`, `.min.js` + map | the editor as a classic script, defining `window.GridEditor` |
23
+ | `dist/grideditor.esm.js` | the editor as an ES module, exporting `GridEditor` |
24
+ | `dist/grideditor.bundle.min.js` | the minified editor with SortableJS in front of it |
25
+ | `dist/grideditor.jquery.js`, `.min.js` + map | the jQuery adapter: the 6.x API for a page that loads jQuery 4 |
26
+ | `dist/plugins/grideditor.<name>.js`, `.min.js`, `.esm.js` | each plugin, classic and as a module |
27
+ | `dist/locales/grideditor.<code>.js`, `.min.js`, `.esm.js` | each locale, the same two ways |
28
+ | `dist/grideditor.d.ts` | the public API's types, copied from `types/` |
29
+ | `dist/grideditor.css`, `.min.css` + map | the stylesheet, from `src/less/` |
30
+
31
+ A plugin or a locale never carries a copy of the editor. Its classic script
32
+ finds the one the page loaded through `src/js/register.js`, which says so, in
33
+ an error, when the editor has not been loaded yet; its module imports
34
+ `../grideditor.esm.js`. `src/js/dom.js`, the editor's DOM helpers, is not
35
+ public: the build puts a copy in each script that uses it.
36
+
37
+ The text editor plugins - tinyMCE, CKEditor and summernote - each import
38
+ `src/js/text/grideditor.text.js`, what every text editor shares, so each
39
+ script carries it; however many a page loads, it is installed once. That
40
+ shared file is never published on its own.
41
+
42
+ The bundle is the minified editor concatenated with the copy of SortableJS in
43
+ `node_modules`, for pages that would rather load one file than two. It carries
44
+ both MIT notices, and a page loads it *or* the editor and SortableJS
45
+ separately, never both. The version is pinned in `package.json`, so refreshing
46
+ it is an `npm update sortablejs` and a rebuild.
47
+
48
+ Locale files are deliberately not part of the editor: a page loads only the
49
+ languages it offers. English is the exception and lives in the editor, because
50
+ it is the fallback every string lookup ends at. See `docs/locale-keys.md` for
51
+ the keys, and `src/js/locales/grideditor.es.js` for what a locale file looks
52
+ like.
42
53
 
43
54
  Running the tests
44
55
  =================
@@ -50,7 +61,9 @@ so build first:
50
61
  * `npm run build`
51
62
  * `npm test`
52
63
 
53
- There is nothing extra to install: the tests use node and Chrome, and start
64
+ `npm test` first checks the public API's types (`npm run test:types`, which
65
+ compiles `test/types/usage.ts` against `types/grideditor.d.ts`), then runs the
66
+ browser suites. There is nothing extra to install: the tests use node and Chrome, and start
54
67
  their own web server. `npm test` runs every suite in `test/` in one Chrome and
55
68
  prints one summary, and exits non-zero if anything failed. To run a single
56
69
  suite, pass part of its name:
@@ -59,8 +72,11 @@ suite, pass part of its name:
59
72
 
60
73
  A suite can also be run on its own with `node test/rte.js`.
61
74
 
62
- The fixture pages in `test/fixtures` load jQuery, SortableJS and Bootstrap from
63
- `test/vendor` rather than from a CDN, so most of the suite runs offline. The
75
+ The fixture pages in `test/fixtures` load SortableJS and Bootstrap from
76
+ `test/vendor` rather than from a CDN, so most of the suite runs offline.
77
+ `grid.html`, which most suites run on, has no jQuery; `adapter.html` is the
78
+ same page through the jQuery adapter, with the vendored jQuery 4, and
79
+ `esm.html` imports the module build. The
64
80
  rich text editor suite is the exception: it loads tinyMCE, CKEditor and
65
81
  Summernote from their CDNs to test against the real editors, and the runner
66
82
  skips it, with a reason, when there is no network. `OFFLINE=1 npm test` forces
package/CHANGELOG.md CHANGED
@@ -5,6 +5,65 @@ 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.1.0] - 2026-09-29
9
+
10
+ ### Changed
11
+ - The tinyMCE integration now targets tinyMCE 7, and the examples, the
12
+ Angular app and the tests use TinyMCE 7.9.3. 6.8.6 has five known
13
+ cross-site scripting advisories (GHSA-5359-pvf2-pw78, GHSA-mh5m-5hw4-5c69,
14
+ GHSA-vg35-5wq7-3x7w, GHSA-q742-qvgc-gc2f, GHSA-v98h-vmpc-fpqv), and 7.9.3
15
+ is the first release with none. This changes tinyMCE's licence from MIT to
16
+ GPL-2.0-or-later: the examples pass `license_key: 'gpl'`, and a page that
17
+ uses tinyMCE 7 passes that or its own commercial key in `tinymce.config`.
18
+ grid-editor stays MIT. The integration still works with tinyMCE 6.
19
+
20
+ ## [7.0.0] - 2026-09-28
21
+ grid-editor is plain DOM: no jQuery. See [UPGRADING.md](UPGRADING.md).
22
+
23
+ ### Added
24
+ - `GridEditor`: `new GridEditor(target, options)`, `GridEditor.create` and
25
+ `GridEditor.get`. The methods are the instance's own, and the ones that do
26
+ something chain.
27
+ - The module build: `dist/grideditor.esm.js`, and each plugin and locale as
28
+ a module that registers as it is imported. `package.json` has `module`,
29
+ `exports` and `types`.
30
+ - `dist/grideditor.d.ts`: the public API's types.
31
+ - `grideditor.jquery.js`, the adapter: the 6.x jQuery API, unchanged, for a
32
+ page that loads jQuery 4.
33
+ - `GridEditor.Sortable` and `GridEditor.bootstrap`, for an app that imports
34
+ SortableJS and Bootstrap rather than loading them as globals.
35
+ - `nodes` in `after-edit-html`'s payload: every element written.
36
+
37
+ ### Changed
38
+ - Events are DOM events on the canvas, `CustomEvent`s with the payload as
39
+ their `detail`; they bubble. Payloads, `create*` results, the plugin handle
40
+ and every plugin hook give and take elements.
41
+ - The classic scripts are `dist/grideditor.js`, `.min.js` and
42
+ `grideditor.bundle.min.js`; the `jquery.grideditor*` names are gone.
43
+ - A `<script>` in html the editor writes is not run in the editor.
44
+ - A listener that throws no longer stops the operation.
45
+ - A second editor asked for on an element hands back the first, and warns.
46
+ - Plugins register on `GridEditor.containers`, `.features`, `.utilities` and
47
+ `.texts`; the build is esbuild, from ES module sources.
48
+ - `error.ckeditor_missing` no longer mentions a jQuery adapter, and
49
+ `error.summernote_missing` says summernote needs jQuery.
50
+
51
+ ### Removed
52
+ - jQuery as a dependency. Only the summernote plugin uses it, since
53
+ summernote does.
54
+ - `remove()`, the alias of `destroy()` deprecated since 3.1.
55
+ - `$.fn.gridEditor.RTEs`, ignored since 6.0.
56
+ - tinyMCE's `oninit` option, the name tinyMCE used before 6, kept until now: ignored, with a warning.
57
+
58
+ ### Fixed
59
+ - `custom_filter` given as a function or an array of them runs.
60
+ - `destroy()`, or `setLocale()`, with a Bootstrap modal open or on its way in
61
+ or out - the settings panel with `settings_panel: 'modal'`, or the delete
62
+ confirmation - threw from Bootstrap's transition and left the page's body
63
+ locked, with no scrolling. The modal is closed first now, and taken away
64
+ once Bootstrap has hidden it.
65
+
66
+
8
67
  ## [6.0.0] - 2026-09-28
9
68
  ### Removed
10
69
  - The *Add text* tool in each column's drawer, and its `tool.add_text` and