@themarioga/grid-editor 8.0.0-beta.3 → 8.0.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 +23 -0
- package/README.md +9 -9
- package/UPGRADING.md +21 -11
- package/dist/grideditor.bundle.min.js +3 -3
- package/dist/grideditor.css +52 -35
- package/dist/grideditor.d.ts +8 -8
- package/dist/grideditor.esm.js +7 -1
- package/dist/grideditor.js +7 -1
- 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 +69 -68
- package/dist/locales/grideditor.es.js +69 -68
- package/dist/locales/grideditor.es.min.js +1 -1
- package/dist/locales/grideditor.es.min.js.map +2 -2
- package/dist/plugins/grideditor.alignment.min.js.map +1 -1
- package/dist/plugins/{grideditor.style.esm.js → grideditor.inline-style.esm.js} +184 -184
- package/dist/plugins/{grideditor.style.js → grideditor.inline-style.js} +182 -182
- package/dist/plugins/grideditor.inline-style.min.js +4 -0
- package/dist/plugins/grideditor.inline-style.min.js.map +7 -0
- package/docs/locale-keys.md +81 -80
- package/docs/plugins.md +5 -5
- package/example/index.html +6 -6
- package/example/{style.html → inline-style.html} +5 -5
- package/example/utilities.html +3 -3
- package/package.json +1 -1
- package/src/js/grideditor.js +8 -0
- package/src/js/{style → inline-style}/accordion.js +9 -9
- package/src/js/{style → inline-style}/catalog.js +6 -6
- package/src/js/{style → inline-style}/custom.js +4 -4
- package/src/js/{style → inline-style}/display.js +2 -2
- package/src/js/{style → inline-style}/drawerflow.js +1 -1
- package/src/js/{style → inline-style}/fields.js +25 -25
- package/src/js/{style → inline-style}/flex.js +2 -2
- package/src/js/{style → inline-style}/float.js +2 -2
- package/src/js/{style → inline-style}/options.js +5 -5
- package/src/js/{style → inline-style}/sections.js +50 -50
- package/src/js/{style → inline-style}/spacing.js +2 -2
- package/src/js/{style → inline-style}/sticky.js +2 -2
- package/src/js/{style → inline-style}/textalign.js +2 -2
- package/src/js/locales/grideditor.es.js +69 -68
- package/src/js/plugins/grideditor.alignment.js +1 -1
- package/src/js/plugins/grideditor.inline-style.js +185 -0
- package/src/less/grideditor.less +43 -25
- package/types/grideditor.d.ts +8 -8
- package/dist/plugins/grideditor.style.min.js +0 -4
- package/dist/plugins/grideditor.style.min.js.map +0 -7
- package/src/js/plugins/grideditor.style.js +0 -185
package/docs/locale-keys.md
CHANGED
|
@@ -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 |
|
|
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,89 @@ 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
|
-
|
|
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
|
-
| `
|
|
309
|
-
| `
|
|
310
|
-
| `
|
|
311
|
-
| `
|
|
312
|
-
| `
|
|
313
|
-
| `
|
|
314
|
-
| `
|
|
315
|
-
| `
|
|
316
|
-
| `
|
|
317
|
-
| `
|
|
318
|
-
| `
|
|
319
|
-
| `
|
|
320
|
-
| `
|
|
321
|
-
| `
|
|
322
|
-
| `
|
|
323
|
-
| `
|
|
324
|
-
| `
|
|
325
|
-
| `
|
|
326
|
-
| `
|
|
327
|
-
| `
|
|
328
|
-
| `
|
|
329
|
-
| `
|
|
330
|
-
| `
|
|
331
|
-
| `
|
|
332
|
-
| `
|
|
333
|
-
| `
|
|
334
|
-
| `
|
|
335
|
-
| `
|
|
336
|
-
| `
|
|
337
|
-
| `
|
|
338
|
-
| `
|
|
339
|
-
| `
|
|
340
|
-
| `
|
|
341
|
-
| `
|
|
342
|
-
| `
|
|
343
|
-
| `
|
|
344
|
-
| `
|
|
345
|
-
| `
|
|
346
|
-
| `
|
|
347
|
-
| `
|
|
348
|
-
| `
|
|
349
|
-
| `
|
|
350
|
-
| `
|
|
351
|
-
| `
|
|
352
|
-
| `
|
|
353
|
-
| `
|
|
354
|
-
| `
|
|
355
|
-
| `
|
|
356
|
-
| `
|
|
357
|
-
| `
|
|
358
|
-
| `
|
|
359
|
-
| `
|
|
360
|
-
| `
|
|
361
|
-
| `
|
|
362
|
-
| `
|
|
363
|
-
| `
|
|
364
|
-
| `
|
|
365
|
-
| `
|
|
366
|
-
| `
|
|
367
|
-
| `
|
|
368
|
-
| `
|
|
369
|
-
| `
|
|
370
|
-
| `
|
|
371
|
-
| `
|
|
372
|
-
| `
|
|
373
|
-
| `
|
|
374
|
-
| `
|
|
375
|
-
| `
|
|
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.prop_width` | Width | Label of the `width` field |
|
|
333
|
+
| `inline_style.prop_height` | Height | Label of the `height` field |
|
|
334
|
+
| `inline_style.prop_min_width` | Min width | Label of the `min-width` field |
|
|
335
|
+
| `inline_style.prop_min_height` | Min height | Label of the `min-height` field |
|
|
336
|
+
| `inline_style.prop_max_width` | Max width | Label of the `max-width` field |
|
|
337
|
+
| `inline_style.prop_max_height` | Max height | Label of the `max-height` field |
|
|
338
|
+
| `inline_style.prop_margin_top` | Margin top | Label of the `margin-top` field |
|
|
339
|
+
| `inline_style.prop_margin_right` | Margin right | Label of the `margin-right` field |
|
|
340
|
+
| `inline_style.prop_margin_bottom` | Margin bottom | Label of the `margin-bottom` field |
|
|
341
|
+
| `inline_style.prop_margin_left` | Margin left | Label of the `margin-left` field |
|
|
342
|
+
| `inline_style.prop_padding_top` | Padding top | Label of the `padding-top` field |
|
|
343
|
+
| `inline_style.prop_padding_right` | Padding right | Label of the `padding-right` field |
|
|
344
|
+
| `inline_style.prop_padding_bottom` | Padding bottom | Label of the `padding-bottom` field |
|
|
345
|
+
| `inline_style.prop_padding_left` | Padding left | Label of the `padding-left` field |
|
|
346
|
+
| `inline_style.prop_border_width` | Border width | Label of the `border-width` field |
|
|
347
|
+
| `inline_style.prop_border_style` | Border style | Label of the `border-style` field |
|
|
348
|
+
| `inline_style.prop_border_color` | Border color | Label of the `border-color` field |
|
|
349
|
+
| `inline_style.prop_border_radius` | Border radius | Label of the `border-radius` field |
|
|
350
|
+
| `inline_style.prop_box_shadow` | Shadow | Label of the `box-shadow` field |
|
|
351
|
+
| `inline_style.prop_background_color` | Background color | Label of the `background-color` field |
|
|
352
|
+
| `inline_style.prop_background_image` | Background image | Label of the `background-image` field |
|
|
353
|
+
| `inline_style.prop_background_size` | Background size | Label of the `background-size` field |
|
|
354
|
+
| `inline_style.prop_background_position` | Background position | Label of the `background-position` field |
|
|
355
|
+
| `inline_style.prop_background_repeat` | Background repeat | Label of the `background-repeat` field |
|
|
356
|
+
| `inline_style.prop_color` | Color | Label of the `color` field |
|
|
357
|
+
| `inline_style.prop_font_size` | Font size | Label of the `font-size` field |
|
|
358
|
+
| `inline_style.prop_text_align` | Text align | Label of the `text-align` field |
|
|
359
|
+
| `inline_style.prop_text_shadow` | Text shadow | Label of the `text-shadow` field |
|
|
360
|
+
| `inline_style.prop_font_family` | Font family | Label of the `font-family` field |
|
|
361
|
+
| `inline_style.prop_font_weight` | Font weight | Label of the `font-weight` field |
|
|
362
|
+
| `inline_style.prop_font_style` | Font style | Label of the `font-style` field |
|
|
363
|
+
| `inline_style.prop_line_height` | Line height | Label of the `line-height` field |
|
|
364
|
+
| `inline_style.prop_letter_spacing` | Letter spacing | Label of the `letter-spacing` field |
|
|
365
|
+
| `inline_style.prop_text_transform` | Text transform | Label of the `text-transform` field |
|
|
366
|
+
| `inline_style.prop_text_decoration` | Text decoration | Label of the `text-decoration` field |
|
|
367
|
+
| `inline_style.prop_display` | Display | Label of the `display` field |
|
|
368
|
+
| `inline_style.prop_opacity` | Opacity | Label of the `opacity` field |
|
|
369
|
+
| `inline_style.prop_overflow` | Overflow | Label of the `overflow` field |
|
|
370
|
+
| `inline_style.prop_visibility` | Visibility | Label of the `visibility` field |
|
|
371
|
+
| `inline_style.prop_position` | Position | Label of the `position` field |
|
|
372
|
+
| `inline_style.prop_top` | Top | Label of the `top` field |
|
|
373
|
+
| `inline_style.prop_right` | Right | Label of the `right` field |
|
|
374
|
+
| `inline_style.prop_bottom` | Bottom | Label of the `bottom` field |
|
|
375
|
+
| `inline_style.prop_left` | Left | Label of the `left` field |
|
|
376
|
+
| `inline_style.prop_z_index` | Z-index | Label of the `z-index` field |
|
|
376
377
|
|
|
377
378
|
|
|
378
379
|
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
|
|
536
|
-
plugin's are the `
|
|
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
|
|
package/example/index.html
CHANGED
|
@@ -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">
|
|
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>
|
|
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
|
-
|
|
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">
|
|
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,
|
package/example/utilities.html
CHANGED
|
@@ -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
|
|
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
|
|
36
|
+
"version": "8.0.0",
|
|
37
37
|
"main": "dist/grideditor.js",
|
|
38
38
|
"module": "dist/grideditor.esm.js",
|
|
39
39
|
"types": "dist/grideditor.d.ts",
|
package/src/js/grideditor.js
CHANGED
|
@@ -3206,6 +3206,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
3206
3206
|
|
|
3207
3207
|
function createDetails(container, cssClasses) {
|
|
3208
3208
|
var detailsDiv = dom.element('div', { 'class': 'ge-details' });
|
|
3209
|
+
detailsDiv.appendChild(sectionTitle(t('panel.section_general')));
|
|
3209
3210
|
var general = detailsDiv.appendChild(dom.element('div', { 'class': 'ge-details-general' }));
|
|
3210
3211
|
var field = function(label) {
|
|
3211
3212
|
var holder = dom.element('label', { 'class': 'ge-field' });
|
|
@@ -3272,6 +3273,11 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
3272
3273
|
return detailsDiv;
|
|
3273
3274
|
}
|
|
3274
3275
|
|
|
3276
|
+
/** The heading of one of a panel's sections. */
|
|
3277
|
+
function sectionTitle(text) {
|
|
3278
|
+
return dom.element('h6', { 'class': 'ge-section-title' }, text);
|
|
3279
|
+
}
|
|
3280
|
+
|
|
3275
3281
|
/**
|
|
3276
3282
|
* What plugins add to a node's panel, between its general fields and
|
|
3277
3283
|
* the Responsive section: each plugin's panelSection(node, kind), in
|
|
@@ -3294,6 +3300,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
3294
3300
|
var holder = dom.element('div', { 'class': 'ge-panel-section', 'data-ge-plugin': name });
|
|
3295
3301
|
|
|
3296
3302
|
if (mode === 'offcanvas' || mode === 'modal') {
|
|
3303
|
+
holder.appendChild(sectionTitle(t(section.labelKey)));
|
|
3297
3304
|
holder.appendChild(section.body);
|
|
3298
3305
|
} else {
|
|
3299
3306
|
var label = t(section.labelKey);
|
|
@@ -5302,6 +5309,7 @@ GridEditor.locales = {
|
|
|
5302
5309
|
'panel.done': 'Done',
|
|
5303
5310
|
'panel.id': 'Id',
|
|
5304
5311
|
'panel.classes': 'Classes',
|
|
5312
|
+
'panel.section_general': 'Id and classes',
|
|
5305
5313
|
'panel.kind_row': 'Row',
|
|
5306
5314
|
'panel.kind_column': 'Column',
|
|
5307
5315
|
'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('
|
|
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('
|
|
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('
|
|
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. */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Display, a part of the style plugin: how a node is displayed per
|
|
2
|
+
* Display, a part of the inline-style plugin: how a node is displayed per
|
|
3
3
|
* breakpoint, hidden included, with Bootstrap's d-{breakpoint}-* classes,
|
|
4
4
|
* and the eye in the drawers that hides and shows it.
|
|
5
5
|
*
|
|
6
6
|
* Its families, and whatever it does on the canvas, as a function of the
|
|
7
|
-
* handle and its options: grideditor.style.js puts them in its sections.
|
|
7
|
+
* handle and its options: grideditor.inline-style.js puts them in its sections.
|
|
8
8
|
*/
|
|
9
9
|
import { GridEditor } from '../grideditor.js';
|
|
10
10
|
import * as dom from '../dom.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The drawer of a flex or grid node, a part of the style plugin.
|
|
2
|
+
* The drawer of a flex or grid node, a part of the inline-style plugin.
|
|
3
3
|
*
|
|
4
4
|
* A drawer is its node's first child, in the flow: in a row, which wraps,
|
|
5
5
|
* it is a line of its own above the columns, but in anything else that
|