@equinor/fusion-framework-react-app 5.2.12 → 5.3.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.
@@ -1,3 +1,4 @@
1
- export type { CreateBookMarkFn } from '@equinor/fusion-framework-react-module-bookmark';
2
- export { default, useCurrentBookmark } from './useCurrentBookmark';
1
+ export { enableBookmark } from '@equinor/fusion-framework-react-module-bookmark';
2
+ export { useCurrentBookmark } from './useCurrentBookmark';
3
3
  export { useBookmark } from './useBookmark';
4
+ export type { Bookmark, Bookmarks, BookmarkData, BookmarkPayloadGenerator, BookmarkProvider, } from '@equinor/fusion-framework-react-module-bookmark';
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * @deprecated Use useBookmark from @equinor/fusion-framework-react-module-bookmark
2
3
  * For application development the useCurrentBookmark should be sufficient enough
3
4
  *
4
5
  * Functionality provided here is:
@@ -14,5 +15,5 @@
14
15
  * @template TData - Current applications bookmark type
15
16
  * @return {*} {Bookmarks<TData>} the full api fro handling bookmarks
16
17
  */
17
- export declare const useBookmark: <TData>() => import("@equinor/fusion-framework-react-module-bookmark").Bookmarks<TData>;
18
+ export declare const useBookmark: <TData>() => import("@equinor/fusion-framework-react-module-bookmark/dist/types/useBookmark").useBookmarkResult;
18
19
  export default useBookmark;
@@ -1,4 +1,4 @@
1
- import { CreateBookMarkFn } from '@equinor/fusion-framework-react-module-bookmark';
1
+ import { BookmarkData, BookmarkPayloadGenerator } from '@equinor/fusion-framework-react-module-bookmark';
2
2
  /**
3
3
  * By providing a CreateBookMarkFn bookmarks is enabled for the current application.
4
4
  *
@@ -11,5 +11,5 @@ import { CreateBookMarkFn } from '@equinor/fusion-framework-react-module-bookmar
11
11
  * ```
12
12
  * @return {*} {CurrentBookmark<TData>}
13
13
  */
14
- export declare const useCurrentBookmark: <TData>(createBookmarkState?: CreateBookMarkFn<TData>) => import("@equinor/fusion-framework-react-module-bookmark").CurrentBookmark<TData>;
14
+ export declare const useCurrentBookmark: <TData extends BookmarkData>(payloadGenerator?: BookmarkPayloadGenerator<TData>) => import("@equinor/fusion-framework-react-module-bookmark/dist/types/useCurrentBookmark").useCurrentBookmarkReturn<TData>;
15
15
  export default useCurrentBookmark;
@@ -1 +1 @@
1
- export declare const version = "5.2.12";
1
+ export declare const version = "5.3.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/fusion-framework-react-app",
3
- "version": "5.2.12",
3
+ "version": "5.3.0",
4
4
  "description": "",
5
5
  "main": "./dist/esm/index.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -82,12 +82,12 @@
82
82
  "directory": "packages/react"
83
83
  },
84
84
  "dependencies": {
85
- "@equinor/fusion-framework-module": "^4.3.5",
86
- "@equinor/fusion-framework-module-app": "^6.0.2",
87
- "@equinor/fusion-framework-app": "^9.1.12",
85
+ "@equinor/fusion-framework-app": "^9.1.13",
88
86
  "@equinor/fusion-framework-module-navigation": "^4.0.7",
89
- "@equinor/fusion-framework-react": "^7.3.1",
87
+ "@equinor/fusion-framework-react": "^7.3.2",
90
88
  "@equinor/fusion-framework-react-module": "^3.1.6",
89
+ "@equinor/fusion-framework-module-app": "^6.0.2",
90
+ "@equinor/fusion-framework-module": "^4.3.5",
91
91
  "@equinor/fusion-framework-react-module-http": "^8.0.0"
92
92
  },
93
93
  "devDependencies": {
@@ -98,11 +98,11 @@
98
98
  "rxjs": "^7.8.1",
99
99
  "typescript": "^5.5.4",
100
100
  "@equinor/fusion-framework-module-event": "^4.2.4",
101
- "@equinor/fusion-framework-module-msal": "^3.1.5",
102
- "@equinor/fusion-framework-react-module-bookmark": "^2.1.19",
103
101
  "@equinor/fusion-framework-module-feature-flag": "^1.1.10",
102
+ "@equinor/fusion-framework-module-msal": "^3.1.5",
104
103
  "@equinor/fusion-framework-react-module-context": "^6.2.14",
105
- "@equinor/fusion-framework-react-widget": "^1.1.19",
104
+ "@equinor/fusion-framework-react-module-bookmark": "^2.2.0",
105
+ "@equinor/fusion-framework-react-widget": "^1.1.20",
106
106
  "@equinor/fusion-observable": "^8.4.2"
107
107
  },
108
108
  "peerDependencies": {
@@ -1,4 +1,12 @@
1
- export type { CreateBookMarkFn } from '@equinor/fusion-framework-react-module-bookmark';
1
+ export { enableBookmark } from '@equinor/fusion-framework-react-module-bookmark';
2
2
 
3
- export { default, useCurrentBookmark } from './useCurrentBookmark';
3
+ export { useCurrentBookmark } from './useCurrentBookmark';
4
4
  export { useBookmark } from './useBookmark';
5
+
6
+ export type {
7
+ Bookmark,
8
+ Bookmarks,
9
+ BookmarkData,
10
+ BookmarkPayloadGenerator,
11
+ BookmarkProvider,
12
+ } from '@equinor/fusion-framework-react-module-bookmark';
@@ -1,6 +1,7 @@
1
1
  import { useBookmark as _useBookmark } from '@equinor/fusion-framework-react-module-bookmark';
2
2
 
3
3
  /**
4
+ * @deprecated Use useBookmark from @equinor/fusion-framework-react-module-bookmark
4
5
  * For application development the useCurrentBookmark should be sufficient enough
5
6
  *
6
7
  * Functionality provided here is:
@@ -16,6 +17,7 @@ import { useBookmark as _useBookmark } from '@equinor/fusion-framework-react-mod
16
17
  * @template TData - Current applications bookmark type
17
18
  * @return {*} {Bookmarks<TData>} the full api fro handling bookmarks
18
19
  */
19
- export const useBookmark = <TData>() => _useBookmark<TData>();
20
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
21
+ export const useBookmark = <TData>() => _useBookmark();
20
22
 
21
23
  export default useBookmark;
@@ -1,7 +1,11 @@
1
1
  import {
2
- CreateBookMarkFn,
2
+ BookmarkData,
3
+ BookmarkPayloadGenerator,
3
4
  useCurrentBookmark as _useCurrentBookmark,
4
5
  } from '@equinor/fusion-framework-react-module-bookmark';
6
+ import { BookmarkModule } from '../../../../modules/bookmark/src';
7
+ import { useFrameworkModule } from '@equinor/fusion-framework-react';
8
+ import useAppModules from '../useAppModules';
5
9
 
6
10
  /**
7
11
  * By providing a CreateBookMarkFn bookmarks is enabled for the current application.
@@ -15,7 +19,21 @@ import {
15
19
  * ```
16
20
  * @return {*} {CurrentBookmark<TData>}
17
21
  */
18
- export const useCurrentBookmark = <TData>(createBookmarkState?: CreateBookMarkFn<TData>) =>
19
- _useCurrentBookmark(createBookmarkState);
22
+ export const useCurrentBookmark = <TData extends BookmarkData>(
23
+ payloadGenerator?: BookmarkPayloadGenerator<TData>,
24
+ ) => {
25
+ const appBookmarkProvider = useAppModules<[BookmarkModule]>().bookmark;
26
+ const frameworkBookmarkProvider = useFrameworkModule<BookmarkModule>('bookmark');
27
+ if (!appBookmarkProvider) {
28
+ console.warn(
29
+ '@deprecation',
30
+ 'application has not enabled bookmarks, this will not work in the future',
31
+ );
32
+ }
33
+ return _useCurrentBookmark<TData>({
34
+ provider: appBookmarkProvider ?? frameworkBookmarkProvider,
35
+ payloadGenerator,
36
+ });
37
+ };
20
38
 
21
39
  export default useCurrentBookmark;
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '5.2.12';
2
+ export const version = '5.3.0';