@themarioga/grid-editor 8.0.0 → 8.2.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 +30 -0
- package/README.md +19 -2
- package/dist/grideditor.bundle.min.js +3 -3
- package/dist/grideditor.css +9 -0
- package/dist/grideditor.d.ts +18 -1
- package/dist/grideditor.esm.js +147 -32
- 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 +147 -32
- 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/dist/plugins/grideditor.inline-style.esm.js +9 -0
- package/dist/plugins/grideditor.inline-style.js +9 -0
- package/dist/plugins/grideditor.inline-style.min.js +3 -3
- package/dist/plugins/grideditor.inline-style.min.js.map +3 -3
- 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 +139 -27
- package/src/js/inline-style/fields.js +10 -0
- package/src/js/locales/grideditor.es.js +1 -0
- package/src/js/plugins/grideditor.inline-style.js +1 -0
- package/src/less/grideditor.less +10 -0
- package/types/grideditor.d.ts +18 -1
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 = [
|
|
@@ -395,11 +397,18 @@ var NESTED_SETTINGS = {
|
|
|
395
397
|
},
|
|
396
398
|
resize: {
|
|
397
399
|
enabled: true,
|
|
400
|
+
// The handle on the column's edge
|
|
401
|
+
tools: true,
|
|
402
|
+
// The narrower and wider tools in the column's drawer
|
|
398
403
|
handles: "e",
|
|
399
404
|
// Which edges carry a handle: 'e', 'w', or 'e, w'
|
|
400
405
|
balance: "next"
|
|
401
406
|
// 'next' takes the units out of the following column
|
|
402
407
|
},
|
|
408
|
+
indent: {
|
|
409
|
+
tools: true
|
|
410
|
+
// The indent tools in the column's drawer
|
|
411
|
+
},
|
|
403
412
|
drag: {
|
|
404
413
|
delay: 0,
|
|
405
414
|
// Milliseconds to hold before a drag starts
|
|
@@ -561,6 +570,8 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
561
570
|
// 'tool' for the move tool, 'drawer' for the whole drawer
|
|
562
571
|
"toolbar_drag": "auto",
|
|
563
572
|
// Drag the toolbar's buttons onto the canvas. 'auto' follows drag_handle
|
|
573
|
+
"active_target": false,
|
|
574
|
+
// A click in a column makes it where the toolbar's buttons add
|
|
564
575
|
"element_tools": [],
|
|
565
576
|
// Host tools on element drawers, same shape as row_tools
|
|
566
577
|
"element_classes": [],
|
|
@@ -595,6 +606,8 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
595
606
|
"default_view": ALL_VIEW,
|
|
596
607
|
"resize": NESTED_SETTINGS.resize,
|
|
597
608
|
// Resizing a column by dragging its edge
|
|
609
|
+
"indent": NESTED_SETTINGS.indent,
|
|
610
|
+
// Indenting a column, offset-*
|
|
598
611
|
"source_textarea": "",
|
|
599
612
|
"edit_source": true,
|
|
600
613
|
// The toolbar's button to edit the canvas as html
|
|
@@ -620,6 +633,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
620
633
|
var sizePicker = null;
|
|
621
634
|
var sourceOpen = false;
|
|
622
635
|
var dropMarker = null;
|
|
636
|
+
var activeTarget = null;
|
|
623
637
|
var warnedHere = {};
|
|
624
638
|
var sortables = [];
|
|
625
639
|
var instanceId = ++editorCounter;
|
|
@@ -1024,6 +1038,34 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1024
1038
|
e.preventDefault();
|
|
1025
1039
|
}
|
|
1026
1040
|
}, signal);
|
|
1041
|
+
if (settings.active_target) {
|
|
1042
|
+
var pressed = null;
|
|
1043
|
+
canvas.addEventListener("pointerdown", function(e) {
|
|
1044
|
+
pressed = { x: e.clientX, y: e.clientY };
|
|
1045
|
+
}, signal);
|
|
1046
|
+
canvas.addEventListener("click", function(e) {
|
|
1047
|
+
var from = pressed;
|
|
1048
|
+
pressed = null;
|
|
1049
|
+
if (!hasClass(canvas, "ge-editing")) {
|
|
1050
|
+
return;
|
|
1051
|
+
}
|
|
1052
|
+
if (from && Math.abs(e.clientX - from.x) + Math.abs(e.clientY - from.y) > settings.drag.threshold) {
|
|
1053
|
+
return;
|
|
1054
|
+
}
|
|
1055
|
+
var region = closest(e.target, targetSelector());
|
|
1056
|
+
changeTarget(region && region !== canvas && canvas.contains(region) ? region : null);
|
|
1057
|
+
}, signal);
|
|
1058
|
+
document.addEventListener("keydown", function(e) {
|
|
1059
|
+
if (e.key !== "Escape" || !activeTarget || openSettingsState || dialogState) {
|
|
1060
|
+
return;
|
|
1061
|
+
}
|
|
1062
|
+
var focus = document.activeElement;
|
|
1063
|
+
if (focus && (is(focus, "input, textarea, select") || focus.isContentEditable)) {
|
|
1064
|
+
return;
|
|
1065
|
+
}
|
|
1066
|
+
changeTarget(null);
|
|
1067
|
+
}, signal);
|
|
1068
|
+
}
|
|
1027
1069
|
}
|
|
1028
1070
|
function textReady(block) {
|
|
1029
1071
|
if (!is(block, ".ge-content") || !canvas.contains(block)) {
|
|
@@ -1049,6 +1091,10 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1049
1091
|
"data-ge-layout": grouped ? JSON.stringify(layout) : layout.join(",")
|
|
1050
1092
|
});
|
|
1051
1093
|
btn.addEventListener("click", function() {
|
|
1094
|
+
if (activeTarget) {
|
|
1095
|
+
addToTarget(btn, "tool");
|
|
1096
|
+
return;
|
|
1097
|
+
}
|
|
1052
1098
|
var row = rowFromLayoutValue(layout);
|
|
1053
1099
|
var added = addNode("row", row, function() {
|
|
1054
1100
|
canvas.appendChild(row);
|
|
@@ -1077,6 +1123,10 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1077
1123
|
);
|
|
1078
1124
|
attr(button, { "data-ge-toolbar": "container", "data-ge-container-type": type });
|
|
1079
1125
|
button.addEventListener("click", function() {
|
|
1126
|
+
if (activeTarget) {
|
|
1127
|
+
addToTarget(button, "tool");
|
|
1128
|
+
return;
|
|
1129
|
+
}
|
|
1080
1130
|
var row = createRow();
|
|
1081
1131
|
var column = row.appendChild(createColumn(MAX_COL_SIZE));
|
|
1082
1132
|
var container = column.appendChild(definition.create({}));
|
|
@@ -1170,6 +1220,10 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1170
1220
|
"data-ge-item": index
|
|
1171
1221
|
});
|
|
1172
1222
|
button.addEventListener("click", function() {
|
|
1223
|
+
if (activeTarget) {
|
|
1224
|
+
addToTarget(button, item.source || "tool");
|
|
1225
|
+
return;
|
|
1226
|
+
}
|
|
1173
1227
|
var made = item.create();
|
|
1174
1228
|
var placed = item.inColumn ? inRowOfItsOwn(made) : made;
|
|
1175
1229
|
var added = addNode(item.kind, made, function() {
|
|
@@ -1275,7 +1329,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1275
1329
|
});
|
|
1276
1330
|
return { region, before };
|
|
1277
1331
|
}
|
|
1278
|
-
function insertFeatureFromToolbar(button, where) {
|
|
1332
|
+
function insertFeatureFromToolbar(button, where, source) {
|
|
1279
1333
|
var item = FEATURES[button.getAttribute("data-ge-feature")].toolbar[parseInt(button.getAttribute("data-ge-item"), 10)];
|
|
1280
1334
|
var made = item.create();
|
|
1281
1335
|
var placed = made;
|
|
@@ -1294,7 +1348,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1294
1348
|
} else {
|
|
1295
1349
|
where.region.appendChild(placed);
|
|
1296
1350
|
}
|
|
1297
|
-
}, { parent: where.region, source: item.source || "dragdrop" });
|
|
1351
|
+
}, { parent: where.region, source: item.source || source || "dragdrop" });
|
|
1298
1352
|
}
|
|
1299
1353
|
function inRowOfItsOwn(node) {
|
|
1300
1354
|
var row = createRow();
|
|
@@ -1321,9 +1375,9 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1321
1375
|
dropMarker.remove();
|
|
1322
1376
|
}
|
|
1323
1377
|
}
|
|
1324
|
-
function insertFromToolbar(button, where) {
|
|
1378
|
+
function insertFromToolbar(button, where, source) {
|
|
1325
1379
|
if (button.getAttribute("data-ge-toolbar") === "feature") {
|
|
1326
|
-
return insertFeatureFromToolbar(button, where);
|
|
1380
|
+
return insertFeatureFromToolbar(button, where, source);
|
|
1327
1381
|
}
|
|
1328
1382
|
var container = button.getAttribute("data-ge-toolbar") === "container";
|
|
1329
1383
|
var type = button.getAttribute("data-ge-container-type");
|
|
@@ -1338,7 +1392,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1338
1392
|
} else {
|
|
1339
1393
|
where.region.appendChild(placed);
|
|
1340
1394
|
}
|
|
1341
|
-
}, { parent: where.region, source: "dragdrop" });
|
|
1395
|
+
}, { parent: where.region, source: source || "dragdrop" });
|
|
1342
1396
|
}
|
|
1343
1397
|
function widthFamily() {
|
|
1344
1398
|
var values = [];
|
|
@@ -1578,6 +1632,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1578
1632
|
}
|
|
1579
1633
|
function openSource() {
|
|
1580
1634
|
deinit();
|
|
1635
|
+
changeTarget(null);
|
|
1581
1636
|
htmlTextArea.style.height = 0.8 * document.documentElement.clientHeight + "px";
|
|
1582
1637
|
htmlTextArea.value = canvas.innerHTML;
|
|
1583
1638
|
show(htmlTextArea);
|
|
@@ -1593,6 +1648,32 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1593
1648
|
init();
|
|
1594
1649
|
hide(htmlTextArea);
|
|
1595
1650
|
}
|
|
1651
|
+
function targetSelector() {
|
|
1652
|
+
return [".column"].concat(pluginHooks("regions")).join(", ");
|
|
1653
|
+
}
|
|
1654
|
+
function isTarget(node) {
|
|
1655
|
+
return !!node && node !== canvas && canvas.contains(node) && is(node, targetSelector());
|
|
1656
|
+
}
|
|
1657
|
+
function changeTarget(node) {
|
|
1658
|
+
if (node === activeTarget) {
|
|
1659
|
+
return;
|
|
1660
|
+
}
|
|
1661
|
+
var from = activeTarget;
|
|
1662
|
+
if (from) {
|
|
1663
|
+
removeClass(from, "ge-active-target");
|
|
1664
|
+
}
|
|
1665
|
+
activeTarget = node;
|
|
1666
|
+
if (node && hasClass(canvas, "ge-editing")) {
|
|
1667
|
+
addClass(node, "ge-active-target");
|
|
1668
|
+
}
|
|
1669
|
+
emit("target-change", { canvas, target: node, from });
|
|
1670
|
+
}
|
|
1671
|
+
function addToTarget(button, source) {
|
|
1672
|
+
var made = insertFromToolbar(button, { region: activeTarget, before: null }, source);
|
|
1673
|
+
if (made && made.scrollIntoView) {
|
|
1674
|
+
made.scrollIntoView({ behavior: "smooth" });
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1596
1677
|
function init() {
|
|
1597
1678
|
if (openSettingsState && !attached(openSettingsState.node)) {
|
|
1598
1679
|
closeSettings();
|
|
@@ -1616,10 +1697,18 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1616
1697
|
makeResizable();
|
|
1617
1698
|
switchLayout(curView);
|
|
1618
1699
|
refreshPreviews(canvas);
|
|
1700
|
+
if (activeTarget && !canvas.contains(activeTarget)) {
|
|
1701
|
+
changeTarget(null);
|
|
1702
|
+
} else if (activeTarget) {
|
|
1703
|
+
addClass(activeTarget, "ge-active-target");
|
|
1704
|
+
}
|
|
1619
1705
|
}
|
|
1620
1706
|
function deinit() {
|
|
1621
1707
|
closeSettings();
|
|
1622
1708
|
removeClass(canvas, "ge-editing ge-drag-drawer ge-dropping");
|
|
1709
|
+
if (activeTarget) {
|
|
1710
|
+
removeClass(activeTarget, "ge-active-target");
|
|
1711
|
+
}
|
|
1623
1712
|
plugins("onBeforeDeinit");
|
|
1624
1713
|
closeSizePicker();
|
|
1625
1714
|
hideDropMarker();
|
|
@@ -1661,6 +1750,7 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
1661
1750
|
closeSource();
|
|
1662
1751
|
}
|
|
1663
1752
|
deinit();
|
|
1753
|
+
activeTarget = null;
|
|
1664
1754
|
removeConfirmModal();
|
|
1665
1755
|
removeSettingsPanels();
|
|
1666
1756
|
removeDialog();
|
|
@@ -2529,30 +2619,34 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
2529
2619
|
}
|
|
2530
2620
|
var drawer = prependDrawer(col, "ge-tools-drawer");
|
|
2531
2621
|
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
|
-
|
|
2622
|
+
if (settings.resize.tools !== false) {
|
|
2623
|
+
createTool(drawer, t("tool.column_narrower"), "ge-decrease-col-width", "bi bi-dash-lg", function(e) {
|
|
2624
|
+
resizeColumn(
|
|
2625
|
+
col,
|
|
2626
|
+
e.shiftKey ? smallest(settings.valid_col_sizes) : stepThrough(settings.valid_col_sizes.filter(isUnits), currentUnits(col), -1),
|
|
2627
|
+
"tool"
|
|
2628
|
+
);
|
|
2629
|
+
});
|
|
2630
|
+
createTool(drawer, t("tool.column_wider"), "ge-increase-col-width", "bi bi-plus-lg", function(e) {
|
|
2631
|
+
resizeColumn(
|
|
2632
|
+
col,
|
|
2633
|
+
e.shiftKey ? widestFor(col) : stepThrough(settings.valid_col_sizes.filter(isUnits), currentUnits(col), 1),
|
|
2634
|
+
"tool"
|
|
2635
|
+
);
|
|
2636
|
+
});
|
|
2637
|
+
}
|
|
2638
|
+
if (settings.indent.tools !== false) {
|
|
2639
|
+
createTool(drawer, t("tool.indent_decrease"), "ge-decrease-col-offset", "bi bi-text-indent-right", function(e) {
|
|
2640
|
+
indentColumn(
|
|
2641
|
+
col,
|
|
2642
|
+
e.shiftKey ? smallest(settings.valid_col_offsets) : stepThrough(settings.valid_col_offsets, currentOffset(col), -1),
|
|
2643
|
+
"tool"
|
|
2644
|
+
);
|
|
2645
|
+
});
|
|
2646
|
+
createTool(drawer, t("tool.indent_increase"), "ge-increase-col-offset", "bi bi-text-indent-left", function(e) {
|
|
2647
|
+
indentColumn(col, e.shiftKey ? deepestFor(col) : stepThrough(settings.valid_col_offsets, currentOffset(col), 1), "tool");
|
|
2648
|
+
});
|
|
2649
|
+
}
|
|
2556
2650
|
addSettingsTool(drawer, col, settings.col_classes);
|
|
2557
2651
|
hostTools(drawer, settings.col_tools);
|
|
2558
2652
|
createTool(drawer, t("tool.delete_column"), "ge-delete-column", "bi bi-trash", function() {
|
|
@@ -4033,6 +4127,23 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
4033
4127
|
return featureMethods[name].apply(null, arguments);
|
|
4034
4128
|
};
|
|
4035
4129
|
}
|
|
4130
|
+
function apiSetActiveTarget(value) {
|
|
4131
|
+
if (!settings.active_target) {
|
|
4132
|
+
warnOnceHere("active_target", "setActiveTarget needs the active_target setting: without it, it does nothing");
|
|
4133
|
+
return;
|
|
4134
|
+
}
|
|
4135
|
+
if (value === null || value === void 0) {
|
|
4136
|
+
changeTarget(null);
|
|
4137
|
+
return;
|
|
4138
|
+
}
|
|
4139
|
+
var node = nodeFrom(value);
|
|
4140
|
+
if (!isTarget(node)) {
|
|
4141
|
+
var named = typeof value === "string" ? value : node ? "<" + node.tagName.toLowerCase() + ">" : String(value);
|
|
4142
|
+
warn("setActiveTarget: " + named + " is not a column or a region of the canvas");
|
|
4143
|
+
return;
|
|
4144
|
+
}
|
|
4145
|
+
changeTarget(node);
|
|
4146
|
+
}
|
|
4036
4147
|
var own = {
|
|
4037
4148
|
getHtml,
|
|
4038
4149
|
getPlainHtml,
|
|
@@ -4066,7 +4177,11 @@ function build(instance, baseElem, optionsOrMethod) {
|
|
|
4066
4177
|
},
|
|
4067
4178
|
setLocale,
|
|
4068
4179
|
getUtility,
|
|
4069
|
-
setUtility
|
|
4180
|
+
setUtility,
|
|
4181
|
+
getActiveTarget: function() {
|
|
4182
|
+
return settings.active_target ? activeTarget : null;
|
|
4183
|
+
},
|
|
4184
|
+
setActiveTarget: apiSetActiveTarget
|
|
4070
4185
|
};
|
|
4071
4186
|
Object.keys(own).forEach(function(name) {
|
|
4072
4187
|
var value = !!(METHODS[name] && METHODS[name].value);
|
|
@@ -4105,7 +4220,7 @@ GridEditor.t = translate;
|
|
|
4105
4220
|
GridEditor._plainHtml = plainHtml;
|
|
4106
4221
|
GridEditor.Sortable = null;
|
|
4107
4222
|
GridEditor.bootstrap = null;
|
|
4108
|
-
GridEditor.version = false ? "dev" : "8.
|
|
4223
|
+
GridEditor.version = false ? "dev" : "8.2.0";
|
|
4109
4224
|
GridEditor.locales = {
|
|
4110
4225
|
en: {
|
|
4111
4226
|
"tool.move": "Move",
|
|
@@ -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,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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K,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
|
}
|