@saltcorn/builder 0.6.2-beta.0 → 0.6.2-beta.4

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": "0.6.2-beta.0",
3
+ "version": "0.6.2-beta.4",
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",
@@ -59,7 +59,7 @@ import { RenderNode } from "./RenderNode";
59
59
  const { Provider } = optionsCtx;
60
60
 
61
61
  /**
62
- *
62
+ *
63
63
  * @returns {div}
64
64
  * @category saltcorn-builder
65
65
  * @subcategory components
@@ -99,7 +99,7 @@ const SettingsPanel = () => {
99
99
  };
100
100
 
101
101
  /**
102
- * @param {number} offset
102
+ * @param {number} offset
103
103
  * @returns {NodeId}
104
104
  */
105
105
  const otherSibling = (offset) => {
@@ -109,7 +109,7 @@ const SettingsPanel = () => {
109
109
  };
110
110
 
111
111
  /**
112
- * @param {object} event
112
+ * @param {object} event
113
113
  */
114
114
  const handleUserKeyPress = (event) => {
115
115
  const { keyCode, target } = event;
@@ -168,8 +168,8 @@ const SettingsPanel = () => {
168
168
  }, [handleUserKeyPress]);
169
169
  const hasChildren =
170
170
  selected && selected.children && selected.children.length > 0;
171
-
172
- /**
171
+
172
+ /**
173
173
  * @returns {void}
174
174
  */
175
175
  const deleteChildren = () => {
@@ -178,7 +178,7 @@ const SettingsPanel = () => {
178
178
  });
179
179
  };
180
180
 
181
- /**
181
+ /**
182
182
  * @returns {void}
183
183
  */
184
184
  const duplicate = () => {
@@ -255,7 +255,7 @@ const SaveButton = () => {
255
255
  const options = useContext(optionsCtx);
256
256
 
257
257
  /**
258
- * @returns {void}
258
+ * @returns {void}
259
259
  */
260
260
  const onClick = () => {
261
261
  const data = craftToSaltcorn(JSON.parse(query.serialize()));
@@ -351,7 +351,7 @@ const NextButton = ({ layout }) => {
351
351
  layoutToNodes(layout, query, actions);
352
352
  }, []);
353
353
 
354
- /**
354
+ /**
355
355
  * @returns {void}
356
356
  */
357
357
  const onClick = () => {
@@ -395,7 +395,7 @@ export const fetchViewPreview = (args = {}) => (changes = {}) => {
395
395
  ...changes,
396
396
  };
397
397
  let viewname,
398
- body = configuration || {};
398
+ body = configuration ? { ...configuration } : {};
399
399
  if (view.includes(":")) {
400
400
  const [reltype, rest] = view.split(":");
401
401
  const [vnm] = rest.split(".");
@@ -925,7 +925,7 @@ export class ErrorBoundary extends React.Component {
925
925
  */
926
926
  constructor(props) {
927
927
  super(props);
928
- this.state = { hasError: false };
928
+ this.state = { hasError: false, reported: false };
929
929
  }
930
930
 
931
931
  /**
@@ -950,6 +950,23 @@ export class ErrorBoundary extends React.Component {
950
950
  JSON.stringify(error),
951
951
  JSON.stringify(errorInfo)
952
952
  );
953
+
954
+ if (!this.state.reported) {
955
+ const data = {
956
+ message: error.message,
957
+ stack: (error && error.stack) || "",
958
+ };
959
+
960
+ fetch("/crashlog/", {
961
+ method: "POST",
962
+ headers: {
963
+ "Content-Type": "application/json",
964
+ "CSRF-Token": _sc_globalCsrf,
965
+ },
966
+ body: JSON.stringify(data),
967
+ });
968
+ this.setState({ reported: true });
969
+ }
953
970
  }
954
971
 
955
972
  /**