@equinor/fusion-framework-react 1.0.16 → 1.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.
@@ -0,0 +1,7 @@
1
+ import { FusionConfigurator } from '@equinor/fusion-framework';
2
+ import { PropsWithChildren, ReactNode } from 'react';
3
+ export declare const Framework: (props: PropsWithChildren<{
4
+ configure: (configurator: FusionConfigurator) => void;
5
+ fallback: NonNullable<ReactNode> | null;
6
+ }>) => JSX.Element;
7
+ export default Framework;
@@ -1,4 +1,5 @@
1
1
  export type { Fusion } from '@equinor/fusion-framework';
2
2
  export { FusionConfigurator } from '@equinor/fusion-framework';
3
3
  export { createFrameworkProvider } from './create-framework-provider';
4
- export { FrameworkProvider as default, FrameworkProvider } from './context';
4
+ export { FrameworkProvider } from './context';
5
+ export { default, Framework } from './Framework';
package/package.json CHANGED
@@ -1,62 +1,62 @@
1
1
  {
2
- "name": "@equinor/fusion-framework-react",
3
- "version": "1.0.16",
4
- "description": "",
5
- "main": "dist/esm/index.js",
6
- "exports": {
7
- ".": "./dist/esm/index.js",
8
- "./hooks": "./dist/esm/hooks/index.js",
9
- "./http": "./dist/esm/http/index.js"
10
- },
11
- "types": "dist/types/index.d.ts",
12
- "typesVersions": {
13
- "*": {
14
- "hooks": [
15
- "dist/types/hooks/index.d.ts"
16
- ],
17
- "http": [
18
- "dist/types/http/index.d.ts"
19
- ]
20
- }
21
- },
22
- "scripts": {
23
- "build": "npm run build:typescript",
24
- "build:typescript": "tsc -b --verbose"
25
- },
26
- "keywords": [],
27
- "author": "",
28
- "license": "ISC",
29
- "publishConfig": {
30
- "access": "public"
31
- },
32
- "repository": {
33
- "type": "git",
34
- "url": "git+https://github.com/equinor/fusion-framework.git",
35
- "directory": "packages/react"
36
- },
37
- "dependencies": {
38
- "@equinor/fusion-framework": "^4.0.15",
39
- "@equinor/fusion-framework-react-module-http": "^1.0.13"
40
- },
41
- "devDependencies": {
42
- "@types/react": "^17.0.11",
43
- "@types/react-dom": "^17.0.7",
44
- "react": "^17.0.2",
45
- "react-dom": "^17.0.2",
46
- "typescript": "^4.8.4"
47
- },
48
- "peerDependencies": {
49
- "@types/react": "^16.9.0 || ^17.0.0 || ^18.0.0",
50
- "react": "^16.9.0 || ^17.0.0 || ^18.0.0",
51
- "react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0"
52
- },
53
- "peerDependenciesMeta": {
54
- "@types/react": {
55
- "optional": true
56
- },
57
- "react-dom": {
58
- "optional": true
59
- }
60
- },
61
- "gitHead": "b43085d957da8dd794cab3e59fca4f9d9b443db4"
2
+ "name": "@equinor/fusion-framework-react",
3
+ "version": "1.1.0",
4
+ "description": "",
5
+ "main": "dist/esm/index.js",
6
+ "exports": {
7
+ ".": "./dist/esm/index.js",
8
+ "./hooks": "./dist/esm/hooks/index.js",
9
+ "./http": "./dist/esm/http/index.js"
10
+ },
11
+ "types": "dist/types/index.d.ts",
12
+ "typesVersions": {
13
+ "*": {
14
+ "hooks": [
15
+ "dist/types/hooks/index.d.ts"
16
+ ],
17
+ "http": [
18
+ "dist/types/http/index.d.ts"
19
+ ]
20
+ }
21
+ },
22
+ "scripts": {
23
+ "build": "npm run build:typescript",
24
+ "build:typescript": "tsc -b --verbose"
25
+ },
26
+ "keywords": [],
27
+ "author": "",
28
+ "license": "ISC",
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/equinor/fusion-framework.git",
35
+ "directory": "packages/react"
36
+ },
37
+ "dependencies": {
38
+ "@equinor/fusion-framework": "^4.0.16",
39
+ "@equinor/fusion-framework-react-module-http": "^1.0.14"
40
+ },
41
+ "devDependencies": {
42
+ "@types/react": "^17.0.11",
43
+ "@types/react-dom": "^17.0.7",
44
+ "react": "^17.0.2",
45
+ "react-dom": "^17.0.2",
46
+ "typescript": "^4.8.4"
47
+ },
48
+ "peerDependencies": {
49
+ "@types/react": "^16.9.0 || ^17.0.0 || ^18.0.0",
50
+ "react": "^16.9.0 || ^17.0.0 || ^18.0.0",
51
+ "react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0"
52
+ },
53
+ "peerDependenciesMeta": {
54
+ "@types/react": {
55
+ "optional": true
56
+ },
57
+ "react-dom": {
58
+ "optional": true
59
+ }
60
+ },
61
+ "gitHead": "3506d6ea39362a9fb2764ac764fe8356fda0de01"
62
62
  }
@@ -0,0 +1,19 @@
1
+ import { FusionConfigurator } from '@equinor/fusion-framework';
2
+ import { createFrameworkProvider } from './create-framework-provider';
3
+ import { PropsWithChildren, ReactNode, Suspense, useMemo } from 'react';
4
+
5
+ export const Framework = (
6
+ props: PropsWithChildren<{
7
+ configure: (configurator: FusionConfigurator) => void;
8
+ fallback: NonNullable<ReactNode> | null;
9
+ }>
10
+ ) => {
11
+ const Component = useMemo(() => createFrameworkProvider(props.configure), [props.configure]);
12
+ return (
13
+ <Suspense fallback={props.fallback}>
14
+ <Component>{props.children}</Component>
15
+ </Suspense>
16
+ );
17
+ };
18
+
19
+ export default Framework;
package/src/index.tsx CHANGED
@@ -7,4 +7,6 @@ export type { Fusion } from '@equinor/fusion-framework';
7
7
  export { FusionConfigurator } from '@equinor/fusion-framework';
8
8
 
9
9
  export { createFrameworkProvider } from './create-framework-provider';
10
- export { FrameworkProvider as default, FrameworkProvider } from './context';
10
+ export { FrameworkProvider } from './context';
11
+
12
+ export { default, Framework } from './Framework';