@equinor/fusion-framework-react 6.0.0 → 6.0.1
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 +17 -0
- package/dist/esm/app/useCurrentApp.js +1 -1
- package/dist/esm/app/useCurrentApp.js.map +1 -1
- package/dist/esm/app/useCurrentAppModule.js +4 -2
- package/dist/esm/app/useCurrentAppModule.js.map +1 -1
- package/dist/esm/app/useCurrentAppModules.js +1 -1
- package/dist/esm/app/useCurrentAppModules.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/app/useCurrentApp.d.ts +1 -1
- package/dist/types/app/useCurrentAppModules.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +8 -8
- package/src/app/useCurrentApp.ts +2 -2
- package/src/app/useCurrentAppModule.ts +4 -2
- package/src/app/useCurrentAppModules.ts +2 -2
- package/src/version.ts +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type AnyModule } from '@equinor/fusion-framework-module';
|
|
2
2
|
import { type CurrentApp } from '@equinor/fusion-framework-module-app';
|
|
3
3
|
export declare const useCurrentApp: <TModules extends AnyModule[] = [], TEnv = unknown>() => {
|
|
4
|
-
currentApp
|
|
4
|
+
currentApp?: CurrentApp<TModules, TEnv>;
|
|
5
5
|
setCurrentApp: (appKey: string) => void;
|
|
6
6
|
clearCurrentApp: () => void;
|
|
7
7
|
error?: unknown;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AppModulesInstance } from '@equinor/fusion-framework-module-app';
|
|
2
2
|
import { type AnyModule } from '@equinor/fusion-framework-module';
|
|
3
3
|
export declare const useCurrentAppModules: <TModules extends AnyModule[] = []>() => {
|
|
4
|
-
modules
|
|
4
|
+
modules?: AppModulesInstance<TModules> | null | undefined;
|
|
5
5
|
error?: unknown;
|
|
6
6
|
complete: boolean;
|
|
7
7
|
};
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.0.
|
|
1
|
+
export declare const version = "6.0.1";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/fusion-framework-react",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/esm/index.js",
|
|
6
6
|
"exports": {
|
|
@@ -48,11 +48,11 @@
|
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"rxjs": "^7.8.1",
|
|
51
|
+
"@equinor/fusion-framework": "^7.0.29",
|
|
51
52
|
"@equinor/fusion-framework-module": "^4.2.6",
|
|
52
53
|
"@equinor/fusion-framework-react-module": "^3.0.7",
|
|
53
|
-
"@equinor/fusion-observable": "^8.1.4",
|
|
54
54
|
"@equinor/fusion-framework-react-module-http": "^4.0.5",
|
|
55
|
-
"@equinor/fusion-
|
|
55
|
+
"@equinor/fusion-observable": "^8.1.5"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/react": "^18.2.20",
|
|
@@ -60,16 +60,16 @@
|
|
|
60
60
|
"react": "^18.2.0",
|
|
61
61
|
"react-dom": "^18.2.0",
|
|
62
62
|
"typescript": "^5.1.3",
|
|
63
|
-
"@equinor/fusion-framework-module-app": "^5.2.
|
|
64
|
-
"@equinor/fusion-framework-
|
|
65
|
-
"@equinor/fusion-framework-module-
|
|
63
|
+
"@equinor/fusion-framework-module-app": "^5.2.13",
|
|
64
|
+
"@equinor/fusion-framework-module-feature-flag": "^1.0.1",
|
|
65
|
+
"@equinor/fusion-framework-react-module-context": "^6.0.19"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"@types/react": "^17.0.0 || ^18.0.0",
|
|
69
69
|
"react": "^17.0.0 || ^18.0.0",
|
|
70
70
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
71
|
-
"@equinor/fusion-framework-
|
|
72
|
-
"@equinor/fusion-framework-module-
|
|
71
|
+
"@equinor/fusion-framework-module-feature-flag": "^1.0.1",
|
|
72
|
+
"@equinor/fusion-framework-react-module-signalr": "^2.0.17"
|
|
73
73
|
},
|
|
74
74
|
"peerDependenciesMeta": {
|
|
75
75
|
"@equinor/fusion-framework-react-module-context": {
|
package/src/app/useCurrentApp.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { useFramework } from '../useFramework';
|
|
|
16
16
|
* @template TEnv type hint what kind of environment config the application has
|
|
17
17
|
*/
|
|
18
18
|
export const useCurrentApp = <TModules extends Array<AnyModule> = [], TEnv = unknown>(): {
|
|
19
|
-
currentApp
|
|
19
|
+
currentApp?: CurrentApp<TModules, TEnv> | null;
|
|
20
20
|
setCurrentApp: (appKey: string) => void;
|
|
21
21
|
clearCurrentApp: () => void;
|
|
22
22
|
error?: unknown;
|
|
@@ -26,7 +26,7 @@ export const useCurrentApp = <TModules extends Array<AnyModule> = [], TEnv = unk
|
|
|
26
26
|
throw Error('Current framework does not have AppModule configured');
|
|
27
27
|
}
|
|
28
28
|
const currentApp$ = useMemo(() => provider.current$, [provider]);
|
|
29
|
-
const { value, error } = useObservableState(currentApp
|
|
29
|
+
const { value, error } = useObservableState(currentApp$, { initial: provider.current });
|
|
30
30
|
return {
|
|
31
31
|
currentApp: value as CurrentApp<TModules, TEnv>,
|
|
32
32
|
setCurrentApp: useMemo(() => provider.setCurrentApp.bind(provider), [provider]),
|
|
@@ -35,8 +35,10 @@ export const useCurrentAppModule = <
|
|
|
35
35
|
const module =
|
|
36
36
|
modules === null
|
|
37
37
|
? null
|
|
38
|
-
:
|
|
39
|
-
|
|
38
|
+
: modules === undefined
|
|
39
|
+
? undefined
|
|
40
|
+
: // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
+
(modules[moduleKey as keyof typeof modules] as any);
|
|
40
42
|
return { module, error, complete };
|
|
41
43
|
};
|
|
42
44
|
|
|
@@ -15,7 +15,7 @@ import { useObservableState } from '@equinor/fusion-observable/react';
|
|
|
15
15
|
* @returns the observable instance of initialized modules of the application
|
|
16
16
|
*/
|
|
17
17
|
export const useCurrentAppModules = <TModules extends Array<AnyModule> = []>(): {
|
|
18
|
-
modules
|
|
18
|
+
modules?: AppModulesInstance<TModules> | null;
|
|
19
19
|
error?: unknown;
|
|
20
20
|
complete: boolean;
|
|
21
21
|
} => {
|
|
@@ -32,7 +32,7 @@ export const useCurrentAppModules = <TModules extends Array<AnyModule> = []>():
|
|
|
32
32
|
error,
|
|
33
33
|
complete,
|
|
34
34
|
} = useObservableState(modules$, {
|
|
35
|
-
initial:
|
|
35
|
+
initial: currentApp === undefined ? undefined : currentApp?.instance ?? null,
|
|
36
36
|
});
|
|
37
37
|
return {
|
|
38
38
|
modules,
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '6.0.
|
|
2
|
+
export const version = '6.0.1';
|