@themarioga/grid-editor 7.2.0 → 8.0.0-beta.2
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 +101 -0
- package/README.md +96 -30
- package/UPGRADING.md +86 -0
- package/dist/grideditor.bundle.min.js +3 -3
- package/dist/grideditor.css +149 -6
- package/dist/grideditor.d.ts +18 -0
- package/dist/grideditor.esm.js +257 -48
- package/dist/grideditor.jquery.js +0 -13
- package/dist/grideditor.jquery.min.js +1 -1
- package/dist/grideditor.jquery.min.js.map +3 -3
- package/dist/grideditor.js +257 -48
- package/dist/grideditor.min.css +1 -1
- package/dist/grideditor.min.css.map +1 -1
- package/dist/grideditor.min.js +2 -2
- package/dist/grideditor.min.js.map +3 -3
- package/dist/locales/grideditor.es.esm.js +80 -6
- package/dist/locales/grideditor.es.js +80 -6
- package/dist/locales/grideditor.es.min.js +1 -1
- package/dist/locales/grideditor.es.min.js.map +2 -2
- package/dist/plugins/grideditor.accordion.min.js.map +2 -2
- package/dist/plugins/grideditor.alignment.esm.js +11 -38
- package/dist/plugins/grideditor.alignment.js +11 -38
- package/dist/plugins/grideditor.alignment.min.js +1 -1
- package/dist/plugins/grideditor.alignment.min.js.map +3 -3
- package/dist/plugins/grideditor.card.min.js.map +1 -1
- package/dist/plugins/grideditor.ckeditor.esm.js +0 -5
- package/dist/plugins/grideditor.ckeditor.js +0 -5
- package/dist/plugins/grideditor.ckeditor.min.js +1 -1
- package/dist/plugins/grideditor.ckeditor.min.js.map +3 -3
- package/dist/plugins/grideditor.clipboard.min.js.map +1 -1
- package/dist/plugins/grideditor.codemirror-inline.min.js.map +1 -1
- package/dist/plugins/grideditor.codemirror.min.js.map +1 -1
- package/dist/plugins/grideditor.elements.min.js.map +2 -2
- package/dist/plugins/grideditor.gutters.min.js.map +1 -1
- package/dist/plugins/grideditor.order.min.js.map +1 -1
- package/dist/plugins/grideditor.popup.min.js.map +1 -1
- package/dist/plugins/grideditor.sections.min.js.map +2 -2
- package/dist/plugins/grideditor.style.esm.js +1926 -0
- package/dist/plugins/grideditor.style.js +1923 -0
- package/dist/plugins/grideditor.style.min.js +4 -0
- package/dist/plugins/grideditor.style.min.js.map +7 -0
- package/dist/plugins/grideditor.summernote.min.js.map +2 -2
- package/dist/plugins/grideditor.tabs.min.js.map +2 -2
- package/dist/plugins/grideditor.tinymce.esm.js +1 -8
- package/dist/plugins/grideditor.tinymce.js +1 -8
- package/dist/plugins/grideditor.tinymce.min.js +1 -1
- package/dist/plugins/grideditor.tinymce.min.js.map +3 -3
- package/docs/events.md +4 -6
- package/docs/locale-keys.md +99 -15
- package/docs/plugins.md +47 -23
- package/example/ckeditor.html +0 -5
- package/example/index.html +17 -2
- package/example/style.html +163 -0
- package/example/utilities.html +21 -16
- package/package.json +1 -1
- package/src/js/dom.js +1 -2
- package/src/js/grideditor.jquery.js +7 -28
- package/src/js/grideditor.js +336 -67
- package/src/js/locales/grideditor.es.js +80 -6
- package/src/js/plugins/grideditor.alignment.js +21 -50
- package/src/js/plugins/grideditor.ckeditor.js +10 -23
- package/src/js/plugins/grideditor.style.js +185 -0
- package/src/js/plugins/grideditor.summernote.js +4 -5
- package/src/js/plugins/grideditor.tinymce.js +4 -17
- package/src/js/style/accordion.js +168 -0
- package/src/js/style/catalog.js +76 -0
- package/src/js/style/custom.js +84 -0
- package/src/js/style/display.js +229 -0
- package/src/js/style/drawerflow.js +118 -0
- package/src/js/style/fields.js +382 -0
- package/src/js/style/flex.js +156 -0
- package/src/js/{plugins/grideditor.float.js → style/float.js} +6 -16
- package/src/js/style/options.js +60 -0
- package/src/js/style/sections.js +298 -0
- package/src/js/{plugins/grideditor.spacing.js → style/spacing.js} +7 -19
- package/src/js/style/sticky.js +39 -0
- package/src/js/{plugins/grideditor.textalign.js → style/textalign.js} +6 -14
- package/src/js/text/grideditor.text.js +1 -1
- package/src/less/grideditor.less +151 -10
- package/types/grideditor.d.ts +18 -0
- package/dist/plugins/grideditor.float.esm.js +0 -34
- package/dist/plugins/grideditor.float.js +0 -41
- package/dist/plugins/grideditor.float.min.js +0 -1
- package/dist/plugins/grideditor.float.min.js.map +0 -7
- package/dist/plugins/grideditor.spacing.esm.js +0 -318
- package/dist/plugins/grideditor.spacing.js +0 -323
- package/dist/plugins/grideditor.spacing.min.js +0 -1
- package/dist/plugins/grideditor.spacing.min.js.map +0 -7
- package/dist/plugins/grideditor.textalign.esm.js +0 -40
- package/dist/plugins/grideditor.textalign.js +0 -47
- package/dist/plugins/grideditor.textalign.min.js +0 -1
- package/dist/plugins/grideditor.textalign.min.js.map +0 -7
- package/dist/plugins/grideditor.visibility.esm.js +0 -158
- package/dist/plugins/grideditor.visibility.js +0 -163
- package/dist/plugins/grideditor.visibility.min.js +0 -1
- package/dist/plugins/grideditor.visibility.min.js.map +0 -7
- package/src/js/plugins/grideditor.visibility.js +0 -171
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,107 @@ 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.0.0-beta.2] - 2026-09-29
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- The style plugin's catalog has Bootstrap 5.3's colors: `bg-*-subtle`,
|
|
12
|
+
`text-bg-*`, `text-*-emphasis`, `text-body-emphasis` and `border-*-subtle`,
|
|
13
|
+
the opacities `bg-opacity-*`, `text-opacity-*` and `border-opacity-*`,
|
|
14
|
+
`fixed-top` and `fixed-bottom`, and on an element `img-fluid`,
|
|
15
|
+
`img-thumbnail` and `object-fit-*`.
|
|
16
|
+
- A Flex section in the style plugin: direction, wrap, `justify-content`,
|
|
17
|
+
`align-items`, `align-content`, and on anything but a row `gap`,
|
|
18
|
+
`row-gap`, `column-gap`, fill, grow and shrink, per breakpoint, with
|
|
19
|
+
`vstack` and `hstack` as chips. `style.sections.flex` turns it off.
|
|
20
|
+
- `sticky-{bp}-top` and `sticky-{bp}-bottom`, per breakpoint, in the style
|
|
21
|
+
plugin's Position section.
|
|
22
|
+
- On a node that is flex or grid in the view being edited, the drawer sits
|
|
23
|
+
on top out of the flow, and the canvas lays the content out as the page
|
|
24
|
+
will.
|
|
25
|
+
|
|
26
|
+
### Changed
|
|
27
|
+
- **BREAKING:** The style plugin's `visibility` utility is `display`, and
|
|
28
|
+
edits every `d-{bp}-*` value from `none` to `inline-flex`. The eye shows a
|
|
29
|
+
node again with the display it has below, so a flex column comes back
|
|
30
|
+
flex. `utility.visibility` and `utility.visibility_shown` are gone from the
|
|
31
|
+
locales, and `utility.display` is new.
|
|
32
|
+
- **BREAKING:** `justify-content-*` and `align-items-*` are the style
|
|
33
|
+
plugin's, in its Flex section, on rows, columns, elements and containers.
|
|
34
|
+
The alignment plugin keeps `align-self-*` only.
|
|
35
|
+
- A node Bootstrap hides in the view being edited is kept on the canvas with
|
|
36
|
+
the display it would have, not as a block.
|
|
37
|
+
## [8.0.0-beta.1] - 2026-09-29
|
|
38
|
+
|
|
39
|
+
Not published: what it holds shipped in 8.0.0-beta.2.
|
|
40
|
+
|
|
41
|
+
### Removed
|
|
42
|
+
- **BREAKING:** `grideditor.spacing.js`, `grideditor.textalign.js`,
|
|
43
|
+
`grideditor.visibility.js` and `grideditor.float.js`, deprecated in 7.3:
|
|
44
|
+
the style plugin carries them. Their names in the `plugins` setting are
|
|
45
|
+
plugins that are not loaded.
|
|
46
|
+
- **BREAKING:** `utilities.spacing` and `utilities.visibility` are no longer
|
|
47
|
+
read; they are `style.spacing` and `style.visibility`.
|
|
48
|
+
- **BREAKING:** `replaces` on a plugin's factory, added in 7.3 for those
|
|
49
|
+
plugins.
|
|
50
|
+
- **BREAKING:** The numeric layout mode indexes of 2.x in `changeView`,
|
|
51
|
+
`getUtility` and `setUtility`: they are views that do not exist.
|
|
52
|
+
- **BREAKING:** The warnings about `sortable_options` and
|
|
53
|
+
`resizable_options`, removed in 4.0, and about `tinymce.config.oninit`,
|
|
54
|
+
removed in 7.0: they are ignored, and `oninit` is passed to tinyMCE as it
|
|
55
|
+
is.
|
|
56
|
+
- **BREAKING:** `ckeditor.config.on.instanceReady`, CKEditor 4's, which 7.x
|
|
57
|
+
called itself: it is not called, and `on` goes to CKEditor 5 as it is.
|
|
58
|
+
- **BREAKING:** The adapter's `$.fn.gridEditor.containers`, `.features`,
|
|
59
|
+
`.utilities` and `.texts`, which kept a plugin written for 6.x from
|
|
60
|
+
throwing: one throws as it loads now.
|
|
61
|
+
- The locale keys `warning.setting_removed`, `warning.oninit_removed` and
|
|
62
|
+
`warning.plugin_6x`, and the words on CKEditor 4 in
|
|
63
|
+
`error.ckeditor_missing`.
|
|
64
|
+
- Notes on earlier versions in the README, the docs and the code;
|
|
65
|
+
UPGRADING.md keeps them. See [UPGRADING.md](UPGRADING.md).
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## [7.3.0] - 2026-09-29
|
|
69
|
+
|
|
70
|
+
### Added
|
|
71
|
+
- The style plugin, `grideditor.style.js`. Every row, column, container,
|
|
72
|
+
pane, element and section gets a *Style* accordion in its settings panel:
|
|
73
|
+
size, spacing, border, background, text, typography, display, position
|
|
74
|
+
and free css. It is written to the node's own `style` through the
|
|
75
|
+
browser, so a value the browser refuses is marked and not written, and
|
|
76
|
+
what the host wrote and nobody edits is kept. Each section offers
|
|
77
|
+
Bootstrap 5.3's classes for what it styles as chips, which put a class in
|
|
78
|
+
the classes field or take it off. A field whose property a Bootstrap
|
|
79
|
+
utility on the node also sets says that the class takes priority. Where
|
|
80
|
+
`settings_panel` is `popover` or `inline` the accordion opens in a
|
|
81
|
+
dialog, from a *Style* button. The `style` setting chooses the sections,
|
|
82
|
+
and in each the properties and whether it has chips. See the README and
|
|
83
|
+
[example/style.html](example/style.html).
|
|
84
|
+
- The style plugin carries spacing, text alignment, visibility and float:
|
|
85
|
+
their per breakpoint fields are in its Spacing, Text, Display and
|
|
86
|
+
Position sections rather than in *Responsive*, and do what they did.
|
|
87
|
+
`style.spacing` and `style.visibility` take what `utilities.spacing` and
|
|
88
|
+
`utilities.visibility` took.
|
|
89
|
+
- For plugins: `panelSection(node, kind)`, a section of a plugin's own in a
|
|
90
|
+
node's settings panel, between its general fields and *Responsive*;
|
|
91
|
+
`ge.openDialog`/`ge.closeDialog`, a modal of the editor's own over the
|
|
92
|
+
settings; `ge.hostStyle`/`ge.setHostStyle`, the host's own style under a
|
|
93
|
+
breakpoint preview; and `replaces` on a factory, for a plugin that takes
|
|
94
|
+
the place of others. A field made with `ge.utilityField` follows the view
|
|
95
|
+
and the classes field wherever the plugin puts it. See
|
|
96
|
+
[docs/plugins.md](docs/plugins.md).
|
|
97
|
+
|
|
98
|
+
### Deprecated
|
|
99
|
+
- `grideditor.spacing.js`, `grideditor.textalign.js`,
|
|
100
|
+
`grideditor.visibility.js` and `grideditor.float.js`, which go in 8.0.
|
|
101
|
+
Loaded on their own they do what they did, and say once per editor that
|
|
102
|
+
they are deprecated; loaded beside the style plugin they stand down, and
|
|
103
|
+
their names in the `plugins` setting ask for it. `utilities.spacing` and
|
|
104
|
+
`utilities.visibility` are still read, when `style.spacing` and
|
|
105
|
+
`style.visibility` are not there, and go in 8.0 too. See
|
|
106
|
+
[UPGRADING.md](UPGRADING.md).
|
|
107
|
+
|
|
108
|
+
|
|
8
109
|
## [7.2.0] - 2026-09-29
|
|
9
110
|
|
|
10
111
|
### Changed
|
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 —
|
|
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.
|
|
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
|
|
@@ -45,11 +45,10 @@ package: an Angular CLI project, with a build step, unlike the pages above.
|
|
|
45
45
|
Installation
|
|
46
46
|
------------
|
|
47
47
|
|
|
48
|
-
* __Dependencies:__ Grid Editor depends on [SortableJS](https://sortablejs.github.io/Sortable/), Bootstrap Icons, and Bootstrap 5, so make sure you have included those in the page. It does not need jQuery
|
|
48
|
+
* __Dependencies:__ Grid Editor depends on [SortableJS](https://sortablejs.github.io/Sortable/), Bootstrap Icons, and Bootstrap 5, so make sure you have included those in the page. It does not need jQuery.
|
|
49
49
|
* If you want to use the tinyMCE integration, include tinyMCE 7 (7.9.3 or later) as well, and `dist/plugins/grideditor.tinymce.min.js` after the editor.
|
|
50
50
|
* If you want to use the summernote integration, include summernote and `dist/plugins/grideditor.summernote.min.js`. Summernote needs jQuery itself, so that page loads jQuery too; nothing else does.
|
|
51
|
-
* If you want to use the CKEditor integration... you get the point: CKEditor 5's browser build (`ckeditor5.umd.js` and `ckeditor5.css`) and `dist/plugins/grideditor.ckeditor.min.js`.
|
|
52
|
-
* 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
|
+
* If you want to use the CKEditor integration... you get the point: CKEditor 5's browser build (`ckeditor5.umd.js` and `ckeditor5.css`) and `dist/plugins/grideditor.ckeditor.min.js`.
|
|
53
52
|
* From npm:
|
|
54
53
|
|
|
55
54
|
```
|
|
@@ -111,7 +110,7 @@ Load the classic script *or* the module build on a page, never both.
|
|
|
111
110
|
|
|
112
111
|
A page that uses the jQuery API of 6.x - `$(el).gridEditor(...)`, jQuery
|
|
113
112
|
events, jQuery objects in the payloads - keeps it by loading jQuery 4 and the
|
|
114
|
-
adapter after the editor, and the
|
|
113
|
+
adapter after the editor, and the plugins after that:
|
|
115
114
|
|
|
116
115
|
```html
|
|
117
116
|
<script src="https://code.jquery.com/jquery-4.0.0.min.js"></script>
|
|
@@ -120,7 +119,8 @@ adapter after the editor, and the 7.x plugins after that:
|
|
|
120
119
|
<script src="grid-editor/dist/plugins/grideditor.tabs.min.js"></script>
|
|
121
120
|
```
|
|
122
121
|
|
|
123
|
-
Plugins written for 6.x
|
|
122
|
+
Plugins written for 6.x do not work with it, and throw as they register on
|
|
123
|
+
`$.fn.gridEditor`: [UPGRADING.md](UPGRADING.md) says how to port one.
|
|
124
124
|
|
|
125
125
|
Usage
|
|
126
126
|
-----
|
|
@@ -215,7 +215,7 @@ ge.settings.locale; // 'en'
|
|
|
215
215
|
A html string written into the canvas - through the source view,
|
|
216
216
|
`source_textarea`, `createElement` or a paste - is parsed as `innerHTML`
|
|
217
217
|
parses: a `<script>` in it is kept in the markup and does not run in the
|
|
218
|
-
editor.
|
|
218
|
+
editor.
|
|
219
219
|
|
|
220
220
|
Events
|
|
221
221
|
------
|
|
@@ -306,7 +306,7 @@ which loses to `col-auto` and `col-N`. `row_cols: false` takes the field away.
|
|
|
306
306
|
In a breakpoint view a size or an offset is written for that breakpoint. In the
|
|
307
307
|
all view it is written once, as the class with no breakpoint (`col-4`,
|
|
308
308
|
`offset-2`), and the breakpoints' own sizes or offsets are taken off: one value
|
|
309
|
-
for every size.
|
|
309
|
+
for every size.
|
|
310
310
|
|
|
311
311
|
The settings button on a row, a column, a container, a tab, an accordion item
|
|
312
312
|
or an element opens a panel with two fields: the node's `id`, and its css
|
|
@@ -428,7 +428,7 @@ __`settings_panel`:__ Where the settings a gear opens are shown - a node's id, i
|
|
|
428
428
|
| `'offcanvas'` | A Bootstrap offcanvas at the side of the window, from the bottom on a phone. It does not move the canvas, and has room for every field |
|
|
429
429
|
| `'popover'` | A Bootstrap popover under the gear, or over it when there is more room there; a press anywhere else puts it away |
|
|
430
430
|
| `'modal'` | A Bootstrap modal |
|
|
431
|
-
| `'inline'` | Unfolded in the drawer itself
|
|
431
|
+
| `'inline'` | Unfolded in the drawer itself |
|
|
432
432
|
|
|
433
433
|
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.
|
|
434
434
|
|
|
@@ -454,7 +454,7 @@ new GridEditor('#myGrid', {
|
|
|
454
454
|
|
|
455
455
|
### Breakpoints and sizing
|
|
456
456
|
|
|
457
|
-
__`layout_modes`:__ Which views the toolbar dropdown offers. Default `['all', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl']`. Offer fewer
|
|
457
|
+
__`layout_modes`:__ Which views the toolbar dropdown offers. Default `['all', 'xs', 'sm', 'md', 'lg', 'xl', 'xxl']`. Offer fewer for a simpler dropdown:
|
|
458
458
|
|
|
459
459
|
```javascript
|
|
460
460
|
new GridEditor('#myGrid', {
|
|
@@ -482,7 +482,7 @@ new GridEditor('#myGrid', {
|
|
|
482
482
|
A column's text is a *text block*: a content area, the text editor that edits
|
|
483
483
|
it, and a drawer of its own - move, which editor, settings, the host's
|
|
484
484
|
`text_tools`, delete - like any other block. It drags between columns, the
|
|
485
|
-
clipboard copies it, and spacing, text alignment and
|
|
485
|
+
clipboard copies it, and spacing, text alignment and display apply to it.
|
|
486
486
|
The markup does not change: the drawer sits beside the content area in a
|
|
487
487
|
wrapper that only exists while editing, because inside it the text editor would
|
|
488
488
|
take it for text. It sits over the text's top right corner and takes no room,
|
|
@@ -560,41 +560,112 @@ __`element_tools`:__ Extra tools on every element drawer, same shape as `row_too
|
|
|
560
560
|
See [example/elements.html](example/elements.html), which also shows the
|
|
561
561
|
pattern for an element with no visual output of its own.
|
|
562
562
|
|
|
563
|
+
### Style
|
|
564
|
+
|
|
565
|
+
Inline css for rows, columns, containers, panes, elements and sections, and
|
|
566
|
+
Bootstrap's classes for it. A plugin:
|
|
567
|
+
|
|
568
|
+
```html
|
|
569
|
+
<script src="grid-editor/dist/plugins/grideditor.style.min.js"></script> <!-- after grideditor.elements -->
|
|
570
|
+
```
|
|
571
|
+
|
|
572
|
+
Each of those nodes gets a *Style* accordion in its settings panel, between
|
|
573
|
+
its id and classes and the *Responsive* section. One section is open at a
|
|
574
|
+
time, and the one you opened last is open on the next node too.
|
|
575
|
+
|
|
576
|
+
| Section | Inline fields | Per breakpoint |
|
|
577
|
+
| --- | --- | --- |
|
|
578
|
+
| Size | `width`, `height`, `min-*` and `max-*` (a column: `min-*` and `max-*` only, its width is the grid's) | |
|
|
579
|
+
| Spacing | `margin-*` and `padding-*`, by side | padding and margin, `{p,m}{,x,y,t,b,s,e}-{bp}-{0–5}` |
|
|
580
|
+
| Border | width, style, color, radius, and a shadow builder | |
|
|
581
|
+
| Background | color, image, size, position, repeat | |
|
|
582
|
+
| Text | color, size, alignment, and a text shadow builder | `text-{bp}-start`, `-center`, `-end` |
|
|
583
|
+
| Typography | family, weight, style, line height, letter spacing, transform, decoration | |
|
|
584
|
+
| Display | display, opacity, overflow, visibility | display, `d-{bp}-*` from `none` to `inline-flex`, with the eye in the drawer that hides and shows |
|
|
585
|
+
| Flex | | direction, wrap, `justify-content-{bp}-*`, `align-items-{bp}-*`, `align-content-{bp}-*`; on anything but a row the gaps, `gap-{bp}-{0–5}`, `row-gap-*`, `column-gap-*`, and fill, grow and shrink |
|
|
586
|
+
| Position | position, `top`, `right`, `bottom`, `left` (not on a column), `z-index` | sticky, `sticky-{bp}-top` / `-bottom`; float, `float-{bp}-*`, on an element |
|
|
587
|
+
| Custom css | whatever no field stands for, as text | |
|
|
588
|
+
|
|
589
|
+
What you type goes to the node's own `style`, through the browser: a value it
|
|
590
|
+
does not take is marked and not written, and whatever the host wrote that you
|
|
591
|
+
do not edit is kept, `!important` included. The style attribute is the same at
|
|
592
|
+
every size, and in a breakpoint view the accordion says so; the per breakpoint
|
|
593
|
+
fields are Bootstrap's responsive classes, and edit the view you are in.
|
|
594
|
+
A text gets only Text and Display, with their per breakpoint fields: its
|
|
595
|
+
editor owns what is inside it.
|
|
596
|
+
|
|
597
|
+
Every section but Spacing and Custom css also offers Bootstrap's classes for
|
|
598
|
+
what it styles - `rounded-3`, `shadow-sm`, `bg-primary`, `bg-primary-subtle`,
|
|
599
|
+
`text-bg-dark`, `bg-opacity-50`, `fs-4`, `fw-bold`, `vstack`, `fixed-top`,
|
|
600
|
+
and on an element `img-fluid` and `object-fit-cover`… - as chips. A chip puts its class in the
|
|
601
|
+
classes field, and pressing it again takes it off; chips that are
|
|
602
|
+
alternatives, like `rounded-2` and `rounded-pill`, take each other off.
|
|
603
|
+
Bootstrap's utilities are `!important`, so a field whose property a class on
|
|
604
|
+
the node also sets says which class takes priority.
|
|
605
|
+
|
|
606
|
+
With `settings_panel: 'popover'` or `'inline'` the panel has a *Style* button
|
|
607
|
+
instead, which opens the accordion in a dialog.
|
|
608
|
+
|
|
609
|
+
__`style`:__ Every section, unless you say otherwise.
|
|
610
|
+
|
|
611
|
+
```javascript
|
|
612
|
+
new GridEditor('#myGrid', {
|
|
613
|
+
style: {
|
|
614
|
+
sections: {
|
|
615
|
+
position: false, // no Position section
|
|
616
|
+
border: { properties: ['border-width', 'border-color'], catalog: false }, // two fields, no chips
|
|
617
|
+
},
|
|
618
|
+
spacing: { values: ['0', '2', '4'], scale: [/* if you changed $spacers */] },
|
|
619
|
+
visibility: { drawer: false }, // no eye in the drawers, the display field only
|
|
620
|
+
},
|
|
621
|
+
});
|
|
622
|
+
```
|
|
623
|
+
|
|
624
|
+
The sections are `size`, `spacing`, `border`, `background`, `text`,
|
|
625
|
+
`typography`, `display`, `flex`, `position` and `custom`. `properties` chooses and
|
|
626
|
+
orders a section's inline fields; the per breakpoint ones stay while the
|
|
627
|
+
section does. What a section you left out or narrowed would have shown is in
|
|
628
|
+
Custom css.
|
|
629
|
+
|
|
630
|
+
Sanitizing what `getHtml` returns is the page's business, style attributes
|
|
631
|
+
included.
|
|
632
|
+
|
|
633
|
+
A node that is flex or grid in the view you are in - a column with `d-flex`,
|
|
634
|
+
a row with `flex-nowrap` - has its drawer on top, out of the flow, so the
|
|
635
|
+
canvas lays out its content as the page will.
|
|
636
|
+
|
|
637
|
+
See [example/style.html](example/style.html).
|
|
638
|
+
|
|
563
639
|
### Responsive utilities
|
|
564
640
|
|
|
565
|
-
Bootstrap's responsive utility classes, edited per breakpoint.
|
|
566
|
-
|
|
641
|
+
Bootstrap's responsive utility classes, edited per breakpoint. The grid's are
|
|
642
|
+
plugins of their own; the ones that style a node are the style plugin's, above.
|
|
567
643
|
|
|
568
644
|
```html
|
|
569
|
-
<script src="grid-editor/dist/plugins/grideditor.visibility.min.js"></script>
|
|
570
645
|
<script src="grid-editor/dist/plugins/grideditor.order.min.js"></script>
|
|
571
646
|
<script src="grid-editor/dist/plugins/grideditor.alignment.min.js"></script>
|
|
572
647
|
<script src="grid-editor/dist/plugins/grideditor.gutters.min.js"></script>
|
|
573
|
-
<script src="grid-editor/dist/plugins/grideditor.
|
|
574
|
-
<script src="grid-editor/dist/plugins/grideditor.textalign.min.js"></script>
|
|
575
|
-
<script src="grid-editor/dist/plugins/grideditor.float.min.js"></script> <!-- after grideditor.elements -->
|
|
648
|
+
<script src="grid-editor/dist/plugins/grideditor.style.min.js"></script>
|
|
576
649
|
```
|
|
577
650
|
|
|
578
651
|
| Plugin | Classes | On |
|
|
579
652
|
| --- | --- | --- |
|
|
580
|
-
| `visibility` | `d-{bp}-none`, `d-{bp}-block`, `d-{bp}-flex` | rows, columns, elements, containers |
|
|
581
653
|
| `order` | `order-{bp}-{first,0–5,last}` | columns |
|
|
582
|
-
| `alignment` | `
|
|
654
|
+
| `alignment` | `align-self-{bp}-*` | columns |
|
|
583
655
|
| `gutters` | `g-{bp}-{0–5}`, `gx-{bp}-*`, `gy-{bp}-*` | rows |
|
|
584
|
-
| `
|
|
585
|
-
| `textalign` | `text-{bp}-start`, `-center`, `-end` | rows, columns, elements, containers |
|
|
586
|
-
| `float` | `float-{bp}-start`, `-end`, `-none` | elements |
|
|
656
|
+
| `style` | display, flex (a row's `justify-content-*` and `align-items-*` among it), spacing, text alignment, sticky and float; see [Style](#style) | rows, columns, elements, containers, texts |
|
|
587
657
|
|
|
588
658
|
A plugin puts a field in the *Responsive* section of each drawer's settings
|
|
589
|
-
panel
|
|
659
|
+
panel - or, for the style plugin, in its section of the *Style* accordion -
|
|
660
|
+
and some add a tool to the drawer. In a breakpoint view a change is
|
|
590
661
|
written for that breakpoint alone, and the field says what it inherits and from
|
|
591
662
|
where. In the all view it is written once, as the class with no breakpoint, and
|
|
592
663
|
replaces what the breakpoints said. While you edit, the canvas shows what the
|
|
593
664
|
classes mean in the view you are in; `getHtml` returns only the classes.
|
|
594
665
|
|
|
595
666
|
```javascript
|
|
596
|
-
ge.setUtility(column, '
|
|
597
|
-
ge.getUtility(column, '
|
|
667
|
+
ge.setUtility(column, 'display', 'none', 'md'); // d-md-none
|
|
668
|
+
ge.getUtility(column, 'display', 'lg'); // 'none', inherited
|
|
598
669
|
```
|
|
599
670
|
|
|
600
671
|
__`utilities`:__ Options for each plugin, under its name.
|
|
@@ -602,10 +673,8 @@ __`utilities`:__ Options for each plugin, under its name.
|
|
|
602
673
|
```javascript
|
|
603
674
|
new GridEditor('#myGrid', {
|
|
604
675
|
utilities: {
|
|
605
|
-
visibility: { drawer: false }, // no eye in the drawers, the field only
|
|
606
676
|
order: { drawer: false }, // no arrows in the column drawers
|
|
607
677
|
gutters: { scale: ['0', '.25rem', '.5rem', '1rem', '1.5rem', '3rem'] }, // if you changed $spacers
|
|
608
|
-
spacing: { values: ['0', '2', '4'], scale: [/* the same */] }, // offer fewer steps
|
|
609
678
|
},
|
|
610
679
|
});
|
|
611
680
|
```
|
|
@@ -880,9 +949,6 @@ new GridEditor('#myGrid', {
|
|
|
880
949
|
});
|
|
881
950
|
```
|
|
882
951
|
|
|
883
|
-
`config.on.instanceReady`, CKEditor 4's, is still called once the editor is
|
|
884
|
-
ready, with the editor as `this` and as `evt.editor`.
|
|
885
|
-
|
|
886
952
|
__`summernote.config`:__ Specify summernote config, when using the `summernote` `content_types`.
|
|
887
953
|
See the [summernote documentation](http://summernote.org/deep-dive/).
|
|
888
954
|
Also check out the [summernote example](example/summernote.html).
|
package/UPGRADING.md
CHANGED
|
@@ -1,3 +1,89 @@
|
|
|
1
|
+
Upgrading from grid-editor `7.x` to `8.0`
|
|
2
|
+
=========================================
|
|
3
|
+
|
|
4
|
+
8.0 takes out what kept pages, plugins and options of earlier versions
|
|
5
|
+
working. Nothing it removes warns: an option that is gone is ignored like any
|
|
6
|
+
option the editor does not know. The jQuery adapter stays, and so does the
|
|
7
|
+
conversion of markup 5.x saved. `8.0.0-beta.2` is the first beta published
|
|
8
|
+
(`8.0.0-beta.1` never was); install it with
|
|
9
|
+
`npm install @themarioga/grid-editor@next`.
|
|
10
|
+
|
|
11
|
+
* __The spacing, textalign, visibility and float plugins are gone.__ Load
|
|
12
|
+
`grideditor.style.js`, which has carried them since 7.3, and name it in the
|
|
13
|
+
`plugins` setting: `'spacing'`, `'textalign'`, `'visibility'` and `'float'`
|
|
14
|
+
there are plugins that are not loaded now, and only get the usual warning.
|
|
15
|
+
* __`utilities.spacing` and `utilities.visibility` are not read.__ They are
|
|
16
|
+
`style.spacing` and `style.visibility`.
|
|
17
|
+
* __`replaces` on a plugin's factory does nothing.__ A plugin that stood in
|
|
18
|
+
for another is loaded beside it, like any two plugins.
|
|
19
|
+
* __`changeView`, `getUtility` and `setUtility` take a view key only.__ The
|
|
20
|
+
numeric indexes of 2.x - `0`, `1`, `2` for desktop, tablet and phone - are
|
|
21
|
+
views that do not exist: `changeView(0)` warns that there is no such
|
|
22
|
+
layout mode and does nothing. Pass `'lg'`, `'sm'` or `'xs'`.
|
|
23
|
+
* __`sortable_options` and `resizable_options` are ignored__, without the
|
|
24
|
+
warning 4.0 gave: use `drag` and `resize`.
|
|
25
|
+
* __`tinymce.config.oninit` is passed to tinyMCE as it is__, without the
|
|
26
|
+
warning 7.0 gave: use `init_instance_callback`.
|
|
27
|
+
* __`ckeditor.config.on.instanceReady` is not called.__ It was CKEditor 4's,
|
|
28
|
+
and 7.x called it itself; `on` goes to CKEditor 5 as it is, which does not
|
|
29
|
+
know it. A function in `config.extraPlugins` is CKEditor 5's way: it is
|
|
30
|
+
called with the editor as the editor starts.
|
|
31
|
+
* __The adapter has no `$.fn.gridEditor.containers`, `.features`,
|
|
32
|
+
`.utilities` or `.texts`.__ A plugin written for 6.x that registers there
|
|
33
|
+
throws as it loads, where 7.x warned and left it out. Port it: see
|
|
34
|
+
"Port a plugin written for 6.x" below.
|
|
35
|
+
* __Gone from the locales:__ `warning.setting_removed`,
|
|
36
|
+
`warning.oninit_removed` and `warning.plugin_6x`. A locale of your own
|
|
37
|
+
can drop them.
|
|
38
|
+
|
|
39
|
+
What `8.0.0-beta.2` adds to that:
|
|
40
|
+
|
|
41
|
+
* __The `visibility` utility is `display`.__ It edits every `d-{bp}-*`
|
|
42
|
+
value now, not only hidden and shown: `setUtility(node, 'display', 'none',
|
|
43
|
+
'md')`, and `before-utility` and `after-utility` say `family: 'display'`.
|
|
44
|
+
`'visibility'` is a family no plugin declares, and gets the usual warning.
|
|
45
|
+
The eye and `style.visibility.drawer` are as they were.
|
|
46
|
+
* __A row's `justify-content-*` and `align-items-*` are the style plugin's.__
|
|
47
|
+
They are in its Flex section, on rows and on anything made flex, and the
|
|
48
|
+
alignment plugin keeps `align-self-*` only. A page that loads alignment
|
|
49
|
+
without style has no field for them: load `grideditor.style.js`.
|
|
50
|
+
* __Locale keys:__ `utility.visibility` and `utility.visibility_shown` are
|
|
51
|
+
gone, and `utility.display` is new; `utility.justify_content` and
|
|
52
|
+
`utility.align_items` come with the style plugin now. The Flex section and
|
|
53
|
+
sticky bring keys of their own, listed in
|
|
54
|
+
[docs/locale-keys.md](docs/locale-keys.md).
|
|
55
|
+
|
|
56
|
+
Upgrading from grid-editor `7.2` to `7.3`
|
|
57
|
+
=========================================
|
|
58
|
+
|
|
59
|
+
Nothing breaks. The spacing, textalign, visibility and float plugins are now
|
|
60
|
+
part of the **style plugin**, and deprecated on their own: they go in 8.0.
|
|
61
|
+
A page that loads them keeps working as it did, with a warning in the
|
|
62
|
+
console.
|
|
63
|
+
|
|
64
|
+
* __Load the style plugin instead of the four.__ It edits the same classes
|
|
65
|
+
per breakpoint, in its Spacing, Text, Display and Position sections rather
|
|
66
|
+
than in *Responsive*, and adds inline css and Bootstrap's classes as
|
|
67
|
+
chips.
|
|
68
|
+
|
|
69
|
+
```html
|
|
70
|
+
<script src="dist/plugins/grideditor.style.min.js"></script>
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
As a module, `import '@themarioga/grid-editor/plugins/style'`. Loaded
|
|
74
|
+
beside it, the old files stand down.
|
|
75
|
+
* __Name it in the `plugins` setting__, if the page names its plugins:
|
|
76
|
+
`plugins: ['style', …]` instead of `'spacing'`, `'textalign'`,
|
|
77
|
+
`'visibility'` or `'float'`. An old name still asks for the style plugin,
|
|
78
|
+
with a warning, until 8.0.
|
|
79
|
+
* __Move the options.__ `utilities: { spacing: … }` is
|
|
80
|
+
`style: { spacing: … }`, and `utilities: { visibility: … }` is
|
|
81
|
+
`style: { visibility: … }`. The old ones are still read, with a warning,
|
|
82
|
+
until 8.0.
|
|
83
|
+
* __Tests or code that look for the fields__ in the Responsive section find
|
|
84
|
+
them in the Style accordion now: `[data-ge-style-section="spacing"]` and
|
|
85
|
+
the others.
|
|
86
|
+
|
|
1
87
|
Upgrading from grid-editor `7.1` to `7.2`
|
|
2
88
|
=========================================
|
|
3
89
|
|