@themarioga/grid-editor 8.7.0 → 8.8.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,35 @@ 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.8.0] - 2026-10-06
9
+
10
+ ### Added
11
+ - The carousel plugin, `dist/plugins/grideditor.carousel.js`: a Bootstrap 5
12
+ carousel whose slides are regions. One slide shows at a time, the arrows in
13
+ the container's drawer move between them and each slide's drawer moves it a
14
+ place; Bootstrap's own arrows and indicators are drawn but do not answer.
15
+ `getHtml` gives the carousel starting at the first slide.
16
+ - A carousel's options - arrows, indicators, fade, dark theme, autoplay and
17
+ its interval, pause, wrap, keyboard and touch - in a *Carousel* section of
18
+ its settings panel, in the `carousel` setting for the ones made new, and in
19
+ the options of `createContainer('carousel', …)`; a slide's own interval in
20
+ its settings panel. The setting `carousel_tools` adds host tools to a slide's
21
+ drawer.
22
+ - `addPane(container, options?)` adds a pane to a container of any type that
23
+ has them, and `addTab` and `addAccordionItem` stay as they were.
24
+ - For plugins: a container's definition can have `paneClass` and
25
+ `paneLabelKey`, which is how the editor names its panes in events and in
26
+ their settings panel; and `ge.suspendToggles` and `ge.resumeToggles` put
27
+ aside `data-bs-slide`, `data-bs-slide-to` and `data-bs-ride` as well.
28
+
29
+ ## [8.7.1] - 2026-10-02
30
+
31
+ ### Fixed
32
+ - autosave: `clearDraft()` drops the save still waiting, which wrote the
33
+ draft back a moment later - a page that cleared it after saving to its
34
+ server found it there again - and what there is when it is called is what
35
+ a new draft starts from, so only a change after it saves again.
36
+
8
37
  ## [8.7.0] - 2026-10-02
9
38
 
10
39
  ### Added
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  Grid Editor
2
2
  ===========
3
3
 
4
- Grid Editor is a visual javascript editor for the [bootstrap 5 grid system](https://getbootstrap.com/docs/5.3/layout/grid/), in plain DOM: no jQuery needed. You can create, drag, resize and delete rows and columns — sized in units, equal (`col`) or to their content (`col-auto`), or shared out by their row (`row-cols-*`) — indent them, group them in sections (`.container`), copy and paste them, and give each of bootstrap's six breakpoints its own layout — or edit them all at once, with a mouse or with a finger. Bootstrap's responsive utilities — display, flex, order, alignment, gutters, spacing, text alignment, sticky and float — are edited per breakpoint too, and any row, column, container or element can be given inline css, with Bootstrap's classes for it offered as chips. It also edits tabs, accordions, popups and cards, and any markup you mark as an element, and it tells your application about every change it makes.
4
+ Grid Editor is a visual javascript editor for the [bootstrap 5 grid system](https://getbootstrap.com/docs/5.3/layout/grid/), in plain DOM: no jQuery needed. You can create, drag, resize and delete rows and columns — sized in units, equal (`col`) or to their content (`col-auto`), or shared out by their row (`row-cols-*`) — indent them, group them in sections (`.container`), copy and paste them, and give each of bootstrap's six breakpoints its own layout — or edit them all at once, with a mouse or with a finger. Bootstrap's responsive utilities — display, flex, order, alignment, gutters, spacing, text alignment, sticky and float — are edited per breakpoint too, and any row, column, container or element can be given inline css, with Bootstrap's classes for it offered as chips. It also edits tabs, accordions, popups, carousels and cards, and any markup you mark as an element, and it tells your application about every change it makes.
5
5
 
6
6
  This is a fork of [Friendly-Pixel/grid-editor](https://github.com/Friendly-Pixel/grid-editor)
7
7
  by Simon Epskamp, carrying it on from 2.x. It is published as
@@ -27,7 +27,7 @@ from any web server, or from GitHub Pages, with no build step.
27
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
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
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) |
30
- | [example/containers.html](example/containers.html) | Tabs, accordions, popups and cards, two levels deep | [live](https://themarioga.github.io/grid-editor/example/containers.html) |
30
+ | [example/containers.html](example/containers.html) | Tabs, accordions, popups, carousels and cards, two levels deep | [live](https://themarioga.github.io/grid-editor/example/containers.html) |
31
31
  | [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
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
33
  | [example/utilities.html](example/utilities.html) | Bootstrap's responsive utilities, edited per breakpoint | [live](https://themarioga.github.io/grid-editor/example/utilities.html) |
@@ -190,9 +190,10 @@ has, with the options it was made with, and warns once.
190
190
  | `createSection` | `options?` | `Element` | A section, with the sections plugin. `options`: `width` (`'fixed'`, `'fluid'` or a breakpoint), `rows` (layouts), and a placement |
191
191
  | `createElement` | `content`, `options?` | `Element` | Host markup wrapped as an element. `options`: `type`, `label` |
192
192
  | `createText` | `type?`, `options?` | `Element` | A content area for a text editor, the first one offered by default. `options`: `content`, and a placement. `null` if the editor is not loaded, or no text editor is |
193
- | `createContainer` | `type`, `options?` | `Element` | `'tabs'`, `'accordion'` or `'popup'` |
193
+ | `createContainer` | `type`, `options?` | `Element` | `'tabs'`, `'accordion'`, `'popup'`, `'carousel'` or `'card'` |
194
194
  | `addTab` | `container`, `options?` | `Element` | Appends a tab, returns its pane |
195
195
  | `addAccordionItem` | `container`, `options?` | `Element` | Appends an item, returns its body |
196
+ | `addPane` | `container`, `options?` | `Element` | Appends a pane to a container of any type that has them - a tab, an item, a carousel slide, whose `options.interval` is its time in milliseconds - and returns it. `null`, and a warning, for a node that is not one |
196
197
  | `getUtility` | `node`, `family`, `view?` | `String` | A utility plugin's value on a node in a view (the current one by default), or `null` |
197
198
  | `setUtility` | `node`, `family`, `value`, `view?` | `Boolean` | Write it through the events; `null` is inherit. `false` if canceled or nothing changed |
198
199
 
@@ -872,7 +873,7 @@ drafts, so the second saves nothing and says so in the console.
872
873
  | `disableAutosave()` | `Boolean` | Stops saving; the draft is kept |
873
874
  | `saveDraft()` | `Boolean` | Saves now, if the html changed, even when disabled; `true` when it wrote |
874
875
  | `getDraft()` | `Object` | `{ html, savedAt }`, or `null` |
875
- | `clearDraft()` | `Boolean` | Takes the draft away, as a page does once it has saved to its server |
876
+ | `clearDraft()` | `Boolean` | Takes the draft away, as a page does once it has saved to its server. A save still waiting is dropped, and what there is now is where a new draft starts from: only a change after it saves again |
876
877
 
877
878
  The methods are there only when the plugin is loaded, and answer `false` or
878
879
  `null` when the browser gives the page no storage - a private window may not -
@@ -893,8 +894,8 @@ place to keep work.
893
894
 
894
895
  ### Containers
895
896
 
896
- Tabs, accordions, popups and cards. A tabs, accordion or popup container holds
897
- panes; a card holds one region. Either way a region is an ordinary one: rows,
897
+ Tabs, accordions, popups, carousels and cards. A tabs, accordion, popup or
898
+ carousel container holds panes; a card holds one region. Either way a region is an ordinary one: rows,
898
899
  columns, content areas and elements nest inside it exactly as they do at the
899
900
  top level.
900
901
 
@@ -906,6 +907,7 @@ it available:
906
907
  <script src="grid-editor/dist/plugins/grideditor.tabs.min.js"></script>
907
908
  <script src="grid-editor/dist/plugins/grideditor.accordion.min.js"></script>
908
909
  <script src="grid-editor/dist/plugins/grideditor.popup.min.js"></script>
910
+ <script src="grid-editor/dist/plugins/grideditor.carousel.min.js"></script>
909
911
  <script src="grid-editor/dist/plugins/grideditor.card.min.js"></script>
910
912
  ```
911
913
 
@@ -925,7 +927,15 @@ new GridEditor('#myGrid', { tabs: { variant: 'pills', vertical: 'md' } }); //
925
927
  ge.createContainer('tabs', { variant: 'underline', width: 'fill' }); // an option given wins
926
928
  ```
927
929
 
928
- __`container_tools`, `tab_tools`, `accordion_tools`:__ Extra tools on the container drawer and on each pane's drawer, same shape as `row_tools`.
930
+ __`carousel`:__ The options of the carousels made new, from the toolbar or with `createContainer`, as Bootstrap has them: `controls` and `indicators` (the arrows and the dots, both `true`), `fade`, `dark` (`data-bs-theme="dark"`), `ride` (`false`, `'carousel'` to start on load, or `'true'` to start after the first interaction), `interval` (milliseconds, 1000 or more, `null` for Bootstrap's own), `pause`, `wrap`, `keyboard` and `touch` (all `true`), and `slides` (how many, 2). A value a key does not take is warned about and its default used. Every carousel also has a *Carousel* section in its settings panel, which changes its own, and every slide an interval in its own. It is all Bootstrap's classes and attributes, so a page's markup says it too.
931
+
932
+ ```javascript
933
+ new GridEditor('#myGrid', { carousel: { fade: true, ride: 'carousel', interval: 4000 } });
934
+ ge.createContainer('carousel', { slides: 3, controls: false }); // an option given wins
935
+ ge.addPane(carousel, { interval: 8000 }); // a slide that stays for 8 seconds
936
+ ```
937
+
938
+ __`container_tools`, `tab_tools`, `accordion_tools`, `carousel_tools`:__ Extra tools on the container drawer and on each pane's drawer, same shape as `row_tools`.
929
939
 
930
940
  ```javascript
931
941
  var tabs = ge.createContainer('tabs', {
@@ -951,6 +961,13 @@ the trigger. Any node in the canvas carrying
951
961
  `data-ge-popup-target="<popup id>"` is a trigger too — grid-editor leaves your
952
962
  markup alone and writes Bootstrap's attributes onto it in the output.
953
963
 
964
+ A carousel shows one slide at a time while editing, as it does on the page.
965
+ The container's drawer has the arrows and says which slide it is on, and
966
+ Bootstrap's own arrows and indicators are drawn but do not answer: the editor
967
+ puts the attributes Bootstrap's javascript acts on aside, so an autoplay never
968
+ starts over the canvas. Each slide's drawer moves it a place back or on. What
969
+ `getHtml` gives starts at the first slide, whichever one the canvas was on.
970
+
954
971
  See [example/containers.html](example/containers.html).
955
972
 
956
973
  ### Localization