@equinor/fusion-framework-react-app 4.1.2 → 4.1.4
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 +34 -0
- package/LICENSE +21 -0
- package/dist/esm/render-component.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/create-legacy-app.d.ts +1 -0
- package/dist/types/make-component.d.ts +1 -1
- package/dist/types/render-app.d.ts +2 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +83 -80
- package/src/create-component.tsx +2 -2
- package/src/create-legacy-app.tsx +1 -1
- package/src/make-component.tsx +3 -3
- package/src/navigation/useRouter.ts +1 -1
- package/src/render-component.tsx +3 -1
- package/src/useAppModule.ts +2 -2
- package/src/useAppModules.ts +1 -1
- package/src/version.ts +1 -1
- package/tsconfig.json +3 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { AnyModule } from '@equinor/fusion-framework-module';
|
|
2
3
|
import type { AppModuleInitiator } from '@equinor/fusion-framework-app';
|
|
3
4
|
export declare const createLegacyApp: <TModules extends AnyModule[]>(Component: React.ElementType, configure?: AppModuleInitiator<TModules> | undefined) => () => JSX.Element;
|
|
@@ -12,7 +12,7 @@ export type ComponentRenderer<TFusion extends Fusion = Fusion, TEnv = AppEnv> =
|
|
|
12
12
|
export declare const makeComponent: <TModules extends AnyModule[], TRef extends Fusion<unknown> = Fusion<unknown>, TEnv extends AppEnv = AppEnv>(Component: React.ReactNode, args: {
|
|
13
13
|
fusion: TRef;
|
|
14
14
|
env: TEnv;
|
|
15
|
-
}, configure?: AppModuleInitiator<TModules, TRef, TEnv> | undefined) => React.LazyExoticComponent<() => JSX.Element>;
|
|
15
|
+
}, configure?: AppModuleInitiator<TModules, TRef, TEnv> | undefined) => React.LazyExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
|
|
16
16
|
declare module '@equinor/fusion-framework-module-event' {
|
|
17
17
|
interface FrameworkEventMap {
|
|
18
18
|
onReactAppLoaded: FrameworkEvent<FrameworkEventInit<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { RenderTeardown } from './render-component';
|
|
2
3
|
import type { ComponentRenderArgs } from './create-component';
|
|
3
|
-
export declare const renderApp: (Component: import("react").ElementType<any>, configure?: import("@equinor/fusion-framework-app").AppModuleInitiator<import("@equinor/fusion-framework-module").AnyModule[], import("@equinor/fusion-framework").Fusion<unknown>, import("@equinor/fusion-framework-app").AppEnv> | undefined) => (el: HTMLElement, args: ComponentRenderArgs) => RenderTeardown;
|
|
4
|
+
export declare const renderApp: (Component: import("react").ElementType<any>, configure?: import("@equinor/fusion-framework-app").AppModuleInitiator<import("@equinor/fusion-framework-module").AnyModule[], import("@equinor/fusion-framework-react").Fusion<unknown>, import("@equinor/fusion-framework-app").AppEnv> | undefined) => (el: HTMLElement, args: ComponentRenderArgs) => RenderTeardown;
|
|
4
5
|
export default renderApp;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.1.
|
|
1
|
+
export declare const version = "4.1.4";
|
package/package.json
CHANGED
|
@@ -1,86 +1,89 @@
|
|
|
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
|
-
|
|
2
|
+
"name": "@equinor/fusion-framework-react-app",
|
|
3
|
+
"version": "4.1.4",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "dist/esm/index.js",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": "./dist/esm/index.js",
|
|
8
|
+
"./bookmark": "./dist/esm/bookmark/index.js",
|
|
9
|
+
"./context": "./dist/esm/context/index.js",
|
|
10
|
+
"./framework": "./dist/esm/framework/index.js",
|
|
11
|
+
"./http": "./dist/esm/http/index.js",
|
|
12
|
+
"./navigation": "./dist/esm/navigation/index.js"
|
|
13
|
+
},
|
|
14
|
+
"types": "./dist/types/index.d.ts",
|
|
15
|
+
"typesVersions": {
|
|
16
|
+
"*": {
|
|
17
|
+
"bookmark": [
|
|
18
|
+
"dist/types/bookmark/index.d.ts"
|
|
19
|
+
],
|
|
20
|
+
"context": [
|
|
21
|
+
"dist/types/context/index.d.ts"
|
|
22
|
+
],
|
|
23
|
+
"framework": [
|
|
24
|
+
"dist/types/framework/index.d.ts"
|
|
25
|
+
],
|
|
26
|
+
"http": [
|
|
27
|
+
"dist/types/http/index.d.ts"
|
|
28
|
+
],
|
|
29
|
+
"navigation": [
|
|
30
|
+
"dist/types/navigation/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"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@equinor/fusion-framework-module-app": "^5.2.3",
|
|
47
|
+
"@equinor/fusion-framework-module": "^4.2.3",
|
|
48
|
+
"@equinor/fusion-framework-app": "^7.1.2",
|
|
49
|
+
"@equinor/fusion-framework-module-navigation": "^3.0.4",
|
|
50
|
+
"@equinor/fusion-framework-react-module": "^3.0.4",
|
|
51
|
+
"@equinor/fusion-framework-react": "^5.2.5",
|
|
52
|
+
"@equinor/fusion-framework-react-module-http": "^3.0.4"
|
|
53
|
+
},
|
|
54
|
+
"devDependencies": {
|
|
55
|
+
"@types/react": "^18.2.20",
|
|
56
|
+
"@types/react-dom": "^18.2.7",
|
|
57
|
+
"react": "^18.2.0",
|
|
58
|
+
"react-dom": "^18.2.0",
|
|
59
|
+
"typescript": "^5.1.3",
|
|
60
|
+
"@equinor/fusion-framework-module-event": "^4.0.4",
|
|
61
|
+
"@equinor/fusion-framework-react-module-bookmark": "^2.0.15",
|
|
62
|
+
"@equinor/fusion-framework-react-module-context": "^6.0.11"
|
|
63
|
+
},
|
|
64
|
+
"peerDependencies": {
|
|
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"
|
|
68
|
+
},
|
|
69
|
+
"peerDependenciesMeta": {
|
|
70
|
+
"@equinor/fusion-framework-react-module-context": {
|
|
71
|
+
"optional": true
|
|
48
72
|
},
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
"@equinor/fusion-framework-module-navigation": "^3.0.1",
|
|
52
|
-
"@equinor/fusion-framework-react": "^5.2.2",
|
|
53
|
-
"@equinor/fusion-framework-react-module-http": "^3.0.3"
|
|
73
|
+
"@equinor/fusion-framework-module-navigation": {
|
|
74
|
+
"optional": true
|
|
54
75
|
},
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
"@equinor/fusion-framework-react-module-context": "^6.0.9",
|
|
58
|
-
"@types/react": "^17.0.11",
|
|
59
|
-
"@types/react-dom": "^17.0.7",
|
|
60
|
-
"react": "^17.0.2",
|
|
61
|
-
"react-dom": "^17.0.2",
|
|
62
|
-
"typescript": "^5.1.3"
|
|
76
|
+
"@equinor/fusion-framework-react-module-bookmark": {
|
|
77
|
+
"optional": true
|
|
63
78
|
},
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
"react": "^17.0.0 || ^18.0.0",
|
|
67
|
-
"react-dom": "^17.0.0 || ^18.0.0"
|
|
79
|
+
"@types/react": {
|
|
80
|
+
"optional": true
|
|
68
81
|
},
|
|
69
|
-
"
|
|
70
|
-
|
|
71
|
-
"optional": true
|
|
72
|
-
},
|
|
73
|
-
"@equinor/fusion-framework-module-navigation": {
|
|
74
|
-
"optional": true
|
|
75
|
-
},
|
|
76
|
-
"@equinor/fusion-framework-react-module-bookmark": {
|
|
77
|
-
"optional": true
|
|
78
|
-
},
|
|
79
|
-
"@types/react": {
|
|
80
|
-
"optional": true
|
|
81
|
-
},
|
|
82
|
-
"react-dom": {
|
|
83
|
-
"optional": true
|
|
84
|
-
}
|
|
82
|
+
"react-dom": {
|
|
83
|
+
"optional": true
|
|
85
84
|
}
|
|
86
|
-
}
|
|
85
|
+
},
|
|
86
|
+
"scripts": {
|
|
87
|
+
"build": "tsc -b"
|
|
88
|
+
}
|
|
89
|
+
}
|
package/src/create-component.tsx
CHANGED
|
@@ -19,7 +19,7 @@ export type ComponentRenderArgs<TFusion extends Fusion = Fusion, TEnv = AppEnv>
|
|
|
19
19
|
|
|
20
20
|
export type ComponentRenderer<TFusion extends Fusion = Fusion, TEnv = AppEnv> = (
|
|
21
21
|
fusion: TFusion,
|
|
22
|
-
env: TEnv
|
|
22
|
+
env: TEnv,
|
|
23
23
|
) => React.LazyExoticComponent<React.ComponentType>;
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -75,7 +75,7 @@ export type ComponentRenderer<TFusion extends Fusion = Fusion, TEnv = AppEnv> =
|
|
|
75
75
|
export const createComponent =
|
|
76
76
|
<TModules extends Array<AnyModule>, TRef extends Fusion = Fusion, TEnv extends AppEnv = AppEnv>(
|
|
77
77
|
Component: React.ElementType,
|
|
78
|
-
configure?: AppModuleInitiator<TModules, TRef, TEnv
|
|
78
|
+
configure?: AppModuleInitiator<TModules, TRef, TEnv>,
|
|
79
79
|
): ComponentRenderer<TRef, TEnv> =>
|
|
80
80
|
(fusion, env) =>
|
|
81
81
|
lazy(async () => {
|
|
@@ -10,7 +10,7 @@ import { AppModule } from '@equinor/fusion-framework-module-app';
|
|
|
10
10
|
|
|
11
11
|
export const createLegacyApp = <TModules extends Array<AnyModule>>(
|
|
12
12
|
Component: React.ElementType,
|
|
13
|
-
configure?: AppModuleInitiator<TModules
|
|
13
|
+
configure?: AppModuleInitiator<TModules>,
|
|
14
14
|
) => {
|
|
15
15
|
const LegacyComponent = (): JSX.Element => {
|
|
16
16
|
const fusion = useFramework<[AppModule]>();
|
package/src/make-component.tsx
CHANGED
|
@@ -19,7 +19,7 @@ export type ComponentRenderArgs<TFusion extends Fusion = Fusion, TEnv = AppEnv>
|
|
|
19
19
|
|
|
20
20
|
export type ComponentRenderer<TFusion extends Fusion = Fusion, TEnv = AppEnv> = (
|
|
21
21
|
fusion: TFusion,
|
|
22
|
-
env: TEnv
|
|
22
|
+
env: TEnv,
|
|
23
23
|
) => React.LazyExoticComponent<React.ComponentType>;
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -38,11 +38,11 @@ export type ComponentRenderer<TFusion extends Fusion = Fusion, TEnv = AppEnv> =
|
|
|
38
38
|
export const makeComponent = <
|
|
39
39
|
TModules extends Array<AnyModule>,
|
|
40
40
|
TRef extends Fusion = Fusion,
|
|
41
|
-
TEnv extends AppEnv = AppEnv
|
|
41
|
+
TEnv extends AppEnv = AppEnv,
|
|
42
42
|
>(
|
|
43
43
|
Component: React.ReactNode,
|
|
44
44
|
args: { fusion: TRef; env: TEnv },
|
|
45
|
-
configure?: AppModuleInitiator<TModules, TRef, TEnv
|
|
45
|
+
configure?: AppModuleInitiator<TModules, TRef, TEnv>,
|
|
46
46
|
) =>
|
|
47
47
|
lazy(async () => {
|
|
48
48
|
const init = configureModules<TModules, TRef, TEnv>(configure);
|
|
@@ -9,7 +9,7 @@ import { type INavigationProvider } from '@equinor/fusion-framework-module-navig
|
|
|
9
9
|
* @param routes router objects __(must be static | memorized)__
|
|
10
10
|
*/
|
|
11
11
|
export const useRouter = (
|
|
12
|
-
routes: Parameters<INavigationProvider['createRouter']>[0]
|
|
12
|
+
routes: Parameters<INavigationProvider['createRouter']>[0],
|
|
13
13
|
): ReturnType<INavigationProvider['createRouter']> => {
|
|
14
14
|
const provider = useNavigationModule();
|
|
15
15
|
return useMemo(() => provider.createRouter(routes), [provider, routes]);
|
package/src/render-component.tsx
CHANGED
|
@@ -14,15 +14,17 @@ export const renderComponent = (renderer: ComponentRenderer) => {
|
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
const render = (el: Element, Component: FunctionComponent): RenderTeardown => {
|
|
17
|
+
// eslint-disable-next-line react/no-deprecated
|
|
17
18
|
ReactDOM.render(
|
|
18
19
|
<StrictMode>
|
|
19
20
|
<Suspense fallback={<p>loading app</p>}>
|
|
20
21
|
<Component />
|
|
21
22
|
</Suspense>
|
|
22
23
|
</StrictMode>,
|
|
23
|
-
el
|
|
24
|
+
el,
|
|
24
25
|
);
|
|
25
26
|
return () => {
|
|
27
|
+
// eslint-disable-next-line react/no-deprecated
|
|
26
28
|
ReactDOM.unmountComponentAtNode(el);
|
|
27
29
|
};
|
|
28
30
|
};
|
package/src/useAppModule.ts
CHANGED
|
@@ -13,9 +13,9 @@ import { useAppModules } from './useAppModules';
|
|
|
13
13
|
*/
|
|
14
14
|
export const useAppModule = <
|
|
15
15
|
TType extends AnyModule | unknown = unknown,
|
|
16
|
-
TKey extends string = ModuleKey<ModuleTypes<AppModules<[TType]
|
|
16
|
+
TKey extends string = ModuleKey<ModuleTypes<AppModules<[TType]>>>,
|
|
17
17
|
>(
|
|
18
|
-
module: TKey
|
|
18
|
+
module: TKey,
|
|
19
19
|
): TType extends AnyModule
|
|
20
20
|
? ModuleType<TType>
|
|
21
21
|
: AppModulesInstance[Extract<keyof AppModulesInstance, TKey>] => {
|
package/src/useAppModules.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { AnyModule } from '@equinor/fusion-framework-module';
|
|
|
3
3
|
import { useModules } from '@equinor/fusion-framework-react-module';
|
|
4
4
|
|
|
5
5
|
export const useAppModules = <
|
|
6
|
-
T extends Array<AnyModule> | unknown = unknown
|
|
6
|
+
T extends Array<AnyModule> | unknown = unknown,
|
|
7
7
|
>(): AppModulesInstance<T> => useModules<AppModulesInstance<T>>();
|
|
8
8
|
|
|
9
9
|
export default useAppModules;
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '4.1.
|
|
2
|
+
export const version = '4.1.4';
|