@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.
- package/CHANGELOG.md +15 -0
- package/README.md +29 -15
- package/UPGRADING.md +1 -1
- package/dist/grideditor.bundle.min.js +2 -2
- package/dist/grideditor.css +24 -3
- package/dist/grideditor.d.ts +20 -0
- package/dist/grideditor.esm.js +10 -1
- package/dist/grideditor.js +10 -1
- package/dist/grideditor.min.css +1 -1
- package/dist/grideditor.min.css.map +1 -1
- package/dist/grideditor.min.js +1 -1
- package/dist/grideditor.min.js.map +3 -3
- package/dist/locales/grideditor.es.esm.js +1 -0
- package/dist/locales/grideditor.es.js +1 -0
- package/dist/locales/grideditor.es.min.js +1 -1
- package/dist/locales/grideditor.es.min.js.map +2 -2
- package/dist/plugins/grideditor.ckeditor.min.js.map +1 -1
- package/dist/plugins/grideditor.inline-style.esm.js +66 -3
- package/dist/plugins/grideditor.inline-style.js +66 -3
- package/dist/plugins/grideditor.inline-style.min.js +4 -4
- package/dist/plugins/grideditor.inline-style.min.js.map +3 -3
- package/dist/plugins/grideditor.summernote.min.js.map +1 -1
- package/dist/plugins/grideditor.tinymce.min.js.map +1 -1
- package/docs/locale-keys.md +1 -0
- package/docs/plugins.md +7 -6
- package/example/adapter.html +11 -1
- package/example/{autocols.html → columns.html} +61 -20
- package/example/containers.html +13 -2
- package/example/{attributes.html → custom-plugins.html} +130 -12
- package/example/elements.html +13 -2
- package/example/history.html +6 -3
- package/example/index.html +30 -81
- package/example/playground.html +840 -0
- package/example/style.html +291 -0
- package/example/text-editors.html +320 -0
- package/package.json +1 -1
- package/src/js/grideditor.js +11 -1
- package/src/js/inline-style/accordion.js +4 -3
- package/src/js/inline-style/fields.js +56 -3
- package/src/js/inline-style/options.js +12 -0
- package/src/js/locales/grideditor.es.js +1 -0
- package/src/js/plugins/grideditor.inline-style.js +10 -0
- package/src/js/text/grideditor.text.js +1 -1
- package/src/less/grideditor.less +26 -3
- package/types/grideditor.d.ts +20 -0
- package/example/breakpoints.html +0 -100
- package/example/ckeditor.html +0 -110
- package/example/custom_editor.html +0 -212
- package/example/inline-style.html +0 -163
- package/example/plugins.html +0 -251
- package/example/summernote.html +0 -114
- package/example/utilities.html +0 -200
|
@@ -12,9 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
<!-- Grid editor CSS -->
|
|
14
14
|
<link rel="stylesheet" type="text/css" href="../dist/grideditor.css" />
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
columns per row are the editor's own, sections are a plugin -->
|
|
15
|
+
<!-- Grid editor javascript, and sections: Bootstrap's containers, a
|
|
16
|
+
plugin since many pages put the whole canvas in one already -->
|
|
18
17
|
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.6/Sortable.min.js"></script>
|
|
19
18
|
<script src="../dist/grideditor.min.js"></script>
|
|
20
19
|
<script src="../dist/plugins/grideditor.sections.min.js"></script>
|
|
@@ -27,11 +26,18 @@
|
|
|
27
26
|
// Sizes are numbers, 'equal' (col) or 'auto' (col-auto), and a
|
|
28
27
|
// layout can be a row with columns per row
|
|
29
28
|
new_row_layouts: [
|
|
30
|
-
[12], [6, 6], [
|
|
29
|
+
[12], [6, 6], [4, 4, 4], [8, 4], ['auto', 'equal'],
|
|
31
30
|
{ row_cols: { xs: 1, sm: 2, lg: 4 }, columns: 4 },
|
|
32
31
|
],
|
|
33
32
|
|
|
34
|
-
|
|
33
|
+
// The default: a size or offset change is written once, as the
|
|
34
|
+
// class with no breakpoint, and replaces what the breakpoints
|
|
35
|
+
// said. Switch the dropdown to a single breakpoint to tune
|
|
36
|
+
// that one on its own.
|
|
37
|
+
default_view: 'all',
|
|
38
|
+
|
|
39
|
+
// A host that wants fewer views can offer fewer
|
|
40
|
+
// layout_modes: ['all', 'lg', 'sm', 'xs'],
|
|
35
41
|
});
|
|
36
42
|
|
|
37
43
|
// A width chosen anywhere - tools, edge, panel - is a resize
|
|
@@ -45,13 +51,24 @@
|
|
|
45
51
|
}).join(', ') + ')' : '');
|
|
46
52
|
});
|
|
47
53
|
|
|
48
|
-
|
|
49
|
-
|
|
54
|
+
// The button shows the html in place of the editor, and pressed again,
|
|
55
|
+
// the editor
|
|
56
|
+
var output = document.getElementById('output');
|
|
57
|
+
var outputLabel = output.textContent;
|
|
58
|
+
output.addEventListener('click', function() {
|
|
59
|
+
var showing = document.body.classList.toggle('showing-html');
|
|
60
|
+
if (showing) { document.getElementById('html').textContent = editor.getHtml(); }
|
|
61
|
+
output.textContent = showing ? 'Back to the editor' : outputLabel;
|
|
50
62
|
});
|
|
51
63
|
});
|
|
52
64
|
</script>
|
|
53
65
|
|
|
54
|
-
<title>Grid Editor
|
|
66
|
+
<title>Grid Editor columns and breakpoints example</title>
|
|
67
|
+
<style>
|
|
68
|
+
/* The html, shown in place of the editor and its toolbar */
|
|
69
|
+
body:not(.showing-html) #html { display: none; }
|
|
70
|
+
.showing-html #myGrid, .showing-html .ge-mainControls { display: none; }
|
|
71
|
+
</style>
|
|
55
72
|
</head>
|
|
56
73
|
<body>
|
|
57
74
|
<!-- Back to the demo index -->
|
|
@@ -64,7 +81,20 @@
|
|
|
64
81
|
|
|
65
82
|
<div class="row my-3">
|
|
66
83
|
<div class="col-lg-8">
|
|
67
|
-
<h1 class="h4">
|
|
84
|
+
<h1 class="h4">Columns and breakpoints</h1>
|
|
85
|
+
<p class="form-text">
|
|
86
|
+
<strong>Six breakpoints, and all sizes.</strong> The
|
|
87
|
+
dropdown on the right of the toolbar picks the view. In
|
|
88
|
+
<strong>All sizes</strong> the canvas renders as the
|
|
89
|
+
browser would, and the width and indent tools write one
|
|
90
|
+
class for every size (<code>col-4</code>), replacing what
|
|
91
|
+
the breakpoints had. Pick a single breakpoint and the
|
|
92
|
+
canvas narrows to its width, its classes become the
|
|
93
|
+
effective ones whatever your window is doing, and the
|
|
94
|
+
tools write only that breakpoint. The first row has a
|
|
95
|
+
different size at each one, and the second an offset that
|
|
96
|
+
changes from phone to desktop.
|
|
97
|
+
</p>
|
|
68
98
|
<p class="form-text">
|
|
69
99
|
<strong>Equal and auto.</strong> A column is a number of
|
|
70
100
|
twelfths, <em>equal</em> (<code>col</code>: an equal share
|
|
@@ -78,16 +108,16 @@
|
|
|
78
108
|
<p class="form-text">
|
|
79
109
|
<strong>Columns per row.</strong> A row's
|
|
80
110
|
<em>Columns per row</em> field shares the line out among
|
|
81
|
-
the columns that have no size of their own. The
|
|
82
|
-
section
|
|
111
|
+
the columns that have no size of their own. The cards in
|
|
112
|
+
the second section are one per line on phones, two on
|
|
83
113
|
tablets, four on desktops.
|
|
84
114
|
</p>
|
|
85
115
|
<p class="form-text">
|
|
86
116
|
<strong>Sections.</strong> Bootstrap's containers, grouping
|
|
87
117
|
rows. Drag rows in and out of them, choose their width in
|
|
88
118
|
their settings, and switch views to see each one as wide
|
|
89
|
-
as its container would be.
|
|
90
|
-
|
|
119
|
+
as its container would be. The first two rows are in
|
|
120
|
+
none: drag one into a section.
|
|
91
121
|
</p>
|
|
92
122
|
<p class="form-text">Last width change: <span id="last">none yet</span></p>
|
|
93
123
|
<button class="btn btn-sm btn-secondary" id="output" type="button">Show the html this produces</button>
|
|
@@ -97,6 +127,24 @@
|
|
|
97
127
|
|
|
98
128
|
<div id="myGrid">
|
|
99
129
|
|
|
130
|
+
<div class="row">
|
|
131
|
+
<div class="col-3 col-sm-4 col-md-5 col-lg-6 col-xl-7 col-xxl-8">
|
|
132
|
+
<h2 class="h5">Sized per breakpoint</h2>
|
|
133
|
+
<p>3 on phone, 4 on tablet, 5 on small desktop, 6 on desktop, 7 on large, 8 on widescreen.</p>
|
|
134
|
+
</div>
|
|
135
|
+
<div class="col-9 col-sm-8 col-md-7 col-lg-6 col-xl-5 col-xxl-4">
|
|
136
|
+
<h2 class="h5">And the rest of the row</h2>
|
|
137
|
+
<p>The two columns always add up to twelve units.</p>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
<div class="row">
|
|
142
|
+
<div class="col-8 offset-2 col-lg-4 offset-lg-8">
|
|
143
|
+
<h2 class="h5">Indented</h2>
|
|
144
|
+
<p>Centred on phone, pushed to the right on desktop.</p>
|
|
145
|
+
</div>
|
|
146
|
+
</div>
|
|
147
|
+
|
|
100
148
|
<div class="container">
|
|
101
149
|
<div class="row">
|
|
102
150
|
<div class="col-auto">
|
|
@@ -123,13 +171,6 @@
|
|
|
123
171
|
</div>
|
|
124
172
|
</div>
|
|
125
173
|
|
|
126
|
-
<div class="row">
|
|
127
|
-
<div class="col-12">
|
|
128
|
-
<h2 class="h5">A row outside any section</h2>
|
|
129
|
-
<p>Full width of the canvas. Drag it into one of the sections above.</p>
|
|
130
|
-
</div>
|
|
131
|
-
</div>
|
|
132
|
-
|
|
133
174
|
</div> <!-- /#myGrid -->
|
|
134
175
|
</div> <!-- /.container-fluid -->
|
|
135
176
|
|
package/example/containers.html
CHANGED
|
@@ -51,8 +51,14 @@
|
|
|
51
51
|
accordion_tools: [],
|
|
52
52
|
});
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
// The button shows the html in place of the editor, and pressed again,
|
|
55
|
+
// the editor
|
|
56
|
+
var output = document.getElementById('output');
|
|
57
|
+
var outputLabel = output.textContent;
|
|
58
|
+
output.addEventListener('click', function() {
|
|
59
|
+
var showing = document.body.classList.toggle('showing-html');
|
|
60
|
+
if (showing) { document.getElementById('html').textContent = editor.getHtml(); }
|
|
61
|
+
output.textContent = showing ? 'Back to the editor' : outputLabel;
|
|
56
62
|
});
|
|
57
63
|
|
|
58
64
|
document.getElementById('authored').addEventListener('click', function() {
|
|
@@ -74,6 +80,11 @@
|
|
|
74
80
|
</script>
|
|
75
81
|
|
|
76
82
|
<title>Grid Editor containers example</title>
|
|
83
|
+
<style>
|
|
84
|
+
/* The html, shown in place of the editor and its toolbar */
|
|
85
|
+
body:not(.showing-html) #html { display: none; }
|
|
86
|
+
.showing-html #myGrid, .showing-html .ge-mainControls { display: none; }
|
|
87
|
+
</style>
|
|
77
88
|
</head>
|
|
78
89
|
<body>
|
|
79
90
|
<!-- Back to the demo index -->
|
|
@@ -30,8 +30,77 @@
|
|
|
30
30
|
}
|
|
31
31
|
</style>
|
|
32
32
|
|
|
33
|
-
<!--
|
|
34
|
-
|
|
33
|
+
<!-- The first plugin of this page's own: a container type, a Bootstrap
|
|
34
|
+
alert whose body is an editable region. -->
|
|
35
|
+
<script id="callout-plugin">
|
|
36
|
+
(function() {
|
|
37
|
+
|
|
38
|
+
// A plugin brings its own strings
|
|
39
|
+
Object.assign(GridEditor.locales.en, {
|
|
40
|
+
'container.add_callout': 'Callout',
|
|
41
|
+
'container.callout_title': 'Heads up',
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
// Registered under the type it builds, and called once per editor
|
|
45
|
+
// with the handle it works through. The handle hands out elements.
|
|
46
|
+
GridEditor.containers.callout = function(ge) {
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
// The toolbar button's label
|
|
50
|
+
labelKey: 'container.add_callout',
|
|
51
|
+
|
|
52
|
+
// A detached container. data-ge-container is what the
|
|
53
|
+
// editor recognises: never a class, so restyling is free.
|
|
54
|
+
create: function(options) {
|
|
55
|
+
var label = document.createElement('span');
|
|
56
|
+
label.className = 'ge-pane-label';
|
|
57
|
+
label.textContent = options.title || ge.t('container.callout_title');
|
|
58
|
+
|
|
59
|
+
var heading = document.createElement('h4');
|
|
60
|
+
heading.className = 'alert-heading';
|
|
61
|
+
heading.appendChild(label);
|
|
62
|
+
|
|
63
|
+
var callout = document.createElement('div');
|
|
64
|
+
callout.className = 'alert alert-primary';
|
|
65
|
+
callout.setAttribute('role', 'alert');
|
|
66
|
+
callout.appendChild(heading);
|
|
67
|
+
callout.appendChild(ge.defaultRegion());
|
|
68
|
+
|
|
69
|
+
var container = document.createElement('div');
|
|
70
|
+
container.setAttribute('data-ge-container', 'callout');
|
|
71
|
+
container.appendChild(callout);
|
|
72
|
+
return container;
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
// Editing furniture on, and off again. Anything mark()
|
|
76
|
+
// adds, unmark() has to take away: what is left is what
|
|
77
|
+
// getHtml hands back.
|
|
78
|
+
mark: function(container) {
|
|
79
|
+
ge.makeLabelEditable(ge.labelIn(container.querySelector('.alert-heading')));
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
unmark: function(container) {
|
|
83
|
+
ge.unwrapLabels(container);
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
// The same, on a copy of the canvas, for
|
|
87
|
+
// getHtml({ keepEditing: true }): unmark only touches
|
|
88
|
+
// markup, so it does for each callout on the copy
|
|
89
|
+
cleanMarkup: function(root) {
|
|
90
|
+
var definition = this;
|
|
91
|
+
root.querySelectorAll('[data-ge-container="callout"]').forEach(function(container) {
|
|
92
|
+
definition.unmark(container);
|
|
93
|
+
});
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
})();
|
|
99
|
+
</script>
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
<!-- The second: a drawer tool that opens a modal, and what the user
|
|
103
|
+
chooses there saved as an attribute on the node. -->
|
|
35
104
|
<script id="animation-plugin">
|
|
36
105
|
(function() {
|
|
37
106
|
|
|
@@ -211,8 +280,11 @@
|
|
|
211
280
|
|
|
212
281
|
<script>
|
|
213
282
|
document.addEventListener('DOMContentLoaded', function() {
|
|
214
|
-
|
|
215
|
-
|
|
283
|
+
// Show the two plugins written above as the page's own source
|
|
284
|
+
['callout', 'animation'].forEach(function(name) {
|
|
285
|
+
document.getElementById(name + '-source').textContent =
|
|
286
|
+
document.getElementById(name + '-plugin').textContent.trim().replace(/^ {8}/gm, '');
|
|
287
|
+
});
|
|
216
288
|
|
|
217
289
|
var editor = new GridEditor('#myGrid', {
|
|
218
290
|
new_row_layouts: [[12], [6, 6], [4, 4, 4]],
|
|
@@ -228,8 +300,14 @@
|
|
|
228
300
|
(payload.to ? payload.to.effect : 'no');
|
|
229
301
|
});
|
|
230
302
|
|
|
231
|
-
|
|
232
|
-
|
|
303
|
+
// The button shows the html in place of the editor, and pressed again,
|
|
304
|
+
// the editor
|
|
305
|
+
var output = document.getElementById('output');
|
|
306
|
+
var outputLabel = output.textContent;
|
|
307
|
+
output.addEventListener('click', function() {
|
|
308
|
+
var showing = document.body.classList.toggle('showing-html');
|
|
309
|
+
if (showing) { document.getElementById('html').textContent = editor.getPlainHtml(); }
|
|
310
|
+
output.textContent = showing ? 'Back to the editor' : outputLabel;
|
|
233
311
|
});
|
|
234
312
|
|
|
235
313
|
// The published page: the plain html, and a few lines of the
|
|
@@ -280,7 +358,12 @@
|
|
|
280
358
|
});
|
|
281
359
|
</script>
|
|
282
360
|
|
|
283
|
-
<title>Grid Editor example -
|
|
361
|
+
<title>Grid Editor example - plugins of your own</title>
|
|
362
|
+
<style>
|
|
363
|
+
/* The html, shown in place of the editor and its toolbar */
|
|
364
|
+
body:not(.showing-html) #html { display: none; }
|
|
365
|
+
.showing-html #myGrid, .showing-html .ge-mainControls { display: none; }
|
|
366
|
+
</style>
|
|
284
367
|
</head>
|
|
285
368
|
<body>
|
|
286
369
|
<!-- Back to the demo index -->
|
|
@@ -292,11 +375,25 @@
|
|
|
292
375
|
|
|
293
376
|
<div class="row my-3">
|
|
294
377
|
<div class="col-lg-9">
|
|
295
|
-
<h1 class="h4">
|
|
378
|
+
<h1 class="h4">Plugins of your own</h1>
|
|
379
|
+
<p class="form-text">
|
|
380
|
+
Everything past rows and columns is a plugin, and a page
|
|
381
|
+
can write its own, in a <code><script></code> after
|
|
382
|
+
the editor. This page has two, shown in full below; see
|
|
383
|
+
<a href="../docs/plugins.md">docs/plugins.md</a> for the
|
|
384
|
+
whole contract.
|
|
385
|
+
</p>
|
|
386
|
+
<p class="form-text">
|
|
387
|
+
<strong>A container: the callout.</strong> A Bootstrap
|
|
388
|
+
alert whose body is a region like any other. Its
|
|
389
|
+
<em>Callout</em> button in the toolbar adds one; it moves,
|
|
390
|
+
deletes, nests, takes an id and classes, and round-trips
|
|
391
|
+
through <code>getHtml</code>, in some thirty lines.
|
|
392
|
+
</p>
|
|
296
393
|
<p class="form-text">
|
|
394
|
+
<strong>A drawer tool with a modal: the animation.</strong>
|
|
297
395
|
The <i class="bi bi-magic"></i> tool in the drawer of a row,
|
|
298
|
-
a column, a text, a
|
|
299
|
-
page. It opens a modal, and what you choose there is saved
|
|
396
|
+
a column, a text, a container or an element opens a modal, and what you choose there is saved
|
|
300
397
|
on the node as a <code>data-animation</code> attribute, which
|
|
301
398
|
<code>getPlainHtml</code> keeps: only <code>data-ge-*</code>
|
|
302
399
|
attributes are the editor’s to take off. A node with
|
|
@@ -355,15 +452,36 @@
|
|
|
355
452
|
</div>
|
|
356
453
|
</div>
|
|
357
454
|
</div>
|
|
455
|
+
<div class="row">
|
|
456
|
+
<div class="col-lg-12">
|
|
457
|
+
<div data-ge-container="callout">
|
|
458
|
+
<div class="alert alert-primary" role="alert">
|
|
459
|
+
<h4 class="alert-heading">Heads up</h4>
|
|
460
|
+
<div class="row"><div class="col-lg-12">
|
|
461
|
+
<p>A callout, from the plugin written on this page. Double click its heading to rewrite it.</p>
|
|
462
|
+
</div></div>
|
|
463
|
+
</div>
|
|
464
|
+
</div>
|
|
465
|
+
</div>
|
|
466
|
+
</div>
|
|
358
467
|
</div>
|
|
359
468
|
|
|
360
469
|
<div class="row my-4">
|
|
361
470
|
<div class="col-lg-10">
|
|
362
|
-
<h2 class="h5">The plugin, in full</h2>
|
|
471
|
+
<h2 class="h5">The callout plugin, in full</h2>
|
|
472
|
+
<p class="form-text">
|
|
473
|
+
A container plugin: <code>create</code> builds one, and
|
|
474
|
+
<code>mark</code> and <code>unmark</code> put the editing
|
|
475
|
+
furniture on and take it off again. The shipped
|
|
476
|
+
<code>card</code> plugin is barely longer.
|
|
477
|
+
</p>
|
|
478
|
+
<pre class="border rounded p-3 bg-light"><code id="callout-source"></code></pre>
|
|
479
|
+
|
|
480
|
+
<h2 class="h5 mt-4">The animation plugin, in full</h2>
|
|
363
481
|
<p class="form-text">
|
|
364
482
|
A feature plugin: <code>drawerTools</code> puts a tool in
|
|
365
483
|
every drawer that has a gear, and the kind says whose drawer
|
|
366
|
-
it is.
|
|
484
|
+
it is.
|
|
367
485
|
</p>
|
|
368
486
|
<pre class="border rounded p-3 bg-light"><code id="animation-source"></code></pre>
|
|
369
487
|
</div>
|
package/example/elements.html
CHANGED
|
@@ -84,13 +84,24 @@
|
|
|
84
84
|
);
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
|
|
88
|
-
|
|
87
|
+
// The button shows the html in place of the editor, and pressed again,
|
|
88
|
+
// the editor
|
|
89
|
+
var output = document.getElementById('output');
|
|
90
|
+
var outputLabel = output.textContent;
|
|
91
|
+
output.addEventListener('click', function() {
|
|
92
|
+
var showing = document.body.classList.toggle('showing-html');
|
|
93
|
+
if (showing) { document.getElementById('html').textContent = editor.getHtml(); }
|
|
94
|
+
output.textContent = showing ? 'Back to the editor' : outputLabel;
|
|
89
95
|
});
|
|
90
96
|
});
|
|
91
97
|
</script>
|
|
92
98
|
|
|
93
99
|
<title>Grid Editor elements example</title>
|
|
100
|
+
<style>
|
|
101
|
+
/* The html, shown in place of the editor and its toolbar */
|
|
102
|
+
body:not(.showing-html) #html { display: none; }
|
|
103
|
+
.showing-html #myGrid, .showing-html .ge-mainControls { display: none; }
|
|
104
|
+
</style>
|
|
94
105
|
</head>
|
|
95
106
|
<body>
|
|
96
107
|
<!-- Back to the demo index -->
|
package/example/history.html
CHANGED
|
@@ -30,8 +30,10 @@
|
|
|
30
30
|
new GridEditor(grid, {
|
|
31
31
|
new_row_layouts: [[12], [6, 6], [4, 4, 4]],
|
|
32
32
|
content_types: [],
|
|
33
|
-
//
|
|
34
|
-
|
|
33
|
+
// Settings open in an offcanvas. A click makes a node the
|
|
34
|
+
// target, which is chosen again after an undo
|
|
35
|
+
settings_panel: 'offcanvas',
|
|
36
|
+
active_target: true,
|
|
35
37
|
history: {
|
|
36
38
|
max: 50, // the steps that can be undone
|
|
37
39
|
delay: 500, // a drag or a burst of changes is one step
|
|
@@ -69,7 +71,8 @@
|
|
|
69
71
|
<p class="text-body-secondary">
|
|
70
72
|
While you are writing in a text or a field, the keys undo what you
|
|
71
73
|
typed there, as usual; it becomes a step when you are done. The
|
|
72
|
-
|
|
74
|
+
node you clicked last - the target, with a dashed outline - is the
|
|
75
|
+
target again after a step, if it is still there.
|
|
73
76
|
<span id="log" class="fw-semibold"></span>
|
|
74
77
|
</p>
|
|
75
78
|
|
package/example/index.html
CHANGED
|
@@ -22,42 +22,18 @@
|
|
|
22
22
|
<code>src/</code>.
|
|
23
23
|
</p>
|
|
24
24
|
<p class="text-body-secondary">
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
and Bootstrap 5;
|
|
25
|
+
Every gesture works with a finger as well as with a mouse —
|
|
26
|
+
sorting, resizing a column, dragging a button off the toolbar
|
|
27
|
+
— so these are worth opening on a phone. The editor needs
|
|
28
|
+
<a href="https://sortablejs.github.io/Sortable/">SortableJS</a>
|
|
29
|
+
and Bootstrap 5; <a href="basic.html">The editor</a> loads
|
|
30
30
|
<code>grideditor.bundle.min.js</code> instead, which is the
|
|
31
31
|
editor and SortableJS in one file.
|
|
32
32
|
</p>
|
|
33
|
-
<p class="text-body-secondary">
|
|
34
|
-
New in 7.0: no jQuery. The editor is <code>new GridEditor(element)</code>,
|
|
35
|
-
as a script or an ES module, and a page written for 6.x keeps
|
|
36
|
-
working with jQuery and <code>grideditor.jquery.js</code> — see
|
|
37
|
-
<a href="adapter.html">The jQuery API</a>.
|
|
38
|
-
</p>
|
|
39
|
-
<p class="text-body-secondary">
|
|
40
|
-
New in 5.0: equal and auto columns, columns per row, and sections
|
|
41
|
-
for Bootstrap's containers — see
|
|
42
|
-
<a href="autocols.html">Column sizes and sections</a>. The
|
|
43
|
-
<em>All sizes</em> view now writes one class for every size.
|
|
44
|
-
</p>
|
|
45
|
-
<p class="text-body-secondary">
|
|
46
|
-
Since 4.1: utility plugins, which edit Bootstrap's responsive
|
|
47
|
-
utility classes — display, column order, alignment,
|
|
48
|
-
gutters and spacing — per breakpoint. See
|
|
49
|
-
<a href="utilities.html">Responsive utilities</a>.
|
|
50
|
-
</p>
|
|
51
|
-
<p class="text-body-secondary">
|
|
52
|
-
New in 7.3: the inline-style plugin, inline css by section with
|
|
53
|
-
Bootstrap's classes as chips, which also carries display,
|
|
54
|
-
spacing, text alignment and float. See
|
|
55
|
-
<a href="inline-style.html">Inline style</a>. In 8.0: flex, sticky and
|
|
56
|
-
Bootstrap 5.3's colors.
|
|
57
|
-
</p>
|
|
58
33
|
|
|
59
34
|
<div class="list-group my-4">
|
|
60
35
|
|
|
36
|
+
|
|
61
37
|
<a class="list-group-item list-group-item-action" href="basic.html">
|
|
62
38
|
<div class="d-flex justify-content-between">
|
|
63
39
|
<strong>The editor</strong>
|
|
@@ -66,12 +42,12 @@
|
|
|
66
42
|
<span class="text-body-secondary">tinyMCE in the content areas, the drawer as the drag handle, and the bundled build</span>
|
|
67
43
|
</a>
|
|
68
44
|
|
|
69
|
-
<a class="list-group-item list-group-item-action" href="plugins.html">
|
|
45
|
+
<a class="list-group-item list-group-item-action" href="custom-plugins.html">
|
|
70
46
|
<div class="d-flex justify-content-between">
|
|
71
|
-
<strong>Plugins</strong>
|
|
72
|
-
<code class="text-body-secondary">plugins.html</code>
|
|
47
|
+
<strong>Plugins of your own</strong>
|
|
48
|
+
<code class="text-body-secondary">custom-plugins.html</code>
|
|
73
49
|
</div>
|
|
74
|
-
<span class="text-body-secondary">
|
|
50
|
+
<span class="text-body-secondary">Two plugins written in the page itself: a container, and a drawer tool that opens a modal and saves its settings on the node as an attribute</span>
|
|
75
51
|
</a>
|
|
76
52
|
|
|
77
53
|
<a class="list-group-item list-group-item-action" href="codemirror.html">
|
|
@@ -82,21 +58,14 @@
|
|
|
82
58
|
<span class="text-body-secondary">The source button's html in a code editor, and edit_source to leave the button out</span>
|
|
83
59
|
</a>
|
|
84
60
|
|
|
85
|
-
<a class="list-group-item list-group-item-action" href="
|
|
61
|
+
<a class="list-group-item list-group-item-action" href="text-editors.html">
|
|
86
62
|
<div class="d-flex justify-content-between">
|
|
87
|
-
<strong>
|
|
88
|
-
<code class="text-body-secondary">
|
|
63
|
+
<strong>Text editors</strong>
|
|
64
|
+
<code class="text-body-secondary">text-editors.html</code>
|
|
89
65
|
</div>
|
|
90
|
-
<span class="text-body-secondary">
|
|
66
|
+
<span class="text-body-secondary">TinyMCE, CKEditor 5, summernote and one written in the page as a plugin, on the textTypes hook: one at a time or all together</span>
|
|
91
67
|
</a>
|
|
92
68
|
|
|
93
|
-
<a class="list-group-item list-group-item-action" href="attributes.html">
|
|
94
|
-
<div class="d-flex justify-content-between">
|
|
95
|
-
<strong>A plugin with a modal</strong>
|
|
96
|
-
<code class="text-body-secondary">attributes.html</code>
|
|
97
|
-
</div>
|
|
98
|
-
<span class="text-body-secondary">A drawer tool that opens a modal and saves its settings on the node as an attribute, with tinyMCE’s undo in mind</span>
|
|
99
|
-
</a>
|
|
100
69
|
|
|
101
70
|
<a class="list-group-item list-group-item-action" href="containers.html">
|
|
102
71
|
<div class="d-flex justify-content-between">
|
|
@@ -114,37 +83,23 @@
|
|
|
114
83
|
<span class="text-body-secondary">Element level controls, including an element with no visual output</span>
|
|
115
84
|
</a>
|
|
116
85
|
|
|
117
|
-
<a class="list-group-item list-group-item-action" href="
|
|
86
|
+
<a class="list-group-item list-group-item-action" href="columns.html">
|
|
118
87
|
<div class="d-flex justify-content-between">
|
|
119
|
-
<strong>
|
|
120
|
-
<code class="text-body-secondary">
|
|
88
|
+
<strong>Columns and breakpoints</strong>
|
|
89
|
+
<code class="text-body-secondary">columns.html</code>
|
|
121
90
|
</div>
|
|
122
|
-
<span class="text-body-secondary">The six breakpoints
|
|
91
|
+
<span class="text-body-secondary">The six breakpoints and the “all sizes” view, equal and auto columns, columns per row, and Bootstrap’s containers as sections</span>
|
|
123
92
|
</a>
|
|
124
93
|
|
|
125
|
-
<a class="list-group-item list-group-item-action" href="autocols.html">
|
|
126
|
-
<div class="d-flex justify-content-between">
|
|
127
|
-
<strong>Column sizes and sections</strong>
|
|
128
|
-
<code class="text-body-secondary">autocols.html</code>
|
|
129
|
-
</div>
|
|
130
|
-
<span class="text-body-secondary">Equal and auto columns, columns per row, and Bootstrap's containers as sections</span>
|
|
131
|
-
</a>
|
|
132
94
|
|
|
133
|
-
<a class="list-group-item list-group-item-action" href="
|
|
95
|
+
<a class="list-group-item list-group-item-action" href="style.html">
|
|
134
96
|
<div class="d-flex justify-content-between">
|
|
135
|
-
<strong>
|
|
136
|
-
<code class="text-body-secondary">
|
|
97
|
+
<strong>Style and responsive utilities</strong>
|
|
98
|
+
<code class="text-body-secondary">style.html</code>
|
|
137
99
|
</div>
|
|
138
|
-
<span class="text-body-secondary">Bootstrap
|
|
100
|
+
<span class="text-body-secondary">Inline css by section with Bootstrap’s classes as chips, and display, flex, order, alignment, gutters, spacing, text alignment and float per breakpoint</span>
|
|
139
101
|
</a>
|
|
140
102
|
|
|
141
|
-
<a class="list-group-item list-group-item-action" href="inline-style.html">
|
|
142
|
-
<div class="d-flex justify-content-between">
|
|
143
|
-
<strong>Inline style</strong>
|
|
144
|
-
<code class="text-body-secondary">inline-style.html</code>
|
|
145
|
-
</div>
|
|
146
|
-
<span class="text-body-secondary">The inline-style plugin: inline css for rows, columns, containers and elements, by section, with Bootstrap's classes for each as chips</span>
|
|
147
|
-
</a>
|
|
148
103
|
|
|
149
104
|
<a class="list-group-item list-group-item-action" href="locale.html">
|
|
150
105
|
<div class="d-flex justify-content-between">
|
|
@@ -154,21 +109,7 @@
|
|
|
154
109
|
<span class="text-body-secondary">The interface in Spanish, with a language switcher</span>
|
|
155
110
|
</a>
|
|
156
111
|
|
|
157
|
-
<a class="list-group-item list-group-item-action" href="ckeditor.html">
|
|
158
|
-
<div class="d-flex justify-content-between">
|
|
159
|
-
<strong>CKEditor</strong>
|
|
160
|
-
<code class="text-body-secondary">ckeditor.html</code>
|
|
161
|
-
</div>
|
|
162
|
-
<span class="text-body-secondary">CKEditor 5 in the content areas instead of tinyMCE</span>
|
|
163
|
-
</a>
|
|
164
112
|
|
|
165
|
-
<a class="list-group-item list-group-item-action" href="summernote.html">
|
|
166
|
-
<div class="d-flex justify-content-between">
|
|
167
|
-
<strong>Summernote</strong>
|
|
168
|
-
<code class="text-body-secondary">summernote.html</code>
|
|
169
|
-
</div>
|
|
170
|
-
<span class="text-body-secondary">The same, with summernote</span>
|
|
171
|
-
</a>
|
|
172
113
|
|
|
173
114
|
<a class="list-group-item list-group-item-action" href="clipboard.html">
|
|
174
115
|
<div class="d-flex justify-content-between">
|
|
@@ -202,6 +143,14 @@
|
|
|
202
143
|
<span class="text-body-secondary">The autosave plugin: drafts kept as the user edits and offered back after a reload, with import and export</span>
|
|
203
144
|
</a>
|
|
204
145
|
|
|
146
|
+
<a class="list-group-item list-group-item-action" href="playground.html">
|
|
147
|
+
<div class="d-flex justify-content-between">
|
|
148
|
+
<strong>Playground</strong>
|
|
149
|
+
<code class="text-body-secondary">playground.html</code>
|
|
150
|
+
</div>
|
|
151
|
+
<span class="text-body-secondary">Every plugin on one canvas, with the settings above it to turn things on and off, the options as code, and the events as they fire</span>
|
|
152
|
+
</a>
|
|
153
|
+
|
|
205
154
|
<a class="list-group-item list-group-item-action" href="adapter.html">
|
|
206
155
|
<div class="d-flex justify-content-between">
|
|
207
156
|
<strong>The jQuery API</strong>
|