@equinor/fusion-framework-react-app 1.0.19 → 1.0.21

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,2 +1,2 @@
1
- export { useAppConfig, useAppConfig$ } from '@equinor/fusion-framework-react-module-app-config';
2
- export type { AppConfig, UseAppConfigResult, UseAppConfigStreamResult, } from '@equinor/fusion-framework-react-module-app-config';
1
+ export { useAppConfig } from '@equinor/fusion-framework-react-module-app-config';
2
+ export type { AppConfig } from '@equinor/fusion-framework-react-module-app-config';
@@ -1,14 +1,15 @@
1
1
  import React from 'react';
2
2
  import type { Fusion } from '@equinor/fusion-framework-react';
3
- import type { AppManifest, AppModuleInitiator, AppModulesInstance } from '@equinor/fusion-framework-app';
3
+ import { AppEnv } from '@equinor/fusion-framework-app';
4
+ import type { AppModuleInitiator, AppModulesInstance } from '@equinor/fusion-framework-app';
4
5
  import type { AnyModule } from '@equinor/fusion-framework-module';
5
6
  import type { FrameworkEvent, FrameworkEventInit } from '@equinor/fusion-framework-module-event';
6
- export declare type ComponentRenderArgs<TFusion extends Fusion = Fusion, TManifest extends AppManifest = AppManifest> = {
7
+ export declare type ComponentRenderArgs<TFusion extends Fusion = Fusion, TEnv = AppEnv> = {
7
8
  fusion: TFusion;
8
- env: TManifest;
9
+ env: TEnv;
9
10
  };
10
- export declare type ComponentRenderer<TFusion extends Fusion = Fusion, TManifest extends AppManifest = AppManifest> = (fusion: TFusion, env: TManifest) => React.LazyExoticComponent<React.ComponentType>;
11
- export declare const createComponent: <TModules extends AnyModule[], TRef extends Fusion<[]> = Fusion<[]>, TManifest extends AppManifest = AppManifest>(Component: React.ComponentType, configure?: AppModuleInitiator<TModules, TRef, TManifest> | undefined) => ComponentRenderer<TRef, TManifest>;
11
+ export declare type ComponentRenderer<TFusion extends Fusion = Fusion, TEnv = AppEnv> = (fusion: TFusion, env: TEnv) => React.LazyExoticComponent<React.ComponentType>;
12
+ export declare const createComponent: <TModules extends AnyModule[], TRef extends Fusion<[]> = Fusion<[]>, TEnv extends AppEnv<unknown, unknown> = AppEnv<unknown, unknown>>(Component: React.ComponentType, configure?: AppModuleInitiator<TModules, TRef, TEnv> | undefined) => ComponentRenderer<TRef, TEnv>;
12
13
  declare module '@equinor/fusion-framework-module-event' {
13
14
  interface FrameworkEventMap {
14
15
  onReactAppLoaded: FrameworkEvent<FrameworkEventInit<{
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import type { AnyModule } from '@equinor/fusion-framework-module';
3
3
  import type { AppModuleInitiator } from '@equinor/fusion-framework-app';
4
- export declare const createLegacyApp: <TModules extends AnyModule[]>(Component: React.ComponentType, configure?: AppModuleInitiator<TModules, import("@equinor/fusion-framework").Fusion<[]>, import("@equinor/fusion-framework-app").AppManifest> | undefined) => () => JSX.Element;
4
+ export declare const createLegacyApp: <TModules extends AnyModule[]>(Component: React.ComponentType, configure?: AppModuleInitiator<TModules, import("@equinor/fusion-framework").Fusion<[]>, import("@equinor/fusion-framework-app").AppEnv<unknown, unknown>> | undefined) => () => JSX.Element;
@@ -5,4 +5,5 @@ export { renderApp } from './render-app';
5
5
  export { createComponent } from './create-component';
6
6
  export { renderComponent } from './render-component';
7
7
  export { createLegacyApp } from './create-legacy-app';
8
+ export type { ComponentRenderArgs, ComponentRenderer } from './create-component';
8
9
  export { default } from './render-app';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { RenderTeardown } from './render-component';
3
3
  import type { ComponentRenderArgs } from './create-component';
4
- export declare const renderApp: (Component: import("react").ComponentType<{}>, configure?: import("@equinor/fusion-framework-app").AppModuleInitiator<import("@equinor/fusion-framework-module").AnyModule[], import("@equinor/fusion-framework").Fusion<[]>, import("@equinor/fusion-framework-app").AppManifest> | undefined) => (el: HTMLElement, args: ComponentRenderArgs) => RenderTeardown;
4
+ export declare const renderApp: (Component: import("react").ComponentType<{}>, configure?: import("@equinor/fusion-framework-app").AppModuleInitiator<import("@equinor/fusion-framework-module").AnyModule[], import("@equinor/fusion-framework").Fusion<[]>, import("@equinor/fusion-framework-app").AppEnv<unknown, unknown>> | undefined) => (el: HTMLElement, args: ComponentRenderArgs) => RenderTeardown;
5
5
  export default renderApp;
package/package.json CHANGED
@@ -1,71 +1,71 @@
1
1
  {
2
- "name": "@equinor/fusion-framework-react-app",
3
- "version": "1.0.19",
4
- "description": "",
5
- "main": "dist/esm/index.js",
6
- "exports": {
7
- ".": "./dist/esm/index.js",
8
- "./config": "./dist/esm/config/index.js",
9
- "./framework": "./dist/esm/framework/index.js",
10
- "./http": "./dist/esm/http/index.js"
11
- },
12
- "types": "./dist/types/index.d.ts",
13
- "typesVersions": {
14
- "*": {
15
- "config": [
16
- "dist/types/config/index.d.ts"
17
- ],
18
- "framework": [
19
- "dist/types/framework/index.d.ts"
20
- ],
21
- "http": [
22
- "dist/types/http/index.d.ts"
23
- ]
24
- }
25
- },
26
- "scripts": {
27
- "build": "npm run build:typescript",
28
- "build:typescript": "tsc -b --verbose"
29
- },
30
- "keywords": [],
31
- "author": "",
32
- "license": "ISC",
33
- "publishConfig": {
34
- "access": "public"
35
- },
36
- "repository": {
37
- "type": "git",
38
- "url": "git+https://github.com/equinor/fusion-framework.git",
39
- "directory": "packages/react"
40
- },
41
- "dependencies": {
42
- "@equinor/fusion-framework-app": "^3.0.7",
43
- "@equinor/fusion-framework-module": "^1.2.5",
44
- "@equinor/fusion-framework-module-event": "^1.0.12",
45
- "@equinor/fusion-framework-module-msal": "^1.0.13",
46
- "@equinor/fusion-framework-react": "^1.0.16",
47
- "@equinor/fusion-framework-react-module-app-config": "^1.0.14",
48
- "@equinor/fusion-framework-react-module-http": "^1.0.13"
49
- },
50
- "devDependencies": {
51
- "@types/react": "^17.0.11",
52
- "@types/react-dom": "^17.0.7",
53
- "react": "^17.0.2",
54
- "react-dom": "^17.0.2",
55
- "typescript": "^4.8.4"
56
- },
57
- "peerDependencies": {
58
- "@types/react": "^16.9.0 || ^17.0.0 || ^18.0.0",
59
- "react": "^16.9.0 || ^17.0.0 || ^18.0.0",
60
- "react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0"
61
- },
62
- "peerDependenciesMeta": {
63
- "@types/react": {
64
- "optional": true
2
+ "name": "@equinor/fusion-framework-react-app",
3
+ "version": "1.0.21",
4
+ "description": "",
5
+ "main": "dist/esm/index.js",
6
+ "exports": {
7
+ ".": "./dist/esm/index.js",
8
+ "./config": "./dist/esm/config/index.js",
9
+ "./framework": "./dist/esm/framework/index.js",
10
+ "./http": "./dist/esm/http/index.js"
65
11
  },
66
- "react-dom": {
67
- "optional": true
68
- }
69
- },
70
- "gitHead": "2dc8f66fd10dba532dba79e7b0b95e9953c51a29"
12
+ "types": "./dist/types/index.d.ts",
13
+ "typesVersions": {
14
+ "*": {
15
+ "config": [
16
+ "dist/types/config/index.d.ts"
17
+ ],
18
+ "framework": [
19
+ "dist/types/framework/index.d.ts"
20
+ ],
21
+ "http": [
22
+ "dist/types/http/index.d.ts"
23
+ ]
24
+ }
25
+ },
26
+ "scripts": {
27
+ "build": "npm run build:typescript",
28
+ "build:typescript": "tsc -b --verbose"
29
+ },
30
+ "keywords": [],
31
+ "author": "",
32
+ "license": "ISC",
33
+ "publishConfig": {
34
+ "access": "public"
35
+ },
36
+ "repository": {
37
+ "type": "git",
38
+ "url": "git+https://github.com/equinor/fusion-framework.git",
39
+ "directory": "packages/react"
40
+ },
41
+ "dependencies": {
42
+ "@equinor/fusion-framework-app": "^3.0.9",
43
+ "@equinor/fusion-framework-module": "^1.2.6",
44
+ "@equinor/fusion-framework-module-event": "^1.0.13",
45
+ "@equinor/fusion-framework-module-msal": "^1.0.14",
46
+ "@equinor/fusion-framework-react": "^1.0.17",
47
+ "@equinor/fusion-framework-react-module-app-config": "^1.0.15",
48
+ "@equinor/fusion-framework-react-module-http": "^1.0.14"
49
+ },
50
+ "devDependencies": {
51
+ "@types/react": "^17.0.11",
52
+ "@types/react-dom": "^17.0.7",
53
+ "react": "^17.0.2",
54
+ "react-dom": "^17.0.2",
55
+ "typescript": "^4.8.4"
56
+ },
57
+ "peerDependencies": {
58
+ "@types/react": "^16.9.0 || ^17.0.0 || ^18.0.0",
59
+ "react": "^16.9.0 || ^17.0.0 || ^18.0.0",
60
+ "react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0"
61
+ },
62
+ "peerDependenciesMeta": {
63
+ "@types/react": {
64
+ "optional": true
65
+ },
66
+ "react-dom": {
67
+ "optional": true
68
+ }
69
+ },
70
+ "gitHead": "2ad4d827ff390bbc3e45c2962598df918457f6e6"
71
71
  }
@@ -1,7 +1,3 @@
1
- export { useAppConfig, useAppConfig$ } from '@equinor/fusion-framework-react-module-app-config';
1
+ export { useAppConfig } from '@equinor/fusion-framework-react-module-app-config';
2
2
 
3
- export type {
4
- AppConfig,
5
- UseAppConfigResult,
6
- UseAppConfigStreamResult,
7
- } from '@equinor/fusion-framework-react-module-app-config';
3
+ export type { AppConfig } from '@equinor/fusion-framework-react-module-app-config';
@@ -3,12 +3,8 @@ import React, { lazy } from 'react';
3
3
  import { FrameworkProvider } from '@equinor/fusion-framework-react';
4
4
  import type { Fusion } from '@equinor/fusion-framework-react';
5
5
 
6
- import { configureModules } from '@equinor/fusion-framework-app';
7
- import type {
8
- AppManifest,
9
- AppModuleInitiator,
10
- AppModulesInstance,
11
- } from '@equinor/fusion-framework-app';
6
+ import { AppEnv, configureModules } from '@equinor/fusion-framework-app';
7
+ import type { AppModuleInitiator, AppModulesInstance } from '@equinor/fusion-framework-app';
12
8
 
13
9
  import type { AnyModule } from '@equinor/fusion-framework-module';
14
10
 
@@ -16,15 +12,15 @@ import type { FrameworkEvent, FrameworkEventInit } from '@equinor/fusion-framewo
16
12
 
17
13
  import { ModuleProvider as AppModuleProvider } from '@equinor/fusion-framework-react-module';
18
14
 
19
- export type ComponentRenderArgs<
20
- TFusion extends Fusion = Fusion,
21
- TManifest extends AppManifest = AppManifest
22
- > = { fusion: TFusion; env: TManifest };
15
+ export type ComponentRenderArgs<TFusion extends Fusion = Fusion, TEnv = AppEnv> = {
16
+ fusion: TFusion;
17
+ env: TEnv;
18
+ };
23
19
 
24
- export type ComponentRenderer<
25
- TFusion extends Fusion = Fusion,
26
- TManifest extends AppManifest = AppManifest
27
- > = (fusion: TFusion, env: TManifest) => React.LazyExoticComponent<React.ComponentType>;
20
+ export type ComponentRenderer<TFusion extends Fusion = Fusion, TEnv = AppEnv> = (
21
+ fusion: TFusion,
22
+ env: TEnv
23
+ ) => React.LazyExoticComponent<React.ComponentType>;
28
24
 
29
25
  /**
30
26
  * Creates an lazy loading Component which configures modules
@@ -76,20 +72,16 @@ export type ComponentRenderer<
76
72
  * @param modules - required modules for application
77
73
  */
78
74
  export const createComponent =
79
- <
80
- TModules extends Array<AnyModule>,
81
- TRef extends Fusion = Fusion,
82
- TManifest extends AppManifest = AppManifest
83
- >(
75
+ <TModules extends Array<AnyModule>, TRef extends Fusion = Fusion, TEnv extends AppEnv = AppEnv>(
84
76
  Component: React.ComponentType,
85
- configure?: AppModuleInitiator<TModules, TRef, TManifest>
86
- ): ComponentRenderer<TRef, TManifest> =>
77
+ configure?: AppModuleInitiator<TModules, TRef, TEnv>
78
+ ): ComponentRenderer<TRef, TEnv> =>
87
79
  (fusion, env) =>
88
80
  lazy(async () => {
89
- const init = configureModules<TModules, TRef, TManifest>(configure);
81
+ const init = configureModules<TModules, TRef, TEnv>(configure);
90
82
  const modules = (await init({
91
83
  fusion,
92
- manifest: env,
84
+ env,
93
85
  })) as unknown as AppModulesInstance;
94
86
 
95
87
  modules.event.dispatchEvent('onReactAppLoaded', {
@@ -15,7 +15,7 @@ export const createLegacyApp = <TModules extends Array<AnyModule>>(
15
15
  const fusion = useFramework();
16
16
  const RenderComponent = useMemo(() => {
17
17
  const creator = createComponent(Component, configure);
18
- return creator(fusion, { name: 'legacy' });
18
+ return creator(fusion, { manifest: { name: 'legacy' } });
19
19
  }, []);
20
20
  return (
21
21
  <Suspense fallback={<p>loading app</p>}>
package/src/index.ts CHANGED
@@ -18,4 +18,6 @@ export { createComponent } from './create-component';
18
18
  export { renderComponent } from './render-component';
19
19
  export { createLegacyApp } from './create-legacy-app';
20
20
 
21
+ export type { ComponentRenderArgs, ComponentRenderer } from './create-component';
22
+
21
23
  export { default } from './render-app';