@equinor/echo-framework 2.0.1 → 2.1.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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "peerDependencies": {
5
5
  "@equinor/echo-base": ">= 2.0.1 < 3.0.0",
6
6
  "@equinor/echo-components": ">= 2.0.1 < 3.0.0",
7
7
  "@equinor/echo-core": ">= 2.0.1 < 3.0.0",
8
8
  "@equinor/echo-search": ">= 2.0.1 < 3.0.0",
9
- "@equinor/echo-utils": ">= 2.0.1 < 3.0.0",
9
+ "@equinor/echo-utils": ">= 2.1.0 < 3.0.0",
10
10
  "@equinor/eds-core-react": "0.49.0",
11
11
  "@equinor/eds-icons": "0.22.0",
12
12
  "react": ">= 17.0.2",
package/src/index.d.ts CHANGED
@@ -43,6 +43,7 @@ export { useIsFullScreenModeEnabled } from './lib/hooks/useIsFullScreenModeEnabl
43
43
  export { useOpenPrepview } from './lib/hooks/useOpenPrepview';
44
44
  export { useScreenOrientation } from './lib/hooks/useScreenOrientation';
45
45
  export { useScreenValues } from './lib/hooks/useScreenValues';
46
+ export { useSelectionGroupLabelsPerItem } from './lib/hooks/useSelectionGroupLabelsPerItem';
46
47
  export { getMeasurementsFromMaintenanceDataApi } from './lib/services/api/api-measuringPoints';
47
48
  export { getPlantsCachedOrApi, getPlantsFromApi } from './lib/services/api/api-plants';
48
49
  export { RegisteredComponentName } from './lib/services/componentRegistry/componentRegistry';
@@ -127,6 +128,7 @@ declare const EchoFramework: Readonly<{
127
128
  isScreenMobileSize: boolean;
128
129
  screenOrientation: import("./lib/types/hookLibrary").ScreenOrientation;
129
130
  };
131
+ useSelectionGroupLabelsPerItem: () => Map<string, string[]>;
130
132
  useTabTitle(): void;
131
133
  useTagDetails({ instCode, tagNo }: {
132
134
  tagNo: string;
@@ -8,5 +8,6 @@ export * from './usePlantAvailableIn3d';
8
8
  export * from './usePlantAvailableIn3dWeb';
9
9
  export * from './useScreenOrientation';
10
10
  export * from './useScreenValues';
11
+ export * from './useSelectionGroupLabelsPerItem';
11
12
  export * from './useTabTitle';
12
13
  export * from './useTagDetails';
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Custom hook that creates a mapping between selection items and their associated group labels.
3
+ *
4
+ * This hook is primarily used in 3D Web for determining which selection groups
5
+ * contain specific items. It's particularly useful for Legend components that need to display
6
+ * which lists/groups items belong to and their associated colors.
7
+ *
8
+ * @returns {Map<string, string[]>} A Map where:
9
+ * - Key: Item ID as a string (converted using globalSelectionUtils.itemIdToString)
10
+ * - Value: Array of group labels that the item belongs to
11
+ *
12
+ * @example
13
+ * ```typescript
14
+ * const itemGroupLabels = useSelectionGroupLabelsPerItem();
15
+ * const groupsForItem = itemGroupLabels.get('item-123');
16
+ * // Returns: ['Group A', 'Group B'] if item-123 belongs to both groups
17
+ * ```
18
+ */
19
+ export declare const useSelectionGroupLabelsPerItem: () => Map<string, string[]>;