@themarioga/grid-editor 8.0.0-beta.3 → 8.1.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 (49) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +17 -11
  3. package/UPGRADING.md +21 -11
  4. package/dist/grideditor.bundle.min.js +3 -3
  5. package/dist/grideditor.css +52 -35
  6. package/dist/grideditor.d.ts +12 -9
  7. package/dist/grideditor.esm.js +44 -25
  8. package/dist/grideditor.js +44 -25
  9. package/dist/grideditor.min.css +1 -1
  10. package/dist/grideditor.min.css.map +1 -1
  11. package/dist/grideditor.min.js +2 -2
  12. package/dist/grideditor.min.js.map +3 -3
  13. package/dist/locales/grideditor.es.esm.js +70 -68
  14. package/dist/locales/grideditor.es.js +70 -68
  15. package/dist/locales/grideditor.es.min.js +1 -1
  16. package/dist/locales/grideditor.es.min.js.map +2 -2
  17. package/dist/plugins/grideditor.alignment.min.js.map +1 -1
  18. package/dist/plugins/{grideditor.style.esm.js → grideditor.inline-style.esm.js} +193 -184
  19. package/dist/plugins/{grideditor.style.js → grideditor.inline-style.js} +191 -182
  20. package/dist/plugins/grideditor.inline-style.min.js +4 -0
  21. package/dist/plugins/grideditor.inline-style.min.js.map +7 -0
  22. package/docs/locale-keys.md +82 -80
  23. package/docs/plugins.md +5 -5
  24. package/example/index.html +6 -6
  25. package/example/{style.html → inline-style.html} +5 -5
  26. package/example/utilities.html +3 -3
  27. package/package.json +1 -1
  28. package/src/js/grideditor.js +39 -22
  29. package/src/js/{style → inline-style}/accordion.js +9 -9
  30. package/src/js/{style → inline-style}/catalog.js +6 -6
  31. package/src/js/{style → inline-style}/custom.js +4 -4
  32. package/src/js/{style → inline-style}/display.js +2 -2
  33. package/src/js/{style → inline-style}/drawerflow.js +1 -1
  34. package/src/js/{style → inline-style}/fields.js +35 -25
  35. package/src/js/{style → inline-style}/flex.js +2 -2
  36. package/src/js/{style → inline-style}/float.js +2 -2
  37. package/src/js/{style → inline-style}/options.js +5 -5
  38. package/src/js/{style → inline-style}/sections.js +50 -50
  39. package/src/js/{style → inline-style}/spacing.js +2 -2
  40. package/src/js/{style → inline-style}/sticky.js +2 -2
  41. package/src/js/{style → inline-style}/textalign.js +2 -2
  42. package/src/js/locales/grideditor.es.js +70 -68
  43. package/src/js/plugins/grideditor.alignment.js +1 -1
  44. package/src/js/plugins/grideditor.inline-style.js +186 -0
  45. package/src/less/grideditor.less +43 -25
  46. package/types/grideditor.d.ts +12 -9
  47. package/dist/plugins/grideditor.style.min.js +0 -4
  48. package/dist/plugins/grideditor.style.min.js.map +0 -7
  49. package/src/js/plugins/grideditor.style.js +0 -185
@@ -76,6 +76,7 @@ title. `{kind}` is one of the `panel.kind_*` keys, or a container's own label.
76
76
  | `panel.done` | Done | The modal's button that closes it |
77
77
  | `panel.id` | Id | Label of the id field |
78
78
  | `panel.classes` | Classes | Label of the classes field |
79
+ | `panel.section_general` | Id and classes | Heading of the panel's section with the id, the classes and the preset toggles |
79
80
  | `panel.editor` | Editor | Label of a text's settings field that says which editor edits it |
80
81
  | `panel.kind_row` | Row | `{kind}` for a row |
81
82
  | `panel.kind_column` | Column | For a column |
@@ -96,7 +97,7 @@ The containers: tabs, accordions and popups, and the panes inside them.
96
97
  | `container.add_tabs` | Tabs | Toolbar button that adds a tabs container |
97
98
  | `container.add_tab` | Add tab | Container drawer, adds a pane |
98
99
  | `container.tab_label` | Tab {number} | Label of a new tab. `{number}` is its position |
99
- | `container.tabs_section` | Tabs | The tabs container's section of its settings panel |
100
+ | `container.tabs_section` | Tabs | Heading of the tabs container's section of its settings panel |
100
101
  | `container.tabs_style` | Style | Its strip's style select |
101
102
  | `container.tabs_style_tabs` | Tabs | Its choice for `nav-tabs` |
102
103
  | `container.tabs_style_pills` | Pills | Its choice for `nav-pills` |
@@ -239,7 +240,7 @@ utility.*
239
240
  ---------
240
241
 
241
242
  The Responsive section of a settings panel, which the utility plugins fill,
242
- and the per breakpoint fields of the style plugin's sections. The labels of
243
+ and the per breakpoint fields of the inline-style plugin's sections. The labels of
243
244
  each utility and its values are the plugins' own keys.
244
245
 
245
246
  | Key | English | Where |
@@ -253,9 +254,9 @@ each utility and its values are the plugins' own keys.
253
254
  | `utility.default` | Default | The empty choice of a field when nothing below the view sets the utility, and always in the all view |
254
255
  | `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` |
255
256
  | `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 |
256
- | `utility.display` | Display | Label of the display field, `d-*`, in the style plugin's Display section. Its other choices are the values themselves |
257
+ | `utility.display` | Display | Label of the display field, `d-*`, in the inline-style plugin's Display section. Its other choices are the values themselves |
257
258
  | `utility.visibility_hidden` | Hidden | Its choice for `d-*-none` |
258
- | `tool.hide_in_view` | Hide in this view | The style plugin's eye, on a node shown in the view being edited |
259
+ | `tool.hide_in_view` | Hide in this view | The inline-style plugin's eye, on a node shown in the view being edited |
259
260
  | `tool.show_in_view` | Show in this view | The same eye, on a node hidden there |
260
261
  | `utility.order` | Order | Label of the order plugin's field |
261
262
  | `utility.order_first` | First | Its choice for `order-*-first` |
@@ -266,7 +267,7 @@ each utility and its values are the plugins' own keys.
266
267
  | `utility.gutters` | Gutters | The gutters plugin's `g-*` field, on a row |
267
268
  | `utility.gutters_x` | Horizontal gutters | Its `gx-*` field |
268
269
  | `utility.gutters_y` | Vertical gutters | Its `gy-*` field |
269
- | `utility.padding` | Padding | The padding group, in the style plugin's Spacing section |
270
+ | `utility.padding` | Padding | The padding group, in the inline-style plugin's Spacing section |
270
271
  | `utility.margin` | Margin | Its margin group |
271
272
  | `utility.side_all` | All sides | The side of `p-*` and `m-*` in a group's side choice |
272
273
  | `utility.side_x` | Left and right | The side of `px-*` and `mx-*` |
@@ -275,11 +276,11 @@ each utility and its values are the plugins' own keys.
275
276
  | `utility.side_b` | Bottom | The side of `pb-*` and `mb-*` |
276
277
  | `utility.side_s` | Start | The side of `ps-*` and `ms-*` |
277
278
  | `utility.side_e` | End | The side of `pe-*` and `me-*` |
278
- | `utility.text_align` | Text alignment | Label of the text alignment field, in the style plugin's Text section |
279
+ | `utility.text_align` | Text alignment | Label of the text alignment field, in the inline-style plugin's Text section |
279
280
  | `utility.text_start` | Start | Its choice for `text-*-start` |
280
281
  | `utility.text_center` | Center | Its choice for `text-*-center` |
281
282
  | `utility.text_end` | End | Its choice for `text-*-end` |
282
- | `utility.flex_direction` | Direction | The `flex-*-row` / `-column` field, in the style plugin's Flex section |
283
+ | `utility.flex_direction` | Direction | The `flex-*-row` / `-column` field, in the inline-style plugin's Flex section |
283
284
  | `utility.flex_wrap` | Wrap | Its `flex-*-wrap` / `-nowrap` field |
284
285
  | `utility.justify_content` | Justify columns | Its `justify-content-*` field |
285
286
  | `utility.align_items` | Align columns | Its `align-items-*` field |
@@ -290,89 +291,90 @@ each utility and its values are the plugins' own keys.
290
291
  | `utility.flex_fill` | Fill | Its `flex-*-fill` field, on anything but a row |
291
292
  | `utility.flex_grow` | Grow | Its `flex-*-grow-*` field |
292
293
  | `utility.flex_shrink` | Shrink | Its `flex-*-shrink-*` field |
293
- | `utility.sticky` | Sticky | The `sticky-*-top` / `-bottom` field, in the style plugin's Position section |
294
- | `utility.float` | Float | Label of the float field, in the style plugin's Position section, on an element |
294
+ | `utility.sticky` | Sticky | The `sticky-*-top` / `-bottom` field, in the inline-style plugin's Position section |
295
+ | `utility.float` | Float | Label of the float field, in the inline-style plugin's Position section, on an element |
295
296
  | `utility.float_start` | Start | Its choice for `float-*-start` |
296
297
  | `utility.float_end` | End | Its choice for `float-*-end` |
297
298
  | `utility.float_none` | None | Its choice for `float-*-none` |
298
299
  | `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 |
299
300
 
300
301
 
301
- style.*
302
- -------
302
+ inline_style.*
303
+ --------------
303
304
 
304
- The style plugin's accordion, in a node's settings panel or in the dialog.
305
+ The inline-style plugin's accordion, in a node's settings panel or in the dialog.
305
306
 
306
307
  | Key | English | Where |
307
308
  | --- | --- | --- |
308
- | `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` |
309
- | `style.dialog_title` | Style: {kind} | Title of that dialog. `{kind}` is what the panel's title calls the node |
310
- | `style.section_size` | Size | The accordion's section header |
311
- | `style.section_spacing` | Spacing | The accordion's section header |
312
- | `style.section_border` | Border | The accordion's section header |
313
- | `style.section_background` | Background | The accordion's section header |
314
- | `style.section_text` | Text | The accordion's section header |
315
- | `style.section_typography` | Typography | The accordion's section header |
316
- | `style.section_display` | Display | The accordion's section header |
317
- | `style.section_flex` | Flex | The accordion's section header |
318
- | `style.section_position` | Position | The accordion's section header |
319
- | `style.section_custom` | Custom css | The accordion's section header |
320
- | `style.all_sizes` | Applies to every size | Note over a section's inline fields in a breakpoint view: the style attribute is not responsive |
321
- | `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 |
322
- | `style.invalid` | Not a value this property takes | Tooltip of an inline field holding a value the browser refused |
323
- | `style.catalog` | Bootstrap classes | Heading of a section's Bootstrap class chips |
324
- | `style.shadow_x` | X | A part of the shadow builder |
325
- | `style.shadow_y` | Y | A part of the shadow builder |
326
- | `style.shadow_blur` | Blur | A part of the shadow builder |
327
- | `style.shadow_spread` | Spread | A part of the shadow builder |
328
- | `style.shadow_color` | Color | A part of the shadow builder |
329
- | `style.shadow_inset` | Inset | The shadow builder's inset checkbox |
330
- | `style.shadow_text_mode` | Edit as text | Link under the shadow builder that edits the value as text |
331
- | `style.prop_width` | Width | Label of the `width` field |
332
- | `style.prop_height` | Height | Label of the `height` field |
333
- | `style.prop_min_width` | Min width | Label of the `min-width` field |
334
- | `style.prop_min_height` | Min height | Label of the `min-height` field |
335
- | `style.prop_max_width` | Max width | Label of the `max-width` field |
336
- | `style.prop_max_height` | Max height | Label of the `max-height` field |
337
- | `style.prop_margin_top` | Margin top | Label of the `margin-top` field |
338
- | `style.prop_margin_right` | Margin right | Label of the `margin-right` field |
339
- | `style.prop_margin_bottom` | Margin bottom | Label of the `margin-bottom` field |
340
- | `style.prop_margin_left` | Margin left | Label of the `margin-left` field |
341
- | `style.prop_padding_top` | Padding top | Label of the `padding-top` field |
342
- | `style.prop_padding_right` | Padding right | Label of the `padding-right` field |
343
- | `style.prop_padding_bottom` | Padding bottom | Label of the `padding-bottom` field |
344
- | `style.prop_padding_left` | Padding left | Label of the `padding-left` field |
345
- | `style.prop_border_width` | Border width | Label of the `border-width` field |
346
- | `style.prop_border_style` | Border style | Label of the `border-style` field |
347
- | `style.prop_border_color` | Border color | Label of the `border-color` field |
348
- | `style.prop_border_radius` | Border radius | Label of the `border-radius` field |
349
- | `style.prop_box_shadow` | Shadow | Label of the `box-shadow` field |
350
- | `style.prop_background_color` | Background color | Label of the `background-color` field |
351
- | `style.prop_background_image` | Background image | Label of the `background-image` field |
352
- | `style.prop_background_size` | Background size | Label of the `background-size` field |
353
- | `style.prop_background_position` | Background position | Label of the `background-position` field |
354
- | `style.prop_background_repeat` | Background repeat | Label of the `background-repeat` field |
355
- | `style.prop_color` | Color | Label of the `color` field |
356
- | `style.prop_font_size` | Font size | Label of the `font-size` field |
357
- | `style.prop_text_align` | Text align | Label of the `text-align` field |
358
- | `style.prop_text_shadow` | Text shadow | Label of the `text-shadow` field |
359
- | `style.prop_font_family` | Font family | Label of the `font-family` field |
360
- | `style.prop_font_weight` | Font weight | Label of the `font-weight` field |
361
- | `style.prop_font_style` | Font style | Label of the `font-style` field |
362
- | `style.prop_line_height` | Line height | Label of the `line-height` field |
363
- | `style.prop_letter_spacing` | Letter spacing | Label of the `letter-spacing` field |
364
- | `style.prop_text_transform` | Text transform | Label of the `text-transform` field |
365
- | `style.prop_text_decoration` | Text decoration | Label of the `text-decoration` field |
366
- | `style.prop_display` | Display | Label of the `display` field |
367
- | `style.prop_opacity` | Opacity | Label of the `opacity` field |
368
- | `style.prop_overflow` | Overflow | Label of the `overflow` field |
369
- | `style.prop_visibility` | Visibility | Label of the `visibility` field |
370
- | `style.prop_position` | Position | Label of the `position` field |
371
- | `style.prop_top` | Top | Label of the `top` field |
372
- | `style.prop_right` | Right | Label of the `right` field |
373
- | `style.prop_bottom` | Bottom | Label of the `bottom` field |
374
- | `style.prop_left` | Left | Label of the `left` field |
375
- | `style.prop_z_index` | Z-index | Label of the `z-index` field |
309
+ | `inline_style.section_title` | Style | Heading of the inline-style plugin's section of the panel, and the button that opens it in the dialog when `settings_panel` is `popover` or `inline` |
310
+ | `inline_style.dialog_title` | Style: {kind} | Title of that dialog. `{kind}` is what the panel's title calls the node |
311
+ | `inline_style.section_size` | Size | The accordion's section header |
312
+ | `inline_style.section_spacing` | Spacing | The accordion's section header |
313
+ | `inline_style.section_border` | Border | The accordion's section header |
314
+ | `inline_style.section_background` | Background | The accordion's section header |
315
+ | `inline_style.section_text` | Text | The accordion's section header |
316
+ | `inline_style.section_typography` | Typography | The accordion's section header |
317
+ | `inline_style.section_display` | Display | The accordion's section header |
318
+ | `inline_style.section_flex` | Flex | The accordion's section header |
319
+ | `inline_style.section_position` | Position | The accordion's section header |
320
+ | `inline_style.section_custom` | Custom css | The accordion's section header |
321
+ | `inline_style.all_sizes` | Applies to every size | Note over a section's inline fields in a breakpoint view: the style attribute is not responsive |
322
+ | `inline_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 |
323
+ | `inline_style.invalid` | Not a value this property takes | Tooltip of an inline field holding a value the browser refused |
324
+ | `inline_style.catalog` | Bootstrap classes | Heading of a section's Bootstrap class chips |
325
+ | `inline_style.shadow_x` | X | A part of the shadow builder |
326
+ | `inline_style.shadow_y` | Y | A part of the shadow builder |
327
+ | `inline_style.shadow_blur` | Blur | A part of the shadow builder |
328
+ | `inline_style.shadow_spread` | Spread | A part of the shadow builder |
329
+ | `inline_style.shadow_color` | Color | A part of the shadow builder |
330
+ | `inline_style.shadow_inset` | Inset | The shadow builder's inset checkbox |
331
+ | `inline_style.shadow_text_mode` | Edit as text | Link under the shadow builder that edits the value as text |
332
+ | `inline_style.shadow_builder_mode` | Edit with the builder | Link under a shadow edited as text that goes back to the builder, when the value is one shadow or none |
333
+ | `inline_style.prop_width` | Width | Label of the `width` field |
334
+ | `inline_style.prop_height` | Height | Label of the `height` field |
335
+ | `inline_style.prop_min_width` | Min width | Label of the `min-width` field |
336
+ | `inline_style.prop_min_height` | Min height | Label of the `min-height` field |
337
+ | `inline_style.prop_max_width` | Max width | Label of the `max-width` field |
338
+ | `inline_style.prop_max_height` | Max height | Label of the `max-height` field |
339
+ | `inline_style.prop_margin_top` | Margin top | Label of the `margin-top` field |
340
+ | `inline_style.prop_margin_right` | Margin right | Label of the `margin-right` field |
341
+ | `inline_style.prop_margin_bottom` | Margin bottom | Label of the `margin-bottom` field |
342
+ | `inline_style.prop_margin_left` | Margin left | Label of the `margin-left` field |
343
+ | `inline_style.prop_padding_top` | Padding top | Label of the `padding-top` field |
344
+ | `inline_style.prop_padding_right` | Padding right | Label of the `padding-right` field |
345
+ | `inline_style.prop_padding_bottom` | Padding bottom | Label of the `padding-bottom` field |
346
+ | `inline_style.prop_padding_left` | Padding left | Label of the `padding-left` field |
347
+ | `inline_style.prop_border_width` | Border width | Label of the `border-width` field |
348
+ | `inline_style.prop_border_style` | Border style | Label of the `border-style` field |
349
+ | `inline_style.prop_border_color` | Border color | Label of the `border-color` field |
350
+ | `inline_style.prop_border_radius` | Border radius | Label of the `border-radius` field |
351
+ | `inline_style.prop_box_shadow` | Shadow | Label of the `box-shadow` field |
352
+ | `inline_style.prop_background_color` | Background color | Label of the `background-color` field |
353
+ | `inline_style.prop_background_image` | Background image | Label of the `background-image` field |
354
+ | `inline_style.prop_background_size` | Background size | Label of the `background-size` field |
355
+ | `inline_style.prop_background_position` | Background position | Label of the `background-position` field |
356
+ | `inline_style.prop_background_repeat` | Background repeat | Label of the `background-repeat` field |
357
+ | `inline_style.prop_color` | Color | Label of the `color` field |
358
+ | `inline_style.prop_font_size` | Font size | Label of the `font-size` field |
359
+ | `inline_style.prop_text_align` | Text align | Label of the `text-align` field |
360
+ | `inline_style.prop_text_shadow` | Text shadow | Label of the `text-shadow` field |
361
+ | `inline_style.prop_font_family` | Font family | Label of the `font-family` field |
362
+ | `inline_style.prop_font_weight` | Font weight | Label of the `font-weight` field |
363
+ | `inline_style.prop_font_style` | Font style | Label of the `font-style` field |
364
+ | `inline_style.prop_line_height` | Line height | Label of the `line-height` field |
365
+ | `inline_style.prop_letter_spacing` | Letter spacing | Label of the `letter-spacing` field |
366
+ | `inline_style.prop_text_transform` | Text transform | Label of the `text-transform` field |
367
+ | `inline_style.prop_text_decoration` | Text decoration | Label of the `text-decoration` field |
368
+ | `inline_style.prop_display` | Display | Label of the `display` field |
369
+ | `inline_style.prop_opacity` | Opacity | Label of the `opacity` field |
370
+ | `inline_style.prop_overflow` | Overflow | Label of the `overflow` field |
371
+ | `inline_style.prop_visibility` | Visibility | Label of the `visibility` field |
372
+ | `inline_style.prop_position` | Position | Label of the `position` field |
373
+ | `inline_style.prop_top` | Top | Label of the `top` field |
374
+ | `inline_style.prop_right` | Right | Label of the `right` field |
375
+ | `inline_style.prop_bottom` | Bottom | Label of the `bottom` field |
376
+ | `inline_style.prop_left` | Left | Label of the `left` field |
377
+ | `inline_style.prop_z_index` | Z-index | Label of the `z-index` field |
376
378
 
377
379
 
378
380
  badge.*
package/docs/plugins.md CHANGED
@@ -241,7 +241,7 @@ so `ge.detailsOf(node)` finds what is in it.
241
241
 
242
242
  A field made with `ge.utilityField` in a section follows the view and the
243
243
  classes field as the Responsive section's do, wherever the section is at the
244
- time. The style plugin's accordion is a section, and what the spacing,
244
+ time. The inline-style plugin's accordion is a section, and what the spacing,
245
245
  textalign, display, flex, sticky and float fields are in: its families are
246
246
  `panel: false`, and it makes their fields itself.
247
247
 
@@ -497,14 +497,14 @@ tool does not belong. A tool writes with `ge.setUtility(node, family, value,
497
497
  `onRefresh(scope)` runs whenever the preview is redrawn — on `init`, on a view
498
498
  change, after a write, after the user types in a classes field — with the node
499
499
  whose utilities changed, or the canvas. It is for what a plugin marks the canvas
500
- with beyond inline styles: the style plugin's display keeps hidden nodes on the
500
+ with beyond inline styles: the inline-style plugin's display keeps hidden nodes on the
501
501
  canvas and fades them there, and takes the drawer of a flex node out of the
502
502
  flow. Whatever it adds, `onDeinit` takes away.
503
503
 
504
504
  ### A panel of your own
505
505
 
506
506
  A field per family is the right panel for most plugins and the wrong one for
507
- some: spacing, part of the style plugin, has fourteen families, and fourteen
507
+ some: spacing, part of the inline-style plugin, has fourteen families, and fourteen
508
508
  fields. Such a plugin marks
509
509
  its families `panel: false` and returns its own element from
510
510
  `panel(node, kind)` — or null where it does not apply — and the editor puts it
@@ -532,7 +532,7 @@ with a warning.
532
532
 
533
533
  Plugin options live in the `utilities` setting, under the plugin's name:
534
534
  `utilities: { gutters: { scale: [...] } }`. The editor passes the
535
- setting through as it is; each plugin fills in its own defaults. The style
536
- plugin's are the `style` setting, since most of them are about its inline
535
+ setting through as it is; each plugin fills in its own defaults. The
536
+ inline-style plugin's are the `inline_style` setting, since most of them are about its inline
537
537
  css.
538
538
 
@@ -49,10 +49,10 @@
49
49
  <a href="utilities.html">Responsive utilities</a>.
50
50
  </p>
51
51
  <p class="text-body-secondary">
52
- New in 7.3: the style plugin, inline css by section with
52
+ New in 7.3: the inline-style plugin, inline css by section with
53
53
  Bootstrap's classes as chips, which also carries display,
54
54
  spacing, text alignment and float. See
55
- <a href="style.html">Style</a>. In 8.0: flex, sticky and
55
+ <a href="inline-style.html">Inline style</a>. In 8.0: flex, sticky and
56
56
  Bootstrap 5.3's colors.
57
57
  </p>
58
58
 
@@ -138,12 +138,12 @@
138
138
  <span class="text-body-secondary">Bootstrap's utility classes edited per breakpoint: display, flex, column order, alignment, gutters, spacing, text alignment and float</span>
139
139
  </a>
140
140
 
141
- <a class="list-group-item list-group-item-action" href="style.html">
141
+ <a class="list-group-item list-group-item-action" href="inline-style.html">
142
142
  <div class="d-flex justify-content-between">
143
- <strong>Style</strong>
144
- <code class="text-body-secondary">style.html</code>
143
+ <strong>Inline style</strong>
144
+ <code class="text-body-secondary">inline-style.html</code>
145
145
  </div>
146
- <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
+ <span class="text-body-secondary">The inline-style plugin: inline css for rows, columns, containers and elements, by section, with Bootstrap's classes for each as chips</span>
147
147
  </a>
148
148
 
149
149
  <a class="list-group-item list-group-item-action" href="locale.html">
@@ -14,12 +14,12 @@
14
14
  <link rel="stylesheet" type="text/css" href="../dist/grideditor.css" />
15
15
 
16
16
  <!-- The editor, the elements and tabs plugins so there is one of each
17
- kind of node, and the style plugin. -->
17
+ kind of node, and the inline-style plugin. -->
18
18
  <script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.6/Sortable.min.js"></script>
19
19
  <script src="../dist/grideditor.min.js"></script>
20
20
  <script src="../dist/plugins/grideditor.elements.min.js"></script>
21
21
  <script src="../dist/plugins/grideditor.tabs.min.js"></script>
22
- <script src="../dist/plugins/grideditor.style.min.js"></script>
22
+ <script src="../dist/plugins/grideditor.inline-style.min.js"></script>
23
23
 
24
24
  <script>
25
25
  document.addEventListener('DOMContentLoaded', function() {
@@ -40,7 +40,7 @@
40
40
  // Every section, unless the host says otherwise: this
41
41
  // leaves out position and keeps the border section to
42
42
  // three fields with no chips
43
- style: narrow.checked ? {
43
+ inline_style: narrow.checked ? {
44
44
  sections: {
45
45
  position: false,
46
46
  border: { properties: ['border-width', 'border-style', 'border-color'], catalog: false },
@@ -66,7 +66,7 @@
66
66
  });
67
67
  </script>
68
68
 
69
- <title>Grid Editor style example</title>
69
+ <title>Grid Editor inline style example</title>
70
70
  </head>
71
71
  <body>
72
72
  <!-- Back to the demo index -->
@@ -78,7 +78,7 @@
78
78
 
79
79
  <div class="row my-3">
80
80
  <div class="col-lg-8">
81
- <h1 class="h4">Style</h1>
81
+ <h1 class="h4">Inline style</h1>
82
82
  <p class="form-text">
83
83
  The gear of a row, a column, a container, a tab, an element
84
84
  or a section has a <strong>Style</strong> accordion: size,
@@ -14,8 +14,8 @@
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 fields in the settings panels. The style
18
- plugin carries display, flex, spacing, text alignment, sticky and
17
+ loading it is what puts its fields in the settings panels. The
18
+ inline-style plugin carries display, flex, spacing, text alignment, sticky and
19
19
  float, and edits them in its Style accordion - a row's justify and
20
20
  align among them, in Flex; order, a column's align-self and gutters
21
21
  are the grid's, and stay in the Responsive section. -->
@@ -26,7 +26,7 @@
26
26
  <script src="../dist/plugins/grideditor.gutters.min.js"></script>
27
27
  <!-- Float works on elements, so the elements plugin comes first -->
28
28
  <script src="../dist/plugins/grideditor.elements.min.js"></script>
29
- <script src="../dist/plugins/grideditor.style.min.js"></script>
29
+ <script src="../dist/plugins/grideditor.inline-style.min.js"></script>
30
30
 
31
31
  <script>
32
32
  document.addEventListener('DOMContentLoaded', function() {
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": "8.0.0-beta.3",
36
+ "version": "8.1.0",
37
37
  "main": "dist/grideditor.js",
38
38
  "module": "dist/grideditor.esm.js",
39
39
  "types": "dist/grideditor.d.ts",
@@ -142,10 +142,14 @@ var NESTED_SETTINGS = {
142
142
  auto: false, // Treat every child of a content area as an element
143
143
  },
144
144
  resize: {
145
- enabled: true,
145
+ enabled: true, // The handle on the column's edge
146
+ tools: true, // The narrower and wider tools in the column's drawer
146
147
  handles: 'e', // Which edges carry a handle: 'e', 'w', or 'e, w'
147
148
  balance: 'next', // 'next' takes the units out of the following column
148
149
  },
150
+ indent: {
151
+ tools: true, // The indent tools in the column's drawer
152
+ },
149
153
  drag: {
150
154
  delay: 0, // Milliseconds to hold before a drag starts
151
155
  touch_delay: 100, // The same for touch, where 0 eats the page's scrolling
@@ -380,6 +384,7 @@ function build(instance, baseElem, optionsOrMethod) {
380
384
  'layout_modes' : VIEW_KEYS.slice(), // Which views the dropdown offers
381
385
  'default_view' : ALL_VIEW,
382
386
  'resize' : NESTED_SETTINGS.resize, // Resizing a column by dragging its edge
387
+ 'indent' : NESTED_SETTINGS.indent, // Indenting a column, offset-*
383
388
  'source_textarea' : '',
384
389
  'edit_source' : true, // The toolbar's button to edit the canvas as html
385
390
  'locale' : 'en', // Code of a locale in GridEditor.locales
@@ -2973,30 +2978,34 @@ function build(instance, baseElem, optionsOrMethod) {
2973
2978
 
2974
2979
  createMoveTool(drawer);
2975
2980
 
2976
- createTool(drawer, t('tool.column_narrower'), 'ge-decrease-col-width', 'bi bi-dash-lg', function(e) {
2977
- resizeColumn(col, e.shiftKey
2978
- ? smallest(settings.valid_col_sizes)
2979
- : stepThrough(settings.valid_col_sizes.filter(isUnits), currentUnits(col), -1),
2980
- 'tool');
2981
- });
2981
+ if (settings.resize.tools !== false) {
2982
+ createTool(drawer, t('tool.column_narrower'), 'ge-decrease-col-width', 'bi bi-dash-lg', function(e) {
2983
+ resizeColumn(col, e.shiftKey
2984
+ ? smallest(settings.valid_col_sizes)
2985
+ : stepThrough(settings.valid_col_sizes.filter(isUnits), currentUnits(col), -1),
2986
+ 'tool');
2987
+ });
2982
2988
 
2983
- createTool(drawer, t('tool.column_wider'), 'ge-increase-col-width', 'bi bi-plus-lg', function(e) {
2984
- resizeColumn(col, e.shiftKey
2985
- ? widestFor(col)
2986
- : stepThrough(settings.valid_col_sizes.filter(isUnits), currentUnits(col), 1),
2987
- 'tool');
2988
- });
2989
+ createTool(drawer, t('tool.column_wider'), 'ge-increase-col-width', 'bi bi-plus-lg', function(e) {
2990
+ resizeColumn(col, e.shiftKey
2991
+ ? widestFor(col)
2992
+ : stepThrough(settings.valid_col_sizes.filter(isUnits), currentUnits(col), 1),
2993
+ 'tool');
2994
+ });
2995
+ }
2989
2996
 
2990
- createTool(drawer, t('tool.indent_decrease'), 'ge-decrease-col-offset', 'bi bi-text-indent-right', function(e) {
2991
- indentColumn(col, e.shiftKey
2992
- ? smallest(settings.valid_col_offsets)
2993
- : stepThrough(settings.valid_col_offsets, currentOffset(col), -1),
2994
- 'tool');
2995
- });
2997
+ if (settings.indent.tools !== false) {
2998
+ createTool(drawer, t('tool.indent_decrease'), 'ge-decrease-col-offset', 'bi bi-text-indent-right', function(e) {
2999
+ indentColumn(col, e.shiftKey
3000
+ ? smallest(settings.valid_col_offsets)
3001
+ : stepThrough(settings.valid_col_offsets, currentOffset(col), -1),
3002
+ 'tool');
3003
+ });
2996
3004
 
2997
- createTool(drawer, t('tool.indent_increase'), 'ge-increase-col-offset', 'bi bi-text-indent-left', function(e) {
2998
- indentColumn(col, e.shiftKey ? deepestFor(col) : stepThrough(settings.valid_col_offsets, currentOffset(col), 1), 'tool');
2999
- });
3005
+ createTool(drawer, t('tool.indent_increase'), 'ge-increase-col-offset', 'bi bi-text-indent-left', function(e) {
3006
+ indentColumn(col, e.shiftKey ? deepestFor(col) : stepThrough(settings.valid_col_offsets, currentOffset(col), 1), 'tool');
3007
+ });
3008
+ }
3000
3009
 
3001
3010
  addSettingsTool(drawer, col, settings.col_classes);
3002
3011
 
@@ -3206,6 +3215,7 @@ function build(instance, baseElem, optionsOrMethod) {
3206
3215
 
3207
3216
  function createDetails(container, cssClasses) {
3208
3217
  var detailsDiv = dom.element('div', { 'class': 'ge-details' });
3218
+ detailsDiv.appendChild(sectionTitle(t('panel.section_general')));
3209
3219
  var general = detailsDiv.appendChild(dom.element('div', { 'class': 'ge-details-general' }));
3210
3220
  var field = function(label) {
3211
3221
  var holder = dom.element('label', { 'class': 'ge-field' });
@@ -3272,6 +3282,11 @@ function build(instance, baseElem, optionsOrMethod) {
3272
3282
  return detailsDiv;
3273
3283
  }
3274
3284
 
3285
+ /** The heading of one of a panel's sections. */
3286
+ function sectionTitle(text) {
3287
+ return dom.element('h6', { 'class': 'ge-section-title' }, text);
3288
+ }
3289
+
3275
3290
  /**
3276
3291
  * What plugins add to a node's panel, between its general fields and
3277
3292
  * the Responsive section: each plugin's panelSection(node, kind), in
@@ -3294,6 +3309,7 @@ function build(instance, baseElem, optionsOrMethod) {
3294
3309
  var holder = dom.element('div', { 'class': 'ge-panel-section', 'data-ge-plugin': name });
3295
3310
 
3296
3311
  if (mode === 'offcanvas' || mode === 'modal') {
3312
+ holder.appendChild(sectionTitle(t(section.labelKey)));
3297
3313
  holder.appendChild(section.body);
3298
3314
  } else {
3299
3315
  var label = t(section.labelKey);
@@ -5302,6 +5318,7 @@ GridEditor.locales = {
5302
5318
  'panel.done': 'Done',
5303
5319
  'panel.id': 'Id',
5304
5320
  'panel.classes': 'Classes',
5321
+ 'panel.section_general': 'Id and classes',
5305
5322
  'panel.kind_row': 'Row',
5306
5323
  'panel.kind_column': 'Column',
5307
5324
  'panel.kind_element': 'Element',
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The style plugin's accordion for one node: a section per group of
2
+ * The inline-style plugin's accordion for one node: a section per group of
3
3
  * properties, each with the merged utilities' per breakpoint fields, the
4
4
  * inline fields and the catalog - as far as each applies to the node.
5
5
  *
@@ -46,7 +46,7 @@ function partContent(ge, part, node, kind) {
46
46
 
47
47
  if (fields.length < 2) { return fields[0] || null; }
48
48
 
49
- var box = dom.element('div', { 'class': 'ge-style-part-fields' });
49
+ var box = dom.element('div', { 'class': 'ge-inline-style-part-fields' });
50
50
  fields.forEach(function(field) { box.appendChild(field); });
51
51
 
52
52
  return box;
@@ -59,7 +59,7 @@ function partContent(ge, part, node, kind) {
59
59
  */
60
60
  export function createAccordion(ge, node, kind, context) {
61
61
  var inline = takesInlineStyle(node, kind);
62
- var accordion = dom.element('div', { 'class': 'accordion ge-style' });
62
+ var accordion = dom.element('div', { 'class': 'accordion ge-inline-style' });
63
63
  var fields = [];
64
64
  var catalogs = [];
65
65
  var notes = [];
@@ -68,7 +68,7 @@ export function createAccordion(ge, node, kind, context) {
68
68
  var changed = function() { render(); };
69
69
 
70
70
  function item(key, labelKey) {
71
- var entry = accordion.appendChild(dom.element('div', { 'class': 'accordion-item', 'data-ge-style-section': key }));
71
+ var entry = accordion.appendChild(dom.element('div', { 'class': 'accordion-item', 'data-ge-inline-style-section': key }));
72
72
  var header = entry.appendChild(dom.element('h2', { 'class': 'accordion-header' }));
73
73
  var button = header.appendChild(dom.element('button', {
74
74
  type: 'button',
@@ -114,13 +114,13 @@ export function createAccordion(ge, node, kind, context) {
114
114
  if (!parts.length && !properties.length && !catalog) { return; }
115
115
 
116
116
  var body = item(key, section.labelKey).body;
117
- parts.forEach(function(part) { body.appendChild(dom.addClass(part, 'ge-style-part')); });
117
+ parts.forEach(function(part) { body.appendChild(dom.addClass(part, 'ge-inline-style-part')); });
118
118
 
119
119
  if (properties.length) {
120
- var note = body.appendChild(dom.element('small', { 'class': 'ge-style-note ge-style-all-sizes' }, ge.t('style.all_sizes')));
120
+ var note = body.appendChild(dom.element('small', { 'class': 'ge-inline-style-note ge-inline-style-all-sizes' }, ge.t('inline_style.all_sizes')));
121
121
  notes.push(note);
122
122
 
123
- var grid = body.appendChild(dom.element('div', { 'class': 'ge-style-fields' }));
123
+ var grid = body.appendChild(dom.element('div', { 'class': 'ge-inline-style-fields' }));
124
124
  properties.forEach(function(property) {
125
125
  var field = createStyleField(ge, node, property, changed);
126
126
  fields.push(field);
@@ -137,7 +137,7 @@ export function createAccordion(ge, node, kind, context) {
137
137
  // Last, since it shows what the fields made above do not
138
138
  if (customItem) {
139
139
  custom = createCustom(ge, node, fields.map(function(field) {
140
- return field.getAttribute('data-ge-style-property');
140
+ return field.getAttribute('data-ge-inline-style-property');
141
141
  }), changed);
142
142
  customItem.body.appendChild(custom.element);
143
143
  accordion.appendChild(customItem.entry);
@@ -148,7 +148,7 @@ export function createAccordion(ge, node, kind, context) {
148
148
  /** Open this section and no other; null closes them all. */
149
149
  function open(key) {
150
150
  dom.all(accordion, '.accordion-item').forEach(function(entry) {
151
- toggle(entry, entry.getAttribute('data-ge-style-section') === key);
151
+ toggle(entry, entry.getAttribute('data-ge-inline-style-section') === key);
152
152
  });
153
153
  }
154
154
 
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The style plugin's catalog: Bootstrap's classes for what a section
2
+ * The inline-style plugin's catalog: Bootstrap's classes for what a section
3
3
  * styles, as chips that put a class on the node or take it off.
4
4
  *
5
5
  * A chip never touches the node itself. It writes the panel's classes
@@ -41,16 +41,16 @@ export function createCatalog(ge, node, kind, groups) {
41
41
  var offered = groups.filter(function(group) { return offeredOn(group, kind); });
42
42
  if (!offered.length) { return null; }
43
43
 
44
- var box = dom.element('div', { 'class': 'ge-style-catalog' });
45
- box.appendChild(dom.element('span', { 'class': 'ge-style-label' }, ge.t('style.catalog')));
44
+ var box = dom.element('div', { 'class': 'ge-inline-style-catalog' });
45
+ box.appendChild(dom.element('span', { 'class': 'ge-inline-style-label' }, ge.t('inline_style.catalog')));
46
46
 
47
47
  offered.forEach(function(group) {
48
- var row = box.appendChild(dom.element('div', { 'class': 'ge-style-chips' }));
48
+ var row = box.appendChild(dom.element('div', { 'class': 'ge-inline-style-chips' }));
49
49
 
50
50
  group.classes.forEach(function(name) {
51
51
  var chip = row.appendChild(dom.element('button', {
52
52
  type: 'button',
53
- 'class': 'btn btn-sm btn-outline-secondary ge-style-chip',
53
+ 'class': 'btn btn-sm btn-outline-secondary ge-inline-style-chip',
54
54
  'data-ge-class': name,
55
55
  'aria-pressed': 'false',
56
56
  }, name));
@@ -68,7 +68,7 @@ export function createCatalog(ge, node, kind, groups) {
68
68
  export function renderCatalog(box, node) {
69
69
  var classes = classesOf(node);
70
70
 
71
- dom.all(box, '.ge-style-chip').forEach(function(chip) {
71
+ dom.all(box, '.ge-inline-style-chip').forEach(function(chip) {
72
72
  var on = classes.indexOf(chip.getAttribute('data-ge-class')) !== -1;
73
73
  dom.toggleClass(chip, 'active', on);
74
74
  chip.setAttribute('aria-pressed', on ? 'true' : 'false');
@@ -1,5 +1,5 @@
1
1
  /**
2
- * The style plugin's free css: a textarea with every declaration of the
2
+ * The inline-style plugin's free css: a textarea with every declaration of the
3
3
  * node's own style that no field on show stands for - whatever the host
4
4
  * wrote that the sections have no field for, and what a section the host
5
5
  * turned off or narrowed would have shown.
@@ -36,12 +36,12 @@ export function createCustom(ge, node, properties, changed) {
36
36
  longhands(property).forEach(function(longhand) { covered[longhand] = true; });
37
37
  });
38
38
 
39
- var box = dom.element('div', { 'class': 'ge-style-custom' });
39
+ var box = dom.element('div', { 'class': 'ge-inline-style-custom' });
40
40
  var textarea = box.appendChild(dom.element('textarea', {
41
- 'class': 'form-control form-control-sm font-monospace ge-style-custom-css',
41
+ 'class': 'form-control form-control-sm font-monospace ge-inline-style-custom-css',
42
42
  rows: '4',
43
43
  spellcheck: 'false',
44
- 'aria-label': ge.t('style.section_custom'),
44
+ 'aria-label': ge.t('inline_style.section_custom'),
45
45
  }));
46
46
 
47
47
  /** The declarations of the host's style no field stands for. */