@ttoss/google-maps 1.22.13 → 1.22.15
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/esm/index.js +4 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -3
- package/package.json +8 -5
- package/src/GoogleMapsProvider.tsx +4 -2
package/dist/esm/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import * as React from "react";
|
|
|
5
5
|
|
|
6
6
|
// src/GoogleMapsProvider.tsx
|
|
7
7
|
import * as React2 from "react";
|
|
8
|
-
import { useScript } from "@ttoss/hooks";
|
|
8
|
+
import { useScript } from "@ttoss/react-hooks";
|
|
9
9
|
import { jsx } from "react/jsx-runtime";
|
|
10
10
|
var GoogleMapsContext = /*#__PURE__*/React2.createContext({
|
|
11
11
|
status: "idle",
|
|
@@ -53,7 +53,9 @@ var GoogleMapsProvider = ({
|
|
|
53
53
|
children
|
|
54
54
|
});
|
|
55
55
|
};
|
|
56
|
-
var useGoogleMaps = () =>
|
|
56
|
+
var useGoogleMaps = () => {
|
|
57
|
+
return React2.useContext(GoogleMapsContext);
|
|
58
|
+
};
|
|
57
59
|
|
|
58
60
|
// src/useGeocoder.ts
|
|
59
61
|
import * as React3 from "react";
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -51,7 +51,7 @@ var React = __toESM(require("react"));
|
|
|
51
51
|
|
|
52
52
|
// src/GoogleMapsProvider.tsx
|
|
53
53
|
var React2 = __toESM(require("react"));
|
|
54
|
-
var
|
|
54
|
+
var import_react_hooks = require("@ttoss/react-hooks");
|
|
55
55
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
56
56
|
var GoogleMapsContext = React2.createContext({
|
|
57
57
|
status: "idle",
|
|
@@ -75,7 +75,7 @@ var GoogleMapsProvider = ({
|
|
|
75
75
|
})();
|
|
76
76
|
const {
|
|
77
77
|
status
|
|
78
|
-
} = (0,
|
|
78
|
+
} = (0, import_react_hooks.useScript)(src);
|
|
79
79
|
const googleMaps = React2.useMemo(() => {
|
|
80
80
|
if (status === "ready" && window.google.maps) {
|
|
81
81
|
return window.google.maps;
|
|
@@ -99,7 +99,9 @@ var GoogleMapsProvider = ({
|
|
|
99
99
|
children
|
|
100
100
|
});
|
|
101
101
|
};
|
|
102
|
-
var useGoogleMaps = () =>
|
|
102
|
+
var useGoogleMaps = () => {
|
|
103
|
+
return React2.useContext(GoogleMapsContext);
|
|
104
|
+
};
|
|
103
105
|
|
|
104
106
|
// src/useGeocoder.ts
|
|
105
107
|
var React3 = __toESM(require("react"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttoss/google-maps",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.15",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": "ttoss",
|
|
6
6
|
"contributors": [
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
},
|
|
20
20
|
"typings": "dist/index.d.ts",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@ttoss/hooks": "^1.21.
|
|
22
|
+
"@ttoss/react-hooks": "^1.21.15",
|
|
23
23
|
"@types/google.maps": "^3.49.2",
|
|
24
24
|
"use-callback-ref": "^1.3.0"
|
|
25
25
|
},
|
|
@@ -28,11 +28,14 @@
|
|
|
28
28
|
"react-dom": ">=16.8.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@ttoss/config": "^1.29.
|
|
32
|
-
"@ttoss/test-utils": "^1.21.
|
|
31
|
+
"@ttoss/config": "^1.29.4",
|
|
32
|
+
"@ttoss/test-utils": "^1.21.4",
|
|
33
|
+
"@types/react": "^18.0.37",
|
|
34
|
+
"jest": "^29.5.0",
|
|
35
|
+
"tsup": "^6.7.0"
|
|
33
36
|
},
|
|
34
37
|
"publishConfig": {
|
|
35
38
|
"access": "public"
|
|
36
39
|
},
|
|
37
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "8eafbcce082f4e1d8173eef0d40b99c683de8af9"
|
|
38
41
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { ScriptStatus, useScript } from '@ttoss/hooks';
|
|
2
|
+
import { ScriptStatus, useScript } from '@ttoss/react-hooks';
|
|
3
3
|
|
|
4
4
|
type Extends<T, U extends T> = U;
|
|
5
5
|
|
|
@@ -89,4 +89,6 @@ export const GoogleMapsProvider = ({
|
|
|
89
89
|
* @returns param.googleMaps: GoogleMaps - returns the google maps object which
|
|
90
90
|
* provides access to the [Google Maps API](https://developers.google.com/maps/documentation/javascript/overview).
|
|
91
91
|
*/
|
|
92
|
-
export const useGoogleMaps = () =>
|
|
92
|
+
export const useGoogleMaps = () => {
|
|
93
|
+
return React.useContext(GoogleMapsContext);
|
|
94
|
+
};
|