@themarioga/grid-editor 8.0.0-beta.3 → 8.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/CHANGELOG.md +40 -0
- package/README.md +17 -11
- package/UPGRADING.md +21 -11
- package/dist/grideditor.bundle.min.js +3 -3
- package/dist/grideditor.css +52 -35
- package/dist/grideditor.d.ts +12 -9
- package/dist/grideditor.esm.js +44 -25
- package/dist/grideditor.js +44 -25
- package/dist/grideditor.min.css +1 -1
- package/dist/grideditor.min.css.map +1 -1
- package/dist/grideditor.min.js +2 -2
- package/dist/grideditor.min.js.map +3 -3
- package/dist/locales/grideditor.es.esm.js +70 -68
- package/dist/locales/grideditor.es.js +70 -68
- package/dist/locales/grideditor.es.min.js +1 -1
- package/dist/locales/grideditor.es.min.js.map +2 -2
- package/dist/plugins/grideditor.alignment.min.js.map +1 -1
- package/dist/plugins/{grideditor.style.esm.js → grideditor.inline-style.esm.js} +193 -184
- package/dist/plugins/{grideditor.style.js → grideditor.inline-style.js} +191 -182
- package/dist/plugins/grideditor.inline-style.min.js +4 -0
- package/dist/plugins/grideditor.inline-style.min.js.map +7 -0
- package/docs/locale-keys.md +82 -80
- package/docs/plugins.md +5 -5
- package/example/index.html +6 -6
- package/example/{style.html → inline-style.html} +5 -5
- package/example/utilities.html +3 -3
- package/package.json +1 -1
- package/src/js/grideditor.js +39 -22
- package/src/js/{style → inline-style}/accordion.js +9 -9
- package/src/js/{style → inline-style}/catalog.js +6 -6
- package/src/js/{style → inline-style}/custom.js +4 -4
- package/src/js/{style → inline-style}/display.js +2 -2
- package/src/js/{style → inline-style}/drawerflow.js +1 -1
- package/src/js/{style → inline-style}/fields.js +35 -25
- package/src/js/{style → inline-style}/flex.js +2 -2
- package/src/js/{style → inline-style}/float.js +2 -2
- package/src/js/{style → inline-style}/options.js +5 -5
- package/src/js/{style → inline-style}/sections.js +50 -50
- package/src/js/{style → inline-style}/spacing.js +2 -2
- package/src/js/{style → inline-style}/sticky.js +2 -2
- package/src/js/{style → inline-style}/textalign.js +2 -2
- package/src/js/locales/grideditor.es.js +70 -68
- package/src/js/plugins/grideditor.alignment.js +1 -1
- package/src/js/plugins/grideditor.inline-style.js +186 -0
- package/src/less/grideditor.less +43 -25
- package/types/grideditor.d.ts +12 -9
- package/dist/plugins/grideditor.style.min.js +0 -4
- package/dist/plugins/grideditor.style.min.js.map +0 -7
- package/src/js/plugins/grideditor.style.js +0 -185
package/dist/grideditor.css
CHANGED
|
@@ -194,6 +194,8 @@
|
|
|
194
194
|
btn-outline-secondary - and this only lays them out. */
|
|
195
195
|
.ge-details {
|
|
196
196
|
font-size: 0.8125rem;
|
|
197
|
+
/* Each section's heading: the general fields, and what plugins add */
|
|
198
|
+
/* Every section after the first, set off from the one above */
|
|
197
199
|
/* The utility plugins' fields, folded under one toggle */
|
|
198
200
|
}
|
|
199
201
|
.ge-details .ge-details-general {
|
|
@@ -201,6 +203,17 @@
|
|
|
201
203
|
flex-direction: column;
|
|
202
204
|
gap: 8px;
|
|
203
205
|
}
|
|
206
|
+
.ge-details .ge-section-title {
|
|
207
|
+
margin: 0 0 6px;
|
|
208
|
+
color: var(--bs-body-color, #333);
|
|
209
|
+
font-size: 0.8125rem;
|
|
210
|
+
font-weight: 600;
|
|
211
|
+
}
|
|
212
|
+
.ge-details .ge-panel-section,
|
|
213
|
+
.ge-details .ge-utilities {
|
|
214
|
+
padding-top: 10px;
|
|
215
|
+
border-top: 1px solid var(--bs-border-color-translucent, rgba(0, 0, 0, 0.1));
|
|
216
|
+
}
|
|
204
217
|
.ge-details .ge-field {
|
|
205
218
|
display: flex;
|
|
206
219
|
flex-direction: column;
|
|
@@ -222,7 +235,7 @@
|
|
|
222
235
|
.ge-details .ge-utilities > .ge-utilities-toggle {
|
|
223
236
|
display: block;
|
|
224
237
|
color: var(--bs-body-color, #333);
|
|
225
|
-
font-weight:
|
|
238
|
+
font-weight: 600;
|
|
226
239
|
cursor: pointer;
|
|
227
240
|
text-decoration: none;
|
|
228
241
|
}
|
|
@@ -283,93 +296,93 @@
|
|
|
283
296
|
.ge-details .ge-panel-section {
|
|
284
297
|
margin-top: 10px;
|
|
285
298
|
}
|
|
286
|
-
/* The style plugin's accordion: in a panel, or in the dialog, which is
|
|
299
|
+
/* The inline-style plugin's accordion: in a panel, or in the dialog, which is
|
|
287
300
|
outside any panel, so it carries the look of the fields it shares. */
|
|
288
|
-
.ge-style {
|
|
301
|
+
.ge-inline-style {
|
|
289
302
|
font-size: 0.8125rem;
|
|
290
303
|
}
|
|
291
|
-
.ge-style .accordion-button {
|
|
304
|
+
.ge-inline-style .accordion-button {
|
|
292
305
|
padding: 6px 10px;
|
|
293
306
|
font-size: 0.8125rem;
|
|
294
307
|
font-weight: 500;
|
|
295
308
|
}
|
|
296
|
-
.ge-style .accordion-body {
|
|
309
|
+
.ge-inline-style .accordion-body {
|
|
297
310
|
display: flex;
|
|
298
311
|
flex-direction: column;
|
|
299
312
|
gap: 10px;
|
|
300
313
|
padding: 8px 10px;
|
|
301
314
|
}
|
|
302
|
-
.ge-style .ge-style-label,
|
|
303
|
-
.ge-style .ge-utility-label,
|
|
304
|
-
.ge-style .ge-style-shadow-label {
|
|
315
|
+
.ge-inline-style .ge-inline-style-label,
|
|
316
|
+
.ge-inline-style .ge-utility-label,
|
|
317
|
+
.ge-inline-style .ge-inline-style-shadow-label {
|
|
305
318
|
color: var(--bs-secondary-color, #6c757d);
|
|
306
319
|
font-size: 0.75rem;
|
|
307
320
|
}
|
|
308
|
-
.ge-style .ge-style-note,
|
|
309
|
-
.ge-style .ge-utility-note,
|
|
310
|
-
.ge-style .ge-spacing-gutter {
|
|
321
|
+
.ge-inline-style .ge-inline-style-note,
|
|
322
|
+
.ge-inline-style .ge-utility-note,
|
|
323
|
+
.ge-inline-style .ge-spacing-gutter {
|
|
311
324
|
color: var(--bs-secondary-color, #666);
|
|
312
325
|
font-size: 0.6875rem;
|
|
313
326
|
}
|
|
314
|
-
.ge-style .ge-style-fields,
|
|
315
|
-
.ge-style .ge-spacing {
|
|
327
|
+
.ge-inline-style .ge-inline-style-fields,
|
|
328
|
+
.ge-inline-style .ge-spacing {
|
|
316
329
|
display: grid;
|
|
317
330
|
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
|
|
318
331
|
gap: 8px 10px;
|
|
319
332
|
}
|
|
320
|
-
.ge-style .ge-style-field,
|
|
321
|
-
.ge-style .ge-utility,
|
|
322
|
-
.ge-style .ge-spacing-group {
|
|
333
|
+
.ge-inline-style .ge-inline-style-field,
|
|
334
|
+
.ge-inline-style .ge-utility,
|
|
335
|
+
.ge-inline-style .ge-spacing-group {
|
|
323
336
|
display: flex;
|
|
324
337
|
flex-direction: column;
|
|
325
338
|
gap: 2px;
|
|
326
339
|
margin: 0;
|
|
327
340
|
}
|
|
328
|
-
.ge-style .ge-spacing-group .ge-utility > .ge-utility-label {
|
|
341
|
+
.ge-inline-style .ge-spacing-group .ge-utility > .ge-utility-label {
|
|
329
342
|
display: none;
|
|
330
343
|
}
|
|
331
|
-
.ge-style .ge-spacing-gutter {
|
|
344
|
+
.ge-inline-style .ge-spacing-gutter {
|
|
332
345
|
grid-column: 1 / -1;
|
|
333
346
|
}
|
|
334
|
-
.ge-style .ge-style-color .form-control-color {
|
|
347
|
+
.ge-inline-style .ge-inline-style-color .form-control-color {
|
|
335
348
|
flex: 0 0 2.25rem;
|
|
336
349
|
padding: 2px;
|
|
337
350
|
}
|
|
338
|
-
.ge-style .ge-style-shadow,
|
|
339
|
-
.ge-style .ge-style-field:has(.ge-style-shadow) {
|
|
351
|
+
.ge-inline-style .ge-inline-style-shadow,
|
|
352
|
+
.ge-inline-style .ge-inline-style-field:has(.ge-inline-style-shadow) {
|
|
340
353
|
grid-column: 1 / -1;
|
|
341
354
|
}
|
|
342
|
-
.ge-style .ge-style-shadow-builder {
|
|
355
|
+
.ge-inline-style .ge-inline-style-shadow-builder {
|
|
343
356
|
display: grid;
|
|
344
357
|
grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
|
|
345
358
|
gap: 4px 8px;
|
|
346
359
|
align-items: end;
|
|
347
360
|
}
|
|
348
|
-
.ge-style .ge-style-shadow-part {
|
|
361
|
+
.ge-inline-style .ge-inline-style-shadow-part {
|
|
349
362
|
display: flex;
|
|
350
363
|
flex-direction: column;
|
|
351
364
|
gap: 2px;
|
|
352
365
|
margin: 0;
|
|
353
366
|
}
|
|
354
|
-
.ge-style .ge-style-shadow-color {
|
|
367
|
+
.ge-inline-style .ge-inline-style-shadow-color {
|
|
355
368
|
grid-column: span 2;
|
|
356
369
|
}
|
|
357
|
-
.ge-style .ge-style-shadow-mode {
|
|
370
|
+
.ge-inline-style .ge-inline-style-shadow-mode {
|
|
358
371
|
display: inline-block;
|
|
359
372
|
margin-top: 2px;
|
|
360
373
|
font-size: 0.6875rem;
|
|
361
374
|
}
|
|
362
|
-
.ge-style .ge-style-catalog {
|
|
375
|
+
.ge-inline-style .ge-inline-style-catalog {
|
|
363
376
|
display: flex;
|
|
364
377
|
flex-direction: column;
|
|
365
378
|
gap: 4px;
|
|
366
379
|
}
|
|
367
|
-
.ge-style .ge-style-chips {
|
|
380
|
+
.ge-inline-style .ge-inline-style-chips {
|
|
368
381
|
display: flex;
|
|
369
382
|
flex-wrap: wrap;
|
|
370
383
|
gap: 3px;
|
|
371
384
|
}
|
|
372
|
-
.ge-style .ge-style-chip {
|
|
385
|
+
.ge-inline-style .ge-inline-style-chip {
|
|
373
386
|
--bs-btn-padding-y: 0;
|
|
374
387
|
--bs-btn-padding-x: 6px;
|
|
375
388
|
--bs-btn-font-size: 0.6875rem;
|
|
@@ -483,7 +496,6 @@
|
|
|
483
496
|
-moz-user-select: none;
|
|
484
497
|
-ms-user-select: none;
|
|
485
498
|
user-select: none;
|
|
486
|
-
background: blue;
|
|
487
499
|
margin: 0 -5px 5px;
|
|
488
500
|
display: block;
|
|
489
501
|
width: calc(100% + 2 * 5px);
|
|
@@ -508,6 +520,10 @@
|
|
|
508
520
|
border-top: 1px solid rgba(0, 0, 0, 0.05);
|
|
509
521
|
text-align: left;
|
|
510
522
|
cursor: auto;
|
|
523
|
+
/* The one line a drawer has room for needs no heading */
|
|
524
|
+
}
|
|
525
|
+
.ge-canvas.ge-editing .ge-tools-drawer > .ge-details > .ge-section-title {
|
|
526
|
+
display: none;
|
|
511
527
|
}
|
|
512
528
|
.ge-canvas.ge-editing .ge-tools-drawer > .ge-details .ge-details-general {
|
|
513
529
|
flex-direction: row;
|
|
@@ -528,6 +544,11 @@
|
|
|
528
544
|
margin-right: 0;
|
|
529
545
|
}
|
|
530
546
|
.ge-canvas.ge-editing .row > .ge-tools-drawer {
|
|
547
|
+
/* Bootstrap pads every child of a row by half its gutter, and
|
|
548
|
+
caps it at the row's width: the drawer is not a column */
|
|
549
|
+
padding-left: 0;
|
|
550
|
+
padding-right: 0;
|
|
551
|
+
max-width: none;
|
|
531
552
|
background: #e5e5e5;
|
|
532
553
|
}
|
|
533
554
|
.ge-canvas.ge-editing .row > .ge-tools-drawer > a {
|
|
@@ -4615,7 +4636,7 @@
|
|
|
4615
4636
|
margin-left: 91.66666667%;
|
|
4616
4637
|
}
|
|
4617
4638
|
/*
|
|
4618
|
-
* The style plugin's display. A node Bootstrap would hide is kept on the
|
|
4639
|
+
* The inline-style plugin's display. A node Bootstrap would hide is kept on the
|
|
4619
4640
|
* canvas - there would be nothing left to click to show it again - and shown
|
|
4620
4641
|
* as it would be if it were not hidden, which data-ge-display says. The
|
|
4621
4642
|
* selectors outweigh Bootstrap's d-* classes, which are !important too.
|
|
@@ -4666,7 +4687,7 @@
|
|
|
4666
4687
|
pointer-events: none;
|
|
4667
4688
|
}
|
|
4668
4689
|
/*
|
|
4669
|
-
* The style plugin's drawer on a flex or grid node: out of the flow, on top
|
|
4690
|
+
* The inline-style plugin's drawer on a flex or grid node: out of the flow, on top
|
|
4670
4691
|
* and as wide as the node, over a transparent top border as tall as it is.
|
|
4671
4692
|
* The border's width comes with the node's data-ge-drawer-out, from a rule
|
|
4672
4693
|
* per height the plugin writes. The selectors outweigh Bootstrap's border
|
|
@@ -4713,10 +4734,6 @@
|
|
|
4713
4734
|
.ge-canvas.ge-editing .row.ge-gutters > .ge-tools-drawer {
|
|
4714
4735
|
margin-top: 0;
|
|
4715
4736
|
margin-bottom: calc(5px - var(--bs-gutter-y));
|
|
4716
|
-
/* Bootstrap pads every child of a row by half its gutter, the drawer
|
|
4717
|
-
too; it keeps the padding a row with no gutter class gives it */
|
|
4718
|
-
padding-left: 0.75rem;
|
|
4719
|
-
padding-right: 0.75rem;
|
|
4720
4737
|
}
|
|
4721
4738
|
.ge-canvas.ge-editing .row.ge-gutters > .column {
|
|
4722
4739
|
padding-left: calc(var(--bs-gutter-x) * 0.5);
|
package/dist/grideditor.d.ts
CHANGED
|
@@ -53,11 +53,11 @@ export interface PresetClass {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/** A content filter: run on init and deinit with the canvas. A string names a function on window. */
|
|
56
|
-
/** A section of the style plugin's accordion. */
|
|
57
|
-
export type
|
|
56
|
+
/** A section of the inline-style plugin's accordion. */
|
|
57
|
+
export type InlineStyleSectionKey = 'size' | 'spacing' | 'border' | 'background' | 'text' | 'typography' | 'display' | 'flex' | 'position' | 'custom';
|
|
58
58
|
|
|
59
59
|
/** A section on or off, or on with some of its properties and without its catalog. */
|
|
60
|
-
export type
|
|
60
|
+
export type InlineStyleSection = boolean | { properties?: string[]; catalog?: boolean };
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* A tabs container's variant: its strip's style, width and alignment, and
|
|
@@ -77,10 +77,10 @@ export interface CreateTabsOptions extends Placement, TabsOptions {
|
|
|
77
77
|
labels?: string[];
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
/** The style plugin's settings. */
|
|
81
|
-
export interface
|
|
80
|
+
/** The inline-style plugin's settings. */
|
|
81
|
+
export interface InlineStyleOptions {
|
|
82
82
|
/** Every section is on unless it is turned off here. */
|
|
83
|
-
sections?: Partial<Record<
|
|
83
|
+
sections?: Partial<Record<InlineStyleSectionKey, InlineStyleSection>>;
|
|
84
84
|
/** The spacing section: the values offered, and what 0 to 5 come to - for the gaps too. */
|
|
85
85
|
spacing?: { values?: string[]; scale?: string[] };
|
|
86
86
|
/** The eye that hides and shows a node, the display family's: false leaves it out of the drawers. */
|
|
@@ -113,8 +113,8 @@ export interface GridEditorOptions {
|
|
|
113
113
|
content_types?: string[];
|
|
114
114
|
row_cols?: boolean;
|
|
115
115
|
utilities?: Record<string, unknown>;
|
|
116
|
-
/** The style plugin's sections, and the options of the utilities it carries. */
|
|
117
|
-
|
|
116
|
+
/** The inline-style plugin's sections, and the options of the utilities it carries. */
|
|
117
|
+
inline_style?: InlineStyleOptions;
|
|
118
118
|
/** The tabs plugin: the variant of the tabs containers made new. */
|
|
119
119
|
tabs?: TabsOptions;
|
|
120
120
|
elements?: { enabled?: boolean | 'auto'; selector?: string; auto?: boolean };
|
|
@@ -124,7 +124,10 @@ export interface GridEditorOptions {
|
|
|
124
124
|
add_column?: { size?: ColumnSize | null; picker?: boolean; delay?: number };
|
|
125
125
|
layout_modes?: View[];
|
|
126
126
|
default_view?: View;
|
|
127
|
-
|
|
127
|
+
/** enabled is the handle on the column's edge, tools the narrower and wider tools in its drawer. */
|
|
128
|
+
resize?: { enabled?: boolean; tools?: boolean; handles?: string; balance?: 'next' | false };
|
|
129
|
+
/** tools is the indent tools in a column's drawer. */
|
|
130
|
+
indent?: { tools?: boolean };
|
|
128
131
|
/** A textarea whose html the canvas starts with. */
|
|
129
132
|
source_textarea?: Target | '';
|
|
130
133
|
edit_source?: boolean;
|
package/dist/grideditor.esm.js
CHANGED
|
@@ -395,11 +395,18 @@ var NESTED_SETTINGS = {
|
|
|
395
395
|
},
|
|
396
396
|
resize: {
|
|
397
397
|
enabled: true,
|
|
398
|
+
// The handle on the column's edge
|
|
399
|
+
tools: true,
|
|
400
|
+
// The narrower and wider tools in the column's drawer
|
|
398
401
|
handles: "e",
|
|
399
402
|
// Which edges carry a handle: 'e', 'w', or 'e, w'
|
|
400
403
|
balance: "next"
|
|
401
404
|
// 'next' takes the units out of the following column
|
|
402
405
|
},
|
|
406
|
+
indent: {
|
|
407
|
+
tools: true
|
|
408
|
+
// The indent tools in the column's drawer
|
|
409
|
+
},
|
|
403
410
|
drag: {
|
|
404
411
|
delay: 0,
|
|
405
412
|
// Milliseconds to hold before a drag starts
|
|
@@ -595,6 +602,8 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
595
602
|
"default_view": ALL_VIEW,
|
|
596
603
|
"resize": NESTED_SETTINGS.resize,
|
|
597
604
|
// Resizing a column by dragging its edge
|
|
605
|
+
"indent": NESTED_SETTINGS.indent,
|
|
606
|
+
// Indenting a column, offset-*
|
|
598
607
|
"source_textarea": "",
|
|
599
608
|
"edit_source": true,
|
|
600
609
|
// The toolbar's button to edit the canvas as html
|
|
@@ -2529,30 +2538,34 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
2529
2538
|
}
|
|
2530
2539
|
var drawer = prependDrawer(col, "ge-tools-drawer");
|
|
2531
2540
|
createMoveTool(drawer);
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2541
|
+
if (settings.resize.tools !== false) {
|
|
2542
|
+
createTool(drawer, t("tool.column_narrower"), "ge-decrease-col-width", "bi bi-dash-lg", function(e) {
|
|
2543
|
+
resizeColumn(
|
|
2544
|
+
col,
|
|
2545
|
+
e.shiftKey ? smallest(settings.valid_col_sizes) : stepThrough(settings.valid_col_sizes.filter(isUnits), currentUnits(col), -1),
|
|
2546
|
+
"tool"
|
|
2547
|
+
);
|
|
2548
|
+
});
|
|
2549
|
+
createTool(drawer, t("tool.column_wider"), "ge-increase-col-width", "bi bi-plus-lg", function(e) {
|
|
2550
|
+
resizeColumn(
|
|
2551
|
+
col,
|
|
2552
|
+
e.shiftKey ? widestFor(col) : stepThrough(settings.valid_col_sizes.filter(isUnits), currentUnits(col), 1),
|
|
2553
|
+
"tool"
|
|
2554
|
+
);
|
|
2555
|
+
});
|
|
2556
|
+
}
|
|
2557
|
+
if (settings.indent.tools !== false) {
|
|
2558
|
+
createTool(drawer, t("tool.indent_decrease"), "ge-decrease-col-offset", "bi bi-text-indent-right", function(e) {
|
|
2559
|
+
indentColumn(
|
|
2560
|
+
col,
|
|
2561
|
+
e.shiftKey ? smallest(settings.valid_col_offsets) : stepThrough(settings.valid_col_offsets, currentOffset(col), -1),
|
|
2562
|
+
"tool"
|
|
2563
|
+
);
|
|
2564
|
+
});
|
|
2565
|
+
createTool(drawer, t("tool.indent_increase"), "ge-increase-col-offset", "bi bi-text-indent-left", function(e) {
|
|
2566
|
+
indentColumn(col, e.shiftKey ? deepestFor(col) : stepThrough(settings.valid_col_offsets, currentOffset(col), 1), "tool");
|
|
2567
|
+
});
|
|
2568
|
+
}
|
|
2556
2569
|
addSettingsTool(drawer, col, settings.col_classes);
|
|
2557
2570
|
hostTools(drawer, settings.col_tools);
|
|
2558
2571
|
createTool(drawer, t("tool.delete_column"), "ge-delete-column", "bi bi-trash", function() {
|
|
@@ -2692,6 +2705,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
2692
2705
|
}
|
|
2693
2706
|
function createDetails(container, cssClasses) {
|
|
2694
2707
|
var detailsDiv = element("div", { "class": "ge-details" });
|
|
2708
|
+
detailsDiv.appendChild(sectionTitle(t("panel.section_general")));
|
|
2695
2709
|
var general = detailsDiv.appendChild(element("div", { "class": "ge-details-general" }));
|
|
2696
2710
|
var field = function(label) {
|
|
2697
2711
|
var holder = element("label", { "class": "ge-field" });
|
|
@@ -2751,6 +2765,9 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
2751
2765
|
}
|
|
2752
2766
|
return detailsDiv;
|
|
2753
2767
|
}
|
|
2768
|
+
function sectionTitle(text) {
|
|
2769
|
+
return element("h6", { "class": "ge-section-title" }, text);
|
|
2770
|
+
}
|
|
2754
2771
|
function pluginSections(node) {
|
|
2755
2772
|
var kind = kindOf(node);
|
|
2756
2773
|
var mode = panelMode();
|
|
@@ -2764,6 +2781,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
2764
2781
|
}
|
|
2765
2782
|
var holder = element("div", { "class": "ge-panel-section", "data-ge-plugin": name });
|
|
2766
2783
|
if (mode === "offcanvas" || mode === "modal") {
|
|
2784
|
+
holder.appendChild(sectionTitle(t(section.labelKey)));
|
|
2767
2785
|
holder.appendChild(section.body);
|
|
2768
2786
|
} else {
|
|
2769
2787
|
var label = t(section.labelKey);
|
|
@@ -4100,7 +4118,7 @@ GridEditor.t = translate;
|
|
|
4100
4118
|
GridEditor._plainHtml = plainHtml;
|
|
4101
4119
|
GridEditor.Sortable = null;
|
|
4102
4120
|
GridEditor.bootstrap = null;
|
|
4103
|
-
GridEditor.version = false ? "dev" : "8.
|
|
4121
|
+
GridEditor.version = false ? "dev" : "8.1.0";
|
|
4104
4122
|
GridEditor.locales = {
|
|
4105
4123
|
en: {
|
|
4106
4124
|
"tool.move": "Move",
|
|
@@ -4130,6 +4148,7 @@ GridEditor.locales = {
|
|
|
4130
4148
|
"panel.done": "Done",
|
|
4131
4149
|
"panel.id": "Id",
|
|
4132
4150
|
"panel.classes": "Classes",
|
|
4151
|
+
"panel.section_general": "Id and classes",
|
|
4133
4152
|
"panel.kind_row": "Row",
|
|
4134
4153
|
"panel.kind_column": "Column",
|
|
4135
4154
|
"panel.kind_element": "Element",
|
package/dist/grideditor.js
CHANGED
|
@@ -396,11 +396,18 @@
|
|
|
396
396
|
},
|
|
397
397
|
resize: {
|
|
398
398
|
enabled: true,
|
|
399
|
+
// The handle on the column's edge
|
|
400
|
+
tools: true,
|
|
401
|
+
// The narrower and wider tools in the column's drawer
|
|
399
402
|
handles: "e",
|
|
400
403
|
// Which edges carry a handle: 'e', 'w', or 'e, w'
|
|
401
404
|
balance: "next"
|
|
402
405
|
// 'next' takes the units out of the following column
|
|
403
406
|
},
|
|
407
|
+
indent: {
|
|
408
|
+
tools: true
|
|
409
|
+
// The indent tools in the column's drawer
|
|
410
|
+
},
|
|
404
411
|
drag: {
|
|
405
412
|
delay: 0,
|
|
406
413
|
// Milliseconds to hold before a drag starts
|
|
@@ -596,6 +603,8 @@
|
|
|
596
603
|
"default_view": ALL_VIEW,
|
|
597
604
|
"resize": NESTED_SETTINGS.resize,
|
|
598
605
|
// Resizing a column by dragging its edge
|
|
606
|
+
"indent": NESTED_SETTINGS.indent,
|
|
607
|
+
// Indenting a column, offset-*
|
|
599
608
|
"source_textarea": "",
|
|
600
609
|
"edit_source": true,
|
|
601
610
|
// The toolbar's button to edit the canvas as html
|
|
@@ -2530,30 +2539,34 @@
|
|
|
2530
2539
|
}
|
|
2531
2540
|
var drawer = prependDrawer(col, "ge-tools-drawer");
|
|
2532
2541
|
createMoveTool(drawer);
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
|
|
2542
|
+
if (settings.resize.tools !== false) {
|
|
2543
|
+
createTool(drawer, t("tool.column_narrower"), "ge-decrease-col-width", "bi bi-dash-lg", function(e) {
|
|
2544
|
+
resizeColumn(
|
|
2545
|
+
col,
|
|
2546
|
+
e.shiftKey ? smallest(settings.valid_col_sizes) : stepThrough(settings.valid_col_sizes.filter(isUnits), currentUnits(col), -1),
|
|
2547
|
+
"tool"
|
|
2548
|
+
);
|
|
2549
|
+
});
|
|
2550
|
+
createTool(drawer, t("tool.column_wider"), "ge-increase-col-width", "bi bi-plus-lg", function(e) {
|
|
2551
|
+
resizeColumn(
|
|
2552
|
+
col,
|
|
2553
|
+
e.shiftKey ? widestFor(col) : stepThrough(settings.valid_col_sizes.filter(isUnits), currentUnits(col), 1),
|
|
2554
|
+
"tool"
|
|
2555
|
+
);
|
|
2556
|
+
});
|
|
2557
|
+
}
|
|
2558
|
+
if (settings.indent.tools !== false) {
|
|
2559
|
+
createTool(drawer, t("tool.indent_decrease"), "ge-decrease-col-offset", "bi bi-text-indent-right", function(e) {
|
|
2560
|
+
indentColumn(
|
|
2561
|
+
col,
|
|
2562
|
+
e.shiftKey ? smallest(settings.valid_col_offsets) : stepThrough(settings.valid_col_offsets, currentOffset(col), -1),
|
|
2563
|
+
"tool"
|
|
2564
|
+
);
|
|
2565
|
+
});
|
|
2566
|
+
createTool(drawer, t("tool.indent_increase"), "ge-increase-col-offset", "bi bi-text-indent-left", function(e) {
|
|
2567
|
+
indentColumn(col, e.shiftKey ? deepestFor(col) : stepThrough(settings.valid_col_offsets, currentOffset(col), 1), "tool");
|
|
2568
|
+
});
|
|
2569
|
+
}
|
|
2557
2570
|
addSettingsTool(drawer, col, settings.col_classes);
|
|
2558
2571
|
hostTools(drawer, settings.col_tools);
|
|
2559
2572
|
createTool(drawer, t("tool.delete_column"), "ge-delete-column", "bi bi-trash", function() {
|
|
@@ -2693,6 +2706,7 @@
|
|
|
2693
2706
|
}
|
|
2694
2707
|
function createDetails(container, cssClasses) {
|
|
2695
2708
|
var detailsDiv = element("div", { "class": "ge-details" });
|
|
2709
|
+
detailsDiv.appendChild(sectionTitle(t("panel.section_general")));
|
|
2696
2710
|
var general = detailsDiv.appendChild(element("div", { "class": "ge-details-general" }));
|
|
2697
2711
|
var field = function(label) {
|
|
2698
2712
|
var holder = element("label", { "class": "ge-field" });
|
|
@@ -2752,6 +2766,9 @@
|
|
|
2752
2766
|
}
|
|
2753
2767
|
return detailsDiv;
|
|
2754
2768
|
}
|
|
2769
|
+
function sectionTitle(text) {
|
|
2770
|
+
return element("h6", { "class": "ge-section-title" }, text);
|
|
2771
|
+
}
|
|
2755
2772
|
function pluginSections(node) {
|
|
2756
2773
|
var kind = kindOf(node);
|
|
2757
2774
|
var mode = panelMode();
|
|
@@ -2765,6 +2782,7 @@
|
|
|
2765
2782
|
}
|
|
2766
2783
|
var holder = element("div", { "class": "ge-panel-section", "data-ge-plugin": name });
|
|
2767
2784
|
if (mode === "offcanvas" || mode === "modal") {
|
|
2785
|
+
holder.appendChild(sectionTitle(t(section.labelKey)));
|
|
2768
2786
|
holder.appendChild(section.body);
|
|
2769
2787
|
} else {
|
|
2770
2788
|
var label = t(section.labelKey);
|
|
@@ -4101,7 +4119,7 @@
|
|
|
4101
4119
|
GridEditor._plainHtml = plainHtml;
|
|
4102
4120
|
GridEditor.Sortable = null;
|
|
4103
4121
|
GridEditor.bootstrap = null;
|
|
4104
|
-
GridEditor.version = false ? "dev" : "8.
|
|
4122
|
+
GridEditor.version = false ? "dev" : "8.1.0";
|
|
4105
4123
|
GridEditor.locales = {
|
|
4106
4124
|
en: {
|
|
4107
4125
|
"tool.move": "Move",
|
|
@@ -4131,6 +4149,7 @@
|
|
|
4131
4149
|
"panel.done": "Done",
|
|
4132
4150
|
"panel.id": "Id",
|
|
4133
4151
|
"panel.classes": "Classes",
|
|
4152
|
+
"panel.section_general": "Id and classes",
|
|
4134
4153
|
"panel.kind_row": "Row",
|
|
4135
4154
|
"panel.kind_column": "Column",
|
|
4136
4155
|
"panel.kind_element": "Element",
|