@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/dist/grideditor.css
CHANGED
|
@@ -194,6 +194,8 @@
|
|
|
194
194
|
btn-outline-secondary - and this only lays them out. */
|
|
195
195
|
.ge-details {
|
|
196
196
|
font-size: 0.8125rem;
|
|
197
|
+
/* Each section's heading: the general fields, and what plugins add */
|
|
198
|
+
/* Every section after the first, set off from the one above */
|
|
197
199
|
/* The utility plugins' fields, folded under one toggle */
|
|
198
200
|
}
|
|
199
201
|
.ge-details .ge-details-general {
|
|
@@ -201,6 +203,17 @@
|
|
|
201
203
|
flex-direction: column;
|
|
202
204
|
gap: 8px;
|
|
203
205
|
}
|
|
206
|
+
.ge-details .ge-section-title {
|
|
207
|
+
margin: 0 0 6px;
|
|
208
|
+
color: var(--bs-body-color, #333);
|
|
209
|
+
font-size: 0.8125rem;
|
|
210
|
+
font-weight: 600;
|
|
211
|
+
}
|
|
212
|
+
.ge-details .ge-panel-section,
|
|
213
|
+
.ge-details .ge-utilities {
|
|
214
|
+
padding-top: 10px;
|
|
215
|
+
border-top: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.1));
|
|
216
|
+
}
|
|
204
217
|
.ge-details .ge-field {
|
|
205
218
|
display: flex;
|
|
206
219
|
flex-direction: column;
|
|
@@ -222,7 +235,7 @@
|
|
|
222
235
|
.ge-details .ge-utilities > .ge-utilities-toggle {
|
|
223
236
|
display: block;
|
|
224
237
|
color: var(--bs-body-color, #333);
|
|
225
|
-
font-weight:
|
|
238
|
+
font-weight: 600;
|
|
226
239
|
cursor: pointer;
|
|
227
240
|
text-decoration: none;
|
|
228
241
|
}
|
|
@@ -283,93 +296,93 @@
|
|
|
283
296
|
.ge-details .ge-panel-section {
|
|
284
297
|
margin-top: 10px;
|
|
285
298
|
}
|
|
286
|
-
/* The style plugin's accordion: in a panel, or in the dialog, which is
|
|
299
|
+
/* The inline-style plugin's accordion: in a panel, or in the dialog, which is
|
|
287
300
|
outside any panel, so it carries the look of the fields it shares. */
|
|
288
|
-
.ge-style {
|
|
301
|
+
.ge-inline-style {
|
|
289
302
|
font-size: 0.8125rem;
|
|
290
303
|
}
|
|
291
|
-
.ge-style .accordion-button {
|
|
304
|
+
.ge-inline-style .accordion-button {
|
|
292
305
|
padding: 6px 10px;
|
|
293
306
|
font-size: 0.8125rem;
|
|
294
307
|
font-weight: 500;
|
|
295
308
|
}
|
|
296
|
-
.ge-style .accordion-body {
|
|
309
|
+
.ge-inline-style .accordion-body {
|
|
297
310
|
display: flex;
|
|
298
311
|
flex-direction: column;
|
|
299
312
|
gap: 10px;
|
|
300
313
|
padding: 8px 10px;
|
|
301
314
|
}
|
|
302
|
-
.ge-style .ge-style-label,
|
|
303
|
-
.ge-style .ge-utility-label,
|
|
304
|
-
.ge-style .ge-style-shadow-label {
|
|
315
|
+
.ge-inline-style .ge-inline-style-label,
|
|
316
|
+
.ge-inline-style .ge-utility-label,
|
|
317
|
+
.ge-inline-style .ge-inline-style-shadow-label {
|
|
305
318
|
color: var(--bs-secondary-color, #6c757d);
|
|
306
319
|
font-size: 0.75rem;
|
|
307
320
|
}
|
|
308
|
-
.ge-style .ge-style-note,
|
|
309
|
-
.ge-style .ge-utility-note,
|
|
310
|
-
.ge-style .ge-spacing-gutter {
|
|
321
|
+
.ge-inline-style .ge-inline-style-note,
|
|
322
|
+
.ge-inline-style .ge-utility-note,
|
|
323
|
+
.ge-inline-style .ge-spacing-gutter {
|
|
311
324
|
color: var(--bs-secondary-color, #666);
|
|
312
325
|
font-size: 0.6875rem;
|
|
313
326
|
}
|
|
314
|
-
.ge-style .ge-style-fields,
|
|
315
|
-
.ge-style .ge-spacing {
|
|
327
|
+
.ge-inline-style .ge-inline-style-fields,
|
|
328
|
+
.ge-inline-style .ge-spacing {
|
|
316
329
|
display: grid;
|
|
317
330
|
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
|
318
331
|
gap: 8px 10px;
|
|
319
332
|
}
|
|
320
|
-
.ge-style .ge-style-field,
|
|
321
|
-
.ge-style .ge-utility,
|
|
322
|
-
.ge-style .ge-spacing-group {
|
|
333
|
+
.ge-inline-style .ge-inline-style-field,
|
|
334
|
+
.ge-inline-style .ge-utility,
|
|
335
|
+
.ge-inline-style .ge-spacing-group {
|
|
323
336
|
display: flex;
|
|
324
337
|
flex-direction: column;
|
|
325
338
|
gap: 2px;
|
|
326
339
|
margin: 0;
|
|
327
340
|
}
|
|
328
|
-
.ge-style .ge-spacing-group .ge-utility > .ge-utility-label {
|
|
341
|
+
.ge-inline-style .ge-spacing-group .ge-utility > .ge-utility-label {
|
|
329
342
|
display: none;
|
|
330
343
|
}
|
|
331
|
-
.ge-style .ge-spacing-gutter {
|
|
344
|
+
.ge-inline-style .ge-spacing-gutter {
|
|
332
345
|
grid-column: 1 / -1;
|
|
333
346
|
}
|
|
334
|
-
.ge-style .ge-style-color .form-control-color {
|
|
347
|
+
.ge-inline-style .ge-inline-style-color .form-control-color {
|
|
335
348
|
flex: 0 0 2.25rem;
|
|
336
349
|
padding: 2px;
|
|
337
350
|
}
|
|
338
|
-
.ge-style .ge-style-shadow,
|
|
339
|
-
.ge-style .ge-style-field:has(.ge-style-shadow) {
|
|
351
|
+
.ge-inline-style .ge-inline-style-shadow,
|
|
352
|
+
.ge-inline-style .ge-inline-style-field:has(.ge-inline-style-shadow) {
|
|
340
353
|
grid-column: 1 / -1;
|
|
341
354
|
}
|
|
342
|
-
.ge-style .ge-style-shadow-builder {
|
|
355
|
+
.ge-inline-style .ge-inline-style-shadow-builder {
|
|
343
356
|
display: grid;
|
|
344
357
|
grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
|
|
345
358
|
gap: 4px 8px;
|
|
346
359
|
align-items: end;
|
|
347
360
|
}
|
|
348
|
-
.ge-style .ge-style-shadow-part {
|
|
361
|
+
.ge-inline-style .ge-inline-style-shadow-part {
|
|
349
362
|
display: flex;
|
|
350
363
|
flex-direction: column;
|
|
351
364
|
gap: 2px;
|
|
352
365
|
margin: 0;
|
|
353
366
|
}
|
|
354
|
-
.ge-style .ge-style-shadow-color {
|
|
367
|
+
.ge-inline-style .ge-inline-style-shadow-color {
|
|
355
368
|
grid-column: span 2;
|
|
356
369
|
}
|
|
357
|
-
.ge-style .ge-style-shadow-mode {
|
|
370
|
+
.ge-inline-style .ge-inline-style-shadow-mode {
|
|
358
371
|
display: inline-block;
|
|
359
372
|
margin-top: 2px;
|
|
360
373
|
font-size: 0.6875rem;
|
|
361
374
|
}
|
|
362
|
-
.ge-style .ge-style-catalog {
|
|
375
|
+
.ge-inline-style .ge-inline-style-catalog {
|
|
363
376
|
display: flex;
|
|
364
377
|
flex-direction: column;
|
|
365
378
|
gap: 4px;
|
|
366
379
|
}
|
|
367
|
-
.ge-style .ge-style-chips {
|
|
380
|
+
.ge-inline-style .ge-inline-style-chips {
|
|
368
381
|
display: flex;
|
|
369
382
|
flex-wrap: wrap;
|
|
370
383
|
gap: 3px;
|
|
371
384
|
}
|
|
372
|
-
.ge-style .ge-style-chip {
|
|
385
|
+
.ge-inline-style .ge-inline-style-chip {
|
|
373
386
|
--bs-btn-padding-y: 0;
|
|
374
387
|
--bs-btn-padding-x: 6px;
|
|
375
388
|
--bs-btn-font-size: 0.6875rem;
|
|
@@ -483,7 +496,6 @@
|
|
|
483
496
|
-moz-user-select: none;
|
|
484
497
|
-ms-user-select: none;
|
|
485
498
|
user-select: none;
|
|
486
|
-
background: blue;
|
|
487
499
|
margin: 0 -5px 5px;
|
|
488
500
|
display: block;
|
|
489
501
|
width: calc(100% + 2 * 5px);
|
|
@@ -508,6 +520,10 @@
|
|
|
508
520
|
border-top: 1px solid rgba(0, 0, 0, 0.05);
|
|
509
521
|
text-align: left;
|
|
510
522
|
cursor: auto;
|
|
523
|
+
/* The one line a drawer has room for needs no heading */
|
|
524
|
+
}
|
|
525
|
+
.ge-canvas.ge-editing .ge-tools-drawer > .ge-details > .ge-section-title {
|
|
526
|
+
display: none;
|
|
511
527
|
}
|
|
512
528
|
.ge-canvas.ge-editing .ge-tools-drawer > .ge-details .ge-details-general {
|
|
513
529
|
flex-direction: row;
|
|
@@ -528,6 +544,11 @@
|
|
|
528
544
|
margin-right: 0;
|
|
529
545
|
}
|
|
530
546
|
.ge-canvas.ge-editing .row > .ge-tools-drawer {
|
|
547
|
+
/* Bootstrap pads every child of a row by half its gutter, and
|
|
548
|
+
caps it at the row's width: the drawer is not a column */
|
|
549
|
+
padding-left: 0;
|
|
550
|
+
padding-right: 0;
|
|
551
|
+
max-width: none;
|
|
531
552
|
background: #e5e5e5;
|
|
532
553
|
}
|
|
533
554
|
.ge-canvas.ge-editing .row > .ge-tools-drawer > a {
|
|
@@ -4615,7 +4636,7 @@
|
|
|
4615
4636
|
margin-left: 91.66666667%;
|
|
4616
4637
|
}
|
|
4617
4638
|
/*
|
|
4618
|
-
* The style plugin's display. A node Bootstrap would hide is kept on the
|
|
4639
|
+
* The inline-style plugin's display. A node Bootstrap would hide is kept on the
|
|
4619
4640
|
* canvas - there would be nothing left to click to show it again - and shown
|
|
4620
4641
|
* as it would be if it were not hidden, which data-ge-display says. The
|
|
4621
4642
|
* selectors outweigh Bootstrap's d-* classes, which are !important too.
|
|
@@ -4666,7 +4687,7 @@
|
|
|
4666
4687
|
pointer-events: none;
|
|
4667
4688
|
}
|
|
4668
4689
|
/*
|
|
4669
|
-
* The style plugin's drawer on a flex or grid node: out of the flow, on top
|
|
4690
|
+
* The inline-style plugin's drawer on a flex or grid node: out of the flow, on top
|
|
4670
4691
|
* and as wide as the node, over a transparent top border as tall as it is.
|
|
4671
4692
|
* The border's width comes with the node's data-ge-drawer-out, from a rule
|
|
4672
4693
|
* per height the plugin writes. The selectors outweigh Bootstrap's border
|
|
@@ -4713,10 +4734,6 @@
|
|
|
4713
4734
|
.ge-canvas.ge-editing .row.ge-gutters > .ge-tools-drawer {
|
|
4714
4735
|
margin-top: 0;
|
|
4715
4736
|
margin-bottom: calc(5px - var(--bs-gutter-y));
|
|
4716
|
-
/* Bootstrap pads every child of a row by half its gutter, the drawer
|
|
4717
|
-
too; it keeps the padding a row with no gutter class gives it */
|
|
4718
|
-
padding-left: 0.75rem;
|
|
4719
|
-
padding-right: 0.75rem;
|
|
4720
4737
|
}
|
|
4721
4738
|
.ge-canvas.ge-editing .row.ge-gutters > .column {
|
|
4722
4739
|
padding-left: calc(var(--bs-gutter-x) * 0.5);
|
package/dist/grideditor.d.ts
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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<
|
|
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
|
-
|
|
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 };
|
package/dist/grideditor.esm.js
CHANGED
|
@@ -2692,6 +2692,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
2692
2692
|
}
|
|
2693
2693
|
function createDetails(container, cssClasses) {
|
|
2694
2694
|
var detailsDiv = element("div", { "class": "ge-details" });
|
|
2695
|
+
detailsDiv.appendChild(sectionTitle(t("panel.section_general")));
|
|
2695
2696
|
var general = detailsDiv.appendChild(element("div", { "class": "ge-details-general" }));
|
|
2696
2697
|
var field = function(label) {
|
|
2697
2698
|
var holder = element("label", { "class": "ge-field" });
|
|
@@ -2751,6 +2752,9 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
2751
2752
|
}
|
|
2752
2753
|
return detailsDiv;
|
|
2753
2754
|
}
|
|
2755
|
+
function sectionTitle(text) {
|
|
2756
|
+
return element("h6", { "class": "ge-section-title" }, text);
|
|
2757
|
+
}
|
|
2754
2758
|
function pluginSections(node) {
|
|
2755
2759
|
var kind = kindOf(node);
|
|
2756
2760
|
var mode = panelMode();
|
|
@@ -2764,6 +2768,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
2764
2768
|
}
|
|
2765
2769
|
var holder = element("div", { "class": "ge-panel-section", "data-ge-plugin": name });
|
|
2766
2770
|
if (mode === "offcanvas" || mode === "modal") {
|
|
2771
|
+
holder.appendChild(sectionTitle(t(section.labelKey)));
|
|
2767
2772
|
holder.appendChild(section.body);
|
|
2768
2773
|
} else {
|
|
2769
2774
|
var label = t(section.labelKey);
|
|
@@ -4100,7 +4105,7 @@ GridEditor.t = translate;
|
|
|
4100
4105
|
GridEditor._plainHtml = plainHtml;
|
|
4101
4106
|
GridEditor.Sortable = null;
|
|
4102
4107
|
GridEditor.bootstrap = null;
|
|
4103
|
-
GridEditor.version = false ? "dev" : "8.0.0
|
|
4108
|
+
GridEditor.version = false ? "dev" : "8.0.0";
|
|
4104
4109
|
GridEditor.locales = {
|
|
4105
4110
|
en: {
|
|
4106
4111
|
"tool.move": "Move",
|
|
@@ -4130,6 +4135,7 @@ GridEditor.locales = {
|
|
|
4130
4135
|
"panel.done": "Done",
|
|
4131
4136
|
"panel.id": "Id",
|
|
4132
4137
|
"panel.classes": "Classes",
|
|
4138
|
+
"panel.section_general": "Id and classes",
|
|
4133
4139
|
"panel.kind_row": "Row",
|
|
4134
4140
|
"panel.kind_column": "Column",
|
|
4135
4141
|
"panel.kind_element": "Element",
|
package/dist/grideditor.js
CHANGED
|
@@ -2693,6 +2693,7 @@
|
|
|
2693
2693
|
}
|
|
2694
2694
|
function createDetails(container, cssClasses) {
|
|
2695
2695
|
var detailsDiv = element("div", { "class": "ge-details" });
|
|
2696
|
+
detailsDiv.appendChild(sectionTitle(t("panel.section_general")));
|
|
2696
2697
|
var general = detailsDiv.appendChild(element("div", { "class": "ge-details-general" }));
|
|
2697
2698
|
var field = function(label) {
|
|
2698
2699
|
var holder = element("label", { "class": "ge-field" });
|
|
@@ -2752,6 +2753,9 @@
|
|
|
2752
2753
|
}
|
|
2753
2754
|
return detailsDiv;
|
|
2754
2755
|
}
|
|
2756
|
+
function sectionTitle(text) {
|
|
2757
|
+
return element("h6", { "class": "ge-section-title" }, text);
|
|
2758
|
+
}
|
|
2755
2759
|
function pluginSections(node) {
|
|
2756
2760
|
var kind = kindOf(node);
|
|
2757
2761
|
var mode = panelMode();
|
|
@@ -2765,6 +2769,7 @@
|
|
|
2765
2769
|
}
|
|
2766
2770
|
var holder = element("div", { "class": "ge-panel-section", "data-ge-plugin": name });
|
|
2767
2771
|
if (mode === "offcanvas" || mode === "modal") {
|
|
2772
|
+
holder.appendChild(sectionTitle(t(section.labelKey)));
|
|
2768
2773
|
holder.appendChild(section.body);
|
|
2769
2774
|
} else {
|
|
2770
2775
|
var label = t(section.labelKey);
|
|
@@ -4101,7 +4106,7 @@
|
|
|
4101
4106
|
GridEditor._plainHtml = plainHtml;
|
|
4102
4107
|
GridEditor.Sortable = null;
|
|
4103
4108
|
GridEditor.bootstrap = null;
|
|
4104
|
-
GridEditor.version = false ? "dev" : "8.0.0
|
|
4109
|
+
GridEditor.version = false ? "dev" : "8.0.0";
|
|
4105
4110
|
GridEditor.locales = {
|
|
4106
4111
|
en: {
|
|
4107
4112
|
"tool.move": "Move",
|
|
@@ -4131,6 +4136,7 @@
|
|
|
4131
4136
|
"panel.done": "Done",
|
|
4132
4137
|
"panel.id": "Id",
|
|
4133
4138
|
"panel.classes": "Classes",
|
|
4139
|
+
"panel.section_general": "Id and classes",
|
|
4134
4140
|
"panel.kind_row": "Row",
|
|
4135
4141
|
"panel.kind_column": "Column",
|
|
4136
4142
|
"panel.kind_element": "Element",
|