@equinor/fusion-framework-dev-portal 4.0.4 → 5.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.
@@ -1,2 +1,7 @@
1
+ /**
2
+ * Inline SVG string used as a generic person-avatar placeholder.
3
+ *
4
+ * Rendered when the person photo cannot be loaded from the people service.
5
+ */
1
6
  export const svg = `<svg height="24px" width="24px" fill="#999" viewBox="0 0 24 24" title="person" role="img" xmlns="http://www.w3.org/2000/svg"><rect width="100%" height="100%" fill="#eee" /><path d="M12 4C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4Zm2 4c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2Zm4 10c-.2-.71-3.3-2-6-2-2.69 0-5.77 1.28-6 2h12ZM4 18c0-2.66 5.33-4 8-4s8 1.34 8 4v2H4v-2Z" fill-rule="evenodd" clip-rule="evenodd" class="sc-dmqHEX eydzYY"></path></svg>`;
2
7
  export default svg;
@@ -18,16 +18,18 @@ import { useFrameworkModule } from '@equinor/fusion-framework-react';
18
18
  type CurrentAppModules = [ContextModule, NavigationModule];
19
19
 
20
20
  /**
21
- * Generates a pathname for navigation based on the current pathname,
22
- * context item, and optional context provider. If a `pathContextId` is provided,
23
- * it replaces the existing context ID in the pathname. Otherwise, it constructs
24
- * a new pathname using the context item's ID.
21
+ * Builds the navigation pathname when the context changes.
22
+ *
23
+ * If a context ID already exists in the current pathname (`pathContextId`),
24
+ * it is replaced with the new context item's ID. Otherwise a new path
25
+ * segment is appended. Falls back to the context provider's
26
+ * `generatePathFromContext` when available.
25
27
  *
26
28
  * @param currentPathname - The current URL pathname.
27
- * @param item - The context item containing the ID to be used in the pathname.
28
- * @param context - An optional context provider with a method to generate a pathname from the context item.
29
- * @param pathContextId - An optional context ID present in the current URL to be replaced.
30
- * @returns The generated pathname for navigation.
29
+ * @param item - The newly selected context item.
30
+ * @param context - Optional context provider with a custom path generator.
31
+ * @param pathContextId - Existing context ID found in the current URL, if any.
32
+ * @returns The generated pathname string for navigation.
31
33
  */
32
34
  const generatePathname = (
33
35
  currentPathname: string,
@@ -60,8 +62,15 @@ const generatePathname = (
60
62
  };
61
63
 
62
64
  /**
63
- * when current application changes, this hook will observe the application module instances.
64
- * If the module has Context and Navigation, this hook will navigate when the context changes
65
+ * Observes the current application's context changes and synchronizes the URL.
66
+ *
67
+ * When the loaded app exposes both a context and navigation module, this hook
68
+ * subscribes to `currentContext$`. On context change it updates the URL
69
+ * pathname — either replacing an existing context ID segment or appending one.
70
+ * When context is cleared, navigation resets to the root path.
71
+ *
72
+ * Uses the app's own navigation instance when available, falling back to the
73
+ * portal-level navigation module.
65
74
  */
66
75
  export const useAppContextNavigation = () => {
67
76
  // use the framework navigation instance
package/src/version.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated by genversion.
2
- export const version = '4.0.4';
2
+ export const version = '5.0.0';