@contentful/field-editor-multiple-line 1.3.4 → 1.3.7
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.
|
@@ -33,7 +33,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
33
33
|
if (cache && cache.has(obj)) {
|
|
34
34
|
return cache.get(obj);
|
|
35
35
|
}
|
|
36
|
-
var newObj = {
|
|
36
|
+
var newObj = {
|
|
37
|
+
__proto__: null
|
|
38
|
+
};
|
|
37
39
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
38
40
|
for(var key in obj){
|
|
39
41
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -52,14 +54,14 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
52
54
|
return newObj;
|
|
53
55
|
}
|
|
54
56
|
function MultipleLineEditor(props) {
|
|
55
|
-
const { field
|
|
57
|
+
const { field, locales, isInitiallyDisabled, withCharValidation } = props;
|
|
56
58
|
const constraints = _fieldeditorshared.ConstraintsUtils.fromFieldValidations(field.validations, field.type);
|
|
57
59
|
const checkConstraint = _fieldeditorshared.ConstraintsUtils.makeChecker(constraints);
|
|
58
60
|
const direction = locales.direction[field.locale] || 'ltr';
|
|
59
61
|
return _react.createElement(_fieldeditorshared.FieldConnector, {
|
|
60
62
|
field: field,
|
|
61
63
|
isInitiallyDisabled: isInitiallyDisabled
|
|
62
|
-
}, ({ errors
|
|
64
|
+
}, ({ errors, disabled, value, setValue })=>{
|
|
63
65
|
return _react.createElement("div", {
|
|
64
66
|
"data-test-id": "multiple-line-editor"
|
|
65
67
|
}, _react.createElement(_f36components.Textarea, {
|
|
@@ -28,7 +28,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
28
28
|
if (cache && cache.has(obj)) {
|
|
29
29
|
return cache.get(obj);
|
|
30
30
|
}
|
|
31
|
-
var newObj = {
|
|
31
|
+
var newObj = {
|
|
32
|
+
__proto__: null
|
|
33
|
+
};
|
|
32
34
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
33
35
|
for(var key in obj){
|
|
34
36
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -70,7 +72,7 @@ describe('MultipleLineEditor', ()=>{
|
|
|
70
72
|
}
|
|
71
73
|
};
|
|
72
74
|
});
|
|
73
|
-
const { getByTestId
|
|
75
|
+
const { getByTestId } = (0, _react1.render)(_react.createElement(_MultipleLineEditor.MultipleLineEditor, {
|
|
74
76
|
field: field,
|
|
75
77
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
76
78
|
isInitiallyDisabled: false
|
|
@@ -86,7 +88,7 @@ describe('MultipleLineEditor', ()=>{
|
|
|
86
88
|
id: 'field-id'
|
|
87
89
|
};
|
|
88
90
|
});
|
|
89
|
-
const { getByTestId
|
|
91
|
+
const { getByTestId } = (0, _react1.render)(_react.createElement(_MultipleLineEditor.MultipleLineEditor, {
|
|
90
92
|
field: field,
|
|
91
93
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
92
94
|
isInitiallyDisabled: false
|
package/dist/cjs/styles.js
CHANGED
|
@@ -9,11 +9,11 @@ function _export(target, all) {
|
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
validationRow: function() {
|
|
13
|
-
return validationRow;
|
|
14
|
-
},
|
|
15
12
|
rightToLeft: function() {
|
|
16
13
|
return rightToLeft;
|
|
14
|
+
},
|
|
15
|
+
validationRow: function() {
|
|
16
|
+
return validationRow;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
const _f36tokens = _interop_require_default(require("@contentful/f36-tokens"));
|
|
@@ -3,14 +3,14 @@ import { Textarea } from '@contentful/f36-components';
|
|
|
3
3
|
import { FieldConnector, CharCounter, CharValidation, ConstraintsUtils } from '@contentful/field-editor-shared';
|
|
4
4
|
import * as styles from './styles';
|
|
5
5
|
export function MultipleLineEditor(props) {
|
|
6
|
-
const { field
|
|
6
|
+
const { field, locales, isInitiallyDisabled, withCharValidation } = props;
|
|
7
7
|
const constraints = ConstraintsUtils.fromFieldValidations(field.validations, field.type);
|
|
8
8
|
const checkConstraint = ConstraintsUtils.makeChecker(constraints);
|
|
9
9
|
const direction = locales.direction[field.locale] || 'ltr';
|
|
10
10
|
return React.createElement(FieldConnector, {
|
|
11
11
|
field: field,
|
|
12
12
|
isInitiallyDisabled: isInitiallyDisabled
|
|
13
|
-
}, ({ errors
|
|
13
|
+
}, ({ errors, disabled, value, setValue })=>{
|
|
14
14
|
return React.createElement("div", {
|
|
15
15
|
"data-test-id": "multiple-line-editor"
|
|
16
16
|
}, React.createElement(Textarea, {
|
|
@@ -27,7 +27,7 @@ describe('MultipleLineEditor', ()=>{
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
|
-
const { getByTestId
|
|
30
|
+
const { getByTestId } = render(React.createElement(MultipleLineEditor, {
|
|
31
31
|
field: field,
|
|
32
32
|
locales: createFakeLocalesAPI(),
|
|
33
33
|
isInitiallyDisabled: false
|
|
@@ -43,7 +43,7 @@ describe('MultipleLineEditor', ()=>{
|
|
|
43
43
|
id: 'field-id'
|
|
44
44
|
};
|
|
45
45
|
});
|
|
46
|
-
const { getByTestId
|
|
46
|
+
const { getByTestId } = render(React.createElement(MultipleLineEditor, {
|
|
47
47
|
field: field,
|
|
48
48
|
locales: createFakeLocalesAPI(),
|
|
49
49
|
isInitiallyDisabled: false
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { FieldAPI, LocalesAPI } from '@contentful/field-editor-shared';
|
|
3
3
|
export interface MultipleLineEditorProps {
|
|
4
4
|
/**
|
|
@@ -18,7 +18,7 @@ export interface MultipleLineEditorProps {
|
|
|
18
18
|
*/
|
|
19
19
|
locales: LocalesAPI;
|
|
20
20
|
}
|
|
21
|
-
export declare function MultipleLineEditor(props: MultipleLineEditorProps):
|
|
21
|
+
export declare function MultipleLineEditor(props: MultipleLineEditorProps): JSX.Element;
|
|
22
22
|
export declare namespace MultipleLineEditor {
|
|
23
23
|
var defaultProps: {
|
|
24
24
|
isInitiallyDisabled: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-multiple-line",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.7",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -37,15 +37,18 @@
|
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@contentful/f36-components": "^4.0.27",
|
|
39
39
|
"@contentful/f36-tokens": "^4.0.0",
|
|
40
|
-
"@contentful/field-editor-shared": "^1.4.
|
|
40
|
+
"@contentful/field-editor-shared": "^1.4.5",
|
|
41
41
|
"emotion": "^10.0.17",
|
|
42
42
|
"lodash": "^4.17.15"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@contentful/field-editor-test-utils": "^1.4.
|
|
45
|
+
"@contentful/field-editor-test-utils": "^1.4.6"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"react": ">=16.8.0"
|
|
49
49
|
},
|
|
50
|
-
"
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"registry": "https://npm.pkg.github.com/"
|
|
52
|
+
},
|
|
53
|
+
"gitHead": "142d2039f023bf4ced956aae1dd08b27c35fdbaa"
|
|
51
54
|
}
|