@themarioga/grid-editor 7.2.0 → 7.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 +41 -0
- package/README.md +83 -14
- package/UPGRADING.md +31 -0
- package/dist/grideditor.bundle.min.js +2 -2
- package/dist/grideditor.css +102 -0
- package/dist/grideditor.d.ts +18 -0
- package/dist/grideditor.esm.js +291 -31
- package/dist/grideditor.js +291 -31
- package/dist/grideditor.min.css +1 -1
- package/dist/grideditor.min.css.map +1 -1
- package/dist/grideditor.min.js +1 -1
- package/dist/grideditor.min.js.map +3 -3
- package/dist/locales/grideditor.es.esm.js +67 -0
- package/dist/locales/grideditor.es.js +67 -0
- package/dist/locales/grideditor.es.min.js +1 -1
- package/dist/locales/grideditor.es.min.js.map +2 -2
- package/dist/plugins/grideditor.float.esm.js +10 -1
- package/dist/plugins/grideditor.float.js +8 -2
- package/dist/plugins/grideditor.float.min.js +1 -1
- package/dist/plugins/grideditor.float.min.js.map +4 -4
- package/dist/plugins/grideditor.spacing.esm.js +12 -3
- package/dist/plugins/grideditor.spacing.js +9 -3
- package/dist/plugins/grideditor.spacing.min.js +1 -1
- package/dist/plugins/grideditor.spacing.min.js.map +4 -4
- package/dist/plugins/grideditor.style.esm.js +1593 -0
- package/dist/plugins/grideditor.style.js +1592 -0
- package/dist/plugins/grideditor.style.min.js +2 -0
- package/dist/plugins/grideditor.style.min.js.map +7 -0
- package/dist/plugins/grideditor.textalign.esm.js +10 -1
- package/dist/plugins/grideditor.textalign.js +8 -2
- package/dist/plugins/grideditor.textalign.min.js +1 -1
- package/dist/plugins/grideditor.textalign.min.js.map +4 -4
- package/dist/plugins/grideditor.visibility.esm.js +12 -3
- package/dist/plugins/grideditor.visibility.js +9 -3
- package/dist/plugins/grideditor.visibility.min.js +1 -1
- package/dist/plugins/grideditor.visibility.min.js.map +4 -4
- package/docs/locale-keys.md +86 -7
- package/docs/plugins.md +49 -5
- package/example/index.html +14 -0
- package/example/style.html +151 -0
- package/example/utilities.html +15 -11
- package/package.json +1 -1
- package/src/js/grideditor.js +365 -27
- package/src/js/locales/grideditor.es.js +67 -0
- package/src/js/plugins/grideditor.float.js +8 -33
- package/src/js/plugins/grideditor.spacing.js +8 -273
- package/src/js/plugins/grideditor.style.js +179 -0
- package/src/js/plugins/grideditor.textalign.js +8 -39
- package/src/js/plugins/grideditor.visibility.js +8 -147
- package/src/js/style/accordion.js +157 -0
- package/src/js/style/catalog.js +76 -0
- package/src/js/style/custom.js +84 -0
- package/src/js/style/fields.js +382 -0
- package/src/js/style/float.js +46 -0
- package/src/js/style/options.js +75 -0
- package/src/js/style/sections.js +271 -0
- package/src/js/style/spacing.js +286 -0
- package/src/js/style/textalign.js +52 -0
- package/src/js/style/visibility.js +160 -0
- package/src/less/grideditor.less +111 -0
- package/types/grideditor.d.ts +18 -0
package/dist/grideditor.js
CHANGED
|
@@ -660,6 +660,7 @@
|
|
|
660
660
|
instance.settings = settingsCopy();
|
|
661
661
|
removeConfirmModal();
|
|
662
662
|
removeSettingsPanels();
|
|
663
|
+
removeDialog();
|
|
663
664
|
mainControls.remove();
|
|
664
665
|
createMainControls();
|
|
665
666
|
reset();
|
|
@@ -1610,6 +1611,9 @@
|
|
|
1610
1611
|
if (openSettingsState && !attached(openSettingsState.node)) {
|
|
1611
1612
|
closeSettings();
|
|
1612
1613
|
}
|
|
1614
|
+
if (dialogState && dialogState.home && !attached(dialogState.home)) {
|
|
1615
|
+
closeDialog();
|
|
1616
|
+
}
|
|
1613
1617
|
runFilter(true);
|
|
1614
1618
|
addClass(canvas, "ge-editing");
|
|
1615
1619
|
toggleClass(canvas, "ge-drag-drawer", settings.drag_handle === "drawer");
|
|
@@ -1633,9 +1637,11 @@
|
|
|
1633
1637
|
plugins("onBeforeDeinit");
|
|
1634
1638
|
closeSizePicker();
|
|
1635
1639
|
hideDropMarker();
|
|
1640
|
+
closeDialog();
|
|
1636
1641
|
all(canvas, ".ge-tools-drawer").forEach(function(drawer) {
|
|
1637
1642
|
drawer.remove();
|
|
1638
1643
|
});
|
|
1644
|
+
pluginFields.clear();
|
|
1639
1645
|
unwrapTexts();
|
|
1640
1646
|
plugins("onDeinit");
|
|
1641
1647
|
clearPreviews(canvas);
|
|
@@ -1671,6 +1677,7 @@
|
|
|
1671
1677
|
deinit();
|
|
1672
1678
|
removeConfirmModal();
|
|
1673
1679
|
removeSettingsPanels();
|
|
1680
|
+
removeDialog();
|
|
1674
1681
|
mainControls.remove();
|
|
1675
1682
|
htmlTextArea.remove();
|
|
1676
1683
|
lifetime.abort();
|
|
@@ -1683,25 +1690,53 @@
|
|
|
1683
1690
|
if (settings.row_cols !== false) {
|
|
1684
1691
|
registerFamily("grid", {}, rowColsFamily());
|
|
1685
1692
|
}
|
|
1686
|
-
var
|
|
1693
|
+
var replacedBy = {};
|
|
1694
|
+
[GridEditor.containers, GridEditor.features, GridEditor.utilities].forEach(function(registry) {
|
|
1695
|
+
Object.keys(registry).forEach(function(name) {
|
|
1696
|
+
(registry[name].replaces || []).forEach(function(old) {
|
|
1697
|
+
if (!replacedBy[old]) {
|
|
1698
|
+
replacedBy[old] = name;
|
|
1699
|
+
}
|
|
1700
|
+
});
|
|
1701
|
+
});
|
|
1702
|
+
});
|
|
1703
|
+
var named = function(name) {
|
|
1687
1704
|
return !settings.plugins || settings.plugins.indexOf(name) !== -1;
|
|
1688
1705
|
};
|
|
1706
|
+
var namedAsOld = function(name) {
|
|
1707
|
+
return !!settings.plugins && settings.plugins.some(function(old) {
|
|
1708
|
+
return replacedBy[old] === name;
|
|
1709
|
+
});
|
|
1710
|
+
};
|
|
1711
|
+
var standsDown = function(name) {
|
|
1712
|
+
return !!replacedBy[name] && wanted(replacedBy[name]);
|
|
1713
|
+
};
|
|
1714
|
+
var wanted = function(name) {
|
|
1715
|
+
return !standsDown(name) && (named(name) || namedAsOld(name));
|
|
1716
|
+
};
|
|
1717
|
+
var replaced = function(name) {
|
|
1718
|
+
if (!standsDown(name) || !named(name)) {
|
|
1719
|
+
return false;
|
|
1720
|
+
}
|
|
1721
|
+
warnOnceHere("replaced:" + name, 'the "' + name + '" plugin is part of "' + replacedBy[name] + '", which is loaded: ignoring it');
|
|
1722
|
+
return true;
|
|
1723
|
+
};
|
|
1689
1724
|
var featureWanted = function(name, factory) {
|
|
1690
1725
|
return factory.always === true || wanted(name);
|
|
1691
1726
|
};
|
|
1692
1727
|
Object.keys(GridEditor.containers).forEach(function(type) {
|
|
1693
|
-
if (wanted(type)) {
|
|
1728
|
+
if (!replaced(type) && wanted(type)) {
|
|
1694
1729
|
CONTAINERS[type] = GridEditor.containers[type](api);
|
|
1695
1730
|
}
|
|
1696
1731
|
});
|
|
1697
1732
|
Object.keys(GridEditor.features).forEach(function(name) {
|
|
1698
1733
|
var factory = GridEditor.features[name];
|
|
1699
|
-
if (featureWanted(name, factory)) {
|
|
1734
|
+
if (!replaced(name) && featureWanted(name, factory)) {
|
|
1700
1735
|
FEATURES[name] = factory(api);
|
|
1701
1736
|
}
|
|
1702
1737
|
});
|
|
1703
1738
|
Object.keys(GridEditor.utilities).forEach(function(name) {
|
|
1704
|
-
if (!wanted(name)) {
|
|
1739
|
+
if (replaced(name) || !wanted(name)) {
|
|
1705
1740
|
return;
|
|
1706
1741
|
}
|
|
1707
1742
|
UTILITIES[name] = GridEditor.utilities[name](api);
|
|
@@ -1719,6 +1754,10 @@
|
|
|
1719
1754
|
if (CONTAINERS[name] || FEATURES[name] || UTILITIES[name]) {
|
|
1720
1755
|
return;
|
|
1721
1756
|
}
|
|
1757
|
+
if (standsDown(name)) {
|
|
1758
|
+
warnOnceHere("renamed:" + name, 'the "' + name + '" plugin is part of "' + replacedBy[name] + '" now: name "' + replacedBy[name] + '" in the plugins setting instead');
|
|
1759
|
+
return;
|
|
1760
|
+
}
|
|
1722
1761
|
warnOnceHere("plugin:" + name, 'the "' + name + '" plugin is not loaded: include dist/plugins/grideditor.' + name + ".js after the editor");
|
|
1723
1762
|
});
|
|
1724
1763
|
}
|
|
@@ -1767,6 +1806,12 @@
|
|
|
1767
1806
|
setUtility,
|
|
1768
1807
|
utilityField,
|
|
1769
1808
|
bareStyle,
|
|
1809
|
+
// The host's own style, under the preview
|
|
1810
|
+
hostStyle,
|
|
1811
|
+
setHostStyle,
|
|
1812
|
+
// A modal of the editor's own, over the settings
|
|
1813
|
+
openDialog,
|
|
1814
|
+
closeDialog,
|
|
1770
1815
|
rowFromLayout: rowFromLayoutValue,
|
|
1771
1816
|
nodeHtml,
|
|
1772
1817
|
// A text editor has rewritten a content area, so whatever the
|
|
@@ -2003,6 +2048,7 @@
|
|
|
2003
2048
|
renderUtilities(section);
|
|
2004
2049
|
});
|
|
2005
2050
|
}
|
|
2051
|
+
renderPluginFields(node);
|
|
2006
2052
|
refreshPreviews(node);
|
|
2007
2053
|
}
|
|
2008
2054
|
function utilityNodes(scope) {
|
|
@@ -2069,6 +2115,61 @@
|
|
|
2069
2115
|
dropEmptyStyle(node);
|
|
2070
2116
|
});
|
|
2071
2117
|
}
|
|
2118
|
+
function hostDeclaration(node) {
|
|
2119
|
+
var scratch = document.createElement("div");
|
|
2120
|
+
var was = {};
|
|
2121
|
+
scratch.style.cssText = node.style.cssText;
|
|
2122
|
+
try {
|
|
2123
|
+
was = JSON.parse(node.getAttribute(PREVIEW_ATTR)) || {};
|
|
2124
|
+
} catch (error) {
|
|
2125
|
+
}
|
|
2126
|
+
Object.keys(was).forEach(function(property) {
|
|
2127
|
+
var before = was[property];
|
|
2128
|
+
if (before && before[0]) {
|
|
2129
|
+
scratch.style.setProperty(property, before[0], before[1]);
|
|
2130
|
+
} else {
|
|
2131
|
+
scratch.style.removeProperty(property);
|
|
2132
|
+
}
|
|
2133
|
+
});
|
|
2134
|
+
return scratch.style;
|
|
2135
|
+
}
|
|
2136
|
+
function hostStyle(node, property) {
|
|
2137
|
+
var declaration = hostDeclaration(node);
|
|
2138
|
+
if (property === void 0) {
|
|
2139
|
+
return declaration.cssText;
|
|
2140
|
+
}
|
|
2141
|
+
return {
|
|
2142
|
+
value: declaration.getPropertyValue(property),
|
|
2143
|
+
priority: declaration.getPropertyPriority(property)
|
|
2144
|
+
};
|
|
2145
|
+
}
|
|
2146
|
+
function setHostStyle(node, property, value, priority) {
|
|
2147
|
+
value = value === null || value === void 0 ? "" : String(value).trim();
|
|
2148
|
+
if (priority === void 0) {
|
|
2149
|
+
priority = hostStyle(node, property).priority;
|
|
2150
|
+
}
|
|
2151
|
+
if (value !== "") {
|
|
2152
|
+
var check = document.createElement("div").style;
|
|
2153
|
+
check.setProperty(property, value, priority || "");
|
|
2154
|
+
if (check.getPropertyValue(property) === "") {
|
|
2155
|
+
return false;
|
|
2156
|
+
}
|
|
2157
|
+
}
|
|
2158
|
+
var previewed = node.hasAttribute(PREVIEW_ATTR);
|
|
2159
|
+
if (previewed) {
|
|
2160
|
+
clearPreviews(node);
|
|
2161
|
+
}
|
|
2162
|
+
if (value === "") {
|
|
2163
|
+
node.style.removeProperty(property);
|
|
2164
|
+
} else {
|
|
2165
|
+
node.style.setProperty(property, value, priority || "");
|
|
2166
|
+
}
|
|
2167
|
+
dropEmptyStyle(node);
|
|
2168
|
+
if (previewed) {
|
|
2169
|
+
refreshPreviews(node);
|
|
2170
|
+
}
|
|
2171
|
+
return true;
|
|
2172
|
+
}
|
|
2072
2173
|
function createUtilitiesSection(node) {
|
|
2073
2174
|
var kind = kindOf(node);
|
|
2074
2175
|
var fields = familiesFor(kind).filter(function(family) {
|
|
@@ -2125,8 +2226,25 @@
|
|
|
2125
2226
|
}
|
|
2126
2227
|
var field = createField(node, family);
|
|
2127
2228
|
renderField(field, node);
|
|
2229
|
+
pluginFields.set(field, node);
|
|
2128
2230
|
return field;
|
|
2129
2231
|
}
|
|
2232
|
+
var pluginFields = /* @__PURE__ */ new Map();
|
|
2233
|
+
function renderPluginFields(node) {
|
|
2234
|
+
pluginFields.forEach(function(fieldNode, field) {
|
|
2235
|
+
if (!field.isConnected) {
|
|
2236
|
+
pluginFields.delete(field);
|
|
2237
|
+
return;
|
|
2238
|
+
}
|
|
2239
|
+
if (node && fieldNode !== node) {
|
|
2240
|
+
return;
|
|
2241
|
+
}
|
|
2242
|
+
if (closest(field, ".ge-utilities")) {
|
|
2243
|
+
return;
|
|
2244
|
+
}
|
|
2245
|
+
renderField(field, fieldNode);
|
|
2246
|
+
});
|
|
2247
|
+
}
|
|
2130
2248
|
function renderUtilities(section) {
|
|
2131
2249
|
var node = sectionNodes.get(section);
|
|
2132
2250
|
children(section, ".ge-utilities-toggle").forEach(function(toggle2) {
|
|
@@ -2670,12 +2788,50 @@
|
|
|
2670
2788
|
});
|
|
2671
2789
|
classGroup.appendChild(btn);
|
|
2672
2790
|
});
|
|
2791
|
+
pluginSections(container).forEach(function(section) {
|
|
2792
|
+
detailsDiv.appendChild(section);
|
|
2793
|
+
});
|
|
2673
2794
|
var utilities = createUtilitiesSection(container);
|
|
2674
2795
|
if (utilities) {
|
|
2675
2796
|
detailsDiv.appendChild(utilities);
|
|
2676
2797
|
}
|
|
2677
2798
|
return detailsDiv;
|
|
2678
2799
|
}
|
|
2800
|
+
function pluginSections(node) {
|
|
2801
|
+
var kind = kindOf(node);
|
|
2802
|
+
var mode = panelMode();
|
|
2803
|
+
var sections = [];
|
|
2804
|
+
[CONTAINERS, FEATURES, UTILITIES].forEach(function(registry) {
|
|
2805
|
+
Object.keys(registry).forEach(function(name) {
|
|
2806
|
+
var plugin = registry[name];
|
|
2807
|
+
var section = plugin.panelSection ? plugin.panelSection(node, kind) : null;
|
|
2808
|
+
if (!section || !section.body) {
|
|
2809
|
+
return;
|
|
2810
|
+
}
|
|
2811
|
+
var holder = element("div", { "class": "ge-panel-section", "data-ge-plugin": name });
|
|
2812
|
+
if (mode === "offcanvas" || mode === "modal") {
|
|
2813
|
+
holder.appendChild(section.body);
|
|
2814
|
+
} else {
|
|
2815
|
+
var label = t(section.labelKey);
|
|
2816
|
+
var open = holder.appendChild(element("button", {
|
|
2817
|
+
type: "button",
|
|
2818
|
+
"class": "btn btn-sm btn-outline-secondary ge-panel-section-open"
|
|
2819
|
+
}, label));
|
|
2820
|
+
hide(section.body);
|
|
2821
|
+
holder.appendChild(section.body);
|
|
2822
|
+
open.addEventListener("click", function() {
|
|
2823
|
+
openDialog(
|
|
2824
|
+
section.titleKey ? t(section.titleKey, { kind: kindLabel(node) }) : label,
|
|
2825
|
+
section.body,
|
|
2826
|
+
open
|
|
2827
|
+
);
|
|
2828
|
+
});
|
|
2829
|
+
}
|
|
2830
|
+
sections.push(holder);
|
|
2831
|
+
});
|
|
2832
|
+
});
|
|
2833
|
+
return sections;
|
|
2834
|
+
}
|
|
2679
2835
|
var PANEL_MODES = ["offcanvas", "popover", "modal", "inline"];
|
|
2680
2836
|
var settingsPanels = {};
|
|
2681
2837
|
var openSettingsState = null;
|
|
@@ -2723,7 +2879,7 @@
|
|
|
2723
2879
|
addClass(node, "ge-settings-target");
|
|
2724
2880
|
var signal = { signal: listening.signal };
|
|
2725
2881
|
document.addEventListener("keydown", function(e) {
|
|
2726
|
-
if (e.key === "Escape") {
|
|
2882
|
+
if (e.key === "Escape" && !dialogState) {
|
|
2727
2883
|
closeSettings();
|
|
2728
2884
|
}
|
|
2729
2885
|
}, signal);
|
|
@@ -2746,15 +2902,20 @@
|
|
|
2746
2902
|
openSettingsState.observer.observe(details);
|
|
2747
2903
|
}
|
|
2748
2904
|
on(document, "mousedown touchstart", function(e) {
|
|
2749
|
-
if (!panel.contains(e.target) && !gear.contains(e.target)) {
|
|
2905
|
+
if (!dialogState && !panel.contains(e.target) && !gear.contains(e.target)) {
|
|
2750
2906
|
closeSettings();
|
|
2751
2907
|
}
|
|
2752
2908
|
}, signal);
|
|
2753
2909
|
} else {
|
|
2754
|
-
showModal(panel)
|
|
2910
|
+
showModal(panel, function() {
|
|
2911
|
+
if (openSettingsState && openSettingsState.mode === "modal") {
|
|
2912
|
+
closeSettings();
|
|
2913
|
+
}
|
|
2914
|
+
});
|
|
2755
2915
|
}
|
|
2756
2916
|
}
|
|
2757
2917
|
function closeSettings() {
|
|
2918
|
+
closeDialog();
|
|
2758
2919
|
var open = openSettingsState;
|
|
2759
2920
|
if (!open) {
|
|
2760
2921
|
return;
|
|
@@ -2832,10 +2993,9 @@
|
|
|
2832
2993
|
settingsPanels[mode].remove();
|
|
2833
2994
|
}
|
|
2834
2995
|
});
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
}
|
|
2996
|
+
Object.keys(settingsPanels).forEach(function(mode) {
|
|
2997
|
+
removeBackdrop(settingsPanels[mode]);
|
|
2998
|
+
});
|
|
2839
2999
|
settingsPanels = {};
|
|
2840
3000
|
}
|
|
2841
3001
|
function placePopover(panel, gear) {
|
|
@@ -2866,25 +3026,30 @@
|
|
|
2866
3026
|
left: Math.max(gap, Math.min(tool.left + tool.width / 2 - left - 8, width - 24))
|
|
2867
3027
|
});
|
|
2868
3028
|
}
|
|
2869
|
-
|
|
2870
|
-
function showModal(panel) {
|
|
3029
|
+
function showModal(panel, dismissed) {
|
|
2871
3030
|
var Modal = modalLibrary();
|
|
3031
|
+
var state = modalState.get(panel);
|
|
3032
|
+
if (!state) {
|
|
3033
|
+
state = { wanted: null, busy: false, backdrop: null, dismissed };
|
|
3034
|
+
modalState.set(panel, state);
|
|
3035
|
+
}
|
|
3036
|
+
state.dismissed = dismissed;
|
|
2872
3037
|
if (!Modal) {
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
3038
|
+
if (!state.backdrop) {
|
|
3039
|
+
state.backdrop = element("div", { "class": "modal-backdrop fade show ge-settings-backdrop" });
|
|
3040
|
+
state.backdrop.addEventListener("click", function() {
|
|
3041
|
+
state.dismissed();
|
|
3042
|
+
});
|
|
3043
|
+
document.body.appendChild(state.backdrop);
|
|
3044
|
+
}
|
|
2878
3045
|
addClass(panel, "show");
|
|
2879
3046
|
panel.style.display = "block";
|
|
2880
3047
|
panel.removeAttribute("aria-hidden");
|
|
2881
3048
|
return;
|
|
2882
3049
|
}
|
|
2883
3050
|
var modal = Modal.getOrCreateInstance(panel);
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
state = { wanted: null, busy: false };
|
|
2887
|
-
modalState.set(panel, state);
|
|
3051
|
+
if (!state.watched) {
|
|
3052
|
+
state.watched = true;
|
|
2888
3053
|
trackModal(panel);
|
|
2889
3054
|
panel.addEventListener("hide.bs.modal", function() {
|
|
2890
3055
|
if (state.wanted === "open") {
|
|
@@ -2901,9 +3066,9 @@
|
|
|
2901
3066
|
panel.addEventListener("hidden.bs.modal", function() {
|
|
2902
3067
|
state.busy = false;
|
|
2903
3068
|
if (state.wanted === "open") {
|
|
2904
|
-
showModal(panel);
|
|
2905
|
-
} else
|
|
2906
|
-
|
|
3069
|
+
showModal(panel, state.dismissed);
|
|
3070
|
+
} else {
|
|
3071
|
+
state.dismissed();
|
|
2907
3072
|
}
|
|
2908
3073
|
});
|
|
2909
3074
|
}
|
|
@@ -2915,23 +3080,117 @@
|
|
|
2915
3080
|
}
|
|
2916
3081
|
function hideModal(panel) {
|
|
2917
3082
|
var Modal = modalLibrary();
|
|
3083
|
+
var state = modalState.get(panel);
|
|
3084
|
+
if (!state) {
|
|
3085
|
+
return;
|
|
3086
|
+
}
|
|
3087
|
+
state.wanted = "closed";
|
|
2918
3088
|
if (!Modal) {
|
|
2919
|
-
if (
|
|
2920
|
-
|
|
2921
|
-
|
|
3089
|
+
if (state.backdrop) {
|
|
3090
|
+
state.backdrop.remove();
|
|
3091
|
+
state.backdrop = null;
|
|
2922
3092
|
}
|
|
2923
3093
|
removeClass(panel, "show");
|
|
2924
3094
|
panel.style.removeProperty("display");
|
|
2925
3095
|
panel.setAttribute("aria-hidden", "true");
|
|
2926
3096
|
return;
|
|
2927
3097
|
}
|
|
2928
|
-
var state = modalState.get(panel) || { wanted: null, busy: false };
|
|
2929
|
-
state.wanted = "closed";
|
|
2930
3098
|
if (!state.busy && hasClass(panel, "show")) {
|
|
2931
3099
|
state.busy = true;
|
|
2932
3100
|
Modal.getOrCreateInstance(panel).hide();
|
|
2933
3101
|
}
|
|
2934
3102
|
}
|
|
3103
|
+
function removeBackdrop(panel) {
|
|
3104
|
+
var state = modalState.get(panel);
|
|
3105
|
+
if (state && state.backdrop) {
|
|
3106
|
+
state.backdrop.remove();
|
|
3107
|
+
state.backdrop = null;
|
|
3108
|
+
}
|
|
3109
|
+
}
|
|
3110
|
+
var dialogPanel = null;
|
|
3111
|
+
var dialogState = null;
|
|
3112
|
+
function dialog() {
|
|
3113
|
+
if (dialogPanel) {
|
|
3114
|
+
return dialogPanel;
|
|
3115
|
+
}
|
|
3116
|
+
dialogPanel = create('<div class="modal fade ge-dialog" tabindex="-1" role="dialog" aria-hidden="true"><div class="modal-dialog modal-dialog-centered modal-dialog-scrollable"><div class="modal-content"><div class="modal-header"><h5 class="modal-title ge-dialog-title"></h5></div><div class="modal-body ge-dialog-body"></div><div class="modal-footer"></div></div></div></div>');
|
|
3117
|
+
one(dialogPanel, ".modal-header").appendChild(element("button", {
|
|
3118
|
+
type: "button",
|
|
3119
|
+
"class": "btn-close ge-dialog-close",
|
|
3120
|
+
"aria-label": t("panel.close")
|
|
3121
|
+
}));
|
|
3122
|
+
one(dialogPanel, ".modal-footer").appendChild(element("button", {
|
|
3123
|
+
type: "button",
|
|
3124
|
+
"class": "btn btn-primary ge-dialog-close"
|
|
3125
|
+
}, t("panel.done")));
|
|
3126
|
+
delegate(dialogPanel, "click", ".ge-dialog-close", function(e) {
|
|
3127
|
+
e.preventDefault();
|
|
3128
|
+
closeDialog();
|
|
3129
|
+
});
|
|
3130
|
+
return document.body.appendChild(dialogPanel);
|
|
3131
|
+
}
|
|
3132
|
+
function openDialog(title, body, opener) {
|
|
3133
|
+
closeDialog();
|
|
3134
|
+
var panel = dialog();
|
|
3135
|
+
var listening = new AbortController();
|
|
3136
|
+
dialogState = {
|
|
3137
|
+
body,
|
|
3138
|
+
home: body.parentElement,
|
|
3139
|
+
next: body.nextElementSibling,
|
|
3140
|
+
opener: opener || document.activeElement,
|
|
3141
|
+
listening
|
|
3142
|
+
};
|
|
3143
|
+
one(panel, ".ge-dialog-title").textContent = title;
|
|
3144
|
+
one(panel, ".ge-dialog-body").appendChild(body);
|
|
3145
|
+
show(body);
|
|
3146
|
+
if (!modalLibrary()) {
|
|
3147
|
+
document.addEventListener("keydown", function(e) {
|
|
3148
|
+
if (e.key === "Escape") {
|
|
3149
|
+
closeDialog();
|
|
3150
|
+
}
|
|
3151
|
+
}, { signal: listening.signal });
|
|
3152
|
+
}
|
|
3153
|
+
Object.keys(settingsPanels).forEach(function(mode) {
|
|
3154
|
+
addClass(settingsPanels[mode], "ge-under-dialog");
|
|
3155
|
+
});
|
|
3156
|
+
showModal(panel, function() {
|
|
3157
|
+
closeDialog();
|
|
3158
|
+
});
|
|
3159
|
+
}
|
|
3160
|
+
function closeDialog() {
|
|
3161
|
+
var open = dialogState;
|
|
3162
|
+
if (!open) {
|
|
3163
|
+
return;
|
|
3164
|
+
}
|
|
3165
|
+
dialogState = null;
|
|
3166
|
+
open.listening.abort();
|
|
3167
|
+
hideModal(dialogPanel);
|
|
3168
|
+
Object.keys(settingsPanels).forEach(function(mode) {
|
|
3169
|
+
removeClass(settingsPanels[mode], "ge-under-dialog");
|
|
3170
|
+
});
|
|
3171
|
+
hide(open.body);
|
|
3172
|
+
if (open.home && attached(open.home)) {
|
|
3173
|
+
if (open.next && open.next.parentElement === open.home) {
|
|
3174
|
+
open.home.insertBefore(open.body, open.next);
|
|
3175
|
+
} else {
|
|
3176
|
+
open.home.appendChild(open.body);
|
|
3177
|
+
}
|
|
3178
|
+
} else {
|
|
3179
|
+
open.body.remove();
|
|
3180
|
+
}
|
|
3181
|
+
if (open.opener && attached(open.opener) && open.opener.focus) {
|
|
3182
|
+
open.opener.focus();
|
|
3183
|
+
}
|
|
3184
|
+
}
|
|
3185
|
+
function removeDialog() {
|
|
3186
|
+
closeDialog();
|
|
3187
|
+
if (!dialogPanel) {
|
|
3188
|
+
return;
|
|
3189
|
+
}
|
|
3190
|
+
removeBackdrop(dialogPanel);
|
|
3191
|
+
retireModal(dialogPanel);
|
|
3192
|
+
dialogPanel = null;
|
|
3193
|
+
}
|
|
2935
3194
|
function kindLabel(node) {
|
|
2936
3195
|
var kind = kindOf(node);
|
|
2937
3196
|
if (CONTAINERS[kind] && CONTAINERS[kind].labelKey) {
|
|
@@ -3802,6 +4061,7 @@
|
|
|
3802
4061
|
renderUtilities(section);
|
|
3803
4062
|
});
|
|
3804
4063
|
});
|
|
4064
|
+
renderPluginFields(null);
|
|
3805
4065
|
refreshPreviews(canvas);
|
|
3806
4066
|
plugins("onViewChange", key);
|
|
3807
4067
|
emit("view-change", { canvas, breakpoint: key, from, to: key });
|
|
@@ -3890,7 +4150,7 @@
|
|
|
3890
4150
|
GridEditor._plainHtml = plainHtml;
|
|
3891
4151
|
GridEditor.Sortable = null;
|
|
3892
4152
|
GridEditor.bootstrap = null;
|
|
3893
|
-
GridEditor.version = false ? "dev" : "7.
|
|
4153
|
+
GridEditor.version = false ? "dev" : "7.3.0";
|
|
3894
4154
|
GridEditor.locales = {
|
|
3895
4155
|
en: {
|
|
3896
4156
|
"tool.move": "Move",
|