@equinor/fusion-framework-react 7.1.4 → 7.2.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 +30 -0
- package/dist/esm/Framework.js +4 -1
- package/dist/esm/Framework.js.map +1 -1
- package/dist/esm/app/useCurrentAppModules.js +1 -1
- package/dist/esm/app/useCurrentAppModules.js.map +1 -1
- package/dist/esm/create-framework-provider.js +6 -6
- package/dist/esm/create-framework-provider.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/Framework.d.ts +2 -2
- package/dist/types/create-framework-provider.d.ts +4 -4
- package/dist/types/version.d.ts +1 -1
- package/package.json +12 -12
- package/src/Framework.tsx +6 -3
- package/src/app/useCurrentAppModules.ts +1 -1
- package/src/create-framework-provider.tsx +13 -8
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 7.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#2425](https://github.com/equinor/fusion-framework/pull/2425) [`843edd9`](https://github.com/equinor/fusion-framework/commit/843edd96f2a01ebd814766105902977cdc1cdf8e) Thanks [@odinr](https://github.com/odinr)! - These changes ensure that the `Framework` component and `createFrameworkProvider` function are consistent with the updated configuration approach and support module instances from the parent context.
|
|
8
|
+
|
|
9
|
+
**Updated Framework Component:**
|
|
10
|
+
|
|
11
|
+
- Added `useModules` hook to import modules from the parent context.
|
|
12
|
+
- Updated the `createFrameworkProvider` function to accept a `ref` parameter for module instances.
|
|
13
|
+
|
|
14
|
+
**Updated create-framework-provider Function:**
|
|
15
|
+
|
|
16
|
+
- Added `ref` parameter to the `createFrameworkProvider` function to support module instances.
|
|
17
|
+
- Updated the example usage in the documentation to reflect the changes.
|
|
18
|
+
|
|
19
|
+
**Misc:**
|
|
20
|
+
|
|
21
|
+
- Replaced deprecated import of `FusionConfigurator` with `FrameworkConfigurator` (renaming).
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [[`75d676d`](https://github.com/equinor/fusion-framework/commit/75d676d2c7919f30e036b5ae97c4d814c569aa87), [`00d5e9c`](https://github.com/equinor/fusion-framework/commit/00d5e9c632876742c3d2a74efea2f126a0a169d9)]:
|
|
26
|
+
- @equinor/fusion-framework-module@4.3.4
|
|
27
|
+
- @equinor/fusion-framework@7.2.5
|
|
28
|
+
- @equinor/fusion-framework-module-feature-flag@1.1.7
|
|
29
|
+
- @equinor/fusion-framework-react-module@3.1.5
|
|
30
|
+
- @equinor/fusion-framework-react-module-http@6.0.3
|
|
31
|
+
- @equinor/fusion-framework-react-module-signalr@3.0.13
|
|
32
|
+
|
|
3
33
|
## 7.1.4
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/dist/esm/Framework.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createFrameworkProvider } from './create-framework-provider';
|
|
3
3
|
import { Suspense, useMemo } from 'react';
|
|
4
|
+
import { useModules } from '@equinor/fusion-framework-react-module';
|
|
4
5
|
export const Framework = (props) => {
|
|
5
6
|
const { configure, fallback, children } = props;
|
|
6
|
-
|
|
7
|
+
//import modules from parent context
|
|
8
|
+
const ref = useModules();
|
|
9
|
+
const Component = useMemo(() => createFrameworkProvider(configure, ref), [configure, ref]);
|
|
7
10
|
return (_jsx(Suspense, { fallback: fallback, children: _jsx(Component, { children: children }) }));
|
|
8
11
|
};
|
|
9
12
|
export default Framework;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Framework.js","sourceRoot":"","sources":["../../src/Framework.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAgC,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Framework.js","sourceRoot":"","sources":["../../src/Framework.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAgC,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAIpE,MAAM,CAAC,MAAM,SAAS,GAAG,CACrB,KAGE,EACJ,EAAE;IACA,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAChD,oCAAoC;IACpC,MAAM,GAAG,GAAG,UAAU,EAAM,CAAC;IAC7B,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,uBAAuB,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC;IAC3F,OAAO,CACH,KAAC,QAAQ,IAAC,QAAQ,EAAE,QAAQ,YACxB,KAAC,SAAS,cAAE,QAAQ,GAAa,GAC1B,CACd,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -17,7 +17,7 @@ export const useCurrentAppModules = () => {
|
|
|
17
17
|
? currentApp.instance$
|
|
18
18
|
: of(null), [currentApp]);
|
|
19
19
|
const { value: modules, error, complete, } = useObservableState(modules$, {
|
|
20
|
-
initial: currentApp === undefined ? undefined : (_a = currentApp === null || currentApp === void 0 ? void 0 : currentApp.instance) !== null && _a !== void 0 ? _a : null,
|
|
20
|
+
initial: currentApp === undefined ? undefined : ((_a = currentApp === null || currentApp === void 0 ? void 0 : currentApp.instance) !== null && _a !== void 0 ? _a : null),
|
|
21
21
|
});
|
|
22
22
|
return {
|
|
23
23
|
modules,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrentAppModules.js","sourceRoot":"","sources":["../../../src/app/useCurrentAppModules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAc,EAAE,EAAE,MAAM,MAAM,CAAC;AAEtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAIlC,EAAE;;IACA,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,aAAa,EAAY,CAAC;IAClE,MAAM,QAAQ,GAAG,OAAO,CACpB,GAAG,EAAE,CACD,UAAU;QACN,CAAC,CAAE,UAAU,CAAC,SAAsD;QACpE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAClB,CAAC,UAAU,CAAC,CACf,CAAC;IACF,MAAM,EACF,KAAK,EAAE,OAAO,EACd,KAAK,EACL,QAAQ,GACX,GAAG,kBAAkB,CAAC,QAAQ,EAAE;QAC7B,OAAO,EAAE,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ,mCAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"useCurrentAppModules.js","sourceRoot":"","sources":["../../../src/app/useCurrentAppModules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAc,EAAE,EAAE,MAAM,MAAM,CAAC;AAEtC,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAEtE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAIlC,EAAE;;IACA,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,aAAa,EAAY,CAAC;IAClE,MAAM,QAAQ,GAAG,OAAO,CACpB,GAAG,EAAE,CACD,UAAU;QACN,CAAC,CAAE,UAAU,CAAC,SAAsD;QACpE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,EAClB,CAAC,UAAU,CAAC,CACf,CAAC;IACF,MAAM,EACF,KAAK,EAAE,OAAO,EACd,KAAK,EACL,QAAQ,GACX,GAAG,kBAAkB,CAAC,QAAQ,EAAE;QAC7B,OAAO,EAAE,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,QAAQ,mCAAI,IAAI,CAAC;KACjF,CAAC,CAAC;IACH,OAAO;QACH,OAAO;QACP,KAAK,EAAE,KAAK,aAAL,KAAK,cAAL,KAAK,GAAI,QAAQ;QACxB,QAAQ;KACX,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
import { lazy } from 'react';
|
|
12
12
|
import initFusion from '@equinor/fusion-framework';
|
|
13
|
-
import {
|
|
13
|
+
import { FrameworkConfigurator } from '@equinor/fusion-framework';
|
|
14
14
|
import { FrameworkProvider } from './context';
|
|
15
15
|
import { ModuleProvider } from '@equinor/fusion-framework-react-module';
|
|
16
16
|
/**
|
|
@@ -21,7 +21,7 @@ import { ModuleProvider } from '@equinor/fusion-framework-react-module';
|
|
|
21
21
|
* @param configurator - callback for configuring modules
|
|
22
22
|
* @example
|
|
23
23
|
* ```tsx
|
|
24
|
-
* const config:
|
|
24
|
+
* const config: FrameworkConfigurator = (config) => {}
|
|
25
25
|
* const Portal = () => {
|
|
26
26
|
* const Framework = createFrameworkProvider(config);
|
|
27
27
|
* return (
|
|
@@ -32,10 +32,10 @@ import { ModuleProvider } from '@equinor/fusion-framework-react-module';
|
|
|
32
32
|
* };
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
export const createFrameworkProvider = (cb) => lazy(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
-
const configurator = new
|
|
37
|
-
yield cb(configurator);
|
|
38
|
-
const framework = yield initFusion(configurator);
|
|
35
|
+
export const createFrameworkProvider = (cb, ref) => lazy(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
const configurator = new FrameworkConfigurator();
|
|
37
|
+
yield cb(configurator, ref);
|
|
38
|
+
const framework = yield initFusion(configurator, ref);
|
|
39
39
|
return {
|
|
40
40
|
default: ({ children }) => (_jsx(FrameworkProvider, { value: framework, children: _jsx(ModuleProvider, { value: framework.modules, children: children }) })),
|
|
41
41
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-framework-provider.js","sourceRoot":"","sources":["../../src/create-framework-provider.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAc,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"create-framework-provider.js","sourceRoot":"","sources":["../../src/create-framework-provider.tsx"],"names":[],"mappings":";;;;;;;;;;AAAA,OAAc,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,UAAU,MAAM,2BAA2B,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAExE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAKnC,EAAuF,EACvF,GAAU,EAC0E,EAAE,CACtF,IAAI,CAAC,GAAS,EAAE;IACZ,MAAM,YAAY,GAAG,IAAI,qBAAqB,EAAY,CAAC;IAC3D,MAAM,EAAE,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;IAC5B,MAAM,SAAS,GAAG,MAAM,UAAU,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC;IACtD,OAAO;QACH,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAkC,EAAE,EAAE,CAAC,CACvD,KAAC,iBAAiB,IAAC,KAAK,EAAE,SAAS,YAC/B,KAAC,cAAc,IAAC,KAAK,EAAE,SAAS,CAAC,OAAO,YAAG,QAAQ,GAAkB,GACrD,CACvB;KACJ,CAAC;AACN,CAAC,CAAA,CAAC,CAAC"}
|
package/dist/esm/version.js
CHANGED