@contentful/field-editor-json 3.3.43 → 3.4.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/dist/cjs/JsonEditor.js +6 -6
- package/dist/cjs/JsonEditorField.js +2 -2
- package/dist/cjs/JsonEditorToolbar.js +5 -5
- package/dist/cjs/JsonInvalidStatus.js +2 -2
- package/dist/esm/JsonEditor.js +6 -6
- package/dist/esm/JsonEditorField.js +2 -2
- package/dist/esm/JsonEditorToolbar.js +5 -5
- package/dist/esm/JsonInvalidStatus.js +2 -2
- package/package.json +6 -4
package/dist/cjs/JsonEditor.js
CHANGED
|
@@ -77,18 +77,18 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
77
77
|
var _React_Component;
|
|
78
78
|
class ConnectedJsonEditor extends (_React_Component = _react.Component) {
|
|
79
79
|
render() {
|
|
80
|
-
return _react.createElement("div", {
|
|
80
|
+
return /*#__PURE__*/ _react.createElement("div", {
|
|
81
81
|
"data-test-id": "json-editor"
|
|
82
|
-
}, _react.createElement(_JsonEditorToolbar.JsonEditorToolbar, {
|
|
82
|
+
}, /*#__PURE__*/ _react.createElement(_JsonEditorToolbar.JsonEditorToolbar, {
|
|
83
83
|
isRedoDisabled: this.props.disabled || this.state.redoStack.length === 0,
|
|
84
84
|
isUndoDisabled: this.props.disabled || this.state.undoStack.length === 0,
|
|
85
85
|
onUndo: this.onUndo,
|
|
86
86
|
onRedo: this.onRedo
|
|
87
|
-
}), _react.createElement(_JsonEditorField.JsonEditorField, {
|
|
87
|
+
}), /*#__PURE__*/ _react.createElement(_JsonEditorField.JsonEditorField, {
|
|
88
88
|
value: this.state.value,
|
|
89
89
|
onChange: this.onChange,
|
|
90
90
|
isDisabled: this.props.disabled
|
|
91
|
-
}), !this.state.isValidJson && _react.createElement(_JsonInvalidStatus.JsonInvalidStatus, null));
|
|
91
|
+
}), !this.state.isValidJson && /*#__PURE__*/ _react.createElement(_JsonInvalidStatus.JsonInvalidStatus, null));
|
|
92
92
|
}
|
|
93
93
|
constructor(props){
|
|
94
94
|
super(props), _define_property(this, "setValidJson", (value)=>{
|
|
@@ -173,10 +173,10 @@ _define_property(ConnectedJsonEditor, "defaultProps", {
|
|
|
173
173
|
isInitiallyDisabled: true
|
|
174
174
|
});
|
|
175
175
|
function JsonEditor(props) {
|
|
176
|
-
return _react.createElement(_fieldeditorshared.FieldConnector, {
|
|
176
|
+
return /*#__PURE__*/ _react.createElement(_fieldeditorshared.FieldConnector, {
|
|
177
177
|
field: props.field,
|
|
178
178
|
isInitiallyDisabled: props.isInitiallyDisabled
|
|
179
|
-
}, ({ value, disabled, setValue, externalReset })
|
|
179
|
+
}, ({ value, disabled, setValue, externalReset })=>/*#__PURE__*/ _react.createElement(ConnectedJsonEditor, {
|
|
180
180
|
key: `json-editor-${externalReset}`,
|
|
181
181
|
initialValue: value,
|
|
182
182
|
disabled: disabled,
|
|
@@ -101,12 +101,12 @@ const styles = {
|
|
|
101
101
|
})
|
|
102
102
|
};
|
|
103
103
|
function JsonEditorField(props) {
|
|
104
|
-
return _react.createElement("div", {
|
|
104
|
+
return /*#__PURE__*/ _react.createElement("div", {
|
|
105
105
|
className: (0, _emotion.cx)(styles.root, {
|
|
106
106
|
disabled: props.isDisabled
|
|
107
107
|
}),
|
|
108
108
|
"data-test-id": "json-editor-code-mirror"
|
|
109
|
-
}, _react.createElement(_reactcodemirror.default, {
|
|
109
|
+
}, /*#__PURE__*/ _react.createElement(_reactcodemirror.default, {
|
|
110
110
|
value: props.value,
|
|
111
111
|
onChange: props.onChange,
|
|
112
112
|
theme: "light",
|
|
@@ -82,13 +82,13 @@ const styles = {
|
|
|
82
82
|
})
|
|
83
83
|
};
|
|
84
84
|
function JsonEditorToolbar(props) {
|
|
85
|
-
return _react.createElement("div", {
|
|
85
|
+
return /*#__PURE__*/ _react.createElement("div", {
|
|
86
86
|
className: styles.toolbar
|
|
87
|
-
}, _react.createElement("div", {
|
|
87
|
+
}, /*#__PURE__*/ _react.createElement("div", {
|
|
88
88
|
className: styles.title
|
|
89
|
-
}, "JSON Editor"), _react.createElement("div", {
|
|
89
|
+
}, "JSON Editor"), /*#__PURE__*/ _react.createElement("div", {
|
|
90
90
|
className: styles.actions
|
|
91
|
-
}, _react.createElement(_f36components.Button, {
|
|
91
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.Button, {
|
|
92
92
|
variant: "secondary",
|
|
93
93
|
size: "small",
|
|
94
94
|
isDisabled: props.isUndoDisabled,
|
|
@@ -96,7 +96,7 @@ function JsonEditorToolbar(props) {
|
|
|
96
96
|
onClick: ()=>{
|
|
97
97
|
props.onUndo();
|
|
98
98
|
}
|
|
99
|
-
}, "Undo"), _react.createElement(_f36components.Button, {
|
|
99
|
+
}, "Undo"), /*#__PURE__*/ _react.createElement(_f36components.Button, {
|
|
100
100
|
variant: "secondary",
|
|
101
101
|
size: "small",
|
|
102
102
|
isDisabled: props.isRedoDisabled,
|
|
@@ -59,11 +59,11 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
59
59
|
return newObj;
|
|
60
60
|
}
|
|
61
61
|
function JsonInvalidStatus() {
|
|
62
|
-
return _react.createElement("div", {
|
|
62
|
+
return /*#__PURE__*/ _react.createElement("div", {
|
|
63
63
|
role: "status",
|
|
64
64
|
"data-test-id": "json-editor.invalid-json",
|
|
65
65
|
className: (0, _emotion.css)({
|
|
66
66
|
marginTop: _f36tokens.default.spacingS
|
|
67
67
|
})
|
|
68
|
-
}, _react.createElement(_f36components.ValidationMessage, null, "This is not valid JSON"));
|
|
68
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.ValidationMessage, null, "This is not valid JSON"));
|
|
69
69
|
}
|
package/dist/esm/JsonEditor.js
CHANGED
|
@@ -21,18 +21,18 @@ import { stringifyJSON, parseJSON, SPACE_INDENT_COUNT } from './utils';
|
|
|
21
21
|
var _React_Component;
|
|
22
22
|
class ConnectedJsonEditor extends (_React_Component = React.Component) {
|
|
23
23
|
render() {
|
|
24
|
-
return React.createElement("div", {
|
|
24
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
25
25
|
"data-test-id": "json-editor"
|
|
26
|
-
}, React.createElement(JsonEditorToolbar, {
|
|
26
|
+
}, /*#__PURE__*/ React.createElement(JsonEditorToolbar, {
|
|
27
27
|
isRedoDisabled: this.props.disabled || this.state.redoStack.length === 0,
|
|
28
28
|
isUndoDisabled: this.props.disabled || this.state.undoStack.length === 0,
|
|
29
29
|
onUndo: this.onUndo,
|
|
30
30
|
onRedo: this.onRedo
|
|
31
|
-
}), React.createElement(JsonEditorField, {
|
|
31
|
+
}), /*#__PURE__*/ React.createElement(JsonEditorField, {
|
|
32
32
|
value: this.state.value,
|
|
33
33
|
onChange: this.onChange,
|
|
34
34
|
isDisabled: this.props.disabled
|
|
35
|
-
}), !this.state.isValidJson && React.createElement(JsonInvalidStatus, null));
|
|
35
|
+
}), !this.state.isValidJson && /*#__PURE__*/ React.createElement(JsonInvalidStatus, null));
|
|
36
36
|
}
|
|
37
37
|
constructor(props){
|
|
38
38
|
super(props), _define_property(this, "setValidJson", (value)=>{
|
|
@@ -117,10 +117,10 @@ _define_property(ConnectedJsonEditor, "defaultProps", {
|
|
|
117
117
|
isInitiallyDisabled: true
|
|
118
118
|
});
|
|
119
119
|
export default function JsonEditor(props) {
|
|
120
|
-
return React.createElement(FieldConnector, {
|
|
120
|
+
return /*#__PURE__*/ React.createElement(FieldConnector, {
|
|
121
121
|
field: props.field,
|
|
122
122
|
isInitiallyDisabled: props.isInitiallyDisabled
|
|
123
|
-
}, ({ value, disabled, setValue, externalReset })
|
|
123
|
+
}, ({ value, disabled, setValue, externalReset })=>/*#__PURE__*/ React.createElement(ConnectedJsonEditor, {
|
|
124
124
|
key: `json-editor-${externalReset}`,
|
|
125
125
|
initialValue: value,
|
|
126
126
|
disabled: disabled,
|
|
@@ -45,12 +45,12 @@ const styles = {
|
|
|
45
45
|
})
|
|
46
46
|
};
|
|
47
47
|
export function JsonEditorField(props) {
|
|
48
|
-
return React.createElement("div", {
|
|
48
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
49
49
|
className: cx(styles.root, {
|
|
50
50
|
disabled: props.isDisabled
|
|
51
51
|
}),
|
|
52
52
|
"data-test-id": "json-editor-code-mirror"
|
|
53
|
-
}, React.createElement(CodeMirror, {
|
|
53
|
+
}, /*#__PURE__*/ React.createElement(CodeMirror, {
|
|
54
54
|
value: props.value,
|
|
55
55
|
onChange: props.onChange,
|
|
56
56
|
theme: "light",
|
|
@@ -26,13 +26,13 @@ const styles = {
|
|
|
26
26
|
})
|
|
27
27
|
};
|
|
28
28
|
export function JsonEditorToolbar(props) {
|
|
29
|
-
return React.createElement("div", {
|
|
29
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
30
30
|
className: styles.toolbar
|
|
31
|
-
}, React.createElement("div", {
|
|
31
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
32
32
|
className: styles.title
|
|
33
|
-
}, "JSON Editor"), React.createElement("div", {
|
|
33
|
+
}, "JSON Editor"), /*#__PURE__*/ React.createElement("div", {
|
|
34
34
|
className: styles.actions
|
|
35
|
-
}, React.createElement(Button, {
|
|
35
|
+
}, /*#__PURE__*/ React.createElement(Button, {
|
|
36
36
|
variant: "secondary",
|
|
37
37
|
size: "small",
|
|
38
38
|
isDisabled: props.isUndoDisabled,
|
|
@@ -40,7 +40,7 @@ export function JsonEditorToolbar(props) {
|
|
|
40
40
|
onClick: ()=>{
|
|
41
41
|
props.onUndo();
|
|
42
42
|
}
|
|
43
|
-
}, "Undo"), React.createElement(Button, {
|
|
43
|
+
}, "Undo"), /*#__PURE__*/ React.createElement(Button, {
|
|
44
44
|
variant: "secondary",
|
|
45
45
|
size: "small",
|
|
46
46
|
isDisabled: props.isRedoDisabled,
|
|
@@ -3,11 +3,11 @@ import { ValidationMessage } from '@contentful/f36-components';
|
|
|
3
3
|
import tokens from '@contentful/f36-tokens';
|
|
4
4
|
import { css } from 'emotion';
|
|
5
5
|
export function JsonInvalidStatus() {
|
|
6
|
-
return React.createElement("div", {
|
|
6
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
7
7
|
role: "status",
|
|
8
8
|
"data-test-id": "json-editor.invalid-json",
|
|
9
9
|
className: css({
|
|
10
10
|
marginTop: tokens.spacingS
|
|
11
11
|
})
|
|
12
|
-
}, React.createElement(ValidationMessage, null, "This is not valid JSON"));
|
|
12
|
+
}, /*#__PURE__*/ React.createElement(ValidationMessage, null, "This is not valid JSON"));
|
|
13
13
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-json",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -36,20 +36,22 @@
|
|
|
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.
|
|
39
|
+
"@contentful/field-editor-shared": "^2.8.0",
|
|
40
40
|
"@types/react-codemirror": "1.0.11",
|
|
41
41
|
"@uiw/react-codemirror": "^4.11.4",
|
|
42
42
|
"emotion": "^10.0.17",
|
|
43
43
|
"lodash": "^4.17.15"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@contentful/field-editor-test-utils": "^1.5.2"
|
|
46
|
+
"@contentful/field-editor-test-utils": "^1.5.2",
|
|
47
|
+
"@lingui/core": "5.3.0"
|
|
47
48
|
},
|
|
48
49
|
"peerDependencies": {
|
|
50
|
+
"@lingui/core": "^5.3.0",
|
|
49
51
|
"react": ">=16.8.0"
|
|
50
52
|
},
|
|
51
53
|
"publishConfig": {
|
|
52
54
|
"registry": "https://npm.pkg.github.com/"
|
|
53
55
|
},
|
|
54
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "a86f67a6d507eb7c8c7a38b4312380361bdbebbb"
|
|
55
57
|
}
|