@equinor/fusion-framework-react-app 0.4.2 → 0.5.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,33 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 0.5.0 (2022-08-22)
7
+
8
+
9
+ ### Features
10
+
11
+ * **react-app:** use event module ([21cf7f9](https://github.com/equinor/fusion-framework/commit/21cf7f98eafb8a4d970f3d2d9f56d56046da1321))
12
+
13
+
14
+
15
+
16
+
17
+ ## [0.4.4](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-react-app@0.4.3...@equinor/fusion-framework-react-app@0.4.4) (2022-08-19)
18
+
19
+ **Note:** Version bump only for package @equinor/fusion-framework-react-app
20
+
21
+
22
+
23
+
24
+
25
+ ## 0.4.3 (2022-08-19)
26
+
27
+ **Note:** Version bump only for package @equinor/fusion-framework-react-app
28
+
29
+
30
+
31
+
32
+
6
33
  ## [0.4.2](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-react-app@0.4.1...@equinor/fusion-framework-react-app@0.4.2) (2022-08-15)
7
34
 
8
35
  **Note:** Version bump only for package @equinor/fusion-framework-react-app
@@ -1,2 +1,2 @@
1
- export { useAppConfig, useAppConfig$, } from '@equinor/fusion-framework-react-module-app-config';
1
+ export { useAppConfig, useAppConfig$ } from '@equinor/fusion-framework-react-module-app-config';
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,YAAY,EAEZ,aAAa,GAEhB,MAAM,mDAAmD,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/config/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mDAAmD,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { lazy } from 'react';
3
- import FrameworkProvider from '@equinor/fusion-framework-react';
4
- import { appModules } from './modules';
5
- import { createModuleProvider } from '@equinor/fusion-framework-react-module';
3
+ import { FrameworkProvider } from '@equinor/fusion-framework-react';
4
+ import { initializeAppModules } from '@equinor/fusion-framework-app';
5
+ import { ModuleProvider as AppModuleProvider } from '@equinor/fusion-framework-react-module';
6
6
  export const createApp = (Component, configure, modules) => (fusion, env) => lazy(async () => {
7
7
  modules ??= [];
8
8
  const configurator = async (config) => {
@@ -10,9 +10,14 @@ export const createApp = (Component, configure, modules) => (fusion, env) => laz
10
10
  await Promise.resolve(configure(config, fusion, env));
11
11
  }
12
12
  };
13
- const AppModuleProvider = await createModuleProvider(configurator, appModules.concat(modules), fusion.modules);
13
+ const appInitiator = initializeAppModules(configurator, modules ?? []);
14
+ const appModules = await appInitiator(fusion, env);
15
+ appModules.event.dispatchEvent('onReactAppLoaded', {
16
+ detail: { modules, fusion },
17
+ source: Component,
18
+ });
14
19
  return {
15
- default: () => (_jsx(FrameworkProvider, { value: fusion, children: _jsx(AppModuleProvider, { children: _jsx(Component, {}) }) })),
20
+ default: () => (_jsx(FrameworkProvider, { value: fusion, children: _jsx(AppModuleProvider, { value: appModules, children: _jsx(Component, {}) }) })),
16
21
  };
17
22
  });
18
23
  export default createApp;
@@ -1 +1 @@
1
- {"version":3,"file":"create-app.js","sourceRoot":"","sources":["../../src/create-app.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAG7B,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAIhE,OAAO,EAAE,UAAU,EAAc,MAAM,WAAW,CAAC;AAEnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAyE9E,MAAM,CAAC,MAAM,SAAS,GAClB,CACI,SAA8B,EAC9B,SAAqC,EACrC,O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SAAS,EAAE;YACX,MAAM,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;SACzD;IACL,CAAC,CAAC;IAEF,MAAM,YAAY,GAAG,oBAAoB,CAAC,YAAY,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC;IAEvE,MAAM,UAAU,GAAG,MAAM,YAAY,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnD,UAAU,CAAC,KAAK,CAAC,aAAa,CAAC,kBAAkB,EAAE;QAC/C,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAC3B,MAAM,EAAE,SAAS;KACpB,CAAC,CAAC;IACH,OAAO;QACH,OAAO,EAAE,GAAG,EAAE,CAAC,CACX,KAAC,iBAAiB,IAAC,KAAK,EAAE,MAAM,YAC5B,KAAC,iBAAiB,IAAC,KAAK,EAAE,UAAU,YAChC,KAAC,SAAS,KAAG,GACG,GACJ,CACvB;KACJ,CAAC;AACN,CAAC,CAAC,CAAC;AAaX,eAAe,SAAS,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { useMemo } from 'react';
2
- import { useAppModule } from '../modules';
2
+ import { useAppModule } from '../useAppModule';
3
3
  export const useHttpClient = (name) => {
4
4
  const http = useAppModule('http');
5
5
  const client = useMemo(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"useHttpClient.js","sourceRoot":"","sources":["../../../src/http/useHttpClient.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAa1C,MAAM,CAAC,MAAM,aAAa,GAAG,CAA6C,IAAY,EAAS,EAAE;IAC7F,MAAM,IAAI,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE;QACxB,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;YACtB,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;SAClC;QACD,MAAM,KAAK,CAAC,iCAAiC,IAAI,GAAG,CAAC,CAAC;IAC1D,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,OAAO,MAA0B,CAAC;AACtC,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"useHttpClient.js","sourceRoot":"","sources":["../../../src/http/useHttpClient.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAa/C,MAAM,CAAC,MAAM,aAAa,GAAG,CAA6C,IAAY,EAAS,EAAE;IAC7F,MAAM,IAAI,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAClC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE;QACxB,IAAI,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE;YACtB,OAAO,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;SAClC;QACD,MAAM,KAAK,CAAC,iCAAiC,IAAI,GAAG,CAAC,CAAC;IAC1D,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;IAEX,OAAO,MAA0B,CAAC;AACtC,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
package/dist/esm/index.js CHANGED
@@ -1,3 +1,6 @@
1
- export { createApp, default } from './create-app';
2
- export { appModules, useAppModule, useAppModules } from './modules';
1
+ export { appModules } from '@equinor/fusion-framework-app';
2
+ export { useAppModule } from './useAppModule';
3
+ export { useAppModules } from './useAppModules';
4
+ export { createApp } from './create-app';
5
+ export { default } from './create-app';
3
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAmB,SAAS,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACnE,OAAO,EAAkC,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAS3D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { useAppModules } from './useAppModules';
2
+ export const useAppModule = (module) => useAppModules()[module];
3
+ export default useAppModule;
4
+ //# sourceMappingURL=useAppModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAppModule.js","sourceRoot":"","sources":["../../src/useAppModule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,CAAC,MAAM,YAAY,GAAG,CACxB,MAAY,EACY,EAAE,CAAC,aAAa,EAAE,CAAC,MAAM,CAAC,CAAC;AAEvD,eAAe,YAAY,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { useModules } from '@equinor/fusion-framework-react-module';
2
+ export const useAppModules = (useModules);
3
+ export default useAppModules;
4
+ //# sourceMappingURL=useAppModules.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAppModules.js","sourceRoot":"","sources":["../../src/useAppModules.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE,MAAM,CAAC,MAAM,aAAa,GAAG,CAAA,UAA8B,CAAA,CAAC;AAE5D,eAAe,aAAa,CAAC"}