@contentful/field-editor-location 2.3.4-canary.28 → 2.3.4-canary.31
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/GoogleMapView.js +2 -2
- package/dist/cjs/LocationEditor.js +8 -8
- package/dist/cjs/LocationSearchInput.js +8 -8
- package/dist/cjs/LocationSelector.js +17 -17
- package/dist/cjs/types.js +3 -3
- package/dist/esm/GoogleMapView.js +2 -2
- package/dist/esm/LocationEditor.js +5 -5
- package/dist/esm/LocationSearchInput.js +8 -8
- package/dist/esm/LocationSelector.js +17 -17
- package/dist/esm/types.js +3 -3
- package/package.json +4 -4
|
@@ -130,9 +130,9 @@ function GoogleMapView(props) {
|
|
|
130
130
|
maps: loadedMaps
|
|
131
131
|
});
|
|
132
132
|
}, []);
|
|
133
|
-
return
|
|
133
|
+
return _react.createElement("div", {
|
|
134
134
|
className: styles.root
|
|
135
|
-
},
|
|
135
|
+
}, _react.createElement(_googlemapreact.default, {
|
|
136
136
|
draggable: !props.disabled,
|
|
137
137
|
bootstrapURLKeys: props.googleMapsKey ? {
|
|
138
138
|
key: props.googleMapsKey
|
|
@@ -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
|
-
LocationEditor
|
|
12
|
+
get LocationEditor () {
|
|
13
13
|
return LocationEditor;
|
|
14
14
|
},
|
|
15
|
-
LocationEditorConnected
|
|
15
|
+
get LocationEditorConnected () {
|
|
16
16
|
return LocationEditorConnected;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
@@ -123,9 +123,9 @@ function LocationEditor({ disabled, value, setValue, googleMapsKey, selectedView
|
|
|
123
123
|
});
|
|
124
124
|
});
|
|
125
125
|
}, []);
|
|
126
|
-
return
|
|
126
|
+
return _react.createElement("div", {
|
|
127
127
|
"data-test-id": "location-editor"
|
|
128
|
-
},
|
|
128
|
+
}, _react.createElement(_GoogleMapView.GoogleMapView, {
|
|
129
129
|
disabled: disabled || mapsObject === null,
|
|
130
130
|
googleMapsKey: googleMapsKey,
|
|
131
131
|
location: localValue,
|
|
@@ -136,7 +136,7 @@ function LocationEditor({ disabled, value, setValue, googleMapsKey, selectedView
|
|
|
136
136
|
setLocalValue(coords);
|
|
137
137
|
setValue(toLocationValue(coords));
|
|
138
138
|
}
|
|
139
|
-
}),
|
|
139
|
+
}), _react.createElement(_LocationSelector.LocationSelector, {
|
|
140
140
|
disabled: disabled || mapsObject === null,
|
|
141
141
|
value: localValue,
|
|
142
142
|
view: selectedView,
|
|
@@ -155,11 +155,11 @@ function LocationEditorConnected(props) {
|
|
|
155
155
|
const { field } = props;
|
|
156
156
|
const googleMapsKey = props.parameters ? props.parameters.instance.googleMapsKey : undefined;
|
|
157
157
|
const [selectedView, setSelectedView] = _react.useState(_types.ViewType.Address);
|
|
158
|
-
return
|
|
158
|
+
return _react.createElement(_fieldeditorshared.FieldConnector, {
|
|
159
159
|
field: field,
|
|
160
160
|
isInitiallyDisabled: props.isInitiallyDisabled
|
|
161
161
|
}, ({ value, disabled, setValue, externalReset })=>{
|
|
162
|
-
return
|
|
162
|
+
return _react.createElement(LocationEditor, {
|
|
163
163
|
key: `location-editor-${externalReset}`,
|
|
164
164
|
value: value,
|
|
165
165
|
disabled: disabled,
|
|
@@ -98,11 +98,11 @@ function LocationSearchInput(props) {
|
|
|
98
98
|
props.value,
|
|
99
99
|
props.disabled
|
|
100
100
|
]);
|
|
101
|
-
return
|
|
101
|
+
return _react.createElement("div", {
|
|
102
102
|
className: styles.root
|
|
103
|
-
},
|
|
103
|
+
}, _react.createElement("div", {
|
|
104
104
|
className: styles.input
|
|
105
|
-
},
|
|
105
|
+
}, _react.createElement(_f36components.TextInput, {
|
|
106
106
|
testId: "location-editor-search",
|
|
107
107
|
isInvalid: hasError,
|
|
108
108
|
placeholder: "Start typing to find location",
|
|
@@ -135,12 +135,12 @@ function LocationSearchInput(props) {
|
|
|
135
135
|
});
|
|
136
136
|
},
|
|
137
137
|
isDisabled: props.disabled
|
|
138
|
-
}), isSearching &&
|
|
138
|
+
}), isSearching && _react.createElement(_f36components.Spinner, {
|
|
139
139
|
className: styles.spinner
|
|
140
|
-
}), suggestion &&
|
|
140
|
+
}), suggestion && _react.createElement(_f36components.Card, {
|
|
141
141
|
padding: "none",
|
|
142
142
|
className: styles.suggestion
|
|
143
|
-
},
|
|
143
|
+
}, _react.createElement(_f36components.Button, {
|
|
144
144
|
variant: "transparent",
|
|
145
145
|
testId: "location-editor-suggestion",
|
|
146
146
|
onClick: ()=>{
|
|
@@ -148,8 +148,8 @@ function LocationSearchInput(props) {
|
|
|
148
148
|
props.onChangeLocation(suggestion.location);
|
|
149
149
|
setSuggestion(null);
|
|
150
150
|
}
|
|
151
|
-
}, suggestion.address)), hasError &&
|
|
151
|
+
}, suggestion.address)), hasError && _react.createElement(_f36components.ValidationMessage, {
|
|
152
152
|
testId: "location-editor-not-found",
|
|
153
153
|
className: styles.validationMessage
|
|
154
|
-
}, "No results found for ",
|
|
154
|
+
}, "No results found for ", _react.createElement("strong", null, address), ". Please make sure that address is spelled correctly.")));
|
|
155
155
|
}
|
|
@@ -90,13 +90,13 @@ const styles = {
|
|
|
90
90
|
})
|
|
91
91
|
};
|
|
92
92
|
function LocationSelector(props) {
|
|
93
|
-
return
|
|
93
|
+
return _react.createElement("div", {
|
|
94
94
|
className: styles.root
|
|
95
|
-
},
|
|
95
|
+
}, _react.createElement("div", {
|
|
96
96
|
className: styles.main
|
|
97
|
-
},
|
|
97
|
+
}, _react.createElement(_f36components.Flex, {
|
|
98
98
|
flexDirection: "row"
|
|
99
|
-
},
|
|
99
|
+
}, _react.createElement(_f36components.Radio, {
|
|
100
100
|
className: (0, _css.css)({
|
|
101
101
|
flexBasis: '100%'
|
|
102
102
|
}),
|
|
@@ -108,7 +108,7 @@ function LocationSelector(props) {
|
|
|
108
108
|
onChange: ()=>{
|
|
109
109
|
props.onChangeView(_types.ViewType.Address);
|
|
110
110
|
}
|
|
111
|
-
}, "Address"),
|
|
111
|
+
}, "Address"), _react.createElement(_f36components.Radio, {
|
|
112
112
|
className: (0, _css.css)({
|
|
113
113
|
flexBasis: '100%'
|
|
114
114
|
}),
|
|
@@ -120,21 +120,21 @@ function LocationSelector(props) {
|
|
|
120
120
|
onChange: ()=>{
|
|
121
121
|
props.onChangeView(_types.ViewType.Coordinates);
|
|
122
122
|
}
|
|
123
|
-
}, "Coordinates")), props.view === _types.ViewType.Address &&
|
|
123
|
+
}, "Coordinates")), props.view === _types.ViewType.Address && _react.createElement("div", {
|
|
124
124
|
className: styles.inputsRow
|
|
125
|
-
},
|
|
125
|
+
}, _react.createElement(_LocationSearchInput.LocationSearchInput, {
|
|
126
126
|
onSearchAddress: props.onSearchAddress,
|
|
127
127
|
onGetAddressFromLocation: props.onGetAddressFromLocation,
|
|
128
128
|
disabled: props.disabled,
|
|
129
129
|
value: props.value,
|
|
130
130
|
onChangeLocation: props.onChangeLocation
|
|
131
|
-
})), props.view === _types.ViewType.Coordinates &&
|
|
131
|
+
})), props.view === _types.ViewType.Coordinates && _react.createElement("div", {
|
|
132
132
|
className: styles.inputsRow
|
|
133
|
-
},
|
|
133
|
+
}, _react.createElement("label", {
|
|
134
134
|
htmlFor: "latitude"
|
|
135
|
-
}, "Latitude"),
|
|
135
|
+
}, "Latitude"), _react.createElement("div", {
|
|
136
136
|
className: styles.splitter
|
|
137
|
-
}),
|
|
137
|
+
}), _react.createElement(_f36components.TextInput, {
|
|
138
138
|
id: "latitude",
|
|
139
139
|
testId: "location-editor-latitude",
|
|
140
140
|
placeholder: "Between -90 and 90",
|
|
@@ -150,13 +150,13 @@ function LocationSelector(props) {
|
|
|
150
150
|
max: "90",
|
|
151
151
|
min: "-90",
|
|
152
152
|
step: "0.1"
|
|
153
|
-
}),
|
|
153
|
+
}), _react.createElement("div", {
|
|
154
154
|
className: styles.splitter
|
|
155
|
-
}),
|
|
155
|
+
}), _react.createElement("label", {
|
|
156
156
|
htmlFor: "longitude"
|
|
157
|
-
}, "Longitude"),
|
|
157
|
+
}, "Longitude"), _react.createElement("div", {
|
|
158
158
|
className: styles.splitter
|
|
159
|
-
}),
|
|
159
|
+
}), _react.createElement(_f36components.TextInput, {
|
|
160
160
|
id: "longitude",
|
|
161
161
|
testId: "location-editor-longitude",
|
|
162
162
|
placeholder: "Between -180 and 180",
|
|
@@ -172,9 +172,9 @@ function LocationSelector(props) {
|
|
|
172
172
|
max: "180",
|
|
173
173
|
min: "-180",
|
|
174
174
|
step: "0.1"
|
|
175
|
-
}))),
|
|
175
|
+
}))), _react.createElement("div", {
|
|
176
176
|
className: styles.secondary
|
|
177
|
-
},
|
|
177
|
+
}, _react.createElement(_f36components.TextLink, {
|
|
178
178
|
as: "button",
|
|
179
179
|
isDisabled: props.disabled,
|
|
180
180
|
testId: "location-editor-clear",
|
package/dist/cjs/types.js
CHANGED
|
@@ -8,8 +8,8 @@ Object.defineProperty(exports, "ViewType", {
|
|
|
8
8
|
return ViewType;
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
var ViewType
|
|
12
|
-
(function(ViewType) {
|
|
11
|
+
var ViewType = /*#__PURE__*/ function(ViewType) {
|
|
13
12
|
ViewType["Address"] = "Address";
|
|
14
13
|
ViewType["Coordinates"] = "Coordinates";
|
|
15
|
-
|
|
14
|
+
return ViewType;
|
|
15
|
+
}({});
|
|
@@ -74,9 +74,9 @@ export function GoogleMapView(props) {
|
|
|
74
74
|
maps: loadedMaps
|
|
75
75
|
});
|
|
76
76
|
}, []);
|
|
77
|
-
return
|
|
77
|
+
return React.createElement("div", {
|
|
78
78
|
className: styles.root
|
|
79
|
-
},
|
|
79
|
+
}, React.createElement(GoogleMapReact, {
|
|
80
80
|
draggable: !props.disabled,
|
|
81
81
|
bootstrapURLKeys: props.googleMapsKey ? {
|
|
82
82
|
key: props.googleMapsKey
|
|
@@ -59,9 +59,9 @@ export function LocationEditor({ disabled, value, setValue, googleMapsKey, selec
|
|
|
59
59
|
});
|
|
60
60
|
});
|
|
61
61
|
}, []);
|
|
62
|
-
return
|
|
62
|
+
return React.createElement("div", {
|
|
63
63
|
"data-test-id": "location-editor"
|
|
64
|
-
},
|
|
64
|
+
}, React.createElement(GoogleMapView, {
|
|
65
65
|
disabled: disabled || mapsObject === null,
|
|
66
66
|
googleMapsKey: googleMapsKey,
|
|
67
67
|
location: localValue,
|
|
@@ -72,7 +72,7 @@ export function LocationEditor({ disabled, value, setValue, googleMapsKey, selec
|
|
|
72
72
|
setLocalValue(coords);
|
|
73
73
|
setValue(toLocationValue(coords));
|
|
74
74
|
}
|
|
75
|
-
}),
|
|
75
|
+
}), React.createElement(LocationSelector, {
|
|
76
76
|
disabled: disabled || mapsObject === null,
|
|
77
77
|
value: localValue,
|
|
78
78
|
view: selectedView,
|
|
@@ -91,11 +91,11 @@ export function LocationEditorConnected(props) {
|
|
|
91
91
|
const { field } = props;
|
|
92
92
|
const googleMapsKey = props.parameters ? props.parameters.instance.googleMapsKey : undefined;
|
|
93
93
|
const [selectedView, setSelectedView] = React.useState(ViewType.Address);
|
|
94
|
-
return
|
|
94
|
+
return React.createElement(FieldConnector, {
|
|
95
95
|
field: field,
|
|
96
96
|
isInitiallyDisabled: props.isInitiallyDisabled
|
|
97
97
|
}, ({ value, disabled, setValue, externalReset })=>{
|
|
98
|
-
return
|
|
98
|
+
return React.createElement(LocationEditor, {
|
|
99
99
|
key: `location-editor-${externalReset}`,
|
|
100
100
|
value: value,
|
|
101
101
|
disabled: disabled,
|
|
@@ -42,11 +42,11 @@ export function LocationSearchInput(props) {
|
|
|
42
42
|
props.value,
|
|
43
43
|
props.disabled
|
|
44
44
|
]);
|
|
45
|
-
return
|
|
45
|
+
return React.createElement("div", {
|
|
46
46
|
className: styles.root
|
|
47
|
-
},
|
|
47
|
+
}, React.createElement("div", {
|
|
48
48
|
className: styles.input
|
|
49
|
-
},
|
|
49
|
+
}, React.createElement(TextInput, {
|
|
50
50
|
testId: "location-editor-search",
|
|
51
51
|
isInvalid: hasError,
|
|
52
52
|
placeholder: "Start typing to find location",
|
|
@@ -79,12 +79,12 @@ export function LocationSearchInput(props) {
|
|
|
79
79
|
});
|
|
80
80
|
},
|
|
81
81
|
isDisabled: props.disabled
|
|
82
|
-
}), isSearching &&
|
|
82
|
+
}), isSearching && React.createElement(Spinner, {
|
|
83
83
|
className: styles.spinner
|
|
84
|
-
}), suggestion &&
|
|
84
|
+
}), suggestion && React.createElement(Card, {
|
|
85
85
|
padding: "none",
|
|
86
86
|
className: styles.suggestion
|
|
87
|
-
},
|
|
87
|
+
}, React.createElement(Button, {
|
|
88
88
|
variant: "transparent",
|
|
89
89
|
testId: "location-editor-suggestion",
|
|
90
90
|
onClick: ()=>{
|
|
@@ -92,8 +92,8 @@ export function LocationSearchInput(props) {
|
|
|
92
92
|
props.onChangeLocation(suggestion.location);
|
|
93
93
|
setSuggestion(null);
|
|
94
94
|
}
|
|
95
|
-
}, suggestion.address)), hasError &&
|
|
95
|
+
}, suggestion.address)), hasError && React.createElement(ValidationMessage, {
|
|
96
96
|
testId: "location-editor-not-found",
|
|
97
97
|
className: styles.validationMessage
|
|
98
|
-
}, "No results found for ",
|
|
98
|
+
}, "No results found for ", React.createElement("strong", null, address), ". Please make sure that address is spelled correctly.")));
|
|
99
99
|
}
|
|
@@ -34,13 +34,13 @@ const styles = {
|
|
|
34
34
|
})
|
|
35
35
|
};
|
|
36
36
|
export function LocationSelector(props) {
|
|
37
|
-
return
|
|
37
|
+
return React.createElement("div", {
|
|
38
38
|
className: styles.root
|
|
39
|
-
},
|
|
39
|
+
}, React.createElement("div", {
|
|
40
40
|
className: styles.main
|
|
41
|
-
},
|
|
41
|
+
}, React.createElement(Flex, {
|
|
42
42
|
flexDirection: "row"
|
|
43
|
-
},
|
|
43
|
+
}, React.createElement(Radio, {
|
|
44
44
|
className: css({
|
|
45
45
|
flexBasis: '100%'
|
|
46
46
|
}),
|
|
@@ -52,7 +52,7 @@ export function LocationSelector(props) {
|
|
|
52
52
|
onChange: ()=>{
|
|
53
53
|
props.onChangeView(ViewType.Address);
|
|
54
54
|
}
|
|
55
|
-
}, "Address"),
|
|
55
|
+
}, "Address"), React.createElement(Radio, {
|
|
56
56
|
className: css({
|
|
57
57
|
flexBasis: '100%'
|
|
58
58
|
}),
|
|
@@ -64,21 +64,21 @@ export function LocationSelector(props) {
|
|
|
64
64
|
onChange: ()=>{
|
|
65
65
|
props.onChangeView(ViewType.Coordinates);
|
|
66
66
|
}
|
|
67
|
-
}, "Coordinates")), props.view === ViewType.Address &&
|
|
67
|
+
}, "Coordinates")), props.view === ViewType.Address && React.createElement("div", {
|
|
68
68
|
className: styles.inputsRow
|
|
69
|
-
},
|
|
69
|
+
}, React.createElement(LocationSearchInput, {
|
|
70
70
|
onSearchAddress: props.onSearchAddress,
|
|
71
71
|
onGetAddressFromLocation: props.onGetAddressFromLocation,
|
|
72
72
|
disabled: props.disabled,
|
|
73
73
|
value: props.value,
|
|
74
74
|
onChangeLocation: props.onChangeLocation
|
|
75
|
-
})), props.view === ViewType.Coordinates &&
|
|
75
|
+
})), props.view === ViewType.Coordinates && React.createElement("div", {
|
|
76
76
|
className: styles.inputsRow
|
|
77
|
-
},
|
|
77
|
+
}, React.createElement("label", {
|
|
78
78
|
htmlFor: "latitude"
|
|
79
|
-
}, "Latitude"),
|
|
79
|
+
}, "Latitude"), React.createElement("div", {
|
|
80
80
|
className: styles.splitter
|
|
81
|
-
}),
|
|
81
|
+
}), React.createElement(TextInput, {
|
|
82
82
|
id: "latitude",
|
|
83
83
|
testId: "location-editor-latitude",
|
|
84
84
|
placeholder: "Between -90 and 90",
|
|
@@ -94,13 +94,13 @@ export function LocationSelector(props) {
|
|
|
94
94
|
max: "90",
|
|
95
95
|
min: "-90",
|
|
96
96
|
step: "0.1"
|
|
97
|
-
}),
|
|
97
|
+
}), React.createElement("div", {
|
|
98
98
|
className: styles.splitter
|
|
99
|
-
}),
|
|
99
|
+
}), React.createElement("label", {
|
|
100
100
|
htmlFor: "longitude"
|
|
101
|
-
}, "Longitude"),
|
|
101
|
+
}, "Longitude"), React.createElement("div", {
|
|
102
102
|
className: styles.splitter
|
|
103
|
-
}),
|
|
103
|
+
}), React.createElement(TextInput, {
|
|
104
104
|
id: "longitude",
|
|
105
105
|
testId: "location-editor-longitude",
|
|
106
106
|
placeholder: "Between -180 and 180",
|
|
@@ -116,9 +116,9 @@ export function LocationSelector(props) {
|
|
|
116
116
|
max: "180",
|
|
117
117
|
min: "-180",
|
|
118
118
|
step: "0.1"
|
|
119
|
-
}))),
|
|
119
|
+
}))), React.createElement("div", {
|
|
120
120
|
className: styles.secondary
|
|
121
|
-
},
|
|
121
|
+
}, React.createElement(TextLink, {
|
|
122
122
|
as: "button",
|
|
123
123
|
isDisabled: props.disabled,
|
|
124
124
|
testId: "location-editor-clear",
|
package/dist/esm/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-location",
|
|
3
|
-
"version": "2.3.4-canary.
|
|
3
|
+
"version": "2.3.4-canary.31+1fb5b692",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@contentful/f36-components": "^6.7.1",
|
|
40
40
|
"@contentful/f36-tokens": "^6.1.2",
|
|
41
|
-
"@contentful/field-editor-shared": "^4.6.3-canary.
|
|
41
|
+
"@contentful/field-editor-shared": "^4.6.3-canary.31+1fb5b692",
|
|
42
42
|
"@emotion/css": "^11.13.5",
|
|
43
43
|
"@types/google-map-react": "2.1.10",
|
|
44
44
|
"google-map-react": "2.2.5",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@contentful/field-editor-test-utils": "^3.2.1",
|
|
49
|
-
"@lingui/core": "5.
|
|
49
|
+
"@lingui/core": "5.9.5"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@lingui/core": "^5.3.0",
|
|
@@ -62,5 +62,5 @@
|
|
|
62
62
|
"prettier --write"
|
|
63
63
|
]
|
|
64
64
|
},
|
|
65
|
-
"gitHead": "
|
|
65
|
+
"gitHead": "1fb5b69244b523826081471d8fe4e721b2e6c5ed"
|
|
66
66
|
}
|