@themarioga/grid-editor 9.0.0-beta.6 → 9.0.0-beta.8

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 (103) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +54 -27
  3. package/UPGRADING.md +1 -1
  4. package/dist/grideditor.bundle.min.js +2 -2
  5. package/dist/grideditor.css +24 -3
  6. package/dist/grideditor.d.ts +27 -2
  7. package/dist/grideditor.esm.js +64 -7
  8. package/dist/grideditor.js +64 -7
  9. package/dist/grideditor.min.css +1 -1
  10. package/dist/grideditor.min.css.map +1 -1
  11. package/dist/grideditor.min.js +1 -1
  12. package/dist/grideditor.min.js.map +3 -3
  13. package/dist/locales/grideditor.es.esm.js +2 -0
  14. package/dist/locales/grideditor.es.js +2 -0
  15. package/dist/locales/grideditor.es.min.js +1 -1
  16. package/dist/locales/grideditor.es.min.js.map +2 -2
  17. package/dist/plugins/grideditor.accordion.esm.js +9 -0
  18. package/dist/plugins/grideditor.accordion.js +9 -0
  19. package/dist/plugins/grideditor.accordion.min.js +1 -1
  20. package/dist/plugins/grideditor.accordion.min.js.map +3 -3
  21. package/dist/plugins/grideditor.card.min.js +1 -1
  22. package/dist/plugins/grideditor.card.min.js.map +1 -1
  23. package/dist/plugins/grideditor.carousel.esm.js +3 -0
  24. package/dist/plugins/grideditor.carousel.js +3 -0
  25. package/dist/plugins/grideditor.carousel.min.js +1 -1
  26. package/dist/plugins/grideditor.carousel.min.js.map +3 -3
  27. package/dist/plugins/grideditor.ckeditor.esm.js +9 -0
  28. package/dist/plugins/grideditor.ckeditor.js +9 -0
  29. package/dist/plugins/grideditor.ckeditor.min.js +1 -1
  30. package/dist/plugins/grideditor.ckeditor.min.js.map +3 -3
  31. package/dist/plugins/grideditor.clipboard.esm.js +44 -7
  32. package/dist/plugins/grideditor.clipboard.js +44 -7
  33. package/dist/plugins/grideditor.clipboard.min.js +1 -1
  34. package/dist/plugins/grideditor.clipboard.min.js.map +3 -3
  35. package/dist/plugins/grideditor.codemirror-inline.min.js.map +1 -1
  36. package/dist/plugins/grideditor.codemirror.min.js.map +1 -1
  37. package/dist/plugins/grideditor.elements.esm.js +3 -0
  38. package/dist/plugins/grideditor.elements.js +3 -0
  39. package/dist/plugins/grideditor.elements.min.js +1 -1
  40. package/dist/plugins/grideditor.elements.min.js.map +3 -3
  41. package/dist/plugins/grideditor.gutters.min.js.map +1 -1
  42. package/dist/plugins/grideditor.history.esm.js +1 -1
  43. package/dist/plugins/grideditor.history.js +1 -1
  44. package/dist/plugins/grideditor.history.min.js +1 -1
  45. package/dist/plugins/grideditor.history.min.js.map +2 -2
  46. package/dist/plugins/grideditor.inline-style.esm.js +66 -3
  47. package/dist/plugins/grideditor.inline-style.js +66 -3
  48. package/dist/plugins/grideditor.inline-style.min.js +4 -4
  49. package/dist/plugins/grideditor.inline-style.min.js.map +3 -3
  50. package/dist/plugins/grideditor.offcanvas.min.js.map +1 -1
  51. package/dist/plugins/grideditor.order.min.js +1 -1
  52. package/dist/plugins/grideditor.order.min.js.map +1 -1
  53. package/dist/plugins/grideditor.popup.min.js.map +1 -1
  54. package/dist/plugins/grideditor.sections.esm.js +9 -0
  55. package/dist/plugins/grideditor.sections.js +9 -0
  56. package/dist/plugins/grideditor.sections.min.js +1 -1
  57. package/dist/plugins/grideditor.sections.min.js.map +3 -3
  58. package/dist/plugins/grideditor.summernote.esm.js +9 -0
  59. package/dist/plugins/grideditor.summernote.js +9 -0
  60. package/dist/plugins/grideditor.summernote.min.js +1 -1
  61. package/dist/plugins/grideditor.summernote.min.js.map +3 -3
  62. package/dist/plugins/grideditor.tabs.esm.js +3 -0
  63. package/dist/plugins/grideditor.tabs.js +3 -0
  64. package/dist/plugins/grideditor.tabs.min.js +1 -1
  65. package/dist/plugins/grideditor.tabs.min.js.map +3 -3
  66. package/dist/plugins/grideditor.tinymce.esm.js +9 -0
  67. package/dist/plugins/grideditor.tinymce.js +9 -0
  68. package/dist/plugins/grideditor.tinymce.min.js +1 -1
  69. package/dist/plugins/grideditor.tinymce.min.js.map +3 -3
  70. package/docs/events.md +6 -1
  71. package/docs/locale-keys.md +2 -0
  72. package/docs/plugins.md +9 -7
  73. package/example/adapter.html +11 -1
  74. package/example/clipboard.html +7 -4
  75. package/example/{autocols.html → columns.html} +61 -20
  76. package/example/containers.html +13 -2
  77. package/example/{attributes.html → custom-plugins.html} +130 -12
  78. package/example/elements.html +13 -2
  79. package/example/history.html +6 -3
  80. package/example/index.html +30 -81
  81. package/example/playground.html +840 -0
  82. package/example/style.html +291 -0
  83. package/example/text-editors.html +320 -0
  84. package/package.json +1 -1
  85. package/src/js/dom.js +6 -0
  86. package/src/js/grideditor.js +69 -7
  87. package/src/js/inline-style/accordion.js +4 -3
  88. package/src/js/inline-style/fields.js +56 -3
  89. package/src/js/inline-style/options.js +12 -0
  90. package/src/js/locales/grideditor.es.js +2 -0
  91. package/src/js/plugins/grideditor.clipboard.js +61 -11
  92. package/src/js/plugins/grideditor.history.js +3 -3
  93. package/src/js/plugins/grideditor.inline-style.js +10 -0
  94. package/src/js/text/grideditor.text.js +1 -1
  95. package/src/less/grideditor.less +26 -3
  96. package/types/grideditor.d.ts +27 -2
  97. package/example/breakpoints.html +0 -100
  98. package/example/ckeditor.html +0 -110
  99. package/example/custom_editor.html +0 -212
  100. package/example/inline-style.html +0 -163
  101. package/example/plugins.html +0 -251
  102. package/example/summernote.html +0 -114
  103. package/example/utilities.html +0 -200
package/CHANGELOG.md CHANGED
@@ -5,6 +5,44 @@ 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
+ ## [9.0.0-beta.8] - 2026-10-22
9
+
10
+ ### Added
11
+ - inline-style: `inline_style.browse`, the host's file browser. With it the
12
+ background image field has a *Browse…* button that calls it with
13
+ `(done, { node, property, value })`; the url it answers - `done(url)` or a
14
+ promise - goes in as if it had been typed. Without it, the field is the text
15
+ box it was.
16
+
17
+ ### Changed
18
+ - `toolbar_overflow: 'menu'`: the more button comes right after the last add
19
+ button on the line, joined to it as one more button of its group, rather
20
+ than at the far end of the room the line had. The buttons on the right stay
21
+ at the end.
22
+
23
+ ## [9.0.0-beta.7] - 2026-10-21
24
+
25
+ ### Added
26
+ - clipboard: cut. A *Cut* tool beside *Copy* in every drawer that has it, and
27
+ Ctrl+X (⌘X) on the target, with `active_target`. It copies the node and
28
+ removes it as its delete tool does, without asking whatever `confirm_delete`
29
+ says. It is all or nothing: a `before-delete` that turns it away leaves the
30
+ clipboard as it was. The target goes to what held the node before it leaves,
31
+ so a paste right after puts it back. The `before-delete` and `after-delete`
32
+ of a cut have `source: 'cut'`, and `after-copy` has `cut`, true for a cut.
33
+ - The plugin handle's `ge.removeNode(node, { source, confirm, before })`: a node
34
+ removed as its own delete tool does, as asked.
35
+
36
+ ### Changed
37
+ - The plugin handle's `ge.setActiveTarget(null)` takes the target away, and
38
+ answers `true`.
39
+
40
+ ### Fixed
41
+ - history: deleting a node with its tool was two steps, one of them the canvas
42
+ halfway through the node's exit animation. A node animating out is marked
43
+ `ge-leaving` while it goes, and history waits for it: a delete, and a cut,
44
+ is one step. The mark never reaches `getHtml`.
45
+
8
46
  ## [9.0.0-beta.6] - 2026-10-21
9
47
 
10
48
  ### Changed
package/README.md CHANGED
@@ -24,20 +24,18 @@ from any web server, or from GitHub Pages, with no build step.
24
24
  | Demo | What it shows | |
25
25
  | --- | --- | --- |
26
26
  | [example/basic.html](example/basic.html) | The editor with tinyMCE in the content areas | [live](https://themarioga.github.io/grid-editor/example/basic.html) |
27
- | [example/breakpoints.html](example/breakpoints.html) | The six breakpoints and the "all sizes" view | [live](https://themarioga.github.io/grid-editor/example/breakpoints.html) |
28
- | [example/plugins.html](example/plugins.html) | The plugin model, with one written in the page itself | [live](https://themarioga.github.io/grid-editor/example/plugins.html) |
29
- | [example/attributes.html](example/attributes.html) | A plugin of your own: a drawer tool, a modal, and its settings saved as an attribute | [live](https://themarioga.github.io/grid-editor/example/attributes.html) |
27
+ | [example/columns.html](example/columns.html) | The six breakpoints and the "all sizes" view, equal and auto columns, columns per row, and sections | [live](https://themarioga.github.io/grid-editor/example/columns.html) |
28
+ | [example/custom-plugins.html](example/custom-plugins.html) | Plugins of your own: a container, and a drawer tool with a modal that saves an attribute | [live](https://themarioga.github.io/grid-editor/example/custom-plugins.html) |
30
29
  | [example/containers.html](example/containers.html) | Tabs, accordions, popups, offcanvases, carousels and cards, two levels deep | [live](https://themarioga.github.io/grid-editor/example/containers.html) |
31
30
  | [example/elements.html](example/elements.html) | Element level controls, including an element with no visual output | [live](https://themarioga.github.io/grid-editor/example/elements.html) |
32
- | [example/autocols.html](example/autocols.html) | Equal and auto columns, columns per row, and sections | [live](https://themarioga.github.io/grid-editor/example/autocols.html) |
33
- | [example/utilities.html](example/utilities.html) | Bootstrap's responsive utilities, edited per breakpoint | [live](https://themarioga.github.io/grid-editor/example/utilities.html) |
31
+ | [example/style.html](example/style.html) | Inline style with Bootstrap's classes as chips, and the responsive utilities, edited per breakpoint | [live](https://themarioga.github.io/grid-editor/example/style.html) |
34
32
  | [example/locale.html](example/locale.html) | The interface in Spanish, with a language switcher | [live](https://themarioga.github.io/grid-editor/example/locale.html) |
35
- | [example/ckeditor.html](example/ckeditor.html) | CKEditor instead of tinyMCE | [live](https://themarioga.github.io/grid-editor/example/ckeditor.html) |
36
- | [example/summernote.html](example/summernote.html) | Summernote instead of tinyMCE | [live](https://themarioga.github.io/grid-editor/example/summernote.html) |
33
+ | [example/text-editors.html](example/text-editors.html) | TinyMCE, CKEditor, summernote and a text editor of your own, one at a time or together | [live](https://themarioga.github.io/grid-editor/example/text-editors.html) |
37
34
  | [example/clipboard.html](example/clipboard.html) | Copy and paste, within an editor, between two, and between tabs | [live](https://themarioga.github.io/grid-editor/example/clipboard.html) |
38
35
  | [example/wrap_content.html](example/wrap_content.html) | Non-bootstrap markup wrapped into the grid | [live](https://themarioga.github.io/grid-editor/example/wrap_content.html) |
39
36
  | [example/history.html](example/history.html) | The history plugin: undo and redo, with the keyboard and the toolbar | [live](https://themarioga.github.io/grid-editor/example/history.html) |
40
37
  | [example/autosave.html](example/autosave.html) | The autosave plugin: drafts kept as the user edits, offered back after a reload; import and export | [live](https://themarioga.github.io/grid-editor/example/autosave.html) |
38
+ | [example/playground.html](example/playground.html) | Every plugin on one canvas, with settings to turn things on and off and the options as code | [live](https://themarioga.github.io/grid-editor/example/playground.html) |
41
39
  | [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) |
42
40
 
43
41
  [example/angular](example/angular) is the editor in an Angular app, from the npm
@@ -490,7 +488,7 @@ __`settings_panel`:__ Where the settings a gear opens are shown - a node's id, i
490
488
  | `'inline'` | Unfolded in the drawer itself |
491
489
  | `'sidebar'` | An offcanvas that stays on the right while you edit, and makes room for itself on the page. A click on any node of the canvas shows its settings, and there is no gear. It turns `active_target` on, so the node clicked is the target, and also where the toolbar adds; `active_target: false` with it is an error |
492
490
 
493
- Each is titled after its node ("Column settings"), the node is outlined while its settings are open, and Escape closes them. The editor opens and places them itself, with Bootstrap's markup and css: a page needs neither Popper nor Bootstrap's javascript, and the modal is Bootstrap's own when Bootstrap is there. [example/utilities.html](example/utilities.html) switches between the four.
491
+ Each is titled after its node ("Column settings"), the node is outlined while its settings are open, and Escape closes them. The editor opens and places them itself, with Bootstrap's markup and css: a page needs neither Popper nor Bootstrap's javascript, and the modal is Bootstrap's own when Bootstrap is there. [example/style.html](example/style.html) switches between them.
494
492
 
495
493
  ```javascript
496
494
  new GridEditor('#myGrid', { settings_panel: 'popover' });
@@ -720,10 +718,26 @@ new GridEditor('#myGrid', {
720
718
  },
721
719
  spacing: { values: ['0', '2', '4'], scale: [/* if you changed $spacers */] },
722
720
  visibility: { drawer: false }, // no eye in the drawers, the display field only
721
+ browse: function(done, context) { // a button beside the background image opens your file browser
722
+ myBrowser.open(function(url) { done(url); });
723
+ },
723
724
  },
724
725
  });
725
726
  ```
726
727
 
728
+ `browse` is your file browser, for the fields that take a url - the background
729
+ image. Without it they are a text box; with it, a button beside the box calls
730
+ `browse(done, { node, property, value })`, where `value` is what the field
731
+ shows. Answer with `done(url)`, or return a promise of the url: the first
732
+ answer counts. `done()`, `null`, an empty text and a promise that never
733
+ answers leave the field as it was, and the url goes in as if it had been
734
+ typed. An answer after the node left the canvas, or the editor was
735
+ destroyed, is ignored. The editor does nothing for the browser's own window:
736
+ a Bootstrap modal, a popup window or a `<input type="file">` work over an
737
+ open panel, but a dialog written in the page that is not a Bootstrap modal
738
+ can lose the focus to the panel's, and with `active_target` a click in it
739
+ puts the selection away - in the sidebar, empties it.
740
+
727
741
  The sections are `size`, `spacing`, `border`, `background`, `text`,
728
742
  `typography`, `display`, `flex`, `position` and `custom`. `properties` chooses and
729
743
  orders a section's inline fields; the per breakpoint ones stay while the
@@ -737,7 +751,7 @@ A node that is flex or grid in the view you are in - a column with `d-flex`,
737
751
  a row with `flex-nowrap` - has its drawer on top, out of the flow, so the
738
752
  canvas lays out its content as the page will.
739
753
 
740
- See [example/inline-style.html](example/inline-style.html).
754
+ See [example/style.html](example/style.html).
741
755
 
742
756
  ### Responsive utilities
743
757
 
@@ -782,7 +796,7 @@ new GridEditor('#myGrid', {
782
796
  });
783
797
  ```
784
798
 
785
- See [example/utilities.html](example/utilities.html), and
799
+ See [example/style.html](example/style.html), and
786
800
  [docs/plugins.md](docs/plugins.md#utility-plugins) for writing one.
787
801
 
788
802
  ### Sections
@@ -817,8 +831,8 @@ A plugin:
817
831
  <script src="grid-editor/dist/plugins/grideditor.clipboard.min.js"></script>
818
832
  ```
819
833
 
820
- Every row, column, section, text, container and element gets a *Copy* tool in its
821
- drawer. While something is copied, a *Paste* tool shows wherever it can go, and
834
+ Every row, column, section, text, container and element gets a *Copy* tool and a
835
+ *Cut* tool in its drawer. While something is copied, a *Paste* tool shows wherever it can go, and
822
836
  nowhere else:
823
837
 
824
838
  | Copied | Pasted into |
@@ -853,17 +867,30 @@ A paste is an add like any other: `before-add-*` and `after-add-*` with
853
867
  `source: 'paste'`, and canceling the first turns it away. A copy fires
854
868
  `grideditor:after-copy`.
855
869
 
870
+ *Cut* is a copy and a delete in one: what it copies is what *Copy* would, and the
871
+ node goes out as its delete tool would take it, but without asking, whatever
872
+ `confirm_delete` says. It is all or nothing: if a `before-delete` handler turns
873
+ the delete away, nothing is copied and the clipboard keeps what it had. A cut
874
+ fires `before-delete`, `after-copy` (with `cut: true`) and `after-delete`, and
875
+ the two deletes have `source: 'cut'`. With `active_target`, the target goes to
876
+ what held the node - a text's column, a column's row, a row's column or section,
877
+ a container's pane's container - so a paste right after puts it back there; a
878
+ top-level row or section leaves no target. A cut is one step for the history
879
+ plugin, and what was cut stays in the clipboard after an undo. Tabs and
880
+ accordion items have no *Cut*, as they have no *Copy*.
881
+
856
882
  With `active_target` - which `settings_panel: 'sidebar'` turns on - there are
857
- shortcuts too, Ctrl+C and Ctrl+V (⌘C and ⌘V on a Mac). Ctrl+C copies the
858
- target, as its *Copy* tool would, whatever its level: a container, a row, an
859
- element, a text. Ctrl+V pastes into the target as the toolbar adds to it - at
860
- the end of what it holds, in the row or the column it lacks, a section after
861
- the block it is in. With no target, they do nothing. They go to the editor used last, and leave
862
- the keys to the browser while a field or a text is being edited, while text
863
- is selected (for Ctrl+C), while a settings panel, a dialog or the delete
864
- confirmation is open, and outside editing. They use the same store as the
865
- tools: the system clipboard is not read or written. `after-copy` says
866
- `source: 'shortcut'` for a copy made with them.
883
+ shortcuts too, Ctrl+C, Ctrl+X and Ctrl+V (⌘C, ⌘X and ⌘V on a Mac). Ctrl+C copies
884
+ the target, as its *Copy* tool would, whatever its level: a container, a row, an
885
+ element, a text. Ctrl+X cuts it, as its *Cut* tool would. Ctrl+V pastes into the
886
+ target as the toolbar adds to it - at the end of what it holds, in the row or the
887
+ column it lacks, a section after the block it is in. With no target, they do
888
+ nothing. They go to the editor used last, and leave the keys to the browser while
889
+ a field or a text is being edited, while text is selected (for Ctrl+C and
890
+ Ctrl+X), while a settings panel, a dialog or the delete confirmation is open, and
891
+ outside editing. They use the same store as the tools: the system clipboard is
892
+ not read or written. `after-copy` says `source: 'shortcut'` for a copy or a cut
893
+ made with them.
867
894
 
868
895
  __`clipboard`:__ `{ shortcuts }`, the plugin's settings. `shortcuts` defaults to
869
896
  `active_target`; `false` turns them off, and `true` without `active_target`
@@ -1175,15 +1202,15 @@ same way, `codemirror.config` included, and a textarea without it.
1175
1202
 
1176
1203
  Grid editor comes with support for the following rich text editors (RTEs), each a plugin of its own to load after the editor:
1177
1204
  * [TinyMCE](http://www.tinymce.com/) 7 - `dist/plugins/grideditor.tinymce.min.js` - [(example)](example/basic.html)
1178
- * [summernote](http://summernote.org/) 0.9 - `dist/plugins/grideditor.summernote.min.js` - [(example)](example/summernote.html)
1179
- * [CKEditor](http://ckeditor.com/) 5 - `dist/plugins/grideditor.ckeditor.min.js` - [(example)](example/ckeditor.html)
1205
+ * [summernote](http://summernote.org/) 0.9 - `dist/plugins/grideditor.summernote.min.js` - [(example)](example/text-editors.html?editor=summernote)
1206
+ * [CKEditor](http://ckeditor.com/) 5 - `dist/plugins/grideditor.ckeditor.min.js` - [(example)](example/text-editors.html?editor=ckeditor)
1180
1207
 
1181
1208
  A text editor is chosen by `content_types`, not by the `plugins` setting: a page
1182
1209
  that names its containers in `plugins` still has its editor. Summernote 0.9.1
1183
1210
  calls `$.now()`, which jQuery 4 removed; its plugin gives it back, and only if
1184
1211
  it is missing. Another editor is a plugin of your own:
1185
1212
  [docs/plugins.md](docs/plugins.md#text) says how, and
1186
- [example/custom_editor.html](example/custom_editor.html) is one.
1213
+ [example/text-editors.html](example/text-editors.html?editor=simpletext) is one.
1187
1214
 
1188
1215
  __`content_types`:__ Specify the RTEs to offer, in order. Valid values: any of `'tinymce'`, `'summernote'`, `'ckeditor'` whose plugin is loaded. Default value: every text editor loaded, in the order the page loaded them.
1189
1216
 
@@ -1195,7 +1222,7 @@ new GridEditor('#myGrid', {
1195
1222
 
1196
1223
  __`ckeditor.config`:__ Specify CKEditor 5 config, when using the `ckeditor` `content_types`:
1197
1224
  anything `InlineEditor.create` takes. See the [CKEditor documentation](https://ckeditor.com/docs/ckeditor5/latest/).
1198
- Also check out the [ckeditor example](example/ckeditor.html).
1225
+ Also check out the [ckeditor example](example/text-editors.html?editor=ckeditor).
1199
1226
 
1200
1227
  Load CKEditor 5's browser build, which puts it on the page as `window.CKEDITOR`:
1201
1228
 
@@ -1233,7 +1260,7 @@ new GridEditor('#myGrid', {
1233
1260
 
1234
1261
  __`summernote.config`:__ Specify summernote config, when using the `summernote` `content_types`.
1235
1262
  See the [summernote documentation](http://summernote.org/deep-dive/).
1236
- Also check out the [summernote example](example/summernote.html).
1263
+ Also check out the [summernote example](example/text-editors.html?editor=summernote).
1237
1264
 
1238
1265
  ```javascript
1239
1266
  new GridEditor('#myGrid', {
package/UPGRADING.md CHANGED
@@ -388,7 +388,7 @@ same from it.
388
388
  that loads none of the shipped editors: `texts` is their own registry. An
389
389
  editor of your own is a feature plugin that declares its type with
390
390
  `textTypes`; [docs/plugins.md](docs/plugins.md#text) has the contract, and
391
- [example/custom_editor.html](example/custom_editor.html) is one in full.
391
+ [example/text-editors.html](example/text-editors.html?editor=simpletext) has one in full.
392
392
 
393
393
  * __No *Add text* tool in the columns' drawers.__ 5.3 put one there; a text
394
394
  is added with the toolbar's *Text* button, dragged into the column, or