@themarioga/grid-editor 8.10.1 → 9.0.0-beta.1
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 +9 -0
- package/README.md +3 -3
- package/UPGRADING.md +14 -0
- package/dist/grideditor.bundle.min.js +2 -2
- package/dist/grideditor.d.ts +3 -3
- package/dist/grideditor.esm.js +8 -2
- package/dist/grideditor.js +8 -2
- package/dist/grideditor.min.js +1 -1
- package/dist/grideditor.min.js.map +2 -2
- package/package.json +1 -1
- package/src/js/grideditor.js +11 -1
- package/types/grideditor.d.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,15 @@ 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.1] - 2026-10-20
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- **BREAKING:** `settings_panel: 'sidebar'` turns `active_target` on. A click
|
|
12
|
+
in a column or a section is also where the toolbar's buttons add, as with
|
|
13
|
+
`active_target: true`, instead of the end of the canvas.
|
|
14
|
+
- **BREAKING:** `settings_panel: 'sidebar'` with `active_target: false` throws
|
|
15
|
+
a `TypeError` from the constructor, which builds nothing.
|
|
16
|
+
|
|
8
17
|
## [8.10.1] - 2026-10-13
|
|
9
18
|
|
|
10
19
|
### 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
|
|
package/UPGRADING.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
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
|
+
* __`settings_panel: 'sidebar'` with `active_target: false` throws.__ The
|
|
11
|
+
constructor raises a `TypeError` and builds nothing. Leave `active_target`
|
|
12
|
+
out, or give it `true`.
|
|
13
|
+
|
|
14
|
+
|
|
1
15
|
Upgrading from grid-editor `7.x` to `8.0`
|
|
2
16
|
=========================================
|
|
3
17
|
|