@themarioga/grid-editor 7.3.0 → 8.0.0-beta.2

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.
Files changed (98) hide show
  1. package/CHANGELOG.md +60 -0
  2. package/README.md +27 -30
  3. package/UPGRADING.md +55 -0
  4. package/dist/grideditor.bundle.min.js +3 -3
  5. package/dist/grideditor.css +47 -6
  6. package/dist/grideditor.d.ts +3 -3
  7. package/dist/grideditor.esm.js +7 -58
  8. package/dist/grideditor.jquery.js +0 -13
  9. package/dist/grideditor.jquery.min.js +1 -1
  10. package/dist/grideditor.jquery.min.js.map +3 -3
  11. package/dist/grideditor.js +7 -58
  12. package/dist/grideditor.min.css +1 -1
  13. package/dist/grideditor.min.css.map +1 -1
  14. package/dist/grideditor.min.js +2 -2
  15. package/dist/grideditor.min.js.map +3 -3
  16. package/dist/locales/grideditor.es.esm.js +13 -6
  17. package/dist/locales/grideditor.es.js +13 -6
  18. package/dist/locales/grideditor.es.min.js +1 -1
  19. package/dist/locales/grideditor.es.min.js.map +2 -2
  20. package/dist/plugins/grideditor.accordion.min.js.map +2 -2
  21. package/dist/plugins/grideditor.alignment.esm.js +11 -38
  22. package/dist/plugins/grideditor.alignment.js +11 -38
  23. package/dist/plugins/grideditor.alignment.min.js +1 -1
  24. package/dist/plugins/grideditor.alignment.min.js.map +3 -3
  25. package/dist/plugins/grideditor.card.min.js.map +1 -1
  26. package/dist/plugins/grideditor.ckeditor.esm.js +0 -5
  27. package/dist/plugins/grideditor.ckeditor.js +0 -5
  28. package/dist/plugins/grideditor.ckeditor.min.js +1 -1
  29. package/dist/plugins/grideditor.ckeditor.min.js.map +3 -3
  30. package/dist/plugins/grideditor.clipboard.min.js.map +1 -1
  31. package/dist/plugins/grideditor.codemirror-inline.min.js.map +1 -1
  32. package/dist/plugins/grideditor.codemirror.min.js.map +1 -1
  33. package/dist/plugins/grideditor.elements.min.js.map +2 -2
  34. package/dist/plugins/grideditor.gutters.min.js.map +1 -1
  35. package/dist/plugins/grideditor.order.min.js.map +1 -1
  36. package/dist/plugins/grideditor.popup.min.js.map +1 -1
  37. package/dist/plugins/grideditor.sections.min.js.map +2 -2
  38. package/dist/plugins/grideditor.style.esm.js +393 -60
  39. package/dist/plugins/grideditor.style.js +387 -56
  40. package/dist/plugins/grideditor.style.min.js +4 -2
  41. package/dist/plugins/grideditor.style.min.js.map +4 -4
  42. package/dist/plugins/grideditor.summernote.min.js.map +2 -2
  43. package/dist/plugins/grideditor.tabs.min.js.map +2 -2
  44. package/dist/plugins/grideditor.tinymce.esm.js +1 -8
  45. package/dist/plugins/grideditor.tinymce.js +1 -8
  46. package/dist/plugins/grideditor.tinymce.min.js +1 -1
  47. package/dist/plugins/grideditor.tinymce.min.js.map +3 -3
  48. package/docs/events.md +4 -6
  49. package/docs/locale-keys.md +18 -13
  50. package/docs/plugins.md +15 -35
  51. package/example/ckeditor.html +0 -5
  52. package/example/index.html +5 -4
  53. package/example/style.html +16 -4
  54. package/example/utilities.html +12 -11
  55. package/package.json +1 -1
  56. package/src/js/dom.js +1 -2
  57. package/src/js/grideditor.jquery.js +7 -28
  58. package/src/js/grideditor.js +12 -81
  59. package/src/js/locales/grideditor.es.js +13 -6
  60. package/src/js/plugins/grideditor.alignment.js +21 -50
  61. package/src/js/plugins/grideditor.ckeditor.js +10 -23
  62. package/src/js/plugins/grideditor.style.js +18 -12
  63. package/src/js/plugins/grideditor.summernote.js +4 -5
  64. package/src/js/plugins/grideditor.tinymce.js +4 -17
  65. package/src/js/style/accordion.js +14 -3
  66. package/src/js/style/display.js +229 -0
  67. package/src/js/style/drawerflow.js +118 -0
  68. package/src/js/style/flex.js +156 -0
  69. package/src/js/style/float.js +2 -4
  70. package/src/js/style/options.js +5 -20
  71. package/src/js/style/sections.js +42 -15
  72. package/src/js/style/spacing.js +2 -4
  73. package/src/js/style/sticky.js +39 -0
  74. package/src/js/style/textalign.js +2 -4
  75. package/src/js/text/grideditor.text.js +1 -1
  76. package/src/less/grideditor.less +40 -10
  77. package/types/grideditor.d.ts +3 -3
  78. package/dist/plugins/grideditor.float.esm.js +0 -43
  79. package/dist/plugins/grideditor.float.js +0 -47
  80. package/dist/plugins/grideditor.float.min.js +0 -1
  81. package/dist/plugins/grideditor.float.min.js.map +0 -7
  82. package/dist/plugins/grideditor.spacing.esm.js +0 -327
  83. package/dist/plugins/grideditor.spacing.js +0 -329
  84. package/dist/plugins/grideditor.spacing.min.js +0 -1
  85. package/dist/plugins/grideditor.spacing.min.js.map +0 -7
  86. package/dist/plugins/grideditor.textalign.esm.js +0 -49
  87. package/dist/plugins/grideditor.textalign.js +0 -53
  88. package/dist/plugins/grideditor.textalign.min.js +0 -1
  89. package/dist/plugins/grideditor.textalign.min.js.map +0 -7
  90. package/dist/plugins/grideditor.visibility.esm.js +0 -167
  91. package/dist/plugins/grideditor.visibility.js +0 -169
  92. package/dist/plugins/grideditor.visibility.min.js +0 -1
  93. package/dist/plugins/grideditor.visibility.min.js.map +0 -7
  94. package/src/js/plugins/grideditor.float.js +0 -29
  95. package/src/js/plugins/grideditor.spacing.js +0 -31
  96. package/src/js/plugins/grideditor.textalign.js +0 -27
  97. package/src/js/plugins/grideditor.visibility.js +0 -32
  98. package/src/js/style/visibility.js +0 -160
package/src/js/dom.js CHANGED
@@ -314,8 +314,7 @@ export function fire(node, type) {
314
314
  /* ------------------------------------------------------------------
315
315
  * Taking a node away, visibly.
316
316
  *
317
- * The durations are the ones 6.x had through jQuery: 400 ms unless the
318
- * caller says otherwise. `done` runs once the node is out of sight, which is
317
+ * The durations are jQuery's: 400 ms unless the caller says otherwise. `done` runs once the node is out of sight, which is
319
318
  * when the caller removes it; a node that is already out of sight is done at
320
319
  * once, on the next task, as jQuery had it.
321
320
  * ------------------------------------------------------------------ */
@@ -1,20 +1,18 @@
1
1
  /**
2
- * The jQuery API of grid-editor 6, on top of the 7.0 editor.
2
+ * The jQuery API of grid-editor 6, on top of the plain DOM editor.
3
3
  *
4
- * grid-editor is plain DOM since 7.0. A page written for 6.x - one that
5
- * calls $(el).gridEditor(...), listens with $(el).on('grideditor:...') and
6
- * reads jQuery objects out of the payloads - loads jQuery 4 and this file
7
- * after grideditor.js, and runs unchanged:
4
+ * A page written for 6.x - one that calls $(el).gridEditor(...), listens
5
+ * with $(el).on('grideditor:...') and reads jQuery objects out of the
6
+ * payloads - loads jQuery 4 and this file after grideditor.js, and runs
7
+ * unchanged:
8
8
  *
9
9
  * <script src="jquery.min.js"></script>
10
10
  * <script src="dist/grideditor.min.js"></script>
11
11
  * <script src="dist/grideditor.jquery.min.js"></script>
12
12
  * <script src="dist/plugins/grideditor.tabs.min.js"></script>
13
13
  *
14
- * What it keeps is the host's side of 6.x. Plugins are not: a plugin
15
- * written for 6.x registered on $.fn.gridEditor.containers, .features,
16
- * .utilities or .texts, and is warned about and left out, since the plugin
17
- * contract hands out elements now. UPGRADING.md says how to port one.
14
+ * What it keeps is the host's side of 6.x. Plugins are not: they register
15
+ * on GridEditor, and the plugin contract hands out elements.
18
16
  *
19
17
  * Every value 6.x gave host code as a jQuery object is one again: the event
20
18
  * payloads and the callbacks' arguments, what the create* methods return,
@@ -250,15 +248,6 @@ function install() {
250
248
  };
251
249
  });
252
250
 
253
- /** Plugins registered the 6.x way: said once each, and never called. */
254
- function warnAboutLegacyPlugins() {
255
- ['containers', 'features', 'utilities', 'texts'].forEach(function(registry) {
256
- Object.keys(legacy[registry]).forEach(function(name) {
257
- warnOnce('plugin-6x:' + registry + ':' + name, english('warning.plugin_6x', { name: name }));
258
- });
259
- });
260
- }
261
-
262
251
  function dispatchMethod(set, name, args) {
263
252
  var descriptor = METHODS[name];
264
253
 
@@ -300,8 +289,6 @@ function install() {
300
289
  return dispatchMethod(this, optionsOrMethod, Array.prototype.slice.call(arguments, 1));
301
290
  }
302
291
 
303
- warnAboutLegacyPlugins();
304
-
305
292
  var options = adaptOptions(optionsOrMethod);
306
293
 
307
294
  this.each(function() {
@@ -311,14 +298,6 @@ function install() {
311
298
  return this;
312
299
  };
313
300
 
314
- // Where a 6.x plugin registers. Kept, so one does not throw as it
315
- // loads, and read only to say it is not used.
316
- var legacy = { containers: {}, features: {}, utilities: {}, texts: {} };
317
- $.fn.gridEditor.containers = legacy.containers;
318
- $.fn.gridEditor.features = legacy.features;
319
- $.fn.gridEditor.utilities = legacy.utilities;
320
- $.fn.gridEditor.texts = legacy.texts;
321
-
322
301
  // Strings are the same thing in both: a 6.x locale file loads unchanged
323
302
  $.fn.gridEditor.locales = GridEditor.locales;
324
303
  $.fn.gridEditor.t = GridEditor.t;
@@ -4,9 +4,8 @@
4
4
  * A fork of https://github.com/Friendly-Pixel/grid-editor by Simon Epskamp,
5
5
  * maintained at https://github.com/themarioga/grid-editor.
6
6
  *
7
- * Plain DOM since 7.0: nothing here needs jQuery. A page written for the 6.x
8
- * jQuery API loads grideditor.jquery.js beside this file and keeps working;
9
- * see UPGRADING.md.
7
+ * Plain DOM: nothing here needs jQuery. A page written against the jQuery
8
+ * API loads grideditor.jquery.js beside this file.
10
9
  */
11
10
  import * as dom from './dom.js';
12
11
 
@@ -73,8 +72,6 @@ var ALL_VIEW_LABEL_KEY = 'view.all';
73
72
  /** Every view key the dropdown can offer, in the order it offers them. */
74
73
  var VIEW_KEYS = [ALL_VIEW].concat(BREAKPOINTS.map(function(tier) { return tier.key; }));
75
74
 
76
- /** What the three layout mode indexes of 2.x meant. */
77
- var LEGACY_VIEW_INDEXES = ['lg', 'sm', 'xs'];
78
75
 
79
76
  var MAX_COL_SIZE = 12;
80
77
  var MAX_COL_OFFSET = 11;
@@ -158,12 +155,6 @@ var NESTED_SETTINGS = {
158
155
  },
159
156
  };
160
157
 
161
- /** Settings 4.0 took away, and what a host should reach for instead. */
162
- var REMOVED_SETTINGS = {
163
- sortable_options: 'drag',
164
- resizable_options: 'resize',
165
- };
166
-
167
158
  var warned = {};
168
159
 
169
160
  /** Editors on the page, counted so each one's sortable groups are its own. */
@@ -372,7 +363,7 @@ function build(instance, baseElem, optionsOrMethod) {
372
363
  'element_tools' : [], // Host tools on element drawers, same shape as row_tools
373
364
  'element_classes' : [], // Preset class toggles on an element's settings panel
374
365
  // content_types, text_tools and text_classes are the text editor
375
- // plugins' settings since 6.0: see grideditor.text.js
366
+ // plugins' settings: see grideditor.text.js
376
367
  'container_classes' : [], // The same, on a container's panel
377
368
  'pane_classes' : [], // And on a tab's or an accordion item's
378
369
  'container_tools' : [], // Host tools on container drawers
@@ -405,18 +396,6 @@ function build(instance, baseElem, optionsOrMethod) {
405
396
  settings[name] = Object.assign({}, NESTED_SETTINGS[name], settings[name]);
406
397
  });
407
398
 
408
- // Both handed out the drag toolkit's own options, which 4.0 stops
409
- // promising: there is no widget underneath a host should be reaching
410
- // for. What they were used for is a setting of the editor's now.
411
- Object.keys(REMOVED_SETTINGS).forEach(function(name) {
412
- if (optionsOrMethod && optionsOrMethod[name] !== undefined) {
413
- warn(translate(settings, 'warning.setting_removed', {
414
- setting: name,
415
- replacement: REMOVED_SETTINGS[name],
416
- }));
417
- }
418
- });
419
-
420
399
 
421
400
  // Elems
422
401
  var canvas,
@@ -432,7 +411,7 @@ function build(instance, baseElem, optionsOrMethod) {
432
411
  var sizePicker = null; // The open column size picker, if there is one
433
412
  var sourceOpen = false; // Whether the canvas is being edited as html
434
413
  var dropMarker = null; // The line showing where a dragged toolbar button would land
435
- var warnedHere = {}; // Deprecations are worth saying once per instance, not once per call
414
+ var warnedHere = {}; // Some warnings are worth saying once per instance, not once per call
436
415
  var sortables = []; // Every list made sortable, so deinit destroys exactly those
437
416
  var instanceId = ++editorCounter; // Scopes the sortable groups to this editor
438
417
  var destroyed = false;
@@ -1866,35 +1845,8 @@ function build(instance, baseElem, optionsOrMethod) {
1866
1845
 
1867
1846
  registerFamily('grid', {}, widthFamily());
1868
1847
  if (settings.row_cols !== false) { registerFamily('grid', {}, rowColsFamily()); }
1869
- // A plugin whose factory says it `replaces` others has taken
1870
- // their place: an old name in the plugins setting asks for it,
1871
- // and the old plugin, loaded beside it, stands down
1872
- var replacedBy = {};
1873
- [GridEditor.containers, GridEditor.features, GridEditor.utilities].forEach(function(registry) {
1874
- Object.keys(registry).forEach(function(name) {
1875
- (registry[name].replaces || []).forEach(function(old) {
1876
- if (!replacedBy[old]) { replacedBy[old] = name; }
1877
- });
1878
- });
1879
- });
1880
- var named = function(name) {
1881
- return !settings.plugins || settings.plugins.indexOf(name) !== -1;
1882
- };
1883
- var namedAsOld = function(name) {
1884
- return !!settings.plugins && settings.plugins.some(function(old) { return replacedBy[old] === name; });
1885
- };
1886
- var standsDown = function(name) {
1887
- return !!replacedBy[name] && wanted(replacedBy[name]);
1888
- };
1889
1848
  var wanted = function(name) {
1890
- return !standsDown(name) && (named(name) || namedAsOld(name));
1891
- };
1892
- var replaced = function(name) {
1893
- if (!standsDown(name) || !named(name)) { return false; }
1894
-
1895
- warnOnceHere('replaced:' + name, 'the "' + name + '" plugin is part of "' + replacedBy[name] +
1896
- '", which is loaded: ignoring it');
1897
- return true;
1849
+ return !settings.plugins || settings.plugins.indexOf(name) !== -1;
1898
1850
  };
1899
1851
 
1900
1852
  // What the plugins setting does not choose: the text editors,
@@ -1905,16 +1857,16 @@ function build(instance, baseElem, optionsOrMethod) {
1905
1857
  };
1906
1858
 
1907
1859
  Object.keys(GridEditor.containers).forEach(function(type) {
1908
- if (!replaced(type) && wanted(type)) { CONTAINERS[type] = GridEditor.containers[type](api); }
1860
+ if (wanted(type)) { CONTAINERS[type] = GridEditor.containers[type](api); }
1909
1861
  });
1910
1862
 
1911
1863
  Object.keys(GridEditor.features).forEach(function(name) {
1912
1864
  var factory = GridEditor.features[name];
1913
- if (!replaced(name) && featureWanted(name, factory)) { FEATURES[name] = factory(api); }
1865
+ if (featureWanted(name, factory)) { FEATURES[name] = factory(api); }
1914
1866
  });
1915
1867
 
1916
1868
  Object.keys(GridEditor.utilities).forEach(function(name) {
1917
- if (replaced(name) || !wanted(name)) { return; }
1869
+ if (!wanted(name)) { return; }
1918
1870
 
1919
1871
  UTILITIES[name] = GridEditor.utilities[name](api);
1920
1872
  (UTILITIES[name].families || []).forEach(function(family) {
@@ -1932,12 +1884,6 @@ function build(instance, baseElem, optionsOrMethod) {
1932
1884
  (settings.plugins || []).forEach(function(name) {
1933
1885
  if (CONTAINERS[name] || FEATURES[name] || UTILITIES[name]) { return; }
1934
1886
 
1935
- if (standsDown(name)) {
1936
- warnOnceHere('renamed:' + name, 'the "' + name + '" plugin is part of "' + replacedBy[name] +
1937
- '" now: name "' + replacedBy[name] + '" in the plugins setting instead');
1938
- return;
1939
- }
1940
-
1941
1887
  warnOnceHere('plugin:' + name, 'the "' + name + '" plugin is not loaded: ' +
1942
1888
  'include dist/plugins/grideditor.' + name + '.js after the editor');
1943
1889
  });
@@ -3295,8 +3241,7 @@ function build(instance, baseElem, optionsOrMethod) {
3295
3241
  refreshUtilities(container);
3296
3242
  });
3297
3243
 
3298
- // Bootstrap 5's outline buttons, filled while their class is on;
3299
- // up to 5.x they carried Bootstrap 3's btn-default, which 5 lacks
3244
+ // Bootstrap's outline buttons, filled while their class is on
3300
3245
  var classGroup = general.appendChild(dom.element('div', { 'class': 'btn-group btn-group-sm ge-presets', role: 'group' }));
3301
3246
  cssClasses.forEach(function(rowClass) {
3302
3247
  var on = dom.hasClass(container, rowClass.cssClass);
@@ -3307,7 +3252,7 @@ function build(instance, baseElem, optionsOrMethod) {
3307
3252
  'aria-pressed': on ? 'true' : 'false',
3308
3253
  });
3309
3254
 
3310
- // A preset's label is the host's markup, as it was in 6.x
3255
+ // A preset's label is the host's markup
3311
3256
  btn.innerHTML = rowClass.label;
3312
3257
  dom.toggleClass(btn, 'active', on);
3313
3258
  btn.addEventListener('click', function() {
@@ -5139,20 +5084,8 @@ function build(instance, baseElem, optionsOrMethod) {
5139
5084
  dom.one(layoutDropdown, 'button').textContent = t(labelKeyFor(view));
5140
5085
  }
5141
5086
 
5142
- /**
5143
- * The view key a caller asked for, or null. 2.x callers passed a
5144
- * layout mode index, which still works and says so once.
5145
- */
5087
+ /** The view key a caller asked for, or null. */
5146
5088
  function viewKey(view) {
5147
- if (typeof view == 'number') {
5148
- warnOnceHere('changeView-index', 'changeView(' + view + '): layout modes are ' +
5149
- 'identified by breakpoint key now, so pass one of ' +
5150
- JSON.stringify(VIEW_KEYS) + '. Numeric indexes still work, ' +
5151
- 'but they mean what they meant in 2.x (' +
5152
- LEGACY_VIEW_INDEXES.join(', ') + ') and will be dropped.');
5153
- return LEGACY_VIEW_INDEXES[view] || null;
5154
- }
5155
-
5156
5089
  return VIEW_KEYS.indexOf(view) === -1 ? null : view;
5157
5090
  }
5158
5091
 
@@ -5409,14 +5342,12 @@ GridEditor.locales = {
5409
5342
  'utility.inherit': 'Inherit: {value} (from {breakpoint})',
5410
5343
  'utility.varies': 'Changes at {breakpoints}; choosing here replaces that',
5411
5344
  'error.sortable_missing': 'SortableJS not available! Make sure you loaded the Sortable js file; dragging is off without it.',
5412
- 'warning.setting_removed': 'The {setting} setting was removed in 4.0. Use {replacement} instead.',
5413
5345
  'warning.already_editing': 'This element already has an editor: that one is handed back, with the options it was made with.',
5414
5346
  'warning.destroyed': '{method}() was called on an editor that has been destroyed, and does nothing.',
5415
5347
  'warning.duplicate_build': 'grideditor.js was loaded twice: the first GridEditor is kept.',
5416
- 'warning.plugin_6x': 'The "{name}" plugin is written for grid-editor 6 and is not loaded. Plugins register on GridEditor since 7.0: see UPGRADING.md.',
5417
5348
  'warning.adapter_no_jquery': 'grideditor.jquery.js needs jQuery 4, and there is no jQuery on the page: the jQuery API is not there.',
5418
5349
  'error.tinymce_missing': 'tinyMCE not available! Make sure you loaded the tinyMCE js file.',
5419
- 'error.ckeditor_missing': 'CKEditor 5 not available! Make sure you loaded its ckeditor5.umd.js file: CKEditor 4 is no longer supported.',
5350
+ 'error.ckeditor_missing': 'CKEditor 5 not available! Make sure you loaded its ckeditor5.umd.js file.',
5420
5351
  'error.summernote_missing': 'Summernote not available! Make sure you loaded jQuery and the Summernote js file.',
5421
5352
  },
5422
5353
  };
@@ -124,9 +124,8 @@ GridEditor.locales.es = {
124
124
  'utility.default': 'Por defecto',
125
125
  'utility.inherit': 'Hereda: {value} (de {breakpoint})',
126
126
  'utility.varies': 'Cambia en {breakpoints}; elegir aquí lo sustituye',
127
- 'utility.visibility': 'Visibilidad',
127
+ 'utility.display': 'Display',
128
128
  'utility.visibility_hidden': 'Oculto',
129
- 'utility.visibility_shown': 'Visible',
130
129
  'tool.hide_in_view': 'Ocultar en esta vista',
131
130
  'tool.show_in_view': 'Mostrar en esta vista',
132
131
  'badge.hidden_in': 'Oculto en {breakpoints}',
@@ -138,6 +137,16 @@ GridEditor.locales.es = {
138
137
  'badge.order': 'Orden: {value}',
139
138
  'utility.justify_content': 'Justificar columnas',
140
139
  'utility.align_items': 'Alinear columnas',
140
+ 'utility.align_content': 'Alinear líneas',
141
+ 'utility.flex_direction': 'Dirección',
142
+ 'utility.flex_wrap': 'Salto de línea',
143
+ 'utility.gap': 'Separación',
144
+ 'utility.row_gap': 'Separación entre filas',
145
+ 'utility.column_gap': 'Separación entre columnas',
146
+ 'utility.flex_fill': 'Rellenar',
147
+ 'utility.flex_grow': 'Crecer',
148
+ 'utility.flex_shrink': 'Encoger',
149
+ 'utility.sticky': 'Fijo al desplazar',
141
150
  'utility.align_self': 'Alinearse',
142
151
  'utility.gutters': 'Espaciado entre columnas',
143
152
  'utility.gutters_x': 'Espaciado horizontal',
@@ -169,6 +178,7 @@ GridEditor.locales.es = {
169
178
  'style.section_text': 'Texto',
170
179
  'style.section_typography': 'Tipografía',
171
180
  'style.section_display': 'Visualización',
181
+ 'style.section_flex': 'Flex',
172
182
  'style.section_position': 'Posición',
173
183
  'style.section_custom': 'CSS libre',
174
184
  'style.all_sizes': 'Se aplica a todos los tamaños',
@@ -228,15 +238,12 @@ GridEditor.locales.es = {
228
238
  'style.prop_left': 'Izquierda',
229
239
  'style.prop_z_index': 'Z-index',
230
240
  'error.sortable_missing': '¡SortableJS no está disponible! Asegúrate de haber cargado el archivo js de Sortable; sin él no se puede arrastrar.',
231
- 'warning.setting_removed': 'El ajuste {setting} se eliminó en la 4.0. Usa {replacement} en su lugar.',
232
241
  'warning.already_editing': 'Este elemento ya tiene un editor: se devuelve ese, con las opciones con las que se creó.',
233
242
  'warning.destroyed': 'Se ha llamado a {method}() en un editor destruido, y no hace nada.',
234
243
  'warning.duplicate_build': 'grideditor.js se ha cargado dos veces: se mantiene el primer GridEditor.',
235
- 'warning.plugin_6x': 'El plugin "{name}" está escrito para grid-editor 6 y no se carga. Desde la 7.0 los plugins se registran en GridEditor: consulta UPGRADING.md.',
236
244
  'warning.adapter_no_jquery': 'grideditor.jquery.js necesita jQuery 4 y la página no tiene jQuery: la API de jQuery no está disponible.',
237
- 'warning.oninit_removed': 'La opción oninit de tinyMCE se eliminó en la 7.0 y se ignora: usa init_instance_callback.',
238
245
  'error.tinymce_missing': '¡tinyMCE no está disponible! Asegúrate de haber cargado el archivo js de tinyMCE.',
239
- 'error.ckeditor_missing': '¡CKEditor 5 no está disponible! Asegúrate de haber cargado su archivo ckeditor5.umd.js: CKEditor 4 ya no está soportado.',
246
+ 'error.ckeditor_missing': '¡CKEditor 5 no está disponible! Asegúrate de haber cargado su archivo ckeditor5.umd.js.',
240
247
  'error.ckeditor_start': 'CKEditor no ha podido arrancar: {message}',
241
248
  'warning.ckeditor_plugin': 'CKEditor no tiene ningún plugin llamado {name}, así que se deja fuera.',
242
249
  'error.codemirror_missing': '¡CodeMirror no está disponible! Asegúrate de haber cargado el archivo js de CodeMirror; sin él el código se edita en un textarea normal.',
@@ -1,23 +1,24 @@
1
1
  /**
2
2
  * Alignment for grid-editor.
3
3
  *
4
- * A utility plugin: load this file after the editor and a row's columns can be
5
- * justified and aligned per breakpoint, and a column can align itself, with
6
- * Bootstrap's justify-content-{breakpoint}-*, align-items-{breakpoint}-* and
7
- * align-self-{breakpoint}-* classes. What it can ask the editor for is the
8
- * handle its factory is called with, described in docs/plugins.md.
4
+ * A utility plugin: load this file after the editor and a column can align
5
+ * itself in its row, per breakpoint, with Bootstrap's align-self-{breakpoint}-*
6
+ * classes. What it can ask the editor for is the handle its factory is called
7
+ * with, described in docs/plugins.md.
9
8
  *
10
9
  * <script src="dist/grideditor.min.js"></script>
11
10
  * <script src="dist/plugins/grideditor.alignment.min.js"></script>
12
11
  *
13
- * Fields only, in the settings panels: alignment is set now and then, not
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
14
+ * edits it, on a row and on anything else made flex.
15
+ *
16
+ * A field only, in the settings panel: alignment is set now and then, not
14
17
  * clicked through, and a drawer is short of room.
15
18
  */
16
19
  import { GridEditor } from '../grideditor.js';
17
20
 
18
21
  Object.assign(GridEditor.locales.en, {
19
- 'utility.justify_content': 'Justify columns',
20
- 'utility.align_items': 'Align columns',
21
22
  'utility.align_self': 'Align self',
22
23
  });
23
24
 
@@ -26,54 +27,24 @@ var FLEX = {
26
27
  start: 'flex-start',
27
28
  end: 'flex-end',
28
29
  center: 'center',
29
- between: 'space-between',
30
- around: 'space-around',
31
- evenly: 'space-evenly',
32
30
  baseline: 'baseline',
33
31
  stretch: 'stretch',
34
32
  auto: 'auto',
35
33
  };
36
34
 
37
- /**
38
- * A family whose preview is its one css property. `none` is what the
39
- * property is when no class says anything, which a view has to show over a
40
- * wider breakpoint's class that is live in a wide window.
41
- */
42
- function family(definition) {
43
- return Object.assign({
44
- prefix: definition.name,
45
- preview: function(value) {
46
- var styles = {};
47
- styles[definition.name] = value === null ? definition.none : FLEX[value];
48
- return styles;
49
- },
50
- }, definition);
51
- }
52
-
53
35
  GridEditor.utilities.alignment = function() {
54
36
  return {
55
- families: [
56
- family({
57
- name: 'justify-content',
58
- labelKey: 'utility.justify_content',
59
- values: ['start', 'center', 'end', 'between', 'around', 'evenly'],
60
- appliesTo: ['row'],
61
- none: 'normal',
62
- }),
63
- family({
64
- name: 'align-items',
65
- labelKey: 'utility.align_items',
66
- values: ['start', 'center', 'end', 'baseline', 'stretch'],
67
- appliesTo: ['row'],
68
- none: 'normal',
69
- }),
70
- family({
71
- name: 'align-self',
72
- labelKey: 'utility.align_self',
73
- values: ['auto', 'start', 'center', 'end', 'baseline', 'stretch'],
74
- appliesTo: ['column'],
75
- none: 'auto',
76
- }),
77
- ],
37
+ families: [{
38
+ name: 'align-self',
39
+ prefix: 'align-self',
40
+ labelKey: 'utility.align_self',
41
+ values: ['auto', 'start', 'center', 'end', 'baseline', 'stretch'],
42
+ appliesTo: ['column'],
43
+
44
+ /** Without a class, auto: what the row's align-items says. */
45
+ preview: function(value) {
46
+ return { 'align-self': value === null ? 'auto' : FLEX[value] };
47
+ },
48
+ }],
78
49
  };
79
50
  };
@@ -11,15 +11,13 @@
11
11
  * <script src="dist/grideditor.min.js"></script>
12
12
  * <script src="dist/plugins/grideditor.ckeditor.min.js"></script>
13
13
  *
14
- * Up to 7.1 this was CKEditor 4, whose last open source release has known
15
- * vulnerabilities and no fixes to come. CKEditor 5 asks for a licenseKey:
16
- * 'GPL', or a commercial key, is the host's to pass in ckeditor.config.
14
+ * CKEditor 5 asks for a license key, GPL or a commercial one, which is the
15
+ * host's to pass in ckeditor.config.
17
16
  *
18
- * Up to 5.x the main bundle carried a copy of this file; since 6.0 it is
19
- * loaded on its own, like every plugin. It imports what every text editor
20
- * shares - text blocks, the Text button, createText, making the host's plain
21
- * content a text - from src/js/text/grideditor.text.js, which the build puts
22
- * in its classic script, installed once however many editors a page loads.
17
+ * It imports what every text editor shares - text blocks, the Text button,
18
+ * createText, making the host's plain content a text - from
19
+ * src/js/text/grideditor.text.js, which the build puts in its classic
20
+ * script, installed once however many editors a page loads.
23
21
  */
24
22
  import { GridEditor } from '../grideditor.js';
25
23
  import * as dom from '../dom.js';
@@ -34,8 +32,8 @@ Object.assign(GridEditor.locales.en, {
34
32
  var INITIAL_CONTENT = '<p>Lorem initius... </p>';
35
33
 
36
34
  // What CKEditor 5 is started with when the host's config does not say. It
37
- // has no plugins of its own, so these are what a text can do: much what the
38
- // CKEditor 4 build 7.1 used offered. Names, looked up on window.CKEDITOR.
35
+ // has no plugins of its own, so these are what a text can do. Names, looked
36
+ // up on window.CKEDITOR.
39
37
  var PLUGINS = [
40
38
  'Essentials', 'Autoformat', 'Paragraph', 'Heading', 'Bold', 'Italic', 'Underline', 'Strikethrough',
41
39
  'Link', 'AutoLink', 'List', 'BlockQuote', 'Indent', 'HorizontalLine', 'Table', 'TableToolbar',
@@ -122,9 +120,6 @@ GridEditor.texts.ckeditor = function(ge) {
122
120
 
123
121
  var configuration = Object.assign({}, DEFAULTS, userConfig);
124
122
  configuration.plugins = pluginsFor(ge, userConfig.plugins || PLUGINS);
125
- // on.instanceReady is CKEditor 4's, and CKEditor 5 has no
126
- // such option: this file calls it, as it did in 7.1
127
- delete configuration.on;
128
123
 
129
124
  var ticket = {};
130
125
  starting.set(contentArea, ticket);
@@ -144,13 +139,6 @@ GridEditor.texts.ckeditor = function(ge) {
144
139
  starting.delete(contentArea);
145
140
  editors.set(contentArea, editor);
146
141
 
147
- // Call the original instanceReady function, if one was
148
- // passed in the config: 7.1's, with CKEditor 4's event
149
- var callback = userConfig.on && userConfig.on.instanceReady;
150
- if (callback) {
151
- callback.call(editor, { editor: editor });
152
- }
153
-
154
142
  // The editor owns what is inside the content area now,
155
143
  // so the grid editor is told to put its own furniture back
156
144
  ge.textReady(contentArea);
@@ -173,9 +161,8 @@ GridEditor.texts.ckeditor = function(ge) {
173
161
  contentAreas.filter(function(contentArea) {
174
162
  return dom.hasClass(contentArea, 'active');
175
163
  }).forEach(function(contentArea) {
176
- // This content area's editor, and no other: up to 5.x
177
- // closing one content area destroyed every CKEditor on
178
- // the page, other editors' and the host's own included
164
+ // This content area's editor, and no other: the other
165
+ // CKEditors on the page, the host's own included, stay
179
166
  var editor = editors.get(contentArea);
180
167
  editors.delete(contentArea);
181
168
  // One still starting sees this and goes as it is ready
@@ -4,7 +4,7 @@
4
4
  * A utility plugin: load this file after the editor and every row, column,
5
5
  * container, pane, element and section gets a Style accordion in its
6
6
  * settings panel - size, spacing, border, background, text, typography,
7
- * display, position and free css - written to the node's own style
7
+ * display, flex, position and free css - written to the node's own style
8
8
  * attribute, with Bootstrap's classes for each section as chips that put
9
9
  * them in the classes field. What it can ask the editor for is the handle
10
10
  * its factory is called with, described in docs/plugins.md.
@@ -12,23 +12,26 @@
12
12
  * <script src="dist/grideditor.min.js"></script>
13
13
  * <script src="dist/plugins/grideditor.style.min.js"></script>
14
14
  *
15
- * It carries what the spacing, textalign, visibility and float plugins
16
- * were up to 7.2: their per breakpoint fields are in its sections rather
17
- * than in Responsive, and those four files are deprecated. Loaded beside
18
- * it they stand down, and their names in the plugins setting ask for it.
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
19
  *
20
20
  * Where the settings panel has no room for it - a popover, inline in the
21
21
  * drawer - the accordion opens in a dialog, from a Style button.
22
22
  *
23
23
  * style.sections chooses the sections, and in each the properties and
24
- * whether it has a catalog; style.spacing and style.visibility are what
25
- * utilities.spacing and utilities.visibility were.
24
+ * whether it has a catalog; style.spacing is the options of spacing, whose
25
+ * scale the gaps share, and style.visibility those of the eye.
26
26
  */
27
27
  import { GridEditor } from '../grideditor.js';
28
28
  import { spacingPart } from '../style/spacing.js';
29
29
  import { textalignPart } from '../style/textalign.js';
30
- import { visibilityPart } from '../style/visibility.js';
30
+ import { displayPart } from '../style/display.js';
31
+ import { flexPart } from '../style/flex.js';
31
32
  import { floatPart } from '../style/float.js';
33
+ import { stickyPart } from '../style/sticky.js';
34
+ import { drawerflowPart } from '../style/drawerflow.js';
32
35
  import { resolveOptions } from '../style/options.js';
33
36
  import { createAccordion } from '../style/accordion.js';
34
37
 
@@ -42,6 +45,7 @@ Object.assign(GridEditor.locales.en, {
42
45
  'style.section_text': 'Text',
43
46
  'style.section_typography': 'Typography',
44
47
  'style.section_display': 'Display',
48
+ 'style.section_flex': 'Flex',
45
49
  'style.section_position': 'Position',
46
50
  'style.section_custom': 'Custom css',
47
51
  'style.all_sizes': 'Applies to every size',
@@ -102,7 +106,8 @@ Object.assign(GridEditor.locales.en, {
102
106
  'style.prop_z_index': 'Z-index',
103
107
  });
104
108
 
105
- var PARTS = ['spacing', 'textalign', 'visibility', 'float'];
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'];
106
111
 
107
112
  GridEditor.utilities.style = function(ge) {
108
113
 
@@ -110,8 +115,11 @@ GridEditor.utilities.style = function(ge) {
110
115
  var parts = {
111
116
  spacing: spacingPart(ge, options.spacing),
112
117
  textalign: textalignPart(ge),
113
- visibility: visibilityPart(ge, options.visibility),
118
+ display: displayPart(ge, options.visibility),
119
+ flex: flexPart(ge, options.spacing),
114
120
  float: floatPart(ge),
121
+ sticky: stickyPart(ge),
122
+ drawerflow: drawerflowPart(ge),
115
123
  };
116
124
  var accordions = []; // { node, accordion } for every panel built since the last init
117
125
  var context = {
@@ -175,5 +183,3 @@ GridEditor.utilities.style = function(ge) {
175
183
  },
176
184
  };
177
185
  };
178
-
179
- GridEditor.utilities.style.replaces = PARTS;
@@ -16,11 +16,10 @@
16
16
  * nothing else. Towards the editor it is plain DOM, like every plugin, and
17
17
  * it needs no jQuery adapter.
18
18
  *
19
- * Up to 5.x the main bundle carried a copy of this file; since 6.0 it is
20
- * loaded on its own, like every plugin. It imports what every text editor
21
- * shares - text blocks, the Text button, createText, making the host's plain
22
- * content a text - from src/js/text/grideditor.text.js, which the build puts
23
- * in its classic script, installed once however many editors a page loads.
19
+ * It imports what every text editor shares - text blocks, the Text button,
20
+ * createText, making the host's plain content a text - from
21
+ * src/js/text/grideditor.text.js, which the build puts in its classic
22
+ * script, installed once however many editors a page loads.
24
23
  */
25
24
  import { GridEditor } from '../grideditor.js';
26
25
  import * as dom from '../dom.js';