@equinor/fusion-framework-cli 10.6.0 → 10.7.0-beta-AH-test-778ecddcafac619d1bdc9be4a2c50f2f8c15cc68
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 +64 -0
- package/dist/bin/dev-portal/useAppContextNavigation.js +3 -2
- package/dist/bin/dev-portal/useAppContextNavigation.js.map +1 -1
- package/dist/bin/public/assets/{index-BarrErBH.js → index-Bg_bVFV6.js} +12 -12
- package/dist/bin/public/index.html +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +17 -17
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,69 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## 10.7.0-beta-AH-test-778ecddcafac619d1bdc9be4a2c50f2f8c15cc68
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#2930](https://github.com/equinor/fusion-framework/pull/2930) [`778ecdd`](https://github.com/equinor/fusion-framework/commit/778ecddcafac619d1bdc9be4a2c50f2f8c15cc68) Thanks [@odinr](https://github.com/odinr)! - **@equinor/fusion-framework-react:**
|
|
8
|
+
|
|
9
|
+
- Enhanced `useAppContextNavigation` to support custom context path extraction and generation. This allows for more flexible navigation handling based on application-specific requirements.
|
|
10
|
+
|
|
11
|
+
**@equinor/fusion-framework-module-context:**
|
|
12
|
+
|
|
13
|
+
- Added support for custom context path extraction and generation in `ContextConfigBuilder`, `ContextProvider`, and `ContextModuleConfigurator`.
|
|
14
|
+
- Introduced `setContextPathExtractor` and `setContextPathGenerator` methods in `ContextConfigBuilder` to allow developers to define custom logic for extracting and generating context paths.
|
|
15
|
+
- Updated `ContextProvider` to utilize `extractContextIdFromPath` and `generatePathFromContext` from the configuration, enabling dynamic path handling.
|
|
16
|
+
- Enhanced `ContextModuleConfigurator` to include `extractContextIdFromPath` and `generatePathFromContext` in the module configuration.
|
|
17
|
+
|
|
18
|
+
If you are using `@equinor/fusion-framework-module-context` and need custom logic for context path handling:
|
|
19
|
+
|
|
20
|
+
1. Use `setContextPathExtractor` to define how to extract context IDs from paths.
|
|
21
|
+
2. Use `setContextPathGenerator` to define how to generate paths based on context items.
|
|
22
|
+
|
|
23
|
+
Example:
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
builder.setContextPathExtractor((path) => {
|
|
27
|
+
// Custom logic to extract context ID from path
|
|
28
|
+
return path.match(/\/custom\/(.+)/)?.[1];
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
builder.setContextPathGenerator((context, path) => {
|
|
32
|
+
// Custom logic to generate path from context
|
|
33
|
+
return path.replace(/^(\/)?custom\/[^/]+(.*)$/, `/app/${item.id}$2`);
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
If your portal is generating context paths based on context items, you can now define custom logic for context path handling:
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
contextProvider.currentContext$
|
|
41
|
+
.pipe(
|
|
42
|
+
map((context) => {
|
|
43
|
+
// Custom logic to generate path from context
|
|
44
|
+
const path = contextProvider.generatePathFromContext?.(
|
|
45
|
+
context,
|
|
46
|
+
location.pathname
|
|
47
|
+
);
|
|
48
|
+
return path ?? fallbackPathGenerator(context, location.pathname);
|
|
49
|
+
}),
|
|
50
|
+
filter(Boolean)
|
|
51
|
+
)
|
|
52
|
+
.subscribe((path) => history.push(path));
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- pre-release changeset for tag **beta-AH-test**, all public packages are patched
|
|
58
|
+
|
|
59
|
+
## 10.6.1
|
|
60
|
+
|
|
61
|
+
### Patch Changes
|
|
62
|
+
|
|
63
|
+
- [#2913](https://github.com/equinor/fusion-framework/pull/2913) [`4b3a72b`](https://github.com/equinor/fusion-framework/commit/4b3a72b57d1069ea4e3fc72d852cbef03bf00d60) Thanks [@dependabot](https://github.com/apps/dependabot)! - chore: bump vite from 6.1.1 to 6.2.2
|
|
64
|
+
|
|
65
|
+
- [#2920](https://github.com/equinor/fusion-framework/pull/2920) [`8362ea2`](https://github.com/equinor/fusion-framework/commit/8362ea223dd9909cb523f0353c80d52aab573a5f) Thanks [@dependabot](https://github.com/apps/dependabot)! - chore: bump @equinor/fusion-react-side-sheet from 1.3.5 to 1.3.6
|
|
66
|
+
|
|
3
67
|
## 10.6.0
|
|
4
68
|
|
|
5
69
|
### Minor Changes
|
|
@@ -22,6 +22,7 @@ export const useAppContextNavigation = () => {
|
|
|
22
22
|
(_a = context === null || context === void 0 ? void 0 : context.currentContext$) !== null && _a !== void 0 ? _a : EMPTY,
|
|
23
23
|
// when the context changes, navigate to the new context
|
|
24
24
|
useCallback((item) => {
|
|
25
|
+
var _a, _b, _c, _d;
|
|
25
26
|
// sanity check, if the item or navigation is undefined, early return
|
|
26
27
|
if (item === undefined || navigation === undefined) {
|
|
27
28
|
return;
|
|
@@ -47,12 +48,12 @@ export const useAppContextNavigation = () => {
|
|
|
47
48
|
return;
|
|
48
49
|
}
|
|
49
50
|
// extract the context id from the current path
|
|
50
|
-
const pathContextId = extractContextIdFromPath(currentPathname);
|
|
51
|
+
const pathContextId = (_b = (_a = context === null || context === void 0 ? void 0 : context.extractContextIdFromPath) === null || _a === void 0 ? void 0 : _a.call(context, currentPathname)) !== null && _b !== void 0 ? _b : extractContextIdFromPath(currentPathname);
|
|
51
52
|
// generate path to the selected context
|
|
52
53
|
const pathname = pathContextId
|
|
53
54
|
? item
|
|
54
55
|
? // context id exists in the url, replace it with the new context id
|
|
55
|
-
currentPathname.replace(pathContextId, item.id)
|
|
56
|
+
((_d = (_c = context === null || context === void 0 ? void 0 : context.generatePathFromContext) === null || _c === void 0 ? void 0 : _c.call(context, item, currentPathname)) !== null && _d !== void 0 ? _d : currentPathname.replace(pathContextId, item.id))
|
|
56
57
|
: // context was cleared, set the path to the root
|
|
57
58
|
'/'
|
|
58
59
|
: // could not find context id in the url, set the path to the new context id
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAppContextNavigation.js","sourceRoot":"","sources":["../../../src/bin/dev-portal/useAppContextNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAG3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAI1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAIrE;;;GAGG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,EAAE;;IAC1C,wCAAwC;IACxC,MAAM,UAAU,GAAG,kBAAkB,CAAmB,YAAY,CAAC,CAAC;IAEtE,sCAAsC;IACtC,MAAM,EAAE,OAAO,EAAE,GAAG,oBAAoB,EAAqB,CAAC;IAC9D,kFAAkF;IAClF,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,EAAE,CAAC;IAE7D,mCAAmC;IACnC,yBAAyB;IACvB,2DAA2D;IAC3D,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,mCAAI,KAAK;IACjC,wDAAwD;IACxD,WAAW,CACT,CAAC,IAAoC,EAAE,EAAE
|
|
1
|
+
{"version":3,"file":"useAppContextNavigation.js","sourceRoot":"","sources":["../../../src/bin/dev-portal/useAppContextNavigation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAEpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAG3E,OAAO,EAAE,wBAAwB,EAAE,MAAM,gDAAgD,CAAC;AAI1F,OA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