@contentful/field-editor-multiple-line 2.3.3-canary.26 → 2.3.3-canary.30
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.
|
@@ -58,14 +58,14 @@ function MultipleLineEditor(props) {
|
|
|
58
58
|
const constraints = _fieldeditorshared.ConstraintsUtils.fromFieldValidations(field.validations, field.type);
|
|
59
59
|
const checkConstraint = _fieldeditorshared.ConstraintsUtils.makeChecker(constraints);
|
|
60
60
|
const direction = locales.direction[field.locale] || 'ltr';
|
|
61
|
-
return
|
|
61
|
+
return _react.createElement(_fieldeditorshared.FieldConnector, {
|
|
62
62
|
field: field,
|
|
63
63
|
isInitiallyDisabled: isInitiallyDisabled,
|
|
64
64
|
isDisabled: isDisabled
|
|
65
65
|
}, ({ errors, disabled, value, setValue })=>{
|
|
66
|
-
return
|
|
66
|
+
return _react.createElement("div", {
|
|
67
67
|
"data-test-id": "multiple-line-editor"
|
|
68
|
-
},
|
|
68
|
+
}, _react.createElement(_f36components.Textarea, {
|
|
69
69
|
id: id,
|
|
70
70
|
className: direction === 'rtl' ? _styles.rightToLeft : '',
|
|
71
71
|
rows: 3,
|
|
@@ -76,16 +76,16 @@ function MultipleLineEditor(props) {
|
|
|
76
76
|
onChange: (e)=>{
|
|
77
77
|
setValue(e.target.value);
|
|
78
78
|
}
|
|
79
|
-
}), withCharValidation &&
|
|
79
|
+
}), withCharValidation && _react.createElement("div", {
|
|
80
80
|
className: _styles.validationRow
|
|
81
|
-
},
|
|
81
|
+
}, _react.createElement(_fieldeditorshared.CharCounter, {
|
|
82
82
|
value: value || '',
|
|
83
83
|
checkConstraint: checkConstraint
|
|
84
|
-
}),
|
|
84
|
+
}), _react.createElement(_fieldeditorshared.CharValidation, {
|
|
85
85
|
constraints: constraints
|
|
86
|
-
})), !withCharValidation &&
|
|
86
|
+
})), !withCharValidation && _react.createElement("div", {
|
|
87
87
|
className: _styles.validationRow
|
|
88
|
-
},
|
|
88
|
+
}, _react.createElement(_fieldeditorshared.CharCounter, {
|
|
89
89
|
value: value || '',
|
|
90
90
|
checkConstraint: ()=>true
|
|
91
91
|
})));
|
|
@@ -55,7 +55,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
55
55
|
(0, _vitest.afterEach)(_react1.cleanup);
|
|
56
56
|
(0, _vitest.it)('renders without crashing', ()=>{
|
|
57
57
|
const [field] = (0, _fieldeditortestutils.createFakeFieldAPI)();
|
|
58
|
-
(0, _react1.render)(
|
|
58
|
+
(0, _react1.render)(_react.createElement(_MultipleLineEditor.MultipleLineEditor, {
|
|
59
59
|
field: field,
|
|
60
60
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
61
61
|
isInitiallyDisabled: false
|
|
@@ -72,7 +72,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
72
72
|
}
|
|
73
73
|
};
|
|
74
74
|
});
|
|
75
|
-
const { getByTestId } = (0, _react1.render)(
|
|
75
|
+
const { getByTestId } = (0, _react1.render)(_react.createElement(_MultipleLineEditor.MultipleLineEditor, {
|
|
76
76
|
field: field,
|
|
77
77
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
78
78
|
isInitiallyDisabled: false
|
|
@@ -88,7 +88,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
88
88
|
id: 'field-id'
|
|
89
89
|
};
|
|
90
90
|
});
|
|
91
|
-
const { getByTestId } = (0, _react1.render)(
|
|
91
|
+
const { getByTestId } = (0, _react1.render)(_react.createElement(_MultipleLineEditor.MultipleLineEditor, {
|
|
92
92
|
field: field,
|
|
93
93
|
locales: (0, _fieldeditortestutils.createFakeLocalesAPI)(),
|
|
94
94
|
isInitiallyDisabled: false
|
package/dist/cjs/styles.js
CHANGED
|
@@ -5,14 +5,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
function _export(target, all) {
|
|
6
6
|
for(var name in all)Object.defineProperty(target, name, {
|
|
7
7
|
enumerable: true,
|
|
8
|
-
get: all
|
|
8
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
|
-
rightToLeft
|
|
12
|
+
get rightToLeft () {
|
|
13
13
|
return rightToLeft;
|
|
14
14
|
},
|
|
15
|
-
validationRow
|
|
15
|
+
get validationRow () {
|
|
16
16
|
return validationRow;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -7,14 +7,14 @@ export function MultipleLineEditor(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
|
-
return
|
|
10
|
+
return React.createElement(FieldConnector, {
|
|
11
11
|
field: field,
|
|
12
12
|
isInitiallyDisabled: isInitiallyDisabled,
|
|
13
13
|
isDisabled: isDisabled
|
|
14
14
|
}, ({ errors, disabled, value, setValue })=>{
|
|
15
|
-
return
|
|
15
|
+
return React.createElement("div", {
|
|
16
16
|
"data-test-id": "multiple-line-editor"
|
|
17
|
-
},
|
|
17
|
+
}, React.createElement(Textarea, {
|
|
18
18
|
id: id,
|
|
19
19
|
className: direction === 'rtl' ? styles.rightToLeft : '',
|
|
20
20
|
rows: 3,
|
|
@@ -25,16 +25,16 @@ export function MultipleLineEditor(props) {
|
|
|
25
25
|
onChange: (e)=>{
|
|
26
26
|
setValue(e.target.value);
|
|
27
27
|
}
|
|
28
|
-
}), withCharValidation &&
|
|
28
|
+
}), withCharValidation && React.createElement("div", {
|
|
29
29
|
className: styles.validationRow
|
|
30
|
-
},
|
|
30
|
+
}, React.createElement(CharCounter, {
|
|
31
31
|
value: value || '',
|
|
32
32
|
checkConstraint: checkConstraint
|
|
33
|
-
}),
|
|
33
|
+
}), React.createElement(CharValidation, {
|
|
34
34
|
constraints: constraints
|
|
35
|
-
})), !withCharValidation &&
|
|
35
|
+
})), !withCharValidation && React.createElement("div", {
|
|
36
36
|
className: styles.validationRow
|
|
37
|
-
},
|
|
37
|
+
}, React.createElement(CharCounter, {
|
|
38
38
|
value: value || '',
|
|
39
39
|
checkConstraint: ()=>true
|
|
40
40
|
})));
|
|
@@ -10,7 +10,7 @@ describe('MultipleLineEditor', ()=>{
|
|
|
10
10
|
afterEach(cleanup);
|
|
11
11
|
it('renders without crashing', ()=>{
|
|
12
12
|
const [field] = createFakeFieldAPI();
|
|
13
|
-
render(
|
|
13
|
+
render(React.createElement(MultipleLineEditor, {
|
|
14
14
|
field: field,
|
|
15
15
|
locales: createFakeLocalesAPI(),
|
|
16
16
|
isInitiallyDisabled: false
|
|
@@ -27,7 +27,7 @@ describe('MultipleLineEditor', ()=>{
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
});
|
|
30
|
-
const { getByTestId } = render(
|
|
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 } = render(
|
|
46
|
+
const { getByTestId } = render(React.createElement(MultipleLineEditor, {
|
|
47
47
|
field: field,
|
|
48
48
|
locales: createFakeLocalesAPI(),
|
|
49
49
|
isInitiallyDisabled: false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-multiple-line",
|
|
3
|
-
"version": "2.3.3-canary.
|
|
3
|
+
"version": "2.3.3-canary.30+0e4621f9",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@contentful/f36-components": "^6.7.1",
|
|
42
42
|
"@contentful/f36-tokens": "^6.1.2",
|
|
43
|
-
"@contentful/field-editor-shared": "^4.6.3-canary.
|
|
43
|
+
"@contentful/field-editor-shared": "^4.6.3-canary.30+0e4621f9",
|
|
44
44
|
"@emotion/css": "^11.13.5"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"prettier --write"
|
|
60
60
|
]
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "0e4621f97b3a6b65da12df50fa740c00bcd17b1f"
|
|
63
63
|
}
|