@themarioga/grid-editor 9.0.0-beta.7 → 9.0.0-beta.8

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 (52) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +29 -15
  3. package/UPGRADING.md +1 -1
  4. package/dist/grideditor.bundle.min.js +2 -2
  5. package/dist/grideditor.css +24 -3
  6. package/dist/grideditor.d.ts +20 -0
  7. package/dist/grideditor.esm.js +10 -1
  8. package/dist/grideditor.js +10 -1
  9. package/dist/grideditor.min.css +1 -1
  10. package/dist/grideditor.min.css.map +1 -1
  11. package/dist/grideditor.min.js +1 -1
  12. package/dist/grideditor.min.js.map +3 -3
  13. package/dist/locales/grideditor.es.esm.js +1 -0
  14. package/dist/locales/grideditor.es.js +1 -0
  15. package/dist/locales/grideditor.es.min.js +1 -1
  16. package/dist/locales/grideditor.es.min.js.map +2 -2
  17. package/dist/plugins/grideditor.ckeditor.min.js.map +1 -1
  18. package/dist/plugins/grideditor.inline-style.esm.js +66 -3
  19. package/dist/plugins/grideditor.inline-style.js +66 -3
  20. package/dist/plugins/grideditor.inline-style.min.js +4 -4
  21. package/dist/plugins/grideditor.inline-style.min.js.map +3 -3
  22. package/dist/plugins/grideditor.summernote.min.js.map +1 -1
  23. package/dist/plugins/grideditor.tinymce.min.js.map +1 -1
  24. package/docs/locale-keys.md +1 -0
  25. package/docs/plugins.md +7 -6
  26. package/example/adapter.html +11 -1
  27. package/example/{autocols.html → columns.html} +61 -20
  28. package/example/containers.html +13 -2
  29. package/example/{attributes.html → custom-plugins.html} +130 -12
  30. package/example/elements.html +13 -2
  31. package/example/history.html +6 -3
  32. package/example/index.html +30 -81
  33. package/example/playground.html +840 -0
  34. package/example/style.html +291 -0
  35. package/example/text-editors.html +320 -0
  36. package/package.json +1 -1
  37. package/src/js/grideditor.js +11 -1
  38. package/src/js/inline-style/accordion.js +4 -3
  39. package/src/js/inline-style/fields.js +56 -3
  40. package/src/js/inline-style/options.js +12 -0
  41. package/src/js/locales/grideditor.es.js +1 -0
  42. package/src/js/plugins/grideditor.inline-style.js +10 -0
  43. package/src/js/text/grideditor.text.js +1 -1
  44. package/src/less/grideditor.less +26 -3
  45. package/types/grideditor.d.ts +20 -0
  46. package/example/breakpoints.html +0 -100
  47. package/example/ckeditor.html +0 -110
  48. package/example/custom_editor.html +0 -212
  49. package/example/inline-style.html +0 -163
  50. package/example/plugins.html +0 -251
  51. package/example/summernote.html +0 -114
  52. package/example/utilities.html +0 -200
@@ -1,114 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
-
6
- <!-- CSS dependencies -->
7
- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
8
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.css">
9
-
10
- <!-- Javascript dependencies. jQuery is summernote's: the editor itself
11
- does not need it, and this page loads no jQuery adapter -->
12
- <script src="https://code.jquery.com/jquery-4.0.0.min.js"></script>
13
- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
14
-
15
- <!-- Summernote CSS -->
16
- <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.9.1/summernote-bs5.min.css" />
17
- <!-- Summernote js -->
18
- <script src="https://cdnjs.cloudflare.com/ajax/libs/summernote/0.9.1/summernote-bs5.min.js"></script>
19
-
20
- <!-- Grid editor CSS -->
21
- <link rel="stylesheet" type="text/css" href="../dist/grideditor.css" />
22
- <!-- Grid editor javascript -->
23
- <script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.6/Sortable.min.js"></script>
24
- <script src="../dist/grideditor.min.js"></script>
25
- <!-- The text editor is a plugin of its own, loaded after the editor -->
26
- <script src="../dist/plugins/grideditor.summernote.min.js"></script>
27
-
28
- <script>
29
- document.addEventListener('DOMContentLoaded', function() {
30
- // Initialize grid editor
31
- var editor = new GridEditor('#myGrid', {
32
- new_row_layouts: [[12], [6, 6], [9, 3], [3, 9]],
33
- content_types: ['summernote'],
34
- summernote: {
35
- config: {
36
- callbacks: {
37
- onInit: function() {
38
- var element = this;
39
- console.log('init done', element);
40
- }
41
- }
42
- }
43
- }
44
- });
45
-
46
- // Get resulting html
47
- var html = editor.getHtml();
48
- console.log(html);
49
- });
50
- </script>
51
-
52
- <title>Grid Editor example</title>
53
- </head>
54
- <body>
55
- <!-- Back to the demo index -->
56
- <div class="container pt-3">
57
- <a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
58
- </div>
59
-
60
-
61
- <div class="container">
62
- <div id="myGrid">
63
-
64
- <div class="row">
65
- <div class="col-md-12">
66
- <h1>Lorem ipsum dolor sit amet, consectetur</h1>
67
- <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Velit exercitationem eaque aperiam rem quia quibusdam dolor ducimus quo similique eos pariatur nostrum aliquam nam eius, doloremque quis voluptatum unde. Porro voluptates aspernatur voluptate ipsam, magni vero. Accusamus, iusto tempore id!</p>
68
- <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quae laboriosam, excepturi quas.</p>
69
- </div>
70
- </div>
71
-
72
- <div class="row">
73
- <div class="col-md-4">
74
- <h2>Lorem ipsum dolor</h2>
75
- <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ea facilis vel aliquam aspernatur dolor placeat totam saepe perferendis. Odio quia vel sed eveniet cupiditate, illum doloremque sint veniam eum? Corporis?</p>
76
- </div>
77
- <div class="col-md-4">
78
- <h2>Pariatur reprehenderit</h2>
79
- <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Illo adipisci ipsa, consequuntur cum, sunt dolores veniam. Enim inventore in dolore deserunt vitae sequi nemo!</p>
80
- </div>
81
- <div class="col-md-4">
82
- <h2>Pariatur reprehenderit</h2>
83
- <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ea excepturi ducimus numquam aut error corporis aspernatur ipsum quos eius culpa!</p>
84
- </div>
85
- </div>
86
-
87
- <div class="row">
88
- <div class="col-md-8">
89
- <h2>Lorem ipsum dolor.</h2>
90
- <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Porro distinctio atque molestiae optio, consequuntur? Iusto ratione cumque dolor aut dolore!</p>
91
-
92
- <div class="row">
93
- <div class="col-md-6">
94
- <hr>
95
- <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Debitis facilis molestias voluptatum laudantium fuga ratione tempora rem dolor dicta rerum vero ut, suscipit ex qui amet quam vel cupiditate quaerat minus assumenda reiciendis, similique omnis delectus! Autem, repudiandae cumque eaque?</p>
96
- </div>
97
- <div class="col-md-6">
98
- <hr>
99
- <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eveniet molestiae quaerat illum, consequuntur iusto aspernatur quam provident? Possimus!</p>
100
- </div>
101
- </div>
102
- </div>
103
-
104
- <div class="col-md-4">
105
- <h2>Lusto ratione</h2>
106
- <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quis fugit quasi officiis id laudantium error aut ut aperiam dicta saepe non vel, cupiditate illum ipsam velit deleniti natus incidunt impedit molestias dolore quos dolores enim. Aliquid ipsam eaque consequuntur quaerat, suscipit a in. Praesentium repudiandae quibusdam recusandae sequi eligendi quos, dignissimos, officiis officia minima necessitatibus eaque consequatur in id adipisci qui minus voluptatum quae debitis, quas maxime iure. Tempore vero unde quia reiciendis ad beatae voluptate omnis, ipsa expedita ab, quasi, neque. Doloribus, pariatur. Aut hic voluptate.</p>
107
- </div>
108
- </div>
109
-
110
- </div> <!-- /#myGrid -->
111
- </div> <!-- /.container -->
112
-
113
- </body>
114
- </html>
@@ -1,200 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
-
6
- <!-- CSS dependencies -->
7
- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-sRIl4kxILFvY47J16cr9ZwB07vP4J8+LH7qKQnuqkuIAvNWLzeN8tE5YBujZqJLB" crossorigin="anonymous">
8
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.13.1/font/bootstrap-icons.css">
9
-
10
- <!-- Javascript dependencies -->
11
- <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.8/dist/js/bootstrap.bundle.min.js" integrity="sha384-FKyoEForCGlyvwx9Hj09JcYn3nv7wiPVlz7YYwJrWVcXK/BmnVDxM+D2scQbITxI" crossorigin="anonymous"></script>
12
-
13
- <!-- Grid editor CSS -->
14
- <link rel="stylesheet" type="text/css" href="../dist/grideditor.css" />
15
-
16
- <!-- The editor, and the utility plugins. Each is a file of its own, and
17
- loading it is what puts its fields in the settings panels. The
18
- inline-style plugin carries display, flex, spacing, text alignment, sticky and
19
- float, and edits them in its Style accordion - a row's justify and
20
- align among them, in Flex; order, a column's align-self and gutters
21
- are the grid's, and stay in the Responsive section. -->
22
- <script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.6/Sortable.min.js"></script>
23
- <script src="../dist/grideditor.min.js"></script>
24
- <script src="../dist/plugins/grideditor.order.min.js"></script>
25
- <script src="../dist/plugins/grideditor.alignment.min.js"></script>
26
- <script src="../dist/plugins/grideditor.gutters.min.js"></script>
27
- <!-- Float works on elements, so the elements plugin comes first -->
28
- <script src="../dist/plugins/grideditor.elements.min.js"></script>
29
- <script src="../dist/plugins/grideditor.inline-style.min.js"></script>
30
-
31
- <script>
32
- document.addEventListener('DOMContentLoaded', function() {
33
- var grid = document.getElementById('myGrid');
34
- var editor;
35
-
36
- function start(panel) {
37
- editor = new GridEditor(grid, {
38
- new_row_layouts: [[12], [6,6], [4,4,4], [8,4]],
39
- content_types: [],
40
-
41
- // Utilities are edited per breakpoint, so this page starts in
42
- // one. Switch to "All sizes" to see the page as it will render.
43
- default_view: 'xs',
44
-
45
- // Where a node's settings open: 'offcanvas', the default,
46
- // 'popover', 'modal', 'inline' in its drawer, or 'sidebar',
47
- // a panel that stays and shows what is clicked
48
- settings_panel: panel,
49
- });
50
- }
51
- start(document.getElementById('panel').value);
52
-
53
- // The same canvas, started again with its settings elsewhere
54
- document.getElementById('panel').addEventListener('change', function() {
55
- var html = editor.getHtml();
56
- editor.destroy();
57
- grid.innerHTML = html;
58
- start(this.value);
59
- });
60
-
61
- // Every change to a utility is announced, like any other operation
62
- grid.addEventListener('grideditor:after-utility', function(e) {
63
- var payload = e.detail;
64
- document.getElementById('last').textContent = payload.family + ' at ' + payload.breakpoint + ': ' +
65
- (payload.from === null ? 'default' : payload.from) + ' → ' +
66
- (payload.to === null ? 'inherit' : payload.to);
67
- });
68
-
69
- document.getElementById('output').addEventListener('click', function() {
70
- document.getElementById('html').textContent = editor.getHtml();
71
- });
72
- });
73
- </script>
74
-
75
- <title>Grid Editor utilities example</title>
76
- </head>
77
- <body>
78
- <!-- Back to the demo index -->
79
- <div class="container pt-3">
80
- <a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
81
- </div>
82
-
83
-
84
- <div class="container">
85
-
86
- <div class="row my-3">
87
- <div class="col-lg-8">
88
- <h1 class="h4">Responsive utilities</h1>
89
- <p class="form-text">
90
- Bootstrap's responsive utility classes, edited per
91
- breakpoint. Pick a breakpoint in the dropdown and every
92
- change is written for that breakpoint alone; in
93
- <strong>All sizes</strong> it is written once, for every
94
- size. Each drawer's gear has a <strong>Style</strong>
95
- accordion, whose sections hold display, flex, spacing, text
96
- alignment, sticky and float, and a <strong>Responsive</strong>
97
- section for the grid's utilities. Every field says what
98
- the breakpoint inherits and from where.
99
- </p>
100
- <div class="d-flex align-items-center gap-2 mb-3">
101
- <label class="form-label mb-0" for="panel">A gear opens its settings in</label>
102
- <select class="form-select form-select-sm w-auto" id="panel">
103
- <option value="offcanvas">a side panel (offcanvas)</option>
104
- <option value="popover">a popover</option>
105
- <option value="modal">a modal</option>
106
- <option value="inline">the drawer itself (inline)</option>
107
- <option value="sidebar">a sidebar that stays (click an element)</option>
108
- </select>
109
- </div>
110
- <p class="form-text">
111
- <strong>Display:</strong> a field in the Display section,
112
- and the eye in a drawer, which hides the
113
- node in the view being edited. It stays on the canvas,
114
- faded, so you can show it again; in All sizes a badge says
115
- at which breakpoints it is hidden. The sidebar below is
116
- hidden on phones and tablets.
117
- </p>
118
- <p class="form-text">
119
- <strong>Order:</strong> the arrows in a column's drawer
120
- move it earlier or later in the view being edited,
121
- without moving the markup. In the second row, "Second"
122
- comes first on phones only.
123
- </p>
124
- <p class="form-text">
125
- <strong>Alignment:</strong> a row justifies and aligns its
126
- columns with fields in the Style accordion's Flex section,
127
- and a column aligns itself with a field in Responsive. The
128
- third row centres its narrow column from small desktop up.
129
- </p>
130
- <p class="form-text">
131
- <strong>Gutters:</strong> fields in a row's panel. A row
132
- with gutter classes is drawn with its real gutters; the
133
- second row has none on phones and wide ones from small
134
- desktop up.
135
- </p>
136
- <p class="form-text">
137
- <strong>Spacing:</strong> a padding and a margin group in
138
- the Style accordion's Spacing section, each a side and a
139
- value. The centred column
140
- below gets more padding from small desktop up.
141
- </p>
142
- <p class="form-text">
143
- <strong>Text alignment:</strong> a field in the Text section.
144
- The centred column's text is centred from small desktop
145
- up. <strong>Float:</strong> a field in an element's Position section;
146
- the quote in the last row floats to the end from tablet up,
147
- with the text flowing round it.
148
- </p>
149
- <p class="form-text">Last change: <span id="last">none yet</span></p>
150
- <button class="btn btn-sm btn-secondary" id="output" type="button">Show the html this produces</button>
151
- <pre id="html" class="form-text"></pre>
152
- </div>
153
- </div>
154
-
155
- <div id="myGrid">
156
-
157
- <div class="row">
158
- <div class="col-12 col-md-8">
159
- <h2 class="h5">Main content</h2>
160
- <p>Full width on phones and tablets, two thirds from small desktop up.</p>
161
- </div>
162
- <div class="col-12 col-md-4 d-none d-md-block">
163
- <h2 class="h5">Sidebar</h2>
164
- <p>Only from small desktop up: <code>d-none d-md-block</code>.</p>
165
- </div>
166
- </div>
167
-
168
- <div class="row g-0 g-md-5">
169
- <div class="col-6">
170
- <h2 class="h5">First</h2>
171
- <p>Change the views and the utilities of these two.</p>
172
- </div>
173
- <div class="col-6 order-first order-sm-0">
174
- <h2 class="h5">Second</h2>
175
- <p>First on phones, with <code>order-first order-sm-0</code>.</p>
176
- </div>
177
- </div>
178
-
179
- <div class="row justify-content-md-center">
180
- <div class="col-12 col-md-6 py-2 py-md-4 text-md-center">
181
- <h2 class="h5">Centred</h2>
182
- <p>Its row has <code>justify-content-md-center</code>, and it has <code>py-2 py-md-4</code>.</p>
183
- </div>
184
- </div>
185
-
186
- <div class="row">
187
- <div class="col-12">
188
- <blockquote data-ge-element="quote" data-ge-label="Pull quote" class="float-sm-end ms-sm-3 p-3 border-start border-4">
189
- A floated element, <code>float-sm-end</code>.
190
- </blockquote>
191
- <p>The text after it flows round the quote from tablet up, and runs under it on phones, where it does not float. Switch between Phone and Tablet in the dropdown to see it move, or choose another float in the element's panel.</p>
192
- <p>A second paragraph, so there is enough text to flow.</p>
193
- </div>
194
- </div>
195
-
196
- </div> <!-- /#myGrid -->
197
- </div> <!-- /.container -->
198
-
199
- </body>
200
- </html>