@themarioga/grid-editor 7.1.0 → 7.3.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 +63 -0
- package/README.md +117 -19
- package/UPGRADING.md +72 -0
- package/dist/grideditor.bundle.min.js +3 -3
- package/dist/grideditor.css +102 -0
- package/dist/grideditor.d.ts +18 -0
- package/dist/grideditor.esm.js +292 -32
- package/dist/grideditor.js +292 -32
- 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 +70 -1
- package/dist/locales/grideditor.es.js +70 -1
- package/dist/locales/grideditor.es.min.js +1 -1
- package/dist/locales/grideditor.es.min.js.map +2 -2
- package/dist/plugins/grideditor.ckeditor.esm.js +123 -48
- package/dist/plugins/grideditor.ckeditor.js +123 -48
- package/dist/plugins/grideditor.ckeditor.min.js +1 -1
- package/dist/plugins/grideditor.ckeditor.min.js.map +3 -3
- package/dist/plugins/grideditor.float.esm.js +10 -1
- package/dist/plugins/grideditor.float.js +8 -2
- package/dist/plugins/grideditor.float.min.js +1 -1
- package/dist/plugins/grideditor.float.min.js.map +4 -4
- package/dist/plugins/grideditor.spacing.esm.js +12 -3
- package/dist/plugins/grideditor.spacing.js +9 -3
- package/dist/plugins/grideditor.spacing.min.js +1 -1
- package/dist/plugins/grideditor.spacing.min.js.map +4 -4
- package/dist/plugins/grideditor.style.esm.js +1593 -0
- package/dist/plugins/grideditor.style.js +1592 -0
- package/dist/plugins/grideditor.style.min.js +2 -0
- package/dist/plugins/grideditor.style.min.js.map +7 -0
- package/dist/plugins/grideditor.summernote.esm.js +1 -1
- package/dist/plugins/grideditor.summernote.js +1 -1
- package/dist/plugins/grideditor.summernote.min.js +1 -1
- package/dist/plugins/grideditor.summernote.min.js.map +2 -2
- package/dist/plugins/grideditor.textalign.esm.js +10 -1
- package/dist/plugins/grideditor.textalign.js +8 -2
- package/dist/plugins/grideditor.textalign.min.js +1 -1
- package/dist/plugins/grideditor.textalign.min.js.map +4 -4
- package/dist/plugins/grideditor.tinymce.esm.js +1 -1
- package/dist/plugins/grideditor.tinymce.js +1 -1
- package/dist/plugins/grideditor.tinymce.min.js +1 -1
- package/dist/plugins/grideditor.tinymce.min.js.map +2 -2
- package/dist/plugins/grideditor.visibility.esm.js +12 -3
- package/dist/plugins/grideditor.visibility.js +9 -3
- package/dist/plugins/grideditor.visibility.min.js +1 -1
- package/dist/plugins/grideditor.visibility.min.js.map +4 -4
- package/docs/locale-keys.md +89 -8
- package/docs/plugins.md +49 -5
- package/example/ckeditor.html +9 -4
- package/example/index.html +15 -1
- package/example/style.html +151 -0
- package/example/utilities.html +15 -11
- package/package.json +1 -1
- package/src/js/grideditor.js +366 -28
- package/src/js/locales/grideditor.es.js +70 -1
- package/src/js/plugins/grideditor.ckeditor.js +129 -65
- package/src/js/plugins/grideditor.float.js +8 -33
- package/src/js/plugins/grideditor.spacing.js +8 -273
- package/src/js/plugins/grideditor.style.js +179 -0
- package/src/js/plugins/grideditor.textalign.js +8 -39
- package/src/js/plugins/grideditor.visibility.js +8 -147
- package/src/js/style/accordion.js +157 -0
- package/src/js/style/catalog.js +76 -0
- package/src/js/style/custom.js +84 -0
- package/src/js/style/fields.js +382 -0
- package/src/js/style/float.js +46 -0
- package/src/js/style/options.js +75 -0
- package/src/js/style/sections.js +271 -0
- package/src/js/style/spacing.js +286 -0
- package/src/js/style/textalign.js +52 -0
- package/src/js/style/visibility.js +160 -0
- package/src/js/text/grideditor.text.js +1 -1
- package/src/less/grideditor.less +111 -0
- package/types/grideditor.d.ts +18 -0
package/docs/locale-keys.md
CHANGED
|
@@ -221,8 +221,11 @@ key, so a locale covers a new breakpoint by adding `view.<key>`. Short strings
|
|
|
221
221
|
utility.*
|
|
222
222
|
---------
|
|
223
223
|
|
|
224
|
-
The Responsive section of a settings panel, which the utility plugins fill
|
|
225
|
-
|
|
224
|
+
The Responsive section of a settings panel, which the utility plugins fill,
|
|
225
|
+
and the per breakpoint fields of the style plugin's sections. The labels of
|
|
226
|
+
each utility and its values are the plugins' own keys. The spacing,
|
|
227
|
+
textalign, visibility and float fields were plugins of their own up to 7.2,
|
|
228
|
+
and are the style plugin's now.
|
|
226
229
|
|
|
227
230
|
| Key | English | Where |
|
|
228
231
|
| --- | --- | --- |
|
|
@@ -235,10 +238,10 @@ The labels of each utility and its values are the plugins' own keys.
|
|
|
235
238
|
| `utility.default` | Default | The empty choice of a field when nothing below the view sets the utility, and always in the all view |
|
|
236
239
|
| `utility.inherit` | Inherit: {value} (from {breakpoint}) | The empty choice in a breakpoint view when a smaller breakpoint sets the utility. `{breakpoint}` is its key, `sm` |
|
|
237
240
|
| `utility.varies` | Changes at {breakpoints}; choosing here replaces that | Note under a field in the all view when breakpoints set their own value. `{breakpoints}` is a list of keys |
|
|
238
|
-
| `utility.visibility` | Visibility | Label of the visibility plugin's
|
|
241
|
+
| `utility.visibility` | Visibility | Label of the visibility field, in the style plugin's Display section |
|
|
239
242
|
| `utility.visibility_hidden` | Hidden | Its choice for `d-*-none` |
|
|
240
243
|
| `utility.visibility_shown` | Shown | Its choice for `d-*-block`, or `d-*-flex` on a row |
|
|
241
|
-
| `tool.hide_in_view` | Hide in this view | The
|
|
244
|
+
| `tool.hide_in_view` | Hide in this view | The style plugin's visibility eye, on a node shown in the view being edited |
|
|
242
245
|
| `tool.show_in_view` | Show in this view | The same eye, on a node hidden there |
|
|
243
246
|
| `utility.order` | Order | Label of the order plugin's field |
|
|
244
247
|
| `utility.order_first` | First | Its choice for `order-*-first` |
|
|
@@ -251,7 +254,7 @@ The labels of each utility and its values are the plugins' own keys.
|
|
|
251
254
|
| `utility.gutters` | Gutters | The gutters plugin's `g-*` field, on a row |
|
|
252
255
|
| `utility.gutters_x` | Horizontal gutters | Its `gx-*` field |
|
|
253
256
|
| `utility.gutters_y` | Vertical gutters | Its `gy-*` field |
|
|
254
|
-
| `utility.padding` | Padding | The
|
|
257
|
+
| `utility.padding` | Padding | The padding group, in the style plugin's Spacing section |
|
|
255
258
|
| `utility.margin` | Margin | Its margin group |
|
|
256
259
|
| `utility.side_all` | All sides | The side of `p-*` and `m-*` in a group's side choice |
|
|
257
260
|
| `utility.side_x` | Left and right | The side of `px-*` and `mx-*` |
|
|
@@ -260,17 +263,93 @@ The labels of each utility and its values are the plugins' own keys.
|
|
|
260
263
|
| `utility.side_b` | Bottom | The side of `pb-*` and `mb-*` |
|
|
261
264
|
| `utility.side_s` | Start | The side of `ps-*` and `ms-*` |
|
|
262
265
|
| `utility.side_e` | End | The side of `pe-*` and `me-*` |
|
|
263
|
-
| `utility.text_align` | Text alignment | Label of the
|
|
266
|
+
| `utility.text_align` | Text alignment | Label of the text alignment field, in the style plugin's Text section |
|
|
264
267
|
| `utility.text_start` | Start | Its choice for `text-*-start` |
|
|
265
268
|
| `utility.text_center` | Center | Its choice for `text-*-center` |
|
|
266
269
|
| `utility.text_end` | End | Its choice for `text-*-end` |
|
|
267
|
-
| `utility.float` | Float | Label of the float plugin's
|
|
270
|
+
| `utility.float` | Float | Label of the float field, in the style plugin's Position section, on an element |
|
|
268
271
|
| `utility.float_start` | Start | Its choice for `float-*-start` |
|
|
269
272
|
| `utility.float_end` | End | Its choice for `float-*-end` |
|
|
270
273
|
| `utility.float_none` | None | Its choice for `float-*-none` |
|
|
271
274
|
| `utility.spacing_gutter` | A column's side padding is its gutter: changing it changes the gutter | Note in a column's spacing group while it carries side padding |
|
|
272
275
|
|
|
273
276
|
|
|
277
|
+
style.*
|
|
278
|
+
-------
|
|
279
|
+
|
|
280
|
+
The style plugin's accordion, in a node's settings panel or in the dialog.
|
|
281
|
+
|
|
282
|
+
| Key | English | Where |
|
|
283
|
+
| --- | --- | --- |
|
|
284
|
+
| `style.section_title` | Style | The style plugin's accordion, and the button that opens it in the dialog when `settings_panel` is `popover` or `inline` |
|
|
285
|
+
| `style.dialog_title` | Style: {kind} | Title of that dialog. `{kind}` is what the panel's title calls the node |
|
|
286
|
+
| `style.section_size` | Size | The accordion's section header |
|
|
287
|
+
| `style.section_spacing` | Spacing | The accordion's section header |
|
|
288
|
+
| `style.section_border` | Border | The accordion's section header |
|
|
289
|
+
| `style.section_background` | Background | The accordion's section header |
|
|
290
|
+
| `style.section_text` | Text | The accordion's section header |
|
|
291
|
+
| `style.section_typography` | Typography | The accordion's section header |
|
|
292
|
+
| `style.section_display` | Display | The accordion's section header |
|
|
293
|
+
| `style.section_position` | Position | The accordion's section header |
|
|
294
|
+
| `style.section_custom` | Custom css | The accordion's section header |
|
|
295
|
+
| `style.all_sizes` | Applies to every size | Note over a section's inline fields in a breakpoint view: the style attribute is not responsive |
|
|
296
|
+
| `style.overridden` | The class {class} takes priority over this value | Note under an inline field whose property a Bootstrap utility on the node also sets. `{class}` is that class |
|
|
297
|
+
| `style.invalid` | Not a value this property takes | Tooltip of an inline field holding a value the browser refused |
|
|
298
|
+
| `style.catalog` | Bootstrap classes | Heading of a section's Bootstrap class chips |
|
|
299
|
+
| `style.shadow_x` | X | A part of the shadow builder |
|
|
300
|
+
| `style.shadow_y` | Y | A part of the shadow builder |
|
|
301
|
+
| `style.shadow_blur` | Blur | A part of the shadow builder |
|
|
302
|
+
| `style.shadow_spread` | Spread | A part of the shadow builder |
|
|
303
|
+
| `style.shadow_color` | Color | A part of the shadow builder |
|
|
304
|
+
| `style.shadow_inset` | Inset | The shadow builder's inset checkbox |
|
|
305
|
+
| `style.shadow_text_mode` | Edit as text | Link under the shadow builder that edits the value as text |
|
|
306
|
+
| `style.prop_width` | Width | Label of the `width` field |
|
|
307
|
+
| `style.prop_height` | Height | Label of the `height` field |
|
|
308
|
+
| `style.prop_min_width` | Min width | Label of the `min-width` field |
|
|
309
|
+
| `style.prop_min_height` | Min height | Label of the `min-height` field |
|
|
310
|
+
| `style.prop_max_width` | Max width | Label of the `max-width` field |
|
|
311
|
+
| `style.prop_max_height` | Max height | Label of the `max-height` field |
|
|
312
|
+
| `style.prop_margin_top` | Margin top | Label of the `margin-top` field |
|
|
313
|
+
| `style.prop_margin_right` | Margin right | Label of the `margin-right` field |
|
|
314
|
+
| `style.prop_margin_bottom` | Margin bottom | Label of the `margin-bottom` field |
|
|
315
|
+
| `style.prop_margin_left` | Margin left | Label of the `margin-left` field |
|
|
316
|
+
| `style.prop_padding_top` | Padding top | Label of the `padding-top` field |
|
|
317
|
+
| `style.prop_padding_right` | Padding right | Label of the `padding-right` field |
|
|
318
|
+
| `style.prop_padding_bottom` | Padding bottom | Label of the `padding-bottom` field |
|
|
319
|
+
| `style.prop_padding_left` | Padding left | Label of the `padding-left` field |
|
|
320
|
+
| `style.prop_border_width` | Border width | Label of the `border-width` field |
|
|
321
|
+
| `style.prop_border_style` | Border style | Label of the `border-style` field |
|
|
322
|
+
| `style.prop_border_color` | Border color | Label of the `border-color` field |
|
|
323
|
+
| `style.prop_border_radius` | Border radius | Label of the `border-radius` field |
|
|
324
|
+
| `style.prop_box_shadow` | Shadow | Label of the `box-shadow` field |
|
|
325
|
+
| `style.prop_background_color` | Background color | Label of the `background-color` field |
|
|
326
|
+
| `style.prop_background_image` | Background image | Label of the `background-image` field |
|
|
327
|
+
| `style.prop_background_size` | Background size | Label of the `background-size` field |
|
|
328
|
+
| `style.prop_background_position` | Background position | Label of the `background-position` field |
|
|
329
|
+
| `style.prop_background_repeat` | Background repeat | Label of the `background-repeat` field |
|
|
330
|
+
| `style.prop_color` | Color | Label of the `color` field |
|
|
331
|
+
| `style.prop_font_size` | Font size | Label of the `font-size` field |
|
|
332
|
+
| `style.prop_text_align` | Text align | Label of the `text-align` field |
|
|
333
|
+
| `style.prop_text_shadow` | Text shadow | Label of the `text-shadow` field |
|
|
334
|
+
| `style.prop_font_family` | Font family | Label of the `font-family` field |
|
|
335
|
+
| `style.prop_font_weight` | Font weight | Label of the `font-weight` field |
|
|
336
|
+
| `style.prop_font_style` | Font style | Label of the `font-style` field |
|
|
337
|
+
| `style.prop_line_height` | Line height | Label of the `line-height` field |
|
|
338
|
+
| `style.prop_letter_spacing` | Letter spacing | Label of the `letter-spacing` field |
|
|
339
|
+
| `style.prop_text_transform` | Text transform | Label of the `text-transform` field |
|
|
340
|
+
| `style.prop_text_decoration` | Text decoration | Label of the `text-decoration` field |
|
|
341
|
+
| `style.prop_display` | Display | Label of the `display` field |
|
|
342
|
+
| `style.prop_opacity` | Opacity | Label of the `opacity` field |
|
|
343
|
+
| `style.prop_overflow` | Overflow | Label of the `overflow` field |
|
|
344
|
+
| `style.prop_visibility` | Visibility | Label of the `visibility` field |
|
|
345
|
+
| `style.prop_position` | Position | Label of the `position` field |
|
|
346
|
+
| `style.prop_top` | Top | Label of the `top` field |
|
|
347
|
+
| `style.prop_right` | Right | Label of the `right` field |
|
|
348
|
+
| `style.prop_bottom` | Bottom | Label of the `bottom` field |
|
|
349
|
+
| `style.prop_left` | Left | Label of the `left` field |
|
|
350
|
+
| `style.prop_z_index` | Z-index | Label of the `z-index` field |
|
|
351
|
+
|
|
352
|
+
|
|
274
353
|
badge.*
|
|
275
354
|
-------
|
|
276
355
|
|
|
@@ -302,7 +381,9 @@ all the same: the developer reading them is the one who chose the locale.
|
|
|
302
381
|
| `warning.adapter_no_jquery` | grideditor.jquery.js needs jQuery 4, … | `grideditor.jquery.js` loaded on a page with no jQuery |
|
|
303
382
|
| `warning.oninit_removed` | tinyMCE's oninit option was removed in 7.0 … | A `tinymce.config` that still has `oninit`; `init_instance_callback` is called |
|
|
304
383
|
| `error.tinymce_missing` | tinyMCE not available! … | `content_types: ['tinymce']` with no tinyMCE loaded |
|
|
305
|
-
| `error.ckeditor_missing` | CKEditor not available! … | `content_types: ['ckeditor']` with no CKEditor loaded |
|
|
384
|
+
| `error.ckeditor_missing` | CKEditor 5 not available! … | `content_types: ['ckeditor']` with no CKEditor 5 loaded, CKEditor 4 included |
|
|
385
|
+
| `error.ckeditor_start` | CKEditor could not start: {message} | `InlineEditor.create` failed: most likely no `licenseKey` in `ckeditor.config` |
|
|
386
|
+
| `warning.ckeditor_plugin` | CKEditor has no plugin called {name}, … | A plugin name in `ckeditor.config.plugins` that is not on `window.CKEDITOR` |
|
|
306
387
|
| `error.summernote_missing` | Summernote not available! … | `content_types: ['summernote']` with no Summernote loaded |
|
|
307
388
|
| `error.codemirror_missing` | CodeMirror not available! … | The codemirror plugin's source view with no CodeMirror loaded: the textarea is used |
|
|
308
389
|
|
package/docs/plugins.md
CHANGED
|
@@ -160,6 +160,9 @@ array.
|
|
|
160
160
|
| `ge.nodeHtml(node)` | One node's markup as `getHtml` would give it. The canvas leaves editing to read it and comes back, as it does for `getHtml` |
|
|
161
161
|
| `ge.toolbarItems(name)` | An array of the toolbar buttons the feature plugin `name` declared, for showing and hiding them |
|
|
162
162
|
| `ge.bareStyle(node, family, property)` | A css property's value on the node with none of the family's classes: what a preview shows when no class applies and that is not a constant |
|
|
163
|
+
| `ge.hostStyle(node, property?)` | `{ value, priority }` of one property of the node's own style, as the host wrote it: never a breakpoint preview's. With no property, the whole of it as css text |
|
|
164
|
+
| `ge.setHostStyle(node, property, value, priority?)` | Write one property of the node's own style, or take it off with `''`. Under a breakpoint preview it is the host's value that changes, and the preview goes back on top. False, and nothing written, for a value the browser refuses. A priority left out keeps the one the property had; no `style=""` is left behind |
|
|
165
|
+
| `ge.openDialog(title, body, opener?)` / `ge.closeDialog()` | A modal of the editor's own, over whatever settings panel is open, which stays open under it. `body` is moved in, and back where it was when the dialog closes; `opener` has the focus back. Bootstrap's modal when Bootstrap's javascript is there, one of the editor's own when it is not. Escape closes the dialog and nothing else; `deinit`, `getHtml`, `setLocale`, `destroy` and closing the panel close it |
|
|
163
166
|
|
|
164
167
|
The add, delete and move events for a container and its panes are fired by the
|
|
165
168
|
editor, not by the plugin: `createPaneControls` handles a pane's delete, and
|
|
@@ -192,6 +195,7 @@ GridEditor.features.elements = function(ge) {
|
|
|
192
195
|
accepts: function(region, node) { … }, // false turns a block away from a region
|
|
193
196
|
toolbar: [{ labelKey: …, kind: …, create: function() { … } }], // buttons beside the containers'
|
|
194
197
|
drawerTools: function(drawer, node, kind) { … }, // tools beside the gear, in every drawer
|
|
198
|
+
panelSection: function(node, kind) { … }, // a section of the node's settings panel, see below
|
|
195
199
|
};
|
|
196
200
|
};
|
|
197
201
|
```
|
|
@@ -224,6 +228,43 @@ needs to put a new kind of block on the canvas:
|
|
|
224
228
|
child: it sits beside it, in a wrapper that only exists while editing, so
|
|
225
229
|
`ge.drawerOf(node)` is how to find it.
|
|
226
230
|
|
|
231
|
+
### A section of the settings panel
|
|
232
|
+
|
|
233
|
+
**`panelSection(node, kind)`**, which any kind of plugin can have, returns a
|
|
234
|
+
section for the node's settings panel - `{ labelKey, titleKey, body }` - or
|
|
235
|
+
null where it has none. The editor puts the sections between the panel's
|
|
236
|
+
general fields and *Responsive*, in the order the plugins were registered.
|
|
237
|
+
Where the panel has room for it, in the offcanvas and the modal, `body` is in
|
|
238
|
+
the panel. A popover, or a panel inline in the drawer, gets a button with the
|
|
239
|
+
label instead, and `body` opens in the dialog, titled `titleKey` - with the
|
|
240
|
+
node's kind as `{kind}` - or the label. `body` stays the panel's either way,
|
|
241
|
+
so `ge.detailsOf(node)` finds what is in it.
|
|
242
|
+
|
|
243
|
+
A field made with `ge.utilityField` in a section follows the view and the
|
|
244
|
+
classes field as the Responsive section's do, wherever the section is at the
|
|
245
|
+
time. The style plugin's accordion is a section, and what the spacing,
|
|
246
|
+
textalign, visibility and float fields are in: its families are
|
|
247
|
+
`panel: false`, and it makes their fields itself.
|
|
248
|
+
|
|
249
|
+
A section that writes css should write it with `ge.setHostStyle` and read it
|
|
250
|
+
with `ge.hostStyle`: in a breakpoint view the node's `style` holds the
|
|
251
|
+
preview's `!important` values too, and they come off on `deinit` with
|
|
252
|
+
whatever was written under them.
|
|
253
|
+
|
|
254
|
+
### A plugin that takes the place of others
|
|
255
|
+
|
|
256
|
+
A factory with **`replaces: ['old', …]`** on it - the function, not what it
|
|
257
|
+
returns, since it is read before any factory is called - stands in for those
|
|
258
|
+
plugins. Loaded beside it, they stand down, with a warning, and none of their
|
|
259
|
+
families is declared twice; an old name in the `plugins` setting asks for it,
|
|
260
|
+
with a warning that the name is deprecated. This is how the style plugin
|
|
261
|
+
takes the spacing, textalign, visibility and float plugins' place:
|
|
262
|
+
|
|
263
|
+
```javascript
|
|
264
|
+
GridEditor.utilities.style = function(ge) { … };
|
|
265
|
+
GridEditor.utilities.style.replaces = ['spacing', 'textalign', 'visibility', 'float'];
|
|
266
|
+
```
|
|
267
|
+
|
|
227
268
|
### Settings of your own, saved on the node
|
|
228
269
|
|
|
229
270
|
A tool that opens a dialog and saves what the user chose on the node is a
|
|
@@ -477,19 +518,20 @@ tool does not belong. A tool writes with `ge.setUtility(node, family, value,
|
|
|
477
518
|
`onRefresh(scope)` runs whenever the preview is redrawn — on `init`, on a view
|
|
478
519
|
change, after a write, after the user types in a classes field — with the node
|
|
479
520
|
whose utilities changed, or the canvas. It is for what a plugin marks the canvas
|
|
480
|
-
with beyond inline styles: the
|
|
521
|
+
with beyond inline styles: the style plugin's visibility keeps hidden nodes on the
|
|
481
522
|
canvas and fades them there. Whatever it adds, `onDeinit` takes away.
|
|
482
523
|
|
|
483
524
|
### A panel of your own
|
|
484
525
|
|
|
485
526
|
A field per family is the right panel for most plugins and the wrong one for
|
|
486
|
-
some: spacing has fourteen families, and fourteen
|
|
527
|
+
some: spacing, part of the style plugin, has fourteen families, and fourteen
|
|
528
|
+
fields. Such a plugin marks
|
|
487
529
|
its families `panel: false` and returns its own element from
|
|
488
530
|
`panel(node, kind)` — or null where it does not apply — and the editor puts it
|
|
489
531
|
in the Responsive section. Inside it, `ge.utilityField(node, family)` makes the
|
|
490
532
|
same field the editor would, and the editor keeps every such field up to date
|
|
491
533
|
with the view and the classes; swapping one field for another is the plugin's
|
|
492
|
-
business. The spacing
|
|
534
|
+
business. The spacing panel is a side and one field, and choosing a
|
|
493
535
|
side swaps the field for that side's family.
|
|
494
536
|
|
|
495
537
|
The same plugins tend to need the node as a whole for the preview, because
|
|
@@ -509,6 +551,8 @@ Two plugins cannot declare the same family name: the second one is ignored,
|
|
|
509
551
|
with a warning.
|
|
510
552
|
|
|
511
553
|
Plugin options live in the `utilities` setting, under the plugin's name:
|
|
512
|
-
`utilities: {
|
|
513
|
-
setting through as it is; each plugin fills in its own defaults.
|
|
554
|
+
`utilities: { gutters: { scale: [...] } }`. The editor passes the
|
|
555
|
+
setting through as it is; each plugin fills in its own defaults. The style
|
|
556
|
+
plugin's are the `style` setting, since most of them are about its inline
|
|
557
|
+
css; `utilities.spacing` and `utilities.visibility` are read there until 8.0.
|
|
514
558
|
|
package/example/ckeditor.html
CHANGED
|
@@ -10,8 +10,9 @@
|
|
|
10
10
|
<!-- Javascript dependencies -->
|
|
11
11
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
|
|
12
12
|
|
|
13
|
-
<!--
|
|
14
|
-
<
|
|
13
|
+
<!-- CKEditor 5: its browser build, and its stylesheet -->
|
|
14
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ckeditor5@48.5.2/dist/browser/ckeditor5.css">
|
|
15
|
+
<script src="https://cdn.jsdelivr.net/npm/ckeditor5@48.5.2/dist/browser/ckeditor5.umd.js"></script>
|
|
15
16
|
|
|
16
17
|
<!-- Grid editor CSS -->
|
|
17
18
|
<link rel="stylesheet" type="text/css" href="../dist/grideditor.css" />
|
|
@@ -28,11 +29,15 @@
|
|
|
28
29
|
new_row_layouts: [[12], [6, 6], [9, 3]],
|
|
29
30
|
content_types: ['ckeditor'],
|
|
30
31
|
ckeditor: {
|
|
32
|
+
// Anything InlineEditor.create takes, over the plugin's
|
|
33
|
+
// own defaults: its plugins, toolbar and headings
|
|
31
34
|
config: {
|
|
35
|
+
// CKEditor 5 is GPL-2.0-or-later: 'GPL' accepts that
|
|
36
|
+
// licence. A commercial licence passes its own key.
|
|
37
|
+
licenseKey: 'GPL',
|
|
32
38
|
on: {
|
|
33
39
|
instanceReady: function(evt) {
|
|
34
|
-
|
|
35
|
-
console.log('instance ready', evt, instance);
|
|
40
|
+
console.log('instance ready', evt.editor);
|
|
36
41
|
}
|
|
37
42
|
}
|
|
38
43
|
}
|
package/example/index.html
CHANGED
|
@@ -48,6 +48,12 @@
|
|
|
48
48
|
gutters and spacing — per breakpoint. See
|
|
49
49
|
<a href="utilities.html">Responsive utilities</a>.
|
|
50
50
|
</p>
|
|
51
|
+
<p class="text-body-secondary">
|
|
52
|
+
New in 7.3: the style plugin, inline css by section with
|
|
53
|
+
Bootstrap's classes as chips, which also carries visibility,
|
|
54
|
+
spacing, text alignment and float. See
|
|
55
|
+
<a href="style.html">Style</a>.
|
|
56
|
+
</p>
|
|
51
57
|
|
|
52
58
|
<div class="list-group my-4">
|
|
53
59
|
|
|
@@ -131,6 +137,14 @@
|
|
|
131
137
|
<span class="text-body-secondary">Bootstrap's utility classes edited per breakpoint: visibility, column order, alignment, gutters, spacing, text alignment and float</span>
|
|
132
138
|
</a>
|
|
133
139
|
|
|
140
|
+
<a class="list-group-item list-group-item-action" href="style.html">
|
|
141
|
+
<div class="d-flex justify-content-between">
|
|
142
|
+
<strong>Style</strong>
|
|
143
|
+
<code class="text-body-secondary">style.html</code>
|
|
144
|
+
</div>
|
|
145
|
+
<span class="text-body-secondary">The style plugin: inline css for rows, columns, containers and elements, by section, with Bootstrap's classes for each as chips</span>
|
|
146
|
+
</a>
|
|
147
|
+
|
|
134
148
|
<a class="list-group-item list-group-item-action" href="locale.html">
|
|
135
149
|
<div class="d-flex justify-content-between">
|
|
136
150
|
<strong>Languages</strong>
|
|
@@ -144,7 +158,7 @@
|
|
|
144
158
|
<strong>CKEditor</strong>
|
|
145
159
|
<code class="text-body-secondary">ckeditor.html</code>
|
|
146
160
|
</div>
|
|
147
|
-
<span class="text-body-secondary">CKEditor in the content areas instead of tinyMCE</span>
|
|
161
|
+
<span class="text-body-secondary">CKEditor 5 in the content areas instead of tinyMCE</span>
|
|
148
162
|
</a>
|
|
149
163
|
|
|
150
164
|
<a class="list-group-item list-group-item-action" href="summernote.html">
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
5
|
+
|
|
6
|
+
<!-- CSS dependencies -->
|
|
7
|
+
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
|
|
8
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.css">
|
|
9
|
+
|
|
10
|
+
<!-- Javascript dependencies -->
|
|
11
|
+
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
|
|
12
|
+
|
|
13
|
+
<!-- Grid editor CSS -->
|
|
14
|
+
<link rel="stylesheet" type="text/css" href="../dist/grideditor.css" />
|
|
15
|
+
|
|
16
|
+
<!-- The editor, the elements and tabs plugins so there is one of each
|
|
17
|
+
kind of node, and the style plugin. -->
|
|
18
|
+
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.6/Sortable.min.js"></script>
|
|
19
|
+
<script src="../dist/grideditor.min.js"></script>
|
|
20
|
+
<script src="../dist/plugins/grideditor.elements.min.js"></script>
|
|
21
|
+
<script src="../dist/plugins/grideditor.tabs.min.js"></script>
|
|
22
|
+
<script src="../dist/plugins/grideditor.style.min.js"></script>
|
|
23
|
+
|
|
24
|
+
<script>
|
|
25
|
+
document.addEventListener('DOMContentLoaded', function() {
|
|
26
|
+
var grid = document.getElementById('myGrid');
|
|
27
|
+
var panel = document.getElementById('panel');
|
|
28
|
+
var narrow = document.getElementById('narrow');
|
|
29
|
+
var editor;
|
|
30
|
+
|
|
31
|
+
function start() {
|
|
32
|
+
editor = new GridEditor(grid, {
|
|
33
|
+
new_row_layouts: [[12], [6,6], [4,4,4], [8,4]],
|
|
34
|
+
content_types: [],
|
|
35
|
+
|
|
36
|
+
// Where a node's settings open. In a popover, or inline
|
|
37
|
+
// in the drawer, the Style accordion opens in a dialog
|
|
38
|
+
settings_panel: panel.value,
|
|
39
|
+
|
|
40
|
+
// Every section, unless the host says otherwise: this
|
|
41
|
+
// leaves out position and keeps the border section to
|
|
42
|
+
// three fields with no chips
|
|
43
|
+
style: narrow.checked ? {
|
|
44
|
+
sections: {
|
|
45
|
+
position: false,
|
|
46
|
+
border: { properties: ['border-width', 'border-style', 'border-color'], catalog: false },
|
|
47
|
+
},
|
|
48
|
+
} : {},
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
start();
|
|
52
|
+
|
|
53
|
+
// The same canvas, started again with the other settings
|
|
54
|
+
function restart() {
|
|
55
|
+
var html = editor.getHtml();
|
|
56
|
+
editor.destroy();
|
|
57
|
+
grid.innerHTML = html;
|
|
58
|
+
start();
|
|
59
|
+
}
|
|
60
|
+
panel.addEventListener('change', restart);
|
|
61
|
+
narrow.addEventListener('change', restart);
|
|
62
|
+
|
|
63
|
+
document.getElementById('output').addEventListener('click', function() {
|
|
64
|
+
document.getElementById('html').textContent = editor.getHtml();
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
</script>
|
|
68
|
+
|
|
69
|
+
<title>Grid Editor style example</title>
|
|
70
|
+
</head>
|
|
71
|
+
<body>
|
|
72
|
+
<!-- Back to the demo index -->
|
|
73
|
+
<div class="container pt-3">
|
|
74
|
+
<a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<div class="container">
|
|
78
|
+
|
|
79
|
+
<div class="row my-3">
|
|
80
|
+
<div class="col-lg-8">
|
|
81
|
+
<h1 class="h4">Style</h1>
|
|
82
|
+
<p class="form-text">
|
|
83
|
+
The gear of a row, a column, a container, a tab, an element
|
|
84
|
+
or a section has a <strong>Style</strong> accordion: size,
|
|
85
|
+
spacing, border, background, text, typography, display,
|
|
86
|
+
position and free css. What you type is written to the
|
|
87
|
+
node's own <code>style</code>; a value the browser does
|
|
88
|
+
not take is marked and not written.
|
|
89
|
+
</p>
|
|
90
|
+
<p class="form-text">
|
|
91
|
+
Each section also offers Bootstrap's classes for what it
|
|
92
|
+
styles, as chips: one puts its class in the classes field,
|
|
93
|
+
and pressing it again takes it off. Bootstrap's utilities
|
|
94
|
+
are <code>!important</code>, so a field whose property a
|
|
95
|
+
class on the node also sets says the class wins.
|
|
96
|
+
</p>
|
|
97
|
+
<p class="form-text">
|
|
98
|
+
The inline style is the same at every size. Padding and
|
|
99
|
+
margin, text alignment, visibility and float are
|
|
100
|
+
Bootstrap's responsive classes, edited per breakpoint in
|
|
101
|
+
their sections: pick a breakpoint in the dropdown.
|
|
102
|
+
</p>
|
|
103
|
+
<div class="d-flex flex-wrap align-items-center gap-3 mb-3">
|
|
104
|
+
<div class="d-flex align-items-center gap-2">
|
|
105
|
+
<label class="form-label mb-0" for="panel">A gear opens its settings in</label>
|
|
106
|
+
<select class="form-select form-select-sm w-auto" id="panel">
|
|
107
|
+
<option value="offcanvas">a side panel (offcanvas)</option>
|
|
108
|
+
<option value="popover">a popover</option>
|
|
109
|
+
<option value="modal">a modal</option>
|
|
110
|
+
<option value="inline">the drawer itself (inline)</option>
|
|
111
|
+
</select>
|
|
112
|
+
</div>
|
|
113
|
+
<div class="form-check mb-0">
|
|
114
|
+
<input class="form-check-input" type="checkbox" id="narrow">
|
|
115
|
+
<label class="form-check-label" for="narrow">Fewer sections: no position, a shorter border</label>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
118
|
+
<button class="btn btn-sm btn-secondary" id="output" type="button">Show the html this produces</button>
|
|
119
|
+
<pre id="html" class="form-text"></pre>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<div id="myGrid">
|
|
124
|
+
|
|
125
|
+
<div class="row" style="background-color: #f0f4ff; border-radius: 12px;">
|
|
126
|
+
<div class="col-12 col-md-8" style="padding-top: 1rem; padding-bottom: 1rem;">
|
|
127
|
+
<h2 class="h5">Styled inline</h2>
|
|
128
|
+
<p>This row has a background and a radius in its <code>style</code>; open its gear and look in Background and Border.</p>
|
|
129
|
+
</div>
|
|
130
|
+
<div class="col-12 col-md-4 shadow-sm rounded-3" style="box-shadow: 0 4px 12px rgba(0, 0, 0, .15)">
|
|
131
|
+
<h2 class="h5">A class and a style</h2>
|
|
132
|
+
<p>It has <code>shadow-sm</code> and an inline shadow: the class wins, and the Border section says so.</p>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
|
|
136
|
+
<div class="row my-3">
|
|
137
|
+
<div class="col-6">
|
|
138
|
+
<div data-ge-element="callout" data-ge-label="Callout" class="p-3 border-start border-4 bg-body-tertiary" style="font-style: italic; letter-spacing: .02em">
|
|
139
|
+
An element, with a few classes from the catalog and some typography of its own.
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
<div class="col-6">
|
|
143
|
+
<p>Try Size on this column: it offers only the min- and max- widths and heights, since its width is the grid's.</p>
|
|
144
|
+
</div>
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
</div> <!-- /#myGrid -->
|
|
148
|
+
</div> <!-- /.container -->
|
|
149
|
+
|
|
150
|
+
</body>
|
|
151
|
+
</html>
|
package/example/utilities.html
CHANGED
|
@@ -14,18 +14,19 @@
|
|
|
14
14
|
<link rel="stylesheet" type="text/css" href="../dist/grideditor.css" />
|
|
15
15
|
|
|
16
16
|
<!-- The editor, and the utility plugins. Each is a file of its own, and
|
|
17
|
-
loading it is what puts its
|
|
17
|
+
loading it is what puts its fields in the settings panels. The style
|
|
18
|
+
plugin carries visibility, spacing, text alignment and float, which
|
|
19
|
+
were plugins of their own up to 7.2, and edits them in its Style
|
|
20
|
+
accordion; order, alignment and gutters are the grid's, and stay in
|
|
21
|
+
the Responsive section. -->
|
|
18
22
|
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.6/Sortable.min.js"></script>
|
|
19
23
|
<script src="../dist/grideditor.min.js"></script>
|
|
20
|
-
<script src="../dist/plugins/grideditor.visibility.min.js"></script>
|
|
21
24
|
<script src="../dist/plugins/grideditor.order.min.js"></script>
|
|
22
25
|
<script src="../dist/plugins/grideditor.alignment.min.js"></script>
|
|
23
26
|
<script src="../dist/plugins/grideditor.gutters.min.js"></script>
|
|
24
|
-
<script src="../dist/plugins/grideditor.spacing.min.js"></script>
|
|
25
|
-
<script src="../dist/plugins/grideditor.textalign.min.js"></script>
|
|
26
27
|
<!-- Float works on elements, so the elements plugin comes first -->
|
|
27
28
|
<script src="../dist/plugins/grideditor.elements.min.js"></script>
|
|
28
|
-
<script src="../dist/plugins/grideditor.
|
|
29
|
+
<script src="../dist/plugins/grideditor.style.min.js"></script>
|
|
29
30
|
|
|
30
31
|
<script>
|
|
31
32
|
document.addEventListener('DOMContentLoaded', function() {
|
|
@@ -89,9 +90,11 @@
|
|
|
89
90
|
breakpoint. Pick a breakpoint in the dropdown and every
|
|
90
91
|
change is written for that breakpoint alone; in
|
|
91
92
|
<strong>All sizes</strong> it is written once, for every
|
|
92
|
-
size. Each drawer's gear has a <strong>
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
size. Each drawer's gear has a <strong>Style</strong>
|
|
94
|
+
accordion, whose sections hold visibility, spacing, text
|
|
95
|
+
alignment and float, and a <strong>Responsive</strong>
|
|
96
|
+
section for the grid's utilities. Every field says what
|
|
97
|
+
the breakpoint inherits and from where.
|
|
95
98
|
</p>
|
|
96
99
|
<div class="d-flex align-items-center gap-2 mb-3">
|
|
97
100
|
<label class="form-label mb-0" for="panel">A gear opens its settings in</label>
|
|
@@ -129,13 +132,14 @@
|
|
|
129
132
|
</p>
|
|
130
133
|
<p class="form-text">
|
|
131
134
|
<strong>Spacing:</strong> a padding and a margin group in
|
|
132
|
-
|
|
135
|
+
the Style accordion's Spacing section, each a side and a
|
|
136
|
+
value. The centred column
|
|
133
137
|
below gets more padding from small desktop up.
|
|
134
138
|
</p>
|
|
135
139
|
<p class="form-text">
|
|
136
|
-
<strong>Text alignment:</strong> a field in
|
|
140
|
+
<strong>Text alignment:</strong> a field in the Text section.
|
|
137
141
|
The centred column's text is centred from small desktop
|
|
138
|
-
up. <strong>Float:</strong> a field in an element's
|
|
142
|
+
up. <strong>Float:</strong> a field in an element's Position section;
|
|
139
143
|
the quote in the last row floats to the end from tablet up,
|
|
140
144
|
with the text flowing round it.
|
|
141
145
|
</p>
|
package/package.json
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"comment": "A scoped package publishes restricted unless it is told otherwise.",
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
|
-
"version": "7.
|
|
36
|
+
"version": "7.3.0",
|
|
37
37
|
"main": "dist/grideditor.js",
|
|
38
38
|
"module": "dist/grideditor.esm.js",
|
|
39
39
|
"types": "dist/grideditor.d.ts",
|