@themarioga/grid-editor 8.0.0 → 8.2.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/CHANGELOG.md CHANGED
@@ -5,6 +5,36 @@ 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
+ ## [8.2.0] - 2026-09-30
9
+
10
+ ### Added
11
+ - `active_target`: with `true`, a click in a column or a section makes it
12
+ where the toolbar's buttons add, marked with a dashed outline, instead of
13
+ the end of the canvas. What a button makes goes where a drop at the
14
+ target's end would put it: a row into a column as a nested row, a text or
15
+ a container as it is, a section after the block the target is in. The
16
+ toolbar's paste button pastes there too. Escape, a click on no column or
17
+ section, or deleting the target clears it. `getActiveTarget()`,
18
+ `setActiveTarget(node | selector | null)` and the `grideditor:target-change`
19
+ event (`callbacks.target_change`). Off by default.
20
+
21
+ ## [8.1.0] - 2026-09-30
22
+
23
+ ### Added
24
+ - `resize.tools`: `false` takes the narrower and wider tools (− +) out of
25
+ the columns' drawers, leaving the handle on the edge. With
26
+ `resize.enabled: false`, which takes the handle out, a column is resized
27
+ with the tools only; the default keeps both.
28
+ - `indent.tools`: `false` takes the indent tools out of the columns'
29
+ drawers. The offsets the markup has are kept, and `createColumn` still
30
+ takes one.
31
+
32
+ ### Fixed
33
+ - A shadow in the inline-style plugin's Border and Text sections, turned to
34
+ text with *Edit as text*, can go back to the builder: *Edit with the
35
+ builder* (`inline_style.shadow_builder_mode`), when the value is one
36
+ shadow or none.
37
+
8
38
  ## [8.0.0] - 2026-09-30
9
39
 
10
40
  The first stable 8.0: what 8.0.0-beta.1 to 8.0.0-beta.3 below brought, and
package/README.md CHANGED
@@ -174,6 +174,8 @@ has, with the options it was made with, and warns once.
174
174
  | `destroy` | — | `this` | Deinit, drop the controls, unbind, forget the instance |
175
175
  | `changeView` | `breakpoint` | `this` | `'xs'`…`'xxl'`, or `'all'` to edit every breakpoint at once, with one class |
176
176
  | `getView` | — | `String` | The view the editor is in |
177
+ | `getActiveTarget` | — | `Element` | With `active_target`, the column or section the toolbar adds to, or `null` |
178
+ | `setActiveTarget` | `node` | `this` | Make a column or section - an element or a selector - the one the toolbar adds to, or `null` for none |
177
179
  | `setLocale` | `code` | `this` | Switch language and re-render the controls |
178
180
  | `createRow` | `layout?`, `options?` | `Element` | A row, optionally with columns: `createRow([8, 4])`, `createRow(['auto', 'equal'])`, `createRow({ row_cols: { xs: 1, md: 3 }, columns: 6 })` |
179
181
  | `createColumn` | `size`, `options?` | `Element` | An empty column: units, `'equal'` or `'auto'`; no size into a row with row-cols takes the row's share. `options`: `offset`, `content` - a text of the first editor offered, or plain content with none |
@@ -361,6 +363,15 @@ new GridEditor('#myGrid', {
361
363
  });
362
364
  ```
363
365
 
366
+ __`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, 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.
367
+
368
+ ```javascript
369
+ const ge = new GridEditor('#myGrid', { active_target: true });
370
+ ge.canvas.addEventListener('grideditor:target-change', function(e) {
371
+ console.log('the toolbar adds to', e.detail.target || 'the end of the canvas');
372
+ });
373
+ ```
374
+
364
375
  __`custom_filter`:__ Allows the execution of a custom function before initialization and after de-initialization. Accepts a functions or a function name as string.
365
376
  Gives the `canvas` element and `isInit` (true/false) as parameter.
366
377
 
@@ -398,6 +409,10 @@ new GridEditor('#myGrid', {
398
409
 
399
410
  __`valid_col_offsets`:__ The same, for the indent buttons. Default `[0, 1, … 11]`.
400
411
 
412
+ __`indent`:__ The indent tools in a column's drawer. `indent: { tools: false }`
413
+ takes them out; the offsets the markup has are kept, and
414
+ `createColumn(size, { offset })` still indents. Default `{ tools: true }`.
415
+
401
416
  __`add_column`:__ What the add column tool in a row's drawer does. A click adds a column of `size`; holding the tool for `delay` milliseconds — with the pointer or with a finger — offers the widths in `valid_col_sizes` instead, marking the ones that no longer fit the row. Defaults:
402
417
 
403
418
  ```javascript
@@ -464,12 +479,14 @@ new GridEditor('#myGrid', {
464
479
 
465
480
  __`default_view`:__ The view the editor starts in. Default `'all'`, which writes one class for every breakpoint at once — what a layout that needs no per-device tuning wants.
466
481
 
467
- __`resize`:__ Resizing a column by dragging its edge. Defaults:
482
+ __`resize`:__ Resizing a column: by dragging its edge, and with the
483
+ narrower and wider tools (− +) in its drawer. Defaults:
468
484
 
469
485
  ```javascript
470
486
  new GridEditor('#myGrid', {
471
487
  resize: {
472
- enabled: true,
488
+ enabled: true, // the handle on the edge; false leaves the − + tools only
489
+ tools: true, // the − + tools; false leaves the handle only
473
490
  handles: 'e', // 'w' for a right to left page, 'e, w' for both
474
491
  balance: 'next', // the following column absorbs the change; false lets the row wrap
475
492
  },