@themarioga/grid-editor 4.0.0 → 5.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 +95 -0
- package/README.md +121 -9
- package/UPGRADING.md +55 -0
- package/dist/grideditor.css +609 -0
- package/dist/grideditor.min.css +1 -1
- package/dist/grideditor.min.css.map +1 -1
- package/dist/jquery.grideditor.bundle.min.js +2 -2
- package/dist/jquery.grideditor.js +1189 -118
- package/dist/jquery.grideditor.min.js +1 -1
- package/dist/jquery.grideditor.min.js.map +1 -1
- package/dist/locales/grideditor.es.js +58 -0
- package/dist/locales/grideditor.es.min.js +1 -1
- package/dist/locales/grideditor.es.min.js.map +1 -1
- package/dist/plugins/grideditor.alignment.js +81 -0
- package/dist/plugins/grideditor.alignment.min.js +2 -0
- package/dist/plugins/grideditor.alignment.min.js.map +1 -0
- package/dist/plugins/grideditor.float.js +56 -0
- package/dist/plugins/grideditor.float.min.js +2 -0
- package/dist/plugins/grideditor.float.min.js.map +1 -0
- package/dist/plugins/grideditor.gutters.js +145 -0
- package/dist/plugins/grideditor.gutters.min.js +2 -0
- package/dist/plugins/grideditor.gutters.min.js.map +1 -0
- package/dist/plugins/grideditor.order.js +206 -0
- package/dist/plugins/grideditor.order.min.js +2 -0
- package/dist/plugins/grideditor.order.min.js.map +1 -0
- package/dist/plugins/grideditor.sections.js +199 -0
- package/dist/plugins/grideditor.sections.min.js +2 -0
- package/dist/plugins/grideditor.sections.min.js.map +1 -0
- package/dist/plugins/grideditor.spacing.js +299 -0
- package/dist/plugins/grideditor.spacing.min.js +2 -0
- package/dist/plugins/grideditor.spacing.min.js.map +1 -0
- package/dist/plugins/grideditor.textalign.js +60 -0
- package/dist/plugins/grideditor.textalign.min.js +2 -0
- package/dist/plugins/grideditor.textalign.min.js.map +1 -0
- package/dist/plugins/grideditor.visibility.js +172 -0
- package/dist/plugins/grideditor.visibility.min.js +2 -0
- package/dist/plugins/grideditor.visibility.min.js.map +1 -0
- package/docs/events.md +32 -2
- package/docs/locale-keys.md +88 -1
- package/docs/plugins.md +141 -3
- package/example/autocols.html +137 -0
- package/example/autosave.html +5 -0
- package/example/basic.html +5 -0
- package/example/breakpoints.html +12 -5
- package/example/ckeditor.html +5 -0
- package/example/containers.html +4 -0
- package/example/elements.html +5 -0
- package/example/index.html +38 -1
- package/example/locale.html +5 -0
- package/example/plugins.html +5 -0
- package/example/summernote.html +5 -0
- package/example/utilities.html +166 -0
- package/example/wrap_content.html +5 -0
- package/package.json +1 -1
- package/src/js/jquery.grideditor.js +1190 -119
- package/src/js/locales/grideditor.es.js +58 -0
- package/src/js/plugins/grideditor.alignment.js +81 -0
- package/src/js/plugins/grideditor.float.js +56 -0
- package/src/js/plugins/grideditor.gutters.js +145 -0
- package/src/js/plugins/grideditor.order.js +206 -0
- package/src/js/plugins/grideditor.sections.js +199 -0
- package/src/js/plugins/grideditor.spacing.js +299 -0
- package/src/js/plugins/grideditor.textalign.js +60 -0
- package/src/js/plugins/grideditor.visibility.js +172 -0
- package/src/less/grideditor.less +299 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Visibility for grid-editor.
|
|
3
|
+
*
|
|
4
|
+
* A utility plugin: load this file after the editor and every row, column,
|
|
5
|
+
* element and container can be hidden at some breakpoints and shown at
|
|
6
|
+
* others, with Bootstrap's d-{breakpoint}-none and d-{breakpoint}-block (or
|
|
7
|
+
* -flex, for a row, which is a flex container and stops being a grid as a
|
|
8
|
+
* block). What it can ask the editor for is the handle its factory is called
|
|
9
|
+
* with, described in docs/plugins.md.
|
|
10
|
+
*
|
|
11
|
+
* <script src="dist/jquery.grideditor.min.js"></script>
|
|
12
|
+
* <script src="dist/plugins/grideditor.visibility.min.js"></script>
|
|
13
|
+
*
|
|
14
|
+
* A hidden node is never hidden from the editor, which would leave nothing to
|
|
15
|
+
* click to show it again. It stays on the canvas, faded and striped in a view
|
|
16
|
+
* where it is hidden, and in the all view says at which breakpoints it is.
|
|
17
|
+
*
|
|
18
|
+
* utilities.visibility.drawer: false leaves the eye out of the drawers, and
|
|
19
|
+
* the panel field is the only control.
|
|
20
|
+
*/
|
|
21
|
+
(function($) {
|
|
22
|
+
|
|
23
|
+
$.extend($.fn.gridEditor.locales.en, {
|
|
24
|
+
'utility.visibility': 'Visibility',
|
|
25
|
+
'utility.visibility_hidden': 'Hidden',
|
|
26
|
+
'utility.visibility_shown': 'Shown',
|
|
27
|
+
'tool.hide_in_view': 'Hide in this view',
|
|
28
|
+
'tool.show_in_view': 'Show in this view',
|
|
29
|
+
'badge.hidden_in': 'Hidden at {breakpoints}',
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
/** A node that carries any class of the family, at any breakpoint. */
|
|
33
|
+
var CLASS_PATTERN = /(?:^|\s)d-(?:(?:sm|md|lg|xl|xxl)-)?(?:none|block|flex)(?:\s|$)/;
|
|
34
|
+
|
|
35
|
+
var NODES = '.row, .column, .ge-element, [data-ge-container]';
|
|
36
|
+
|
|
37
|
+
$.fn.gridEditor.utilities.visibility = function(ge) {
|
|
38
|
+
|
|
39
|
+
var options = $.extend({ drawer: true }, ge.settings.utilities.visibility);
|
|
40
|
+
|
|
41
|
+
/** What "shown" is written as on this kind of node. */
|
|
42
|
+
function shown(kind) {
|
|
43
|
+
return kind === 'row' ? 'flex' : 'block';
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function applies(node, kind) {
|
|
47
|
+
return kind === 'row' || kind === 'column' || kind === 'element' ||
|
|
48
|
+
node.is('[data-ge-container]');
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function hiddenAt(node, view) {
|
|
52
|
+
return ge.getUtility(node, 'visibility', view) === 'none';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/** The breakpoints at which the node is hidden, smallest first. */
|
|
56
|
+
function hiddenTiers(node) {
|
|
57
|
+
return ge.breakpoints.filter(function(key) { return hiddenAt(node, key); });
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Whether the node is hidden in the view being edited. In the all view
|
|
62
|
+
* that means hidden at every breakpoint, since "hidden at some" is what
|
|
63
|
+
* the badge is for.
|
|
64
|
+
*/
|
|
65
|
+
function hiddenHere(node) {
|
|
66
|
+
return ge.view() === 'all'
|
|
67
|
+
? hiddenTiers(node).length === ge.breakpoints.length
|
|
68
|
+
: hiddenAt(node, ge.view());
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** What the breakpoint below the view shows, which an inherit falls back to. */
|
|
72
|
+
function hiddenBelow(node) {
|
|
73
|
+
var index = ge.breakpoints.indexOf(ge.view());
|
|
74
|
+
|
|
75
|
+
return index > 0 && hiddenAt(node, ge.breakpoints[index - 1]);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Hide or show the node in the view being edited, with as few classes as
|
|
80
|
+
* that takes. In a breakpoint view that is often none at all: showing a
|
|
81
|
+
* node the breakpoint below shows removes this breakpoint's d-*-none
|
|
82
|
+
* rather than writing a d-*-block on top of it. In the all view a node
|
|
83
|
+
* is hidden everywhere or shown everywhere, and shown is no class.
|
|
84
|
+
*/
|
|
85
|
+
function toggle(node, kind) {
|
|
86
|
+
var hide = !hiddenHere(node);
|
|
87
|
+
var value;
|
|
88
|
+
|
|
89
|
+
if (ge.view() === 'all') {
|
|
90
|
+
value = hide ? 'none' : null;
|
|
91
|
+
} else if (hide) {
|
|
92
|
+
value = hiddenBelow(node) ? null : 'none';
|
|
93
|
+
} else {
|
|
94
|
+
value = hiddenBelow(node) ? shown(kind) : null;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
ge.setUtility(node, 'visibility', value, { source: 'tool' });
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* The canvas shows each node as the view sees it. ge-visibility keeps a
|
|
102
|
+
* node Bootstrap would hide on the canvas, ge-hidden-in-view fades it,
|
|
103
|
+
* and data-ge-hidden-in carries the badge text for the all view.
|
|
104
|
+
*/
|
|
105
|
+
function mark(scope) {
|
|
106
|
+
scope.find(NODES).addBack(NODES).each(function() {
|
|
107
|
+
var node = $(this);
|
|
108
|
+
var kind = ge.kindOf(node);
|
|
109
|
+
var carries = applies(node, kind) && CLASS_PATTERN.test(node.attr('class') || '');
|
|
110
|
+
var tiers = carries ? hiddenTiers(node) : [];
|
|
111
|
+
var here = carries && hiddenHere(node);
|
|
112
|
+
var partly = carries && ge.view() === 'all' && tiers.length > 0 && !here;
|
|
113
|
+
|
|
114
|
+
node.toggleClass('ge-visibility', carries).toggleClass('ge-hidden-in-view', here);
|
|
115
|
+
|
|
116
|
+
if (partly) {
|
|
117
|
+
node.attr('data-ge-hidden-in', ge.t('badge.hidden_in', { breakpoints: tiers.join(', ') }));
|
|
118
|
+
} else {
|
|
119
|
+
node.removeAttr('data-ge-hidden-in');
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
node.children('.ge-tools-drawer').children('.ge-visibility-tool').each(function() {
|
|
123
|
+
$(this)
|
|
124
|
+
.attr('title', here ? ge.t('tool.show_in_view') : ge.t('tool.hide_in_view'))
|
|
125
|
+
.find('i').attr('class', here ? 'bi bi-eye-slash' : 'bi bi-eye');
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
function unmark() {
|
|
131
|
+
ge.canvas.find('.ge-visibility, .ge-hidden-in-view, [data-ge-hidden-in]').each(function() {
|
|
132
|
+
var node = $(this)
|
|
133
|
+
.removeClass('ge-visibility ge-hidden-in-view')
|
|
134
|
+
.removeAttr('data-ge-hidden-in')
|
|
135
|
+
;
|
|
136
|
+
|
|
137
|
+
if (!node.attr('class')) { node.removeAttr('class'); }
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
return {
|
|
142
|
+
families: [{
|
|
143
|
+
name: 'visibility',
|
|
144
|
+
prefix: 'd',
|
|
145
|
+
values: ['none', 'block', 'flex'],
|
|
146
|
+
appliesTo: ['row', 'column', 'element', 'container'],
|
|
147
|
+
labelKey: 'utility.visibility',
|
|
148
|
+
|
|
149
|
+
/** Hidden, or shown the way this kind of node is shown. */
|
|
150
|
+
choices: function(node, kind) {
|
|
151
|
+
return ['none', shown(kind)];
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
label: function(value) {
|
|
155
|
+
return value === 'none' ? ge.t('utility.visibility_hidden') : ge.t('utility.visibility_shown');
|
|
156
|
+
},
|
|
157
|
+
}],
|
|
158
|
+
|
|
159
|
+
drawerTools: function(drawer, node, kind) {
|
|
160
|
+
if (!options.drawer || !applies(node, kind)) { return; }
|
|
161
|
+
|
|
162
|
+
ge.createTool(drawer, ge.t('tool.hide_in_view'), 'ge-visibility-tool', 'bi bi-eye', function() {
|
|
163
|
+
toggle(node, kind);
|
|
164
|
+
});
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
onRefresh: mark,
|
|
168
|
+
onDeinit: unmark,
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
})(jQuery);
|
package/src/less/grideditor.less
CHANGED
|
@@ -44,6 +44,8 @@
|
|
|
44
44
|
|
|
45
45
|
.ge-row-icon {
|
|
46
46
|
width: 48px;
|
|
47
|
+
/* A button shrinks to its content, and an equal column has none */
|
|
48
|
+
flex: 0 0 48px;
|
|
47
49
|
margin: 0;
|
|
48
50
|
|
|
49
51
|
.column {
|
|
@@ -52,6 +54,10 @@
|
|
|
52
54
|
padding: 0;
|
|
53
55
|
border-left: 2px solid #f4f4f4;
|
|
54
56
|
}
|
|
57
|
+
/* Nothing inside to be as wide as */
|
|
58
|
+
.col-auto {
|
|
59
|
+
min-width: 8px;
|
|
60
|
+
}
|
|
55
61
|
}
|
|
56
62
|
}
|
|
57
63
|
|
|
@@ -167,6 +173,8 @@
|
|
|
167
173
|
margin: 0 -@editGutter @editGutter;
|
|
168
174
|
display: block;
|
|
169
175
|
width: calc(~"100% +" 2 * @editGutter);
|
|
176
|
+
/* Its node may align text, and the drawer's tools would follow */
|
|
177
|
+
text-align: left;
|
|
170
178
|
|
|
171
179
|
> a {
|
|
172
180
|
display: inline-block;
|
|
@@ -207,6 +215,83 @@
|
|
|
207
215
|
input.ge-classes {
|
|
208
216
|
width: 200px;
|
|
209
217
|
}
|
|
218
|
+
|
|
219
|
+
/* The utility plugins' fields, folded under one toggle */
|
|
220
|
+
.ge-utilities {
|
|
221
|
+
margin-top: 5px;
|
|
222
|
+
font-size: 11px;
|
|
223
|
+
|
|
224
|
+
> .ge-utilities-toggle {
|
|
225
|
+
color: #333;
|
|
226
|
+
cursor: pointer;
|
|
227
|
+
text-decoration: none;
|
|
228
|
+
|
|
229
|
+
&::before {
|
|
230
|
+
content: '\25B8';
|
|
231
|
+
display: inline-block;
|
|
232
|
+
width: 1em;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
&.ge-open > .ge-utilities-toggle::before {
|
|
236
|
+
content: '\25BE';
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
> .ge-utilities-body {
|
|
240
|
+
display: none;
|
|
241
|
+
flex-wrap: wrap;
|
|
242
|
+
gap: 4px 10px;
|
|
243
|
+
margin-top: 4px;
|
|
244
|
+
}
|
|
245
|
+
&.ge-open > .ge-utilities-body {
|
|
246
|
+
display: flex;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.ge-utility {
|
|
250
|
+
display: inline-flex;
|
|
251
|
+
flex-direction: column;
|
|
252
|
+
margin: 0;
|
|
253
|
+
|
|
254
|
+
select {
|
|
255
|
+
border: 1px solid #7F7F7F;
|
|
256
|
+
border-radius: 4px;
|
|
257
|
+
font-size: 11px;
|
|
258
|
+
padding: 1px 2px;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
.ge-utility-note {
|
|
262
|
+
color: #666;
|
|
263
|
+
font-size: 10px;
|
|
264
|
+
max-width: 160px;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/* The spacing plugin: a side and a value per group */
|
|
268
|
+
.ge-spacing {
|
|
269
|
+
display: flex;
|
|
270
|
+
flex-wrap: wrap;
|
|
271
|
+
gap: 4px 10px;
|
|
272
|
+
}
|
|
273
|
+
.ge-spacing-group {
|
|
274
|
+
display: inline-flex;
|
|
275
|
+
flex-direction: column;
|
|
276
|
+
|
|
277
|
+
> .ge-spacing-side {
|
|
278
|
+
border: 1px solid #7F7F7F;
|
|
279
|
+
border-radius: 4px;
|
|
280
|
+
font-size: 11px;
|
|
281
|
+
padding: 1px 2px;
|
|
282
|
+
margin-bottom: 2px;
|
|
283
|
+
}
|
|
284
|
+
/* The group names the field once */
|
|
285
|
+
.ge-utility > .ge-utility-label {
|
|
286
|
+
display: none;
|
|
287
|
+
}
|
|
288
|
+
}
|
|
289
|
+
.ge-spacing-gutter {
|
|
290
|
+
flex-basis: 100%;
|
|
291
|
+
color: #666;
|
|
292
|
+
font-size: 10px;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
210
295
|
}
|
|
211
296
|
}
|
|
212
297
|
.row {
|
|
@@ -237,6 +322,10 @@
|
|
|
237
322
|
position: relative;
|
|
238
323
|
|
|
239
324
|
> .ge-tools-drawer {
|
|
325
|
+
/* The drawer is not content: an auto column is as wide as what
|
|
326
|
+
it holds, and its tools would make it as wide as a drawer */
|
|
327
|
+
contain: inline-size;
|
|
328
|
+
|
|
240
329
|
a {
|
|
241
330
|
color: @colTextColor;
|
|
242
331
|
}
|
|
@@ -293,6 +382,13 @@
|
|
|
293
382
|
color: #fff;
|
|
294
383
|
}
|
|
295
384
|
|
|
385
|
+
/* col and col-auto: a word, not a number */
|
|
386
|
+
&.ge-size-flex {
|
|
387
|
+
width: auto;
|
|
388
|
+
padding-left: 5px;
|
|
389
|
+
padding-right: 5px;
|
|
390
|
+
}
|
|
391
|
+
|
|
296
392
|
/* Wider than what is left of the row: allowed, but said so */
|
|
297
393
|
&.ge-size-tight {
|
|
298
394
|
color: #999;
|
|
@@ -567,16 +663,43 @@
|
|
|
567
663
|
/* this tier applies at the active one, so it is written by the pass below */
|
|
568
664
|
}
|
|
569
665
|
.ge-tier-above-off(@j, @active) when (@j > @active) {
|
|
666
|
+
.ge-flex-columns-off(extract(@ge-col-prefixes, @j));
|
|
570
667
|
.ge-columns-off(extract(@ge-col-prefixes, @j));
|
|
571
668
|
.ge-offsets-off(extract(@ge-offset-prefixes, @j));
|
|
572
669
|
}
|
|
573
670
|
|
|
574
671
|
.ge-tiers-upto-on(@active, @j: 1) when (@j =< @active) {
|
|
672
|
+
.ge-flex-columns-on(extract(@ge-col-prefixes, @j));
|
|
575
673
|
.ge-columns-on(extract(@ge-col-prefixes, @j));
|
|
576
674
|
.ge-offsets-on(extract(@ge-offset-prefixes, @j));
|
|
577
675
|
.ge-tiers-upto-on(@active, @j + 1);
|
|
578
676
|
}
|
|
579
677
|
|
|
678
|
+
/*
|
|
679
|
+
* col and col-auto, in the order Bootstrap writes them: before the numbered
|
|
680
|
+
* sizes, so that of two classes for one tier the number wins, as it does on
|
|
681
|
+
* the real page.
|
|
682
|
+
*/
|
|
683
|
+
.ge-flex-columns-on(@prefix) {
|
|
684
|
+
.@{prefix} {
|
|
685
|
+
flex: 1 0 0%;
|
|
686
|
+
max-width: 100%;
|
|
687
|
+
}
|
|
688
|
+
.@{prefix}-auto {
|
|
689
|
+
flex: 0 0 auto;
|
|
690
|
+
width: auto;
|
|
691
|
+
max-width: 100%;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
.ge-flex-columns-off(@prefix) {
|
|
695
|
+
.@{prefix},
|
|
696
|
+
.@{prefix}-auto {
|
|
697
|
+
flex: 0 0 auto;
|
|
698
|
+
width: 100%;
|
|
699
|
+
max-width: 100%;
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
|
|
580
703
|
.ge-columns-on(@prefix, @i: 1) when (@i =< @ge-columns) {
|
|
581
704
|
.@{prefix}-@{i} {
|
|
582
705
|
flex: 0 0 auto;
|
|
@@ -617,3 +740,179 @@
|
|
|
617
740
|
}
|
|
618
741
|
|
|
619
742
|
.ge-layout-modes();
|
|
743
|
+
|
|
744
|
+
/*
|
|
745
|
+
* The visibility plugin. A node Bootstrap would hide is kept on the canvas -
|
|
746
|
+
* there would be nothing left to click to show it again - and shown the way
|
|
747
|
+
* the view sees it instead. The selectors outweigh Bootstrap's d-* classes,
|
|
748
|
+
* which are !important too.
|
|
749
|
+
*/
|
|
750
|
+
.ge-canvas.ge-editing {
|
|
751
|
+
.ge-visibility {
|
|
752
|
+
display: block !important;
|
|
753
|
+
}
|
|
754
|
+
.row.ge-visibility {
|
|
755
|
+
display: flex !important;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
.ge-hidden-in-view {
|
|
759
|
+
opacity: .45;
|
|
760
|
+
background-image: repeating-linear-gradient(
|
|
761
|
+
-45deg, transparent 0, transparent 6px, rgba(0, 0, 0, .07) 6px, rgba(0, 0, 0, .07) 12px
|
|
762
|
+
);
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
/* The all view: hidden at some breakpoints, said in a corner */
|
|
766
|
+
[data-ge-hidden-in] {
|
|
767
|
+
position: relative;
|
|
768
|
+
|
|
769
|
+
&::after {
|
|
770
|
+
content: attr(data-ge-hidden-in);
|
|
771
|
+
position: absolute;
|
|
772
|
+
right: 2px;
|
|
773
|
+
bottom: 2px;
|
|
774
|
+
z-index: 1;
|
|
775
|
+
padding: 0 4px;
|
|
776
|
+
border-radius: 3px;
|
|
777
|
+
background: rgba(0, 0, 0, .6);
|
|
778
|
+
color: #fff;
|
|
779
|
+
font-size: 10px;
|
|
780
|
+
line-height: 16px;
|
|
781
|
+
pointer-events: none;
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
/* The order plugin: a column ordered by class in this view says where */
|
|
787
|
+
.ge-canvas.ge-editing .column[data-ge-order]::before {
|
|
788
|
+
content: attr(data-ge-order);
|
|
789
|
+
position: absolute;
|
|
790
|
+
left: 2px;
|
|
791
|
+
bottom: 2px;
|
|
792
|
+
z-index: 1;
|
|
793
|
+
padding: 0 4px;
|
|
794
|
+
border-radius: 3px;
|
|
795
|
+
background: fade(@colTextColor, 85%);
|
|
796
|
+
color: #fff;
|
|
797
|
+
font-size: 10px;
|
|
798
|
+
line-height: 16px;
|
|
799
|
+
pointer-events: none;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
/*
|
|
803
|
+
* The gutters plugin. A row with gutter classes is drawn with its real
|
|
804
|
+
* gutters rather than the editor's frame: each column padded by half the
|
|
805
|
+
* horizontal gutter, and the vertical gutter above each column. Bootstrap
|
|
806
|
+
* takes the first line's back with a negative top margin on the row, which
|
|
807
|
+
* here would pull it over the row above, so the row's drawer takes it back
|
|
808
|
+
* instead and the gap shows between lines of columns only.
|
|
809
|
+
*/
|
|
810
|
+
.ge-canvas.ge-editing .row.ge-gutters {
|
|
811
|
+
margin-top: 0;
|
|
812
|
+
|
|
813
|
+
> .ge-tools-drawer {
|
|
814
|
+
margin-top: 0;
|
|
815
|
+
margin-bottom: calc(@editGutter - var(--bs-gutter-y));
|
|
816
|
+
/* Bootstrap pads every child of a row by half its gutter, the drawer
|
|
817
|
+
too; it keeps the padding a row with no gutter class gives it */
|
|
818
|
+
padding-left: .75rem;
|
|
819
|
+
padding-right: .75rem;
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
> .column {
|
|
823
|
+
padding-left: calc(var(--bs-gutter-x) * .5);
|
|
824
|
+
padding-right: calc(var(--bs-gutter-x) * .5);
|
|
825
|
+
|
|
826
|
+
> .ge-tools-drawer {
|
|
827
|
+
margin-left: calc(var(--bs-gutter-x) * -.5);
|
|
828
|
+
margin-right: calc(var(--bs-gutter-x) * -.5);
|
|
829
|
+
width: calc(100% + var(--bs-gutter-x));
|
|
830
|
+
}
|
|
831
|
+
}
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
/* A row whose row-cols sizes its columns in this view says how many */
|
|
835
|
+
.ge-canvas.ge-editing .row[data-ge-row-cols] {
|
|
836
|
+
position: relative;
|
|
837
|
+
|
|
838
|
+
&::before {
|
|
839
|
+
content: attr(data-ge-row-cols);
|
|
840
|
+
position: absolute;
|
|
841
|
+
left: 2px;
|
|
842
|
+
bottom: 2px;
|
|
843
|
+
z-index: 1;
|
|
844
|
+
padding: 0 4px;
|
|
845
|
+
border-radius: 3px;
|
|
846
|
+
background: rgba(0, 0, 0, .55);
|
|
847
|
+
color: #fff;
|
|
848
|
+
font-size: 10px;
|
|
849
|
+
line-height: 16px;
|
|
850
|
+
pointer-events: none;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
/*
|
|
855
|
+
* The sections plugin: Bootstrap's containers on the canvas. A section is
|
|
856
|
+
* framed while editing, and in a breakpoint view each container class gets
|
|
857
|
+
* the max-width it has at that breakpoint - Bootstrap sets it for the
|
|
858
|
+
* window, and the window is not what a breakpoint view narrows.
|
|
859
|
+
*/
|
|
860
|
+
@ge-section-color: #8a6d3b;
|
|
861
|
+
|
|
862
|
+
.ge-canvas.ge-editing > .ge-section {
|
|
863
|
+
border: 1px dashed @ge-section-color;
|
|
864
|
+
margin-bottom: @editGutter;
|
|
865
|
+
padding-bottom: @editGutter;
|
|
866
|
+
|
|
867
|
+
> .ge-section-drawer {
|
|
868
|
+
background: fadeout(@ge-section-color, 85%);
|
|
869
|
+
margin-left: 0;
|
|
870
|
+
margin-right: 0;
|
|
871
|
+
width: 100%;
|
|
872
|
+
|
|
873
|
+
> a {
|
|
874
|
+
color: darken(@ge-section-color, 5%);
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
/* The width field, in the section's settings panel beside id and classes */
|
|
880
|
+
.ge-canvas.ge-editing .ge-details .ge-section-width {
|
|
881
|
+
display: inline-flex;
|
|
882
|
+
align-items: center;
|
|
883
|
+
gap: 4px;
|
|
884
|
+
margin: 0;
|
|
885
|
+
font-size: 11px;
|
|
886
|
+
|
|
887
|
+
select {
|
|
888
|
+
border: 1px solid #7F7F7F;
|
|
889
|
+
border-radius: 4px;
|
|
890
|
+
font-size: 11px;
|
|
891
|
+
padding: 1px 2px;
|
|
892
|
+
}
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
@ge-section-classes: container, container-sm, container-md, container-lg, container-xl, container-xxl;
|
|
896
|
+
@ge-section-from: 2, 2, 3, 4, 5, 6;
|
|
897
|
+
@ge-section-widths: 100%, 540px, 720px, 960px, 1140px, 1320px;
|
|
898
|
+
|
|
899
|
+
.ge-section-modes(@i: 1) when (@i =< length(@ge-tiers)) {
|
|
900
|
+
@tier: extract(@ge-tiers, @i);
|
|
901
|
+
.ge-section-classes(@i, @tier);
|
|
902
|
+
.ge-section-modes(@i + 1);
|
|
903
|
+
}
|
|
904
|
+
.ge-section-classes(@i, @tier, @k: 1) when (@k =< length(@ge-section-classes)) {
|
|
905
|
+
.ge-section-width(@i, @tier, extract(@ge-section-classes, @k), extract(@ge-section-from, @k));
|
|
906
|
+
.ge-section-classes(@i, @tier, @k + 1);
|
|
907
|
+
}
|
|
908
|
+
.ge-section-width(@i, @tier, @class, @from) when (@i >= @from) {
|
|
909
|
+
.ge-canvas.ge-layout-@{tier} > .@{class} {
|
|
910
|
+
max-width: extract(@ge-section-widths, @i);
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
.ge-section-width(@i, @tier, @class, @from) when (@i < @from) {
|
|
914
|
+
.ge-canvas.ge-layout-@{tier} > .@{class} {
|
|
915
|
+
max-width: 100%;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
.ge-section-modes();
|