@availity/hooks 5.0.3 → 5.1.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/CHANGELOG.md CHANGED
@@ -2,6 +2,15 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ # [5.1.0](https://github.com/Availity/availity-react/compare/@availity/hooks@5.0.3...@availity/hooks@5.1.0) (2024-10-01)
6
+
7
+
8
+ ### Features
9
+
10
+ * **hooks:** add useUpdateNav ([68d0f21](https://github.com/Availity/availity-react/commit/68d0f21d1eb034065d7528ebf6033f2e8f20057e))
11
+
12
+
13
+
5
14
  ## [5.0.3](https://github.com/Availity/availity-react/compare/@availity/hooks@5.0.2...@availity/hooks@5.0.3) (2024-08-22)
6
15
 
7
16
 
package/index.d.ts CHANGED
@@ -7,4 +7,5 @@ export { default as useCurrentUser } from './types/useCurrentUser';
7
7
  export { default as useProviders } from './types/useProviders';
8
8
  export { default as usePermissions } from './types/usePermissions';
9
9
  export { default as useOrganizations } from './types/useOrganizations';
10
+ export { default as useUpdateNav } from './types/useUpdateNav';
10
11
  export { default as useWindowDimensions } from './types/useWindowDimensions';
package/index.js CHANGED
@@ -7,4 +7,5 @@ export { default as useCurrentUser } from './src/useCurrentUser';
7
7
  export { default as useProviders } from './src/useProviders';
8
8
  export { default as usePermissions } from './src/usePermissions';
9
9
  export { default as useOrganizations } from './src/useOrganizations';
10
+ export { default as useUpdateNav } from './src/useUpdateNav';
10
11
  export { default as useWindowDimensions } from './src/useWindowDimensions';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@availity/hooks",
3
- "version": "5.0.3",
3
+ "version": "5.1.0",
4
4
  "description": "A group of pre-built hooks that are common in most apps",
5
5
  "keywords": [
6
6
  "react",
@@ -30,14 +30,18 @@
30
30
  },
31
31
  "devDependencies": {
32
32
  "@availity/api-axios": "^9.0.0",
33
+ "@availity/message-core": "^7.0.1",
33
34
  "axios": "^1.7.4",
34
35
  "react": "^18.3.1",
35
- "react-dom": "^18.3.1"
36
+ "react-dom": "^18.3.1",
37
+ "react-router-dom": "^6.26.0"
36
38
  },
37
39
  "peerDependencies": {
38
- "@availity/api-axios": "^8.0.0",
40
+ "@availity/api-axios": "^9.0.0",
41
+ "@availity/message-core": "^7.0.1",
39
42
  "axios": "^1.7.4",
40
- "react": ">=16.8.0"
43
+ "react": ">=16.8.0",
44
+ "react-router-dom": "^6.0.0"
41
45
  },
42
46
  "publishConfig": {
43
47
  "access": "public"
@@ -0,0 +1,17 @@
1
+ import { useEffect } from 'react';
2
+ import { useLocation } from 'react-router-dom';
3
+ import avMessage from '@availity/message-core';
4
+
5
+ const useUpdateNav = () => {
6
+ const location = useLocation();
7
+
8
+ useEffect(() => {
9
+ try {
10
+ avMessage.send({ event: 'navChange', url: window.location.href });
11
+ } catch {
12
+ // noop
13
+ }
14
+ }, [location]);
15
+ };
16
+
17
+ export default useUpdateNav;
@@ -0,0 +1,3 @@
1
+ declare const useUpdateNav: () => void;
2
+
3
+ export default useUpdateNav;