@contentful/field-editor-location 2.3.4-canary.28 → 2.3.4-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.
@@ -130,9 +130,9 @@ function GoogleMapView(props) {
130
130
  maps: loadedMaps
131
131
  });
132
132
  }, []);
133
- return /*#__PURE__*/ _react.createElement("div", {
133
+ return _react.createElement("div", {
134
134
  className: styles.root
135
- }, /*#__PURE__*/ _react.createElement(_googlemapreact.default, {
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[name]
8
+ get: Object.getOwnPropertyDescriptor(all, name).get
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- LocationEditor: function() {
12
+ get LocationEditor () {
13
13
  return LocationEditor;
14
14
  },
15
- LocationEditorConnected: function() {
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 /*#__PURE__*/ _react.createElement("div", {
126
+ return _react.createElement("div", {
127
127
  "data-test-id": "location-editor"
128
- }, /*#__PURE__*/ _react.createElement(_GoogleMapView.GoogleMapView, {
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
- }), /*#__PURE__*/ _react.createElement(_LocationSelector.LocationSelector, {
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 /*#__PURE__*/ _react.createElement(_fieldeditorshared.FieldConnector, {
158
+ return _react.createElement(_fieldeditorshared.FieldConnector, {
159
159
  field: field,
160
160
  isInitiallyDisabled: props.isInitiallyDisabled
161
161
  }, ({ value, disabled, setValue, externalReset })=>{
162
- return /*#__PURE__*/ _react.createElement(LocationEditor, {
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 /*#__PURE__*/ _react.createElement("div", {
101
+ return _react.createElement("div", {
102
102
  className: styles.root
103
- }, /*#__PURE__*/ _react.createElement("div", {
103
+ }, _react.createElement("div", {
104
104
  className: styles.input
105
- }, /*#__PURE__*/ _react.createElement(_f36components.TextInput, {
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 && /*#__PURE__*/ _react.createElement(_f36components.Spinner, {
138
+ }), isSearching && _react.createElement(_f36components.Spinner, {
139
139
  className: styles.spinner
140
- }), suggestion && /*#__PURE__*/ _react.createElement(_f36components.Card, {
140
+ }), suggestion && _react.createElement(_f36components.Card, {
141
141
  padding: "none",
142
142
  className: styles.suggestion
143
- }, /*#__PURE__*/ _react.createElement(_f36components.Button, {
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 && /*#__PURE__*/ _react.createElement(_f36components.ValidationMessage, {
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 ", /*#__PURE__*/ _react.createElement("strong", null, address), ". Please make sure that address is spelled correctly.")));
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 /*#__PURE__*/ _react.createElement("div", {
93
+ return _react.createElement("div", {
94
94
  className: styles.root
95
- }, /*#__PURE__*/ _react.createElement("div", {
95
+ }, _react.createElement("div", {
96
96
  className: styles.main
97
- }, /*#__PURE__*/ _react.createElement(_f36components.Flex, {
97
+ }, _react.createElement(_f36components.Flex, {
98
98
  flexDirection: "row"
99
- }, /*#__PURE__*/ _react.createElement(_f36components.Radio, {
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"), /*#__PURE__*/ _react.createElement(_f36components.Radio, {
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 && /*#__PURE__*/ _react.createElement("div", {
123
+ }, "Coordinates")), props.view === _types.ViewType.Address && _react.createElement("div", {
124
124
  className: styles.inputsRow
125
- }, /*#__PURE__*/ _react.createElement(_LocationSearchInput.LocationSearchInput, {
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 && /*#__PURE__*/ _react.createElement("div", {
131
+ })), props.view === _types.ViewType.Coordinates && _react.createElement("div", {
132
132
  className: styles.inputsRow
133
- }, /*#__PURE__*/ _react.createElement("label", {
133
+ }, _react.createElement("label", {
134
134
  htmlFor: "latitude"
135
- }, "Latitude"), /*#__PURE__*/ _react.createElement("div", {
135
+ }, "Latitude"), _react.createElement("div", {
136
136
  className: styles.splitter
137
- }), /*#__PURE__*/ _react.createElement(_f36components.TextInput, {
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
- }), /*#__PURE__*/ _react.createElement("div", {
153
+ }), _react.createElement("div", {
154
154
  className: styles.splitter
155
- }), /*#__PURE__*/ _react.createElement("label", {
155
+ }), _react.createElement("label", {
156
156
  htmlFor: "longitude"
157
- }, "Longitude"), /*#__PURE__*/ _react.createElement("div", {
157
+ }, "Longitude"), _react.createElement("div", {
158
158
  className: styles.splitter
159
- }), /*#__PURE__*/ _react.createElement(_f36components.TextInput, {
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
- }))), /*#__PURE__*/ _react.createElement("div", {
175
+ }))), _react.createElement("div", {
176
176
  className: styles.secondary
177
- }, /*#__PURE__*/ _react.createElement(_f36components.TextLink, {
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
- })(ViewType || (ViewType = {}));
14
+ return ViewType;
15
+ }({});
@@ -74,9 +74,9 @@ export function GoogleMapView(props) {
74
74
  maps: loadedMaps
75
75
  });
76
76
  }, []);
77
- return /*#__PURE__*/ React.createElement("div", {
77
+ return React.createElement("div", {
78
78
  className: styles.root
79
- }, /*#__PURE__*/ React.createElement(GoogleMapReact, {
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 /*#__PURE__*/ React.createElement("div", {
62
+ return React.createElement("div", {
63
63
  "data-test-id": "location-editor"
64
- }, /*#__PURE__*/ React.createElement(GoogleMapView, {
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
- }), /*#__PURE__*/ React.createElement(LocationSelector, {
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 /*#__PURE__*/ React.createElement(FieldConnector, {
94
+ return React.createElement(FieldConnector, {
95
95
  field: field,
96
96
  isInitiallyDisabled: props.isInitiallyDisabled
97
97
  }, ({ value, disabled, setValue, externalReset })=>{
98
- return /*#__PURE__*/ React.createElement(LocationEditor, {
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 /*#__PURE__*/ React.createElement("div", {
45
+ return React.createElement("div", {
46
46
  className: styles.root
47
- }, /*#__PURE__*/ React.createElement("div", {
47
+ }, React.createElement("div", {
48
48
  className: styles.input
49
- }, /*#__PURE__*/ React.createElement(TextInput, {
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 && /*#__PURE__*/ React.createElement(Spinner, {
82
+ }), isSearching && React.createElement(Spinner, {
83
83
  className: styles.spinner
84
- }), suggestion && /*#__PURE__*/ React.createElement(Card, {
84
+ }), suggestion && React.createElement(Card, {
85
85
  padding: "none",
86
86
  className: styles.suggestion
87
- }, /*#__PURE__*/ React.createElement(Button, {
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 && /*#__PURE__*/ React.createElement(ValidationMessage, {
95
+ }, suggestion.address)), hasError && React.createElement(ValidationMessage, {
96
96
  testId: "location-editor-not-found",
97
97
  className: styles.validationMessage
98
- }, "No results found for ", /*#__PURE__*/ React.createElement("strong", null, address), ". Please make sure that address is spelled correctly.")));
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 /*#__PURE__*/ React.createElement("div", {
37
+ return React.createElement("div", {
38
38
  className: styles.root
39
- }, /*#__PURE__*/ React.createElement("div", {
39
+ }, React.createElement("div", {
40
40
  className: styles.main
41
- }, /*#__PURE__*/ React.createElement(Flex, {
41
+ }, React.createElement(Flex, {
42
42
  flexDirection: "row"
43
- }, /*#__PURE__*/ React.createElement(Radio, {
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"), /*#__PURE__*/ React.createElement(Radio, {
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 && /*#__PURE__*/ React.createElement("div", {
67
+ }, "Coordinates")), props.view === ViewType.Address && React.createElement("div", {
68
68
  className: styles.inputsRow
69
- }, /*#__PURE__*/ React.createElement(LocationSearchInput, {
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 && /*#__PURE__*/ React.createElement("div", {
75
+ })), props.view === ViewType.Coordinates && React.createElement("div", {
76
76
  className: styles.inputsRow
77
- }, /*#__PURE__*/ React.createElement("label", {
77
+ }, React.createElement("label", {
78
78
  htmlFor: "latitude"
79
- }, "Latitude"), /*#__PURE__*/ React.createElement("div", {
79
+ }, "Latitude"), React.createElement("div", {
80
80
  className: styles.splitter
81
- }), /*#__PURE__*/ React.createElement(TextInput, {
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
- }), /*#__PURE__*/ React.createElement("div", {
97
+ }), React.createElement("div", {
98
98
  className: styles.splitter
99
- }), /*#__PURE__*/ React.createElement("label", {
99
+ }), React.createElement("label", {
100
100
  htmlFor: "longitude"
101
- }, "Longitude"), /*#__PURE__*/ React.createElement("div", {
101
+ }, "Longitude"), React.createElement("div", {
102
102
  className: styles.splitter
103
- }), /*#__PURE__*/ React.createElement(TextInput, {
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
- }))), /*#__PURE__*/ React.createElement("div", {
119
+ }))), React.createElement("div", {
120
120
  className: styles.secondary
121
- }, /*#__PURE__*/ React.createElement(TextLink, {
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
@@ -1,5 +1,5 @@
1
- export var ViewType;
2
- (function(ViewType) {
1
+ export var ViewType = /*#__PURE__*/ function(ViewType) {
3
2
  ViewType["Address"] = "Address";
4
3
  ViewType["Coordinates"] = "Coordinates";
5
- })(ViewType || (ViewType = {}));
4
+ return ViewType;
5
+ }({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contentful/field-editor-location",
3
- "version": "2.3.4-canary.28+dce976a5",
3
+ "version": "2.3.4-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",
@@ -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.28+dce976a5",
41
+ "@contentful/field-editor-shared": "^4.6.3-canary.30+0e4621f9",
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.3.0"
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": "dce976a59659a0c2ef12511f9449ac0100a50987"
65
+ "gitHead": "0e4621f97b3a6b65da12df50fa740c00bcd17b1f"
66
66
  }