@equinor/fusion-framework-react-app 9.0.9-next.0 → 10.0.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 +80 -12
- package/README.md +176 -99
- package/dist/esm/ag-grid/useTheme.js +7 -0
- package/dist/esm/ag-grid/useTheme.js.map +1 -1
- package/dist/esm/analytics/index.js +8 -0
- package/dist/esm/analytics/index.js.map +1 -1
- package/dist/esm/analytics/useTrackFeature.js +17 -1
- package/dist/esm/analytics/useTrackFeature.js.map +1 -1
- package/dist/esm/apploader/index.js +8 -0
- package/dist/esm/apploader/index.js.map +1 -1
- package/dist/esm/bookmark/index.js +8 -0
- package/dist/esm/bookmark/index.js.map +1 -1
- package/dist/esm/context/index.js +8 -0
- package/dist/esm/context/index.js.map +1 -1
- package/dist/esm/context/useContextProvider.js +6 -0
- package/dist/esm/context/useContextProvider.js.map +1 -1
- package/dist/esm/context/useCurrentContext.js +14 -0
- package/dist/esm/context/useCurrentContext.js.map +1 -1
- package/dist/esm/create-legacy-app.js +13 -0
- package/dist/esm/create-legacy-app.js.map +1 -1
- package/dist/esm/feature-flag/index.js.map +1 -1
- package/dist/esm/feature-flag/useFeature.js +20 -4
- package/dist/esm/feature-flag/useFeature.js.map +1 -1
- package/dist/esm/framework/index.js +8 -1
- package/dist/esm/framework/index.js.map +1 -1
- package/dist/esm/framework/useFrameworkCurrentContext.js +9 -0
- package/dist/esm/framework/useFrameworkCurrentContext.js.map +1 -1
- package/dist/esm/help-center/useHelpCenter.js +12 -1
- package/dist/esm/help-center/useHelpCenter.js.map +1 -1
- package/dist/esm/http/index.js +9 -0
- package/dist/esm/http/index.js.map +1 -1
- package/dist/esm/http/selectors.js +8 -0
- package/dist/esm/http/selectors.js.map +1 -1
- package/dist/esm/index.js +15 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/make-component.js.map +1 -1
- package/dist/esm/msal/index.js +13 -0
- package/dist/esm/msal/index.js.map +1 -1
- package/dist/esm/msal/useAccessToken.js +15 -3
- package/dist/esm/msal/useAccessToken.js.map +1 -1
- package/dist/esm/msal/useCurrentAccount.js +12 -2
- package/dist/esm/msal/useCurrentAccount.js.map +1 -1
- package/dist/esm/msal/useToken.js +19 -3
- package/dist/esm/msal/useToken.js.map +1 -1
- package/dist/esm/navigation/index.js +8 -0
- package/dist/esm/navigation/index.js.map +1 -1
- package/dist/esm/navigation/useNavigationModule.js +6 -1
- package/dist/esm/navigation/useNavigationModule.js.map +1 -1
- package/dist/esm/navigation/useRouter.js +23 -4
- package/dist/esm/navigation/useRouter.js.map +1 -1
- package/dist/esm/render-app.js +19 -4
- package/dist/esm/render-app.js.map +1 -1
- package/dist/esm/render-component.js +16 -8
- package/dist/esm/render-component.js.map +1 -1
- package/dist/esm/settings/index.js +8 -0
- package/dist/esm/settings/index.js.map +1 -1
- package/dist/esm/useAppModule.js +13 -5
- package/dist/esm/useAppModule.js.map +1 -1
- package/dist/esm/useAppModules.js +9 -3
- package/dist/esm/useAppModules.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/ag-grid/useTheme.d.ts +7 -0
- package/dist/types/analytics/index.d.ts +8 -0
- package/dist/types/analytics/useTrackFeature.d.ts +17 -1
- package/dist/types/apploader/index.d.ts +8 -0
- package/dist/types/bookmark/index.d.ts +8 -0
- package/dist/types/context/index.d.ts +8 -0
- package/dist/types/context/useContextProvider.d.ts +6 -0
- package/dist/types/context/useCurrentContext.d.ts +14 -0
- package/dist/types/create-legacy-app.d.ts +13 -0
- package/dist/types/feature-flag/index.d.ts +8 -0
- package/dist/types/feature-flag/useFeature.d.ts +20 -4
- package/dist/types/framework/index.d.ts +8 -0
- package/dist/types/framework/useFrameworkCurrentContext.d.ts +9 -0
- package/dist/types/help-center/useHelpCenter.d.ts +12 -1
- package/dist/types/http/index.d.ts +9 -0
- package/dist/types/http/selectors.d.ts +8 -0
- package/dist/types/index.d.ts +15 -0
- package/dist/types/make-component.d.ts +15 -0
- package/dist/types/msal/index.d.ts +13 -0
- package/dist/types/msal/useAccessToken.d.ts +15 -3
- package/dist/types/msal/useCurrentAccount.d.ts +12 -2
- package/dist/types/msal/useToken.d.ts +19 -3
- package/dist/types/navigation/index.d.ts +8 -0
- package/dist/types/navigation/useNavigationModule.d.ts +6 -1
- package/dist/types/navigation/useRouter.d.ts +23 -4
- package/dist/types/render-app.d.ts +19 -4
- package/dist/types/render-component.d.ts +13 -4
- package/dist/types/settings/index.d.ts +8 -0
- package/dist/types/useAppModule.d.ts +13 -5
- package/dist/types/useAppModules.d.ts +9 -3
- package/dist/types/version.d.ts +1 -1
- package/package.json +22 -23
- package/src/ag-grid/useTheme.ts +7 -0
- package/src/analytics/index.ts +8 -0
- package/src/analytics/useTrackFeature.ts +17 -1
- package/src/apploader/index.ts +8 -0
- package/src/bookmark/index.ts +8 -0
- package/src/context/index.ts +8 -0
- package/src/context/useContextProvider.ts +6 -0
- package/src/context/useCurrentContext.ts +14 -0
- package/src/create-legacy-app.tsx +13 -0
- package/src/feature-flag/index.ts +8 -0
- package/src/feature-flag/useFeature.ts +20 -4
- package/src/framework/index.ts +8 -1
- package/src/framework/useFrameworkCurrentContext.ts +9 -0
- package/src/help-center/useHelpCenter.ts +12 -1
- package/src/http/index.ts +9 -0
- package/src/http/selectors.ts +8 -0
- package/src/index.ts +16 -0
- package/src/make-component.tsx +15 -0
- package/src/msal/index.ts +13 -0
- package/src/msal/useAccessToken.ts +15 -3
- package/src/msal/useCurrentAccount.ts +12 -2
- package/src/msal/useToken.ts +19 -3
- package/src/navigation/index.ts +8 -0
- package/src/navigation/useNavigationModule.ts +6 -1
- package/src/navigation/useRouter.ts +23 -4
- package/src/render-app.ts +19 -4
- package/src/render-component.tsx +20 -8
- package/src/settings/index.ts +8 -0
- package/src/useAppModule.ts +13 -5
- package/src/useAppModules.ts +9 -3
- package/src/version.ts +1 -1
- package/vitest.config.ts +4 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFeature.js","sourceRoot":"","sources":["../../../src/feature-flag/useFeature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAKtE,OAAO,EAAE,WAAW,EAAE,MAAM,yDAAyD,CAAC;AAEtF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C
|
|
1
|
+
{"version":3,"file":"useFeature.js","sourceRoot":"","sources":["../../../src/feature-flag/useFeature.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEjD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAKtE,OAAO,EAAE,WAAW,EAAE,MAAM,yDAAyD,CAAC;AAEtF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CACxB,GAAW,EAKX,EAAE;IACF,MAAM,WAAW,GAAG,YAAY,CAAoB,aAAa,CAAC,CAAC;IACnE,MAAM,iBAAiB,GAAG,kBAAkB,CAAoB,aAAa,CAAC,CAAC;IAE/E,sCAAsC;IACtC,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,EAAE;QAC7B,0DAA0D;QAC1D,IAAI,CAAC,iBAAiB,EAAE,CAAC;YACvB,OAAO,WAAW,CAAC,SAAS,CAAC;QAC/B,CAAC;QACD,yDAAyD;QACzD,OAAO,aAAa,CAAC;YACnB,SAAS,EAAE,iBAAiB,CAAC,SAAS;YACtC,GAAG,EAAE,WAAW,CAAC,SAAS;SAC3B,CAAC,CAAC,IAAI,CACL,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,EAAE,EAAE;YACzB,OAAO,EAAE,GAAG,SAAS,EAAE,GAAG,GAAG,EAAE,CAAC;QAClC,CAAC,CAAC,CACH,CAAC;IACJ,CAAC,EAAE,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAErC,4CAA4C;IAC5C,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,CAAI,GAAG,CAAC,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC;IAEtF,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,kBAAkB,CAAC,QAAQ,IAAI,KAAK,CAAC,CAAC;IAExE,MAAM,aAAa,GAAG,WAAW,CAC/B,CAAC,MAAgB,EAAE,EAAE;QACnB,qDAAqD;QACrD,MAAM,OAAO,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC;QACtF,WAAW,CAAC,aAAa,CAAC;YACxB,GAAG;YACH,OAAO;SACR,CAAC,CAAC;IACL,CAAC,EACD,CAAC,WAAW,EAAE,GAAG,CAAC,CACnB,CAAC;IAEF,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;AAC3C,CAAC,CAAC"}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Framework sub-path entry-point.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports framework-level hooks (as opposed to application-scoped ones)
|
|
5
|
+
* for accessing the Fusion instance, current user, and HTTP clients.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
1
9
|
export { useFramework } from '@equinor/fusion-framework-react';
|
|
2
|
-
// TODO
|
|
3
10
|
export { useCurrentUser, useHttpClient as useFrameworkHttpClient, } from '@equinor/fusion-framework-react/hooks';
|
|
4
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/framework/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/framework/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,OAAO,EACL,cAAc,EACd,aAAa,IAAI,sBAAsB,GACxC,MAAM,uCAAuC,CAAC"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { useFramework } from '@equinor/fusion-framework-react';
|
|
2
2
|
import { useCurrentContext } from '@equinor/fusion-framework-react-module-context';
|
|
3
|
+
/**
|
|
4
|
+
* React hook that returns the currently selected context from the
|
|
5
|
+
* **framework-level** context module (as opposed to the application-scoped one).
|
|
6
|
+
*
|
|
7
|
+
* Use this when you need the portal/host context rather than the app's own
|
|
8
|
+
* context provider.
|
|
9
|
+
*
|
|
10
|
+
* @returns The current framework context, or `undefined` if none is selected.
|
|
11
|
+
*/
|
|
3
12
|
export const useFrameworkCurrentContext = () => useCurrentContext(useFramework().modules.context);
|
|
4
13
|
export default useFrameworkCurrentContext;
|
|
5
14
|
//# sourceMappingURL=useFrameworkCurrentContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFrameworkCurrentContext.js","sourceRoot":"","sources":["../../../src/framework/useFrameworkCurrentContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAEnF,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,EAAE,CAAC,iBAAiB,CAAC,YAAY,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAElG,eAAe,0BAA0B,CAAC"}
|
|
1
|
+
{"version":3,"file":"useFrameworkCurrentContext.js","sourceRoot":"","sources":["../../../src/framework/useFrameworkCurrentContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gDAAgD,CAAC;AAEnF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,EAAE,CAAC,iBAAiB,CAAC,YAAY,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAElG,eAAe,0BAA0B,CAAC"}
|
|
@@ -2,7 +2,18 @@ import { useCallback } from 'react';
|
|
|
2
2
|
import useAppModule from '../useAppModule';
|
|
3
3
|
export const EVENT_NAME = '@Portal::FusionHelp::open';
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* React hook that returns an API for opening the portal help-center sidesheet.
|
|
6
|
+
*
|
|
7
|
+
* Each method dispatches a framework event that the portal shell listens for
|
|
8
|
+
* and opens the corresponding help page.
|
|
9
|
+
*
|
|
10
|
+
* @returns A {@link HelpCenter} object with methods to open specific help pages.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const helpCenter = useHelpCenter();
|
|
15
|
+
* <Button onClick={() => helpCenter.openFaqs()}>FAQs</Button>
|
|
16
|
+
* ```
|
|
6
17
|
*/
|
|
7
18
|
export const useHelpCenter = () => {
|
|
8
19
|
const eventModule = useAppModule('event');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useHelpCenter.js","sourceRoot":"","sources":["../../../src/help-center/useHelpCenter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAoC3C,MAAM,CAAC,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAyCtD
|
|
1
|
+
{"version":3,"file":"useHelpCenter.js","sourceRoot":"","sources":["../../../src/help-center/useHelpCenter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAoC3C,MAAM,CAAC,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAyCtD;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAAe,EAAE;IAC5C,MAAM,WAAW,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IAE1C,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAS,EAAE;QACtC,WAAW,CAAC,aAAa,CAAC,UAAU,EAAE;YACpC,MAAM,EAAE;gBACN,IAAI,EAAE,MAAM;aACb;SACF,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,MAAM,WAAW,GAAG,WAAW,CAC7B,CAAC,SAAiB,EAAQ,EAAE;QAC1B,WAAW,CAAC,aAAa,CAAC,UAAU,EAAE;YACpC,MAAM,EAAE;gBACN,IAAI,EAAE,SAAS;gBACf,SAAS,EAAE,SAAS;aACrB;SACF,CAAC,CAAC;IACL,CAAC,EACD,CAAC,WAAW,CAAC,CACd,CAAC;IAEF,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAS,EAAE;QACtC,WAAW,CAAC,aAAa,CAAC,UAAU,EAAE;YACpC,MAAM,EAAE;gBACN,IAAI,EAAE,MAAM;aACb;SACF,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,MAAM,UAAU,GAAG,WAAW,CAC5B,CAAC,MAAc,EAAQ,EAAE;QACvB,WAAW,CAAC,aAAa,CAAC,UAAU,EAAE;YACpC,MAAM,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE,MAAM;aACf;SACF,CAAC,CAAC;IACL,CAAC,EACD,CAAC,WAAW,CAAC,CACd,CAAC;IAEF,MAAM,cAAc,GAAG,WAAW,CAAC,GAAS,EAAE;QAC5C,WAAW,CAAC,aAAa,CAAC,UAAU,EAAE;YACpC,MAAM,EAAE;gBACN,IAAI,EAAE,YAAY;aACnB;SACF,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,MAAM,gBAAgB,GAAG,WAAW,CAAC,GAAS,EAAE;QAC9C,WAAW,CAAC,aAAa,CAAC,UAAU,EAAE;YACpC,MAAM,EAAE;gBACN,IAAI,EAAE,eAAe;aACtB;SACF,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,OAAO;QACL,QAAQ;QACR,WAAW;QACX,QAAQ;QACR,UAAU;QACV,cAAc;QACd,gBAAgB;KACjB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/dist/esm/http/index.js
CHANGED
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP sub-path entry-point.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports hooks from `@equinor/fusion-framework-react-module-http`,
|
|
5
|
+
* including {@link useHttpClient} for making authenticated HTTP requests
|
|
6
|
+
* from within a Fusion application.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
1
10
|
export * from '@equinor/fusion-framework-react-module-http';
|
|
2
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/http/index.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/http/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,cAAc,6CAA6C,CAAC"}
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP selector utilities.
|
|
3
|
+
*
|
|
4
|
+
* Re-exports response-selector helpers (e.g. JSON, blob, text selectors)
|
|
5
|
+
* from `@equinor/fusion-framework-module-http/selectors`.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
1
9
|
export * from '@equinor/fusion-framework-module-http/selectors';
|
|
2
10
|
//# sourceMappingURL=selectors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectors.js","sourceRoot":"","sources":["../../../src/http/selectors.ts"],"names":[],"mappings":"AAAA,cAAc,iDAAiD,CAAC"}
|
|
1
|
+
{"version":3,"file":"selectors.js","sourceRoot":"","sources":["../../../src/http/selectors.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,iDAAiD,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
*
|
|
4
|
+
* React bindings for building Fusion Framework applications.
|
|
5
|
+
*
|
|
6
|
+
* Provides the main entry-point helpers (`renderApp`, `createComponent`, `makeComponent`)
|
|
7
|
+
* plus React hooks for accessing framework modules (HTTP, auth, context, navigation, etc.)
|
|
8
|
+
* from within a Fusion app.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* This is the primary package application developers depend on when building
|
|
12
|
+
* React-based Fusion apps. It re-exports core types from `@equinor/fusion-framework-app`
|
|
13
|
+
* and adds React-specific rendering, hooks, and sub-path entry-points for optional
|
|
14
|
+
* modules such as MSAL, feature flags, bookmarks, analytics, and settings.
|
|
15
|
+
*/
|
|
1
16
|
export { useAppModule } from './useAppModule';
|
|
2
17
|
export { useAppModules } from './useAppModules';
|
|
3
18
|
export { useAppEnvironmentVariables } from './useAppEnvironmentVariables';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAgBH,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,OAAO,EAAE,aAAa,EAAuB,MAAM,kBAAkB,CAAC;AAEtE,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAKrD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"make-component.js","sourceRoot":"","sources":["../../src/make-component.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,EAAe,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAO9E,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"make-component.js","sourceRoot":"","sources":["../../src/make-component.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AAGpE,OAAO,EAAe,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAO9E,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM,wCAAwC,CAAC;AA2B7F;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAK3B,SAA0B,EAC1B,IAAiC,EACjC,SAAoD,EACJ,EAAE,CAClD,IAAI,CAAC,KAAK,IAAI,EAAE;IACd,MAAM,IAAI,GAAG,gBAAgB,CAAuB,SAAS,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;IAEjC,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IAExB,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,kBAAkB,EAAE;QAC9C,MAAM,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE;QAC1C,MAAM,EAAE,SAAS;KAClB,CAAC,CAAC;IAEH,OAAO;QACL,OAAO,EAAE,GAAG,EAAE,CAAC,CACb,KAAC,iBAAiB,IAAC,KAAK,EAAE,MAAM,YAC9B,KAAC,iBAAiB,IAAC,KAAK,EAAE,OAAO,YAAG,SAAS,GAAqB,GAChD,CACrB;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAaL,eAAe,aAAa,CAAC"}
|
package/dist/esm/msal/index.js
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MSAL authentication sub-path entry-point.
|
|
3
|
+
*
|
|
4
|
+
* Provides React hooks for accessing MSAL-based authentication state
|
|
5
|
+
* (current account, access tokens) from within a Fusion application.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Requires `@equinor/fusion-framework-module-msal` to be installed and
|
|
9
|
+
* configured by the host/portal. Applications should **not** configure the
|
|
10
|
+
* MSAL module themselves.
|
|
11
|
+
*
|
|
12
|
+
* @packageDocumentation
|
|
13
|
+
*/
|
|
1
14
|
export { useCurrentAccount } from './useCurrentAccount';
|
|
2
15
|
export { useAccessToken } from './useAccessToken';
|
|
3
16
|
export { useToken } from './useToken';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/msal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/msal/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import { useToken } from './useToken';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* React hook that acquires an OAuth 2.0 access token string via MSAL.
|
|
4
4
|
*
|
|
5
|
-
* @
|
|
6
|
-
*
|
|
5
|
+
* This is a convenience wrapper around {@link useToken} that extracts the
|
|
6
|
+
* `accessToken` property from the full `AuthenticationResult`.
|
|
7
|
+
*
|
|
8
|
+
* @param req - The token request containing the `scopes` to acquire.
|
|
9
|
+
* @param req.scopes - Array of scope strings (e.g. `['User.Read']`).
|
|
10
|
+
* @returns An object with:
|
|
11
|
+
* - `token` – the access token string, or `undefined` while pending.
|
|
12
|
+
* - `pending` – `true` while the token is being acquired.
|
|
13
|
+
* - `error` – any error encountered during acquisition.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* const { token, pending, error } = useAccessToken({ scopes: ['api://my-api/.default'] });
|
|
18
|
+
* ```
|
|
7
19
|
*/
|
|
8
20
|
export const useAccessToken = (req) => {
|
|
9
21
|
const { token, error, pending } = useToken(req);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAccessToken.js","sourceRoot":"","sources":["../../../src/msal/useAccessToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC
|
|
1
|
+
{"version":3,"file":"useAccessToken.js","sourceRoot":"","sources":["../../../src/msal/useAccessToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,GAE9B,EAAwD,EAAE;IACzD,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;IAChD,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACvD,CAAC,CAAC"}
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import useAppModule from '../useAppModule';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
3
|
+
* React hook that returns the currently signed-in user's MSAL account info.
|
|
4
|
+
*
|
|
5
|
+
* @returns The {@link AccountInfo} for the active account, or `undefined` if
|
|
6
|
+
* no user is signed in.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const account = useCurrentAccount();
|
|
11
|
+
* if (account) {
|
|
12
|
+
* console.log('Signed in as', account.name);
|
|
13
|
+
* }
|
|
14
|
+
* ```
|
|
5
15
|
*/
|
|
6
16
|
export const useCurrentAccount = () => {
|
|
7
17
|
const msalProvider = useAppModule('auth');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCurrentAccount.js","sourceRoot":"","sources":["../../../src/msal/useCurrentAccount.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C
|
|
1
|
+
{"version":3,"file":"useCurrentAccount.js","sourceRoot":"","sources":["../../../src/msal/useCurrentAccount.ts"],"names":[],"mappings":"AACA,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAA4B,EAAE;IAC7D,MAAM,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAC1C,OAAO,YAAY,CAAC,OAAO,IAAI,SAAS,CAAC;AAC3C,CAAC,CAAC"}
|
|
@@ -1,9 +1,25 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react';
|
|
2
2
|
import useAppModule from '../useAppModule';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* React hook that acquires a full MSAL {@link AuthenticationResult} for the
|
|
5
|
+
* requested scopes.
|
|
6
|
+
*
|
|
7
|
+
* The hook attempts silent acquisition first and falls back to an interactive
|
|
8
|
+
* prompt when required by the MSAL provider.
|
|
9
|
+
*
|
|
10
|
+
* @param req - The token request containing the `scopes` to acquire.
|
|
11
|
+
* @param req.scopes - Array of scope strings (e.g. `['User.Read']`).
|
|
12
|
+
* @returns An object with:
|
|
13
|
+
* - `token` – the full {@link AuthenticationResult}, or `undefined` while pending.
|
|
14
|
+
* - `pending` – `true` while the token is being acquired.
|
|
15
|
+
* - `error` – any error encountered during acquisition.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```tsx
|
|
19
|
+
* const { token, pending } = useToken({ scopes: ['User.Read'] });
|
|
20
|
+
* if (pending) return <Spinner />;
|
|
21
|
+
* console.log('ID token:', token?.idToken);
|
|
22
|
+
* ```
|
|
7
23
|
*/
|
|
8
24
|
export const useToken = (req) => {
|
|
9
25
|
const msalProvider = useAppModule('auth');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useToken.js","sourceRoot":"","sources":["../../../src/msal/useToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAI5C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C
|
|
1
|
+
{"version":3,"file":"useToken.js","sourceRoot":"","sources":["../../../src/msal/useToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAI5C,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,GAExB,EAAsE,EAAE;IACvE,MAAM,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;IAC1C,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAmC,SAAS,CAAC,CAAC;IAChF,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IACvD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAU,IAAI,CAAC,CAAC;IAClD,SAAS,CAAC,GAAG,EAAE;QACb,UAAU,CAAC,IAAI,CAAC,CAAC;QACjB,QAAQ,CAAC,SAAS,CAAC,CAAC;QACpB,YAAY;aACT,YAAY,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;aAC9B,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YACf,IAAI,MAAM,EAAE,CAAC;gBACX,QAAQ,CAAC,MAAM,CAAC,CAAC;YACnB,CAAC;QACH,CAAC,CAAC;aACD,KAAK,CAAC,QAAQ,CAAC;aACf,OAAO,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;IACtC,CAAC,EAAE,CAAC,YAAY,EAAE,GAAG,CAAC,CAAC,CAAC;IACxB,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AACnC,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Navigation sub-path entry-point.
|
|
3
|
+
*
|
|
4
|
+
* Provides hooks for accessing the Fusion navigation module and creating
|
|
5
|
+
* client-side routers compatible with `react-router`.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
1
9
|
export { useNavigationModule } from './useNavigationModule';
|
|
2
10
|
export { useRouter } from './useRouter';
|
|
3
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/navigation/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/navigation/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import useAppModule from '../useAppModule';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* React hook that resolves the application-scoped navigation module provider.
|
|
4
|
+
*
|
|
5
|
+
* @returns The navigation provider instance.
|
|
6
|
+
* @throws If the navigation module has not been enabled for the application.
|
|
7
|
+
*/
|
|
3
8
|
export const useNavigationModule = () => useAppModule('navigation');
|
|
4
9
|
//# sourceMappingURL=useNavigationModule.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNavigationModule.js","sourceRoot":"","sources":["../../../src/navigation/useNavigationModule.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAG3C
|
|
1
|
+
{"version":3,"file":"useNavigationModule.js","sourceRoot":"","sources":["../../../src/navigation/useNavigationModule.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAG3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAwB,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC"}
|
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { useNavigationModule } from './useNavigationModule';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
4
|
+
* React hook that creates a router instance for client-side navigation.
|
|
5
|
+
*
|
|
6
|
+
* The `routes` argument **must** be static or memoised to avoid re-creating
|
|
7
|
+
* the router on every render.
|
|
8
|
+
*
|
|
9
|
+
* @param routes - An array of route objects compatible with
|
|
10
|
+
* `INavigationProvider.createRouter`.
|
|
11
|
+
* @returns A router instance to pass to `<RouterProvider>`.
|
|
12
|
+
*
|
|
13
|
+
* @see {@link https://equinor.github.io/fusion-framework/modules/navigation/ | Fusion navigation docs}
|
|
14
|
+
* @see {@link https://reactrouter.com/en/main/routers/create-browser-router | react-router docs}
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```tsx
|
|
18
|
+
* import { useRouter } from '@equinor/fusion-framework-react-app/navigation';
|
|
19
|
+
* import { RouterProvider } from 'react-router-dom';
|
|
20
|
+
*
|
|
21
|
+
* const routes = [{ path: '/', element: <Home /> }];
|
|
22
|
+
* const App = () => {
|
|
23
|
+
* const router = useRouter(routes);
|
|
24
|
+
* return <RouterProvider router={router} />;
|
|
25
|
+
* };
|
|
26
|
+
* ```
|
|
8
27
|
*/
|
|
9
28
|
export const useRouter = (routes) => {
|
|
10
29
|
const provider = useNavigationModule();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRouter.js","sourceRoot":"","sources":["../../../src/navigation/useRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D
|
|
1
|
+
{"version":3,"file":"useRouter.js","sourceRoot":"","sources":["../../../src/navigation/useRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAG5D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,MAA0D,EACT,EAAE;IACnD,MAAM,QAAQ,GAAG,mBAAmB,EAAE,CAAC;IACvC,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAC1E,CAAC,CAAC"}
|
package/dist/esm/render-app.js
CHANGED
|
@@ -1,11 +1,26 @@
|
|
|
1
1
|
import { createComponent } from './create-component';
|
|
2
2
|
import { renderComponent } from './render-component';
|
|
3
3
|
/**
|
|
4
|
-
* Creates a render function for
|
|
5
|
-
* Uses React 18's createRoot API via renderComponent.
|
|
4
|
+
* Creates a render function for a Fusion React application.
|
|
6
5
|
*
|
|
7
|
-
* @
|
|
8
|
-
*
|
|
6
|
+
* Wraps {@link createComponent} and {@link renderComponent} into a single factory:
|
|
7
|
+
* call the returned function with an `HTMLElement` and `ComponentRenderArgs` to
|
|
8
|
+
* mount the app using React 18's `createRoot` API.
|
|
9
|
+
*
|
|
10
|
+
* @param componentArgs - Arguments forwarded to {@link createComponent} (the React
|
|
11
|
+
* component to render and an optional module-configuration callback).
|
|
12
|
+
* @returns A mount function that accepts a DOM element and render args, and returns
|
|
13
|
+
* a {@link RenderTeardown} callback to unmount the application.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { renderApp } from '@equinor/fusion-framework-react-app';
|
|
18
|
+
* import { App } from './App';
|
|
19
|
+
* import { configure } from './config';
|
|
20
|
+
*
|
|
21
|
+
* export const render = renderApp(App, configure);
|
|
22
|
+
* export default render;
|
|
23
|
+
* ```
|
|
9
24
|
*/
|
|
10
25
|
export const renderApp = (...componentArgs) => {
|
|
11
26
|
const renderer = renderComponent(createComponent(...componentArgs));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-app.js","sourceRoot":"","sources":["../../src/render-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAuB,MAAM,oBAAoB,CAAC;AAI1E
|
|
1
|
+
{"version":3,"file":"render-app.js","sourceRoot":"","sources":["../../src/render-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAuB,MAAM,oBAAoB,CAAC;AAI1E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,GAAG,aAAiD,EAAE,EAAE;IAChF,MAAM,QAAQ,GAAG,eAAe,CAAC,eAAe,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC;IACpE,OAAO,CAAC,EAAe,EAAE,IAAyB,EAAkB,EAAE;QACpE,OAAO,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -2,11 +2,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Suspense, StrictMode } from 'react';
|
|
3
3
|
import { createRoot } from 'react-dom/client';
|
|
4
4
|
/**
|
|
5
|
-
* Renders a React component into a DOM element using React 18's createRoot API.
|
|
5
|
+
* Renders a React component into a DOM element using React 18's `createRoot` API.
|
|
6
6
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* The component is wrapped in `<StrictMode>` and `<Suspense>` with a basic
|
|
8
|
+
* loading fallback.
|
|
9
|
+
*
|
|
10
|
+
* @param el - The DOM element to render into.
|
|
11
|
+
* @param Component - The React function component to render.
|
|
12
|
+
* @returns A {@link RenderTeardown} callback that unmounts the component.
|
|
10
13
|
*/
|
|
11
14
|
const render = (el, Component) => {
|
|
12
15
|
const root = createRoot(el);
|
|
@@ -16,11 +19,16 @@ const render = (el, Component) => {
|
|
|
16
19
|
};
|
|
17
20
|
};
|
|
18
21
|
/**
|
|
19
|
-
* Creates a
|
|
20
|
-
*
|
|
22
|
+
* Creates a mount function from a {@link ComponentRenderer}.
|
|
23
|
+
*
|
|
24
|
+
* The returned function accepts a target `HTMLElement` and
|
|
25
|
+
* {@link ComponentRenderArgs}, resolves the lazy component via the renderer,
|
|
26
|
+
* and mounts it with React 18's `createRoot`.
|
|
21
27
|
*
|
|
22
|
-
* @param renderer - A
|
|
23
|
-
*
|
|
28
|
+
* @param renderer - A {@link ComponentRenderer} that produces a lazy component
|
|
29
|
+
* from Fusion and environment arguments.
|
|
30
|
+
* @returns A function `(el, args) => RenderTeardown` that mounts the app and
|
|
31
|
+
* returns a teardown callback.
|
|
24
32
|
*/
|
|
25
33
|
export const renderComponent = (renderer) => {
|
|
26
34
|
return (el, args) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render-component.js","sourceRoot":"","sources":["../../src/render-component.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAa,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"render-component.js","sourceRoot":"","sources":["../../src/render-component.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE7C,OAAO,EAAE,UAAU,EAAa,MAAM,kBAAkB,CAAC;AASzD;;;;;;;;;GASG;AACH,MAAM,MAAM,GAAG,CAAC,EAAW,EAAE,SAA4B,EAAkB,EAAE;IAC3E,MAAM,IAAI,GAAS,UAAU,CAAC,EAAE,CAAC,CAAC;IAClC,IAAI,CAAC,MAAM,CACT,KAAC,UAAU,cACT,KAAC,QAAQ,IAAC,QAAQ,EAAE,sCAAkB,YACpC,KAAC,SAAS,KAAG,GACJ,GACA,CACd,CAAC;IACF,OAAO,GAAG,EAAE;QACV,IAAI,CAAC,OAAO,EAAE,CAAC;IACjB,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,QAA2B,EAAE,EAAE;IAC7D,OAAO,CAAC,EAAe,EAAE,IAAyB,EAAkB,EAAE;QACpE,MAAM,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QAClD,OAAO,MAAM,CAAC,EAAE,EAAE,SAAS,CAAC,CAAC;IAC/B,CAAC,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Settings sub-path entry-point.
|
|
3
|
+
*
|
|
4
|
+
* Provides hooks for reading and updating per-application user settings
|
|
5
|
+
* that are persisted by the Fusion platform.
|
|
6
|
+
*
|
|
7
|
+
* @packageDocumentation
|
|
8
|
+
*/
|
|
1
9
|
export { useAppSetting } from './useAppSetting';
|
|
2
10
|
export { useAppSettings } from './useAppSettings';
|
|
3
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/settings/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/settings/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/esm/useAppModule.js
CHANGED
|
@@ -1,11 +1,19 @@
|
|
|
1
1
|
import { useAppModules } from './useAppModules';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* React hook that retrieves a single module instance from the application scope.
|
|
4
4
|
*
|
|
5
|
-
* @template TType - The
|
|
6
|
-
*
|
|
7
|
-
* @
|
|
8
|
-
* @
|
|
5
|
+
* @template TType - The concrete module type (e.g. `ContextModule`). Pass
|
|
6
|
+
* `unknown` to infer the type from the key.
|
|
7
|
+
* @template TKey - The string key used to look up the module.
|
|
8
|
+
* @param module - The key identifying the module to retrieve.
|
|
9
|
+
* @returns The resolved module instance.
|
|
10
|
+
* @throws If the requested module is not registered in the application scope.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```tsx
|
|
14
|
+
* const auth = useAppModule('auth');
|
|
15
|
+
* auth.acquireAccessToken().then(console.log);
|
|
16
|
+
* ```
|
|
9
17
|
*/
|
|
10
18
|
export function useAppModule(module) {
|
|
11
19
|
const appModule = useAppModules()[module];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAppModule.js","sourceRoot":"","sources":["../../src/useAppModule.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD
|
|
1
|
+
{"version":3,"file":"useAppModule.js","sourceRoot":"","sources":["../../src/useAppModule.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,YAAY,CAI1B,MAAY;IAIZ,MAAM,SAAS,GAAG,aAAa,EAAE,CAAC,MAAkC,CAAC,CAAC;IACtE,IAAI,CAAC,SAAS,EAAE,CAAC;QACf,MAAM,KAAK,CAAC,yBAAyB,MAAM,oCAAoC,CAAC,CAAC;IACnF,CAAC;IACD,OAAO,SAEwD,CAAC;AAClE,CAAC;AAED,eAAe,YAAY,CAAC"}
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { useModules } from '@equinor/fusion-framework-react-module';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* React hook that returns the full set of initialised application-scoped modules.
|
|
4
4
|
*
|
|
5
|
-
* @template T -
|
|
6
|
-
* @returns
|
|
5
|
+
* @template T - Optional array of additional module types beyond the defaults.
|
|
6
|
+
* @returns The {@link AppModulesInstance} containing all registered modules.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const modules = useAppModules();
|
|
11
|
+
* console.log(Object.keys(modules));
|
|
12
|
+
* ```
|
|
7
13
|
*/
|
|
8
14
|
export const useAppModules = () => useModules();
|
|
9
15
|
export default useAppModules;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAppModules.js","sourceRoot":"","sources":["../../src/useAppModules.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE
|
|
1
|
+
{"version":3,"file":"useAppModules.js","sourceRoot":"","sources":["../../src/useAppModules.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEpE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,GAEF,EAAE,CAAC,UAAU,EAA0C,CAAC;AAEnF,eAAe,aAAa,CAAC"}
|
package/dist/esm/version.js
CHANGED
package/dist/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC"}
|