@saltcorn/builder 1.1.2-beta.9 → 1.1.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@saltcorn/builder",
|
|
3
|
-
"version": "1.1.2
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"description": "Drag and drop view builder for Saltcorn, open-source no-code platform",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"homepage": "https://saltcorn.com",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"@babel/preset-react": "7.24.7",
|
|
21
21
|
"@craftjs/core": "0.1.0-beta.20",
|
|
22
22
|
"@craftjs/utils": "0.1.0-beta.20",
|
|
23
|
-
"@saltcorn/common-code": "1.1.2
|
|
23
|
+
"@saltcorn/common-code": "1.1.2",
|
|
24
24
|
"saltcorn-craft-layers-noeye": "0.1.0-beta.22",
|
|
25
25
|
"@fonticonpicker/react-fonticonpicker": "1.2.0",
|
|
26
26
|
"@fortawesome/fontawesome-svg-core": "1.2.34",
|
|
@@ -89,7 +89,7 @@ const InitNewElement = ({ nodekeys, savingState, setSavingState }) => {
|
|
|
89
89
|
return {};
|
|
90
90
|
});
|
|
91
91
|
const options = useContext(optionsCtx);
|
|
92
|
-
const doSave = (query) => {
|
|
92
|
+
const doSave = (query, keepalive) => {
|
|
93
93
|
if (!query.serialize) return;
|
|
94
94
|
|
|
95
95
|
const data = craftToSaltcorn(
|
|
@@ -110,7 +110,7 @@ const InitNewElement = ({ nodekeys, savingState, setSavingState }) => {
|
|
|
110
110
|
|
|
111
111
|
fetch(`/${urlroot}/savebuilder/${options.page_id || options.view_id}`, {
|
|
112
112
|
method: "POST", // or 'PUT'
|
|
113
|
-
keepalive
|
|
113
|
+
keepalive,//this is conditional bec body size is limited to 64KB
|
|
114
114
|
headers: {
|
|
115
115
|
"Content-Type": "application/json",
|
|
116
116
|
"CSRF-Token": options.csrfToken,
|
|
@@ -144,7 +144,7 @@ const InitNewElement = ({ nodekeys, savingState, setSavingState }) => {
|
|
|
144
144
|
});
|
|
145
145
|
};
|
|
146
146
|
useEffect(() => {
|
|
147
|
-
window.addEventListener("beforeunload", () => doSave(query));
|
|
147
|
+
window.addEventListener("beforeunload", () => doSave(query, true));
|
|
148
148
|
window.addEventListener("blur", () => doSave(query));
|
|
149
149
|
window.addEventListener("pagehide", () => doSave(query));
|
|
150
150
|
}, []);
|