@contentful/field-editor-url 1.3.6 → 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.
package/dist/cjs/UrlEditor.js
CHANGED
|
@@ -32,7 +32,9 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
32
32
|
if (cache && cache.has(obj)) {
|
|
33
33
|
return cache.get(obj);
|
|
34
34
|
}
|
|
35
|
-
var newObj = {
|
|
35
|
+
var newObj = {
|
|
36
|
+
__proto__: null
|
|
37
|
+
};
|
|
36
38
|
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
37
39
|
for(var key in obj){
|
|
38
40
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
@@ -51,11 +53,11 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
51
53
|
return newObj;
|
|
52
54
|
}
|
|
53
55
|
function UrlEditor(props) {
|
|
54
|
-
const { field
|
|
56
|
+
const { field } = props;
|
|
55
57
|
return _react.createElement(_fieldeditorshared.FieldConnector, {
|
|
56
58
|
field: field,
|
|
57
59
|
isInitiallyDisabled: props.isInitiallyDisabled
|
|
58
|
-
}, ({ value
|
|
60
|
+
}, ({ value, errors, disabled, setValue })=>{
|
|
59
61
|
return _react.createElement("div", {
|
|
60
62
|
"data-test-id": "url-editor"
|
|
61
63
|
}, _react.createElement(_f36components.TextInput, {
|
|
@@ -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)) {
|
|
@@ -69,7 +71,7 @@ describe('UrlEditor', ()=>{
|
|
|
69
71
|
}
|
|
70
72
|
};
|
|
71
73
|
});
|
|
72
|
-
const { getByTestId
|
|
74
|
+
const { getByTestId } = (0, _react1.render)(_react.createElement(_UrlEditor.UrlEditor, {
|
|
73
75
|
field: field,
|
|
74
76
|
isInitiallyDisabled: false
|
|
75
77
|
}));
|
|
@@ -84,7 +86,7 @@ describe('UrlEditor', ()=>{
|
|
|
84
86
|
id: 'field-id'
|
|
85
87
|
};
|
|
86
88
|
});
|
|
87
|
-
const { getByTestId
|
|
89
|
+
const { getByTestId } = (0, _react1.render)(_react.createElement(_UrlEditor.UrlEditor, {
|
|
88
90
|
field: field,
|
|
89
91
|
isInitiallyDisabled: false
|
|
90
92
|
}));
|
|
@@ -122,10 +124,10 @@ describe('UrlEditor', ()=>{
|
|
|
122
124
|
}
|
|
123
125
|
};
|
|
124
126
|
});
|
|
125
|
-
const { getByTestId
|
|
127
|
+
const { getByTestId, getByText } = (0, _react1.render)(_react.createElement(_UrlEditor.UrlEditor, {
|
|
126
128
|
field: field,
|
|
127
129
|
isInitiallyDisabled: false
|
|
128
|
-
}, ({ value
|
|
130
|
+
}, ({ value })=>{
|
|
129
131
|
return _react.createElement("div", null, "Custom preview: ", value);
|
|
130
132
|
}));
|
|
131
133
|
const $input = getByTestId('cf-ui-text-input');
|
package/dist/esm/UrlEditor.js
CHANGED
|
@@ -2,11 +2,11 @@ import * as React from 'react';
|
|
|
2
2
|
import { TextInput } from '@contentful/f36-components';
|
|
3
3
|
import { FieldConnector } from '@contentful/field-editor-shared';
|
|
4
4
|
export function UrlEditor(props) {
|
|
5
|
-
const { field
|
|
5
|
+
const { field } = props;
|
|
6
6
|
return React.createElement(FieldConnector, {
|
|
7
7
|
field: field,
|
|
8
8
|
isInitiallyDisabled: props.isInitiallyDisabled
|
|
9
|
-
}, ({ value
|
|
9
|
+
}, ({ value, errors, disabled, setValue })=>{
|
|
10
10
|
return React.createElement("div", {
|
|
11
11
|
"data-test-id": "url-editor"
|
|
12
12
|
}, React.createElement(TextInput, {
|
|
@@ -26,7 +26,7 @@ describe('UrlEditor', ()=>{
|
|
|
26
26
|
}
|
|
27
27
|
};
|
|
28
28
|
});
|
|
29
|
-
const { getByTestId
|
|
29
|
+
const { getByTestId } = render(React.createElement(UrlEditor, {
|
|
30
30
|
field: field,
|
|
31
31
|
isInitiallyDisabled: false
|
|
32
32
|
}));
|
|
@@ -41,7 +41,7 @@ describe('UrlEditor', ()=>{
|
|
|
41
41
|
id: 'field-id'
|
|
42
42
|
};
|
|
43
43
|
});
|
|
44
|
-
const { getByTestId
|
|
44
|
+
const { getByTestId } = render(React.createElement(UrlEditor, {
|
|
45
45
|
field: field,
|
|
46
46
|
isInitiallyDisabled: false
|
|
47
47
|
}));
|
|
@@ -79,10 +79,10 @@ describe('UrlEditor', ()=>{
|
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
81
|
});
|
|
82
|
-
const { getByTestId
|
|
82
|
+
const { getByTestId, getByText } = render(React.createElement(UrlEditor, {
|
|
83
83
|
field: field,
|
|
84
84
|
isInitiallyDisabled: false
|
|
85
|
-
}, ({ value
|
|
85
|
+
}, ({ value })=>{
|
|
86
86
|
return React.createElement("div", null, "Custom preview: ", value);
|
|
87
87
|
}));
|
|
88
88
|
const $input = getByTestId('cf-ui-text-input');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-url",
|
|
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,12 +37,12 @@
|
|
|
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"
|
|
@@ -50,5 +50,5 @@
|
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"registry": "https://npm.pkg.github.com/"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "142d2039f023bf4ced956aae1dd08b27c35fdbaa"
|
|
54
54
|
}
|