@themarioga/grid-editor 6.0.0 → 7.0.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/AUTO_SAVE.md +2 -2
- package/BUILDING.md +45 -29
- package/CHANGELOG.md +47 -0
- package/README.md +137 -85
- package/UPGRADING.md +119 -0
- package/dist/grideditor.bundle.min.js +14 -0
- package/dist/grideditor.d.ts +335 -0
- package/dist/grideditor.esm.js +3977 -0
- package/dist/grideditor.jquery.js +253 -0
- package/dist/grideditor.jquery.min.js +1 -0
- package/dist/grideditor.jquery.min.js.map +7 -0
- package/dist/grideditor.js +3983 -0
- package/dist/grideditor.min.js +6 -0
- package/dist/grideditor.min.js.map +7 -0
- package/dist/locales/grideditor.es.esm.js +158 -0
- package/dist/locales/grideditor.es.js +164 -168
- package/dist/locales/grideditor.es.min.js +6 -2
- package/dist/locales/grideditor.es.min.js.map +7 -1
- package/dist/plugins/grideditor.accordion.esm.js +294 -0
- package/dist/plugins/grideditor.accordion.js +286 -180
- package/dist/plugins/grideditor.accordion.min.js +1 -2
- package/dist/plugins/grideditor.accordion.min.js.map +7 -1
- package/dist/plugins/grideditor.alignment.esm.js +55 -0
- package/dist/plugins/grideditor.alignment.js +58 -77
- package/dist/plugins/grideditor.alignment.min.js +1 -2
- package/dist/plugins/grideditor.alignment.min.js.map +7 -1
- package/dist/plugins/grideditor.card.esm.js +73 -0
- package/dist/plugins/grideditor.card.js +74 -64
- package/dist/plugins/grideditor.card.min.js +1 -2
- package/dist/plugins/grideditor.card.min.js.map +7 -1
- package/dist/plugins/grideditor.ckeditor.esm.js +500 -0
- package/dist/plugins/grideditor.ckeditor.js +484 -449
- package/dist/plugins/grideditor.ckeditor.min.js +1 -2
- package/dist/plugins/grideditor.ckeditor.min.js.map +7 -1
- package/dist/plugins/grideditor.clipboard.esm.js +326 -0
- package/dist/plugins/grideditor.clipboard.js +298 -235
- package/dist/plugins/grideditor.clipboard.min.js +1 -2
- package/dist/plugins/grideditor.clipboard.min.js.map +7 -1
- package/dist/plugins/grideditor.codemirror-inline.esm.js +205 -0
- package/dist/plugins/grideditor.codemirror-inline.js +188 -168
- package/dist/plugins/grideditor.codemirror-inline.min.js +1 -2
- package/dist/plugins/grideditor.codemirror-inline.min.js.map +7 -1
- package/dist/plugins/grideditor.codemirror.esm.js +63 -0
- package/dist/plugins/grideditor.codemirror.js +60 -71
- package/dist/plugins/grideditor.codemirror.min.js +1 -2
- package/dist/plugins/grideditor.codemirror.min.js.map +7 -1
- package/dist/plugins/grideditor.elements.esm.js +271 -0
- package/dist/plugins/grideditor.elements.js +256 -149
- package/dist/plugins/grideditor.elements.min.js +1 -2
- package/dist/plugins/grideditor.elements.min.js.map +7 -1
- package/dist/plugins/grideditor.float.esm.js +34 -0
- package/dist/plugins/grideditor.float.js +37 -52
- package/dist/plugins/grideditor.float.min.js +1 -2
- package/dist/plugins/grideditor.float.min.js.map +7 -1
- package/dist/plugins/grideditor.gutters.esm.js +143 -0
- package/dist/plugins/grideditor.gutters.js +134 -131
- package/dist/plugins/grideditor.gutters.min.js +1 -2
- package/dist/plugins/grideditor.gutters.min.js.map +7 -1
- package/dist/plugins/grideditor.order.esm.js +189 -0
- package/dist/plugins/grideditor.order.js +170 -182
- package/dist/plugins/grideditor.order.min.js +1 -2
- package/dist/plugins/grideditor.order.min.js.map +7 -1
- package/dist/plugins/grideditor.popup.esm.js +187 -0
- package/dist/plugins/grideditor.popup.js +183 -134
- package/dist/plugins/grideditor.popup.min.js +1 -2
- package/dist/plugins/grideditor.popup.min.js.map +7 -1
- package/dist/plugins/grideditor.sections.esm.js +271 -0
- package/dist/plugins/grideditor.sections.js +250 -173
- package/dist/plugins/grideditor.sections.min.js +1 -2
- package/dist/plugins/grideditor.sections.min.js.map +7 -1
- package/dist/plugins/grideditor.spacing.esm.js +318 -0
- package/dist/plugins/grideditor.spacing.js +296 -272
- package/dist/plugins/grideditor.spacing.min.js +1 -2
- package/dist/plugins/grideditor.spacing.min.js.map +7 -1
- package/dist/plugins/grideditor.summernote.esm.js +509 -0
- package/dist/plugins/grideditor.summernote.js +493 -427
- package/dist/plugins/grideditor.summernote.min.js +1 -2
- package/dist/plugins/grideditor.summernote.min.js.map +7 -1
- package/dist/plugins/grideditor.tabs.esm.js +237 -0
- package/dist/plugins/grideditor.tabs.js +233 -139
- package/dist/plugins/grideditor.tabs.min.js +1 -2
- package/dist/plugins/grideditor.tabs.min.js.map +7 -1
- package/dist/plugins/grideditor.textalign.esm.js +40 -0
- package/dist/plugins/grideditor.textalign.js +43 -56
- package/dist/plugins/grideditor.textalign.min.js +1 -2
- package/dist/plugins/grideditor.textalign.min.js.map +7 -1
- package/dist/plugins/grideditor.tinymce.esm.js +519 -0
- package/dist/plugins/grideditor.tinymce.js +502 -490
- package/dist/plugins/grideditor.tinymce.min.js +1 -2
- package/dist/plugins/grideditor.tinymce.min.js.map +7 -1
- package/dist/plugins/grideditor.visibility.esm.js +158 -0
- package/dist/plugins/grideditor.visibility.js +140 -149
- package/dist/plugins/grideditor.visibility.min.js +1 -2
- package/dist/plugins/grideditor.visibility.min.js.map +7 -1
- package/docs/events.md +47 -21
- package/docs/locale-keys.md +6 -0
- package/docs/plugins.md +47 -25
- package/example/adapter.html +112 -0
- package/example/attributes.html +85 -61
- package/example/autocols.html +9 -9
- package/example/autosave.html +13 -14
- package/example/basic.html +4 -5
- package/example/breakpoints.html +5 -6
- package/example/ckeditor.html +4 -5
- package/example/clipboard.html +11 -10
- package/example/codemirror.html +9 -7
- package/example/containers.html +7 -8
- package/example/custom_editor.html +53 -34
- package/example/elements.html +10 -11
- package/example/index.html +16 -2
- package/example/locale.html +6 -7
- package/example/plugins.html +44 -29
- package/example/summernote.html +6 -5
- package/example/utilities.html +17 -13
- package/example/wrap_content.html +9 -9
- package/package.json +43 -12
- package/src/js/dom.js +401 -0
- package/src/js/grideditor.classic.js +16 -0
- package/src/js/grideditor.jquery.js +325 -0
- package/src/js/{jquery.grideditor.js → grideditor.js} +1284 -1124
- package/src/js/locales/grideditor.es.js +163 -156
- package/src/js/plugins/grideditor.accordion.js +97 -77
- package/src/js/plugins/grideditor.alignment.js +5 -7
- package/src/js/plugins/grideditor.card.js +23 -23
- package/src/js/plugins/grideditor.ckeditor.js +107 -106
- package/src/js/plugins/grideditor.clipboard.js +49 -37
- package/src/js/plugins/grideditor.codemirror-inline.js +50 -37
- package/src/js/plugins/grideditor.codemirror.js +9 -10
- package/src/js/plugins/grideditor.elements.js +57 -33
- package/src/js/plugins/grideditor.float.js +4 -6
- package/src/js/plugins/grideditor.gutters.js +20 -15
- package/src/js/plugins/grideditor.order.js +28 -25
- package/src/js/plugins/grideditor.popup.js +63 -51
- package/src/js/plugins/grideditor.sections.js +39 -32
- package/src/js/plugins/grideditor.spacing.js +42 -45
- package/src/js/plugins/grideditor.summernote.js +112 -76
- package/src/js/plugins/grideditor.tabs.js +65 -57
- package/src/js/plugins/grideditor.textalign.js +4 -6
- package/src/js/plugins/grideditor.tinymce.js +147 -139
- package/src/js/plugins/grideditor.visibility.js +24 -25
- package/src/js/register.js +18 -0
- package/src/js/text/grideditor.text.js +77 -56
- package/types/grideditor.d.ts +335 -0
- package/dist/jquery.grideditor.bundle.min.js +0 -10
- package/dist/jquery.grideditor.js +0 -4927
- package/dist/jquery.grideditor.min.js +0 -2
- 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
|
|
5
|
-
|
|
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
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
`dist/
|
|
26
|
-
|
|
27
|
-
`
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
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
|
|
63
|
-
`test/vendor` rather than from a CDN, so most of the suite runs offline.
|
|
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,53 @@ 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.0.0] - 2026-09-28
|
|
9
|
+
grid-editor is plain DOM: no jQuery. See [UPGRADING.md](UPGRADING.md).
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- `GridEditor`: `new GridEditor(target, options)`, `GridEditor.create` and
|
|
13
|
+
`GridEditor.get`. The methods are the instance's own, and the ones that do
|
|
14
|
+
something chain.
|
|
15
|
+
- The module build: `dist/grideditor.esm.js`, and each plugin and locale as
|
|
16
|
+
a module that registers as it is imported. `package.json` has `module`,
|
|
17
|
+
`exports` and `types`.
|
|
18
|
+
- `dist/grideditor.d.ts`: the public API's types.
|
|
19
|
+
- `grideditor.jquery.js`, the adapter: the 6.x jQuery API, unchanged, for a
|
|
20
|
+
page that loads jQuery 4.
|
|
21
|
+
- `GridEditor.Sortable` and `GridEditor.bootstrap`, for an app that imports
|
|
22
|
+
SortableJS and Bootstrap rather than loading them as globals.
|
|
23
|
+
- `nodes` in `after-edit-html`'s payload: every element written.
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
- Events are DOM events on the canvas, `CustomEvent`s with the payload as
|
|
27
|
+
their `detail`; they bubble. Payloads, `create*` results, the plugin handle
|
|
28
|
+
and every plugin hook give and take elements.
|
|
29
|
+
- The classic scripts are `dist/grideditor.js`, `.min.js` and
|
|
30
|
+
`grideditor.bundle.min.js`; the `jquery.grideditor*` names are gone.
|
|
31
|
+
- A `<script>` in html the editor writes is not run in the editor.
|
|
32
|
+
- A listener that throws no longer stops the operation.
|
|
33
|
+
- A second editor asked for on an element hands back the first, and warns.
|
|
34
|
+
- Plugins register on `GridEditor.containers`, `.features`, `.utilities` and
|
|
35
|
+
`.texts`; the build is esbuild, from ES module sources.
|
|
36
|
+
- `error.ckeditor_missing` no longer mentions a jQuery adapter, and
|
|
37
|
+
`error.summernote_missing` says summernote needs jQuery.
|
|
38
|
+
|
|
39
|
+
### Removed
|
|
40
|
+
- jQuery as a dependency. Only the summernote plugin uses it, since
|
|
41
|
+
summernote does.
|
|
42
|
+
- `remove()`, the alias of `destroy()` deprecated since 3.1.
|
|
43
|
+
- `$.fn.gridEditor.RTEs`, ignored since 6.0.
|
|
44
|
+
- tinyMCE's `oninit` option, the name tinyMCE used before 6, kept until now: ignored, with a warning.
|
|
45
|
+
|
|
46
|
+
### Fixed
|
|
47
|
+
- `custom_filter` given as a function or an array of them runs.
|
|
48
|
+
- `destroy()`, or `setLocale()`, with a Bootstrap modal open or on its way in
|
|
49
|
+
or out - the settings panel with `settings_panel: 'modal'`, or the delete
|
|
50
|
+
confirmation - threw from Bootstrap's transition and left the page's body
|
|
51
|
+
locked, with no scrolling. The modal is closed first now, and taken away
|
|
52
|
+
once Bootstrap has hidden it.
|
|
53
|
+
|
|
54
|
+
|
|
8
55
|
## [6.0.0] - 2026-09-28
|
|
9
56
|
### Removed
|
|
10
57
|
- The *Add text* tool in each column's drawer, and its `tool.add_text` and
|