@sanity/google-maps-input 3.0.2-0 → 3.0.2
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/LICENSE +1 -1
- package/README.md +16 -13
- package/dist/index.cjs.mjs +7 -0
- package/{lib/src → dist}/index.d.ts +2 -1
- package/dist/index.esm.js +2964 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +2991 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -48
- package/src/diff/GeopointArrayDiff.tsx +5 -3
- package/src/diff/GeopointFieldDiff.tsx +6 -4
- package/src/input/GeopointInput.tsx +25 -25
- package/src/loader/GoogleMapsLoadProxy.tsx +1 -1
- package/src/loader/loadGoogleMapsApi.ts +6 -2
- package/src/map/util.ts +1 -1
- package/lib/index.esm.js +0 -2
- package/lib/index.esm.js.map +0 -1
- package/lib/index.js +0 -2
- package/lib/index.js.map +0 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
# @sanity/google-maps-input
|
|
2
2
|
|
|
3
|
-
>
|
|
4
|
-
> For the v2 version, please refer to the [v2-branch](https://github.com/sanity-io/
|
|
3
|
+
> This is a **Sanity Studio v3** plugin.
|
|
4
|
+
> For the v2 version, please refer to the [v2-branch](https://github.com/sanity-io/google-maps-input/tree/studio-v2).
|
|
5
|
+
|
|
6
|
+
## What is it?
|
|
5
7
|
|
|
6
|
-
## What is it?
|
|
7
8
|
Plugin for [Sanity Studio](https://www.sanity.io) providing input handlers for geo-related input types using Google Maps.
|
|
8
9
|
|
|
9
10
|
This plugin will replace the default `geopoint` input component.
|
|
@@ -12,7 +13,7 @@ This plugin will replace the default `geopoint` input component.
|
|
|
12
13
|
|
|
13
14
|
## Know issues in Studio V3
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
- Diff-preview is not implemented.
|
|
16
17
|
|
|
17
18
|
These will be re-added well before Studio V3 GA.
|
|
18
19
|
|
|
@@ -35,23 +36,25 @@ yarn add @sanity/google-maps-input
|
|
|
35
36
|
Add it as a plugin in sanity.config.ts (or .js), with a valid [Google Maps API key](https://developers.google.com/maps/documentation/javascript/get-api-key):
|
|
36
37
|
|
|
37
38
|
```js
|
|
38
|
-
import {
|
|
39
|
+
import {googleMapsInput} from '@sanity/google-maps-input'
|
|
39
40
|
|
|
40
41
|
export default defineConfig({
|
|
41
42
|
// ...
|
|
42
43
|
plugins: [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
]
|
|
44
|
+
googleMapsInput({
|
|
45
|
+
apiKey: 'my-api-key',
|
|
46
|
+
}),
|
|
47
|
+
],
|
|
47
48
|
})
|
|
48
49
|
```
|
|
50
|
+
|
|
49
51
|
Ensure that the key has access to:
|
|
50
|
-
* Google Maps JavaScript API
|
|
51
|
-
* Google Places API Web Service
|
|
52
|
-
* Google Static Maps API
|
|
53
52
|
|
|
54
|
-
|
|
53
|
+
- Google Maps JavaScript API
|
|
54
|
+
- Google Places API Web Service
|
|
55
|
+
- Google Static Maps API
|
|
56
|
+
|
|
57
|
+
And that the key allows web-access from the Studio URL(s) you are using the plugin in.
|
|
55
58
|
|
|
56
59
|
Note: This plugin will replace the default `geopoint` input component.
|
|
57
60
|
|
|
@@ -4,6 +4,7 @@ import {ArrayDiff} from 'sanity'
|
|
|
4
4
|
import {DiffComponent} from 'sanity'
|
|
5
5
|
import {DiffComponentOptions} from 'sanity'
|
|
6
6
|
import {DiffProps} from 'sanity'
|
|
7
|
+
import {JSX as JSX_2} from 'react/jsx-runtime'
|
|
7
8
|
import {ObjectDiff} from 'sanity'
|
|
8
9
|
import {ObjectInputProps} from 'sanity'
|
|
9
10
|
import {ObjectSchemaType} from 'sanity'
|
|
@@ -38,7 +39,7 @@ export declare class GeopointInput extends React_2.PureComponent<GeopointInputPr
|
|
|
38
39
|
handleCloseModal: () => void
|
|
39
40
|
handleChange: (latLng: google.maps.LatLng) => void
|
|
40
41
|
handleClear: () => void
|
|
41
|
-
render():
|
|
42
|
+
render(): JSX_2.Element
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
export declare type GeopointInputProps = ObjectInputProps<Geopoint, GeopointSchemaType> & {
|