@themarioga/grid-editor 8.10.1 → 9.0.0-beta.2
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 +23 -0
- package/README.md +21 -3
- package/UPGRADING.md +19 -0
- package/dist/grideditor.bundle.min.js +2 -2
- package/dist/grideditor.d.ts +6 -4
- package/dist/grideditor.esm.js +43 -2
- package/dist/grideditor.js +43 -2
- package/dist/grideditor.min.js +1 -1
- package/dist/grideditor.min.js.map +3 -3
- package/dist/plugins/grideditor.clipboard.esm.js +116 -2
- package/dist/plugins/grideditor.clipboard.js +116 -2
- package/dist/plugins/grideditor.clipboard.min.js +1 -1
- package/dist/plugins/grideditor.clipboard.min.js.map +3 -3
- package/docs/events.md +1 -1
- package/docs/plugins.md +4 -0
- package/package.json +1 -1
- package/src/js/grideditor.js +32 -1
- package/src/js/plugins/grideditor.clipboard.js +125 -2
- package/types/grideditor.d.ts +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,29 @@ 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.2] - 2026-10-20
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- clipboard: Ctrl+C and Ctrl+V (⌘C and ⌘V) with `active_target`, and so with
|
|
12
|
+
the sidebar. Ctrl+C copies the node selected or the target; Ctrl+V pastes
|
|
13
|
+
into the target, or the node selected, by the paste rules the toolbar and
|
|
14
|
+
the tools already have. The keys stay the browser's while a field or a
|
|
15
|
+
text is edited, while text is selected, or while a panel or a dialog is
|
|
16
|
+
open. They use the plugin's own store, never the system clipboard, and go
|
|
17
|
+
to the editor used last. `clipboard: { shortcuts: false }` turns them off;
|
|
18
|
+
`after-copy` says `source: 'shortcut'` for them.
|
|
19
|
+
- The plugin handle has `getSelected()`, `getActiveTarget()`, `panelOpen()`
|
|
20
|
+
and `contains(node)`.
|
|
21
|
+
|
|
22
|
+
## [9.0.0-beta.1] - 2026-10-20
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
- **BREAKING:** `settings_panel: 'sidebar'` turns `active_target` on. A click
|
|
26
|
+
in a column or a section is also where the toolbar's buttons add, as with
|
|
27
|
+
`active_target: true`, instead of the end of the canvas.
|
|
28
|
+
- **BREAKING:** `settings_panel: 'sidebar'` with `active_target: false` throws
|
|
29
|
+
a `TypeError` from the constructor, which builds nothing.
|
|
30
|
+
|
|
8
31
|
## [8.10.1] - 2026-10-13
|
|
9
32
|
|
|
10
33
|
### Fixed
|
package/README.md
CHANGED
|
@@ -182,7 +182,7 @@ has, with the options it was made with, and warns once.
|
|
|
182
182
|
| `destroy` | — | `this` | Deinit, drop the controls, unbind, forget the instance |
|
|
183
183
|
| `changeView` | `breakpoint` | `this` | `'xs'`…`'xxl'`, or `'all'` to edit every breakpoint at once, with one class |
|
|
184
184
|
| `getView` | — | `String` | The view the editor is in |
|
|
185
|
-
| `getActiveTarget` | — | `Element` | With `active_target
|
|
185
|
+
| `getActiveTarget` | — | `Element` | With `active_target` - which the `'sidebar'` panel turns on - the column or section the toolbar adds to, or `null` |
|
|
186
186
|
| `setActiveTarget` | `node` | `this` | Make a column or section - an element or a selector - the one the toolbar adds to, or `null` for none |
|
|
187
187
|
| `getSelected` | — | `Element` | With `settings_panel: 'sidebar'`, the node whose settings the sidebar shows, or `null`. Always `null` without it |
|
|
188
188
|
| `setSelected` | `node` | `this` | With `settings_panel: 'sidebar'`, show the settings of a node with settings - an element or a selector - or `null` for none. It does not unfold a sidebar that is folded away, and does nothing without the `'sidebar'` panel |
|
|
@@ -398,7 +398,7 @@ new GridEditor('#myGrid', {
|
|
|
398
398
|
});
|
|
399
399
|
```
|
|
400
400
|
|
|
401
|
-
__`active_target`:__ Whether a click in a column or a section makes it where the toolbar's buttons add. Default `false`, and the toolbar adds at the end of the canvas. With `true`, the column or section clicked last - marked with a dashed outline - gets what a button makes at its end, as if the button had been dropped there: a text or a container goes into a column as it is, and into a section in a row of its own; a row goes into a column as a nested row; a section, which only the canvas takes, goes to the canvas just after the block the target is in. The toolbar's paste button pastes there too. Escape, a click in the canvas on no column or section, a click again on the target's own background or drawer (not on a tool or on what it holds), or deleting the target clears it, and the toolbar adds at the end of the canvas again; dragging a button still drops it where it is let go.
|
|
401
|
+
__`active_target`:__ Whether a click in a column or a section makes it where the toolbar's buttons add. Default `false`, and the toolbar adds at the end of the canvas. With `settings_panel: 'sidebar'` it is on without being asked, and giving `false` with the sidebar throws a `TypeError`: both follow the node last clicked. With `true`, the column or section clicked last - marked with a dashed outline - gets what a button makes at its end, as if the button had been dropped there: a text or a container goes into a column as it is, and into a section in a row of its own; a row goes into a column as a nested row; a section, which only the canvas takes, goes to the canvas just after the block the target is in. The toolbar's paste button pastes there too. Escape, a click in the canvas on no column or section, a click again on the target's own background or drawer (not on a tool or on what it holds), or deleting the target clears it, and the toolbar adds at the end of the canvas again; dragging a button still drops it where it is let go.
|
|
402
402
|
|
|
403
403
|
```javascript
|
|
404
404
|
const ge = new GridEditor('#myGrid', { active_target: true });
|
|
@@ -479,7 +479,7 @@ __`settings_panel`:__ Where the settings a gear opens are shown - a node's id, i
|
|
|
479
479
|
| `'popover'` | A Bootstrap popover under the gear, or over it when there is more room there; a press anywhere else puts it away |
|
|
480
480
|
| `'modal'` | A Bootstrap modal |
|
|
481
481
|
| `'inline'` | Unfolded in the drawer itself |
|
|
482
|
-
| `'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 |
|
|
482
|
+
| `'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 also where the toolbar adds; `active_target: false` with it is an error |
|
|
483
483
|
|
|
484
484
|
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.
|
|
485
485
|
|
|
@@ -844,6 +844,24 @@ A paste is an add like any other: `before-add-*` and `after-add-*` with
|
|
|
844
844
|
`source: 'paste'`, and canceling the first turns it away. A copy fires
|
|
845
845
|
`grideditor:after-copy`.
|
|
846
846
|
|
|
847
|
+
With `active_target` - which `settings_panel: 'sidebar'` turns on - there are
|
|
848
|
+
shortcuts too, Ctrl+C and Ctrl+V (⌘C and ⌘V on a Mac). Ctrl+C copies the node
|
|
849
|
+
selected in the sidebar or, with none, the target, as its *Copy* tool would.
|
|
850
|
+
Ctrl+V pastes into the target as the toolbar's paste button would - a row at
|
|
851
|
+
its end, a section after the block it is in - and a text, a container or an
|
|
852
|
+
element at the end of a target column, as its *Paste* tool would; with no
|
|
853
|
+
target, into the node selected, as its *Paste* tool would. What does not fit
|
|
854
|
+
there is not pasted anywhere else. They go to the editor used last, and leave
|
|
855
|
+
the keys to the browser while a field or a text is being edited, while text
|
|
856
|
+
is selected (for Ctrl+C), while a settings panel, a dialog or the delete
|
|
857
|
+
confirmation is open, and outside editing. They use the same store as the
|
|
858
|
+
tools: the system clipboard is not read or written. `after-copy` says
|
|
859
|
+
`source: 'shortcut'` for a copy made with them.
|
|
860
|
+
|
|
861
|
+
__`clipboard`:__ `{ shortcuts }`, the plugin's settings. `shortcuts` defaults to
|
|
862
|
+
`active_target`; `false` turns them off, and `true` without `active_target`
|
|
863
|
+
warns and does nothing.
|
|
864
|
+
|
|
847
865
|
### Autosave
|
|
848
866
|
|
|
849
867
|
A plugin:
|
package/UPGRADING.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
+
Upgrading from grid-editor `8.x` to `9.0`
|
|
2
|
+
=========================================
|
|
3
|
+
|
|
4
|
+
* __`settings_panel: 'sidebar'` turns `active_target` on.__ A click on a
|
|
5
|
+
column or a section is now also where the toolbar's buttons add - a text, a
|
|
6
|
+
row, a container, a paste - instead of the end of the canvas. There is no
|
|
7
|
+
setting to have the sidebar without it. Clicking the canvas's background, or
|
|
8
|
+
pressing Escape, clears the target and the toolbar adds at the end of the
|
|
9
|
+
canvas again, as before.
|
|
10
|
+
* __With the clipboard plugin and `active_target`, Ctrl+C and Ctrl+V copy
|
|
11
|
+
and paste nodes.__ They act on the node selected or the target, and leave
|
|
12
|
+
the keys alone while a field or a text has the focus or text is selected.
|
|
13
|
+
`clipboard: { shortcuts: false }` turns them off. This came in
|
|
14
|
+
`9.0.0-beta.2`.
|
|
15
|
+
* __`settings_panel: 'sidebar'` with `active_target: false` throws.__ The
|
|
16
|
+
constructor raises a `TypeError` and builds nothing. Leave `active_target`
|
|
17
|
+
out, or give it `true`.
|
|
18
|
+
|
|
19
|
+
|
|
1
20
|
Upgrading from grid-editor `7.x` to `8.0`
|
|
2
21
|
=========================================
|
|
3
22
|
|