@themarioga/grid-editor 5.3.0 → 6.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.
Files changed (38) hide show
  1. package/BUILDING.md +2 -4
  2. package/CHANGELOG.md +38 -0
  3. package/README.md +21 -8
  4. package/UPGRADING.md +57 -12
  5. package/dist/grideditor.css +46 -1
  6. package/dist/grideditor.min.css +1 -1
  7. package/dist/grideditor.min.css.map +1 -1
  8. package/dist/jquery.grideditor.bundle.min.js +2 -2
  9. package/dist/jquery.grideditor.js +104 -416
  10. package/dist/jquery.grideditor.min.js +1 -1
  11. package/dist/jquery.grideditor.min.js.map +1 -1
  12. package/dist/plugins/grideditor.ckeditor.js +2 -1
  13. package/dist/plugins/grideditor.ckeditor.min.js.map +1 -1
  14. package/dist/plugins/grideditor.clipboard.js +1 -11
  15. package/dist/plugins/grideditor.clipboard.min.js +1 -1
  16. package/dist/plugins/grideditor.clipboard.min.js.map +1 -1
  17. package/dist/plugins/grideditor.elements.js +66 -38
  18. package/dist/plugins/grideditor.elements.min.js +1 -1
  19. package/dist/plugins/grideditor.elements.min.js.map +1 -1
  20. package/dist/plugins/grideditor.summernote.js +2 -1
  21. package/dist/plugins/grideditor.summernote.min.js.map +1 -1
  22. package/dist/plugins/grideditor.tinymce.js +2 -1
  23. package/dist/plugins/grideditor.tinymce.min.js.map +1 -1
  24. package/docs/events.md +4 -3
  25. package/docs/plugins.md +16 -19
  26. package/example/attributes.html +21 -37
  27. package/example/elements.html +25 -20
  28. package/example/plugins.html +5 -5
  29. package/example/utilities.html +1 -1
  30. package/package.json +1 -1
  31. package/src/js/jquery.grideditor.js +103 -18
  32. package/src/js/plugins/grideditor.ckeditor.js +2 -1
  33. package/src/js/plugins/grideditor.clipboard.js +1 -11
  34. package/src/js/plugins/grideditor.elements.js +66 -38
  35. package/src/js/plugins/grideditor.summernote.js +2 -1
  36. package/src/js/plugins/grideditor.tinymce.js +2 -1
  37. package/src/less/grideditor.less +54 -1
  38. package/src/js/compat/bundled-texts.js +0 -14
package/BUILDING.md CHANGED
@@ -22,10 +22,8 @@ the languages and the container plugins it actually wants. See
22
22
  [docs/plugins.md](docs/plugins.md) for what a container plugin is.
23
23
 
24
24
  The text editor plugins - tinyMCE, CKEditor and summernote - are built to
25
- `dist/plugins/` like the others, and up to 6.0 also go into the main bundle,
26
- followed by `src/js/compat/bundled-texts.js`, which marks them as the bundle's
27
- copies so the editor can warn a page that relies on them. 6.0 drops both from
28
- `jsFiles` in the Gruntfile.
25
+ `dist/plugins/` like the others, and like them are not part of the main
26
+ bundle. Up to 5.x the bundle carried a copy of each.
29
27
 
30
28
  One more file comes out of it: `dist/jquery.grideditor.bundle.min.js`, the
31
29
  minified editor concatenated with the copy of SortableJS in `node_modules`,
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
+ ## [6.0.0-beta.1] - 2026-09-23
9
+ ### Changed
10
+ - **Elements are blocks of the column.** An element sits in a column beside
11
+ its texts, rows and containers, never inside a content area's text, and
12
+ drags within a column and between columns; the canvas and sections turn one
13
+ away. Markup 5.x saved, with elements in the text, is converted as the editor
14
+ starts: a content area is cut at each element among its own children, the
15
+ text after going into a new content area of the same type. Rows and
16
+ containers inside a content area come out the same way. `getPlainHtml`
17
+ publishes what 5.x published, except that a content area's own id and classes
18
+ stay on its first part. See [UPGRADING.md](UPGRADING.md).
19
+ - **The text editors are not in the main bundle**, nor in the bundle with
20
+ SortableJS: load `dist/plugins/grideditor.<editor>.min.js`.
21
+ - `elements.auto: true` makes every loose node of a column an element.
22
+ - `createElement` into a content area puts the element beside it, and warns.
23
+ - A text dragged between columns is `kind: 'text'`, as when it is added or
24
+ deleted; it was `kind: 'content'`.
25
+ - Elements carry no `contenteditable` and their drawers no `data-mce-bogus`.
26
+ - While a text is being edited its drawer stays faint, so as not to hide the
27
+ end of the line being typed, until the pointer is on the drawer itself; with
28
+ its settings open it stays whole.
29
+
30
+ ### Added
31
+ - A feature plugin's `cuts`: the nodes that are never part of a text, which
32
+ cut the content area they sit in.
33
+
34
+ ### Removed
35
+ - The copies of the text editors in the main bundle, and the warning about
36
+ using them.
37
+
38
+ ## [5.3.1] - 2026-09-23
39
+ ### Changed
40
+ - A text's drawer sits over the text's top right corner instead of in a bar
41
+ above it, and takes no room: in 5.3.0 every text made its column about
42
+ 35px taller. It shows while the pointer is over the text, while the text is
43
+ being edited or holds the focus, while its settings are open (across the
44
+ text then, so the panel has room) and during a drag.
45
+
8
46
  ## [5.3.0] - 2026-09-23
9
47
  ### Added
10
48
  - **Text as a block.** Each content area in a column is a text block while
package/README.md CHANGED
@@ -47,7 +47,7 @@ Installation
47
47
  * If you want to use the tinyMCE integration, include tinyMCE 6 as well, and `dist/plugins/grideditor.tinymce.min.js` after the editor. The tinyMCE jQuery plugin is no longer needed, and no longer exists as of tinyMCE 6.
48
48
  * If you want to use the summernote integration, include summernote and `dist/plugins/grideditor.summernote.min.js`.
49
49
  * If you want to use the CKEditor integration... you get the point: CKEditor and `dist/plugins/grideditor.ckeditor.min.js`.
50
- * Up to 5.x the main bundle still carries a copy of the three, so a page that does not load the plugin keeps working, and the console says, once, to load it. 6.0 leaves the copies out.
50
+ * Up to 5.x the main bundle carried a copy of the three; since 6.0 the plugin of the editor you use has to be loaded, as above. See [UPGRADING.md](UPGRADING.md).
51
51
  * From npm:
52
52
 
53
53
  ```
@@ -411,7 +411,11 @@ it, and a drawer of its own - move, which editor, settings, the host's
411
411
  clipboard copies it, and spacing, text alignment and visibility apply to it.
412
412
  The markup does not change: the drawer sits beside the content area in a
413
413
  wrapper that only exists while editing, because inside it the text editor would
414
- take it for text.
414
+ take it for text. It sits over the text's top right corner and takes no room,
415
+ showing while the pointer is over the text, while the text is being edited or
416
+ holds the focus, and while its settings are open. While the text is being
417
+ edited it stays faint, not to hide the end of the line being typed, until the
418
+ pointer is on the drawer itself.
415
419
 
416
420
  A column's drawer has an *Add text* tool, and the toolbar a *Text* button, one
417
421
  per editor when `content_types` offers several (*Text (tinyMCE)*, *Text
@@ -431,9 +435,9 @@ __`text_classes`:__ Preset class toggles on a text's settings panel, as `row_cla
431
435
 
432
436
  ### Elements
433
437
 
434
- An element is a node inside a content area that the editor treats as one
435
- movable, deletable thing instead of as rich text. It is a plugin, like the
436
- containers:
438
+ An element is a node the editor treats as one movable, deletable block instead
439
+ of as rich text: a block of the column, beside its texts, rows and containers,
440
+ never part of a text. It is a plugin, like the containers:
437
441
 
438
442
  ```html
439
443
  <script src="grid-editor/dist/plugins/grideditor.elements.min.js"></script>
@@ -442,11 +446,20 @@ containers:
442
446
  You mark the elements themselves:
443
447
 
444
448
  ```html
445
- <div class="ge-content">
449
+ <div class="col-md-6">
450
+ <div class="ge-content"><p>Some text</p></div>
446
451
  <blockquote data-ge-element="quote" data-ge-label="Pull quote">…your markup…</blockquote>
447
452
  </div>
448
453
  ```
449
454
 
455
+ Up to 5.x an element lived inside a content area, among its text. Markup saved
456
+ that way still loads: each element comes out of the text it sits in, into the
457
+ column, and the text is cut there - before it, and after it in a new content
458
+ area of the same type. Only a content area's own children count, as in 5.x;
459
+ a marked node inside a paragraph is text. What `getPlainHtml` publishes is the
460
+ same as before. `createElement` with `appendTo` a content area puts the element
461
+ beside it instead, with a warning.
462
+
450
463
  __`elements`:__ Defaults:
451
464
 
452
465
  ```javascript
@@ -454,7 +467,7 @@ $('#myGrid').gridEditor({
454
467
  elements: {
455
468
  enabled: 'auto', // on when the page has any; true or false to decide yourself
456
469
  selector: '[data-ge-element]', // what counts as an element
457
- auto: false, // true treats every child of a content area as one
470
+ auto: false, // true treats every loose node of a column as one
458
471
  },
459
472
  });
460
473
  ```
@@ -560,7 +573,7 @@ nowhere else:
560
573
  | a section | the canvas, from the toolbar's paste button |
561
574
  | a container (tabs, accordion, popup, card) | a column |
562
575
  | a text | a column |
563
- | an element | a column's content area |
576
+ | an element | a column |
564
577
 
565
578
  The toolbar's paste button is the clipboard icon on the right, beside the
566
579
  source and preview buttons, and shows only while a row or a section is copied.
package/UPGRADING.md CHANGED
@@ -1,25 +1,70 @@
1
- Getting ready for grid-editor `6.*`, from `5.2`
2
- ===============================================
1
+ Upgrading from grid-editor `5.*` to `6.*`
2
+ =========================================
3
3
 
4
- Nothing here breaks in 5.x. It is what 6.0 will need, and 5.2 already
5
- accepts, so a page can make the change at its own pace.
4
+ Two changes make it a major: **elements are blocks of the column**, no longer
5
+ part of a text, and **the text editors are not in the main bundle**. Markup
6
+ 5.x saved loads as it is, and `getPlainHtml` publishes the same from it.
6
7
 
7
- * __Load your text editor as a plugin.__ tinyMCE, CKEditor and summernote
8
- are plugins in `dist/plugins/`, loaded after the editor:
8
+ * __Load your text editor as a plugin.__ tinyMCE, CKEditor and summernote are
9
+ plugins in `dist/plugins/`, loaded after the editor:
9
10
 
10
11
  ```html
11
12
  <script src="grid-editor/dist/jquery.grideditor.min.js"></script>
12
13
  <script src="grid-editor/dist/plugins/grideditor.tinymce.min.js"></script>
13
14
  ```
14
15
 
15
- Up to 5.x the main bundle, and the bundle with SortableJS, still carry a
16
- copy of each, so a page that does not load the plugin keeps working. When a
17
- content area is edited with one of those copies the console says so, once.
18
- 6.0 leaves the copies out.
16
+ Up to 5.x the main bundle, and the bundle with SortableJS, carried a copy of
17
+ each, and since 5.2 editing with one said so in the console. Without the
18
+ plugin a text is still a block, to move and delete, and its drawer says it
19
+ cannot be edited.
20
+
21
+ * __Elements are blocks of the column.__ Up to 5.x an element lived inside a
22
+ content area, among the text a rich text editor edited. Now it sits in the
23
+ column beside the texts, and markup saved the 5.x way is converted as the
24
+ editor starts: each content area is cut at each element among its own
25
+ children - the text before it stays, the element goes into the column, the
26
+ text after goes into a new content area of the same type - and the next
27
+ `getHtml` saves the 6.0 shape.
28
+
29
+ ```html
30
+ <!-- 5.x -->
31
+ <div class="ge-content"><p>Before</p><blockquote data-ge-element="quote">…</blockquote><p>After</p></div>
32
+
33
+ <!-- 6.0 -->
34
+ <div class="ge-content"><p>Before</p></div>
35
+ <blockquote data-ge-element="quote">…</blockquote>
36
+ <div class="ge-content"><p>After</p></div>
37
+ ```
38
+
39
+ What `getPlainHtml` publishes is the same, `div.ge-content` being taken off,
40
+ with one exception: a content area with an id or classes of the host's
41
+ keeps them on its first part only. What to do: nothing, unless you style a
42
+ `div.ge-content` of your own as a whole, or read the saved markup expecting
43
+ elements inside a content area. A marked node inside a paragraph or a list
44
+ was text in 5.x and is text still.
45
+
46
+ Rows and containers found inside a content area come out of it the same way.
47
+
48
+ * __`createElement` into a content area__ - `appendTo` or `prependTo` one - puts
49
+ the element beside it instead, after or before, and warns once. Place it in a
50
+ column.
51
+
52
+ * __`elements.auto: true`__ means every loose node of a column is an element,
53
+ where it meant every child of a content area. A 5.x content area's children
54
+ still come out as elements, so a page that relied on it looks the same.
55
+
56
+ * __A text dragged between columns is `kind: 'text'`__ in `before-move` and
57
+ `after-move`, as it is in its add and delete events since 5.3. It was
58
+ `kind: 'content'`.
59
+
60
+ * __No more `contenteditable="false"` or `data-mce-bogus` on elements__, which
61
+ only existed to live inside a text editor. And a plugin that wrote an
62
+ element's attributes through tinyMCE's `undoManager.transact` can write them
63
+ with a plain `attr()`.
19
64
 
20
65
  * __An integration of your own under `$.fn.gridEditor.RTEs`__ still works,
21
- wrapped by the editor, with a warning that it is deprecated. Register it
22
- under `$.fn.gridEditor.texts` instead; [docs/plugins.md](docs/plugins.md#text-editor-plugins)
66
+ wrapped, with a warning that it is deprecated. Register it under
67
+ `$.fn.gridEditor.texts` instead; [docs/plugins.md](docs/plugins.md#text-editor-plugins)
23
68
  has the contract. `RTEs` goes in 7.0.
24
69
 
25
70
 
@@ -483,9 +483,32 @@
483
483
  position: relative;
484
484
  outline: 1px dashed rgba(90, 111, 138, 0.6);
485
485
  margin-bottom: 5px;
486
+ /* Over the text rather than above it: nearly every column has a
487
+ text, and a bar for each would make every column taller. It shows
488
+ while it is wanted - the pointer over the text, the text being
489
+ edited or holding the focus, its settings open, a drag under way -
490
+ and takes no room either way. */
491
+ /* While the text is being edited it would sit over the end of its
492
+ first line, so it stands back - faint, still there to click - until
493
+ the pointer is on the drawer itself */
494
+ /* Except when something in it is in use: its settings, a choice it
495
+ offers, a drag */
496
+ /* With its settings open it spans the text, so the panel has room */
486
497
  }
487
498
  .ge-canvas.ge-editing .ge-text-block > .ge-text-drawer {
488
- background: rgba(90, 111, 138, 0.12);
499
+ position: absolute;
500
+ top: 0;
501
+ right: 0;
502
+ z-index: 5;
503
+ width: auto;
504
+ margin: 0;
505
+ border-radius: 0 0 0 4px;
506
+ background: #e1e5ea;
507
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
508
+ opacity: 0;
509
+ visibility: hidden;
510
+ /* Hidden only once it has faded, shown at once */
511
+ transition: opacity 120ms ease, visibility 0s linear 120ms;
489
512
  }
490
513
  .ge-canvas.ge-editing .ge-text-block > .ge-text-drawer > a {
491
514
  color: #50637b;
@@ -497,6 +520,28 @@
497
520
  .ge-canvas.ge-editing .ge-text-block > .ge-text-drawer > a.ge-text-missing {
498
521
  color: #b02a37;
499
522
  }
523
+ .ge-canvas.ge-editing .ge-text-block:hover > .ge-text-drawer,
524
+ .ge-canvas.ge-editing .ge-text-block:focus-within > .ge-text-drawer,
525
+ .ge-canvas.ge-editing .ge-text-block.ge-drag-chosen > .ge-text-drawer,
526
+ .ge-canvas.ge-editing .ge-text-block:has(> .ge-rte-active) > .ge-text-drawer,
527
+ .ge-canvas.ge-editing .ge-text-block:has(> .ge-text-drawer.ge-picker-open) > .ge-text-drawer,
528
+ .ge-canvas.ge-editing .ge-text-block:has(> .ge-text-drawer > .ge-details[style*="block"]) > .ge-text-drawer {
529
+ opacity: 1;
530
+ visibility: visible;
531
+ transition-delay: 0s;
532
+ }
533
+ .ge-canvas.ge-editing .ge-text-block:has(> .ge-rte-active) > .ge-text-drawer:not(:hover) {
534
+ opacity: 0.35;
535
+ }
536
+ .ge-canvas.ge-editing .ge-text-block.ge-drag-chosen > .ge-text-drawer:not(:hover),
537
+ .ge-canvas.ge-editing .ge-text-block:has(> .ge-text-drawer.ge-picker-open) > .ge-text-drawer:not(:hover),
538
+ .ge-canvas.ge-editing .ge-text-block:has(> .ge-text-drawer > .ge-details[style*="block"]) > .ge-text-drawer:not(:hover) {
539
+ opacity: 1;
540
+ }
541
+ .ge-canvas.ge-editing .ge-text-block:has(> .ge-text-drawer > .ge-details[style*="block"]) > .ge-text-drawer {
542
+ left: 0;
543
+ border-radius: 0;
544
+ }
500
545
  .ge-canvas.ge-editing .column:not(:has( > :not(.ge-tools-drawer, .ge-resize-handle)))::after {
501
546
  content: '';
502
547
  display: block;