@themarioga/grid-editor 9.3.0 → 9.4.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/README.md +45 -4
  3. package/dist/grideditor.bundle.min.js +2 -2
  4. package/dist/grideditor.css +73 -11
  5. package/dist/grideditor.d.ts +37 -0
  6. package/dist/grideditor.esm.js +1 -1
  7. package/dist/grideditor.js +1 -1
  8. package/dist/grideditor.min.css +1 -1
  9. package/dist/grideditor.min.css.map +1 -1
  10. package/dist/grideditor.min.js +1 -1
  11. package/dist/locales/grideditor.es.esm.js +23 -0
  12. package/dist/locales/grideditor.es.js +23 -0
  13. package/dist/locales/grideditor.es.min.js +1 -1
  14. package/dist/locales/grideditor.es.min.js.map +2 -2
  15. package/dist/plugins/grideditor.dropdown.esm.js +2231 -0
  16. package/dist/plugins/grideditor.dropdown.js +2232 -0
  17. package/dist/plugins/grideditor.dropdown.min.js +1 -0
  18. package/dist/plugins/grideditor.dropdown.min.js.map +7 -0
  19. package/dist/plugins/grideditor.navbar.esm.js +199 -95
  20. package/dist/plugins/grideditor.navbar.js +199 -95
  21. package/dist/plugins/grideditor.navbar.min.js +1 -1
  22. package/dist/plugins/grideditor.navbar.min.js.map +4 -4
  23. package/dist/plugins/grideditor.sidenav.esm.js +199 -95
  24. package/dist/plugins/grideditor.sidenav.js +199 -95
  25. package/dist/plugins/grideditor.sidenav.min.js +1 -1
  26. package/dist/plugins/grideditor.sidenav.min.js.map +4 -4
  27. package/docs/events.md +4 -4
  28. package/docs/locale-keys.md +24 -1
  29. package/docs/plugins.md +3 -2
  30. package/example/containers.html +35 -1
  31. package/example/playground.html +1 -0
  32. package/package.json +1 -1
  33. package/src/js/locales/grideditor.es.js +23 -0
  34. package/src/js/nav/convert.js +6 -2
  35. package/src/js/nav/drawers.js +46 -14
  36. package/src/js/nav/dropdown.js +253 -0
  37. package/src/js/nav/feature.js +26 -7
  38. package/src/js/nav/panels.js +65 -54
  39. package/src/js/nav/pieces.js +52 -6
  40. package/src/js/plugins/grideditor.dropdown.js +335 -0
  41. package/src/less/grideditor.less +33 -1
  42. package/types/grideditor.d.ts +37 -0
package/CHANGELOG.md CHANGED
@@ -8,6 +8,25 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
  ## [Unreleased]
9
9
 
10
10
 
11
+ ## [9.4.0] - 2026-12-02
12
+
13
+ ### Added
14
+ - **Dropdown** (`grideditor.dropdown.js`), a container plugin: a Bootstrap 5.3
15
+ dropdown on its own, in a column. Its menu is a list of items - links,
16
+ dividers, headers and texts, edited where they stand and reordered as a
17
+ navbar's dropdowns are - or free content, rows and columns, whichever the
18
+ settings panel says; changing it asks first. The button can be split, open
19
+ down, up, right or left, take the menu to the right, and have a Bootstrap
20
+ style, outlined or not, and a size. The setting `dropdown` and
21
+ `createContainer('dropdown', …)` take the same options and a `browse` for
22
+ the host's file browser. It shares `src/js/nav/` with the navbar and sidenav
23
+ plugins, which it works beside in any order of loading; load the three from
24
+ the same version.
25
+
26
+ ### Fixed
27
+ - An item dragged from one dropdown's menu to another's, in a navbar or a
28
+ sidebar, no longer gets the `dropdown-item` class twice.
29
+
11
30
  ## [9.3.0] - 2026-12-01
12
31
 
13
32
  ### Added
package/README.md CHANGED
@@ -26,7 +26,7 @@ from any web server, or from GitHub Pages, with no build step.
26
26
  | [example/basic.html](example/basic.html) | The editor with tinyMCE in the content areas | [live](https://themarioga.github.io/grid-editor/example/basic.html) |
27
27
  | [example/columns.html](example/columns.html) | The six breakpoints and the "all sizes" view, equal and auto columns, columns per row, and sections | [live](https://themarioga.github.io/grid-editor/example/columns.html) |
28
28
  | [example/custom-plugins.html](example/custom-plugins.html) | Plugins of your own: a container, and a drawer tool with a modal that saves an attribute | [live](https://themarioga.github.io/grid-editor/example/custom-plugins.html) |
29
- | [example/containers.html](example/containers.html) | Tabs, accordions, popups, offcanvases, carousels, cards, a navbar and a sidebar, two levels deep | [live](https://themarioga.github.io/grid-editor/example/containers.html) |
29
+ | [example/containers.html](example/containers.html) | Tabs, accordions, popups, offcanvases, carousels, cards, a navbar, a sidebar and dropdowns, two levels deep | [live](https://themarioga.github.io/grid-editor/example/containers.html) |
30
30
  | [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) |
31
31
  | [example/style.html](example/style.html) | Inline style with Bootstrap's classes as chips, and the responsive utilities, edited per breakpoint | [live](https://themarioga.github.io/grid-editor/example/style.html) |
32
32
  | [example/locale.html](example/locale.html) | The interface in Spanish, with a language switcher | [live](https://themarioga.github.io/grid-editor/example/locale.html) |
@@ -189,7 +189,7 @@ has, with the options it was made with, and warns once.
189
189
  | `createSection` | `options?` | `Element` | A section, with the sections plugin. `options`: `width` (`'fixed'`, `'fluid'` or a breakpoint), `rows` (layouts), and a placement |
190
190
  | `createElement` | `content`, `options?` | `Element` | Host markup wrapped as an element. `options`: `type`, `label` |
191
191
  | `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 |
192
- | `createContainer` | `type`, `options?` | `Element` | `'tabs'`, `'accordion'`, `'popup'`, `'offcanvas'`, `'carousel'`, `'card'`, `'navbar'` or `'sidenav'` |
192
+ | `createContainer` | `type`, `options?` | `Element` | `'tabs'`, `'accordion'`, `'popup'`, `'offcanvas'`, `'carousel'`, `'card'`, `'navbar'`, `'sidenav'` or `'dropdown'` |
193
193
  | `addTab` | `container`, `options?` | `Element` | Appends a tab, returns its pane |
194
194
  | `addAccordionItem` | `container`, `options?` | `Element` | Appends an item, returns its body |
195
195
  | `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 |
@@ -1017,7 +1017,7 @@ The methods are there only when the plugin is loaded.
1017
1017
 
1018
1018
  ### Containers
1019
1019
 
1020
- Tabs, accordions, popups, offcanvases, carousels, cards, navbars and sidebars. A tabs, accordion or
1020
+ Tabs, accordions, popups, offcanvases, carousels, cards, navbars, sidebars and dropdowns. A tabs, accordion or
1021
1021
  carousel container holds panes; a popup, an offcanvas and a card hold one region. Either way a region is an ordinary one: rows,
1022
1022
  columns, content areas and elements nest inside it exactly as they do at the
1023
1023
  top level.
@@ -1035,6 +1035,7 @@ it available:
1035
1035
  <script src="grid-editor/dist/plugins/grideditor.card.min.js"></script>
1036
1036
  <script src="grid-editor/dist/plugins/grideditor.navbar.min.js"></script>
1037
1037
  <script src="grid-editor/dist/plugins/grideditor.sidenav.min.js"></script>
1038
+ <script src="grid-editor/dist/plugins/grideditor.dropdown.min.js"></script>
1038
1039
  ```
1039
1040
 
1040
1041
  The toolbar offers a button per loaded plugin. See [docs/plugins.md](docs/plugins.md)
@@ -1117,7 +1118,8 @@ starts over the canvas. Each slide's drawer moves it a place back or on. What
1117
1118
  `getHtml` gives starts at the first slide, whichever one the canvas was on.
1118
1119
 
1119
1120
  A navbar and a sidebar are navigation, and are edited piece by piece: see
1120
- [Navbars and sidebars](#navbars-and-sidebars) below. See
1121
+ [Navbars and sidebars](#navbars-and-sidebars) below. A dropdown on its own is
1122
+ edited the same way: see [Dropdowns](#dropdowns). See
1121
1123
  [example/containers.html](example/containers.html).
1122
1124
 
1123
1125
  #### Navbars and sidebars
@@ -1179,6 +1181,45 @@ of its own there is no distance to travel, and a sidebar next to a column of
1179
1181
  content taller than it does stick. `fixed-*` and `sticky-*` are shown in their
1180
1182
  place while editing, so they never cover the editor.
1181
1183
 
1184
+ #### Dropdowns
1185
+
1186
+ `grideditor.dropdown.js` is a Bootstrap 5.3 dropdown on its own: a button that
1187
+ opens a menu, in a column like any other block. The menu is one of two kinds,
1188
+ chosen in its settings panel: _Items_ - links, dividers, headers and texts,
1189
+ renamed where they stand and reordered by their drawers, as the dropdowns of a
1190
+ navbar are - or _Free content_, rows and columns. Changing the kind asks first,
1191
+ and what the menu held is dropped. The button can be split into an action,
1192
+ with a link of its own, and a caret; it opens down, up, right or left; the menu
1193
+ can open to the right; and it has a Bootstrap style, outlined or not, and a
1194
+ size.
1195
+
1196
+ Nothing of Bootstrap's javascript runs on the canvas while editing: the menu is
1197
+ shown open, below the buttons whichever the direction, with a tool to fold it
1198
+ away, and a click on a link goes nowhere. With the preview button pressed the
1199
+ toggle works. A dropdown is not put inside the free content of another, nor a
1200
+ navbar or a sidebar: Bootstrap has no menus inside menus. Load it from the same
1201
+ version of grid-editor as the navbar and sidenav plugins, in any order.
1202
+
1203
+ __`dropdown`:__ The options of the dropdowns made new: `label` (the button's
1204
+ text; the interface's `Dropdown`), `menu` (`'items'` or `'content'`), `style`
1205
+ (`'secondary'`, `'primary'`, `'success'`, `'danger'`, `'warning'`, `'info'`,
1206
+ `'light'`, `'dark'` or `'link'`), `outline` (`false`; `link` has none), `size`
1207
+ (`null`, `'sm'` or `'lg'`), `direction` (`'down'`, `'up'`, `'end'` or `'start'`),
1208
+ `menu_end` (`false`) and `split` (`false`), and `browse`, the host's file
1209
+ browser of the navbar and sidenav settings, for the links. `createContainer`
1210
+ takes the same options, which win over the setting. A value a key does not take
1211
+ is warned about and its default used.
1212
+
1213
+ ```javascript
1214
+ new GridEditor('#myGrid', { dropdown: { style: 'primary', size: 'sm' } });
1215
+ ge.createContainer('dropdown', { label: 'Actions', split: true, direction: 'end' });
1216
+ ge.createContainer('dropdown', { menu: 'content', label: 'Filters' });
1217
+ ```
1218
+
1219
+ A link's `href` is written as it is typed, as in the navbar. A button's text and
1220
+ the toggles are edited in place, and `getHtml` gives the markup of Bootstrap's
1221
+ documentation, with nothing of the editor in it.
1222
+
1182
1223
  ### Localization
1183
1224
 
1184
1225
  __`locale`:__ The code of a locale in `$.fn.gridEditor.locales`. Default `'en'`.