@themarioga/grid-editor 3.2.1 → 4.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.
Files changed (43) hide show
  1. package/BUILDING.md +12 -3
  2. package/CHANGELOG.md +45 -0
  3. package/README.md +26 -6
  4. package/UPGRADING.md +79 -0
  5. package/dist/grideditor.css +40 -20
  6. package/dist/grideditor.min.css +1 -1
  7. package/dist/grideditor.min.css.map +1 -1
  8. package/dist/jquery.grideditor.bundle.min.js +10 -0
  9. package/dist/jquery.grideditor.js +369 -165
  10. package/dist/jquery.grideditor.min.js +1 -1
  11. package/dist/jquery.grideditor.min.js.map +1 -1
  12. package/dist/locales/grideditor.es.js +2 -0
  13. package/dist/locales/grideditor.es.min.js +1 -1
  14. package/dist/locales/grideditor.es.min.js.map +1 -1
  15. package/dist/plugins/grideditor.accordion.js +8 -0
  16. package/dist/plugins/grideditor.accordion.min.js +1 -1
  17. package/dist/plugins/grideditor.accordion.min.js.map +1 -1
  18. package/dist/plugins/grideditor.elements.js +5 -5
  19. package/dist/plugins/grideditor.elements.min.js +1 -1
  20. package/dist/plugins/grideditor.elements.min.js.map +1 -1
  21. package/dist/plugins/grideditor.tabs.js +8 -0
  22. package/dist/plugins/grideditor.tabs.min.js +1 -1
  23. package/dist/plugins/grideditor.tabs.min.js.map +1 -1
  24. package/docs/events.md +6 -7
  25. package/docs/locale-keys.md +2 -0
  26. package/docs/plugins.md +21 -7
  27. package/example/autosave.html +1 -1
  28. package/example/basic.html +3 -2
  29. package/example/breakpoints.html +1 -1
  30. package/example/ckeditor.html +1 -1
  31. package/example/containers.html +1 -1
  32. package/example/elements.html +1 -1
  33. package/example/locale.html +1 -1
  34. package/example/plugins.html +1 -1
  35. package/example/summernote.html +1 -1
  36. package/example/wrap_content.html +1 -1
  37. package/package.json +3 -2
  38. package/src/js/jquery.grideditor.js +369 -165
  39. package/src/js/locales/grideditor.es.js +2 -0
  40. package/src/js/plugins/grideditor.accordion.js +8 -0
  41. package/src/js/plugins/grideditor.elements.js +5 -5
  42. package/src/js/plugins/grideditor.tabs.js +8 -0
  43. package/src/less/grideditor.less +43 -18
@@ -69,6 +69,8 @@
69
69
  'view.lg': 'Escritorio',
70
70
  'view.xl': 'Escritorio grande',
71
71
  'view.xxl': 'Pantalla panorámica',
72
+ 'error.sortable_missing': '¡SortableJS no está disponible! Asegúrate de haber cargado el archivo js de Sortable; sin él no se puede arrastrar.',
73
+ 'warning.setting_removed': 'El ajuste {setting} se eliminó en la 4.0. Usa {replacement} en su lugar.',
72
74
  'error.tinymce_missing': '¡tinyMCE no está disponible! Asegúrate de haber cargado el archivo js de tinyMCE.',
73
75
  'error.ckeditor_missing': '¡CKEditor no está disponible! Asegúrate de haber cargado los archivos js de ckeditor y del adaptador de jQuery.',
74
76
  'error.summernote_missing': '¡Summernote no está disponible! Asegúrate de haber cargado el archivo js de Summernote.',
@@ -99,6 +99,14 @@ $.fn.gridEditor.containers.accordion = function(ge) {
99
99
 
100
100
  return {
101
101
  labelKey: 'container.add_accordion',
102
+
103
+ // Items sort within their accordion and into any other one
104
+ onSortable: function(sortable) {
105
+ sortable(ge.canvas.find('.ge-container-accordion > .accordion'), {
106
+ draggable: '.ge-accordion-item',
107
+ group: 'accordion',
108
+ });
109
+ },
102
110
  addPaneKey: 'container.add_accordion_item',
103
111
  paneKind: 'accordion-item',
104
112
 
@@ -127,13 +127,13 @@ $.fn.gridEditor.features.elements = function(ge) {
127
127
  onContentReady: markElements,
128
128
 
129
129
  /** Elements move within a content area and between them. */
130
- onSortable: function(shared) {
130
+ onSortable: function(sortable) {
131
131
  if (!elementsEnabled()) { return; }
132
132
 
133
- ge.canvas.find('.ge-content').sortable($.extend({
134
- items: '> .ge-element',
135
- connectWith: '.ge-canvas .ge-content',
136
- }, shared, ge.settings.sortable_options));
133
+ sortable(ge.canvas.find('.ge-content'), {
134
+ draggable: '.ge-element',
135
+ group: 'element',
136
+ });
137
137
  },
138
138
  };
139
139
  };
@@ -73,6 +73,14 @@ $.fn.gridEditor.containers.tabs = function(ge) {
73
73
 
74
74
  return {
75
75
  labelKey: 'container.add_tabs',
76
+
77
+ // A tab strip sorts its own tabs, and the panes follow them. No
78
+ // group: a tab belongs to the strip it was made in.
79
+ onSortable: function(sortable) {
80
+ sortable(ge.canvas.find('.ge-container-tabs > .nav-tabs'), {
81
+ draggable: '.ge-tab',
82
+ });
83
+ },
76
84
  addPaneKey: 'container.add_tab',
77
85
  paneKind: 'tab',
78
86
 
@@ -106,7 +106,24 @@
106
106
  }
107
107
 
108
108
  /* The button following the pointer must not be what the pointer is over */
109
+ .ge-drag-helper {
110
+ opacity: .85;
111
+ pointer-events: none;
112
+
113
+ .ge-tools-drawer {
114
+ pointer-events: none;
115
+ }
116
+ }
117
+
118
+ /* A toolbar button that can be carried onto the canvas */
119
+ .ge-palette-button {
120
+ cursor: move;
121
+ touch-action: none;
122
+ }
123
+
109
124
  .ge-toolbar-helper {
125
+ position: absolute;
126
+ z-index: 1000;
110
127
  pointer-events: none;
111
128
  opacity: 0.85;
112
129
  }
@@ -131,10 +148,9 @@
131
148
 
132
149
  .ge-tools-drawer {
133
150
  /* Positioned, so a tool can hang a picker off itself. Deliberately
134
- not stacked above anything the rest of the time: jQuery UI's resize
135
- handle carries an inline z-index of 90 and runs down the column's
136
- edge, and a drawer sitting over it would take the clicks meant for
137
- the handle. */
151
+ not stacked above anything the rest of the time: the resize handle
152
+ runs down the column's edge, and a drawer sitting over it would take
153
+ the clicks meant for the handle. */
138
154
  position: relative;
139
155
  -webkit-touch-callout: none;
140
156
 
@@ -423,12 +439,18 @@
423
439
  }
424
440
  }
425
441
 
426
- /* Sorting */
427
- .ui-sortable-placeholder {
442
+ /* Sorting. The dragged node stays in the list and shows where it would
443
+ land - that is the placeholder - while a copy of it follows the
444
+ pointer. */
445
+ .ge-drag-placeholder {
428
446
  background: fadeout(yellow, 80%);
429
- visibility: visible !important;
447
+ opacity: 1;
430
448
  min-height: 50px;
431
449
  max-height: 100px;
450
+
451
+ > * {
452
+ visibility: hidden;
453
+ }
432
454
  }
433
455
 
434
456
  /* A size change should read as a movement rather than a jump, but not
@@ -437,23 +459,26 @@
437
459
  .column {
438
460
  transition: width 120ms ease, margin-left 120ms ease;
439
461
  }
440
- .column.ui-resizable-resizing {
462
+ .column.ge-resizing {
441
463
  transition: none;
442
464
  /* Follow the pointer in pixels: the layout mode's max-width is what
443
465
  the column will snap back into once the drag lands */
444
466
  max-width: none;
445
467
  }
446
468
 
447
- /* Resizing. jQuery UI's own stylesheet is not a dependency, so the handle
448
- is styled here: a grip on the column's edge, clear of the drawer, which
449
- is what keeps the resize gesture and the sort gesture apart */
450
- .column > .ui-resizable-handle {
469
+ /* Resizing: a grip on the column's edge, clear of the drawer, which is
470
+ what keeps the resize gesture and the sort gesture apart */
471
+ .column > .ge-resize-handle {
451
472
  position: absolute;
452
473
  display: block;
453
474
  z-index: 10;
475
+
476
+ /* The gesture is the editor's, not the page's: without this a touch
477
+ drag on the handle scrolls instead of resizing */
478
+ touch-action: none;
454
479
  }
455
- .column > .ui-resizable-e,
456
- .column > .ui-resizable-w {
480
+ .column > .ge-resize-e,
481
+ .column > .ge-resize-w {
457
482
  top: 0;
458
483
  bottom: 0;
459
484
  width: 8px;
@@ -464,10 +489,10 @@
464
489
  background: @colColor;
465
490
  }
466
491
  }
467
- .column > .ui-resizable-e {
492
+ .column > .ge-resize-e {
468
493
  right: -1px;
469
494
  }
470
- .column > .ui-resizable-w {
495
+ .column > .ge-resize-w {
471
496
  left: -1px;
472
497
  }
473
498
 
@@ -479,13 +504,13 @@
479
504
  font-size: 11px;
480
505
  color: @colTextColor;
481
506
  }
482
- .column.ui-resizable-resizing > .ge-tools-drawer > .ge-resize-size {
507
+ .column.ge-resizing > .ge-tools-drawer > .ge-resize-size {
483
508
  display: block;
484
509
  }
485
510
  }
486
511
 
487
512
  /* The handle belongs to editing, and never to the output */
488
- .ge-canvas:not(.ge-editing) .ui-resizable-handle {
513
+ .ge-canvas:not(.ge-editing) .ge-resize-handle {
489
514
  display: none;
490
515
  }
491
516