@contentful/field-editor-single-line 1.6.5 → 1.7.1
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.
|
@@ -65,14 +65,14 @@ function SingleLineEditor(props) {
|
|
|
65
65
|
const checkConstraint = _fieldeditorshared.ConstraintsUtils.makeChecker(constraints);
|
|
66
66
|
const direction = locales.direction[field.locale] || 'ltr';
|
|
67
67
|
const handleCheckConstraint = withCharValidation ? checkConstraint : ()=>true;
|
|
68
|
-
return _react.createElement(_fieldeditorshared.FieldConnector, {
|
|
68
|
+
return /*#__PURE__*/ _react.createElement(_fieldeditorshared.FieldConnector, {
|
|
69
69
|
field: field,
|
|
70
70
|
isInitiallyDisabled: isInitiallyDisabled,
|
|
71
71
|
isDisabled: isDisabled
|
|
72
72
|
}, ({ value, errors, disabled, setValue })=>{
|
|
73
|
-
return _react.createElement("div", {
|
|
73
|
+
return /*#__PURE__*/ _react.createElement("div", {
|
|
74
74
|
"data-test-id": "single-line-editor"
|
|
75
|
-
}, _react.createElement(_f36components.TextInput, {
|
|
75
|
+
}, /*#__PURE__*/ _react.createElement(_f36components.TextInput, {
|
|
76
76
|
id: id,
|
|
77
77
|
className: direction === 'rtl' ? _styles.rightToLeft : '',
|
|
78
78
|
isRequired: field.required,
|
|
@@ -84,12 +84,12 @@ function SingleLineEditor(props) {
|
|
|
84
84
|
onChange: (e)=>{
|
|
85
85
|
setValue(e.target.value);
|
|
86
86
|
}
|
|
87
|
-
}), withCharInformation && _react.createElement("div", {
|
|
87
|
+
}), withCharInformation && /*#__PURE__*/ _react.createElement("div", {
|
|
88
88
|
className: _styles.validationRow
|
|
89
|
-
}, _react.createElement(_fieldeditorshared.CharCounter, {
|
|
89
|
+
}, /*#__PURE__*/ _react.createElement(_fieldeditorshared.CharCounter, {
|
|
90
90
|
value: value || '',
|
|
91
91
|
checkConstraint: handleCheckConstraint
|
|
92
|
-
}), withCharValidation && _react.createElement(_fieldeditorshared.CharValidation, {
|
|
92
|
+
}), withCharValidation && /*#__PURE__*/ _react.createElement(_fieldeditorshared.CharValidation, {
|
|
93
93
|
constraints: constraints
|
|
94
94
|
})));
|
|
95
95
|
});
|
|
@@ -60,7 +60,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
60
60
|
type: 'Symbol'
|
|
61
61
|
};
|
|
62
62
|
});
|
|
63
|
-
(0, _react1.render)(_react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
63
|
+
(0, _react1.render)(/*#__PURE__*/ _react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
64
64
|
field: field,
|
|
65
65
|
isInitiallyDisabled: false,
|
|
66
66
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)()
|
|
@@ -78,7 +78,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
78
78
|
}
|
|
79
79
|
};
|
|
80
80
|
});
|
|
81
|
-
const { getByTestId, getByText } = (0, _react1.render)(_react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
81
|
+
const { getByTestId, getByText } = (0, _react1.render)(/*#__PURE__*/ _react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
82
82
|
field: field,
|
|
83
83
|
isInitiallyDisabled: false,
|
|
84
84
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)()
|
|
@@ -97,7 +97,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
97
97
|
type: 'Symbol'
|
|
98
98
|
};
|
|
99
99
|
});
|
|
100
|
-
const { getByTestId } = (0, _react1.render)(_react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
100
|
+
const { getByTestId } = (0, _react1.render)(/*#__PURE__*/ _react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
101
101
|
field: field,
|
|
102
102
|
isInitiallyDisabled: false,
|
|
103
103
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)()
|
|
@@ -133,7 +133,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
133
133
|
id: 'field-id'
|
|
134
134
|
};
|
|
135
135
|
});
|
|
136
|
-
const { getByText } = (0, _react1.render)(_react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
136
|
+
const { getByText } = (0, _react1.render)(/*#__PURE__*/ _react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
137
137
|
field: field,
|
|
138
138
|
isInitiallyDisabled: false,
|
|
139
139
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)()
|
|
@@ -149,7 +149,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
149
149
|
id: 'field-id'
|
|
150
150
|
};
|
|
151
151
|
});
|
|
152
|
-
const { getByText } = (0, _react1.render)(_react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
152
|
+
const { getByText } = (0, _react1.render)(/*#__PURE__*/ _react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
153
153
|
field: field,
|
|
154
154
|
isInitiallyDisabled: false,
|
|
155
155
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)()
|
|
@@ -173,7 +173,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
173
173
|
id: 'field-id'
|
|
174
174
|
};
|
|
175
175
|
});
|
|
176
|
-
const { getByText } = (0, _react1.render)(_react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
176
|
+
const { getByText } = (0, _react1.render)(/*#__PURE__*/ _react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
177
177
|
field: field,
|
|
178
178
|
isInitiallyDisabled: false,
|
|
179
179
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)()
|
|
@@ -196,7 +196,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
196
196
|
id: 'field-id'
|
|
197
197
|
};
|
|
198
198
|
});
|
|
199
|
-
const { getByText } = (0, _react1.render)(_react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
199
|
+
const { getByText } = (0, _react1.render)(/*#__PURE__*/ _react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
200
200
|
field: field,
|
|
201
201
|
isInitiallyDisabled: false,
|
|
202
202
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)()
|
|
@@ -220,7 +220,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
220
220
|
id: 'field-id'
|
|
221
221
|
};
|
|
222
222
|
});
|
|
223
|
-
const { getByText, queryByText } = (0, _react1.render)(_react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
223
|
+
const { getByText, queryByText } = (0, _react1.render)(/*#__PURE__*/ _react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
224
224
|
field: field,
|
|
225
225
|
withCharValidation: false,
|
|
226
226
|
isInitiallyDisabled: false,
|
|
@@ -245,7 +245,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
245
245
|
id: 'field-id'
|
|
246
246
|
};
|
|
247
247
|
});
|
|
248
|
-
const { queryByText } = (0, _react1.render)(_react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
248
|
+
const { queryByText } = (0, _react1.render)(/*#__PURE__*/ _react.createElement(_SingleLineEditor.SingleLineEditor, {
|
|
249
249
|
field: field,
|
|
250
250
|
withCharValidation: false,
|
|
251
251
|
isInitiallyDisabled: false,
|
|
@@ -14,14 +14,14 @@ export function SingleLineEditor(props) {
|
|
|
14
14
|
const checkConstraint = ConstraintsUtils.makeChecker(constraints);
|
|
15
15
|
const direction = locales.direction[field.locale] || 'ltr';
|
|
16
16
|
const handleCheckConstraint = withCharValidation ? checkConstraint : ()=>true;
|
|
17
|
-
return React.createElement(FieldConnector, {
|
|
17
|
+
return /*#__PURE__*/ React.createElement(FieldConnector, {
|
|
18
18
|
field: field,
|
|
19
19
|
isInitiallyDisabled: isInitiallyDisabled,
|
|
20
20
|
isDisabled: isDisabled
|
|
21
21
|
}, ({ value, errors, disabled, setValue })=>{
|
|
22
|
-
return React.createElement("div", {
|
|
22
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
23
23
|
"data-test-id": "single-line-editor"
|
|
24
|
-
}, React.createElement(TextInput, {
|
|
24
|
+
}, /*#__PURE__*/ React.createElement(TextInput, {
|
|
25
25
|
id: id,
|
|
26
26
|
className: direction === 'rtl' ? styles.rightToLeft : '',
|
|
27
27
|
isRequired: field.required,
|
|
@@ -33,12 +33,12 @@ export function SingleLineEditor(props) {
|
|
|
33
33
|
onChange: (e)=>{
|
|
34
34
|
setValue(e.target.value);
|
|
35
35
|
}
|
|
36
|
-
}), withCharInformation && React.createElement("div", {
|
|
36
|
+
}), withCharInformation && /*#__PURE__*/ React.createElement("div", {
|
|
37
37
|
className: styles.validationRow
|
|
38
|
-
}, React.createElement(CharCounter, {
|
|
38
|
+
}, /*#__PURE__*/ React.createElement(CharCounter, {
|
|
39
39
|
value: value || '',
|
|
40
40
|
checkConstraint: handleCheckConstraint
|
|
41
|
-
}), withCharValidation && React.createElement(CharValidation, {
|
|
41
|
+
}), withCharValidation && /*#__PURE__*/ React.createElement(CharValidation, {
|
|
42
42
|
constraints: constraints
|
|
43
43
|
})));
|
|
44
44
|
});
|
|
@@ -15,7 +15,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
15
15
|
type: 'Symbol'
|
|
16
16
|
};
|
|
17
17
|
});
|
|
18
|
-
render(React.createElement(SingleLineEditor, {
|
|
18
|
+
render(/*#__PURE__*/ React.createElement(SingleLineEditor, {
|
|
19
19
|
field: field,
|
|
20
20
|
isInitiallyDisabled: false,
|
|
21
21
|
locales: createFakeLocalesAPI()
|
|
@@ -33,7 +33,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
});
|
|
36
|
-
const { getByTestId, getByText } = render(React.createElement(SingleLineEditor, {
|
|
36
|
+
const { getByTestId, getByText } = render(/*#__PURE__*/ React.createElement(SingleLineEditor, {
|
|
37
37
|
field: field,
|
|
38
38
|
isInitiallyDisabled: false,
|
|
39
39
|
locales: createFakeLocalesAPI()
|
|
@@ -52,7 +52,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
52
52
|
type: 'Symbol'
|
|
53
53
|
};
|
|
54
54
|
});
|
|
55
|
-
const { getByTestId } = render(React.createElement(SingleLineEditor, {
|
|
55
|
+
const { getByTestId } = render(/*#__PURE__*/ React.createElement(SingleLineEditor, {
|
|
56
56
|
field: field,
|
|
57
57
|
isInitiallyDisabled: false,
|
|
58
58
|
locales: createFakeLocalesAPI()
|
|
@@ -88,7 +88,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
88
88
|
id: 'field-id'
|
|
89
89
|
};
|
|
90
90
|
});
|
|
91
|
-
const { getByText } = render(React.createElement(SingleLineEditor, {
|
|
91
|
+
const { getByText } = render(/*#__PURE__*/ React.createElement(SingleLineEditor, {
|
|
92
92
|
field: field,
|
|
93
93
|
isInitiallyDisabled: false,
|
|
94
94
|
locales: createFakeLocalesAPI()
|
|
@@ -104,7 +104,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
104
104
|
id: 'field-id'
|
|
105
105
|
};
|
|
106
106
|
});
|
|
107
|
-
const { getByText } = render(React.createElement(SingleLineEditor, {
|
|
107
|
+
const { getByText } = render(/*#__PURE__*/ React.createElement(SingleLineEditor, {
|
|
108
108
|
field: field,
|
|
109
109
|
isInitiallyDisabled: false,
|
|
110
110
|
locales: createFakeLocalesAPI()
|
|
@@ -128,7 +128,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
128
128
|
id: 'field-id'
|
|
129
129
|
};
|
|
130
130
|
});
|
|
131
|
-
const { getByText } = render(React.createElement(SingleLineEditor, {
|
|
131
|
+
const { getByText } = render(/*#__PURE__*/ React.createElement(SingleLineEditor, {
|
|
132
132
|
field: field,
|
|
133
133
|
isInitiallyDisabled: false,
|
|
134
134
|
locales: createFakeLocalesAPI()
|
|
@@ -151,7 +151,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
151
151
|
id: 'field-id'
|
|
152
152
|
};
|
|
153
153
|
});
|
|
154
|
-
const { getByText } = render(React.createElement(SingleLineEditor, {
|
|
154
|
+
const { getByText } = render(/*#__PURE__*/ React.createElement(SingleLineEditor, {
|
|
155
155
|
field: field,
|
|
156
156
|
isInitiallyDisabled: false,
|
|
157
157
|
locales: createFakeLocalesAPI()
|
|
@@ -175,7 +175,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
175
175
|
id: 'field-id'
|
|
176
176
|
};
|
|
177
177
|
});
|
|
178
|
-
const { getByText, queryByText } = render(React.createElement(SingleLineEditor, {
|
|
178
|
+
const { getByText, queryByText } = render(/*#__PURE__*/ React.createElement(SingleLineEditor, {
|
|
179
179
|
field: field,
|
|
180
180
|
withCharValidation: false,
|
|
181
181
|
isInitiallyDisabled: false,
|
|
@@ -200,7 +200,7 @@ describe('SingleLineEditor', ()=>{
|
|
|
200
200
|
id: 'field-id'
|
|
201
201
|
};
|
|
202
202
|
});
|
|
203
|
-
const { queryByText } = render(React.createElement(SingleLineEditor, {
|
|
203
|
+
const { queryByText } = render(/*#__PURE__*/ React.createElement(SingleLineEditor, {
|
|
204
204
|
field: field,
|
|
205
205
|
withCharValidation: false,
|
|
206
206
|
isInitiallyDisabled: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-single-line",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.1",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -37,18 +37,20 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@contentful/f36-components": "^4.70.0",
|
|
39
39
|
"@contentful/f36-tokens": "^4.0.5",
|
|
40
|
-
"@contentful/field-editor-shared": "^2.
|
|
40
|
+
"@contentful/field-editor-shared": "^2.9.0",
|
|
41
41
|
"emotion": "^10.0.17",
|
|
42
42
|
"lodash": "^4.17.15"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@contentful/field-editor-test-utils": "^1.5.2"
|
|
45
|
+
"@contentful/field-editor-test-utils": "^1.5.2",
|
|
46
|
+
"@lingui/core": "5.3.0"
|
|
46
47
|
},
|
|
47
48
|
"peerDependencies": {
|
|
49
|
+
"@lingui/core": "^5.3.0",
|
|
48
50
|
"react": ">=16.8.0"
|
|
49
51
|
},
|
|
50
52
|
"publishConfig": {
|
|
51
53
|
"registry": "https://npm.pkg.github.com/"
|
|
52
54
|
},
|
|
53
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "44e5546797a12db4d96f290e039a483297265ffa"
|
|
54
56
|
}
|