@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
@@ -56,6 +56,7 @@ GridEditor.locales.es = {
56
56
  'panel.done': 'Hecho',
57
57
  'panel.id': 'Id',
58
58
  'panel.classes': 'Clases',
59
+ 'panel.section_general': 'Id y clases',
59
60
  'panel.editor': 'Editor',
60
61
  'panel.kind_row': 'Fila',
61
62
  'panel.kind_column': 'Columna',
@@ -186,74 +187,75 @@ GridEditor.locales.es = {
186
187
  'utility.float_end': 'Fin',
187
188
  'utility.float_none': 'Ninguno',
188
189
  'utility.spacing_gutter': 'El relleno lateral de una columna es su espaciado: cambiarlo cambia el espacio entre columnas',
189
- 'style.section_title': 'Estilo',
190
- 'style.dialog_title': 'Estilo: {kind}',
191
- 'style.section_size': 'Tamaño',
192
- 'style.section_spacing': 'Espaciado',
193
- 'style.section_border': 'Borde',
194
- 'style.section_background': 'Fondo',
195
- 'style.section_text': 'Texto',
196
- 'style.section_typography': 'Tipografía',
197
- 'style.section_display': 'Visualización',
198
- 'style.section_flex': 'Flex',
199
- 'style.section_position': 'Posición',
200
- 'style.section_custom': 'CSS libre',
201
- 'style.all_sizes': 'Se aplica a todos los tamaños',
202
- 'style.overridden': 'La clase {class} tiene prioridad sobre este valor',
203
- 'style.invalid': 'Esta propiedad no acepta ese valor',
204
- 'style.catalog': 'Clases de Bootstrap',
205
- 'style.shadow_x': 'X',
206
- 'style.shadow_y': 'Y',
207
- 'style.shadow_blur': 'Desenfoque',
208
- 'style.shadow_spread': 'Extensión',
209
- 'style.shadow_color': 'Color',
210
- 'style.shadow_inset': 'Interior',
211
- 'style.shadow_text_mode': 'Editar como texto',
212
- 'style.prop_width': 'Ancho',
213
- 'style.prop_height': 'Alto',
214
- 'style.prop_min_width': 'Ancho mínimo',
215
- 'style.prop_min_height': 'Alto mínimo',
216
- 'style.prop_max_width': 'Ancho máximo',
217
- 'style.prop_max_height': 'Alto máximo',
218
- 'style.prop_margin_top': 'Margen superior',
219
- 'style.prop_margin_right': 'Margen derecho',
220
- 'style.prop_margin_bottom': 'Margen inferior',
221
- 'style.prop_margin_left': 'Margen izquierdo',
222
- 'style.prop_padding_top': 'Relleno superior',
223
- 'style.prop_padding_right': 'Relleno derecho',
224
- 'style.prop_padding_bottom': 'Relleno inferior',
225
- 'style.prop_padding_left': 'Relleno izquierdo',
226
- 'style.prop_border_width': 'Grosor del borde',
227
- 'style.prop_border_style': 'Estilo del borde',
228
- 'style.prop_border_color': 'Color del borde',
229
- 'style.prop_border_radius': 'Radio del borde',
230
- 'style.prop_box_shadow': 'Sombra',
231
- 'style.prop_background_color': 'Color de fondo',
232
- 'style.prop_background_image': 'Imagen de fondo',
233
- 'style.prop_background_size': 'Tamaño del fondo',
234
- 'style.prop_background_position': 'Posición del fondo',
235
- 'style.prop_background_repeat': 'Repetición del fondo',
236
- 'style.prop_color': 'Color',
237
- 'style.prop_font_size': 'Tamaño de letra',
238
- 'style.prop_text_align': 'Alineación',
239
- 'style.prop_text_shadow': 'Sombra del texto',
240
- 'style.prop_font_family': 'Fuente',
241
- 'style.prop_font_weight': 'Grosor de letra',
242
- 'style.prop_font_style': 'Estilo de letra',
243
- 'style.prop_line_height': 'Interlineado',
244
- 'style.prop_letter_spacing': 'Espaciado entre letras',
245
- 'style.prop_text_transform': 'Mayúsculas',
246
- 'style.prop_text_decoration': 'Decoración',
247
- 'style.prop_display': 'Display',
248
- 'style.prop_opacity': 'Opacidad',
249
- 'style.prop_overflow': 'Desbordamiento',
250
- 'style.prop_visibility': 'Visibilidad',
251
- 'style.prop_position': 'Posición',
252
- 'style.prop_top': 'Arriba',
253
- 'style.prop_right': 'Derecha',
254
- 'style.prop_bottom': 'Abajo',
255
- 'style.prop_left': 'Izquierda',
256
- 'style.prop_z_index': 'Z-index',
190
+ 'inline_style.section_title': 'Estilo',
191
+ 'inline_style.dialog_title': 'Estilo: {kind}',
192
+ 'inline_style.section_size': 'Tamaño',
193
+ 'inline_style.section_spacing': 'Espaciado',
194
+ 'inline_style.section_border': 'Borde',
195
+ 'inline_style.section_background': 'Fondo',
196
+ 'inline_style.section_text': 'Texto',
197
+ 'inline_style.section_typography': 'Tipografía',
198
+ 'inline_style.section_display': 'Visualización',
199
+ 'inline_style.section_flex': 'Flex',
200
+ 'inline_style.section_position': 'Posición',
201
+ 'inline_style.section_custom': 'CSS libre',
202
+ 'inline_style.all_sizes': 'Se aplica a todos los tamaños',
203
+ 'inline_style.overridden': 'La clase {class} tiene prioridad sobre este valor',
204
+ 'inline_style.invalid': 'Esta propiedad no acepta ese valor',
205
+ 'inline_style.catalog': 'Clases de Bootstrap',
206
+ 'inline_style.shadow_x': 'X',
207
+ 'inline_style.shadow_y': 'Y',
208
+ 'inline_style.shadow_blur': 'Desenfoque',
209
+ 'inline_style.shadow_spread': 'Extensión',
210
+ 'inline_style.shadow_color': 'Color',
211
+ 'inline_style.shadow_inset': 'Interior',
212
+ 'inline_style.shadow_text_mode': 'Editar como texto',
213
+ 'inline_style.shadow_builder_mode': 'Editar con el constructor',
214
+ 'inline_style.prop_width': 'Ancho',
215
+ 'inline_style.prop_height': 'Alto',
216
+ 'inline_style.prop_min_width': 'Ancho mínimo',
217
+ 'inline_style.prop_min_height': 'Alto mínimo',
218
+ 'inline_style.prop_max_width': 'Ancho máximo',
219
+ 'inline_style.prop_max_height': 'Alto máximo',
220
+ 'inline_style.prop_margin_top': 'Margen superior',
221
+ 'inline_style.prop_margin_right': 'Margen derecho',
222
+ 'inline_style.prop_margin_bottom': 'Margen inferior',
223
+ 'inline_style.prop_margin_left': 'Margen izquierdo',
224
+ 'inline_style.prop_padding_top': 'Relleno superior',
225
+ 'inline_style.prop_padding_right': 'Relleno derecho',
226
+ 'inline_style.prop_padding_bottom': 'Relleno inferior',
227
+ 'inline_style.prop_padding_left': 'Relleno izquierdo',
228
+ 'inline_style.prop_border_width': 'Grosor del borde',
229
+ 'inline_style.prop_border_style': 'Estilo del borde',
230
+ 'inline_style.prop_border_color': 'Color del borde',
231
+ 'inline_style.prop_border_radius': 'Radio del borde',
232
+ 'inline_style.prop_box_shadow': 'Sombra',
233
+ 'inline_style.prop_background_color': 'Color de fondo',
234
+ 'inline_style.prop_background_image': 'Imagen de fondo',
235
+ 'inline_style.prop_background_size': 'Tamaño del fondo',
236
+ 'inline_style.prop_background_position': 'Posición del fondo',
237
+ 'inline_style.prop_background_repeat': 'Repetición del fondo',
238
+ 'inline_style.prop_color': 'Color',
239
+ 'inline_style.prop_font_size': 'Tamaño de letra',
240
+ 'inline_style.prop_text_align': 'Alineación',
241
+ 'inline_style.prop_text_shadow': 'Sombra del texto',
242
+ 'inline_style.prop_font_family': 'Fuente',
243
+ 'inline_style.prop_font_weight': 'Grosor de letra',
244
+ 'inline_style.prop_font_style': 'Estilo de letra',
245
+ 'inline_style.prop_line_height': 'Interlineado',
246
+ 'inline_style.prop_letter_spacing': 'Espaciado entre letras',
247
+ 'inline_style.prop_text_transform': 'Mayúsculas',
248
+ 'inline_style.prop_text_decoration': 'Decoración',
249
+ 'inline_style.prop_display': 'Display',
250
+ 'inline_style.prop_opacity': 'Opacidad',
251
+ 'inline_style.prop_overflow': 'Desbordamiento',
252
+ 'inline_style.prop_visibility': 'Visibilidad',
253
+ 'inline_style.prop_position': 'Posición',
254
+ 'inline_style.prop_top': 'Arriba',
255
+ 'inline_style.prop_right': 'Derecha',
256
+ 'inline_style.prop_bottom': 'Abajo',
257
+ 'inline_style.prop_left': 'Izquierda',
258
+ 'inline_style.prop_z_index': 'Z-index',
257
259
  'error.sortable_missing': '¡SortableJS no está disponible! Asegúrate de haber cargado el archivo js de Sortable; sin él no se puede arrastrar.',
258
260
  'warning.already_editing': 'Este elemento ya tiene un editor: se devuelve ese, con las opciones con las que se creó.',
259
261
  'warning.destroyed': 'Se ha llamado a {method}() en un editor destruido, y no hace nada.',
@@ -10,7 +10,7 @@
10
10
  * <script src="dist/plugins/grideditor.alignment.min.js"></script>
11
11
  *
12
12
  * How a row justifies and aligns its columns - justify-content-* and
13
- * align-items-* - is a flex container's, and the style plugin's Flex section
13
+ * align-items-* - is a flex container's, and the inline-style plugin's Flex section
14
14
  * edits it, on a row and on anything else made flex.
15
15
  *
16
16
  * A field only, in the settings panel: alignment is set now and then, not
@@ -0,0 +1,186 @@
1
+ /**
2
+ * Inline style for grid-editor.
3
+ *
4
+ * A utility plugin: load this file after the editor and every row, column,
5
+ * container, pane, element and section gets a Style accordion in its
6
+ * settings panel - size, spacing, border, background, text, typography,
7
+ * display, flex, position and free css - written to the node's own style
8
+ * attribute, with Bootstrap's classes for each section as chips that put
9
+ * them in the classes field. What it can ask the editor for is the handle
10
+ * its factory is called with, described in docs/plugins.md.
11
+ *
12
+ * <script src="dist/grideditor.min.js"></script>
13
+ * <script src="dist/plugins/grideditor.inline-style.min.js"></script>
14
+ *
15
+ * It also edits spacing, text alignment, display, flex, sticky and float,
16
+ * Bootstrap's responsive classes, per breakpoint in its sections. On a node
17
+ * that is flex or grid, the drawer leaves the flow, so the canvas lays the
18
+ * content out as the page will.
19
+ *
20
+ * Where the settings panel has no room for it - a popover, inline in the
21
+ * drawer - the accordion opens in a dialog, from a Style button.
22
+ *
23
+ * inline_style.sections chooses the sections, and in each the properties and
24
+ * whether it has a catalog; inline_style.spacing is the options of spacing, whose
25
+ * scale the gaps share, and inline_style.visibility those of the eye.
26
+ */
27
+ import { GridEditor } from '../grideditor.js';
28
+ import { spacingPart } from '../inline-style/spacing.js';
29
+ import { textalignPart } from '../inline-style/textalign.js';
30
+ import { displayPart } from '../inline-style/display.js';
31
+ import { flexPart } from '../inline-style/flex.js';
32
+ import { floatPart } from '../inline-style/float.js';
33
+ import { stickyPart } from '../inline-style/sticky.js';
34
+ import { drawerflowPart } from '../inline-style/drawerflow.js';
35
+ import { resolveOptions } from '../inline-style/options.js';
36
+ import { createAccordion } from '../inline-style/accordion.js';
37
+
38
+ Object.assign(GridEditor.locales.en, {
39
+ 'inline_style.section_title': 'Style',
40
+ 'inline_style.dialog_title': 'Style: {kind}',
41
+ 'inline_style.section_size': 'Size',
42
+ 'inline_style.section_spacing': 'Spacing',
43
+ 'inline_style.section_border': 'Border',
44
+ 'inline_style.section_background': 'Background',
45
+ 'inline_style.section_text': 'Text',
46
+ 'inline_style.section_typography': 'Typography',
47
+ 'inline_style.section_display': 'Display',
48
+ 'inline_style.section_flex': 'Flex',
49
+ 'inline_style.section_position': 'Position',
50
+ 'inline_style.section_custom': 'Custom css',
51
+ 'inline_style.all_sizes': 'Applies to every size',
52
+ 'inline_style.overridden': 'The class {class} takes priority over this value',
53
+ 'inline_style.invalid': 'Not a value this property takes',
54
+ 'inline_style.catalog': 'Bootstrap classes',
55
+ 'inline_style.shadow_x': 'X',
56
+ 'inline_style.shadow_y': 'Y',
57
+ 'inline_style.shadow_blur': 'Blur',
58
+ 'inline_style.shadow_spread': 'Spread',
59
+ 'inline_style.shadow_color': 'Color',
60
+ 'inline_style.shadow_inset': 'Inset',
61
+ 'inline_style.shadow_text_mode': 'Edit as text',
62
+ 'inline_style.shadow_builder_mode': 'Edit with the builder',
63
+ 'inline_style.prop_width': 'Width',
64
+ 'inline_style.prop_height': 'Height',
65
+ 'inline_style.prop_min_width': 'Min width',
66
+ 'inline_style.prop_min_height': 'Min height',
67
+ 'inline_style.prop_max_width': 'Max width',
68
+ 'inline_style.prop_max_height': 'Max height',
69
+ 'inline_style.prop_margin_top': 'Margin top',
70
+ 'inline_style.prop_margin_right': 'Margin right',
71
+ 'inline_style.prop_margin_bottom': 'Margin bottom',
72
+ 'inline_style.prop_margin_left': 'Margin left',
73
+ 'inline_style.prop_padding_top': 'Padding top',
74
+ 'inline_style.prop_padding_right': 'Padding right',
75
+ 'inline_style.prop_padding_bottom': 'Padding bottom',
76
+ 'inline_style.prop_padding_left': 'Padding left',
77
+ 'inline_style.prop_border_width': 'Border width',
78
+ 'inline_style.prop_border_style': 'Border style',
79
+ 'inline_style.prop_border_color': 'Border color',
80
+ 'inline_style.prop_border_radius': 'Border radius',
81
+ 'inline_style.prop_box_shadow': 'Shadow',
82
+ 'inline_style.prop_background_color': 'Background color',
83
+ 'inline_style.prop_background_image': 'Background image',
84
+ 'inline_style.prop_background_size': 'Background size',
85
+ 'inline_style.prop_background_position': 'Background position',
86
+ 'inline_style.prop_background_repeat': 'Background repeat',
87
+ 'inline_style.prop_color': 'Color',
88
+ 'inline_style.prop_font_size': 'Font size',
89
+ 'inline_style.prop_text_align': 'Text align',
90
+ 'inline_style.prop_text_shadow': 'Text shadow',
91
+ 'inline_style.prop_font_family': 'Font family',
92
+ 'inline_style.prop_font_weight': 'Font weight',
93
+ 'inline_style.prop_font_style': 'Font style',
94
+ 'inline_style.prop_line_height': 'Line height',
95
+ 'inline_style.prop_letter_spacing': 'Letter spacing',
96
+ 'inline_style.prop_text_transform': 'Text transform',
97
+ 'inline_style.prop_text_decoration': 'Text decoration',
98
+ 'inline_style.prop_display': 'Display',
99
+ 'inline_style.prop_opacity': 'Opacity',
100
+ 'inline_style.prop_overflow': 'Overflow',
101
+ 'inline_style.prop_visibility': 'Visibility',
102
+ 'inline_style.prop_position': 'Position',
103
+ 'inline_style.prop_top': 'Top',
104
+ 'inline_style.prop_right': 'Right',
105
+ 'inline_style.prop_bottom': 'Bottom',
106
+ 'inline_style.prop_left': 'Left',
107
+ 'inline_style.prop_z_index': 'Z-index',
108
+ });
109
+
110
+ // The drawer's part last: it asks the browser how the others left the node
111
+ var PARTS = ['spacing', 'textalign', 'display', 'flex', 'float', 'sticky', 'drawerflow'];
112
+
113
+ GridEditor.utilities['inline-style'] = function(ge) {
114
+
115
+ var options = resolveOptions(ge);
116
+ var parts = {
117
+ spacing: spacingPart(ge, options.spacing),
118
+ textalign: textalignPart(ge),
119
+ display: displayPart(ge, options.visibility),
120
+ flex: flexPart(ge, options.spacing),
121
+ float: floatPart(ge),
122
+ sticky: stickyPart(ge),
123
+ drawerflow: drawerflowPart(ge),
124
+ };
125
+ var accordions = []; // { node, accordion } for every panel built since the last init
126
+ var context = {
127
+ sections: options.sections,
128
+ parts: parts,
129
+ state: { open: null },
130
+ opened: function(key) {
131
+ accordions.forEach(function(entry) { entry.accordion.open(key); });
132
+ },
133
+ };
134
+
135
+ /** Every part's hook, called in turn. */
136
+ function each(hook) {
137
+ return function() {
138
+ var args = arguments;
139
+ PARTS.forEach(function(name) {
140
+ if (parts[name][hook]) { parts[name][hook].apply(null, args); }
141
+ });
142
+ };
143
+ }
144
+
145
+ var partsRefresh = each('onRefresh');
146
+
147
+ return {
148
+ // The parts' families, edited in the sections rather than in Responsive
149
+ families: PARTS.reduce(function(all, name) {
150
+ return all.concat(parts[name].families.map(function(family) {
151
+ return Object.assign({}, family, { panel: false });
152
+ }));
153
+ }, []),
154
+
155
+ panelSection: function(node, kind) {
156
+ var accordion = createAccordion(ge, node, kind, context);
157
+ if (!accordion) { return null; }
158
+
159
+ accordions.push({ node: node, accordion: accordion });
160
+
161
+ return { labelKey: 'inline_style.section_title', titleKey: 'inline_style.dialog_title', body: accordion.element };
162
+ },
163
+
164
+ preview: function(node, kind, breakpoint) {
165
+ return parts.spacing.preview(node, kind, breakpoint);
166
+ },
167
+
168
+ // After a write, a change of classes or of view: the accordions of
169
+ // the nodes it touched follow
170
+ onRefresh: function(scope) {
171
+ partsRefresh(scope);
172
+
173
+ accordions = accordions.filter(function(entry) { return entry.accordion.element.isConnected; });
174
+ accordions.forEach(function(entry) {
175
+ if (entry.node === scope || scope.contains(entry.node)) { entry.accordion.render(); }
176
+ });
177
+ },
178
+
179
+ drawerTools: each('drawerTools'),
180
+
181
+ onDeinit: function() {
182
+ each('onDeinit')();
183
+ accordions = [];
184
+ },
185
+ };
186
+ };
@@ -248,6 +248,19 @@
248
248
  flex-direction: column;
249
249
  gap: 8px;
250
250
  }
251
+ /* Each section's heading: the general fields, and what plugins add */
252
+ .ge-section-title {
253
+ margin: 0 0 6px;
254
+ color: var(--bs-body-color, #333);
255
+ font-size: 0.8125rem;
256
+ font-weight: 600;
257
+ }
258
+ /* Every section after the first, set off from the one above */
259
+ .ge-panel-section,
260
+ .ge-utilities {
261
+ padding-top: 10px;
262
+ border-top: 1px solid var(--bs-border-color-translucent, rgba(0,0,0,0.1));
263
+ }
251
264
  .ge-field {
252
265
  display: flex;
253
266
  flex-direction: column;
@@ -270,7 +283,7 @@
270
283
  > .ge-utilities-toggle {
271
284
  display: block;
272
285
  color: var(--bs-body-color, #333);
273
- font-weight: 500;
286
+ font-weight: 600;
274
287
  cursor: pointer;
275
288
  text-decoration: none;
276
289
 
@@ -342,9 +355,9 @@
342
355
  margin-top: 10px;
343
356
  }
344
357
 
345
- /* The style plugin's accordion: in a panel, or in the dialog, which is
358
+ /* The inline-style plugin's accordion: in a panel, or in the dialog, which is
346
359
  outside any panel, so it carries the look of the fields it shares. */
347
- .ge-style {
360
+ .ge-inline-style {
348
361
  font-size: 0.8125rem;
349
362
 
350
363
  .accordion-button {
@@ -359,26 +372,26 @@
359
372
  padding: 8px 10px;
360
373
  }
361
374
 
362
- .ge-style-label,
375
+ .ge-inline-style-label,
363
376
  .ge-utility-label,
364
- .ge-style-shadow-label {
377
+ .ge-inline-style-shadow-label {
365
378
  color: var(--bs-secondary-color, #6c757d);
366
379
  font-size: 0.75rem;
367
380
  }
368
- .ge-style-note,
381
+ .ge-inline-style-note,
369
382
  .ge-utility-note,
370
383
  .ge-spacing-gutter {
371
384
  color: var(--bs-secondary-color, #666);
372
385
  font-size: 0.6875rem;
373
386
  }
374
387
 
375
- .ge-style-fields,
388
+ .ge-inline-style-fields,
376
389
  .ge-spacing {
377
390
  display: grid;
378
391
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
379
392
  gap: 8px 10px;
380
393
  }
381
- .ge-style-field,
394
+ .ge-inline-style-field,
382
395
  .ge-utility,
383
396
  .ge-spacing-group {
384
397
  display: flex;
@@ -393,47 +406,47 @@
393
406
  grid-column: 1 / -1;
394
407
  }
395
408
 
396
- .ge-style-color .form-control-color {
409
+ .ge-inline-style-color .form-control-color {
397
410
  flex: 0 0 2.25rem;
398
411
  padding: 2px;
399
412
  }
400
413
 
401
- .ge-style-shadow,
402
- .ge-style-field:has(.ge-style-shadow) {
414
+ .ge-inline-style-shadow,
415
+ .ge-inline-style-field:has(.ge-inline-style-shadow) {
403
416
  grid-column: 1 / -1;
404
417
  }
405
- .ge-style-shadow-builder {
418
+ .ge-inline-style-shadow-builder {
406
419
  display: grid;
407
420
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
408
421
  gap: 4px 8px;
409
422
  align-items: end;
410
423
  }
411
- .ge-style-shadow-part {
424
+ .ge-inline-style-shadow-part {
412
425
  display: flex;
413
426
  flex-direction: column;
414
427
  gap: 2px;
415
428
  margin: 0;
416
429
  }
417
- .ge-style-shadow-color {
430
+ .ge-inline-style-shadow-color {
418
431
  grid-column: span 2;
419
432
  }
420
- .ge-style-shadow-mode {
433
+ .ge-inline-style-shadow-mode {
421
434
  display: inline-block;
422
435
  margin-top: 2px;
423
436
  font-size: 0.6875rem;
424
437
  }
425
438
 
426
- .ge-style-catalog {
439
+ .ge-inline-style-catalog {
427
440
  display: flex;
428
441
  flex-direction: column;
429
442
  gap: 4px;
430
443
  }
431
- .ge-style-chips {
444
+ .ge-inline-style-chips {
432
445
  display: flex;
433
446
  flex-wrap: wrap;
434
447
  gap: 3px;
435
448
  }
436
- .ge-style-chip {
449
+ .ge-inline-style-chip {
437
450
  --bs-btn-padding-y: 0;
438
451
  --bs-btn-padding-x: 6px;
439
452
  --bs-btn-font-size: 0.6875rem;
@@ -523,7 +536,6 @@
523
536
  -moz-user-select: none;
524
537
  -ms-user-select: none;
525
538
  user-select: none;
526
- background: blue;
527
539
  margin: 0 -@editGutter @editGutter;
528
540
  display: block;
529
541
  width: calc(~"100% +" 2 * @editGutter);
@@ -547,6 +559,10 @@
547
559
  text-align: left;
548
560
  cursor: auto;
549
561
 
562
+ /* The one line a drawer has room for needs no heading */
563
+ > .ge-section-title {
564
+ display: none;
565
+ }
550
566
  .ge-details-general {
551
567
  flex-direction: row;
552
568
  align-items: flex-end;
@@ -568,6 +584,12 @@
568
584
  margin-right: 0;
569
585
 
570
586
  > .ge-tools-drawer {
587
+ /* Bootstrap pads every child of a row by half its gutter, and
588
+ caps it at the row's width: the drawer is not a column */
589
+ padding-left: 0;
590
+ padding-right: 0;
591
+ max-width: none;
592
+
571
593
  > a {
572
594
  color: #666;
573
595
  }
@@ -1143,7 +1165,7 @@
1143
1165
  .ge-layout-modes();
1144
1166
 
1145
1167
  /*
1146
- * The style plugin's display. A node Bootstrap would hide is kept on the
1168
+ * The inline-style plugin's display. A node Bootstrap would hide is kept on the
1147
1169
  * canvas - there would be nothing left to click to show it again - and shown
1148
1170
  * as it would be if it were not hidden, which data-ge-display says. The
1149
1171
  * selectors outweigh Bootstrap's d-* classes, which are !important too.
@@ -1186,7 +1208,7 @@
1186
1208
  }
1187
1209
 
1188
1210
  /*
1189
- * The style plugin's drawer on a flex or grid node: out of the flow, on top
1211
+ * The inline-style plugin's drawer on a flex or grid node: out of the flow, on top
1190
1212
  * and as wide as the node, over a transparent top border as tall as it is.
1191
1213
  * The border's width comes with the node's data-ge-drawer-out, from a rule
1192
1214
  * per height the plugin writes. The selectors outweigh Bootstrap's border
@@ -1236,10 +1258,6 @@
1236
1258
  > .ge-tools-drawer {
1237
1259
  margin-top: 0;
1238
1260
  margin-bottom: calc(@editGutter - var(--bs-gutter-y));
1239
- /* Bootstrap pads every child of a row by half its gutter, the drawer
1240
- too; it keeps the padding a row with no gutter class gives it */
1241
- padding-left: .75rem;
1242
- padding-right: .75rem;
1243
1261
  }
1244
1262
 
1245
1263
  > .column {
@@ -53,11 +53,11 @@ export interface PresetClass {
53
53
  }
54
54
 
55
55
  /** A content filter: run on init and deinit with the canvas. A string names a function on window. */
56
- /** A section of the style plugin's accordion. */
57
- export type StyleSectionKey = 'size' | 'spacing' | 'border' | 'background' | 'text' | 'typography' | 'display' | 'flex' | 'position' | 'custom';
56
+ /** A section of the inline-style plugin's accordion. */
57
+ export type InlineStyleSectionKey = 'size' | 'spacing' | 'border' | 'background' | 'text' | 'typography' | 'display' | 'flex' | 'position' | 'custom';
58
58
 
59
59
  /** A section on or off, or on with some of its properties and without its catalog. */
60
- export type StyleSection = boolean | { properties?: string[]; catalog?: boolean };
60
+ export type InlineStyleSection = boolean | { properties?: string[]; catalog?: boolean };
61
61
 
62
62
  /**
63
63
  * A tabs container's variant: its strip's style, width and alignment, and
@@ -77,10 +77,10 @@ export interface CreateTabsOptions extends Placement, TabsOptions {
77
77
  labels?: string[];
78
78
  }
79
79
 
80
- /** The style plugin's settings. */
81
- export interface StyleOptions {
80
+ /** The inline-style plugin's settings. */
81
+ export interface InlineStyleOptions {
82
82
  /** Every section is on unless it is turned off here. */
83
- sections?: Partial<Record<StyleSectionKey, StyleSection>>;
83
+ sections?: Partial<Record<InlineStyleSectionKey, InlineStyleSection>>;
84
84
  /** The spacing section: the values offered, and what 0 to 5 come to - for the gaps too. */
85
85
  spacing?: { values?: string[]; scale?: string[] };
86
86
  /** The eye that hides and shows a node, the display family's: false leaves it out of the drawers. */
@@ -113,8 +113,8 @@ export interface GridEditorOptions {
113
113
  content_types?: string[];
114
114
  row_cols?: boolean;
115
115
  utilities?: Record<string, unknown>;
116
- /** The style plugin's sections, and the options of the utilities it carries. */
117
- style?: StyleOptions;
116
+ /** The inline-style plugin's sections, and the options of the utilities it carries. */
117
+ inline_style?: InlineStyleOptions;
118
118
  /** The tabs plugin: the variant of the tabs containers made new. */
119
119
  tabs?: TabsOptions;
120
120
  elements?: { enabled?: boolean | 'auto'; selector?: string; auto?: boolean };
@@ -124,7 +124,10 @@ export interface GridEditorOptions {
124
124
  add_column?: { size?: ColumnSize | null; picker?: boolean; delay?: number };
125
125
  layout_modes?: View[];
126
126
  default_view?: View;
127
- resize?: { enabled?: boolean; handles?: string; balance?: 'next' | false };
127
+ /** enabled is the handle on the column's edge, tools the narrower and wider tools in its drawer. */
128
+ resize?: { enabled?: boolean; tools?: boolean; handles?: string; balance?: 'next' | false };
129
+ /** tools is the indent tools in a column's drawer. */
130
+ indent?: { tools?: boolean };
128
131
  /** A textarea whose html the canvas starts with. */
129
132
  source_textarea?: Target | '';
130
133
  edit_source?: boolean;