@terrestris/shogun-admin 18.1.0-next.3 → 18.1.0-next.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.
@@ -77,7 +77,7 @@ export var JSONEditor = function (_a) {
77
77
  var _b;
78
78
  var _c;
79
79
  var initialValue = _a.initialValue, onChangeProp = _a.onChange, editorProps = _a.editorProps, entityType = _a.entityType, dataField = _a.dataField, _d = _a.indentSize, indentSize = _d === void 0 ? 2 : _d;
80
- var _e = useState(JSON.stringify(initialValue || undefined, null, indentSize)), currentValue = _e[0], setCurrentValue = _e[1];
80
+ var _e = useState(), currentValue = _e[0], setCurrentValue = _e[1];
81
81
  // We need to keep track of whether the document has been formatted initially. This is necessary
82
82
  // because the document will be formatted on mount, which will trigger the onChange event. We
83
83
  // don't want to trigger the onChange event on mount, so we need to keep track of whether the
@@ -217,6 +217,11 @@ export var JSONEditor = function (_a) {
217
217
  }
218
218
  };
219
219
  var isEditedManually = isEditedManuallyMap === null || isEditedManuallyMap === void 0 ? void 0 : isEditedManuallyMap["".concat(entityType, ".").concat(dataField)];
220
+ useEffect(function () {
221
+ if (initialValue) {
222
+ setCurrentValue(JSON.stringify(initialValue || undefined, null, indentSize));
223
+ }
224
+ }, [indentSize, initialValue]);
220
225
  return (React.createElement(FullscreenWrapper, null,
221
226
  React.createElement("div", { className: "json-editor" },
222
227
  React.createElement("div", { className: "json-editor-toolbar" },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terrestris/shogun-admin",
3
- "version": "18.1.0-next.3",
3
+ "version": "18.1.0-next.4",
4
4
  "description": "The admin UI for the SHOGun Web-mapping backend.",
5
5
  "keywords": [
6
6
  "SHOGun",