@contentful/field-editor-json 3.3.37 → 3.3.38

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.
@@ -8,9 +8,9 @@ Object.defineProperty(exports, "default", {
8
8
  return JsonEditor;
9
9
  }
10
10
  });
11
- const _react = _interop_require_wildcard(require("react"));
11
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
12
12
  const _fieldeditorshared = require("@contentful/field-editor-shared");
13
- const _throttle = _interop_require_default(require("lodash/throttle"));
13
+ const _throttle = /*#__PURE__*/ _interop_require_default(require("lodash/throttle"));
14
14
  const _JsonEditorField = require("./JsonEditorField");
15
15
  const _JsonEditorToolbar = require("./JsonEditorToolbar");
16
16
  const _JsonInvalidStatus = require("./JsonInvalidStatus");
@@ -91,21 +91,18 @@ class ConnectedJsonEditor extends (_React_Component = _react.Component) {
91
91
  }), !this.state.isValidJson && _react.createElement(_JsonInvalidStatus.JsonInvalidStatus, null));
92
92
  }
93
93
  constructor(props){
94
- super(props);
95
- _define_property(this, "setValidJson", (value)=>{
94
+ super(props), _define_property(this, "setValidJson", (value)=>{
96
95
  this.setState({
97
96
  isValidJson: value
98
97
  });
99
- });
100
- _define_property(this, "pushUndo", (0, _throttle.default)((value)=>{
98
+ }), _define_property(this, "pushUndo", (0, _throttle.default)((value)=>{
101
99
  this.setState((state)=>({
102
100
  undoStack: [
103
101
  ...state.undoStack,
104
102
  value
105
103
  ]
106
104
  }));
107
- }, 400));
108
- _define_property(this, "onChange", (value)=>{
105
+ }, 400)), _define_property(this, "onChange", (value)=>{
109
106
  const parsed = (0, _utils.parseJSON)(value);
110
107
  if (value !== this.state.lastUndo) {
111
108
  this.pushUndo(this.state.value);
@@ -117,8 +114,7 @@ class ConnectedJsonEditor extends (_React_Component = _react.Component) {
117
114
  if (parsed.valid) {
118
115
  this.props.setValue(parsed.value);
119
116
  }
120
- });
121
- _define_property(this, "onUndo", ()=>{
117
+ }), _define_property(this, "onUndo", ()=>{
122
118
  const undoStack = this.state.undoStack;
123
119
  if (undoStack.length === 0) {
124
120
  return;
@@ -140,8 +136,7 @@ class ConnectedJsonEditor extends (_React_Component = _react.Component) {
140
136
  this.props.setValue(parsedValue.value);
141
137
  }
142
138
  });
143
- });
144
- _define_property(this, "onRedo", ()=>{
139
+ }), _define_property(this, "onRedo", ()=>{
145
140
  const redoStack = [
146
141
  ...this.state.redoStack
147
142
  ];
@@ -8,12 +8,12 @@ Object.defineProperty(exports, "JsonEditorField", {
8
8
  return JsonEditorField;
9
9
  }
10
10
  });
11
- const _react = _interop_require_wildcard(require("react"));
11
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
12
12
  const _langjson = require("@codemirror/lang-json");
13
13
  const _language = require("@codemirror/language");
14
14
  const _view = require("@codemirror/view");
15
- const _f36tokens = _interop_require_default(require("@contentful/f36-tokens"));
16
- const _reactcodemirror = _interop_require_default(require("@uiw/react-codemirror"));
15
+ const _f36tokens = /*#__PURE__*/ _interop_require_default(require("@contentful/f36-tokens"));
16
+ const _reactcodemirror = /*#__PURE__*/ _interop_require_default(require("@uiw/react-codemirror"));
17
17
  const _emotion = require("emotion");
18
18
  const _utils = require("./utils");
19
19
  function _interop_require_default(obj) {
@@ -8,9 +8,9 @@ Object.defineProperty(exports, "JsonEditorToolbar", {
8
8
  return JsonEditorToolbar;
9
9
  }
10
10
  });
11
- const _react = _interop_require_wildcard(require("react"));
11
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
12
12
  const _f36components = require("@contentful/f36-components");
13
- const _f36tokens = _interop_require_default(require("@contentful/f36-tokens"));
13
+ const _f36tokens = /*#__PURE__*/ _interop_require_default(require("@contentful/f36-tokens"));
14
14
  const _emotion = require("emotion");
15
15
  function _interop_require_default(obj) {
16
16
  return obj && obj.__esModule ? obj : {
@@ -8,9 +8,9 @@ Object.defineProperty(exports, "JsonInvalidStatus", {
8
8
  return JsonInvalidStatus;
9
9
  }
10
10
  });
11
- const _react = _interop_require_wildcard(require("react"));
11
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
12
12
  const _f36components = require("@contentful/f36-components");
13
- const _f36tokens = _interop_require_default(require("@contentful/f36-tokens"));
13
+ const _f36tokens = /*#__PURE__*/ _interop_require_default(require("@contentful/f36-tokens"));
14
14
  const _emotion = require("emotion");
15
15
  function _interop_require_default(obj) {
16
16
  return obj && obj.__esModule ? obj : {
package/dist/cjs/index.js CHANGED
@@ -8,7 +8,7 @@ Object.defineProperty(exports, "JsonEditor", {
8
8
  return _JsonEditor.default;
9
9
  }
10
10
  });
11
- const _JsonEditor = _interop_require_default(require("./JsonEditor"));
11
+ const _JsonEditor = /*#__PURE__*/ _interop_require_default(require("./JsonEditor"));
12
12
  function _interop_require_default(obj) {
13
13
  return obj && obj.__esModule ? obj : {
14
14
  default: obj
@@ -35,21 +35,18 @@ class ConnectedJsonEditor extends (_React_Component = React.Component) {
35
35
  }), !this.state.isValidJson && React.createElement(JsonInvalidStatus, null));
36
36
  }
37
37
  constructor(props){
38
- super(props);
39
- _define_property(this, "setValidJson", (value)=>{
38
+ super(props), _define_property(this, "setValidJson", (value)=>{
40
39
  this.setState({
41
40
  isValidJson: value
42
41
  });
43
- });
44
- _define_property(this, "pushUndo", throttle((value)=>{
42
+ }), _define_property(this, "pushUndo", throttle((value)=>{
45
43
  this.setState((state)=>({
46
44
  undoStack: [
47
45
  ...state.undoStack,
48
46
  value
49
47
  ]
50
48
  }));
51
- }, 400));
52
- _define_property(this, "onChange", (value)=>{
49
+ }, 400)), _define_property(this, "onChange", (value)=>{
53
50
  const parsed = parseJSON(value);
54
51
  if (value !== this.state.lastUndo) {
55
52
  this.pushUndo(this.state.value);
@@ -61,8 +58,7 @@ class ConnectedJsonEditor extends (_React_Component = React.Component) {
61
58
  if (parsed.valid) {
62
59
  this.props.setValue(parsed.value);
63
60
  }
64
- });
65
- _define_property(this, "onUndo", ()=>{
61
+ }), _define_property(this, "onUndo", ()=>{
66
62
  const undoStack = this.state.undoStack;
67
63
  if (undoStack.length === 0) {
68
64
  return;
@@ -84,8 +80,7 @@ class ConnectedJsonEditor extends (_React_Component = React.Component) {
84
80
  this.props.setValue(parsedValue.value);
85
81
  }
86
82
  });
87
- });
88
- _define_property(this, "onRedo", ()=>{
83
+ }), _define_property(this, "onRedo", ()=>{
89
84
  const redoStack = [
90
85
  ...this.state.redoStack
91
86
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-json",
3
- "version": "3.3.37",
3
+ "version": "3.3.38",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/types/index.d.ts",
@@ -36,7 +36,7 @@
36
36
  "@codemirror/lang-json": "^6.0.0",
37
37
  "@contentful/f36-components": "^4.70.0",
38
38
  "@contentful/f36-tokens": "^4.0.5",
39
- "@contentful/field-editor-shared": "^2.4.0",
39
+ "@contentful/field-editor-shared": "^2.4.1",
40
40
  "@types/react-codemirror": "1.0.11",
41
41
  "@uiw/react-codemirror": "^4.11.4",
42
42
  "emotion": "^10.0.17",
@@ -51,5 +51,5 @@
51
51
  "publishConfig": {
52
52
  "registry": "https://npm.pkg.github.com/"
53
53
  },
54
- "gitHead": "acf662acf17e749090975671bf14ce107ac9c499"
54
+ "gitHead": "1d0dc6dc10cf4ad43aa48b04fa67d29ab7edaee8"
55
55
  }