@themarioga/grid-editor 8.0.0-beta.2 → 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 +39 -0
- package/README.md +16 -9
- package/UPGRADING.md +21 -11
- package/dist/grideditor.bundle.min.js +3 -3
- package/dist/grideditor.css +77 -35
- package/dist/grideditor.d.ts +29 -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 +86 -68
- package/dist/locales/grideditor.es.js +86 -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/dist/plugins/grideditor.tabs.esm.js +274 -6
- package/dist/plugins/grideditor.tabs.js +274 -6
- package/dist/plugins/grideditor.tabs.min.js +1 -1
- package/dist/plugins/grideditor.tabs.min.js.map +3 -3
- package/docs/locale-keys.md +97 -79
- package/docs/plugins.md +5 -5
- package/example/containers.html +64 -2
- 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 +86 -68
- package/src/js/plugins/grideditor.alignment.js +1 -1
- package/src/js/plugins/grideditor.inline-style.js +185 -0
- package/src/js/plugins/grideditor.tabs.js +311 -5
- package/src/less/grideditor.less +71 -25
- package/types/grideditor.d.ts +29 -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
|
@@ -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
|
|
|
@@ -56,6 +56,7 @@ GridEditor.locales.es = {
|
|
|
56
56
|
'panel.done': 'Hecho',
|
|
57
57
|
'panel.id': 'Id',
|
|
58
58
|
'panel.classes': 'Clases',
|
|
59
|
+
'panel.section_general': 'Id y clases',
|
|
59
60
|
'panel.editor': 'Editor',
|
|
60
61
|
'panel.kind_row': 'Fila',
|
|
61
62
|
'panel.kind_column': 'Columna',
|
|
@@ -74,6 +75,23 @@ GridEditor.locales.es = {
|
|
|
74
75
|
'container.add_tabs': 'Pestañas',
|
|
75
76
|
'container.add_tab': 'Añadir pestaña',
|
|
76
77
|
'container.tab_label': 'Pestaña {number}',
|
|
78
|
+
'container.tabs_section': 'Pestañas',
|
|
79
|
+
'container.tabs_style': 'Estilo',
|
|
80
|
+
'container.tabs_style_tabs': 'Pestañas',
|
|
81
|
+
'container.tabs_style_pills': 'Pills',
|
|
82
|
+
'container.tabs_style_underline': 'Subrayado',
|
|
83
|
+
'container.tabs_width': 'Ancho',
|
|
84
|
+
'container.tabs_width_natural': 'Natural',
|
|
85
|
+
'container.tabs_width_fill': 'Rellenar',
|
|
86
|
+
'container.tabs_width_justified': 'Justificado',
|
|
87
|
+
'container.tabs_align': 'Alineación',
|
|
88
|
+
'container.tabs_align_start': 'Inicio',
|
|
89
|
+
'container.tabs_align_center': 'Centro',
|
|
90
|
+
'container.tabs_align_end': 'Fin',
|
|
91
|
+
'container.tabs_layout': 'Disposición',
|
|
92
|
+
'container.tabs_layout_horizontal': 'Horizontal',
|
|
93
|
+
'container.tabs_layout_vertical': 'Vertical',
|
|
94
|
+
'container.tabs_layout_vertical_from': 'Vertical desde {breakpoint}',
|
|
77
95
|
'container.add_accordion': 'Acordeón',
|
|
78
96
|
'container.add_accordion_item': 'Añadir apartado',
|
|
79
97
|
'container.accordion_label': 'Apartado {number}',
|
|
@@ -169,74 +187,74 @@ GridEditor.locales.es = {
|
|
|
169
187
|
'utility.float_end': 'Fin',
|
|
170
188
|
'utility.float_none': 'Ninguno',
|
|
171
189
|
'utility.spacing_gutter': 'El relleno lateral de una columna es su espaciado: cambiarlo cambia el espacio entre columnas',
|
|
172
|
-
'
|
|
173
|
-
'
|
|
174
|
-
'
|
|
175
|
-
'
|
|
176
|
-
'
|
|
177
|
-
'
|
|
178
|
-
'
|
|
179
|
-
'
|
|
180
|
-
'
|
|
181
|
-
'
|
|
182
|
-
'
|
|
183
|
-
'
|
|
184
|
-
'
|
|
185
|
-
'
|
|
186
|
-
'
|
|
187
|
-
'
|
|
188
|
-
'
|
|
189
|
-
'
|
|
190
|
-
'
|
|
191
|
-
'
|
|
192
|
-
'
|
|
193
|
-
'
|
|
194
|
-
'
|
|
195
|
-
'
|
|
196
|
-
'
|
|
197
|
-
'
|
|
198
|
-
'
|
|
199
|
-
'
|
|
200
|
-
'
|
|
201
|
-
'
|
|
202
|
-
'
|
|
203
|
-
'
|
|
204
|
-
'
|
|
205
|
-
'
|
|
206
|
-
'
|
|
207
|
-
'
|
|
208
|
-
'
|
|
209
|
-
'
|
|
210
|
-
'
|
|
211
|
-
'
|
|
212
|
-
'
|
|
213
|
-
'
|
|
214
|
-
'
|
|
215
|
-
'
|
|
216
|
-
'
|
|
217
|
-
'
|
|
218
|
-
'
|
|
219
|
-
'
|
|
220
|
-
'
|
|
221
|
-
'
|
|
222
|
-
'
|
|
223
|
-
'
|
|
224
|
-
'
|
|
225
|
-
'
|
|
226
|
-
'
|
|
227
|
-
'
|
|
228
|
-
'
|
|
229
|
-
'
|
|
230
|
-
'
|
|
231
|
-
'
|
|
232
|
-
'
|
|
233
|
-
'
|
|
234
|
-
'
|
|
235
|
-
'
|
|
236
|
-
'
|
|
237
|
-
'
|
|
238
|
-
'
|
|
239
|
-
'
|
|
190
|
+
'inline_style.section_title': 'Estilo',
|
|
191
|
+
'inline_style.dialog_title': 'Estilo: {kind}',
|
|
192
|
+
'inline_style.section_size': 'Tamaño',
|
|
193
|
+
'inline_style.section_spacing': 'Espaciado',
|
|
194
|
+
'inline_style.section_border': 'Borde',
|
|
195
|
+
'inline_style.section_background': 'Fondo',
|
|
196
|
+
'inline_style.section_text': 'Texto',
|
|
197
|
+
'inline_style.section_typography': 'Tipografía',
|
|
198
|
+
'inline_style.section_display': 'Visualización',
|
|
199
|
+
'inline_style.section_flex': 'Flex',
|
|
200
|
+
'inline_style.section_position': 'Posición',
|
|
201
|
+
'inline_style.section_custom': 'CSS libre',
|
|
202
|
+
'inline_style.all_sizes': 'Se aplica a todos los tamaños',
|
|
203
|
+
'inline_style.overridden': 'La clase {class} tiene prioridad sobre este valor',
|
|
204
|
+
'inline_style.invalid': 'Esta propiedad no acepta ese valor',
|
|
205
|
+
'inline_style.catalog': 'Clases de Bootstrap',
|
|
206
|
+
'inline_style.shadow_x': 'X',
|
|
207
|
+
'inline_style.shadow_y': 'Y',
|
|
208
|
+
'inline_style.shadow_blur': 'Desenfoque',
|
|
209
|
+
'inline_style.shadow_spread': 'Extensión',
|
|
210
|
+
'inline_style.shadow_color': 'Color',
|
|
211
|
+
'inline_style.shadow_inset': 'Interior',
|
|
212
|
+
'inline_style.shadow_text_mode': 'Editar como texto',
|
|
213
|
+
'inline_style.prop_width': 'Ancho',
|
|
214
|
+
'inline_style.prop_height': 'Alto',
|
|
215
|
+
'inline_style.prop_min_width': 'Ancho mínimo',
|
|
216
|
+
'inline_style.prop_min_height': 'Alto mínimo',
|
|
217
|
+
'inline_style.prop_max_width': 'Ancho máximo',
|
|
218
|
+
'inline_style.prop_max_height': 'Alto máximo',
|
|
219
|
+
'inline_style.prop_margin_top': 'Margen superior',
|
|
220
|
+
'inline_style.prop_margin_right': 'Margen derecho',
|
|
221
|
+
'inline_style.prop_margin_bottom': 'Margen inferior',
|
|
222
|
+
'inline_style.prop_margin_left': 'Margen izquierdo',
|
|
223
|
+
'inline_style.prop_padding_top': 'Relleno superior',
|
|
224
|
+
'inline_style.prop_padding_right': 'Relleno derecho',
|
|
225
|
+
'inline_style.prop_padding_bottom': 'Relleno inferior',
|
|
226
|
+
'inline_style.prop_padding_left': 'Relleno izquierdo',
|
|
227
|
+
'inline_style.prop_border_width': 'Grosor del borde',
|
|
228
|
+
'inline_style.prop_border_style': 'Estilo del borde',
|
|
229
|
+
'inline_style.prop_border_color': 'Color del borde',
|
|
230
|
+
'inline_style.prop_border_radius': 'Radio del borde',
|
|
231
|
+
'inline_style.prop_box_shadow': 'Sombra',
|
|
232
|
+
'inline_style.prop_background_color': 'Color de fondo',
|
|
233
|
+
'inline_style.prop_background_image': 'Imagen de fondo',
|
|
234
|
+
'inline_style.prop_background_size': 'Tamaño del fondo',
|
|
235
|
+
'inline_style.prop_background_position': 'Posición del fondo',
|
|
236
|
+
'inline_style.prop_background_repeat': 'Repetición del fondo',
|
|
237
|
+
'inline_style.prop_color': 'Color',
|
|
238
|
+
'inline_style.prop_font_size': 'Tamaño de letra',
|
|
239
|
+
'inline_style.prop_text_align': 'Alineación',
|
|
240
|
+
'inline_style.prop_text_shadow': 'Sombra del texto',
|
|
241
|
+
'inline_style.prop_font_family': 'Fuente',
|
|
242
|
+
'inline_style.prop_font_weight': 'Grosor de letra',
|
|
243
|
+
'inline_style.prop_font_style': 'Estilo de letra',
|
|
244
|
+
'inline_style.prop_line_height': 'Interlineado',
|
|
245
|
+
'inline_style.prop_letter_spacing': 'Espaciado entre letras',
|
|
246
|
+
'inline_style.prop_text_transform': 'Mayúsculas',
|
|
247
|
+
'inline_style.prop_text_decoration': 'Decoración',
|
|
248
|
+
'inline_style.prop_display': 'Display',
|
|
249
|
+
'inline_style.prop_opacity': 'Opacidad',
|
|
250
|
+
'inline_style.prop_overflow': 'Desbordamiento',
|
|
251
|
+
'inline_style.prop_visibility': 'Visibilidad',
|
|
252
|
+
'inline_style.prop_position': 'Posición',
|
|
253
|
+
'inline_style.prop_top': 'Arriba',
|
|
254
|
+
'inline_style.prop_right': 'Derecha',
|
|
255
|
+
'inline_style.prop_bottom': 'Abajo',
|
|
256
|
+
'inline_style.prop_left': 'Izquierda',
|
|
257
|
+
'inline_style.prop_z_index': 'Z-index',
|
|
240
258
|
'error.sortable_missing': '¡SortableJS no está disponible! Asegúrate de haber cargado el archivo js de Sortable; sin él no se puede arrastrar.',
|
|
241
259
|
'warning.already_editing': 'Este elemento ya tiene un editor: se devuelve ese, con las opciones con las que se creó.',
|
|
242
260
|
'warning.destroyed': 'Se ha llamado a {method}() en un editor destruido, y no hace nada.',
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* <script src="dist/plugins/grideditor.alignment.min.js"></script>
|
|
11
11
|
*
|
|
12
12
|
* How a row justifies and aligns its columns - justify-content-* and
|
|
13
|
-
* align-items-* - is a flex container's, and the style plugin's Flex section
|
|
13
|
+
* align-items-* - is a flex container's, and the inline-style plugin's Flex section
|
|
14
14
|
* edits it, on a row and on anything else made flex.
|
|
15
15
|
*
|
|
16
16
|
* A field only, in the settings panel: alignment is set now and then, not
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inline style for grid-editor.
|
|
3
|
+
*
|
|
4
|
+
* A utility plugin: load this file after the editor and every row, column,
|
|
5
|
+
* container, pane, element and section gets a Style accordion in its
|
|
6
|
+
* settings panel - size, spacing, border, background, text, typography,
|
|
7
|
+
* display, flex, position and free css - written to the node's own style
|
|
8
|
+
* attribute, with Bootstrap's classes for each section as chips that put
|
|
9
|
+
* them in the classes field. What it can ask the editor for is the handle
|
|
10
|
+
* its factory is called with, described in docs/plugins.md.
|
|
11
|
+
*
|
|
12
|
+
* <script src="dist/grideditor.min.js"></script>
|
|
13
|
+
* <script src="dist/plugins/grideditor.inline-style.min.js"></script>
|
|
14
|
+
*
|
|
15
|
+
* It also edits spacing, text alignment, display, flex, sticky and float,
|
|
16
|
+
* Bootstrap's responsive classes, per breakpoint in its sections. On a node
|
|
17
|
+
* that is flex or grid, the drawer leaves the flow, so the canvas lays the
|
|
18
|
+
* content out as the page will.
|
|
19
|
+
*
|
|
20
|
+
* Where the settings panel has no room for it - a popover, inline in the
|
|
21
|
+
* drawer - the accordion opens in a dialog, from a Style button.
|
|
22
|
+
*
|
|
23
|
+
* inline_style.sections chooses the sections, and in each the properties and
|
|
24
|
+
* whether it has a catalog; inline_style.spacing is the options of spacing, whose
|
|
25
|
+
* scale the gaps share, and inline_style.visibility those of the eye.
|
|
26
|
+
*/
|
|
27
|
+
import { GridEditor } from '../grideditor.js';
|
|
28
|
+
import { spacingPart } from '../inline-style/spacing.js';
|
|
29
|
+
import { textalignPart } from '../inline-style/textalign.js';
|
|
30
|
+
import { displayPart } from '../inline-style/display.js';
|
|
31
|
+
import { flexPart } from '../inline-style/flex.js';
|
|
32
|
+
import { floatPart } from '../inline-style/float.js';
|
|
33
|
+
import { stickyPart } from '../inline-style/sticky.js';
|
|
34
|
+
import { drawerflowPart } from '../inline-style/drawerflow.js';
|
|
35
|
+
import { resolveOptions } from '../inline-style/options.js';
|
|
36
|
+
import { createAccordion } from '../inline-style/accordion.js';
|
|
37
|
+
|
|
38
|
+
Object.assign(GridEditor.locales.en, {
|
|
39
|
+
'inline_style.section_title': 'Style',
|
|
40
|
+
'inline_style.dialog_title': 'Style: {kind}',
|
|
41
|
+
'inline_style.section_size': 'Size',
|
|
42
|
+
'inline_style.section_spacing': 'Spacing',
|
|
43
|
+
'inline_style.section_border': 'Border',
|
|
44
|
+
'inline_style.section_background': 'Background',
|
|
45
|
+
'inline_style.section_text': 'Text',
|
|
46
|
+
'inline_style.section_typography': 'Typography',
|
|
47
|
+
'inline_style.section_display': 'Display',
|
|
48
|
+
'inline_style.section_flex': 'Flex',
|
|
49
|
+
'inline_style.section_position': 'Position',
|
|
50
|
+
'inline_style.section_custom': 'Custom css',
|
|
51
|
+
'inline_style.all_sizes': 'Applies to every size',
|
|
52
|
+
'inline_style.overridden': 'The class {class} takes priority over this value',
|
|
53
|
+
'inline_style.invalid': 'Not a value this property takes',
|
|
54
|
+
'inline_style.catalog': 'Bootstrap classes',
|
|
55
|
+
'inline_style.shadow_x': 'X',
|
|
56
|
+
'inline_style.shadow_y': 'Y',
|
|
57
|
+
'inline_style.shadow_blur': 'Blur',
|
|
58
|
+
'inline_style.shadow_spread': 'Spread',
|
|
59
|
+
'inline_style.shadow_color': 'Color',
|
|
60
|
+
'inline_style.shadow_inset': 'Inset',
|
|
61
|
+
'inline_style.shadow_text_mode': 'Edit as text',
|
|
62
|
+
'inline_style.prop_width': 'Width',
|
|
63
|
+
'inline_style.prop_height': 'Height',
|
|
64
|
+
'inline_style.prop_min_width': 'Min width',
|
|
65
|
+
'inline_style.prop_min_height': 'Min height',
|
|
66
|
+
'inline_style.prop_max_width': 'Max width',
|
|
67
|
+
'inline_style.prop_max_height': 'Max height',
|
|
68
|
+
'inline_style.prop_margin_top': 'Margin top',
|
|
69
|
+
'inline_style.prop_margin_right': 'Margin right',
|
|
70
|
+
'inline_style.prop_margin_bottom': 'Margin bottom',
|
|
71
|
+
'inline_style.prop_margin_left': 'Margin left',
|
|
72
|
+
'inline_style.prop_padding_top': 'Padding top',
|
|
73
|
+
'inline_style.prop_padding_right': 'Padding right',
|
|
74
|
+
'inline_style.prop_padding_bottom': 'Padding bottom',
|
|
75
|
+
'inline_style.prop_padding_left': 'Padding left',
|
|
76
|
+
'inline_style.prop_border_width': 'Border width',
|
|
77
|
+
'inline_style.prop_border_style': 'Border style',
|
|
78
|
+
'inline_style.prop_border_color': 'Border color',
|
|
79
|
+
'inline_style.prop_border_radius': 'Border radius',
|
|
80
|
+
'inline_style.prop_box_shadow': 'Shadow',
|
|
81
|
+
'inline_style.prop_background_color': 'Background color',
|
|
82
|
+
'inline_style.prop_background_image': 'Background image',
|
|
83
|
+
'inline_style.prop_background_size': 'Background size',
|
|
84
|
+
'inline_style.prop_background_position': 'Background position',
|
|
85
|
+
'inline_style.prop_background_repeat': 'Background repeat',
|
|
86
|
+
'inline_style.prop_color': 'Color',
|
|
87
|
+
'inline_style.prop_font_size': 'Font size',
|
|
88
|
+
'inline_style.prop_text_align': 'Text align',
|
|
89
|
+
'inline_style.prop_text_shadow': 'Text shadow',
|
|
90
|
+
'inline_style.prop_font_family': 'Font family',
|
|
91
|
+
'inline_style.prop_font_weight': 'Font weight',
|
|
92
|
+
'inline_style.prop_font_style': 'Font style',
|
|
93
|
+
'inline_style.prop_line_height': 'Line height',
|
|
94
|
+
'inline_style.prop_letter_spacing': 'Letter spacing',
|
|
95
|
+
'inline_style.prop_text_transform': 'Text transform',
|
|
96
|
+
'inline_style.prop_text_decoration': 'Text decoration',
|
|
97
|
+
'inline_style.prop_display': 'Display',
|
|
98
|
+
'inline_style.prop_opacity': 'Opacity',
|
|
99
|
+
'inline_style.prop_overflow': 'Overflow',
|
|
100
|
+
'inline_style.prop_visibility': 'Visibility',
|
|
101
|
+
'inline_style.prop_position': 'Position',
|
|
102
|
+
'inline_style.prop_top': 'Top',
|
|
103
|
+
'inline_style.prop_right': 'Right',
|
|
104
|
+
'inline_style.prop_bottom': 'Bottom',
|
|
105
|
+
'inline_style.prop_left': 'Left',
|
|
106
|
+
'inline_style.prop_z_index': 'Z-index',
|
|
107
|
+
});
|
|
108
|
+
|
|
109
|
+
// The drawer's part last: it asks the browser how the others left the node
|
|
110
|
+
var PARTS = ['spacing', 'textalign', 'display', 'flex', 'float', 'sticky', 'drawerflow'];
|
|
111
|
+
|
|
112
|
+
GridEditor.utilities['inline-style'] = function(ge) {
|
|
113
|
+
|
|
114
|
+
var options = resolveOptions(ge);
|
|
115
|
+
var parts = {
|
|
116
|
+
spacing: spacingPart(ge, options.spacing),
|
|
117
|
+
textalign: textalignPart(ge),
|
|
118
|
+
display: displayPart(ge, options.visibility),
|
|
119
|
+
flex: flexPart(ge, options.spacing),
|
|
120
|
+
float: floatPart(ge),
|
|
121
|
+
sticky: stickyPart(ge),
|
|
122
|
+
drawerflow: drawerflowPart(ge),
|
|
123
|
+
};
|
|
124
|
+
var accordions = []; // { node, accordion } for every panel built since the last init
|
|
125
|
+
var context = {
|
|
126
|
+
sections: options.sections,
|
|
127
|
+
parts: parts,
|
|
128
|
+
state: { open: null },
|
|
129
|
+
opened: function(key) {
|
|
130
|
+
accordions.forEach(function(entry) { entry.accordion.open(key); });
|
|
131
|
+
},
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/** Every part's hook, called in turn. */
|
|
135
|
+
function each(hook) {
|
|
136
|
+
return function() {
|
|
137
|
+
var args = arguments;
|
|
138
|
+
PARTS.forEach(function(name) {
|
|
139
|
+
if (parts[name][hook]) { parts[name][hook].apply(null, args); }
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
var partsRefresh = each('onRefresh');
|
|
145
|
+
|
|
146
|
+
return {
|
|
147
|
+
// The parts' families, edited in the sections rather than in Responsive
|
|
148
|
+
families: PARTS.reduce(function(all, name) {
|
|
149
|
+
return all.concat(parts[name].families.map(function(family) {
|
|
150
|
+
return Object.assign({}, family, { panel: false });
|
|
151
|
+
}));
|
|
152
|
+
}, []),
|
|
153
|
+
|
|
154
|
+
panelSection: function(node, kind) {
|
|
155
|
+
var accordion = createAccordion(ge, node, kind, context);
|
|
156
|
+
if (!accordion) { return null; }
|
|
157
|
+
|
|
158
|
+
accordions.push({ node: node, accordion: accordion });
|
|
159
|
+
|
|
160
|
+
return { labelKey: 'inline_style.section_title', titleKey: 'inline_style.dialog_title', body: accordion.element };
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
preview: function(node, kind, breakpoint) {
|
|
164
|
+
return parts.spacing.preview(node, kind, breakpoint);
|
|
165
|
+
},
|
|
166
|
+
|
|
167
|
+
// After a write, a change of classes or of view: the accordions of
|
|
168
|
+
// the nodes it touched follow
|
|
169
|
+
onRefresh: function(scope) {
|
|
170
|
+
partsRefresh(scope);
|
|
171
|
+
|
|
172
|
+
accordions = accordions.filter(function(entry) { return entry.accordion.element.isConnected; });
|
|
173
|
+
accordions.forEach(function(entry) {
|
|
174
|
+
if (entry.node === scope || scope.contains(entry.node)) { entry.accordion.render(); }
|
|
175
|
+
});
|
|
176
|
+
},
|
|
177
|
+
|
|
178
|
+
drawerTools: each('drawerTools'),
|
|
179
|
+
|
|
180
|
+
onDeinit: function() {
|
|
181
|
+
each('onDeinit')();
|
|
182
|
+
accordions = [];
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
};
|