@sanity/google-maps-input 2.30.1 → 3.0.0-studio-v3.0
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/README.md +68 -2
- package/lib/cjs/index.js +899 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/esm/index.js +889 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/types/index.d.ts +43 -0
- package/lib/types/index.d.ts.map +1 -0
- package/package.json +67 -16
- package/src/@types/css.d.ts +4 -0
- package/src/diff/GeopointArrayDiff.tsx +84 -0
- package/src/diff/GeopointFieldDiff.styles.tsx +20 -0
- package/src/diff/GeopointFieldDiff.tsx +95 -0
- package/src/diff/GeopointMove.tsx +48 -0
- package/src/diff/resolver.ts +21 -0
- package/src/global-workaround.ts +11 -0
- package/src/index.tsx +51 -0
- package/src/input/GeopointInput.styles.tsx +12 -0
- package/src/input/GeopointInput.tsx +176 -0
- package/src/input/GeopointSelect.tsx +78 -0
- package/src/loader/GoogleMapsLoadProxy.tsx +51 -0
- package/src/loader/LoadError.tsx +44 -0
- package/src/loader/loadGoogleMapsApi.ts +97 -0
- package/src/map/Arrow.tsx +76 -0
- package/src/map/Map.styles.tsx +10 -0
- package/src/map/Map.tsx +125 -0
- package/src/map/Marker.tsx +130 -0
- package/src/map/SearchInput.styles.tsx +8 -0
- package/src/map/SearchInput.tsx +56 -0
- package/src/map/util.ts +14 -0
- package/src/types.ts +19 -0
- package/.depcheckignore.json +0 -3
- package/config.dist.json +0 -9
- package/dist/dts/diff/GeopointArrayDiff.d.ts +0 -5
- package/dist/dts/diff/GeopointArrayDiff.d.ts.map +0 -1
- package/dist/dts/diff/GeopointFieldDiff.d.ts +0 -5
- package/dist/dts/diff/GeopointFieldDiff.d.ts.map +0 -1
- package/dist/dts/diff/GeopointFieldDiff.styles.d.ts +0 -2
- package/dist/dts/diff/GeopointFieldDiff.styles.d.ts.map +0 -1
- package/dist/dts/diff/GeopointMove.d.ts +0 -13
- package/dist/dts/diff/GeopointMove.d.ts.map +0 -1
- package/dist/dts/diff/resolver.d.ts +0 -4
- package/dist/dts/diff/resolver.d.ts.map +0 -1
- package/dist/dts/input/GeopointInput.d.ts +0 -40
- package/dist/dts/input/GeopointInput.d.ts.map +0 -1
- package/dist/dts/input/GeopointInput.styles.d.ts +0 -3
- package/dist/dts/input/GeopointInput.styles.d.ts.map +0 -1
- package/dist/dts/input/GeopointSelect.d.ts +0 -28
- package/dist/dts/input/GeopointSelect.d.ts.map +0 -1
- package/dist/dts/loader/GoogleMapsLoadProxy.d.ts +0 -14
- package/dist/dts/loader/GoogleMapsLoadProxy.d.ts.map +0 -1
- package/dist/dts/loader/LoadError.d.ts +0 -10
- package/dist/dts/loader/LoadError.d.ts.map +0 -1
- package/dist/dts/loader/loadGoogleMapsApi.d.ts +0 -18
- package/dist/dts/loader/loadGoogleMapsApi.d.ts.map +0 -1
- package/dist/dts/map/Arrow.d.ts +0 -29
- package/dist/dts/map/Arrow.d.ts.map +0 -1
- package/dist/dts/map/Map.d.ts +0 -37
- package/dist/dts/map/Map.d.ts.map +0 -1
- package/dist/dts/map/Map.styles.d.ts +0 -2
- package/dist/dts/map/Map.styles.d.ts.map +0 -1
- package/dist/dts/map/Marker.d.ts +0 -36
- package/dist/dts/map/Marker.d.ts.map +0 -1
- package/dist/dts/map/SearchInput.d.ts +0 -16
- package/dist/dts/map/SearchInput.d.ts.map +0 -1
- package/dist/dts/map/SearchInput.styles.d.ts +0 -2
- package/dist/dts/map/SearchInput.styles.d.ts.map +0 -1
- package/dist/dts/map/util.d.ts +0 -4
- package/dist/dts/map/util.d.ts.map +0 -1
- package/dist/dts/types.d.ts +0 -14
- package/dist/dts/types.d.ts.map +0 -1
- package/lib/@types/css.d.js +0 -1
- package/lib/diff/GeopointArrayDiff.js +0 -82
- package/lib/diff/GeopointFieldDiff.js +0 -97
- package/lib/diff/GeopointFieldDiff.styles.js +0 -18
- package/lib/diff/GeopointMove.js +0 -55
- package/lib/diff/resolver.js +0 -27
- package/lib/input/GeopointInput.js +0 -194
- package/lib/input/GeopointInput.styles.js +0 -22
- package/lib/input/GeopointSelect.js +0 -103
- package/lib/loader/GoogleMapsLoadProxy.js +0 -70
- package/lib/loader/LoadError.js +0 -43
- package/lib/loader/loadGoogleMapsApi.js +0 -81
- package/lib/map/Arrow.js +0 -97
- package/lib/map/Map.js +0 -147
- package/lib/map/Map.styles.js +0 -18
- package/lib/map/Marker.js +0 -156
- package/lib/map/SearchInput.js +0 -77
- package/lib/map/SearchInput.styles.js +0 -18
- package/lib/map/util.js +0 -14
- package/lib/types.js +0 -5
- package/sanity.json +0 -18
- package/tsconfig.json +0 -20
package/README.md
CHANGED
|
@@ -1,16 +1,56 @@
|
|
|
1
1
|
# @sanity/google-maps-input
|
|
2
2
|
|
|
3
|
+
> **NOTE**
|
|
4
|
+
>
|
|
5
|
+
> This is the **Sanity Studio v3 version** of @sanity/google-maps-input.
|
|
6
|
+
>
|
|
7
|
+
> For the v2 version, please refer to the [v2-branch](https://github.com/sanity-io/sanity/tree/next/packages/%40sanity/google-maps-input).
|
|
8
|
+
|
|
9
|
+
## What is it?
|
|
3
10
|
Plugin for [Sanity Studio](https://www.sanity.io) providing input handlers for geo-related input types using Google Maps.
|
|
4
11
|
|
|
12
|
+
This plugin will replace the default `geopoint` input component.
|
|
13
|
+
|
|
14
|
+

|
|
15
|
+
|
|
5
16
|
## Installation
|
|
6
17
|
|
|
7
18
|
In your studio folder, run:
|
|
8
19
|
|
|
9
20
|
```
|
|
10
|
-
|
|
21
|
+
npm install --save @sanity/google-maps-input@studio-v3
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
or
|
|
25
|
+
|
|
26
|
+
```
|
|
27
|
+
yarn add @sanity/google-maps-input@studio-v3
|
|
11
28
|
```
|
|
12
29
|
|
|
13
|
-
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
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):
|
|
33
|
+
|
|
34
|
+
```js
|
|
35
|
+
import { googleMapsInput } from "@sanity/google-maps-input";
|
|
36
|
+
|
|
37
|
+
export default createConfig({
|
|
38
|
+
// ...
|
|
39
|
+
plugins: [
|
|
40
|
+
googleMapsInput({
|
|
41
|
+
apiKey: "my-api-key"
|
|
42
|
+
})
|
|
43
|
+
]
|
|
44
|
+
})
|
|
45
|
+
```
|
|
46
|
+
Ensure that the key has access to:
|
|
47
|
+
* Google Maps JavaScript API
|
|
48
|
+
* Google Places API Web Service
|
|
49
|
+
* Google Static Maps API
|
|
50
|
+
|
|
51
|
+
And that the key allows web-access from the Studio URL(s) you are using the plugin in.
|
|
52
|
+
|
|
53
|
+
Note: This plugin will replace the default `geopoint` input component.
|
|
14
54
|
|
|
15
55
|
## Stuck? Get help
|
|
16
56
|
|
|
@@ -18,4 +58,30 @@ Then add a valid [Google Maps API key](https://developers.google.com/maps/docume
|
|
|
18
58
|
|
|
19
59
|
Join [Sanity’s developer community](https://slack.sanity.io) or ping us [on twitter](https://twitter.com/sanity_io).
|
|
20
60
|
|
|
61
|
+
## License
|
|
62
|
+
|
|
63
|
+
MIT-licensed. See LICENSE.
|
|
64
|
+
|
|
65
|
+
## Develop & test
|
|
66
|
+
|
|
67
|
+
Make sure to run `npm run build` once, then run
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
npm run link-watch
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
In another shell, `cd` to your test studio and run:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
npx yalc add @sanity/google-maps-input --link && yarn install
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
Now, changes in this repo will be automatically built and pushed to the studio,
|
|
80
|
+
triggering hotreload. Yalc avoids issues with react-hooks that are typical when using yarn/npm link.
|
|
81
|
+
|
|
82
|
+
### About build & watch
|
|
83
|
+
|
|
84
|
+
This plugin uses [@sanity/plugin-sdk](https://github.com/sanity-io/plugin-sdk)
|
|
85
|
+
with default configuration for build & watch scripts.
|
|
86
|
+
|
|
21
87
|
|