@themarioga/grid-editor 9.0.0-beta.8 → 9.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.
@@ -59,7 +59,10 @@
59
59
  <script src="../dist/plugins/grideditor.codemirror-inline.min.js"></script>
60
60
 
61
61
  <style>
62
- .pg-config .card-header { font-weight: 600; font-size: .875rem; }
62
+ .pg-config .accordion-button { font-weight: 600; font-size: .875rem; padding: .5rem .75rem; }
63
+ .pg-config .accordion-body { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 1.5rem; padding: .75rem; }
64
+ .pg-config .accordion-body > .pg-plugins { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
65
+ .pg-config .pg-plugins > :not(.form-check) { grid-column: 1 / -1; }
63
66
  .pg-config .form-label, .pg-config .form-check-label { font-size: .8125rem; }
64
67
  .pg-config .form-text { font-size: .75rem; margin-top: 0; }
65
68
  .pg-config .pg-field { margin-bottom: .5rem; }
@@ -81,9 +84,6 @@
81
84
  <div class="container-fluid px-4 py-3 pg-config">
82
85
  <div class="d-flex flex-wrap align-items-center gap-2 mb-2">
83
86
  <h1 class="h4 mb-0 me-auto">Playground</h1>
84
- <button class="btn btn-sm btn-outline-secondary" type="button" data-bs-toggle="collapse" data-bs-target="#settings">
85
- <i class="bi bi-sliders"></i> Settings
86
- </button>
87
87
  <button class="btn btn-sm btn-outline-secondary" type="button" id="showCode"><i class="bi bi-code-slash"></i> Options as code</button>
88
88
  <button class="btn btn-sm btn-outline-secondary" type="button" id="showHtml"><i class="bi bi-filetype-html"></i> Html</button>
89
89
  <button class="btn btn-sm btn-outline-secondary" type="button" id="openPage"><i class="bi bi-box-arrow-up-right"></i> Open the result</button>
@@ -111,9 +111,8 @@
111
111
  </div>
112
112
 
113
113
  <div class="container-fluid px-4 pb-3 pg-config">
114
- <div class="collapse show" id="settings">
115
- <div class="row row-cols-1 row-cols-md-2 row-cols-xl-4 g-3" id="groups"></div>
116
- </div>
114
+ <h2 class="h6 mb-2"><i class="bi bi-sliders"></i> Settings</h2>
115
+ <div class="accordion" id="groups"></div>
117
116
  </div>
118
117
 
119
118
  <div class="container-fluid px-4 pb-4">
@@ -356,7 +355,7 @@
356
355
  disabled: function(s) { return s.settings_panel === 'sidebar'; } },
357
356
  { id: 'confirm_delete', label: 'Ask before deleting', type: 'check', default: true },
358
357
  { id: 'edit_source', label: 'Source button on the toolbar', type: 'check', default: true },
359
- { id: 'toolbar_groups', label: 'Toolbar in categories', type: 'check', default: false },
358
+ { id: 'toolbar_groups', label: 'Toolbar in categories', type: 'check', always: true, default: true },
360
359
  { id: 'toolbar_overflow', label: 'Toolbar that does not fit', type: 'select', default: 'menu', options: [['menu', 'A ⋯ menu'], ['wrap', 'Wraps']] },
361
360
  { id: 'drawer_overflow', label: 'Drawers that do not fit', type: 'select', default: 'menu', options: [['menu', 'A ⋯ tool'], ['wrap', 'Wrap']] },
362
361
  ] },
@@ -703,14 +702,20 @@
703
702
  function render() {
704
703
  var root = document.getElementById('groups');
705
704
  root.innerHTML = '';
706
- GROUPS.forEach(function(group) {
707
- var col = document.createElement('div');
708
- col.className = 'col';
709
- col.innerHTML = '<div class="card h-100"><div class="card-header py-1">' + group.title + '</div><div class="card-body py-2"></div></div>';
710
- var body = col.querySelector('.card-body');
711
- if (group.id === 'plugins') { body.appendChild(pluginsNode()); }
705
+ // Each group folds on its own, so several can be open at once
706
+ GROUPS.forEach(function(group, i) {
707
+ var item = document.createElement('div');
708
+ item.className = 'accordion-item';
709
+ item.innerHTML =
710
+ '<h3 class="accordion-header">' +
711
+ '<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" ' +
712
+ 'data-bs-target="#group-' + i + '" aria-expanded="false" aria-controls="group-' + i + '">' + group.title + '</button>' +
713
+ '</h3>' +
714
+ '<div class="accordion-collapse collapse" id="group-' + i + '"><div class="accordion-body"></div></div>';
715
+ var body = item.querySelector('.accordion-body');
716
+ if (group.id === 'plugins') { body.appendChild(pluginsNode()).classList.add('pg-plugins'); }
712
717
  group.fields.forEach(function(field) { body.appendChild(fieldNode(field)); });
713
- root.appendChild(col);
718
+ root.appendChild(item);
714
719
  });
715
720
  refresh();
716
721
  }
package/package.json CHANGED
@@ -32,7 +32,7 @@
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "version": "9.0.0-beta.8",
35
+ "version": "9.0.0",
36
36
  "main": "dist/grideditor.js",
37
37
  "module": "dist/grideditor.esm.js",
38
38
  "types": "dist/grideditor.d.ts",
@@ -82,7 +82,10 @@
82
82
  flex: none;
83
83
  margin-right: 8px;
84
84
 
85
+ /* An outline button has no background of its own: with the toolbar
86
+ fixed over the canvas, the drawers would show through */
85
87
  > .btn {
88
+ --bs-btn-bg: var(--bs-body-bg, #fff);
86
89
  white-space: nowrap;
87
90
  }
88
91
  }