@themarioga/grid-editor 3.2.1 → 4.1.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.
- package/BUILDING.md +12 -3
- package/CHANGELOG.md +87 -0
- package/README.md +79 -7
- package/UPGRADING.md +79 -0
- package/dist/grideditor.css +188 -20
- package/dist/grideditor.min.css +1 -1
- package/dist/grideditor.min.css.map +1 -1
- package/dist/jquery.grideditor.bundle.min.js +10 -0
- package/dist/jquery.grideditor.js +924 -174
- package/dist/jquery.grideditor.min.js +1 -1
- package/dist/jquery.grideditor.min.js.map +1 -1
- package/dist/locales/grideditor.es.js +34 -0
- package/dist/locales/grideditor.es.min.js +1 -1
- package/dist/locales/grideditor.es.min.js.map +1 -1
- package/dist/plugins/grideditor.accordion.js +8 -0
- package/dist/plugins/grideditor.accordion.min.js +1 -1
- package/dist/plugins/grideditor.accordion.min.js.map +1 -1
- package/dist/plugins/grideditor.alignment.js +81 -0
- package/dist/plugins/grideditor.alignment.min.js +2 -0
- package/dist/plugins/grideditor.alignment.min.js.map +1 -0
- package/dist/plugins/grideditor.elements.js +5 -5
- package/dist/plugins/grideditor.elements.min.js +1 -1
- package/dist/plugins/grideditor.elements.min.js.map +1 -1
- package/dist/plugins/grideditor.gutters.js +145 -0
- package/dist/plugins/grideditor.gutters.min.js +2 -0
- package/dist/plugins/grideditor.gutters.min.js.map +1 -0
- package/dist/plugins/grideditor.order.js +206 -0
- package/dist/plugins/grideditor.order.min.js +2 -0
- package/dist/plugins/grideditor.order.min.js.map +1 -0
- package/dist/plugins/grideditor.spacing.js +299 -0
- package/dist/plugins/grideditor.spacing.min.js +2 -0
- package/dist/plugins/grideditor.spacing.min.js.map +1 -0
- package/dist/plugins/grideditor.tabs.js +8 -0
- package/dist/plugins/grideditor.tabs.min.js +1 -1
- package/dist/plugins/grideditor.tabs.min.js.map +1 -1
- package/dist/plugins/grideditor.visibility.js +172 -0
- package/dist/plugins/grideditor.visibility.min.js +2 -0
- package/dist/plugins/grideditor.visibility.min.js.map +1 -0
- package/docs/events.md +26 -8
- package/docs/locale-keys.md +54 -0
- package/docs/plugins.md +129 -10
- package/example/autosave.html +6 -1
- package/example/basic.html +8 -2
- package/example/breakpoints.html +6 -1
- package/example/ckeditor.html +6 -1
- package/example/containers.html +5 -1
- package/example/elements.html +6 -1
- package/example/index.html +24 -1
- package/example/locale.html +6 -1
- package/example/plugins.html +6 -1
- package/example/summernote.html +6 -1
- package/example/utilities.html +145 -0
- package/example/wrap_content.html +6 -1
- package/package.json +3 -2
- package/src/js/jquery.grideditor.js +924 -174
- package/src/js/locales/grideditor.es.js +34 -0
- package/src/js/plugins/grideditor.accordion.js +8 -0
- package/src/js/plugins/grideditor.alignment.js +81 -0
- package/src/js/plugins/grideditor.elements.js +5 -5
- package/src/js/plugins/grideditor.gutters.js +145 -0
- package/src/js/plugins/grideditor.order.js +206 -0
- package/src/js/plugins/grideditor.spacing.js +299 -0
- package/src/js/plugins/grideditor.tabs.js +8 -0
- package/src/js/plugins/grideditor.visibility.js +172 -0
- package/src/less/grideditor.less +210 -18
|
@@ -0,0 +1,145 @@
|
|
|
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://code.jquery.com/jquery-4.0.0.min.js"></script>
|
|
12
|
+
<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>
|
|
13
|
+
|
|
14
|
+
<!-- Grid editor CSS -->
|
|
15
|
+
<link rel="stylesheet" type="text/css" href="../dist/grideditor.css" />
|
|
16
|
+
|
|
17
|
+
<!-- The editor, and the utility plugins. Each is a file of its own, and
|
|
18
|
+
loading it is what puts its field in the settings panels. -->
|
|
19
|
+
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.6/Sortable.min.js"></script>
|
|
20
|
+
<script src="../dist/jquery.grideditor.min.js"></script>
|
|
21
|
+
<script src="../dist/plugins/grideditor.visibility.min.js"></script>
|
|
22
|
+
<script src="../dist/plugins/grideditor.order.min.js"></script>
|
|
23
|
+
<script src="../dist/plugins/grideditor.alignment.min.js"></script>
|
|
24
|
+
<script src="../dist/plugins/grideditor.gutters.min.js"></script>
|
|
25
|
+
<script src="../dist/plugins/grideditor.spacing.min.js"></script>
|
|
26
|
+
|
|
27
|
+
<script>
|
|
28
|
+
$(function() {
|
|
29
|
+
$('#myGrid').gridEditor({
|
|
30
|
+
new_row_layouts: [[12], [6,6], [4,4,4], [8,4]],
|
|
31
|
+
content_types: [],
|
|
32
|
+
|
|
33
|
+
// Utilities are edited per breakpoint, so this page starts in
|
|
34
|
+
// one. Switch to "All sizes" to see the page as it will render.
|
|
35
|
+
default_view: 'xs',
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// Every change to a utility is announced, like any other operation
|
|
39
|
+
$('#myGrid').on('grideditor:after-utility', function(e, payload) {
|
|
40
|
+
$('#last').text(payload.family + ' at ' + payload.breakpoint + ': ' +
|
|
41
|
+
(payload.from === null ? 'default' : payload.from) + ' → ' +
|
|
42
|
+
(payload.to === null ? 'inherit' : payload.to));
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
$('#output').on('click', function() {
|
|
46
|
+
$('#html').text($('#myGrid').gridEditor('getHtml'));
|
|
47
|
+
});
|
|
48
|
+
});
|
|
49
|
+
</script>
|
|
50
|
+
|
|
51
|
+
<title>Grid Editor utilities example</title>
|
|
52
|
+
</head>
|
|
53
|
+
<body>
|
|
54
|
+
<!-- Back to the demo index -->
|
|
55
|
+
<div class="container pt-3">
|
|
56
|
+
<a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
<div class="container">
|
|
61
|
+
|
|
62
|
+
<div class="row my-3">
|
|
63
|
+
<div class="col-lg-8">
|
|
64
|
+
<h1 class="h4">Responsive utilities</h1>
|
|
65
|
+
<p class="form-text">
|
|
66
|
+
Bootstrap's responsive utility classes, edited per
|
|
67
|
+
breakpoint. Pick a breakpoint in the dropdown and every
|
|
68
|
+
change is written for that breakpoint alone; in
|
|
69
|
+
<strong>All sizes</strong> it is written once, for every
|
|
70
|
+
size. Each drawer's gear has a <strong>Responsive</strong>
|
|
71
|
+
section with a field per utility, which says what the
|
|
72
|
+
breakpoint inherits and from where.
|
|
73
|
+
</p>
|
|
74
|
+
<p class="form-text">
|
|
75
|
+
<strong>Visibility:</strong> the eye in a drawer hides the
|
|
76
|
+
node in the view being edited. It stays on the canvas,
|
|
77
|
+
faded, so you can show it again; in All sizes a badge says
|
|
78
|
+
at which breakpoints it is hidden. The sidebar below is
|
|
79
|
+
hidden on phones and tablets.
|
|
80
|
+
</p>
|
|
81
|
+
<p class="form-text">
|
|
82
|
+
<strong>Order:</strong> the arrows in a column's drawer
|
|
83
|
+
move it earlier or later in the view being edited,
|
|
84
|
+
without moving the markup. In the second row, "Second"
|
|
85
|
+
comes first on phones only.
|
|
86
|
+
</p>
|
|
87
|
+
<p class="form-text">
|
|
88
|
+
<strong>Alignment:</strong> fields in the panel of a row
|
|
89
|
+
(justify and align its columns) and of a column (align
|
|
90
|
+
itself). The third row centres its narrow column from
|
|
91
|
+
small desktop up.
|
|
92
|
+
</p>
|
|
93
|
+
<p class="form-text">
|
|
94
|
+
<strong>Gutters:</strong> fields in a row's panel. A row
|
|
95
|
+
with gutter classes is drawn with its real gutters; the
|
|
96
|
+
second row has none on phones and wide ones from small
|
|
97
|
+
desktop up.
|
|
98
|
+
</p>
|
|
99
|
+
<p class="form-text">
|
|
100
|
+
<strong>Spacing:</strong> a padding and a margin group in
|
|
101
|
+
every panel, each a side and a value. The centred column
|
|
102
|
+
below gets more padding from small desktop up.
|
|
103
|
+
</p>
|
|
104
|
+
<p class="form-text">Last change: <span id="last">none yet</span></p>
|
|
105
|
+
<button class="btn btn-sm btn-secondary" id="output" type="button">Show the html this produces</button>
|
|
106
|
+
<pre id="html" class="form-text"></pre>
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<div id="myGrid">
|
|
111
|
+
|
|
112
|
+
<div class="row">
|
|
113
|
+
<div class="col-12 col-md-8">
|
|
114
|
+
<h2 class="h5">Main content</h2>
|
|
115
|
+
<p>Full width on phones and tablets, two thirds from small desktop up.</p>
|
|
116
|
+
</div>
|
|
117
|
+
<div class="col-12 col-md-4 d-none d-md-block">
|
|
118
|
+
<h2 class="h5">Sidebar</h2>
|
|
119
|
+
<p>Only from small desktop up: <code>d-none d-md-block</code>.</p>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<div class="row g-0 g-md-5">
|
|
124
|
+
<div class="col-6">
|
|
125
|
+
<h2 class="h5">First</h2>
|
|
126
|
+
<p>Change the views and the utilities of these two.</p>
|
|
127
|
+
</div>
|
|
128
|
+
<div class="col-6 order-first order-sm-0">
|
|
129
|
+
<h2 class="h5">Second</h2>
|
|
130
|
+
<p>First on phones, with <code>order-first order-sm-0</code>.</p>
|
|
131
|
+
</div>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
<div class="row justify-content-md-center">
|
|
135
|
+
<div class="col-12 col-md-6 py-2 py-md-4">
|
|
136
|
+
<h2 class="h5">Centred</h2>
|
|
137
|
+
<p>Its row has <code>justify-content-md-center</code>, and it has <code>py-2 py-md-4</code>.</p>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
|
|
141
|
+
</div> <!-- /#myGrid -->
|
|
142
|
+
</div> <!-- /.container -->
|
|
143
|
+
|
|
144
|
+
</body>
|
|
145
|
+
</html>
|
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
|
|
10
10
|
<!-- Javascript dependencies -->
|
|
11
11
|
<script src="https://code.jquery.com/jquery-4.0.0.min.js"></script>
|
|
12
|
-
<script src="https://code.jquery.com/ui/1.14.2/jquery-ui.min.js"></script>
|
|
13
12
|
<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
13
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/tinymce/6.8.6/tinymce.min.js"></script>
|
|
15
14
|
|
|
16
15
|
<!-- Grid editor CSS -->
|
|
17
16
|
<link rel="stylesheet" type="text/css" href="../dist/grideditor.css" />
|
|
18
17
|
<!-- Grid editor javascript -->
|
|
18
|
+
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.6/Sortable.min.js"></script>
|
|
19
19
|
<script src="../dist/jquery.grideditor.min.js"></script>
|
|
20
20
|
|
|
21
21
|
<script>
|
|
@@ -35,6 +35,11 @@
|
|
|
35
35
|
<title>Grid Editor example</title>
|
|
36
36
|
</head>
|
|
37
37
|
<body>
|
|
38
|
+
<!-- Back to the demo index -->
|
|
39
|
+
<div class="container pt-3">
|
|
40
|
+
<a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
|
|
41
|
+
</div>
|
|
42
|
+
|
|
38
43
|
<div id="myGrid">
|
|
39
44
|
<h1>Hello!</h1>
|
|
40
45
|
<p>Test</p>
|
package/package.json
CHANGED
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"grunt-contrib-cssmin": "^5.0.0",
|
|
22
22
|
"grunt-contrib-less": "^3.0.0",
|
|
23
23
|
"grunt-contrib-uglify": "^5.2.2",
|
|
24
|
-
"grunt-contrib-watch": "^1.1.0"
|
|
24
|
+
"grunt-contrib-watch": "^1.1.0",
|
|
25
|
+
"sortablejs": "^1.15.6"
|
|
25
26
|
},
|
|
26
27
|
"name": "@themarioga/grid-editor",
|
|
27
28
|
"description": "Visual javascript editor for the bootstrap grid system, written as a jQuery plugin.",
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
"comment": "A scoped package publishes restricted unless it is told otherwise.",
|
|
34
35
|
"access": "public"
|
|
35
36
|
},
|
|
36
|
-
"version": "
|
|
37
|
+
"version": "4.1.0",
|
|
37
38
|
"main": "dist/jquery.grideditor.js",
|
|
38
39
|
"files": [
|
|
39
40
|
"dist",
|