@themarioga/grid-editor 8.1.0 → 8.3.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 +22 -0
- package/README.md +19 -0
- package/dist/grideditor.bundle.min.js +3 -3
- package/dist/grideditor.css +76 -0
- package/dist/grideditor.d.ts +16 -0
- package/dist/grideditor.esm.js +218 -12
- package/dist/grideditor.jquery.js +3 -1
- package/dist/grideditor.jquery.min.js +1 -1
- package/dist/grideditor.jquery.min.js.map +2 -2
- package/dist/grideditor.js +218 -12
- 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 +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/docs/events.md +7 -0
- package/docs/locale-keys.md +1 -0
- package/package.json +1 -1
- package/src/js/grideditor.jquery.js +2 -0
- package/src/js/grideditor.js +229 -9
- package/src/js/locales/grideditor.es.js +1 -0
- package/src/less/grideditor.less +86 -0
- package/types/grideditor.d.ts +16 -0
package/dist/grideditor.css
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
position: relative;
|
|
3
3
|
min-height: 22px;
|
|
4
4
|
margin-bottom: 10px;
|
|
5
|
+
/* toolbar_overflow: 'menu'. The add buttons keep to one line, and the
|
|
6
|
+
ones that don't fit go behind a button at its end. The right-hand
|
|
7
|
+
buttons come before in the markup, so they are ordered back to how
|
|
8
|
+
floating them puts them. */
|
|
5
9
|
}
|
|
6
10
|
.ge-mainControls .ge-wrapper {
|
|
7
11
|
padding-top: 5px;
|
|
@@ -45,6 +49,69 @@
|
|
|
45
49
|
.ge-mainControls .ge-layout-mode {
|
|
46
50
|
margin-left: 5px;
|
|
47
51
|
}
|
|
52
|
+
.ge-mainControls .ge-wrapper.ge-toolbar-menu {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: flex-start;
|
|
55
|
+
}
|
|
56
|
+
.ge-mainControls .ge-wrapper.ge-toolbar-menu > .pull-right {
|
|
57
|
+
float: none;
|
|
58
|
+
}
|
|
59
|
+
.ge-mainControls .ge-wrapper.ge-toolbar-menu > .ge-toolbar-end {
|
|
60
|
+
order: 1;
|
|
61
|
+
}
|
|
62
|
+
.ge-mainControls .ge-wrapper.ge-toolbar-menu > .btn-group.pull-right {
|
|
63
|
+
order: 2;
|
|
64
|
+
}
|
|
65
|
+
.ge-mainControls .ge-wrapper.ge-toolbar-menu > .ge-layout-mode {
|
|
66
|
+
order: 3;
|
|
67
|
+
}
|
|
68
|
+
.ge-mainControls .ge-toolbar-start {
|
|
69
|
+
display: flex;
|
|
70
|
+
flex: 1 1 auto;
|
|
71
|
+
min-width: 0;
|
|
72
|
+
overflow: hidden;
|
|
73
|
+
}
|
|
74
|
+
.ge-mainControls .ge-toolbar-more {
|
|
75
|
+
display: none;
|
|
76
|
+
position: relative;
|
|
77
|
+
flex: none;
|
|
78
|
+
margin: 0 5px 0 4px;
|
|
79
|
+
}
|
|
80
|
+
.ge-mainControls .ge-toolbar-more.ge-needed {
|
|
81
|
+
display: block;
|
|
82
|
+
}
|
|
83
|
+
.ge-mainControls .ge-toolbar-overflow {
|
|
84
|
+
display: none;
|
|
85
|
+
position: absolute;
|
|
86
|
+
z-index: 30;
|
|
87
|
+
top: calc(100% + 4px);
|
|
88
|
+
right: 0;
|
|
89
|
+
flex-direction: column;
|
|
90
|
+
gap: 6px;
|
|
91
|
+
width: max-content;
|
|
92
|
+
max-width: min(420px, calc(100vw - 32px));
|
|
93
|
+
padding: 6px;
|
|
94
|
+
background: #fff;
|
|
95
|
+
border: 1px solid rgba(0, 0, 0, 0.15);
|
|
96
|
+
border-radius: 6px;
|
|
97
|
+
box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
|
|
98
|
+
/* Wrapped onto several lines, a group's buttons stand apart */
|
|
99
|
+
}
|
|
100
|
+
.ge-mainControls .ge-toolbar-overflow > .btn-group {
|
|
101
|
+
flex-wrap: wrap;
|
|
102
|
+
gap: 4px;
|
|
103
|
+
margin: 0;
|
|
104
|
+
}
|
|
105
|
+
.ge-mainControls .ge-toolbar-overflow > .btn-group:empty {
|
|
106
|
+
display: none;
|
|
107
|
+
}
|
|
108
|
+
.ge-mainControls .ge-toolbar-overflow > .btn-group > .btn.btn {
|
|
109
|
+
margin-left: 0;
|
|
110
|
+
border-radius: 4px;
|
|
111
|
+
}
|
|
112
|
+
.ge-mainControls .ge-toolbar-more.ge-open > .ge-toolbar-overflow {
|
|
113
|
+
display: flex;
|
|
114
|
+
}
|
|
48
115
|
.ge-mainControls .ge-toolbar-end {
|
|
49
116
|
margin-right: 5px;
|
|
50
117
|
}
|
|
@@ -439,6 +506,15 @@
|
|
|
439
506
|
outline: 2px solid var(--bs-primary, #0d6efd);
|
|
440
507
|
outline-offset: 1px;
|
|
441
508
|
}
|
|
509
|
+
/* Where the toolbar's buttons add, with active_target. A node that is both
|
|
510
|
+
shows both: this one a little further out */
|
|
511
|
+
.ge-canvas.ge-editing .ge-active-target {
|
|
512
|
+
outline: 2px dashed var(--bs-success, #198754);
|
|
513
|
+
outline-offset: -2px;
|
|
514
|
+
}
|
|
515
|
+
.ge-canvas.ge-editing .ge-active-target.ge-settings-target {
|
|
516
|
+
box-shadow: 0 0 0 4px var(--bs-success, #198754);
|
|
517
|
+
}
|
|
442
518
|
/* While editing */
|
|
443
519
|
.ge-canvas.ge-editing {
|
|
444
520
|
/* Content area */
|
package/dist/grideditor.d.ts
CHANGED
|
@@ -107,6 +107,10 @@ export interface GridEditorOptions {
|
|
|
107
107
|
text_tools?: HostTool[];
|
|
108
108
|
drag_handle?: 'tool' | 'drawer';
|
|
109
109
|
toolbar_drag?: 'auto' | boolean;
|
|
110
|
+
/** The add buttons that don't fit on the toolbar's line: behind a more button, or onto another line. Default 'menu'. */
|
|
111
|
+
toolbar_overflow?: 'menu' | 'wrap';
|
|
112
|
+
/** A click in a column or a section makes it where the toolbar's buttons add. Default false. */
|
|
113
|
+
active_target?: boolean;
|
|
110
114
|
/** The plugins to use, of any kind; null is every one loaded. */
|
|
111
115
|
plugins?: string[] | null;
|
|
112
116
|
/** The text editors offered, in order. */
|
|
@@ -218,6 +222,13 @@ export interface ViewChangePayload {
|
|
|
218
222
|
to: View;
|
|
219
223
|
}
|
|
220
224
|
|
|
225
|
+
/** The active target changed: the column or region the toolbar adds to, or null for the canvas. */
|
|
226
|
+
export interface TargetChangePayload {
|
|
227
|
+
canvas: HTMLElement;
|
|
228
|
+
target: HTMLElement | null;
|
|
229
|
+
from: HTMLElement | null;
|
|
230
|
+
}
|
|
231
|
+
|
|
221
232
|
/** The events, by name, with their payloads. Adding fires a specific name and the generic one. */
|
|
222
233
|
export interface GridEditorEventMap {
|
|
223
234
|
'grideditor:before-add': Payload;
|
|
@@ -255,6 +266,7 @@ export interface GridEditorEventMap {
|
|
|
255
266
|
'grideditor:after-copy': Payload;
|
|
256
267
|
'grideditor:popup-orphan': PopupOrphanPayload;
|
|
257
268
|
'grideditor:view-change': ViewChangePayload;
|
|
269
|
+
'grideditor:target-change': TargetChangePayload;
|
|
258
270
|
}
|
|
259
271
|
|
|
260
272
|
/** An event the editor dispatches on its canvas: a CustomEvent whose detail is the payload. */
|
|
@@ -343,6 +355,10 @@ export declare class GridEditor {
|
|
|
343
355
|
/** Take the editor off: the markup stays, everything else goes. */
|
|
344
356
|
destroy(): this;
|
|
345
357
|
changeView(view: View): this;
|
|
358
|
+
/** The column or region the toolbar adds to, or null. Null without active_target. */
|
|
359
|
+
getActiveTarget(): HTMLElement | null;
|
|
360
|
+
/** Make a column or region, or the first a selector matches, where the toolbar adds; null for none. */
|
|
361
|
+
setActiveTarget(target: HTMLElement | string | null): this;
|
|
346
362
|
getView(): View;
|
|
347
363
|
setLocale(code: string): this;
|
|
348
364
|
createRow(layout?: RowLayout, options?: Placement): HTMLElement | null;
|
package/dist/grideditor.esm.js
CHANGED
|
@@ -325,7 +325,9 @@ var METHODS = {
|
|
|
325
325
|
addAccordionItem: { value: true },
|
|
326
326
|
setLocale: {},
|
|
327
327
|
getUtility: { value: true },
|
|
328
|
-
setUtility: { value: true }
|
|
328
|
+
setUtility: { value: true },
|
|
329
|
+
getActiveTarget: { value: true },
|
|
330
|
+
setActiveTarget: {}
|
|
329
331
|
};
|
|
330
332
|
var PLACEMENTS = ["appendTo", "prependTo", "insertAfter", "insertBefore"];
|
|
331
333
|
var BREAKPOINTS = [
|
|
@@ -568,6 +570,10 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
568
570
|
// 'tool' for the move tool, 'drawer' for the whole drawer
|
|
569
571
|
"toolbar_drag": "auto",
|
|
570
572
|
// Drag the toolbar's buttons onto the canvas. 'auto' follows drag_handle
|
|
573
|
+
"toolbar_overflow": "menu",
|
|
574
|
+
// What doesn't fit on one line: 'menu' behind a button, 'wrap' onto another line
|
|
575
|
+
"active_target": false,
|
|
576
|
+
// A click in a column makes it where the toolbar's buttons add
|
|
571
577
|
"element_tools": [],
|
|
572
578
|
// Host tools on element drawers, same shape as row_tools
|
|
573
579
|
"element_classes": [],
|
|
@@ -629,6 +635,10 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
629
635
|
var sizePicker = null;
|
|
630
636
|
var sourceOpen = false;
|
|
631
637
|
var dropMarker = null;
|
|
638
|
+
var activeTarget = null;
|
|
639
|
+
var toolbarLifetime = null;
|
|
640
|
+
var closeOverflowMenu = function() {
|
|
641
|
+
};
|
|
632
642
|
var warnedHere = {};
|
|
633
643
|
var sortables = [];
|
|
634
644
|
var instanceId = ++editorCounter;
|
|
@@ -656,7 +666,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
656
666
|
removeConfirmModal();
|
|
657
667
|
removeSettingsPanels();
|
|
658
668
|
removeDialog();
|
|
659
|
-
|
|
669
|
+
removeMainControls();
|
|
660
670
|
createMainControls();
|
|
661
671
|
reset();
|
|
662
672
|
}
|
|
@@ -1033,6 +1043,34 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1033
1043
|
e.preventDefault();
|
|
1034
1044
|
}
|
|
1035
1045
|
}, signal);
|
|
1046
|
+
if (settings.active_target) {
|
|
1047
|
+
var pressed = null;
|
|
1048
|
+
canvas.addEventListener("pointerdown", function(e) {
|
|
1049
|
+
pressed = { x: e.clientX, y: e.clientY };
|
|
1050
|
+
}, signal);
|
|
1051
|
+
canvas.addEventListener("click", function(e) {
|
|
1052
|
+
var from = pressed;
|
|
1053
|
+
pressed = null;
|
|
1054
|
+
if (!hasClass(canvas, "ge-editing")) {
|
|
1055
|
+
return;
|
|
1056
|
+
}
|
|
1057
|
+
if (from && Math.abs(e.clientX - from.x) + Math.abs(e.clientY - from.y) > settings.drag.threshold) {
|
|
1058
|
+
return;
|
|
1059
|
+
}
|
|
1060
|
+
var region = closest(e.target, targetSelector());
|
|
1061
|
+
changeTarget(region && region !== canvas && canvas.contains(region) ? region : null);
|
|
1062
|
+
}, signal);
|
|
1063
|
+
document.addEventListener("keydown", function(e) {
|
|
1064
|
+
if (e.key !== "Escape" || !activeTarget || openSettingsState || dialogState) {
|
|
1065
|
+
return;
|
|
1066
|
+
}
|
|
1067
|
+
var focus = document.activeElement;
|
|
1068
|
+
if (focus && (is(focus, "input, textarea, select") || focus.isContentEditable)) {
|
|
1069
|
+
return;
|
|
1070
|
+
}
|
|
1071
|
+
changeTarget(null);
|
|
1072
|
+
}, signal);
|
|
1073
|
+
}
|
|
1036
1074
|
}
|
|
1037
1075
|
function textReady(block) {
|
|
1038
1076
|
if (!is(block, ".ge-content") || !canvas.contains(block)) {
|
|
@@ -1045,7 +1083,13 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1045
1083
|
mainControls = element("div", { "class": "ge-mainControls" });
|
|
1046
1084
|
htmlTextArea.parentNode.insertBefore(mainControls, htmlTextArea);
|
|
1047
1085
|
wrapper = mainControls.appendChild(element("div", { "class": "ge-wrapper ge-top" }));
|
|
1048
|
-
|
|
1086
|
+
var overflowMenu = settings.toolbar_overflow !== "wrap";
|
|
1087
|
+
var start = wrapper;
|
|
1088
|
+
if (overflowMenu) {
|
|
1089
|
+
addClass(wrapper, "ge-toolbar-menu");
|
|
1090
|
+
start = wrapper.appendChild(element("div", { "class": "ge-toolbar-start" }));
|
|
1091
|
+
}
|
|
1092
|
+
addRowGroup = start.appendChild(element("div", { "class": "ge-addRowGroup btn-group" }));
|
|
1049
1093
|
addContainerGroup = element("div", { "class": "ge-addContainerGroup btn-group ms-1" });
|
|
1050
1094
|
settings.new_row_layouts.forEach(function(layout) {
|
|
1051
1095
|
var grouped = !Array.isArray(layout);
|
|
@@ -1058,6 +1102,10 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1058
1102
|
"data-ge-layout": grouped ? JSON.stringify(layout) : layout.join(",")
|
|
1059
1103
|
});
|
|
1060
1104
|
btn.addEventListener("click", function() {
|
|
1105
|
+
if (activeTarget) {
|
|
1106
|
+
addToTarget(btn, "tool");
|
|
1107
|
+
return;
|
|
1108
|
+
}
|
|
1061
1109
|
var row = rowFromLayoutValue(layout);
|
|
1062
1110
|
var added = addNode("row", row, function() {
|
|
1063
1111
|
canvas.appendChild(row);
|
|
@@ -1076,7 +1124,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1076
1124
|
icon += "</div>";
|
|
1077
1125
|
btn.appendChild(create(icon));
|
|
1078
1126
|
});
|
|
1079
|
-
|
|
1127
|
+
start.appendChild(addContainerGroup);
|
|
1080
1128
|
Object.keys(CONTAINERS).forEach(function(type) {
|
|
1081
1129
|
var definition = CONTAINERS[type];
|
|
1082
1130
|
var button = labelButton(
|
|
@@ -1086,6 +1134,10 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1086
1134
|
);
|
|
1087
1135
|
attr(button, { "data-ge-toolbar": "container", "data-ge-container-type": type });
|
|
1088
1136
|
button.addEventListener("click", function() {
|
|
1137
|
+
if (activeTarget) {
|
|
1138
|
+
addToTarget(button, "tool");
|
|
1139
|
+
return;
|
|
1140
|
+
}
|
|
1089
1141
|
var row = createRow();
|
|
1090
1142
|
var column = row.appendChild(createColumn(MAX_COL_SIZE));
|
|
1091
1143
|
var container = column.appendChild(definition.create({}));
|
|
@@ -1156,8 +1208,99 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1156
1208
|
end.appendChild(button);
|
|
1157
1209
|
});
|
|
1158
1210
|
}
|
|
1211
|
+
if (overflowMenu) {
|
|
1212
|
+
createOverflowMenu(start);
|
|
1213
|
+
}
|
|
1159
1214
|
makeToolbarDraggable();
|
|
1160
1215
|
}
|
|
1216
|
+
function removeMainControls() {
|
|
1217
|
+
if (toolbarLifetime) {
|
|
1218
|
+
toolbarLifetime.abort();
|
|
1219
|
+
}
|
|
1220
|
+
toolbarLifetime = null;
|
|
1221
|
+
closeOverflowMenu = function() {
|
|
1222
|
+
};
|
|
1223
|
+
mainControls.remove();
|
|
1224
|
+
}
|
|
1225
|
+
function createOverflowMenu(start) {
|
|
1226
|
+
var more = create('<div class="ge-toolbar-more"><button type="button" class="btn btn-sm btn-primary"><i class="bi bi-three-dots"></i></button><div class="ge-toolbar-overflow"><div class="ge-addRowGroup btn-group"></div><div class="ge-addContainerGroup btn-group"></div></div></div>');
|
|
1227
|
+
start.parentNode.insertBefore(more, start.nextSibling);
|
|
1228
|
+
var toggle2 = one(more, "button");
|
|
1229
|
+
var panel = one(more, ".ge-toolbar-overflow");
|
|
1230
|
+
var spares = all(panel, ".btn-group");
|
|
1231
|
+
var homes = [];
|
|
1232
|
+
[addRowGroup, addContainerGroup].forEach(function(group, index) {
|
|
1233
|
+
Array.prototype.slice.call(group.children).forEach(function(button) {
|
|
1234
|
+
homes.push({ button, home: group, spare: spares[index] });
|
|
1235
|
+
});
|
|
1236
|
+
});
|
|
1237
|
+
toggle2.setAttribute("title", t("tool.more"));
|
|
1238
|
+
toggle2.setAttribute("aria-haspopup", "true");
|
|
1239
|
+
toggle2.setAttribute("aria-expanded", "false");
|
|
1240
|
+
var menuLifetime = toolbarLifetime = new AbortController();
|
|
1241
|
+
var signal = { signal: menuLifetime.signal };
|
|
1242
|
+
toggle2.addEventListener("click", function() {
|
|
1243
|
+
openOverflow(!hasClass(more, "ge-open"));
|
|
1244
|
+
});
|
|
1245
|
+
panel.addEventListener("click", function(e) {
|
|
1246
|
+
if (closest(e.target, "[data-ge-toolbar]")) {
|
|
1247
|
+
openOverflow(false);
|
|
1248
|
+
}
|
|
1249
|
+
});
|
|
1250
|
+
document.addEventListener("pointerdown", function(e) {
|
|
1251
|
+
if (!more.contains(e.target)) {
|
|
1252
|
+
openOverflow(false);
|
|
1253
|
+
}
|
|
1254
|
+
}, signal);
|
|
1255
|
+
document.addEventListener("keydown", function(e) {
|
|
1256
|
+
if (e.key === "Escape") {
|
|
1257
|
+
openOverflow(false);
|
|
1258
|
+
}
|
|
1259
|
+
}, signal);
|
|
1260
|
+
closeOverflowMenu = function() {
|
|
1261
|
+
openOverflow(false);
|
|
1262
|
+
};
|
|
1263
|
+
fit();
|
|
1264
|
+
if (window.ResizeObserver) {
|
|
1265
|
+
var pending = false;
|
|
1266
|
+
var observer = new window.ResizeObserver(function() {
|
|
1267
|
+
if (pending) {
|
|
1268
|
+
return;
|
|
1269
|
+
}
|
|
1270
|
+
pending = true;
|
|
1271
|
+
window.requestAnimationFrame(function() {
|
|
1272
|
+
pending = false;
|
|
1273
|
+
if (!menuLifetime.signal.aborted) {
|
|
1274
|
+
fit();
|
|
1275
|
+
}
|
|
1276
|
+
});
|
|
1277
|
+
});
|
|
1278
|
+
observer.observe(wrapper);
|
|
1279
|
+
observer.observe(start);
|
|
1280
|
+
menuLifetime.signal.addEventListener("abort", function() {
|
|
1281
|
+
observer.disconnect();
|
|
1282
|
+
});
|
|
1283
|
+
}
|
|
1284
|
+
function openOverflow(open) {
|
|
1285
|
+
open = open && hasClass(more, "ge-needed");
|
|
1286
|
+
toggleClass(more, "ge-open", open);
|
|
1287
|
+
toggle2.setAttribute("aria-expanded", open ? "true" : "false");
|
|
1288
|
+
}
|
|
1289
|
+
function fit() {
|
|
1290
|
+
homes.forEach(function(entry) {
|
|
1291
|
+
entry.home.appendChild(entry.button);
|
|
1292
|
+
});
|
|
1293
|
+
removeClass(more, "ge-needed");
|
|
1294
|
+
if (start.scrollWidth <= start.clientWidth) {
|
|
1295
|
+
openOverflow(false);
|
|
1296
|
+
return;
|
|
1297
|
+
}
|
|
1298
|
+
addClass(more, "ge-needed");
|
|
1299
|
+
for (var i = homes.length - 1; i >= 0 && start.scrollWidth > start.clientWidth; i--) {
|
|
1300
|
+
homes[i].spare.insertBefore(homes[i].button, homes[i].spare.firstChild);
|
|
1301
|
+
}
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1161
1304
|
function labelButton(button, label, iconClass) {
|
|
1162
1305
|
button.setAttribute("title", label);
|
|
1163
1306
|
if (iconClass) {
|
|
@@ -1179,6 +1322,10 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1179
1322
|
"data-ge-item": index
|
|
1180
1323
|
});
|
|
1181
1324
|
button.addEventListener("click", function() {
|
|
1325
|
+
if (activeTarget) {
|
|
1326
|
+
addToTarget(button, item.source || "tool");
|
|
1327
|
+
return;
|
|
1328
|
+
}
|
|
1182
1329
|
var made = item.create();
|
|
1183
1330
|
var placed = item.inColumn ? inRowOfItsOwn(made) : made;
|
|
1184
1331
|
var added = addNode(item.kind, made, function() {
|
|
@@ -1228,6 +1375,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1228
1375
|
}
|
|
1229
1376
|
helper = addClass(button.cloneNode(true), "ge-toolbar-helper");
|
|
1230
1377
|
document.body.appendChild(helper);
|
|
1378
|
+
closeOverflowMenu();
|
|
1231
1379
|
addClass(canvas, "ge-dropping");
|
|
1232
1380
|
}
|
|
1233
1381
|
css(helper, { left: move.pageX - 14, top: move.pageY - 14 });
|
|
@@ -1284,7 +1432,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1284
1432
|
});
|
|
1285
1433
|
return { region, before };
|
|
1286
1434
|
}
|
|
1287
|
-
function insertFeatureFromToolbar(button, where) {
|
|
1435
|
+
function insertFeatureFromToolbar(button, where, source) {
|
|
1288
1436
|
var item = FEATURES[button.getAttribute("data-ge-feature")].toolbar[parseInt(button.getAttribute("data-ge-item"), 10)];
|
|
1289
1437
|
var made = item.create();
|
|
1290
1438
|
var placed = made;
|
|
@@ -1303,7 +1451,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1303
1451
|
} else {
|
|
1304
1452
|
where.region.appendChild(placed);
|
|
1305
1453
|
}
|
|
1306
|
-
}, { parent: where.region, source: item.source || "dragdrop" });
|
|
1454
|
+
}, { parent: where.region, source: item.source || source || "dragdrop" });
|
|
1307
1455
|
}
|
|
1308
1456
|
function inRowOfItsOwn(node) {
|
|
1309
1457
|
var row = createRow();
|
|
@@ -1330,9 +1478,9 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1330
1478
|
dropMarker.remove();
|
|
1331
1479
|
}
|
|
1332
1480
|
}
|
|
1333
|
-
function insertFromToolbar(button, where) {
|
|
1481
|
+
function insertFromToolbar(button, where, source) {
|
|
1334
1482
|
if (button.getAttribute("data-ge-toolbar") === "feature") {
|
|
1335
|
-
return insertFeatureFromToolbar(button, where);
|
|
1483
|
+
return insertFeatureFromToolbar(button, where, source);
|
|
1336
1484
|
}
|
|
1337
1485
|
var container = button.getAttribute("data-ge-toolbar") === "container";
|
|
1338
1486
|
var type = button.getAttribute("data-ge-container-type");
|
|
@@ -1347,7 +1495,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1347
1495
|
} else {
|
|
1348
1496
|
where.region.appendChild(placed);
|
|
1349
1497
|
}
|
|
1350
|
-
}, { parent: where.region, source: "dragdrop" });
|
|
1498
|
+
}, { parent: where.region, source: source || "dragdrop" });
|
|
1351
1499
|
}
|
|
1352
1500
|
function widthFamily() {
|
|
1353
1501
|
var values = [];
|
|
@@ -1587,6 +1735,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1587
1735
|
}
|
|
1588
1736
|
function openSource() {
|
|
1589
1737
|
deinit();
|
|
1738
|
+
changeTarget(null);
|
|
1590
1739
|
htmlTextArea.style.height = 0.8 * document.documentElement.clientHeight + "px";
|
|
1591
1740
|
htmlTextArea.value = canvas.innerHTML;
|
|
1592
1741
|
show(htmlTextArea);
|
|
@@ -1602,6 +1751,32 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1602
1751
|
init();
|
|
1603
1752
|
hide(htmlTextArea);
|
|
1604
1753
|
}
|
|
1754
|
+
function targetSelector() {
|
|
1755
|
+
return [".column"].concat(pluginHooks("regions")).join(", ");
|
|
1756
|
+
}
|
|
1757
|
+
function isTarget(node) {
|
|
1758
|
+
return !!node && node !== canvas && canvas.contains(node) && is(node, targetSelector());
|
|
1759
|
+
}
|
|
1760
|
+
function changeTarget(node) {
|
|
1761
|
+
if (node === activeTarget) {
|
|
1762
|
+
return;
|
|
1763
|
+
}
|
|
1764
|
+
var from = activeTarget;
|
|
1765
|
+
if (from) {
|
|
1766
|
+
removeClass(from, "ge-active-target");
|
|
1767
|
+
}
|
|
1768
|
+
activeTarget = node;
|
|
1769
|
+
if (node && hasClass(canvas, "ge-editing")) {
|
|
1770
|
+
addClass(node, "ge-active-target");
|
|
1771
|
+
}
|
|
1772
|
+
emit("target-change", { canvas, target: node, from });
|
|
1773
|
+
}
|
|
1774
|
+
function addToTarget(button, source) {
|
|
1775
|
+
var made = insertFromToolbar(button, { region: activeTarget, before: null }, source);
|
|
1776
|
+
if (made && made.scrollIntoView) {
|
|
1777
|
+
made.scrollIntoView({ behavior: "smooth" });
|
|
1778
|
+
}
|
|
1779
|
+
}
|
|
1605
1780
|
function init() {
|
|
1606
1781
|
if (openSettingsState && !attached(openSettingsState.node)) {
|
|
1607
1782
|
closeSettings();
|
|
@@ -1625,10 +1800,18 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1625
1800
|
makeResizable();
|
|
1626
1801
|
switchLayout(curView);
|
|
1627
1802
|
refreshPreviews(canvas);
|
|
1803
|
+
if (activeTarget && !canvas.contains(activeTarget)) {
|
|
1804
|
+
changeTarget(null);
|
|
1805
|
+
} else if (activeTarget) {
|
|
1806
|
+
addClass(activeTarget, "ge-active-target");
|
|
1807
|
+
}
|
|
1628
1808
|
}
|
|
1629
1809
|
function deinit() {
|
|
1630
1810
|
closeSettings();
|
|
1631
1811
|
removeClass(canvas, "ge-editing ge-drag-drawer ge-dropping");
|
|
1812
|
+
if (activeTarget) {
|
|
1813
|
+
removeClass(activeTarget, "ge-active-target");
|
|
1814
|
+
}
|
|
1632
1815
|
plugins("onBeforeDeinit");
|
|
1633
1816
|
closeSizePicker();
|
|
1634
1817
|
hideDropMarker();
|
|
@@ -1670,10 +1853,11 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1670
1853
|
closeSource();
|
|
1671
1854
|
}
|
|
1672
1855
|
deinit();
|
|
1856
|
+
activeTarget = null;
|
|
1673
1857
|
removeConfirmModal();
|
|
1674
1858
|
removeSettingsPanels();
|
|
1675
1859
|
removeDialog();
|
|
1676
|
-
|
|
1860
|
+
removeMainControls();
|
|
1677
1861
|
htmlTextArea.remove();
|
|
1678
1862
|
lifetime.abort();
|
|
1679
1863
|
instances.delete(canvas);
|
|
@@ -4046,6 +4230,23 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
4046
4230
|
return featureMethods[name].apply(null, arguments);
|
|
4047
4231
|
};
|
|
4048
4232
|
}
|
|
4233
|
+
function apiSetActiveTarget(value) {
|
|
4234
|
+
if (!settings.active_target) {
|
|
4235
|
+
warnOnceHere("active_target", "setActiveTarget needs the active_target setting: without it, it does nothing");
|
|
4236
|
+
return;
|
|
4237
|
+
}
|
|
4238
|
+
if (value === null || value === void 0) {
|
|
4239
|
+
changeTarget(null);
|
|
4240
|
+
return;
|
|
4241
|
+
}
|
|
4242
|
+
var node = nodeFrom(value);
|
|
4243
|
+
if (!isTarget(node)) {
|
|
4244
|
+
var named = typeof value === "string" ? value : node ? "<" + node.tagName.toLowerCase() + ">" : String(value);
|
|
4245
|
+
warn("setActiveTarget: " + named + " is not a column or a region of the canvas");
|
|
4246
|
+
return;
|
|
4247
|
+
}
|
|
4248
|
+
changeTarget(node);
|
|
4249
|
+
}
|
|
4049
4250
|
var own = {
|
|
4050
4251
|
getHtml,
|
|
4051
4252
|
getPlainHtml,
|
|
@@ -4079,7 +4280,11 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
4079
4280
|
},
|
|
4080
4281
|
setLocale,
|
|
4081
4282
|
getUtility,
|
|
4082
|
-
setUtility
|
|
4283
|
+
setUtility,
|
|
4284
|
+
getActiveTarget: function() {
|
|
4285
|
+
return settings.active_target ? activeTarget : null;
|
|
4286
|
+
},
|
|
4287
|
+
setActiveTarget: apiSetActiveTarget
|
|
4083
4288
|
};
|
|
4084
4289
|
Object.keys(own).forEach(function(name) {
|
|
4085
4290
|
var value = !!(METHODS[name] && METHODS[name].value);
|
|
@@ -4118,7 +4323,7 @@ GridEditor.t = translate;
|
|
|
4118
4323
|
GridEditor._plainHtml = plainHtml;
|
|
4119
4324
|
GridEditor.Sortable = null;
|
|
4120
4325
|
GridEditor.bootstrap = null;
|
|
4121
|
-
GridEditor.version = false ? "dev" : "8.
|
|
4326
|
+
GridEditor.version = false ? "dev" : "8.3.0";
|
|
4122
4327
|
GridEditor.locales = {
|
|
4123
4328
|
en: {
|
|
4124
4329
|
"tool.move": "Move",
|
|
@@ -4143,6 +4348,7 @@ GridEditor.locales = {
|
|
|
4143
4348
|
"tool.indent_increase": "Increase indent\n(hold shift for max)",
|
|
4144
4349
|
"tool.edit_source": "Edit Source Code",
|
|
4145
4350
|
"tool.preview": "Preview",
|
|
4351
|
+
"tool.more": "More",
|
|
4146
4352
|
"panel.title": "{kind} settings",
|
|
4147
4353
|
"panel.close": "Close",
|
|
4148
4354
|
"panel.done": "Done",
|
|
@@ -45,7 +45,9 @@
|
|
|
45
45
|
addAccordionItem: { value: true },
|
|
46
46
|
setLocale: {},
|
|
47
47
|
getUtility: { value: true },
|
|
48
|
-
setUtility: { value: true }
|
|
48
|
+
setUtility: { value: true },
|
|
49
|
+
getActiveTarget: { value: true },
|
|
50
|
+
setActiveTarget: {}
|
|
49
51
|
};
|
|
50
52
|
var TOOL_SETTINGS = [
|
|
51
53
|
"row_tools",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var u=window.GridEditor;if(!u||typeof u.get!="function")throw new Error("grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, its locales and grideditor.jquery.js");var i=window.jQuery,
|
|
1
|
+
(()=>{var u=window.GridEditor;if(!u||typeof u.get!="function")throw new Error("grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, its locales and grideditor.jquery.js");var i=window.jQuery,T=function(a,o){return u.t({locale:"en"},a,o)},m={};function b(a,o){m[a]||(m[a]=!0,window.console&&window.console.warn&&window.console.warn("grid-editor: "+o))}!i||!i.fn?b("no-jquery",T("warning.adapter_no_jquery")):x();function x(){var a={getHtml:{value:!0},getPlainHtml:{value:!0},init:{},deinit:{},reset:{},destroy:{},changeView:{},getView:{value:!0},createRow:{value:!0},createColumn:{value:!0},createElement:{value:!0},createText:{value:!0},createSection:{value:!0},createContainer:{value:!0},addTab:{value:!0},addAccordionItem:{value:!0},setLocale:{},getUtility:{value:!0},setUtility:{value:!0},getActiveTarget:{value:!0},setActiveTarget:{}},o=["row_tools","col_tools","element_tools","container_tools","tab_tools","accordion_tools","text_tools"];function g(r){return!!r&&r.nodeType===1}function l(r){return r instanceof i?r[0]||null:r}function h(r){if(r instanceof i)return l(r);if(r&&typeof r=="object"&&!Array.isArray(r)&&!g(r)){var t={};return Object.keys(r).forEach(function(e){t[e]=l(r[e])}),t}return r}function w(r){return g(r)?i(r):r}var s=new WeakMap;function p(r){if(!r||typeof r!="object")return r;if(s.has(r))return s.get(r);var t=Object.assign({},r);return["node","parent","canvas"].forEach(function(e){e in r&&(t[e]=i(r[e]||[]))}),r.container&&(t.container=i(r.container)),Array.isArray(r.nodes)&&(t.node=i(r.nodes)),["from","to"].forEach(function(e){var n=r[e];n&&typeof n=="object"&&"parent"in n&&(t[e]=Object.assign({},n,{parent:i(n.parent||[])}))}),s.set(r,t),t}var v=i.event.dispatch;i.event.dispatch=function(r){return arguments.length===1&&r instanceof window.CustomEvent&&typeof r.type=="string"&&r.type.indexOf("grideditor:")===0?v.call(this,r,p(r.detail)):v.apply(this,arguments)};function y(r){return function(t){return r.call(this,i.event.fix(t))}}function _(r){if(!r||!r.on)return r;var t;return typeof r.on=="function"?t=y(r.on):(t={},Object.keys(r.on).forEach(function(e){t[e]=y(r.on[e])})),Object.assign({},r,{on:t})}function j(r){return function(t,e){var n=typeof r=="string"?window[r]:r;return n(i(t),e)}}function E(r){if(r=Object.assign({},r||{}),r.callbacks){var t={};Object.keys(r.callbacks).forEach(function(n){var c=r.callbacks[n];t[n]=typeof c=="function"?function(f){return c(p(f))}:c}),r.callbacks=t}if(r.custom_filter&&r.custom_filter.length){var e=typeof r.custom_filter=="string"||typeof r.custom_filter=="function"?[r.custom_filter]:Array.prototype.slice.call(r.custom_filter);r.custom_filter=e.map(j)}return o.forEach(function(n){Array.isArray(r[n])&&(r[n]=r[n].map(_))}),r.source_textarea=l(r.source_textarea),r}function A(r){var t={canvas:i(r.canvas)};return Object.keys(a).forEach(function(e){t[e]=function(){var n=r[e].apply(r,Array.prototype.map.call(arguments,h));return n===r?void 0:w(n)}}),Object.defineProperty(t,"settings",{enumerable:!0,get:function(){return r.settings}}),t}u._created.push(function(r){i.data(r.canvas,"grideditor",A(r));var t=r.destroy;r.destroy=function(){var e=t.apply(this,arguments);return i.removeData(r.canvas,"grideditor"),e}});function O(r,t,e){var n=a[t];if(!n)return b("method:"+t,'unknown method "'+t+'"'),r;if(e=e.map(h),n.value){var c=r.first();if(!c.length)return null;var f=u.get(c[0]);return f?w(f[t].apply(f,e)):t==="getHtml"?c.html():t==="getPlainHtml"?u._plainHtml(c.html()):null}return r.each(function(){var d=u.get(this);d&&d[t].apply(d,e)}),r}i.fn.gridEditor=function(r){if(typeof r=="string")return O(this,r,Array.prototype.slice.call(arguments,1));var t=E(r);return this.each(function(){u.create(this,t)}),this},i.fn.gridEditor.locales=u.locales,i.fn.gridEditor.t=u.t}})();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/js/register.js", "../src/js/grideditor.jquery.js"],
|
|
4
|
-
"sourcesContent": ["/**\n * What a plugin's or a locale's classic script imports in place of the\n * editor: the GridEditor the page already loaded.\n *\n * The build points `import { GridEditor } from '../grideditor.js'` here for\n * the classic scripts, so each registers on the editor the page has rather\n * than bringing its own. Loaded before the editor there is nothing to\n * register on, and saying so is better than a TypeError three calls later.\n */\nvar GridEditor = window.GridEditor;\n\nif (!GridEditor || typeof GridEditor.get !== 'function') {\n throw new Error('grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, ' +\n 'its locales and grideditor.jquery.js');\n}\n\nexport { GridEditor };\nexport default GridEditor;\n", "/**\n * The jQuery API of grid-editor 6, on top of the plain DOM editor.\n *\n * A page written for 6.x - one that calls $(el).gridEditor(...), listens\n * with $(el).on('grideditor:...') and reads jQuery objects out of the\n * payloads - loads jQuery 4 and this file after grideditor.js, and runs\n * unchanged:\n *\n * <script src=\"jquery.min.js\"></script>\n * <script src=\"dist/grideditor.min.js\"></script>\n * <script src=\"dist/grideditor.jquery.min.js\"></script>\n * <script src=\"dist/plugins/grideditor.tabs.min.js\"></script>\n *\n * What it keeps is the host's side of 6.x. Plugins are not: they register\n * on GridEditor, and the plugin contract hands out elements.\n *\n * Every value 6.x gave host code as a jQuery object is one again: the event\n * payloads and the callbacks' arguments, what the create* methods return,\n * the handle $(el).data('grideditor') gives, the canvas custom_filter gets,\n * and the event a host tool's handler gets. What the host hands in may be a\n * jQuery object wherever 6.x took one.\n */\nimport { GridEditor } from './grideditor.js';\n\nvar $ = window.jQuery;\n\nvar english = function(key, params) { return GridEditor.t({ locale: 'en' }, key, params); };\n\nvar warned = {};\n\nfunction warnOnce(key, message) {\n if (warned[key]) { return; }\n warned[key] = true;\n if (window.console && window.console.warn) { window.console.warn('grid-editor: ' + message); }\n}\n\nif (!$ || !$.fn) {\n warnOnce('no-jquery', english('warning.adapter_no_jquery'));\n} else {\n install();\n}\n\nfunction install() {\n\n /**\n * Every method 6.x dispatched, and which hand back something other than\n * the jQuery set: those run against the first element only, and do not\n * chain.\n */\n var METHODS = {\n getHtml: { value: true },\n getPlainHtml: { value: true },\n init: {},\n deinit: {},\n reset: {},\n destroy: {},\n changeView: {},\n getView: { value: true },\n createRow: { value: true },\n createColumn: { value: true },\n createElement: { value: true },\n createText: { value: true },\n createSection: { value: true },\n createContainer: { value: true },\n addTab: { value: true },\n addAccordionItem: { value: true },\n setLocale: {},\n getUtility: { value: true },\n setUtility: { value: true },\n };\n\n /** The *_tools settings, whose handlers 6.x bound with jQuery. */\n var TOOL_SETTINGS = ['row_tools', 'col_tools', 'element_tools', 'container_tools',\n 'tab_tools', 'accordion_tools', 'text_tools'];\n\n function isElement(value) {\n return !!value && value.nodeType === 1;\n }\n\n /** What the host handed in, as the editor takes it: a jQuery object is its first element. */\n function unwrap(value) {\n if (value instanceof $) { return value[0] || null; }\n return value;\n }\n\n /** An argument, and the options object an argument may be, unwrapped one level down. */\n function unwrapArgument(value) {\n if (value instanceof $) { return unwrap(value); }\n\n if (value && typeof value === 'object' && !Array.isArray(value) && !isElement(value)) {\n var copy = {};\n Object.keys(value).forEach(function(key) { copy[key] = unwrap(value[key]); });\n return copy;\n }\n\n return value;\n }\n\n /** What the editor handed back, as 6.x did: an element is a jQuery object. */\n function wrapResult(value) {\n return isElement(value) ? $(value) : value;\n }\n\n /**\n * A payload as 6.x built it: its nodes jQuery objects, and an empty set\n * where there is no node - a detached node's parent. The same payload\n * wraps to the same object, so every listener of one notification sees\n * one payload, as they did.\n */\n var wrappedPayloads = new WeakMap();\n\n function wrapPayload(payload) {\n if (!payload || typeof payload !== 'object') { return payload; }\n if (wrappedPayloads.has(payload)) { return wrappedPayloads.get(payload); }\n\n var copy = Object.assign({}, payload);\n\n ['node', 'parent', 'canvas'].forEach(function(key) {\n if (key in payload) { copy[key] = $(payload[key] || []); }\n });\n if (payload.container) { copy.container = $(payload.container); }\n // edit-html writes any number of nodes, which 6.x gave as one set\n if (Array.isArray(payload.nodes)) { copy.node = $(payload.nodes); }\n ['from', 'to'].forEach(function(key) {\n var position = payload[key];\n if (position && typeof position === 'object' && 'parent' in position) {\n copy[key] = Object.assign({}, position, { parent: $(position.parent || []) });\n }\n });\n\n wrappedPayloads.set(payload, copy);\n return copy;\n }\n\n /**\n * The events, as jQuery handlers had them: (event, payload).\n *\n * The editor dispatches DOM events, which jQuery hands its handlers with\n * no second argument. Its dispatcher is where every one of them passes,\n * delegated ones too, so that is where the payload goes back in: once,\n * for each handler, and preventDefault() on the jQuery event is\n * preventDefault() on the editor's.\n */\n var dispatch = $.event.dispatch;\n $.event.dispatch = function(nativeEvent) {\n if (arguments.length === 1 && nativeEvent instanceof window.CustomEvent &&\n typeof nativeEvent.type === 'string' && nativeEvent.type.indexOf('grideditor:') === 0) {\n return dispatch.call(this, nativeEvent, wrapPayload(nativeEvent.detail));\n }\n\n return dispatch.apply(this, arguments);\n };\n\n /** A handler of a host's tool, given a jQuery event as 6.x gave it. */\n function jqueryHandler(handler) {\n return function(event) {\n return handler.call(this, $.event.fix(event));\n };\n }\n\n function adaptTool(tool) {\n if (!tool || !tool.on) { return tool; }\n\n var on;\n if (typeof tool.on === 'function') {\n on = jqueryHandler(tool.on);\n } else {\n on = {};\n Object.keys(tool.on).forEach(function(name) { on[name] = jqueryHandler(tool.on[name]); });\n }\n\n return Object.assign({}, tool, { on: on });\n }\n\n /** A custom_filter, as a function of a jQuery canvas; a name is looked up when it runs. */\n function adaptFilter(filter) {\n return function(canvas, isInit) {\n var func = typeof filter === 'string' ? window[filter] : filter;\n return func($(canvas), isInit);\n };\n }\n\n /** The host's 6.x options, as the editor takes them. */\n function adaptOptions(options) {\n options = Object.assign({}, options || {});\n\n if (options.callbacks) {\n var callbacks = {};\n Object.keys(options.callbacks).forEach(function(name) {\n var callback = options.callbacks[name];\n callbacks[name] = typeof callback === 'function'\n ? function(payload) { return callback(wrapPayload(payload)); }\n : callback;\n });\n options.callbacks = callbacks;\n }\n\n if (options.custom_filter && options.custom_filter.length) {\n var filters = typeof options.custom_filter === 'string' || typeof options.custom_filter === 'function'\n ? [options.custom_filter]\n : Array.prototype.slice.call(options.custom_filter);\n options.custom_filter = filters.map(adaptFilter);\n }\n\n TOOL_SETTINGS.forEach(function(name) {\n if (Array.isArray(options[name])) { options[name] = options[name].map(adaptTool); }\n });\n\n options.source_textarea = unwrap(options.source_textarea);\n\n return options;\n }\n\n /**\n * The handle $(el).data('grideditor') gave in 6.x: the same methods, with\n * jQuery going in and coming out, and the canvas as a jQuery object.\n */\n function handleFor(instance) {\n var handle = { canvas: $(instance.canvas) };\n\n Object.keys(METHODS).forEach(function(name) {\n handle[name] = function() {\n var result = instance[name].apply(instance, Array.prototype.map.call(arguments, unwrapArgument));\n return result === instance ? undefined : wrapResult(result);\n };\n });\n\n Object.defineProperty(handle, 'settings', {\n enumerable: true,\n get: function() { return instance.settings; },\n });\n\n return handle;\n }\n\n /**\n * Every editor gets its 6.x handle, whoever made it: $(el).gridEditor()\n * or new GridEditor(el). It goes with the editor.\n */\n GridEditor._created.push(function(instance) {\n $.data(instance.canvas, 'grideditor', handleFor(instance));\n\n var destroy = instance.destroy;\n instance.destroy = function() {\n var result = destroy.apply(this, arguments);\n $.removeData(instance.canvas, 'grideditor');\n return result;\n };\n });\n\n function dispatchMethod(set, name, args) {\n var descriptor = METHODS[name];\n\n if (!descriptor) {\n warnOnce('method:' + name, 'unknown method \"' + name + '\"');\n return set;\n }\n\n args = args.map(unwrapArgument);\n\n if (descriptor.value) {\n var element = set.first();\n if (!element.length) { return null; }\n\n var instance = GridEditor.get(element[0]);\n if (!instance) {\n if (name === 'getHtml') { return element.html(); }\n if (name === 'getPlainHtml') { return GridEditor._plainHtml(element.html()); }\n return null;\n }\n\n return wrapResult(instance[name].apply(instance, args));\n }\n\n set.each(function() {\n var found = GridEditor.get(this);\n if (found) { found[name].apply(found, args); }\n });\n\n return set;\n }\n\n /**\n * $(el).gridEditor(options): an editor on each element that has none.\n * $(el).gridEditor('method', ...): a method, 6.x style.\n */\n $.fn.gridEditor = function(optionsOrMethod) {\n if (typeof optionsOrMethod == 'string') {\n return dispatchMethod(this, optionsOrMethod, Array.prototype.slice.call(arguments, 1));\n }\n\n var options = adaptOptions(optionsOrMethod);\n\n this.each(function() {\n GridEditor.create(this, options);\n });\n\n return this;\n };\n\n // Strings are the same thing in both: a 6.x locale file loads unchanged\n $.fn.gridEditor.locales = GridEditor.locales;\n $.fn.gridEditor.t = GridEditor.t;\n}\n"],
|
|
5
|
-
"mappings": "MASA,IAAIA,EAAa,OAAO,WAExB,GAAI,CAACA,GAAc,OAAOA,EAAW,KAAQ,WACzC,MAAM,IAAI,MAAM,wHAC0B,ECW9C,IAAIC,EAAI,OAAO,OAEXC,EAAU,SAASC,EAAKC,EAAQ,CAAE,OAAOC,EAAW,EAAE,CAAE,OAAQ,IAAK,EAAGF,EAAKC,CAAM,CAAG,EAEtFE,EAAS,CAAC,EAEd,SAASC,EAASJ,EAAKK,EAAS,CACxBF,EAAOH,CAAG,IACdG,EAAOH,CAAG,EAAI,GACV,OAAO,SAAW,OAAO,QAAQ,MAAQ,OAAO,QAAQ,KAAK,gBAAkBK,CAAO,EAC9F,CAEI,CAACP,GAAK,CAACA,EAAE,GACTM,EAAS,YAAaL,EAAQ,2BAA2B,CAAC,EAE1DO,EAAQ,EAGZ,SAASA,GAAU,CAOf,IAAIC,EAAU,CACV,QAAkB,CAAE,MAAO,EAAK,EAChC,aAAkB,CAAE,MAAO,EAAK,EAChC,KAAkB,CAAC,EACnB,OAAkB,CAAC,EACnB,MAAkB,CAAC,EACnB,QAAkB,CAAC,EACnB,WAAkB,CAAC,EACnB,QAAkB,CAAE,MAAO,EAAK,EAChC,UAAkB,CAAE,MAAO,EAAK,EAChC,aAAkB,CAAE,MAAO,EAAK,EAChC,cAAkB,CAAE,MAAO,EAAK,EAChC,WAAkB,CAAE,MAAO,EAAK,EAChC,cAAkB,CAAE,MAAO,EAAK,EAChC,gBAAkB,CAAE,MAAO,EAAK,EAChC,OAAkB,CAAE,MAAO,EAAK,EAChC,iBAAkB,CAAE,MAAO,EAAK,EAChC,UAAkB,CAAC,EACnB,WAAkB,CAAE,MAAO,EAAK,EAChC,WAAkB,CAAE,MAAO,EAAK,
|
|
4
|
+
"sourcesContent": ["/**\n * What a plugin's or a locale's classic script imports in place of the\n * editor: the GridEditor the page already loaded.\n *\n * The build points `import { GridEditor } from '../grideditor.js'` here for\n * the classic scripts, so each registers on the editor the page has rather\n * than bringing its own. Loaded before the editor there is nothing to\n * register on, and saying so is better than a TypeError three calls later.\n */\nvar GridEditor = window.GridEditor;\n\nif (!GridEditor || typeof GridEditor.get !== 'function') {\n throw new Error('grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, ' +\n 'its locales and grideditor.jquery.js');\n}\n\nexport { GridEditor };\nexport default GridEditor;\n", "/**\n * The jQuery API of grid-editor 6, on top of the plain DOM editor.\n *\n * A page written for 6.x - one that calls $(el).gridEditor(...), listens\n * with $(el).on('grideditor:...') and reads jQuery objects out of the\n * payloads - loads jQuery 4 and this file after grideditor.js, and runs\n * unchanged:\n *\n * <script src=\"jquery.min.js\"></script>\n * <script src=\"dist/grideditor.min.js\"></script>\n * <script src=\"dist/grideditor.jquery.min.js\"></script>\n * <script src=\"dist/plugins/grideditor.tabs.min.js\"></script>\n *\n * What it keeps is the host's side of 6.x. Plugins are not: they register\n * on GridEditor, and the plugin contract hands out elements.\n *\n * Every value 6.x gave host code as a jQuery object is one again: the event\n * payloads and the callbacks' arguments, what the create* methods return,\n * the handle $(el).data('grideditor') gives, the canvas custom_filter gets,\n * and the event a host tool's handler gets. What the host hands in may be a\n * jQuery object wherever 6.x took one.\n */\nimport { GridEditor } from './grideditor.js';\n\nvar $ = window.jQuery;\n\nvar english = function(key, params) { return GridEditor.t({ locale: 'en' }, key, params); };\n\nvar warned = {};\n\nfunction warnOnce(key, message) {\n if (warned[key]) { return; }\n warned[key] = true;\n if (window.console && window.console.warn) { window.console.warn('grid-editor: ' + message); }\n}\n\nif (!$ || !$.fn) {\n warnOnce('no-jquery', english('warning.adapter_no_jquery'));\n} else {\n install();\n}\n\nfunction install() {\n\n /**\n * Every method 6.x dispatched, and which hand back something other than\n * the jQuery set: those run against the first element only, and do not\n * chain.\n */\n var METHODS = {\n getHtml: { value: true },\n getPlainHtml: { value: true },\n init: {},\n deinit: {},\n reset: {},\n destroy: {},\n changeView: {},\n getView: { value: true },\n createRow: { value: true },\n createColumn: { value: true },\n createElement: { value: true },\n createText: { value: true },\n createSection: { value: true },\n createContainer: { value: true },\n addTab: { value: true },\n addAccordionItem: { value: true },\n setLocale: {},\n getUtility: { value: true },\n setUtility: { value: true },\n getActiveTarget: { value: true },\n setActiveTarget: {},\n };\n\n /** The *_tools settings, whose handlers 6.x bound with jQuery. */\n var TOOL_SETTINGS = ['row_tools', 'col_tools', 'element_tools', 'container_tools',\n 'tab_tools', 'accordion_tools', 'text_tools'];\n\n function isElement(value) {\n return !!value && value.nodeType === 1;\n }\n\n /** What the host handed in, as the editor takes it: a jQuery object is its first element. */\n function unwrap(value) {\n if (value instanceof $) { return value[0] || null; }\n return value;\n }\n\n /** An argument, and the options object an argument may be, unwrapped one level down. */\n function unwrapArgument(value) {\n if (value instanceof $) { return unwrap(value); }\n\n if (value && typeof value === 'object' && !Array.isArray(value) && !isElement(value)) {\n var copy = {};\n Object.keys(value).forEach(function(key) { copy[key] = unwrap(value[key]); });\n return copy;\n }\n\n return value;\n }\n\n /** What the editor handed back, as 6.x did: an element is a jQuery object. */\n function wrapResult(value) {\n return isElement(value) ? $(value) : value;\n }\n\n /**\n * A payload as 6.x built it: its nodes jQuery objects, and an empty set\n * where there is no node - a detached node's parent. The same payload\n * wraps to the same object, so every listener of one notification sees\n * one payload, as they did.\n */\n var wrappedPayloads = new WeakMap();\n\n function wrapPayload(payload) {\n if (!payload || typeof payload !== 'object') { return payload; }\n if (wrappedPayloads.has(payload)) { return wrappedPayloads.get(payload); }\n\n var copy = Object.assign({}, payload);\n\n ['node', 'parent', 'canvas'].forEach(function(key) {\n if (key in payload) { copy[key] = $(payload[key] || []); }\n });\n if (payload.container) { copy.container = $(payload.container); }\n // edit-html writes any number of nodes, which 6.x gave as one set\n if (Array.isArray(payload.nodes)) { copy.node = $(payload.nodes); }\n ['from', 'to'].forEach(function(key) {\n var position = payload[key];\n if (position && typeof position === 'object' && 'parent' in position) {\n copy[key] = Object.assign({}, position, { parent: $(position.parent || []) });\n }\n });\n\n wrappedPayloads.set(payload, copy);\n return copy;\n }\n\n /**\n * The events, as jQuery handlers had them: (event, payload).\n *\n * The editor dispatches DOM events, which jQuery hands its handlers with\n * no second argument. Its dispatcher is where every one of them passes,\n * delegated ones too, so that is where the payload goes back in: once,\n * for each handler, and preventDefault() on the jQuery event is\n * preventDefault() on the editor's.\n */\n var dispatch = $.event.dispatch;\n $.event.dispatch = function(nativeEvent) {\n if (arguments.length === 1 && nativeEvent instanceof window.CustomEvent &&\n typeof nativeEvent.type === 'string' && nativeEvent.type.indexOf('grideditor:') === 0) {\n return dispatch.call(this, nativeEvent, wrapPayload(nativeEvent.detail));\n }\n\n return dispatch.apply(this, arguments);\n };\n\n /** A handler of a host's tool, given a jQuery event as 6.x gave it. */\n function jqueryHandler(handler) {\n return function(event) {\n return handler.call(this, $.event.fix(event));\n };\n }\n\n function adaptTool(tool) {\n if (!tool || !tool.on) { return tool; }\n\n var on;\n if (typeof tool.on === 'function') {\n on = jqueryHandler(tool.on);\n } else {\n on = {};\n Object.keys(tool.on).forEach(function(name) { on[name] = jqueryHandler(tool.on[name]); });\n }\n\n return Object.assign({}, tool, { on: on });\n }\n\n /** A custom_filter, as a function of a jQuery canvas; a name is looked up when it runs. */\n function adaptFilter(filter) {\n return function(canvas, isInit) {\n var func = typeof filter === 'string' ? window[filter] : filter;\n return func($(canvas), isInit);\n };\n }\n\n /** The host's 6.x options, as the editor takes them. */\n function adaptOptions(options) {\n options = Object.assign({}, options || {});\n\n if (options.callbacks) {\n var callbacks = {};\n Object.keys(options.callbacks).forEach(function(name) {\n var callback = options.callbacks[name];\n callbacks[name] = typeof callback === 'function'\n ? function(payload) { return callback(wrapPayload(payload)); }\n : callback;\n });\n options.callbacks = callbacks;\n }\n\n if (options.custom_filter && options.custom_filter.length) {\n var filters = typeof options.custom_filter === 'string' || typeof options.custom_filter === 'function'\n ? [options.custom_filter]\n : Array.prototype.slice.call(options.custom_filter);\n options.custom_filter = filters.map(adaptFilter);\n }\n\n TOOL_SETTINGS.forEach(function(name) {\n if (Array.isArray(options[name])) { options[name] = options[name].map(adaptTool); }\n });\n\n options.source_textarea = unwrap(options.source_textarea);\n\n return options;\n }\n\n /**\n * The handle $(el).data('grideditor') gave in 6.x: the same methods, with\n * jQuery going in and coming out, and the canvas as a jQuery object.\n */\n function handleFor(instance) {\n var handle = { canvas: $(instance.canvas) };\n\n Object.keys(METHODS).forEach(function(name) {\n handle[name] = function() {\n var result = instance[name].apply(instance, Array.prototype.map.call(arguments, unwrapArgument));\n return result === instance ? undefined : wrapResult(result);\n };\n });\n\n Object.defineProperty(handle, 'settings', {\n enumerable: true,\n get: function() { return instance.settings; },\n });\n\n return handle;\n }\n\n /**\n * Every editor gets its 6.x handle, whoever made it: $(el).gridEditor()\n * or new GridEditor(el). It goes with the editor.\n */\n GridEditor._created.push(function(instance) {\n $.data(instance.canvas, 'grideditor', handleFor(instance));\n\n var destroy = instance.destroy;\n instance.destroy = function() {\n var result = destroy.apply(this, arguments);\n $.removeData(instance.canvas, 'grideditor');\n return result;\n };\n });\n\n function dispatchMethod(set, name, args) {\n var descriptor = METHODS[name];\n\n if (!descriptor) {\n warnOnce('method:' + name, 'unknown method \"' + name + '\"');\n return set;\n }\n\n args = args.map(unwrapArgument);\n\n if (descriptor.value) {\n var element = set.first();\n if (!element.length) { return null; }\n\n var instance = GridEditor.get(element[0]);\n if (!instance) {\n if (name === 'getHtml') { return element.html(); }\n if (name === 'getPlainHtml') { return GridEditor._plainHtml(element.html()); }\n return null;\n }\n\n return wrapResult(instance[name].apply(instance, args));\n }\n\n set.each(function() {\n var found = GridEditor.get(this);\n if (found) { found[name].apply(found, args); }\n });\n\n return set;\n }\n\n /**\n * $(el).gridEditor(options): an editor on each element that has none.\n * $(el).gridEditor('method', ...): a method, 6.x style.\n */\n $.fn.gridEditor = function(optionsOrMethod) {\n if (typeof optionsOrMethod == 'string') {\n return dispatchMethod(this, optionsOrMethod, Array.prototype.slice.call(arguments, 1));\n }\n\n var options = adaptOptions(optionsOrMethod);\n\n this.each(function() {\n GridEditor.create(this, options);\n });\n\n return this;\n };\n\n // Strings are the same thing in both: a 6.x locale file loads unchanged\n $.fn.gridEditor.locales = GridEditor.locales;\n $.fn.gridEditor.t = GridEditor.t;\n}\n"],
|
|
5
|
+
"mappings": "MASA,IAAIA,EAAa,OAAO,WAExB,GAAI,CAACA,GAAc,OAAOA,EAAW,KAAQ,WACzC,MAAM,IAAI,MAAM,wHAC0B,ECW9C,IAAIC,EAAI,OAAO,OAEXC,EAAU,SAASC,EAAKC,EAAQ,CAAE,OAAOC,EAAW,EAAE,CAAE,OAAQ,IAAK,EAAGF,EAAKC,CAAM,CAAG,EAEtFE,EAAS,CAAC,EAEd,SAASC,EAASJ,EAAKK,EAAS,CACxBF,EAAOH,CAAG,IACdG,EAAOH,CAAG,EAAI,GACV,OAAO,SAAW,OAAO,QAAQ,MAAQ,OAAO,QAAQ,KAAK,gBAAkBK,CAAO,EAC9F,CAEI,CAACP,GAAK,CAACA,EAAE,GACTM,EAAS,YAAaL,EAAQ,2BAA2B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G,EAAQ,OAAU,OAAO,KAE9B,IAAIR,EAAWrC,EAAW,IAAI6C,EAAQ,CAAC,CAAC,EACxC,OAAKR,EAMEzB,EAAWyB,EAASZ,CAAI,EAAE,MAAMY,EAAUM,CAAI,CAAC,EAL9ClB,IAAS,UAAoBoB,EAAQ,KAAK,EAC1CpB,IAAS,eAAyBzB,EAAW,WAAW6C,EAAQ,KAAK,CAAC,EACnE,IAIf,CAEA,OAAAH,EAAI,KAAK,UAAW,CAChB,IAAII,EAAQ9C,EAAW,IAAI,IAAI,EAC3B8C,GAASA,EAAMrB,CAAI,EAAE,MAAMqB,EAAOH,CAAI,CAC9C,CAAC,EAEMD,CACX,CAMA9C,EAAE,GAAG,WAAa,SAASmD,EAAiB,CACxC,GAAI,OAAOA,GAAmB,SAC1B,OAAON,EAAe,KAAMM,EAAiB,MAAM,UAAU,MAAM,KAAK,UAAW,CAAC,CAAC,EAGzF,IAAIf,EAAUD,EAAagB,CAAe,EAE1C,YAAK,KAAK,UAAW,CACjB/C,EAAW,OAAO,KAAMgC,CAAO,CACnC,CAAC,EAEM,IACX,EAGApC,EAAE,GAAG,WAAW,QAAUI,EAAW,QACrCJ,EAAE,GAAG,WAAW,EAAII,EAAW,CACnC",
|
|
6
6
|
"names": ["GridEditor", "$", "english", "key", "params", "GridEditor", "warned", "warnOnce", "message", "install", "METHODS", "TOOL_SETTINGS", "isElement", "value", "unwrap", "unwrapArgument", "copy", "wrapResult", "wrappedPayloads", "wrapPayload", "payload", "position", "dispatch", "nativeEvent", "jqueryHandler", "handler", "event", "adaptTool", "tool", "on", "name", "adaptFilter", "filter", "canvas", "isInit", "func", "adaptOptions", "options", "callbacks", "callback", "filters", "handleFor", "instance", "handle", "result", "destroy", "dispatchMethod", "set", "args", "descriptor", "element", "found", "optionsOrMethod"]
|
|
7
7
|
}
|