@equinor/fusion-framework-react 5.2.2 → 5.2.5
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 +41 -0
- package/LICENSE +21 -0
- package/dist/esm/Framework.js +3 -2
- package/dist/esm/Framework.js.map +1 -1
- package/dist/esm/version.js +2 -0
- package/dist/esm/version.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/Framework.d.ts +4 -3
- package/dist/types/context.d.ts +1 -0
- package/dist/types/version.d.ts +1 -0
- package/package.json +79 -75
- package/src/Framework.tsx +9 -6
- package/src/app/useApps.ts +1 -1
- package/src/app/useCurrentAppModules.ts +1 -1
- package/src/create-framework-provider.tsx +1 -1
- package/src/signalr/index.ts +2 -2
- package/src/version.ts +2 -0
- package/tsconfig.json +3 -1
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FusionConfigurator } from '@equinor/fusion-framework';
|
|
2
2
|
import { PropsWithChildren, ReactNode } from 'react';
|
|
3
|
+
type ConfigureCallback = (configurator: FusionConfigurator) => void;
|
|
3
4
|
export declare const Framework: (props: PropsWithChildren<{
|
|
4
|
-
configure:
|
|
5
|
-
fallback: NonNullable<ReactNode> | null;
|
|
6
|
-
}>) => JSX.Element;
|
|
5
|
+
readonly configure: ConfigureCallback;
|
|
6
|
+
readonly fallback: NonNullable<ReactNode> | null;
|
|
7
|
+
}>) => import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export default Framework;
|
package/dist/types/context.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const version = "5.2.5";
|
package/package.json
CHANGED
|
@@ -1,80 +1,84 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
2
|
+
"name": "@equinor/fusion-framework-react",
|
|
3
|
+
"version": "5.2.5",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/esm/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./dist/esm/index.js",
|
|
8
|
+
"./app": "./dist/esm/app/index.js",
|
|
9
|
+
"./context": "./dist/esm/context/index.js",
|
|
10
|
+
"./hooks": "./dist/esm/hooks/index.js",
|
|
11
|
+
"./http": "./dist/esm/http/index.js",
|
|
12
|
+
"./signalr": "./dist/esm/signalr/index.js"
|
|
13
|
+
},
|
|
14
|
+
"types": "dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
"*": {
|
|
17
|
+
"app": [
|
|
18
|
+
"dist/types/app/index.d.ts"
|
|
19
|
+
],
|
|
20
|
+
"context": [
|
|
21
|
+
"dist/types/context/index.d.ts"
|
|
22
|
+
],
|
|
23
|
+
"hooks": [
|
|
24
|
+
"dist/types/hooks/index.d.ts"
|
|
25
|
+
],
|
|
26
|
+
"http": [
|
|
27
|
+
"dist/types/http/index.d.ts"
|
|
28
|
+
],
|
|
29
|
+
"signalr": [
|
|
30
|
+
"dist/types/signalr/index.d.ts"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"keywords": [],
|
|
35
|
+
"author": "",
|
|
36
|
+
"license": "ISC",
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"access": "public"
|
|
39
|
+
},
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "git+https://github.com/equinor/fusion-framework.git",
|
|
43
|
+
"directory": "packages/react/framework"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"rxjs": "^7.8.1",
|
|
47
|
+
"@equinor/fusion-framework": "^7.0.17",
|
|
48
|
+
"@equinor/fusion-framework-module": "^4.2.3",
|
|
49
|
+
"@equinor/fusion-framework-react-module-http": "^3.0.4",
|
|
50
|
+
"@equinor/fusion-observable": "^8.1.0"
|
|
51
|
+
},
|
|
52
|
+
"devDependencies": {
|
|
53
|
+
"@types/react": "^18.2.20",
|
|
54
|
+
"@types/react-dom": "^18.2.7",
|
|
55
|
+
"react": "^18.2.0",
|
|
56
|
+
"react-dom": "^18.2.0",
|
|
57
|
+
"typescript": "^5.1.3",
|
|
58
|
+
"@equinor/fusion-framework-module-app": "^5.2.3",
|
|
59
|
+
"@equinor/fusion-framework-react-module-context": "^6.0.11"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"@types/react": "^17.0.0 || ^18.0.0",
|
|
63
|
+
"react": "^17.0.0 || ^18.0.0",
|
|
64
|
+
"react-dom": "^17.0.0 || ^18.0.0",
|
|
65
|
+
"@equinor/fusion-framework-react-module-signalr": "^2.0.5"
|
|
66
|
+
},
|
|
67
|
+
"peerDependenciesMeta": {
|
|
68
|
+
"@equinor/fusion-framework-react-module-context": {
|
|
69
|
+
"optional": true
|
|
54
70
|
},
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
"@types/react": "^17.0.11",
|
|
58
|
-
"@types/react-dom": "^17.0.7",
|
|
59
|
-
"react": "^17.0.2",
|
|
60
|
-
"react-dom": "^17.0.2",
|
|
61
|
-
"typescript": "^5.1.3"
|
|
71
|
+
"@equinor/fusion-framework-react-module-signalr": {
|
|
72
|
+
"optional": true
|
|
62
73
|
},
|
|
63
|
-
"
|
|
64
|
-
|
|
65
|
-
"@types/react": "^17.0.0 || ^18.0.0",
|
|
66
|
-
"react": "^17.0.0 || ^18.0.0",
|
|
67
|
-
"react-dom": "^17.0.0 || ^18.0.0"
|
|
74
|
+
"@types/react": {
|
|
75
|
+
"optional": true
|
|
68
76
|
},
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
"optional": true
|
|
72
|
-
},
|
|
73
|
-
"@types/react": {
|
|
74
|
-
"optional": true
|
|
75
|
-
},
|
|
76
|
-
"react-dom": {
|
|
77
|
-
"optional": true
|
|
78
|
-
}
|
|
77
|
+
"react-dom": {
|
|
78
|
+
"optional": true
|
|
79
79
|
}
|
|
80
|
-
}
|
|
80
|
+
},
|
|
81
|
+
"scripts": {
|
|
82
|
+
"build": "tsc -b"
|
|
83
|
+
}
|
|
84
|
+
}
|
package/src/Framework.tsx
CHANGED
|
@@ -2,16 +2,19 @@ import { FusionConfigurator } from '@equinor/fusion-framework';
|
|
|
2
2
|
import { createFrameworkProvider } from './create-framework-provider';
|
|
3
3
|
import { PropsWithChildren, ReactNode, Suspense, useMemo } from 'react';
|
|
4
4
|
|
|
5
|
+
type ConfigureCallback = (configurator: FusionConfigurator) => void;
|
|
6
|
+
|
|
5
7
|
export const Framework = (
|
|
6
8
|
props: PropsWithChildren<{
|
|
7
|
-
configure:
|
|
8
|
-
fallback: NonNullable<ReactNode> | null;
|
|
9
|
-
}
|
|
9
|
+
readonly configure: ConfigureCallback;
|
|
10
|
+
readonly fallback: NonNullable<ReactNode> | null;
|
|
11
|
+
}>,
|
|
10
12
|
) => {
|
|
11
|
-
const
|
|
13
|
+
const { configure, fallback, children } = props;
|
|
14
|
+
const Component = useMemo(() => createFrameworkProvider(configure), [configure]);
|
|
12
15
|
return (
|
|
13
|
-
<Suspense fallback={
|
|
14
|
-
<Component>{
|
|
16
|
+
<Suspense fallback={fallback}>
|
|
17
|
+
<Component>{children}</Component>
|
|
15
18
|
</Suspense>
|
|
16
19
|
);
|
|
17
20
|
};
|
package/src/app/useApps.ts
CHANGED
|
@@ -14,7 +14,7 @@ export const useApps = (args?: {
|
|
|
14
14
|
}): { apps: AppManifest[] | undefined; isLoading: boolean } => {
|
|
15
15
|
const provider = useAppProvider();
|
|
16
16
|
const { value: manifests, complete } = useObservableState(
|
|
17
|
-
useMemo(() => provider.getAllAppManifests(), [provider])
|
|
17
|
+
useMemo(() => provider.getAllAppManifests(), [provider]),
|
|
18
18
|
);
|
|
19
19
|
|
|
20
20
|
const apps = useMemo(() => {
|
|
@@ -25,7 +25,7 @@ import type { AnyModule } from '@equinor/fusion-framework-module';
|
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
27
|
export const createFrameworkProvider = <TModules extends Array<AnyModule> = []>(
|
|
28
|
-
cb: (configurator: FusionConfigurator<TModules>) => void | Promise<void
|
|
28
|
+
cb: (configurator: FusionConfigurator<TModules>) => void | Promise<void>,
|
|
29
29
|
): React.LazyExoticComponent<React.FunctionComponent<React.PropsWithChildren<unknown>>> =>
|
|
30
30
|
lazy(async () => {
|
|
31
31
|
const configurator = new FusionConfigurator<TModules>();
|
package/src/signalr/index.ts
CHANGED
|
@@ -26,12 +26,12 @@ const myHook = () => {
|
|
|
26
26
|
*/
|
|
27
27
|
export const useSignalR = <T>(
|
|
28
28
|
hubId: string,
|
|
29
|
-
topicId: string
|
|
29
|
+
topicId: string,
|
|
30
30
|
): ReturnType<typeof useProviderTopic<T>> => {
|
|
31
31
|
const provider = useFramework<[SignalRModule]>().modules.signalR;
|
|
32
32
|
if (!provider) {
|
|
33
33
|
throw Error(
|
|
34
|
-
'SignalR is not configured, see @equinor/fusion-framework-react-module-signalr'
|
|
34
|
+
'SignalR is not configured, see @equinor/fusion-framework-react-module-signalr',
|
|
35
35
|
);
|
|
36
36
|
}
|
|
37
37
|
return useProviderTopic(provider, hubId, topicId);
|
package/src/version.ts
ADDED