@equinor/echo-framework 0.26.7 → 0.26.9

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.
Files changed (49) hide show
  1. package/index.cjs.js +3 -3
  2. package/package.json +9 -9
  3. package/src/index.d.ts +3 -0
  4. package/src/lib/__mocks__/mockedProjects.d.ts +16 -0
  5. package/src/lib/__mocks__/mockedTags.d.ts +5 -0
  6. package/src/lib/__mocks__/mockedWorkOrders.d.ts +4 -0
  7. package/src/lib/__mocks__/plants.d.ts +17 -0
  8. package/src/lib/components/echoLogo/echoLogo.d.ts +1 -0
  9. package/src/lib/components/fullScreenButtons/FullScreenModeButton.d.ts +8 -1
  10. package/src/lib/components/prepview/panels/objects/HorizontalObjects.d.ts +1 -1
  11. package/src/lib/components/prepview/panels/objects/Objects.d.ts +1 -1
  12. package/src/lib/feature/equipment/hooks/useOpenEquipmentDetails.d.ts +27 -4
  13. package/src/lib/feature/globalSelection/components/AddToSelectionMenuTrigger/AddToSelectionMenuItem.d.ts +8 -0
  14. package/src/lib/feature/globalSelection/components/AddToSelectionMenuTrigger/AddToSelectionMenuTrigger.d.ts +6 -0
  15. package/src/lib/feature/globalSelection/components/SelectionActionBar.d.ts +2 -3
  16. package/src/lib/feature/globalSelection/globalSelection.api.d.ts +10 -2
  17. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.repository.d.ts +5 -2
  18. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +11 -5
  19. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.utils.d.ts +3 -0
  20. package/src/lib/feature/globalSelection/index.d.ts +1 -0
  21. package/src/lib/feature/globalSelection/selectionMenu/hooks/useGlobalSelectionColorsSortedByFrequency.d.ts +2 -0
  22. package/src/lib/feature/globalSelection/selectionMenu/hooks/useMoveSelectionTreeItems.d.ts +10 -0
  23. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/selectionTree.action.types.d.ts +7 -2
  24. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +11 -2
  25. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.utils.d.ts +13 -2
  26. package/src/lib/feature/legend/components/pdfMarkers/subComponents/MultipleMarkersByLegends.d.ts +8 -12
  27. package/src/lib/feature/legend/components/pdfMarkers/subComponents/components/PopoverLoading.d.ts +2 -0
  28. package/src/lib/feature/legend/components/pdfMarkers/subComponents/hooks/usePopoverHandler.d.ts +7 -0
  29. package/src/lib/feature/legend/components/popover/LegendPopoverContent.d.ts +1 -0
  30. package/src/lib/feature/legend/types/legendStrategy.type.d.ts +7 -2
  31. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointHistoryList/hooks/useMeasuringChartConfig.d.ts +1 -1
  32. package/src/lib/feature/measuringPoint/hooks/useOpenMeasuringPointDetails.d.ts +25 -2
  33. package/src/lib/feature/workOrder/components/WorkOrderPanelSafeX/WorkOrderPanelSafeX.d.ts +5 -0
  34. package/src/lib/feature/workOrder/components/WorkOrderPanelSafeX/api/api-prepview-workOrder-safetyCards.d.ts +6 -0
  35. package/src/lib/feature/workOrder/components/WorkOrderPanelSafeX/components/SSUListItem/SSUListItem.d.ts +6 -0
  36. package/src/lib/feature/workOrder/components/WorkOrderPanelSafeX/components/SSUListItem/SSUListItemMarker.d.ts +5 -0
  37. package/src/lib/feature/workOrder/components/WorkOrderPanelSafeX/hooks/usePrepviewWorkOrderSafetyCards.d.ts +6 -0
  38. package/src/lib/feature/workOrder/components/WorkOrderPanelSafeX/types/workOrder-safetyCards.d.ts +16 -0
  39. package/src/lib/hooks/hookLibrary.d.ts +20 -1
  40. package/src/lib/hooks/useOpenPrepview.d.ts +25 -0
  41. package/src/lib/icons/index.d.ts +13 -0
  42. package/src/lib/services/eventHubActions/toastActions.d.ts +1 -1
  43. package/src/lib/services/leftPanelNavigation/index.d.ts +1 -0
  44. package/src/lib/services/leftPanelNavigation/leftPanelNavigation.store.types.d.ts +0 -1
  45. package/src/lib/services/leftPanelNavigation/leftPanelNavigation.utils.d.ts +12 -0
  46. package/src/lib/types/dataAccess/dataAccessLinks.d.ts +34 -0
  47. package/src/lib/types/dataAccess/index.d.ts +1 -0
  48. package/src/lib/types/hookLibrary.d.ts +1 -0
  49. package/src/lib/utils/asyncUtils.d.ts +2 -0
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "0.26.7",
3
+ "version": "0.26.9",
4
4
  "peerDependencies": {
5
- "@equinor/echo-base": ">= 0.26.6 < 0.27.0",
6
- "@equinor/echo-components": ">= 0.26.6 < 0.27.0",
7
- "@equinor/echo-core": ">= 0.26.6 < 0.27.0",
8
- "@equinor/echo-search": ">= 0.26.6 < 0.27.0",
9
- "@equinor/echo-utils": ">= 0.26.7 < 0.27.0",
5
+ "@equinor/echo-base": ">= 0.26.8 < 0.27.0",
6
+ "@equinor/echo-components": ">= 0.26.9 < 0.27.0",
7
+ "@equinor/echo-core": ">= 0.26.8 < 0.27.0",
8
+ "@equinor/echo-search": ">= 0.26.8 < 0.27.0",
9
+ "@equinor/echo-utils": ">= 0.26.9 < 0.27.0",
10
10
  "@equinor/eds-core-react": "0.43.0",
11
11
  "@equinor/eds-icons": "0.22.0",
12
12
  "react": ">= 17.0.2",
@@ -19,13 +19,13 @@
19
19
  "react-router-dom": "5.3.4",
20
20
  "zustand": ">= 4.4.7 < 5",
21
21
  "immer": "10.1.1",
22
- "ag-charts-enterprise": "11.3.2"
22
+ "ag-charts-enterprise": "12.0.2"
23
23
  },
24
24
  "dependencies": {
25
25
  "dexie": "4.0.11",
26
26
  "mark.js": "8.11.1",
27
- "ag-charts-community": "11.3.2",
28
- "ag-charts-react": "11.3.2"
27
+ "ag-charts-community": "12.0.2",
28
+ "ag-charts-react": "12.0.2"
29
29
  },
30
30
  "main": "./index.cjs.js",
31
31
  "type": "commonjs",
package/src/index.d.ts CHANGED
@@ -17,10 +17,12 @@ export * from './lib/feature/equipment/index';
17
17
  export * from './lib/feature/globalSelection';
18
18
  export { SelectionActionBar } from './lib/feature/globalSelection/components/SelectionActionBar';
19
19
  export { PanTo3DButton } from './lib/feature/globalSelection/panToEcho3d/panTo3DButton';
20
+ export { useGlobalSelectionColorsSortedByFrequency } from './lib/feature/globalSelection/selectionMenu/hooks/useGlobalSelectionColorsSortedByFrequency';
20
21
  export { useIsAllIGlobalSelectionItemsHidden } from './lib/feature/globalSelection/selectionMenu/hooks/useIsAllIGlobalSelectionItemsHidden';
21
22
  export { GlobalSelectionCategoryId } from './lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types';
22
23
  export * from './lib/feature/legacyLegend/index';
23
24
  export { PositionalLegendMarkers } from './lib/feature/legend/components/pdfMarkers/PositionalLegendMarkers';
25
+ export { PopoverLoading } from './lib/feature/legend/components/pdfMarkers/subComponents/components/PopoverLoading';
24
26
  export * from './lib/feature/legend/index';
25
27
  export { legendVisibleTagsSubscribeToStore } from './lib/feature/legend/legendVisibleDataAsTagsStore';
26
28
  export type { LegendDataId, LegendEquipmentId, LegendState, LegendTagId } from './lib/feature/legend/types/legendType';
@@ -52,6 +54,7 @@ export * from './lib/services/locationService/locationService';
52
54
  export { createSimpleStore } from './lib/services/stores/createSimpleStore';
53
55
  export * from './lib/services/userSetting';
54
56
  export * from './lib/types/api-echohub';
57
+ export { dataAccessLinks } from './lib/types/dataAccess/dataAccessLinks';
55
58
  export type { EchoHubPlant } from './lib/types/echoHubPlant';
56
59
  export * from './lib/types/eventTypes';
57
60
  export * from './lib/types/extensions';
@@ -0,0 +1,16 @@
1
+ export declare const mockedProjects: {
2
+ projectCode: string;
3
+ stidDeliveryCode: number;
4
+ description: string;
5
+ isRevProject: string;
6
+ filter: {
7
+ value: string;
8
+ text: string;
9
+ };
10
+ instCode: string;
11
+ insertedDate: string;
12
+ insertedBy: string;
13
+ updatedDate: string;
14
+ updatedBy: string;
15
+ validFlg: string;
16
+ }[];
@@ -0,0 +1,5 @@
1
+ import { TagSummaryDto } from '@equinor/echo-search';
2
+ export declare const mockedArchivedTags: TagSummaryDto[];
3
+ export declare const mockedNonArchivedTags: TagSummaryDto[];
4
+ export declare const mockedTags: TagSummaryDto[];
5
+ export declare const estimatedTagCount: number;
@@ -0,0 +1,4 @@
1
+ import { WorkOrderDetailsDto } from '@equinor/echo-search';
2
+ export declare const mockedOpenWorkOrders: WorkOrderDetailsDto[];
3
+ export declare const mockedClosedWorkOrders: WorkOrderDetailsDto[];
4
+ export declare const mockedWorkOrders: WorkOrderDetailsDto[];
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Start Mock Data
3
+ *
4
+ * Just some quick data as a Proof of Concept.
5
+ * When continuing on this, we should extract it to a data folder,
6
+ * and have helper functions for getting the data in the handlers below.
7
+ */
8
+ export interface Plant {
9
+ instCode: string;
10
+ hasTr2000: boolean;
11
+ description: string;
12
+ sapPlantId: string;
13
+ proCoSysPlantId: string;
14
+ }
15
+ export declare const mockedInstCodeName = "MockedInstCode";
16
+ export declare const mockedSapPlantId = "1234";
17
+ export declare const plants: Plant[];
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  interface Props {
3
3
  className?: string;
4
+ subtitle?: string | React.ReactNode;
4
5
  }
5
6
  export declare const EchoLogo: React.FC<Props>;
6
7
  export {};
@@ -1,2 +1,9 @@
1
1
  import React from 'react';
2
- export declare const FullScreenModeButton: React.FC;
2
+ interface FullScreenModeButtonProps {
3
+ active?: boolean;
4
+ dataTestId?: string;
5
+ onClick?: () => void;
6
+ toolTipDisabled?: boolean;
7
+ }
8
+ export declare const FullScreenModeButton: React.FC<FullScreenModeButtonProps>;
9
+ export {};
@@ -2,5 +2,5 @@ import { PrepviewObject } from '../../types';
2
2
  interface HorizontalObjectProps {
3
3
  objects: PrepviewObject[];
4
4
  }
5
- declare function HorizontalObject({ objects }: HorizontalObjectProps): import("react/jsx-runtime").JSX.Element;
5
+ declare function HorizontalObject({ objects }: Readonly<HorizontalObjectProps>): import("react/jsx-runtime").JSX.Element;
6
6
  export { HorizontalObject };
@@ -1,5 +1,5 @@
1
1
  interface Props {
2
2
  workOrderId: string;
3
3
  }
4
- declare function ObjectsPanel({ workOrderId }: Props): import("react/jsx-runtime").JSX.Element;
4
+ declare function ObjectsPanel({ workOrderId }: Readonly<Props>): import("react/jsx-runtime").JSX.Element;
5
5
  export { ObjectsPanel };
@@ -1,11 +1,34 @@
1
1
  /**
2
- * Opens equipment details panel on the left side of the screen
3
- * @returns {function}
2
+ * Custom hook that returns a function to open equipment details in a side panel.
3
+ *
4
+ * The returned function accepts an `OpenEquipmentArgs` object, which specifies the equipment to display,
5
+ * the panel to use, and additional options such as toggling and navigation behavior.
6
+ *
7
+ * If `allowToggle` is true and the equipment is already open in the specified panel, the panel will be closed.
8
+ * Otherwise, the panel will be activated and populated with the equipment details.
9
+ *
10
+ * @returns A function that opens equipment details in the left panel based on the provided arguments.
11
+ *
12
+ * @example
13
+ * const openEquipmentDetails = useOpenEquipmentDetails();
14
+ * openEquipmentDetails({ equipmentId: '123', tagNo: 'TAG-001', plantNo: 'PLANT-01' });
15
+ *
16
+ * Returns a function that opens the equipment details panel with the specified arguments.
17
+ * @param args - The arguments for opening the equipment details panel.
18
+ * @param args.equipmentId - The unique identifier of the equipment to display.
19
+ * @param args.tagNo - (Optional) The tag number of the equipment.
20
+ * @param args.plantNo - (Optional) The plant number associated with the equipment.
21
+ * @param args.panelKey - (Optional) The key of the panel to open. Defaults to the core search panel if not provided.
22
+ * @param args.keepLastNavigationItem - (Optional) Whether to keep the last navigation item in the panel.
23
+ * @param args.allowToggle - (Optional) If true, toggles the panel open/closed if the same item is already open.
24
+ *
25
+ * @returns A function that, when called with the above arguments, opens the equipment details panel accordingly.
4
26
  */
5
27
  export declare function useOpenEquipmentDetails(): (args: {
6
28
  equipmentId: string;
7
- tagNo: string | undefined;
8
- plantNo: string | undefined;
29
+ tagNo?: string;
30
+ plantNo?: string;
9
31
  panelKey?: string;
10
32
  keepLastNavigationItem?: boolean;
33
+ allowToggle?: boolean;
11
34
  }) => void;
@@ -0,0 +1,8 @@
1
+ import { Guid } from '@equinor/echo-utils';
2
+ import { SelectionGroup } from '../../selectionMenu/selectionTreeStore/selectionTree.store.types';
3
+ interface AddToSelectionMenuItemProps {
4
+ group: SelectionGroup;
5
+ onAddToSelection: (groupId: Guid) => void;
6
+ }
7
+ export declare const AddToSelectionMenuItem: (props: AddToSelectionMenuItemProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import { Guid } from '@equinor/echo-utils';
2
+ interface AddToSelectionMenuTriggerProps {
3
+ onAddToSelection: (groupId: Guid) => void;
4
+ }
5
+ export declare const AddToSelectionMenuTrigger: (props: AddToSelectionMenuTriggerProps) => import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -1,9 +1,8 @@
1
+ import { Guid } from '@equinor/echo-utils';
1
2
  import { GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
2
3
  export interface SelectionActionBarProps {
3
4
  itemId: GlobalSelectionTypes.ItemId;
4
- onAddItemClick: () => void;
5
+ onAddItemClick: (groupId: Guid) => void;
5
6
  className?: string;
6
- darkBackground?: boolean;
7
- buttonSize?: 'medium' | 'small';
8
7
  }
9
8
  export declare const SelectionActionBar: React.FC<SelectionActionBarProps>;
@@ -66,6 +66,7 @@ export declare const globalSelectionApi: Readonly<{
66
66
  * @param {AddItemArgs} args - The arguments for adding tags.
67
67
  * @param {Array<string>} args.itemIds - The IDs of the items to add tags to.
68
68
  * @param {boolean} [args.replaceItems=false] - Whether to replace existing items with the new tags.
69
+ * @param {Guid} args.groupId - Optional. The ID of the list to which the items should be added. If not provided, it will be added to the "Local Selection".
69
70
  * @returns {Promise<AddTagsResponse>} response The response of the add tags action.
70
71
  * @returns {Array<Object>} response.tagFetchResults - The results of the tag fetch operation.
71
72
  * @returns {string} response.actionResult - The result of the action, if 'getActionResult' is set to true. It can be the following:
@@ -79,7 +80,7 @@ export declare const globalSelectionApi: Readonly<{
79
80
  * Adds work orders to a specified list in the selection menu panel.
80
81
  *
81
82
  * @param {Object} args - The arguments for adding work orders.
82
- * @param {Guid} args.groupId - Optional. The ID of the list to which the work orders should be added. If not provided, it will be added to the "Local Selection".
83
+ * @param {Guid} args.groupId - Optional. The ID of the list to which the items should be added. If not provided, it will be added to the "Local Selection".
83
84
  * @param {Readonly<Readonly<GlobalSelectionTypes.WorkOrderId>[]>} args.items - An array of WorkOrderId objects representing the work orders to be added.
84
85
  */
85
86
  workOrders: (args: import("./selectionMenu/selectionTreeStore/actions/selectionTree.action.types").AddItemArgs<GlobalSelectionTypes.WorkOrderId>) => import("./selectionMenu/selectionTreeStore/selectionTree.store.types").AddWorkOrdersReturnType;
@@ -103,12 +104,13 @@ export declare const globalSelectionApi: Readonly<{
103
104
  * Adds items to a specified list in the selection menu panel.
104
105
  *
105
106
  * @param {Object} args - The arguments for adding items.
106
- * @param {Guid} args.groupId - Optional. The ID of the list to which the items should be added. If not provided, the default list ID is used.
107
+ * @param {Guid} args.groupId - Optional. The ID of the list to which the items should be added. If not provided, it will be added to the "Local Selection".
107
108
  * @param {GlobalSelectionTypes.ItemId[]} args.itemIds - ItemIds to be added. Only tags or work orders can be added for now.
108
109
  *
109
110
  */
110
111
  addItems: (args: {
111
112
  itemIds: GlobalSelectionTypes.ItemId[];
113
+ groupId?: import("@equinor/echo-utils").Guid;
112
114
  } & import("./selectionMenu/selectionTreeStore/actions/selectionTree.action.types").AddByGroupIdAndLabel) => void;
113
115
  }>;
114
116
  search: {
@@ -155,6 +157,12 @@ export declare const globalSelectionApi: Readonly<{
155
157
  isVisible: boolean;
156
158
  }) => void;
157
159
  }>;
160
+ color: Readonly<{
161
+ setByItemIds: (args: {
162
+ itemIds: Readonly<Readonly<GlobalSelectionTypes.ItemId>>[];
163
+ color: string;
164
+ }) => void;
165
+ }>;
158
166
  errorStatus: Readonly<{
159
167
  /**
160
168
  * Sets the error status for specific items in the selection menu panel.
@@ -1,8 +1,11 @@
1
1
  import { PersistOptions } from 'zustand/middleware';
2
+ import { PersistedSelectionGroup } from '../selectionMenu/selectionTreeStore/selectionTree.store.types';
2
3
  import { GlobalSelectionStore } from './globalSelectionStore.types';
3
- declare function loadAndPopulateStoreMetadata(store: GlobalSelectionStore): Promise<void>;
4
+ declare function loadAndPopulateStoreMetadataFromDisk(store: GlobalSelectionStore): Promise<void>;
5
+ declare function loadAndPopulateStoreMetadataFromApi(store: GlobalSelectionStore, data: PersistedSelectionGroup[]): Promise<void>;
4
6
  export declare const globalSelectionRepository: {
5
- loadAndPopulateStoreMetadata: typeof loadAndPopulateStoreMetadata;
7
+ loadAndPopulateStoreMetadataFromDisk: typeof loadAndPopulateStoreMetadataFromDisk;
8
+ loadAndPopulateStoreMetadataFromApi: typeof loadAndPopulateStoreMetadataFromApi;
6
9
  persistOptions: PersistOptions<GlobalSelectionStore, GlobalSelectionStore>;
7
10
  };
8
11
  export {};
@@ -40,7 +40,11 @@ export interface GlobalSelectionMetaData {
40
40
  errorStatus?: string;
41
41
  systemStatus: SelectionItemSystemStatus;
42
42
  }
43
- type GlobalSelectionGenericItem<T extends GlobalSelectionItemType> = {
43
+ export interface GlobalSelectionItemIdMetadata {
44
+ itemId: GlobalSelectionTypes.ItemId;
45
+ metaData: Partial<PersistedGlobalSelectionMetaData>;
46
+ }
47
+ export type GlobalSelectionGenericItem<T extends GlobalSelectionItemType> = {
44
48
  id: GlobalSelectionTypes.ItemId;
45
49
  type: T;
46
50
  data: GlobalSelectionTypes.ItemTypeToDataMap[T];
@@ -71,6 +75,10 @@ export interface GlobalSelectionStore extends GlobalSelectionStoreData {
71
75
  removeItemsFromSelection: (args: {
72
76
  itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
73
77
  }) => void;
78
+ setColorByItemIds: (args: {
79
+ itemIds: Readonly<Readonly<GlobalSelectionTypes.ItemId>>[];
80
+ color: string;
81
+ }) => void;
74
82
  setVisibilityByItemIds: (args: {
75
83
  itemIds: Readonly<Readonly<GlobalSelectionTypes.ItemId>>[];
76
84
  isVisible: boolean;
@@ -78,10 +86,7 @@ export interface GlobalSelectionStore extends GlobalSelectionStoreData {
78
86
  setAllItemsVisibility: (args: {
79
87
  isVisible: boolean;
80
88
  }) => void;
81
- setItemMetaData: (args: ReadonlyArray<{
82
- itemId: GlobalSelectionTypes.ItemId;
83
- metaData: Partial<GlobalSelectionMetaData>;
84
- }>) => void;
89
+ setItemMetaData: (args: ReadonlyArray<GlobalSelectionItemIdMetadata>) => void;
85
90
  resetItemErrorStatuses: () => void;
86
91
  getStoredItemIds: () => Readonly<GlobalSelectionTypes.ItemId[]>;
87
92
  resetState: () => void;
@@ -97,6 +102,7 @@ export type GlobalSelectionAddItemResult<DataType> = {
97
102
  fetchResult: DataType;
98
103
  actionResult: GlobalSelectionActionResult;
99
104
  };
105
+ export type PersistedGlobalSelectionMetaData = Pick<GlobalSelectionMetaData, 'color' | 'isHiddenByUser'>;
100
106
  export declare namespace GlobalSelectionTypes {
101
107
  type WorkOrderId = Pick<GlobalSelectionWorkOrderDto, 'workOrderId'>;
102
108
  type EquipmentId = Pick<GlobalSelectionEquipmentDto, 'equipmentId'>;
@@ -34,6 +34,7 @@ declare function mapToId(item: GlobalSelectionTypes.MeasuringPointId): GlobalSel
34
34
  declare function mapToId(item: GlobalSelectionTypes.ItemId): GlobalSelectionTypes.ItemId;
35
35
  declare function itemIdToString(itemId: GlobalSelectionTypes.ItemId): GlobalSelectionTypes.ItemIdString;
36
36
  export declare function mapIdToItemType(itemId: GlobalSelectionTypes.ItemId): GlobalSelectionItemType;
37
+ export declare function sortByFrequency(list: string[]): string[];
37
38
  /**
38
39
  * A utility object that provides various functions for handling global selections.
39
40
  *
@@ -44,6 +45,7 @@ export declare function mapIdToItemType(itemId: GlobalSelectionTypes.ItemId): Gl
44
45
  * @property {Function} idsEqual - Compares two global selection item IDs for equality.
45
46
  * @property {Function} mapToId - Maps an object to its global selection item ID.
46
47
  * @property {Function} itemIdToString - Converts a global selection item id object to a string, each value is concatenated by a '-'
48
+ * @property {Function} sortByFrequency - Sorts and aggregates a list of strings.
47
49
  */
48
50
  export declare const globalSelectionUtils: Readonly<{
49
51
  isMeasuringPointId: typeof isMeasuringPointId;
@@ -54,5 +56,6 @@ export declare const globalSelectionUtils: Readonly<{
54
56
  mapToId: typeof mapToId;
55
57
  mapIdToItemType: typeof mapIdToItemType;
56
58
  itemIdToString: typeof itemIdToString;
59
+ sortByFrequency: typeof sortByFrequency;
57
60
  }>;
58
61
  export {};
@@ -8,6 +8,7 @@ export { useGlobalSelectionLists } from './hooks/useGlobalSelectionLists';
8
8
  export { useGlobalSelectionTags } from './hooks/useGlobalSelectionTags';
9
9
  export { useGlobalSelectionWorkOrders } from './hooks/useGlobalSelectionWorkOrders';
10
10
  export { useSelectionCategoriesByGroupId } from './hooks/useSelectionCategoriesByGroupId';
11
+ export { useMoveSelectionTreeItems } from './selectionMenu/hooks/useMoveSelectionTreeItems';
11
12
  export { useSelectionMenuGroups } from './selectionMenu/hooks/useSelectionMenuGroups';
12
13
  export { loadEchoViewIdAndSelectionIdFromUrl } from '../../services/echoViewService/loadEchoViewIdAndSelectionIdFromUrl';
13
14
  export { RemoveSelectionItemsConfirmDialog } from './components/RemoveSelectionItemsConfirmDialog';
@@ -0,0 +1,2 @@
1
+ import { SelectionTreeTypes } from '../selectionTreeStore/selectionTree.store.types';
2
+ export declare function useGlobalSelectionColorsSortedByFrequency(categories: SelectionTreeTypes.Category[]): string[];
@@ -0,0 +1,10 @@
1
+ import { Guid } from '@equinor/echo-utils';
2
+ import { GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
3
+ import { GlobalSelectionCategoryId } from '../selectionTreeStore/selectionTree.store.types';
4
+ type MoveSelectionArgs = {
5
+ sourceGroupId: Guid;
6
+ sourceCategoryId?: GlobalSelectionCategoryId;
7
+ sourceItemId?: GlobalSelectionTypes.ItemId;
8
+ };
9
+ export declare const useMoveSelectionTreeItems: (args: MoveSelectionArgs) => ((newGroupId: Guid) => void) | undefined;
10
+ export {};
@@ -1,11 +1,15 @@
1
1
  import { ResultArray } from '@equinor/echo-search';
2
+ import { Guid } from '@equinor/echo-utils';
2
3
  import { GlobalSelectionItemType, GlobalSelectionItemTypeToDataMap, GlobalSelectionTypes, SelectionItemTypeToItemIdMap } from '../../../globalSelectionStore/globalSelectionStore.types';
4
+ /**
5
+ * @deprecated A group should not be created with label and subLabel.
6
+ * Use `groupId` instead to specify the group.
7
+ * This type will be removed in the future.
8
+ */
3
9
  export type AddByGroupIdAndLabel = {
4
- groupId?: string;
5
10
  label: string;
6
11
  subLabel: string;
7
12
  } | {
8
- groupId?: string;
9
13
  label?: undefined;
10
14
  subLabel?: undefined;
11
15
  };
@@ -13,6 +17,7 @@ export type AddItemArgs<ItemIdType extends GlobalSelectionTypes.ItemId> = {
13
17
  itemIds: Readonly<ItemIdType[]>;
14
18
  replaceItems?: boolean;
15
19
  getActionResult?: boolean;
20
+ groupId?: Guid;
16
21
  } & AddByGroupIdAndLabel;
17
22
  export type AddItemsResponse<T extends GlobalSelectionItemType> = {
18
23
  fetchResults: ResultArray<GlobalSelectionItemTypeToDataMap[T]>[];
@@ -1,5 +1,5 @@
1
1
  import { Guid } from '@equinor/echo-utils';
2
- import { GlobalSelectionItemType, GlobalSelectionTypes, SelectionItemTypeToItemIdMap } from '../../globalSelectionStore/globalSelectionStore.types';
2
+ import { GlobalSelectionItemType, GlobalSelectionTypes, PersistedGlobalSelectionMetaData, SelectionItemTypeToItemIdMap } from '../../globalSelectionStore/globalSelectionStore.types';
3
3
  import { AddByGroupIdAndLabel, AddItemArgs, AddItemsResponse, SelectionTreeActionResult } from './actions/selectionTree.action.types';
4
4
  export declare enum GlobalSelectionCategoryId {
5
5
  Tags = "DEFAULT_TAG_LIST_ID",
@@ -12,6 +12,11 @@ export type SelectionTreeItem<T extends GlobalSelectionItemType> = {
12
12
  readonly id: SelectionItemTypeToItemIdMap[T];
13
13
  readonly type: T;
14
14
  };
15
+ export type PersistedSelectionTreeItem<T extends GlobalSelectionItemType> = {
16
+ readonly id: SelectionItemTypeToItemIdMap[T];
17
+ readonly type: T;
18
+ readonly metaData: PersistedGlobalSelectionMetaData;
19
+ };
15
20
  export interface SelectionBase {
16
21
  readonly groupId: Guid;
17
22
  readonly label: string;
@@ -25,7 +30,7 @@ export interface SelectionCategory {
25
30
  export interface PersistedSelectionCategory {
26
31
  readonly id: GlobalSelectionCategoryId;
27
32
  readonly label: string;
28
- readonly items: SelectionTreeItem<GlobalSelectionItemType>[];
33
+ readonly items: PersistedSelectionTreeItem<GlobalSelectionItemType>[];
29
34
  }
30
35
  export interface SelectionGroup extends SelectionBase {
31
36
  readonly categories: SelectionCategory[];
@@ -40,6 +45,7 @@ export interface SelectionTreeStore {
40
45
  groups: SelectionGroup[];
41
46
  addItems: (args: {
42
47
  itemIds: GlobalSelectionTypes.ItemId[];
48
+ groupId?: Guid;
43
49
  } & AddByGroupIdAndLabel) => void;
44
50
  addTags: (args: AddItemArgs<GlobalSelectionTypes.TagId>) => AddTagsReturnType;
45
51
  addWorkOrders: (args: AddItemArgs<GlobalSelectionTypes.WorkOrderId>) => AddWorkOrdersReturnType;
@@ -57,6 +63,9 @@ export interface SelectionTreeStore {
57
63
  findGroupIdByLabel: (args: {
58
64
  label: string;
59
65
  }) => Guid | undefined;
66
+ findGroupById: (args: {
67
+ id: Guid;
68
+ }) => SelectionGroup | undefined;
60
69
  removeItemsById: (args: {
61
70
  groupId?: Guid;
62
71
  categoryId: GlobalSelectionCategoryId;
@@ -1,5 +1,5 @@
1
1
  import { Guid } from '@equinor/echo-utils';
2
- import { GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
2
+ import { GlobalSelectionItemType, GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
3
3
  import { GlobalSelectionCategoryId, SelectionTreeTypes } from './selectionTree.store.types';
4
4
  /**
5
5
  * Check if an item ID is present in the selection tree.
@@ -61,7 +61,7 @@ export declare function itemsNotFoundInSelectionTree(args: {
61
61
  * @param {Object} args - The function arguments.
62
62
  * @param {GlobalSelectionTypes.ItemId[]} args.itemIds - The array of item IDs to search for.
63
63
  * @param {SelectionTreeTypes.Group[]} args.groups - The selection tree groups to search within.
64
- * @returns {string[]} An array of group IDs, with labels and sublabels, where any of the item IDs are found.
64
+ * @returns {Object[]} An array of group IDs, with labels and sublabels, where any of the item IDs are found.
65
65
  */
66
66
  export declare function getGroupIdsByItemIds(args: {
67
67
  itemIds: GlobalSelectionTypes.ItemId[];
@@ -71,6 +71,16 @@ export declare function getGroupIdsByItemIds(args: {
71
71
  label: string;
72
72
  subLabel?: string;
73
73
  }[];
74
+ /**
75
+ * Checks if the items in a given group's category are the same as the provided item IDs.
76
+ *
77
+ * @param args - The arguments object.
78
+ * @param args.itemIds - An array of item IDs to compare.
79
+ * @param args.groups - An array of groups to search within.
80
+ * @param args.groupId - The ID of the group to check.
81
+ * @param args.categoryId - The ID of the category within the group to check.
82
+ * @returns `true` if the items in the group are the same as the provided item IDs, otherwise `false`.
83
+ */
74
84
  export declare function areItemsTheSameInGroup<ItemType extends GlobalSelectionTypes.ItemId>(args: {
75
85
  itemIds: ItemType[];
76
86
  groups: SelectionTreeTypes.Group[];
@@ -93,3 +103,4 @@ export declare function removeGroupIfEmpty(allGroups: SelectionTreeTypes.Group[]
93
103
  * @returns {void}
94
104
  */
95
105
  export declare function removeItemsFromGlobalSelection(groups: SelectionTreeTypes.Group[], itemIds: GlobalSelectionTypes.ItemId[]): void;
106
+ export declare function getItemsByIdsFromGlobalSelectionStore(itemIds: GlobalSelectionTypes.ItemId[]): GlobalSelectionTypes.GenericItem<GlobalSelectionItemType>[];
@@ -2,18 +2,13 @@ import React from 'react';
2
2
  import { LegendDataId, LegendId } from '../../../types/legendType';
3
3
  interface MultipleMarkersByLegendsProps {
4
4
  itemId: LegendDataId;
5
- /**
6
- * Flag to indicate if the marker should have a pointer, currently in lower right corner.
7
- */
8
5
  hasPointer: boolean;
9
- setOpenItem: (value: PopoverContent | undefined) => void;
10
- /**
11
- * We use active for the icon. So several icons might be active if they have the same tagNo on the PDF, but only 1 of them is open.
12
- */
13
- activeItem: ActiveItem | undefined;
14
- openPopover?: PopoverContent;
15
- popoverElements?: ReadonlyArray<JSX.Element>;
6
+ onOpenPopover: RequestPopoverHandler;
7
+ onClosePopover: () => void;
8
+ currentPopover?: PopoverContent;
9
+ positionString: string;
16
10
  }
11
+ export type RequestPopoverHandler = (itemId: LegendDataId, legendId: LegendId, positionString: string, fetchPopoverContent: () => Promise<ReadonlyArray<React.JSX.Element>>) => void;
17
12
  export interface PopoverContent {
18
13
  elements: ReadonlyArray<JSX.Element>;
19
14
  activeItem: ActiveItem;
@@ -24,15 +19,16 @@ export interface PopoverContent {
24
19
  interface ActiveItem {
25
20
  itemId: LegendDataId;
26
21
  legendId: LegendId;
22
+ positionString: string;
27
23
  }
28
24
  /**
29
25
  * Renders 1 marker for each legend.
30
26
  *
31
27
  * @param {LegendDataId} itemId - The ID of the legend item.
32
28
  * @param {boolean} hasPointer - Flag to indicate if the marker should have a pointer, currently in lower right corner.
33
- * @param {string} popoverOffset - The offset for the popover.
29
+ * @param {RequestPopoverHandler} onOpenPopover - Callback invoked when a marker is clicked; fetchPopoverContent should be called to fetch/populate the popover.
30
+ * @param {() => void} onClosePopover - Callback invoked to close the popover
34
31
  * @param {(value: PopoverContent | undefined) => void} setOpenItem - Callback function to handle opening the popover.
35
- * @param {ActiveItem | undefined} activeItem - We use active for the icon. Several icons might be active if they have the same tagNo on the PDF, but only 1 of them is open.
36
32
  */
37
33
  export declare const MultipleMarkersByLegendsComponent: React.FC<MultipleMarkersByLegendsProps>;
38
34
  export declare const MultipleMarkersByLegends: React.NamedExoticComponent<MultipleMarkersByLegendsProps>;
@@ -0,0 +1,2 @@
1
+ declare const PopoverLoading: React.FC;
2
+ export { PopoverLoading };
@@ -0,0 +1,7 @@
1
+ import { LegendDataId, LegendId } from '../../../../types/legendType';
2
+ import { PopoverContent } from '../MultipleMarkersByLegends';
3
+ export declare function usePopoverHandler(): {
4
+ currentPopover: PopoverContent | undefined;
5
+ handleOpenPopover: (itemId: LegendDataId, legendId: LegendId, positionString: string, fetchPopoverContent: () => Promise<ReadonlyArray<React.JSX.Element>>) => Promise<void>;
6
+ handleClosePopover: () => void;
7
+ };
@@ -9,6 +9,7 @@ export interface LegendPopoverContentProps {
9
9
  onPopoverClicked?: () => void;
10
10
  children?: React.ReactNode;
11
11
  excludedLegendTitles?: ReadonlyArray<string>;
12
+ showAddToSelectionButton?: boolean;
12
13
  }
13
14
  export type LegendPopoverTertiaryLabels = {
14
15
  first: string;
@@ -22,9 +22,14 @@ export interface LegendStrategy {
22
22
  */
23
23
  useMarkers: (itemIds: ReadonlyArray<LegendDataId>) => ReadonlyArray<Marker>;
24
24
  /**
25
- * Returns the paginable popover content for the given itemId. One tagId can for example have multiple work-orders.
25
+ * Returns popover content that supports pagination for the given itemId.
26
+ *
27
+ * This function is asynchronous because the popover content may depend on data that needs to be fetched before rendering,
28
+ * such as related equipment, work orders, or other resources.
29
+ * @param {LegendDataId} itemId - The identifier for the legend item for which to render popover content.
30
+ * @returns A Promise resolving to one or more React elements to display in the popover.
26
31
  */
27
- popoverContent: (itemId: LegendDataId) => React.JSX.Element | ReadonlyArray<React.JSX.Element>;
32
+ popoverContent: (itemId: LegendDataId) => Promise<React.JSX.Element | ReadonlyArray<React.JSX.Element>>;
28
33
  /**
29
34
  * Returns the custom legend component for the legend, if this is omitted the default basicLegendRenderer will be used
30
35
  */
@@ -2,7 +2,7 @@ import { AgCartesianChartOptions } from 'ag-charts-community';
2
2
  import { MeasurementDto } from '../../../../types/measuringPoint';
3
3
  import { ActiveStyle, HandleInterpolationChange } from '../types/activeStyleType';
4
4
  export declare function useMeasuringChartConfig(measurements: MeasurementDto[], activeStyle: ActiveStyle, setActiveStyle: (style: ActiveStyle) => void, isFullscreen: boolean): {
5
- chartConfig: AgCartesianChartOptions;
5
+ chartConfig: AgCartesianChartOptions<any, unknown>;
6
6
  sortedMeasurements: import("../utils/measuringPointHistoryListUtils").SortedMeasurement[];
7
7
  pointCount: number;
8
8
  setPointCount: import("react").Dispatch<import("react").SetStateAction<number>>;
@@ -1,8 +1,30 @@
1
1
  import { MeasuringPointData } from '@equinor/echo-search';
2
2
  import { MeasurementDto } from '../types/measuringPoint';
3
3
  /**
4
- * Opens measuring point details panel on the left side of the screen
5
- * @returns {function} A function to open the measuring point details panel
4
+ * Custom hook that provides a function to open the measuring point details panel.
5
+ *
6
+ * The returned function, `openMeasuringPointDetails`, opens the measuring point details panel with the specified arguments.
7
+ * It can optionally toggle the panel, keep the last navigation item, and pass measurement data to the details component.
8
+ *
9
+ * @returns A function to open the measuring point details panel.
10
+ *
11
+ * @example
12
+ * const openMeasuringPointDetails = useOpenMeasuringPointDetails();
13
+ * openMeasuringPointDetails({
14
+ * measuringPointProps: { measuringPointId: 123, ... },
15
+ * panelKey: 'MY_PANEL',
16
+ * keepLastNavigationItem: true,
17
+ * measurements: [...],
18
+ * allowToggle: false
19
+ * });
20
+ *
21
+ * @function
22
+ * @param {Object} args - Arguments for opening the measuring point details panel.
23
+ * @param {MeasuringPointProps} args.measuringPointProps - The properties of the measuring point, including its ID and position.
24
+ * @param {string} [args.panelKey] - The key of the panel to open. Defaults to ECHO_CORE_SEARCH if not provided.
25
+ * @param {boolean} [args.keepLastNavigationItem] - Whether to keep the last navigation item in the panel.
26
+ * @param {MeasurementDto[]} [args.measurements] - Optional array of measurement data associated with the measuring point. If not provided, the UI component will fetch the measurements.
27
+ * @param {boolean} [args.allowToggle] - Whether to allow toggling the panel open/closed if the item is already open.
6
28
  */
7
29
  export declare function useOpenMeasuringPointDetails(): (args: MeasuringPointArgs) => void;
8
30
  type MeasuringPointArgs = {
@@ -10,5 +32,6 @@ type MeasuringPointArgs = {
10
32
  measurements?: MeasurementDto[];
11
33
  panelKey?: string;
12
34
  keepLastNavigationItem?: boolean;
35
+ allowToggle?: boolean;
13
36
  };
14
37
  export {};
@@ -0,0 +1,5 @@
1
+ interface WorkOrderPanelSafeXProps {
2
+ readonly workOrderId: string;
3
+ }
4
+ export declare const WorkOrderPanelSafeX: ({ workOrderId }: WorkOrderPanelSafeXProps) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,6 @@
1
+ import { PrepViewSafetyCard } from '../types/workOrder-safetyCards';
2
+ interface PrepviewWorkOrderSafetyCardsRequest {
3
+ readonly workOrderId: string;
4
+ }
5
+ export declare const getPrepviewWorkOrderSafetyCards: (args: PrepviewWorkOrderSafetyCardsRequest) => Promise<PrepViewSafetyCard[]>;
6
+ export {};