@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.
@@ -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: (configurator: FusionConfigurator) => void;
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;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import type { Fusion } from '@equinor/fusion-framework';
2
3
  export declare const context: import("react").Context<Fusion<any> | null>;
3
4
  export declare const FrameworkProvider: import("react").Provider<Fusion<any> | null>;
@@ -0,0 +1 @@
1
+ export declare const version = "5.2.5";
package/package.json CHANGED
@@ -1,80 +1,84 @@
1
1
  {
2
- "name": "@equinor/fusion-framework-react",
3
- "version": "5.2.2",
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
- "scripts": {
35
- "build": "tsc -b",
36
- "prepack": "yarn build"
37
- },
38
- "keywords": [],
39
- "author": "",
40
- "license": "ISC",
41
- "publishConfig": {
42
- "access": "public"
43
- },
44
- "repository": {
45
- "type": "git",
46
- "url": "git+https://github.com/equinor/fusion-framework.git",
47
- "directory": "packages/react/framework"
48
- },
49
- "dependencies": {
50
- "@equinor/fusion-framework": "^7.0.15",
51
- "@equinor/fusion-framework-react-module-context": "^6.0.9",
52
- "@equinor/fusion-framework-react-module-http": "^3.0.3",
53
- "rxjs": "^7.5.7"
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
- "devDependencies": {
56
- "@equinor/fusion-framework-module-app": "^5.2.1",
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
- "peerDependencies": {
64
- "@equinor/fusion-framework-react-module-signalr": "*",
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
- "peerDependenciesMeta": {
70
- "@equinor/fusion-framework-react-module-signalr": {
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: (configurator: FusionConfigurator) => void;
8
- fallback: NonNullable<ReactNode> | null;
9
- }>
9
+ readonly configure: ConfigureCallback;
10
+ readonly fallback: NonNullable<ReactNode> | null;
11
+ }>,
10
12
  ) => {
11
- const Component = useMemo(() => createFrameworkProvider(props.configure), [props.configure]);
13
+ const { configure, fallback, children } = props;
14
+ const Component = useMemo(() => createFrameworkProvider(configure), [configure]);
12
15
  return (
13
- <Suspense fallback={props.fallback}>
14
- <Component>{props.children}</Component>
16
+ <Suspense fallback={fallback}>
17
+ <Component>{children}</Component>
15
18
  </Suspense>
16
19
  );
17
20
  };
@@ -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(() => {
@@ -23,7 +23,7 @@ export const useCurrentAppModules = <TModules extends Array<AnyModule> = []>():
23
23
  currentApp
24
24
  ? (currentApp.instance$ as Observable<AppModulesInstance<TModules>>)
25
25
  : of(null),
26
- [currentApp]
26
+ [currentApp],
27
27
  );
28
28
  return {
29
29
  modules$,
@@ -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>();
@@ -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
@@ -0,0 +1,2 @@
1
+ // Generated by genversion.
2
+ export const version = '5.2.5';
package/tsconfig.json CHANGED
@@ -4,7 +4,9 @@
4
4
  "outDir": "dist/esm",
5
5
  "rootDir": "src",
6
6
  "declarationDir": "./dist/types",
7
- "baseUrl": "src",
7
+ "paths": {
8
+ "react": [ "./node_modules/@types/react" ],
9
+ },
8
10
  },
9
11
  "references": [
10
12
  {