@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
|
@@ -54,8 +54,9 @@ function partContent(ge, part, node, kind) {
|
|
|
54
54
|
|
|
55
55
|
/**
|
|
56
56
|
* `context` is the plugin's: its resolved sections, its parts by name, the
|
|
57
|
-
* state it keeps for the editor ({ open })
|
|
58
|
-
* the user opens or closes a section
|
|
57
|
+
* state it keeps for the editor ({ open }), `opened(key)`, called when
|
|
58
|
+
* the user opens or closes a section, the host's `browse` and whether the
|
|
59
|
+
* editor was `destroyed`.
|
|
59
60
|
*/
|
|
60
61
|
export function createAccordion(ge, node, kind, context) {
|
|
61
62
|
var inline = takesInlineStyle(node, kind);
|
|
@@ -122,7 +123,7 @@ export function createAccordion(ge, node, kind, context) {
|
|
|
122
123
|
|
|
123
124
|
var grid = body.appendChild(dom.element('div', { 'class': 'ge-inline-style-fields' }));
|
|
124
125
|
properties.forEach(function(property) {
|
|
125
|
-
var field = createStyleField(ge, node, property, changed);
|
|
126
|
+
var field = createStyleField(ge, node, property, changed, context);
|
|
126
127
|
fields.push(field);
|
|
127
128
|
grid.appendChild(field);
|
|
128
129
|
});
|
|
@@ -312,12 +312,53 @@ function shadowControl(ge, node, property, changed) {
|
|
|
312
312
|
return { element: holder, render: render, value: function() { return ge.hostStyle(node, property).value; } };
|
|
313
313
|
}
|
|
314
314
|
|
|
315
|
+
/**
|
|
316
|
+
* The button that opens the host's file browser: `browse(done, { node,
|
|
317
|
+
* property, value })`, answered by `done(url)` or by the promise it
|
|
318
|
+
* returns, whichever comes first. Nothing, an empty text or a value that is
|
|
319
|
+
* not a text leaves the field as it was, and so does an answer that comes
|
|
320
|
+
* when the node or the editor is gone. Errors are the host's: not caught.
|
|
321
|
+
*/
|
|
322
|
+
function browseButton(ge, node, property, context, current, apply) {
|
|
323
|
+
var button = dom.element('button', {
|
|
324
|
+
type: 'button',
|
|
325
|
+
'class': 'btn btn-outline-secondary ge-inline-style-browse',
|
|
326
|
+
title: ge.t('inline_style.browse'),
|
|
327
|
+
'aria-label': ge.t('inline_style.browse'),
|
|
328
|
+
});
|
|
329
|
+
button.appendChild(dom.element('i', { 'class': 'bi bi-folder2-open', 'aria-hidden': 'true' }));
|
|
330
|
+
|
|
331
|
+
button.addEventListener('click', function() {
|
|
332
|
+
var answered = false; // Each press takes one answer, the first
|
|
333
|
+
|
|
334
|
+
function answer(url) {
|
|
335
|
+
if (answered) { return; }
|
|
336
|
+
answered = true;
|
|
337
|
+
|
|
338
|
+
if (url === null || url === undefined) { return; }
|
|
339
|
+
if (typeof url !== 'string') {
|
|
340
|
+
ge.warn('inline_style.browse gave ' + typeof url + ', not a text: ignored');
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
if (url.trim() === '' || context.destroyed || !ge.canvas.contains(node)) { return; }
|
|
344
|
+
|
|
345
|
+
apply(url.trim());
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
var result = context.browse(answer, { node: node, property: property.name, value: shownUrl(current()) });
|
|
349
|
+
if (result && typeof result.then === 'function') { result.then(answer); }
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
return button;
|
|
353
|
+
}
|
|
354
|
+
|
|
315
355
|
/**
|
|
316
356
|
* The field for one property of a node. `changed` is called after every
|
|
317
357
|
* write that went through, so the plugin can bring the rest of its
|
|
318
|
-
* sections up to date.
|
|
358
|
+
* sections up to date. `context` is the plugin's, where the host's
|
|
359
|
+
* file browser is.
|
|
319
360
|
*/
|
|
320
|
-
export function createStyleField(ge, node, property, changed) {
|
|
361
|
+
export function createStyleField(ge, node, property, changed, context) {
|
|
321
362
|
var field = dom.element('div', { 'class': 'ge-inline-style-field', 'data-ge-inline-style-property': property.name });
|
|
322
363
|
var label = field.appendChild(dom.element('label', { 'class': 'ge-inline-style-label' }, ge.t(property.labelKey)));
|
|
323
364
|
var render;
|
|
@@ -350,8 +391,20 @@ export function createStyleField(ge, node, property, changed) {
|
|
|
350
391
|
field.appendChild(color.element);
|
|
351
392
|
render = function() { color.set(current()); };
|
|
352
393
|
} else if (property.type === 'url') {
|
|
353
|
-
var url =
|
|
394
|
+
var url = textInput();
|
|
354
395
|
url.addEventListener('change', function() { commit(urlValue(url.value), url); });
|
|
396
|
+
|
|
397
|
+
if (context && context.browse) {
|
|
398
|
+
var group = field.appendChild(dom.element('div', { 'class': 'input-group input-group-sm ge-inline-style-url' }));
|
|
399
|
+
group.appendChild(url);
|
|
400
|
+
group.appendChild(browseButton(ge, node, property, context, current, function(text) {
|
|
401
|
+
dom.removeClass(url, 'is-invalid');
|
|
402
|
+
url.value = text;
|
|
403
|
+
commit(urlValue(text), url);
|
|
404
|
+
}));
|
|
405
|
+
} else {
|
|
406
|
+
field.appendChild(url);
|
|
407
|
+
}
|
|
355
408
|
render = function() { fill(url, shownUrl(current())); };
|
|
356
409
|
} else if (property.type === 'shadow') {
|
|
357
410
|
var shadow = shadowControl(ge, node, property.name, changed);
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* sections: { border: { properties: [...], catalog: false }, position: false, … },
|
|
6
6
|
* spacing: { values, scale }, // the values offered, and what 0 to 5 come to
|
|
7
7
|
* visibility: { drawer }, // false leaves the eye out of the drawers
|
|
8
|
+
* browse: function(done, ctx), // a file browser for the url fields: see fields.js
|
|
8
9
|
* }
|
|
9
10
|
*
|
|
10
11
|
* Every section is on unless it is turned off.
|
|
@@ -49,10 +50,21 @@ function resolveSections(ge, given) {
|
|
|
49
50
|
return resolved;
|
|
50
51
|
}
|
|
51
52
|
|
|
53
|
+
/** The host's file browser, or null: anything but a function is ignored. */
|
|
54
|
+
function resolveBrowse(ge, given) {
|
|
55
|
+
if (given === undefined || given === null) { return null; }
|
|
56
|
+
if (typeof given === 'function') { return given; }
|
|
57
|
+
|
|
58
|
+
ge.warn('inline_style.browse must be a function: ignored');
|
|
59
|
+
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
|
|
52
63
|
export function resolveOptions(ge) {
|
|
53
64
|
var style = ge.settings.inline_style || {};
|
|
54
65
|
|
|
55
66
|
return {
|
|
67
|
+
browse: resolveBrowse(ge, style.browse),
|
|
56
68
|
sections: resolveSections(ge, style.sections),
|
|
57
69
|
spacing: style.spacing,
|
|
58
70
|
visibility: style.visibility,
|
|
@@ -266,6 +266,7 @@ GridEditor.locales.es = {
|
|
|
266
266
|
'inline_style.overridden': 'La clase {class} tiene prioridad sobre este valor',
|
|
267
267
|
'inline_style.invalid': 'Esta propiedad no acepta ese valor',
|
|
268
268
|
'inline_style.catalog': 'Clases de Bootstrap',
|
|
269
|
+
'inline_style.browse': 'Examinar…',
|
|
269
270
|
'inline_style.shadow_x': 'X',
|
|
270
271
|
'inline_style.shadow_y': 'Y',
|
|
271
272
|
'inline_style.shadow_blur': 'Desenfoque',
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
* inline_style.sections chooses the sections, and in each the properties and
|
|
24
24
|
* whether it has a catalog; inline_style.spacing is the options of spacing, whose
|
|
25
25
|
* scale the gaps share, and inline_style.visibility those of the eye.
|
|
26
|
+
* inline_style.browse is the host's file browser: with it, a url field - the
|
|
27
|
+
* background image - has a button that opens it, and takes the url it gives.
|
|
26
28
|
*/
|
|
27
29
|
import { GridEditor } from '../grideditor.js';
|
|
28
30
|
import { spacingPart } from '../inline-style/spacing.js';
|
|
@@ -52,6 +54,7 @@ Object.assign(GridEditor.locales.en, {
|
|
|
52
54
|
'inline_style.overridden': 'The class {class} takes priority over this value',
|
|
53
55
|
'inline_style.invalid': 'Not a value this property takes',
|
|
54
56
|
'inline_style.catalog': 'Bootstrap classes',
|
|
57
|
+
'inline_style.browse': 'Browse…',
|
|
55
58
|
'inline_style.shadow_x': 'X',
|
|
56
59
|
'inline_style.shadow_y': 'Y',
|
|
57
60
|
'inline_style.shadow_blur': 'Blur',
|
|
@@ -127,6 +130,8 @@ GridEditor.utilities['inline-style'] = function(ge) {
|
|
|
127
130
|
sections: options.sections,
|
|
128
131
|
parts: parts,
|
|
129
132
|
state: { open: null },
|
|
133
|
+
browse: options.browse,
|
|
134
|
+
destroyed: false,
|
|
130
135
|
opened: function(key) {
|
|
131
136
|
accordions.forEach(function(entry) { entry.accordion.open(key); });
|
|
132
137
|
},
|
|
@@ -178,6 +183,11 @@ GridEditor.utilities['inline-style'] = function(ge) {
|
|
|
178
183
|
|
|
179
184
|
drawerTools: each('drawerTools'),
|
|
180
185
|
|
|
186
|
+
// An answer from the host's browser can come after the editor is gone
|
|
187
|
+
onDestroy: function() {
|
|
188
|
+
context.destroyed = true;
|
|
189
|
+
},
|
|
190
|
+
|
|
181
191
|
onDeinit: function() {
|
|
182
192
|
each('onDeinit')();
|
|
183
193
|
accordions = [];
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*
|
|
16
16
|
* Each editor registers under GridEditor.texts, which is this file's own
|
|
17
17
|
* registry and not a contract: an editor of a host's own is a feature plugin
|
|
18
|
-
* of its own, as example/
|
|
18
|
+
* of its own, as example/text-editors.html shows.
|
|
19
19
|
*/
|
|
20
20
|
import { GridEditor } from '../grideditor.js';
|
|
21
21
|
import * as dom from '../dom.js';
|
package/src/less/grideditor.less
CHANGED
|
@@ -109,31 +109,54 @@
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
+
/* As wide as its buttons, so the more button comes right after them;
|
|
113
|
+
the room left over pushes the right-hand buttons to the end, from
|
|
114
|
+
the line or, while it shows, from the more button */
|
|
112
115
|
.ge-toolbar-start {
|
|
113
116
|
display: flex;
|
|
114
|
-
flex:
|
|
117
|
+
flex: 0 1 auto;
|
|
115
118
|
min-width: 0;
|
|
119
|
+
margin-right: auto;
|
|
116
120
|
overflow: hidden;
|
|
117
121
|
|
|
118
122
|
/* A group as wide as its buttons and a button as wide as its label:
|
|
119
123
|
squeezed, they would wrap their labels rather than overflow */
|
|
120
124
|
> .btn-group {
|
|
121
125
|
flex: none;
|
|
126
|
+
|
|
127
|
+
/* All its buttons behind the more button: no margin left over */
|
|
128
|
+
&:empty {
|
|
129
|
+
display: none;
|
|
130
|
+
}
|
|
122
131
|
}
|
|
123
132
|
.btn {
|
|
124
133
|
white-space: nowrap;
|
|
125
134
|
}
|
|
135
|
+
.btn.ge-before-more {
|
|
136
|
+
border-top-right-radius: 0;
|
|
137
|
+
border-bottom-right-radius: 0;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
.ge-toolbar-overflowing > .ge-toolbar-start {
|
|
141
|
+
margin-right: 0;
|
|
126
142
|
}
|
|
127
143
|
|
|
128
144
|
.ge-toolbar-more {
|
|
129
145
|
display: none;
|
|
130
146
|
position: relative;
|
|
131
147
|
flex: none;
|
|
132
|
-
margin: 0
|
|
148
|
+
margin: 0 auto 0 -1px;
|
|
149
|
+
padding-right: 5px;
|
|
133
150
|
|
|
134
151
|
&.ge-needed {
|
|
135
152
|
display: block;
|
|
136
153
|
}
|
|
154
|
+
|
|
155
|
+
/* Joined to the last button on the line, as in a btn-group */
|
|
156
|
+
> .btn {
|
|
157
|
+
border-top-left-radius: 0;
|
|
158
|
+
border-bottom-left-radius: 0;
|
|
159
|
+
}
|
|
137
160
|
}
|
|
138
161
|
|
|
139
162
|
.ge-toolbar-overflow {
|
|
@@ -141,7 +164,7 @@
|
|
|
141
164
|
position: absolute;
|
|
142
165
|
z-index: 30;
|
|
143
166
|
top: ~"calc(100% + 4px)";
|
|
144
|
-
right:
|
|
167
|
+
right: 5px;
|
|
145
168
|
flex-direction: column;
|
|
146
169
|
gap: 6px;
|
|
147
170
|
width: max-content;
|
package/types/grideditor.d.ts
CHANGED
|
@@ -140,6 +140,24 @@ export interface CreateOffcanvasOptions extends Placement, OffcanvasOptions {
|
|
|
140
140
|
trigger_label?: string;
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
+
/** What a file browser is told about the field it was opened from. */
|
|
144
|
+
export interface InlineStyleBrowseContext {
|
|
145
|
+
node: HTMLElement;
|
|
146
|
+
property: string;
|
|
147
|
+
/** What the field shows: the url, or the value as it is when it is not one. */
|
|
148
|
+
value: string;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* The host's file browser. It answers with `done(url)`, or with a promise of
|
|
153
|
+
* the url: the first answer counts. Nothing, `null` or an empty text leaves
|
|
154
|
+
* the field as it was.
|
|
155
|
+
*/
|
|
156
|
+
export type InlineStyleBrowse = (
|
|
157
|
+
done: (url?: string | null) => void,
|
|
158
|
+
context: InlineStyleBrowseContext,
|
|
159
|
+
) => void | Promise<string | null | undefined>;
|
|
160
|
+
|
|
143
161
|
/** The inline-style plugin's settings. */
|
|
144
162
|
export interface InlineStyleOptions {
|
|
145
163
|
/** Every section is on unless it is turned off here. */
|
|
@@ -148,6 +166,8 @@ export interface InlineStyleOptions {
|
|
|
148
166
|
spacing?: { values?: string[]; scale?: string[] };
|
|
149
167
|
/** The eye that hides and shows a node, the display family's: false leaves it out of the drawers. */
|
|
150
168
|
visibility?: { drawer?: boolean };
|
|
169
|
+
/** A file browser for the url fields: with it they have a button that opens it. */
|
|
170
|
+
browse?: InlineStyleBrowse;
|
|
151
171
|
}
|
|
152
172
|
|
|
153
173
|
/** What the sidebar shows while nothing is selected, instead of its message. */
|
package/example/breakpoints.html
DELETED
|
@@ -1,100 +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
|
-
<!-- Grid editor javascript -->
|
|
16
|
-
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.6/Sortable.min.js"></script>
|
|
17
|
-
<script src="../dist/grideditor.min.js"></script>
|
|
18
|
-
|
|
19
|
-
<script>
|
|
20
|
-
document.addEventListener('DOMContentLoaded', function() {
|
|
21
|
-
var editor = new GridEditor('#myGrid', {
|
|
22
|
-
new_row_layouts: [[12], [6,6], [4,4,4], [8,4]],
|
|
23
|
-
content_types: [],
|
|
24
|
-
|
|
25
|
-
// The default: a size or offset change is written once, as the
|
|
26
|
-
// class with no breakpoint, and replaces what the breakpoints
|
|
27
|
-
// said. Switch the dropdown to a single breakpoint to tune
|
|
28
|
-
// that one on its own.
|
|
29
|
-
default_view: 'all',
|
|
30
|
-
|
|
31
|
-
// A host that wants the old three-mode feel can offer three
|
|
32
|
-
// layout_modes: ['all', 'lg', 'sm', 'xs'],
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
document.getElementById('output').addEventListener('click', function() {
|
|
36
|
-
document.getElementById('html').textContent = editor.getHtml();
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
</script>
|
|
40
|
-
|
|
41
|
-
<title>Grid Editor breakpoints example</title>
|
|
42
|
-
</head>
|
|
43
|
-
<body>
|
|
44
|
-
<!-- Back to the demo index -->
|
|
45
|
-
<div class="container pt-3">
|
|
46
|
-
<a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
|
|
47
|
-
</div>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
<div class="container">
|
|
51
|
-
|
|
52
|
-
<div class="row my-3">
|
|
53
|
-
<div class="col-lg-8">
|
|
54
|
-
<h1 class="h4">Six breakpoints, and "all sizes"</h1>
|
|
55
|
-
<p class="form-text">
|
|
56
|
-
The dropdown on the right of the toolbar picks the layout
|
|
57
|
-
mode. In <strong>All sizes</strong> the canvas renders as
|
|
58
|
-
the browser would, and the width and indent tools write one
|
|
59
|
-
class for every size (<code>col-4</code>), replacing what
|
|
60
|
-
the breakpoints had. Pick a single breakpoint and the
|
|
61
|
-
canvas narrows to that tier's width, that tier's classes
|
|
62
|
-
become the effective ones whatever your window is doing,
|
|
63
|
-
and the tools write only that tier.
|
|
64
|
-
</p>
|
|
65
|
-
<p class="form-text">
|
|
66
|
-
The row below starts with a different size per tier, so
|
|
67
|
-
switching modes visibly changes it: 3 units on phone, 4 on
|
|
68
|
-
tablet, 6 on desktop, 8 on widescreen. The second row shows
|
|
69
|
-
offsets, which are indented per tier in the same way.
|
|
70
|
-
</p>
|
|
71
|
-
<button class="btn btn-sm btn-secondary" id="output" type="button">Show the html this produces</button>
|
|
72
|
-
<pre id="html" class="form-text"></pre>
|
|
73
|
-
</div>
|
|
74
|
-
</div>
|
|
75
|
-
|
|
76
|
-
<div id="myGrid">
|
|
77
|
-
|
|
78
|
-
<div class="row">
|
|
79
|
-
<div class="col-3 col-sm-4 col-md-5 col-lg-6 col-xl-7 col-xxl-8">
|
|
80
|
-
<h2 class="h5">Sized per tier</h2>
|
|
81
|
-
<p>3 on phone, 4 on tablet, 5 on small desktop, 6 on desktop, 7 on large, 8 on widescreen.</p>
|
|
82
|
-
</div>
|
|
83
|
-
<div class="col-9 col-sm-8 col-md-7 col-lg-6 col-xl-5 col-xxl-4">
|
|
84
|
-
<h2 class="h5">And the rest of the row</h2>
|
|
85
|
-
<p>The two columns always add up to twelve units.</p>
|
|
86
|
-
</div>
|
|
87
|
-
</div>
|
|
88
|
-
|
|
89
|
-
<div class="row">
|
|
90
|
-
<div class="col-8 offset-2 col-lg-4 offset-lg-8">
|
|
91
|
-
<h2 class="h5">Indented</h2>
|
|
92
|
-
<p>Centred on phone, pushed to the right on desktop.</p>
|
|
93
|
-
</div>
|
|
94
|
-
</div>
|
|
95
|
-
|
|
96
|
-
</div> <!-- /#myGrid -->
|
|
97
|
-
</div> <!-- /.container -->
|
|
98
|
-
|
|
99
|
-
</body>
|
|
100
|
-
</html>
|
package/example/ckeditor.html
DELETED
|
@@ -1,110 +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
|
-
<!-- CKEditor 5: its browser build, and its stylesheet -->
|
|
14
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/ckeditor5@48.5.2/dist/browser/ckeditor5.css">
|
|
15
|
-
<script src="https://cdn.jsdelivr.net/npm/ckeditor5@48.5.2/dist/browser/ckeditor5.umd.js"></script>
|
|
16
|
-
|
|
17
|
-
<!-- Grid editor CSS -->
|
|
18
|
-
<link rel="stylesheet" type="text/css" href="../dist/grideditor.css" />
|
|
19
|
-
<!-- Grid editor javascript -->
|
|
20
|
-
<script src="https://cdn.jsdelivr.net/npm/sortablejs@1.15.6/Sortable.min.js"></script>
|
|
21
|
-
<script src="../dist/grideditor.min.js"></script>
|
|
22
|
-
<!-- The text editor is a plugin of its own, loaded after the editor -->
|
|
23
|
-
<script src="../dist/plugins/grideditor.ckeditor.min.js"></script>
|
|
24
|
-
|
|
25
|
-
<script>
|
|
26
|
-
document.addEventListener('DOMContentLoaded', function() {
|
|
27
|
-
// Initialize grid editor
|
|
28
|
-
var editor = new GridEditor('#myGrid', {
|
|
29
|
-
new_row_layouts: [[12], [6, 6], [9, 3]],
|
|
30
|
-
content_types: ['ckeditor'],
|
|
31
|
-
ckeditor: {
|
|
32
|
-
// Anything InlineEditor.create takes, over the plugin's
|
|
33
|
-
// own defaults: its plugins, toolbar and headings
|
|
34
|
-
config: {
|
|
35
|
-
// CKEditor 5 is GPL-2.0-or-later: 'GPL' accepts that
|
|
36
|
-
// licence. A commercial licence passes its own key.
|
|
37
|
-
licenseKey: 'GPL',
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
// Get resulting html
|
|
43
|
-
var html = editor.getHtml();
|
|
44
|
-
console.log(html);
|
|
45
|
-
});
|
|
46
|
-
</script>
|
|
47
|
-
|
|
48
|
-
<title>Grid Editor example</title>
|
|
49
|
-
</head>
|
|
50
|
-
<body>
|
|
51
|
-
<!-- Back to the demo index -->
|
|
52
|
-
<div class="container pt-3">
|
|
53
|
-
<a class="link-secondary" href="index.html"><i class="bi bi-arrow-left"></i> All demos</a>
|
|
54
|
-
</div>
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
<div class="container">
|
|
58
|
-
<div id="myGrid">
|
|
59
|
-
|
|
60
|
-
<div class="row">
|
|
61
|
-
<div class="col-md-12">
|
|
62
|
-
<h1>Lorem ipsum dolor sit amet, consectetur</h1>
|
|
63
|
-
<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>
|
|
64
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quae laboriosam, excepturi quas.</p>
|
|
65
|
-
</div>
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
<div class="row">
|
|
69
|
-
<div class="col-md-4">
|
|
70
|
-
<h2>Lorem ipsum dolor</h2>
|
|
71
|
-
<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>
|
|
72
|
-
</div>
|
|
73
|
-
<div class="col-md-4">
|
|
74
|
-
<h2>Pariatur reprehenderit</h2>
|
|
75
|
-
<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>
|
|
76
|
-
</div>
|
|
77
|
-
<div class="col-md-4">
|
|
78
|
-
<h2>Pariatur reprehenderit</h2>
|
|
79
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ea excepturi ducimus numquam aut error corporis aspernatur ipsum quos eius culpa!</p>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<div class="row">
|
|
84
|
-
<div class="col-md-8">
|
|
85
|
-
<h2>Lorem ipsum dolor.</h2>
|
|
86
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Porro distinctio atque molestiae optio, consequuntur? Iusto ratione cumque dolor aut dolore!</p>
|
|
87
|
-
|
|
88
|
-
<div class="row">
|
|
89
|
-
<div class="col-md-6">
|
|
90
|
-
<hr>
|
|
91
|
-
<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>
|
|
92
|
-
</div>
|
|
93
|
-
<div class="col-md-6">
|
|
94
|
-
<hr>
|
|
95
|
-
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eveniet molestiae quaerat illum, consequuntur iusto aspernatur quam provident? Possimus!</p>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
</div>
|
|
99
|
-
|
|
100
|
-
<div class="col-md-4">
|
|
101
|
-
<h2>Lusto ratione</h2>
|
|
102
|
-
<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>
|
|
103
|
-
</div>
|
|
104
|
-
</div>
|
|
105
|
-
|
|
106
|
-
</div> <!-- /#myGrid -->
|
|
107
|
-
</div> <!-- /.container -->
|
|
108
|
-
|
|
109
|
-
</body>
|
|
110
|
-
</html>
|