@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.
- package/CHANGELOG.md +40 -0
- package/README.md +17 -11
- package/UPGRADING.md +21 -11
- package/dist/grideditor.bundle.min.js +3 -3
- package/dist/grideditor.css +52 -35
- package/dist/grideditor.d.ts +12 -9
- package/dist/grideditor.esm.js +44 -25
- package/dist/grideditor.js +44 -25
- 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 +70 -68
- package/dist/locales/grideditor.es.js +70 -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} +193 -184
- package/dist/plugins/{grideditor.style.js → grideditor.inline-style.js} +191 -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 +82 -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 +39 -22
- 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 +35 -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 +70 -68
- package/src/js/plugins/grideditor.alignment.js +1 -1
- package/src/js/plugins/grideditor.inline-style.js +186 -0
- package/src/less/grideditor.less +43 -25
- package/types/grideditor.d.ts +12 -9
- 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
|
@@ -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
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The style plugin's inline fields: one per css property, each writing the
|
|
2
|
+
* The inline-style plugin's inline fields: one per css property, each writing the
|
|
3
3
|
* node's own style through ge.setHostStyle, never by hand, so the preview
|
|
4
4
|
* of a breakpoint view neither shows in them nor eats what they write.
|
|
5
5
|
*
|
|
@@ -40,7 +40,7 @@ function mark(input, ok, ge) {
|
|
|
40
40
|
if (ok) {
|
|
41
41
|
input.removeAttribute('title');
|
|
42
42
|
} else {
|
|
43
|
-
input.setAttribute('title', ge.t('
|
|
43
|
+
input.setAttribute('title', ge.t('inline_style.invalid'));
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -70,7 +70,7 @@ function pickable(value) {
|
|
|
70
70
|
|
|
71
71
|
/** A picker and a text beside it, which takes what a picker cannot: rgba, var(), transparent. */
|
|
72
72
|
function colorControl(onValue) {
|
|
73
|
-
var box = dom.element('div', { 'class': 'input-group input-group-sm ge-style-color' });
|
|
73
|
+
var box = dom.element('div', { 'class': 'input-group input-group-sm ge-inline-style-color' });
|
|
74
74
|
var picker = box.appendChild(dom.element('input', { type: 'color', 'class': 'form-control form-control-color' }));
|
|
75
75
|
var text = box.appendChild(textInput());
|
|
76
76
|
|
|
@@ -146,10 +146,10 @@ var LENGTH = /^-?(?:\d*\.)?\d+(?:[a-z%]+)?$/i;
|
|
|
146
146
|
|
|
147
147
|
/** The lengths of a shadow, in the order css writes them; a text shadow has no spread. */
|
|
148
148
|
var SHADOW_PARTS = [
|
|
149
|
-
{ name: 'x', labelKey: '
|
|
150
|
-
{ name: 'y', labelKey: '
|
|
151
|
-
{ name: 'blur', labelKey: '
|
|
152
|
-
{ name: 'spread', labelKey: '
|
|
149
|
+
{ name: 'x', labelKey: 'inline_style.shadow_x' },
|
|
150
|
+
{ name: 'y', labelKey: 'inline_style.shadow_y' },
|
|
151
|
+
{ name: 'blur', labelKey: 'inline_style.shadow_blur' },
|
|
152
|
+
{ name: 'spread', labelKey: 'inline_style.shadow_spread' },
|
|
153
153
|
];
|
|
154
154
|
|
|
155
155
|
/**
|
|
@@ -206,7 +206,7 @@ function composeShadow(parts, box) {
|
|
|
206
206
|
*/
|
|
207
207
|
function shadowControl(ge, node, property, changed) {
|
|
208
208
|
var box = property === 'box-shadow';
|
|
209
|
-
var holder = dom.element('div', { 'class': 'ge-style-shadow' });
|
|
209
|
+
var holder = dom.element('div', { 'class': 'ge-inline-style-shadow' });
|
|
210
210
|
var textMode = false;
|
|
211
211
|
|
|
212
212
|
function writeValue(value, input) {
|
|
@@ -218,34 +218,34 @@ function shadowControl(ge, node, property, changed) {
|
|
|
218
218
|
|
|
219
219
|
function builder(parts) {
|
|
220
220
|
holder.innerHTML = '';
|
|
221
|
-
var grid = holder.appendChild(dom.element('div', { 'class': 'ge-style-shadow-builder' }));
|
|
221
|
+
var grid = holder.appendChild(dom.element('div', { 'class': 'ge-inline-style-shadow-builder' }));
|
|
222
222
|
var names = box ? SHADOW_PARTS : SHADOW_PARTS.slice(0, 3);
|
|
223
223
|
var inputs = names.map(function(part, i) {
|
|
224
|
-
var cell = grid.appendChild(dom.element('label', { 'class': 'ge-style-shadow-part' }));
|
|
225
|
-
cell.appendChild(dom.element('span', { 'class': 'ge-style-shadow-label' }, ge.t(part.labelKey)));
|
|
226
|
-
var input = cell.appendChild(textInput('ge-style-shadow-' + part.name));
|
|
224
|
+
var cell = grid.appendChild(dom.element('label', { 'class': 'ge-inline-style-shadow-part' }));
|
|
225
|
+
cell.appendChild(dom.element('span', { 'class': 'ge-inline-style-shadow-label' }, ge.t(part.labelKey)));
|
|
226
|
+
var input = cell.appendChild(textInput('ge-inline-style-shadow-' + part.name));
|
|
227
227
|
input.value = parts.lengths[i] || '';
|
|
228
228
|
return input;
|
|
229
229
|
});
|
|
230
230
|
|
|
231
|
-
var colorCell = grid.appendChild(dom.element('label', { 'class': 'ge-style-shadow-part ge-style-shadow-color' }));
|
|
232
|
-
colorCell.appendChild(dom.element('span', { 'class': 'ge-style-shadow-label' }, ge.t('
|
|
231
|
+
var colorCell = grid.appendChild(dom.element('label', { 'class': 'ge-inline-style-shadow-part ge-inline-style-shadow-color' }));
|
|
232
|
+
colorCell.appendChild(dom.element('span', { 'class': 'ge-inline-style-shadow-label' }, ge.t('inline_style.shadow_color')));
|
|
233
233
|
var color = colorControl(function() { update(); });
|
|
234
234
|
colorCell.appendChild(color.element);
|
|
235
235
|
color.set(parts.color);
|
|
236
236
|
|
|
237
237
|
var inset = null;
|
|
238
238
|
if (box) {
|
|
239
|
-
var insetCell = grid.appendChild(dom.element('label', { 'class': 'form-check ge-style-shadow-inset' }));
|
|
239
|
+
var insetCell = grid.appendChild(dom.element('label', { 'class': 'form-check ge-inline-style-shadow-inset' }));
|
|
240
240
|
inset = insetCell.appendChild(dom.element('input', { type: 'checkbox', 'class': 'form-check-input' }));
|
|
241
|
-
insetCell.appendChild(dom.element('span', { 'class': 'form-check-label' }, ge.t('
|
|
241
|
+
insetCell.appendChild(dom.element('span', { 'class': 'form-check-label' }, ge.t('inline_style.shadow_inset')));
|
|
242
242
|
inset.checked = parts.inset;
|
|
243
243
|
inset.addEventListener('change', function() { update(); });
|
|
244
244
|
}
|
|
245
245
|
|
|
246
246
|
inputs.forEach(function(input) { input.addEventListener('change', function() { update(); }); });
|
|
247
247
|
|
|
248
|
-
var toText = holder.appendChild(dom.element('a', { href: '#', 'class': 'ge-style-shadow-mode' }, ge.t('
|
|
248
|
+
var toText = holder.appendChild(dom.element('a', { href: '#', 'class': 'ge-inline-style-shadow-mode' }, ge.t('inline_style.shadow_text_mode')));
|
|
249
249
|
toText.addEventListener('click', function(e) {
|
|
250
250
|
e.preventDefault();
|
|
251
251
|
textMode = true;
|
|
@@ -264,7 +264,7 @@ function shadowControl(ge, node, property, changed) {
|
|
|
264
264
|
|
|
265
265
|
function text(value) {
|
|
266
266
|
holder.innerHTML = '';
|
|
267
|
-
var input = holder.appendChild(textInput('ge-style-shadow-text'));
|
|
267
|
+
var input = holder.appendChild(textInput('ge-inline-style-shadow-text'));
|
|
268
268
|
input.value = value;
|
|
269
269
|
input.addEventListener('change', function() {
|
|
270
270
|
if (input.value.trim() === '') {
|
|
@@ -276,6 +276,16 @@ function shadowControl(ge, node, property, changed) {
|
|
|
276
276
|
}
|
|
277
277
|
writeValue(input.value, input);
|
|
278
278
|
});
|
|
279
|
+
|
|
280
|
+
// Back to the builder, when it can hold the value: one shadow, or none
|
|
281
|
+
if (parseShadow(value, box)) {
|
|
282
|
+
var toBuilder = holder.appendChild(dom.element('a', { href: '#', 'class': 'ge-inline-style-shadow-mode' }, ge.t('inline_style.shadow_builder_mode')));
|
|
283
|
+
toBuilder.addEventListener('click', function(e) {
|
|
284
|
+
e.preventDefault();
|
|
285
|
+
textMode = false;
|
|
286
|
+
render();
|
|
287
|
+
});
|
|
288
|
+
}
|
|
279
289
|
}
|
|
280
290
|
|
|
281
291
|
var shown = null; // The value the builder or the text was last built for
|
|
@@ -288,7 +298,7 @@ function shadowControl(ge, node, property, changed) {
|
|
|
288
298
|
|
|
289
299
|
// Built again only when the value changed under it: building takes
|
|
290
300
|
// the focus from whichever of its inputs the user moved on to
|
|
291
|
-
if (value === shown && holder.firstChild && textMode === !!holder.querySelector('.ge-style-shadow-text')) { return; }
|
|
301
|
+
if (value === shown && holder.firstChild && textMode === !!holder.querySelector('.ge-inline-style-shadow-text')) { return; }
|
|
292
302
|
shown = value;
|
|
293
303
|
|
|
294
304
|
if (textMode || !parts) {
|
|
@@ -308,8 +318,8 @@ function shadowControl(ge, node, property, changed) {
|
|
|
308
318
|
* sections up to date.
|
|
309
319
|
*/
|
|
310
320
|
export function createStyleField(ge, node, property, changed) {
|
|
311
|
-
var field = dom.element('div', { 'class': 'ge-style-field', 'data-ge-style-property': property.name });
|
|
312
|
-
var label = field.appendChild(dom.element('label', { 'class': 'ge-style-label' }, ge.t(property.labelKey)));
|
|
321
|
+
var field = dom.element('div', { 'class': 'ge-inline-style-field', 'data-ge-inline-style-property': property.name });
|
|
322
|
+
var label = field.appendChild(dom.element('label', { 'class': 'ge-inline-style-label' }, ge.t(property.labelKey)));
|
|
313
323
|
var render;
|
|
314
324
|
|
|
315
325
|
function current() {
|
|
@@ -355,19 +365,19 @@ export function createStyleField(ge, node, property, changed) {
|
|
|
355
365
|
|
|
356
366
|
var control = field.querySelector('input, select');
|
|
357
367
|
if (control) {
|
|
358
|
-
control.id = 'ge-style-field-' + (++fieldCounter);
|
|
368
|
+
control.id = 'ge-inline-style-field-' + (++fieldCounter);
|
|
359
369
|
label.setAttribute('for', control.id);
|
|
360
370
|
}
|
|
361
371
|
|
|
362
|
-
field.appendChild(dom.element('small', { 'class': 'ge-style-note ge-style-overridden' }));
|
|
372
|
+
field.appendChild(dom.element('small', { 'class': 'ge-inline-style-note ge-inline-style-overridden' }));
|
|
363
373
|
|
|
364
374
|
renderers.set(field, function() {
|
|
365
375
|
render();
|
|
366
376
|
|
|
367
377
|
// A Bootstrap utility on the node wins over the value: every one is !important
|
|
368
378
|
var winner = current() ? overriding(property.name, classesOf(node)) : null;
|
|
369
|
-
var note = dom.child(field, '.ge-style-overridden');
|
|
370
|
-
note.textContent = winner ? ge.t('
|
|
379
|
+
var note = dom.child(field, '.ge-inline-style-overridden');
|
|
380
|
+
note.textContent = winner ? ge.t('inline_style.overridden', { 'class': winner }) : '';
|
|
371
381
|
dom.toggle(note, !!winner);
|
|
372
382
|
});
|
|
373
383
|
renderStyleField(field);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Flex, a part of the style plugin: a flex container's direction, wrap,
|
|
2
|
+
* Flex, a part of the inline-style plugin: a flex container's direction, wrap,
|
|
3
3
|
* alignment and gaps, and how its children grow, shrink and fill, per
|
|
4
4
|
* breakpoint, with Bootstrap's flex-{breakpoint}-*, justify-content-*,
|
|
5
5
|
* align-items-*, align-content-*, gap-* and row-/column-gap-* classes.
|
|
6
6
|
*
|
|
7
7
|
* Its families, and whatever it does on the canvas, as a function of the
|
|
8
8
|
* handle and the spacing options, whose scale the gaps share:
|
|
9
|
-
* grideditor.style.js puts them in its Flex section.
|
|
9
|
+
* grideditor.inline-style.js puts them in its Flex section.
|
|
10
10
|
*/
|
|
11
11
|
import { GridEditor } from '../grideditor.js';
|
|
12
12
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Float, a part of the style plugin: floating an element per breakpoint, with Bootstrap's
|
|
2
|
+
* Float, a part of the inline-style plugin: floating an element per breakpoint, with Bootstrap's
|
|
3
3
|
* float-{breakpoint}-start, -end and -none classes.
|
|
4
4
|
*
|
|
5
5
|
* Its families, and whatever it does on the canvas, as a function of the
|
|
6
|
-
* handle: grideditor.style.js puts them in its sections.
|
|
6
|
+
* handle: grideditor.inline-style.js puts them in its sections.
|
|
7
7
|
*/
|
|
8
8
|
import { GridEditor } from '../grideditor.js';
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The style plugin's settings, `
|
|
2
|
+
* The inline-style plugin's settings, `inline_style` in the editor's options:
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* inline_style: {
|
|
5
5
|
* sections: { border: { properties: [...], catalog: false }, position: false, … },
|
|
6
6
|
* spacing: { values, scale }, // the values offered, and what 0 to 5 come to
|
|
7
7
|
* visibility: { drawer }, // false leaves the eye out of the drawers
|
|
@@ -19,7 +19,7 @@ function resolveSections(ge, given) {
|
|
|
19
19
|
var resolved = {};
|
|
20
20
|
|
|
21
21
|
Object.keys(given || {}).forEach(function(key) {
|
|
22
|
-
if (!section(key)) { ge.warn('
|
|
22
|
+
if (!section(key)) { ge.warn('inline_style.sections: there is no "' + key + '" section: ignored'); }
|
|
23
23
|
});
|
|
24
24
|
|
|
25
25
|
SECTIONS.forEach(function(each) {
|
|
@@ -34,7 +34,7 @@ function resolveSections(ge, given) {
|
|
|
34
34
|
if (Array.isArray(option.properties)) {
|
|
35
35
|
option.properties.forEach(function(name) {
|
|
36
36
|
if (own.indexOf(name) === -1) {
|
|
37
|
-
ge.warn('
|
|
37
|
+
ge.warn('inline_style.sections.' + each.key + ': "' + name + '" is not one of its properties: ignored');
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
properties = option.properties.filter(function(name) { return own.indexOf(name) !== -1; })
|
|
@@ -50,7 +50,7 @@ function resolveSections(ge, given) {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export function resolveOptions(ge) {
|
|
53
|
-
var style = ge.settings.
|
|
53
|
+
var style = ge.settings.inline_style || {};
|
|
54
54
|
|
|
55
55
|
return {
|
|
56
56
|
sections: resolveSections(ge, style.sections),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* What the style plugin's sections are made of: for each, its inline
|
|
2
|
+
* What the inline-style plugin's sections are made of: for each, its inline
|
|
3
3
|
* properties and the field each one gets, the Bootstrap 5.3 classes its
|
|
4
4
|
* catalog offers, and which of the merged utility parts it shows.
|
|
5
5
|
*
|
|
@@ -48,14 +48,14 @@ var ONLY_ON_ELEMENT = ['element'];
|
|
|
48
48
|
export var SECTIONS = [
|
|
49
49
|
{
|
|
50
50
|
key: 'size',
|
|
51
|
-
labelKey: '
|
|
51
|
+
labelKey: 'inline_style.section_size',
|
|
52
52
|
properties: [
|
|
53
|
-
prop('width', { labelKey: '
|
|
54
|
-
prop('height', { labelKey: '
|
|
55
|
-
prop('min-width', { labelKey: '
|
|
56
|
-
prop('min-height', { labelKey: '
|
|
57
|
-
prop('max-width', { labelKey: '
|
|
58
|
-
prop('max-height', { labelKey: '
|
|
53
|
+
prop('width', { labelKey: 'inline_style.prop_width', notOn: NOT_ON_COLUMN }),
|
|
54
|
+
prop('height', { labelKey: 'inline_style.prop_height', notOn: NOT_ON_COLUMN }),
|
|
55
|
+
prop('min-width', { labelKey: 'inline_style.prop_min_width' }),
|
|
56
|
+
prop('min-height', { labelKey: 'inline_style.prop_min_height' }),
|
|
57
|
+
prop('max-width', { labelKey: 'inline_style.prop_max_width' }),
|
|
58
|
+
prop('max-height', { labelKey: 'inline_style.prop_max_height' }),
|
|
59
59
|
],
|
|
60
60
|
catalog: [
|
|
61
61
|
group(each('w-', ['25', '50', '75', '100', 'auto']), true, NOT_ON_COLUMN),
|
|
@@ -68,23 +68,23 @@ export var SECTIONS = [
|
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
key: 'spacing',
|
|
71
|
-
labelKey: '
|
|
71
|
+
labelKey: 'inline_style.section_spacing',
|
|
72
72
|
properties: [
|
|
73
|
-
prop('margin-top', { labelKey: '
|
|
74
|
-
prop('padding-top', { labelKey: '
|
|
73
|
+
prop('margin-top', { labelKey: 'inline_style.prop_margin_top' }), prop('margin-right', { labelKey: 'inline_style.prop_margin_right' }), prop('margin-bottom', { labelKey: 'inline_style.prop_margin_bottom' }), prop('margin-left', { labelKey: 'inline_style.prop_margin_left' }),
|
|
74
|
+
prop('padding-top', { labelKey: 'inline_style.prop_padding_top' }), prop('padding-right', { labelKey: 'inline_style.prop_padding_right' }), prop('padding-bottom', { labelKey: 'inline_style.prop_padding_bottom' }), prop('padding-left', { labelKey: 'inline_style.prop_padding_left' }),
|
|
75
75
|
],
|
|
76
76
|
catalog: [],
|
|
77
77
|
parts: ['spacing'],
|
|
78
78
|
},
|
|
79
79
|
{
|
|
80
80
|
key: 'border',
|
|
81
|
-
labelKey: '
|
|
81
|
+
labelKey: 'inline_style.section_border',
|
|
82
82
|
properties: [
|
|
83
|
-
prop('border-width', { labelKey: '
|
|
84
|
-
prop('border-style', { labelKey: '
|
|
85
|
-
prop('border-color', { labelKey: '
|
|
86
|
-
prop('border-radius', { labelKey: '
|
|
87
|
-
prop('box-shadow', { labelKey: '
|
|
83
|
+
prop('border-width', { labelKey: 'inline_style.prop_border_width' }),
|
|
84
|
+
prop('border-style', { labelKey: 'inline_style.prop_border_style', type: 'select', values: ['none', 'solid', 'dashed', 'dotted', 'double', 'groove', 'ridge', 'inset', 'outset'] }),
|
|
85
|
+
prop('border-color', { labelKey: 'inline_style.prop_border_color', type: 'color' }),
|
|
86
|
+
prop('border-radius', { labelKey: 'inline_style.prop_border_radius' }),
|
|
87
|
+
prop('box-shadow', { labelKey: 'inline_style.prop_box_shadow', type: 'shadow' }),
|
|
88
88
|
],
|
|
89
89
|
catalog: [
|
|
90
90
|
group(['border', 'border-0'].concat(each('border-', SIDES), each('border-', SIDES, '-0')), false),
|
|
@@ -99,13 +99,13 @@ export var SECTIONS = [
|
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
key: 'background',
|
|
102
|
-
labelKey: '
|
|
102
|
+
labelKey: 'inline_style.section_background',
|
|
103
103
|
properties: [
|
|
104
|
-
prop('background-color', { labelKey: '
|
|
105
|
-
prop('background-image', { labelKey: '
|
|
106
|
-
prop('background-size', { labelKey: '
|
|
107
|
-
prop('background-position', { labelKey: '
|
|
108
|
-
prop('background-repeat', { labelKey: '
|
|
104
|
+
prop('background-color', { labelKey: 'inline_style.prop_background_color', type: 'color' }),
|
|
105
|
+
prop('background-image', { labelKey: 'inline_style.prop_background_image', type: 'url' }),
|
|
106
|
+
prop('background-size', { labelKey: 'inline_style.prop_background_size' }),
|
|
107
|
+
prop('background-position', { labelKey: 'inline_style.prop_background_position' }),
|
|
108
|
+
prop('background-repeat', { labelKey: 'inline_style.prop_background_repeat', type: 'select', values: ['repeat', 'no-repeat', 'repeat-x', 'repeat-y', 'space', 'round'] }),
|
|
109
109
|
],
|
|
110
110
|
catalog: [
|
|
111
111
|
group(each('bg-', COLORS.concat(['body', 'body-secondary', 'body-tertiary', 'white', 'black', 'transparent']))
|
|
@@ -117,12 +117,12 @@ export var SECTIONS = [
|
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
key: 'text',
|
|
120
|
-
labelKey: '
|
|
120
|
+
labelKey: 'inline_style.section_text',
|
|
121
121
|
properties: [
|
|
122
|
-
prop('color', { labelKey: '
|
|
123
|
-
prop('font-size', { labelKey: '
|
|
124
|
-
prop('text-align', { labelKey: '
|
|
125
|
-
prop('text-shadow', { labelKey: '
|
|
122
|
+
prop('color', { labelKey: 'inline_style.prop_color', type: 'color' }),
|
|
123
|
+
prop('font-size', { labelKey: 'inline_style.prop_font_size' }),
|
|
124
|
+
prop('text-align', { labelKey: 'inline_style.prop_text_align', type: 'select', values: ['start', 'center', 'end', 'left', 'right', 'justify'] }),
|
|
125
|
+
prop('text-shadow', { labelKey: 'inline_style.prop_text_shadow', type: 'shadow' }),
|
|
126
126
|
],
|
|
127
127
|
catalog: [
|
|
128
128
|
group(each('text-', COLORS.concat(['body', 'body-secondary', 'body-tertiary', 'white', 'black']))
|
|
@@ -135,15 +135,15 @@ export var SECTIONS = [
|
|
|
135
135
|
},
|
|
136
136
|
{
|
|
137
137
|
key: 'typography',
|
|
138
|
-
labelKey: '
|
|
138
|
+
labelKey: 'inline_style.section_typography',
|
|
139
139
|
properties: [
|
|
140
|
-
prop('font-family', { labelKey: '
|
|
141
|
-
prop('font-weight', { labelKey: '
|
|
142
|
-
prop('font-style', { labelKey: '
|
|
143
|
-
prop('line-height', { labelKey: '
|
|
144
|
-
prop('letter-spacing', { labelKey: '
|
|
145
|
-
prop('text-transform', { labelKey: '
|
|
146
|
-
prop('text-decoration', { labelKey: '
|
|
140
|
+
prop('font-family', { labelKey: 'inline_style.prop_font_family' }),
|
|
141
|
+
prop('font-weight', { labelKey: 'inline_style.prop_font_weight', type: 'select', values: ['100', '200', '300', '400', '500', '600', '700', '800', '900', 'normal', 'bold', 'lighter', 'bolder'] }),
|
|
142
|
+
prop('font-style', { labelKey: 'inline_style.prop_font_style', type: 'select', values: ['normal', 'italic', 'oblique'] }),
|
|
143
|
+
prop('line-height', { labelKey: 'inline_style.prop_line_height' }),
|
|
144
|
+
prop('letter-spacing', { labelKey: 'inline_style.prop_letter_spacing' }),
|
|
145
|
+
prop('text-transform', { labelKey: 'inline_style.prop_text_transform', type: 'select', values: ['none', 'uppercase', 'lowercase', 'capitalize'] }),
|
|
146
|
+
prop('text-decoration', { labelKey: 'inline_style.prop_text_decoration', type: 'select', values: ['none', 'underline', 'line-through', 'overline'] }),
|
|
147
147
|
],
|
|
148
148
|
catalog: [
|
|
149
149
|
group(each('fw-', ['lighter', 'light', 'normal', 'medium', 'semibold', 'bold', 'bolder'])),
|
|
@@ -158,12 +158,12 @@ export var SECTIONS = [
|
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
key: 'display',
|
|
161
|
-
labelKey: '
|
|
161
|
+
labelKey: 'inline_style.section_display',
|
|
162
162
|
properties: [
|
|
163
|
-
prop('display', { labelKey: '
|
|
164
|
-
prop('opacity', { labelKey: '
|
|
165
|
-
prop('overflow', { labelKey: '
|
|
166
|
-
prop('visibility', { labelKey: '
|
|
163
|
+
prop('display', { labelKey: 'inline_style.prop_display', type: 'select', values: ['none', 'block', 'inline', 'inline-block', 'flex', 'inline-flex', 'grid', 'inline-grid'] }),
|
|
164
|
+
prop('opacity', { labelKey: 'inline_style.prop_opacity' }),
|
|
165
|
+
prop('overflow', { labelKey: 'inline_style.prop_overflow', type: 'select', values: ['visible', 'hidden', 'auto', 'scroll', 'clip'] }),
|
|
166
|
+
prop('visibility', { labelKey: 'inline_style.prop_visibility', type: 'select', values: ['visible', 'hidden'] }),
|
|
167
167
|
],
|
|
168
168
|
catalog: [
|
|
169
169
|
group(each('opacity-', ['0', '25', '50', '75', '100'])),
|
|
@@ -174,7 +174,7 @@ export var SECTIONS = [
|
|
|
174
174
|
},
|
|
175
175
|
{
|
|
176
176
|
key: 'flex',
|
|
177
|
-
labelKey: '
|
|
177
|
+
labelKey: 'inline_style.section_flex',
|
|
178
178
|
properties: [],
|
|
179
179
|
catalog: [
|
|
180
180
|
group(['vstack', 'hstack'], true, ['row']),
|
|
@@ -183,14 +183,14 @@ export var SECTIONS = [
|
|
|
183
183
|
},
|
|
184
184
|
{
|
|
185
185
|
key: 'position',
|
|
186
|
-
labelKey: '
|
|
186
|
+
labelKey: 'inline_style.section_position',
|
|
187
187
|
properties: [
|
|
188
|
-
prop('position', { labelKey: '
|
|
189
|
-
prop('top', { labelKey: '
|
|
190
|
-
prop('right', { labelKey: '
|
|
191
|
-
prop('bottom', { labelKey: '
|
|
192
|
-
prop('left', { labelKey: '
|
|
193
|
-
prop('z-index', { labelKey: '
|
|
188
|
+
prop('position', { labelKey: 'inline_style.prop_position', type: 'select', values: ['static', 'relative', 'absolute', 'fixed', 'sticky'] }),
|
|
189
|
+
prop('top', { labelKey: 'inline_style.prop_top', notOn: NOT_ON_COLUMN }),
|
|
190
|
+
prop('right', { labelKey: 'inline_style.prop_right', notOn: NOT_ON_COLUMN }),
|
|
191
|
+
prop('bottom', { labelKey: 'inline_style.prop_bottom', notOn: NOT_ON_COLUMN }),
|
|
192
|
+
prop('left', { labelKey: 'inline_style.prop_left', notOn: NOT_ON_COLUMN }),
|
|
193
|
+
prop('z-index', { labelKey: 'inline_style.prop_z_index' }),
|
|
194
194
|
],
|
|
195
195
|
catalog: [
|
|
196
196
|
group(each('position-', ['static', 'relative', 'absolute', 'fixed', 'sticky'])),
|
|
@@ -206,7 +206,7 @@ export var SECTIONS = [
|
|
|
206
206
|
},
|
|
207
207
|
{
|
|
208
208
|
key: 'custom',
|
|
209
|
-
labelKey: '
|
|
209
|
+
labelKey: 'inline_style.section_custom',
|
|
210
210
|
properties: [],
|
|
211
211
|
catalog: [],
|
|
212
212
|
parts: [],
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Spacing, a part of the style plugin: padding and margin per breakpoint, with Bootstrap's p-{breakpoint}-*,
|
|
2
|
+
* Spacing, a part of the inline-style plugin: padding and margin per breakpoint, with Bootstrap's p-{breakpoint}-*,
|
|
3
3
|
* pt-, px- … and m-{breakpoint}-*, mt-, mx- … classes.
|
|
4
4
|
*
|
|
5
5
|
* Its families, and whatever it does on the canvas, as a function of the
|
|
6
|
-
* handle and its options: grideditor.style.js puts them in its sections.
|
|
6
|
+
* handle and its options: grideditor.inline-style.js puts them in its sections.
|
|
7
7
|
*/
|
|
8
8
|
import { GridEditor } from '../grideditor.js';
|
|
9
9
|
import * as dom from '../dom.js';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Sticky, a part of the style plugin: sticking a node to the top or the
|
|
2
|
+
* Sticky, a part of the inline-style plugin: sticking a node to the top or the
|
|
3
3
|
* bottom of the page as it scrolls, per breakpoint, with Bootstrap's
|
|
4
4
|
* sticky-{breakpoint}-top and -bottom classes.
|
|
5
5
|
*
|
|
6
6
|
* Its families, and whatever it does on the canvas, as a function of the
|
|
7
|
-
* handle: grideditor.style.js puts them in its sections.
|
|
7
|
+
* handle: grideditor.inline-style.js puts them in its sections.
|
|
8
8
|
*/
|
|
9
9
|
import { GridEditor } from '../grideditor.js';
|
|
10
10
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Text alignment, a part of the style plugin: text alignment per breakpoint, with Bootstrap's text-{breakpoint}-start,
|
|
2
|
+
* Text alignment, a part of the inline-style plugin: text alignment per breakpoint, with Bootstrap's text-{breakpoint}-start,
|
|
3
3
|
* -center and -end classes.
|
|
4
4
|
*
|
|
5
5
|
* Its families, and whatever it does on the canvas, as a function of the
|
|
6
|
-
* handle: grideditor.style.js puts them in its sections.
|
|
6
|
+
* handle: grideditor.inline-style.js puts them in its sections.
|
|
7
7
|
*/
|
|
8
8
|
import { GridEditor } from '../grideditor.js';
|
|
9
9
|
|