@equinor/echo-framework 4.2.0 → 4.3.0-beta-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.
Files changed (52) hide show
  1. package/{47deeba42768c5d1.svg → 063009f06499d102.svg} +8 -8
  2. package/README.md +48 -48
  3. package/{1bd97dd2170d0f64.svg → f4c85313e79b1662.svg} +850 -850
  4. package/index.cjs.js +2 -2
  5. package/index.d.ts +2 -2
  6. package/package.json +8 -8
  7. package/src/index.d.ts +3 -3
  8. package/src/lib/components/prepview/panels/tagDocumentRefs/HorizontalDocumentGroups.d.ts +1 -1
  9. package/src/lib/feature/globalSelection/components/SelectionActionBar/SelectionActionBarMenuItem.d.ts +12 -0
  10. package/src/lib/feature/globalSelection/components/SelectionActionBar.d.ts +5 -0
  11. package/src/lib/feature/globalSelection/hooks/useSelectionAction.d.ts +2 -2
  12. package/src/lib/feature/legend/components/BasicLegendRenderer.d.ts +1 -1
  13. package/src/lib/feature/legend/components/LegendSelectorContainer.d.ts +17 -0
  14. package/src/lib/feature/legend/components/pdfMarkers/subComponents/ItemMarkerPopoverContainer.d.ts +9 -0
  15. package/src/lib/feature/legend/components/popover/LegendPopoverContent.d.ts +9 -26
  16. package/src/lib/feature/legend/components/popover/LegendPopoverContent.logic.d.ts +12 -6
  17. package/src/lib/feature/legend/hooks/useGroupedMarkers.utils.d.ts +0 -4
  18. package/src/lib/feature/legend/hooks/useLegendMarker/useLegendMarker.utils.d.ts +1 -1
  19. package/src/lib/feature/legend/hooks/useLegendUniqueBadges.d.ts +1 -3
  20. package/src/lib/feature/legend/hooks/useLegendUniqueMarkers.d.ts +1 -3
  21. package/src/lib/feature/legend/index.d.ts +8 -5
  22. package/src/lib/feature/legend/legendStrategies/notificationStrategy/api/notificationsLegend.api.d.ts +7 -0
  23. package/src/lib/feature/legend/legendStrategies/notificationStrategy/components/NotificationPopover.d.ts +8 -0
  24. package/src/lib/feature/legend/legendStrategies/notificationStrategy/hooks/useNotificationMarkers.d.ts +6 -0
  25. package/src/lib/feature/legend/legendStrategies/notificationStrategy/hooks/useNotificationsByTagIds.d.ts +14 -0
  26. package/src/lib/feature/legend/legendStrategies/notificationStrategy/logic/getNotificationPopover.d.ts +12 -0
  27. package/src/lib/feature/legend/legendStrategies/notificationStrategy/logic/notificationLegend.logic.d.ts +12 -0
  28. package/src/lib/feature/legend/legendStrategies/notificationStrategy/notificationStrategy.types.d.ts +5 -0
  29. package/src/lib/feature/legend/legendStrategies/notificationStrategy/optionConfigs/notificationBadgeLegendOptionConfig.d.ts +6 -0
  30. package/src/lib/feature/legend/legendStrategies/notificationStrategy/optionConfigs/notificationMarkerLegendOptionConfig.d.ts +4 -0
  31. package/src/lib/feature/legend/legendStrategies/notificationStrategy/testing/createTestNotification.d.ts +2 -0
  32. package/src/lib/feature/legend/legendStrategies/notificationStrategy/utils/getColorForNotificationLegendStatus.d.ts +7 -0
  33. package/src/lib/feature/legend/legendStrategies/notificationStrategy/utils/getNotificationTitlesByPropertyName.d.ts +2 -0
  34. package/src/lib/feature/legend/legendStrategies/notificationStrategy/utils/notificationLegend.utils.d.ts +12 -0
  35. package/src/lib/feature/legend/logic/getColorForLegendStatus.d.ts +5 -0
  36. package/src/lib/feature/legend/logic/normalizeBadges.d.ts +25 -12
  37. package/src/lib/feature/legend/logic/propertyAccessor.utils.d.ts +36 -0
  38. package/src/lib/feature/legend/stores/initializeLegendInStores.d.ts +3 -4
  39. package/src/lib/feature/legend/stores/legendDataStore/legendStore.d.ts +0 -1
  40. package/src/lib/feature/legend/stores/legendUIStore/legendUIStore.types.d.ts +5 -5
  41. package/src/lib/feature/legend/types/legendStrategy.type.d.ts +6 -6
  42. package/src/lib/feature/legend/types/legendType.d.ts +26 -19
  43. package/src/lib/hooks/useOpenPdfFile.d.ts +12 -0
  44. package/src/lib/hooks/useScreenValues.d.ts +2 -2
  45. package/src/lib/services/dataLayerPanel/dataLayerPanel.store.d.ts +2 -0
  46. package/src/lib/feature/globalSelection/components/SelectionActionBar/SelectionFeedbackDisplay.d.ts +0 -7
  47. package/src/lib/feature/globalSelection/components/SelectionActionBar/selectionFeedback.types.d.ts +0 -1
  48. package/src/lib/feature/globalSelection/components/SelectionMenuTrigger/SelectionGroupMenuItem.d.ts +0 -9
  49. package/src/lib/feature/globalSelection/components/SelectionMenuTrigger/SelectionMenuTrigger.d.ts +0 -12
  50. package/src/lib/feature/legend/components/legendTextSelector/LegendTextSelector.d.ts +0 -20
  51. package/src/lib/feature/legend/legendStrategies/workOrderStrategy/components/WorkOrderPopoverPrimaryRow.d.ts +0 -15
  52. package/src/lib/feature/legend/legendStrategies/workOrderStrategy/components/WorkOrderPopoverThirdRow.d.ts +0 -16
package/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./src/index";
2
- export { default } from "./src/index";
1
+ export * from "./src\\index";
2
+ export { default } from "./src\\index";
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "4.2.0",
3
+ "version": "4.3.0-beta-0",
4
4
  "peerDependencies": {
5
- "@equinor/echo-base": ">= 4.2.0 < 5.0.0",
6
- "@equinor/echo-components": ">= 4.2.0 < 5.0.0",
7
- "@equinor/echo-core": ">= 4.2.0 < 5.0.0",
8
- "@equinor/echo-search": ">= 4.2.0 < 5.0.0",
9
- "@equinor/echo-utils": ">= 4.2.0 < 5.0.0",
5
+ "@equinor/echo-base": "4.3.0-beta-0",
6
+ "@equinor/echo-components": "4.3.0-beta-0",
7
+ "@equinor/echo-core": "4.3.0-beta-0",
8
+ "@equinor/echo-search": "4.3.0-beta-0",
9
+ "@equinor/echo-utils": "4.3.0-beta-0",
10
10
  "@equinor/eds-core-react": "0.49.0",
11
11
  "@equinor/eds-icons": "0.22.0",
12
12
  "@equinor/eds-tokens": "2.1.0",
@@ -19,11 +19,11 @@
19
19
  "react-router-dom": ">= 6.30.3 < 7",
20
20
  "zustand": ">= 4.4.7 < 5",
21
21
  "immer": ">= 11.1.4 < 12.0.0",
22
- "msw": "2.12.10",
22
+ "msw": ">= 2.0.0 < 3",
23
23
  "date-fns": "4.1.0"
24
24
  },
25
25
  "dependencies": {
26
- "dexie": "4.3.0",
26
+ "dexie": "4.4.2",
27
27
  "mark.js": "8.11.1",
28
28
  "ag-charts-community": "12.3.1",
29
29
  "ag-charts-react": "12.3.1",
package/src/index.d.ts CHANGED
@@ -19,7 +19,7 @@ export { ReturnToExternalAppButton } from './lib/feature/echoView/ReturnToExtern
19
19
  export { fetchEquipmentFromApi } from './lib/feature/equipment/api/api-equipmentWithMeasuringPoints';
20
20
  export * from './lib/feature/equipment/index';
21
21
  export * from './lib/feature/globalSelection';
22
- export { SelectionActionBar } from './lib/feature/globalSelection/components/SelectionActionBar';
22
+ export { ItemDetailsSelectionActionBar, SelectionActionBar } from './lib/feature/globalSelection/components/SelectionActionBar';
23
23
  export { PanTo3DButton } from './lib/feature/globalSelection/panToEcho3d/panTo3DButton';
24
24
  export { useIsAllIGlobalSelectionItemsHidden } from './lib/feature/globalSelection/selectionMenu/hooks/useIsAllIGlobalSelectionItemsHidden';
25
25
  export { useSelectionColorFrequencyByIds } from './lib/feature/globalSelection/selectionMenu/hooks/useSelectionColorFrequency';
@@ -137,8 +137,8 @@ declare const EchoFramework: Readonly<{
137
137
  usePlantAvailableIn3dWeb(plantCode?: string): boolean;
138
138
  useScreenOrientation(): import("./lib/types/hookLibrary").ScreenOrientation;
139
139
  useScreenValues(): {
140
- isScreenMobileSize: boolean;
141
- screenOrientation: import("./lib/types/hookLibrary").ScreenOrientation;
140
+ readonly isScreenMobileSize: boolean;
141
+ readonly screenOrientation: import("./lib/types/hookLibrary").ScreenOrientation;
142
142
  };
143
143
  useSelectionGroupLabelsPerItem: () => Map<string, string[]>;
144
144
  useTabTitle(): void;
@@ -3,5 +3,5 @@ interface HorizontalDocumentGroupsProps {
3
3
  documentGroups: Array<PrepviewDocumentGroup>;
4
4
  tagNo: string;
5
5
  }
6
- declare function HorizontalDocumentGroups({ documentGroups, tagNo, }: HorizontalDocumentGroupsProps): import("react/jsx-runtime").JSX.Element;
6
+ declare function HorizontalDocumentGroups({ documentGroups, tagNo }: HorizontalDocumentGroupsProps): import("react/jsx-runtime").JSX.Element;
7
7
  export { HorizontalDocumentGroups };
@@ -0,0 +1,12 @@
1
+ import { Guid } from '@equinor/echo-utils';
2
+ import { GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
3
+ import { type SelectionGroup } from '../../selectionMenu/selectionTreeStore/selectionTree.store.types';
4
+ interface SelectionActionBarMenuItemProps {
5
+ readonly isInGroup: boolean;
6
+ readonly group: SelectionGroup;
7
+ readonly addToSelection: (groupId: Guid, itemId: GlobalSelectionTypes.ItemId) => void;
8
+ readonly removeFromSelection: (groupId: Guid, itemId: GlobalSelectionTypes.ItemId) => void;
9
+ readonly itemId: GlobalSelectionTypes.ItemId;
10
+ }
11
+ export declare const SelectionActionBarMenuItem: (props: SelectionActionBarMenuItemProps) => import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -5,3 +5,8 @@ export interface SelectionActionBarProps {
5
5
  readonly showPopoverUpdateDelay?: boolean;
6
6
  }
7
7
  export declare const SelectionActionBar: React.FC<SelectionActionBarProps>;
8
+ /**
9
+ * Simple wrapper to apply custom styles to the SelectionActionBar when used in the ItemDetails pages,
10
+ * without affecting the SelectionActionBar used elsewhere.
11
+ */
12
+ export declare const ItemDetailsSelectionActionBar: (props: SelectionActionBarProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
+ import type { SelectionBarFeedbackType } from '@equinor/echo-components';
1
2
  import { Guid } from '@equinor/echo-utils';
2
- import type { SelectionFeedbackType } from '../components/SelectionActionBar/selectionFeedback.types';
3
3
  import { GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
4
4
  /**
5
5
  *
@@ -14,7 +14,7 @@ import { GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionSto
14
14
  */
15
15
  export declare function useSelectionAction(showPopoverUpdateDelay?: boolean): {
16
16
  isLoading: boolean;
17
- feedbackType: SelectionFeedbackType | null;
17
+ feedbackType: SelectionBarFeedbackType | null;
18
18
  addToSelection: (groupId: Guid, itemId: GlobalSelectionTypes.ItemId) => Promise<void>;
19
19
  removeFromSelection: (groupId: Guid, itemId: GlobalSelectionTypes.ItemId) => void;
20
20
  changeColor: (itemId: GlobalSelectionTypes.ItemId, color: string) => void;
@@ -1,6 +1,6 @@
1
1
  import { LegendId } from '../types/legendType';
2
2
  interface LegendSelectorMenuProps {
3
- legendId: LegendId;
3
+ readonly legendId: LegendId;
4
4
  }
5
5
  export declare const BasicLegendRenderer: import("react").NamedExoticComponent<LegendSelectorMenuProps>;
6
6
  export {};
@@ -0,0 +1,17 @@
1
+ import { LegendChipProps } from '@equinor/echo-components';
2
+ import { type LegendOptionConfig } from '../types/legendType';
3
+ interface LegendSelectorContainerProps {
4
+ readonly selectedOption: LegendOptionConfig;
5
+ readonly onSelectedOptionChange?: (option: LegendOptionConfig) => void;
6
+ readonly options: ReadonlyArray<LegendOptionConfig>;
7
+ readonly legendChips: ReadonlyArray<LegendChipProps>;
8
+ /** Whether this is a marker or badge selector (affects icon displayed) */
9
+ readonly variant: 'marker' | 'badge';
10
+ }
11
+ /**
12
+ * A reusable container for legend selectors that handles both option selection
13
+ * and display option selection (how the badge text is rendered) based on LegendOptionConfigs.
14
+ * Display options are only available for badge variants with enableDisplayOptions: true.
15
+ */
16
+ export declare const LegendSelectorContainer: (props: LegendSelectorContainerProps) => import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,9 @@
1
+ import { type LegendId } from '../../../types/legendType';
2
+ interface ItemMarkerPopoverContainerProps {
3
+ legendId: LegendId;
4
+ elements: ReadonlyArray<React.ReactElement>;
5
+ isPopoverActive: boolean;
6
+ handleClose: () => void;
7
+ }
8
+ export declare const ItemMarkerPopoverContainer: ({ legendId, elements, isPopoverActive, handleClose }: ItemMarkerPopoverContainerProps) => import("react/jsx-runtime").JSX.Element | null;
9
+ export {};
@@ -1,41 +1,24 @@
1
- import { FC } from 'react';
2
- import { Marker } from '../../types/legendMarkerBadge.type';
3
1
  import { LegendDataId, LegendId } from '../../types/legendType';
4
2
  export interface LegendPopoverContentProps {
5
3
  legendId: LegendId;
6
4
  legendDataId: LegendDataId;
7
- title: string | React.ReactNode;
8
- description: string;
9
- tertiary?: LegendPopoverTertiaryLabels | React.ReactNode;
10
5
  onPopoverClicked?: () => void;
11
6
  children?: React.ReactNode;
12
- excludedLegendTitles?: ReadonlyArray<string>;
7
+ excludedChipLegendTitles?: ReadonlyArray<string>;
13
8
  showAddToSelectionButton?: boolean;
14
- getMarkersForChipsCreation?: () => ReadonlyArray<Marker>;
15
9
  }
16
- export type LegendPopoverTertiaryLabels = {
17
- first: string;
18
- second?: string;
19
- third?: string;
20
- };
21
10
  /**
22
11
  * Renders the content for a legend popover, typically used as the content for the ItemMarkerPopover component.
23
- *
24
- * Uses `legendId` and `legendDataId` to look up and render relevant `LegendChip` components for the given legend item.
25
- * Displays a title, description, and optional tertiary content (either a structured object with up to three strings, or a custom ReactNode).
26
- * Additional custom content can be rendered via `children`.
27
- * Optionally, chips can be created from markers provided by the `getMarkersForChipsCreation` callback.
12
+ * The content includes dynamically generated chips based on the markers associated with the provided legendId and legendDataId.
13
+ * It is possible to exclude certain chips based on their legend titles using props. Chips with excluded titles will not be rendered in the popover.
14
+ * The component also includes an optional "Add to Selection" button that allows users to add the item to their global selection groups.
28
15
  *
29
16
  * @component
30
- * @param {object} props - Component props
31
17
  * @param {LegendId} props.legendId - The identifier used to look up legend strategy.
32
18
  * @param {LegendDataId} props.legendDataId - The identifier for retrieving the markers.
33
- * @param {string | React.ReactNode} props.title - The main title of the popover.
34
- * @param {string} props.description - The description or supporting text.
35
- * @param {LegendPopoverTertiaryLabels | React.ReactNode} [props.tertiary] - Optional tertiary content. If an object, displays up to three labeled strings; if a ReactNode, renders as-is.
36
- * @param {() => void} [props.onPopoverClicked] - Optional callback for popover click events.
37
- * @param {React.ReactNode} [props.children] - Optional custom content to render below the predefined main content.
38
- * @param {ReadonlyArray<string>} [props.excludedLegendTitles] - Optional array of titles to exclude from the legend chips.
39
- * @param {() => ReadonlyArray<Marker>} [props.getMarkersForChipsCreation] - Optional callback that returns the markers to be used for chip creation.
19
+ * @param {() => void} [props.onPopoverClicked] - Optional callback for popover content click events.
20
+ * @param {React.ReactNode} [props.children] - Optional custom content to render inside the popover content area, will be above chips.
21
+ * @param {ReadonlyArray<string>} [props.excludedChipLegendTitles] - Optional array of titles to exclude from the legend chips.
22
+ * @param {boolean} [props.showAddToSelectionButton] - Optional flag to show or hide the "Add to Selection" button.
40
23
  */
41
- export declare const LegendPopoverContent: FC<LegendPopoverContentProps>;
24
+ export declare const LegendPopoverContent: (props: LegendPopoverContentProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,7 @@
1
- import { LegendChipProps } from '@equinor/echo-components';
2
1
  import { LegendState } from '../../types/legendType';
3
2
  import { Marker } from './../../types/legendMarkerBadge.type';
4
3
  /**
5
- * Returns an array of visible LegendChipProps for the given markers and legend state.
4
+ * Returns an array of visible PopoverChip for the given markers and legend state.
6
5
  *
7
6
  * Filters out markers and badges that are hidden (using isHiddenMarker/isHiddenBadge) or whose titles match any value in the
8
7
  * excludedLegendTitles array (case-insensitive). Badge chips are only included if selectedMarkerOption !== selectedBadgeOption.
@@ -11,11 +10,18 @@ import { Marker } from './../../types/legendMarkerBadge.type';
11
10
  * @param {ReadonlyArray<Marker>} params.markers - The list of marker objects to process.
12
11
  * @param {LegendState} params.legend - The legend state, used for filtering and selection logic.
13
12
  * @param {ReadonlyArray<string>} [params.excludedLegendTitles] - Optional array of titles to exclude from the chips (case-insensitive).
14
- * @returns {LegendChipProps[]} The filtered and mapped array of LegendChipProps for rendering.
13
+ * @returns {PopoverChip[]} The filtered and mapped array of PopoverChip for rendering.
15
14
  */
16
- export declare function getLegendChipsFromMarkers({ markers, legendSelectedBadgeOption, legendSelectedMarkerOption, excludedLegendTitles }: {
15
+ interface GetPopoverChipsParams {
17
16
  markers: ReadonlyArray<Marker>;
18
- excludedLegendTitles?: ReadonlyArray<string>;
19
17
  legendSelectedBadgeOption?: LegendState['selectedBadgeOption'];
20
18
  legendSelectedMarkerOption?: LegendState['selectedMarkerOption'];
21
- }): LegendChipProps[];
19
+ excludedLegendTitles?: ReadonlyArray<string>;
20
+ }
21
+ interface PopoverChip {
22
+ text: string;
23
+ backgroundColor: string;
24
+ textColor: string;
25
+ }
26
+ export declare function getPopoverChips({ markers, legendSelectedBadgeOption, legendSelectedMarkerOption, excludedLegendTitles }: GetPopoverChipsParams): PopoverChip[];
27
+ export {};
@@ -1,9 +1,5 @@
1
1
  import { SelectionGroup } from '../../globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types';
2
2
  import { Marker } from '../types/legendMarkerBadge.type';
3
- /**
4
- * Checks if a marker has badges from multiple different item IDs.
5
- */
6
- export declare const hasBadgesFromMultipleItemIds: (marker: Marker) => boolean;
7
3
  /**
8
4
  * Gets all potential group keys a marker could generate.
9
5
  * Used for per-marker hidden state subscriptions.
@@ -18,4 +18,4 @@ export declare const useUniqueVisibleData: () => LegendDataId[];
18
18
  * Common logic for creating markers from data using strategy.
19
19
  * Selection-based grouping is handled at the viewport rendering level.
20
20
  */
21
- export declare const useCreateMarkers: (legendId: LegendId, data: LegendDataId[], isViewport?: boolean) => ReadonlyArray<Marker>;
21
+ export declare const useCreateMarkers: (legendId: LegendId, data: LegendDataId[]) => ReadonlyArray<Marker>;
@@ -4,6 +4,4 @@ import { LegendId } from '../types/legendType';
4
4
  * Returns all unique badges for the given legendId, determined by unique title + color.
5
5
  * This will also return markers that are not visible on screen.
6
6
  */
7
- export declare function useLegendUniqueBadges(legendId: LegendId, options?: {
8
- isViewport?: boolean;
9
- }): ReadonlyArray<Badge>;
7
+ export declare function useLegendUniqueBadges(legendId: LegendId): ReadonlyArray<Badge>;
@@ -4,6 +4,4 @@ import { LegendId } from '../types/legendType';
4
4
  * Returns all unique markers for the given legendId, determined by unique displayKey (title + color).
5
5
  * This will also return markers that are not visible on screen.
6
6
  */
7
- export declare function useLegendUniqueMarkers(legendId: LegendId, options?: {
8
- isViewport?: boolean;
9
- }): ReadonlyArray<Marker>;
7
+ export declare function useLegendUniqueMarkers(legendId: LegendId): ReadonlyArray<Marker>;
@@ -2,22 +2,25 @@ import './legendStrategies/notificationStrategy/notificationStrategy';
2
2
  import './legendStrategies/workOrderStrategy/WorkOrderLegend';
3
3
  export { getBadgeChips, getMarkerChips } from './components/basicLegendRenderer.logic';
4
4
  export { LegendList } from './components/LegendList';
5
- export { LegendTextSelector } from './components/legendTextSelector/LegendTextSelector';
5
+ export { LegendSelectorContainer } from './components/LegendSelectorContainer';
6
6
  export { PositionalItem } from './components/pdfMarkers/PositionalItem';
7
7
  export { MultipleMarkersByLegends } from './components/pdfMarkers/subComponents/MultipleMarkersByLegends';
8
8
  export { LegendPopoverContent } from './components/popover/LegendPopoverContent';
9
- export type { LegendPopoverContentProps, LegendPopoverTertiaryLabels } from './components/popover/LegendPopoverContent';
9
+ export type { LegendPopoverContentProps } from './components/popover/LegendPopoverContent';
10
10
  export { trackEventNewLegendAccordionToggled, trackEventNewLegendSelectedBadgeOptionChanged, trackEventNewLegendSelectedMarkerOptionChanged } from './legendAnalytics';
11
11
  export { legendFacade } from './legendFacade';
12
12
  export { getLegendStrategy } from './legendStrategies/legendCollections';
13
13
  export { legendSnapShot } from './stores/legendDataStore/legendStore';
14
14
  export type { Badge, Marker } from './types/legendMarkerBadge.type';
15
15
  export type { LegendStrategy } from './types/legendStrategy.type';
16
- export type { LegendId, LegendOptionConfig } from './types/legendType';
16
+ export type { LegendBadgeOptionConfig, LegendId, LegendMarkerOptionConfig, LegendOptionConfig, LegendOptionDisplayOption } from './types/legendType';
17
17
  export { useLegendUniqueBadges } from './hooks/useLegendUniqueBadges';
18
18
  export { useLegendUniqueMarkers } from './hooks/useLegendUniqueMarkers';
19
19
  export { useOpenWorkOrdersByTagNos } from './hooks/useWorkOrdersByTagNos';
20
20
  export { useWorkOrdersByTagsQuery } from './hooks/useWorkOrdersByTagsQuery';
21
- export { COUNT_MODE_KEYWORD } from './logic/normalizeBadges';
22
- export { useLegendVisibleDataStore } from './stores/legendVisibleDataStore/legendVisibleDataStore';
21
+ export { isCountMode, isIdMode, normalizeBadges } from './logic/normalizeBadges';
22
+ export { getColorForLegendStatus } from './logic/getColorForLegendStatus';
23
+ export { createArrayAccessor, createCountAccessor, createDateAccessor, createStringAccessor, getPropertyValues, toSingleTitle } from './logic/propertyAccessor.utils';
24
+ export type { PropertyAccessor } from './logic/propertyAccessor.utils';
23
25
  export { useLegendUIStore } from './stores/legendUIStore/legendUIStore';
26
+ export { useLegendVisibleDataStore } from './stores/legendVisibleDataStore/legendVisibleDataStore';
@@ -0,0 +1,7 @@
1
+ import { NotificationDto } from '@equinor/echo-search';
2
+ export declare function createFunctionalLocationList(tagNos: ReadonlyArray<string>, plantNo: string): ReadonlyArray<string>;
3
+ export interface RequestTagsNotifications {
4
+ readonly tagNos: ReadonlyArray<string>;
5
+ readonly instCode: string;
6
+ }
7
+ export declare function getOpenNotificationsForTagsApi({ instCode, tagNos }: RequestTagsNotifications): Promise<ReadonlyArray<NotificationDto>>;
@@ -0,0 +1,8 @@
1
+ import type { NotificationItemCardData } from '@equinor/echo-components';
2
+ import { type LegendDataId } from '../../../types/legendType';
3
+ interface NotificationPopoverProps {
4
+ legendDataId: LegendDataId;
5
+ notification: NotificationItemCardData;
6
+ }
7
+ export declare const NotificationPopover: (props: NotificationPopoverProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { Marker } from '../../../types/legendMarkerBadge.type';
2
+ import { type LegendDataId } from '../../../types/legendType';
3
+ /**
4
+ * Orchestrates fetching notifications for the given tag IDs and transforms them into markers for the notification legend.
5
+ */
6
+ export declare const useNotificationMarkers: (itemIds: ReadonlyArray<LegendDataId>) => ReadonlyArray<Marker>;
@@ -0,0 +1,14 @@
1
+ import { TagNo, type NotificationDto } from '@equinor/echo-search';
2
+ import { type LegendTagId } from '../../../types/legendType';
3
+ export interface TagNotificationGroup {
4
+ readonly tagId: TagNo;
5
+ readonly notifications: ReadonlyArray<NotificationDto>;
6
+ }
7
+ interface UseNotificationsByTagIdsResult {
8
+ readonly data: ReadonlyArray<TagNotificationGroup>;
9
+ readonly error: Error | undefined;
10
+ readonly isFetching: boolean;
11
+ }
12
+ export declare const useNotificationsByTagIds: (enabled: boolean, tagIds: ReadonlyArray<LegendTagId>) => UseNotificationsByTagIdsResult;
13
+ export declare const groupNotificationsByTagId: (notifications: ReadonlyArray<NotificationDto>) => ReadonlyArray<TagNotificationGroup>;
14
+ export {};
@@ -0,0 +1,12 @@
1
+ import { type NotificationItemCardData } from '@equinor/echo-components';
2
+ import type { NotificationDetails } from '@equinor/echo-search';
3
+ import { Explicit } from '@equinor/echo-utils';
4
+ import { type LegendDataId, type LegendNotificationId } from '../../../types/legendType';
5
+ /**
6
+ * Notification is not a selection-based legend, so the dataId is not directly tied to global selection item IDs.
7
+ * Instead, we define a specific type for notification legend data IDs (LegendNotificationId) and use a type guard (isNotificationDataId) to identify them.
8
+ * This allows us to safely handle notification data IDs without relying on global selection structures.
9
+ */
10
+ export declare const isNotificationDataId: (dataId: LegendDataId) => dataId is LegendNotificationId;
11
+ export declare const getPopoverContent: (_legendDataId: LegendDataId, itemIds: ReadonlyArray<LegendDataId>) => Promise<JSX.Element[]>;
12
+ export declare const mapNotificationToNotificationItemCard: (notification: NotificationDetails) => Explicit<NotificationItemCardData>;
@@ -0,0 +1,12 @@
1
+ import { NotificationDto } from '@equinor/echo-search';
2
+ import type { Badge, Marker } from '../../../types/legendMarkerBadge.type';
3
+ import type { LegendBadgeOptionConfig, LegendMarkerOptionConfig } from '../../../types/legendType';
4
+ interface CreateMarkerFromNotificationsArgs {
5
+ readonly notifications: ReadonlyArray<NotificationDto>;
6
+ readonly selectedMarkerOption: LegendMarkerOptionConfig;
7
+ readonly selectedBadgeOption: LegendBadgeOptionConfig;
8
+ }
9
+ export declare const createMarkerFromNotifications: ({ notifications, selectedMarkerOption, selectedBadgeOption }: CreateMarkerFromNotificationsArgs) => Marker;
10
+ export declare const createMarkerTitle: (notifications: ReadonlyArray<NotificationDto>, selectedMarkerOption: LegendMarkerOptionConfig) => string;
11
+ export declare const createBadges: (notifications: ReadonlyArray<NotificationDto>, selectedBadgeOption: LegendBadgeOptionConfig) => ReadonlyArray<Badge>;
12
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { LegendStatus } from '../../../legacyLegend/legend';
2
+ import type { NotificationBadgeOptions } from './optionConfigs/notificationBadgeLegendOptionConfig';
3
+ import type { NotificationMarkerOptions } from './optionConfigs/notificationMarkerLegendOptionConfig';
4
+ export type AllNotificationPropertyOptions = NotificationMarkerOptions | NotificationBadgeOptions;
5
+ export type EndDateStatusText = 'Expired' | '0-7 days' | '8 days - 1 month' | '1-3 months' | '3-6 months' | '6-12 months' | '> 1 year' | LegendStatus.Unknown;
@@ -0,0 +1,6 @@
1
+ import { NotificationDto } from '@equinor/echo-search';
2
+ import { LegendBadgeOptionConfig } from '../../../types/legendType';
3
+ type KeysFromNotificationDto = Pick<NotificationDto, 'maintenanceRecordId' | 'recordTypeId'>;
4
+ export type NotificationBadgeOptions = keyof KeysFromNotificationDto | 'count';
5
+ export declare const NOTIFICATION_LEGEND_BADGE_OPTIONS: ReadonlyArray<LegendBadgeOptionConfig<NotificationBadgeOptions>>;
6
+ export {};
@@ -0,0 +1,4 @@
1
+ import { NotificationDto } from '@equinor/echo-search';
2
+ import { type LegendMarkerOptionConfig } from '../../../types/legendType';
3
+ export type NotificationMarkerOptions = keyof Pick<NotificationDto, 'activeStatusIds' | 'requiredEndDateTime' | 'recordTypeId'>;
4
+ export declare const NOTIFICATION_LEGEND_MARKER_OPTIONS: ReadonlyArray<LegendMarkerOptionConfig<NotificationMarkerOptions>>;
@@ -0,0 +1,2 @@
1
+ import type { NotificationDto } from '@equinor/echo-search';
2
+ export declare const createTestNotification: (overrides?: Partial<NotificationDto>) => NotificationDto;
@@ -0,0 +1,7 @@
1
+ import type { LegendOptionConfig } from '../../../types/legendType';
2
+ /**
3
+ * Determines the appropriate color for a notification legend item based on its title and the selected property.
4
+ * It uses a predefined color mapping for specific notification properties,
5
+ * and falls back to a general status color if no specific mapping is found.
6
+ */
7
+ export declare const getColorForNotificationLegendStatus: (title: string, selectedProperty: LegendOptionConfig) => string;
@@ -0,0 +1,2 @@
1
+ import { NotificationDto } from '@equinor/echo-search';
2
+ export declare function getNotificationTitlesByPropertyName(propertyName: string, notification: NotificationDto, notifications: ReadonlyArray<NotificationDto>): ReadonlyArray<string>;
@@ -0,0 +1,12 @@
1
+ import { NotificationDto } from '@equinor/echo-search';
2
+ import type { EndDateStatusText } from '../notificationStrategy.types';
3
+ /**
4
+ * Determines the appropriate icon name for a marker based on the record types of the provided notifications.
5
+ * If there are multiple record types or no notifications, it returns a generic icon.
6
+ * Otherwise, it returns a specific icon based on the record type.
7
+ */
8
+ export declare const getIconForMarker: (notifications: ReadonlyArray<NotificationDto>) => string;
9
+ /**
10
+ * Returns user-friendly end date status text based on the required end date of a notification.
11
+ */
12
+ export declare function getEndDateStatusText(date: Date | undefined): EndDateStatusText;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Wrapper for pre-existing legend status colors, to avoid importing legacy utils into new legend code.
3
+ * Also handles new 'Unknown' and 'Multiple' statuses correctly, which legacy utils do not.
4
+ */
5
+ export declare const getColorForLegendStatus: (status: string) => string;
@@ -1,17 +1,19 @@
1
1
  import { Badge } from '../types/legendMarkerBadge.type';
2
+ import { type LegendOptionDisplayOption } from '../types/legendType';
2
3
  /**
3
- * Keyword used to identify count mode in badge text options. This changes
4
- * the way we normalize badges.
4
+ * Determines if count mode should be enabled based on badge text option.
5
+ *
6
+ * @param badgeDisplayOption - Badge text configuration option from legend state
7
+ * @returns Whether count mode should be enabled
5
8
  */
6
- export declare const COUNT_MODE_KEYWORD = "Count";
9
+ export declare function isCountMode(badgeDisplayOption?: LegendOptionDisplayOption): boolean;
7
10
  /**
8
- * Determines if count mode should be enabled based on badge text options.
9
- * Count mode is enabled when any option value exactly equals 'Count'.
11
+ * Determines if ID mode should be enabled based on badge display option.
10
12
  *
11
- * @param badgeTextOptions - Badge text configuration options from legend state
12
- * @returns Whether count mode should be enabled
13
+ * @param badgeDisplayOption - Badge text configuration option from legend state
14
+ * @returns Whether ID mode should be enabled
13
15
  */
14
- export declare function isCountMode(badgeTextOptions: Record<string, string> | undefined): boolean;
16
+ export declare function isIdMode(badgeDisplayOption?: LegendOptionDisplayOption): boolean;
15
17
  /**
16
18
  * Creates badges with count displayed as title.
17
19
  * Takes all badges (including duplicates) and unique badges, and returns unique badges
@@ -23,11 +25,22 @@ export declare function isCountMode(badgeTextOptions: Record<string, string> | u
23
25
  */
24
26
  export declare function createBadgesWithCount(allBadges: ReadonlyArray<Badge>, uniqueBadges: ReadonlyArray<Badge>): Badge[];
25
27
  /**
26
- * Normalizes badges for display by removing duplicates and optionally applying count mode.
27
- * Count mode is determined from the badge text options configuration.
28
+ * Creates badges with their item's ID displayed as title.
29
+ * Each badge's title is replaced with the primary identifier from its itemId.
30
+ *
31
+ * @param badges - Array of badges to transform
32
+ * @returns Array of badges with item ID as title
33
+ */
34
+ export declare function createBadgesWithId(badges: ReadonlyArray<Badge>): Badge[];
35
+ /**
36
+ * Normalizes badges for display by removing duplicates and applying display mode transformations.
37
+ * Supports three display modes:
38
+ * - 'displayName' (default): Shows the original badge title
39
+ * - 'id': Shows the item's primary identifier (tagNo, equipmentId, workOrderId)
40
+ * - 'count': Shows the count of badges with the same title
28
41
  *
29
42
  * @param badges - Array of badges to normalize
30
- * @param badgeTextOptions - Badge text configuration options from legend state
43
+ * @param badgeDisplayOption - Badge display option from legend state ('displayName' | 'id' | 'count')
31
44
  * @returns Normalized array of badges
32
45
  */
33
- export declare function normalizeBadges(badges: ReadonlyArray<Badge>, badgeTextOptions: Record<string, string> | undefined): Badge[];
46
+ export declare function normalizeBadges(badges: ReadonlyArray<Badge>, badgeDisplayOption?: LegendOptionDisplayOption): Badge[];
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Property accessor function type that returns all values as an array.
3
+ * Takes an item and optional context (like a collection) and returns string values.
4
+ */
5
+ export type PropertyAccessor<TItem, TContext = ReadonlyArray<TItem>> = (item: TItem, context: TContext) => ReadonlyArray<string>;
6
+ /**
7
+ * Creates an accessor that extracts a string property value as a single-element array.
8
+ * Returns empty array if the value is empty or not a string.
9
+ */
10
+ export declare function createStringAccessor<TItem>(property: keyof TItem): PropertyAccessor<TItem, ReadonlyArray<TItem>>;
11
+ /**
12
+ * Creates an accessor that returns all elements from an array property.
13
+ * Returns empty array if the property is not an array.
14
+ */
15
+ export declare function createArrayAccessor<TItem>(property: keyof TItem): PropertyAccessor<TItem, ReadonlyArray<TItem>>;
16
+ /**
17
+ * Creates an accessor that converts a Date property to ISO string as a single-element array.
18
+ * Returns empty array if the value is not a Date.
19
+ */
20
+ export declare function createDateAccessor<TItem>(property: keyof TItem): PropertyAccessor<TItem, ReadonlyArray<TItem>>;
21
+ /**
22
+ * Creates a count accessor that returns the size of the context collection.
23
+ */
24
+ export declare function createCountAccessor<TItem>(): PropertyAccessor<TItem, ReadonlyArray<TItem>>;
25
+ /**
26
+ * Looks up property values using a map of accessors.
27
+ * Returns empty array if the property is not found in the accessor map.
28
+ */
29
+ export declare function getPropertyValues<TItem, TContext = ReadonlyArray<TItem>>(item: TItem, propertyName: string, context: TContext, accessors: Readonly<Record<string, PropertyAccessor<TItem, TContext>>>): ReadonlyArray<string>;
30
+ /**
31
+ * Normalizes an array of values to a single display title:
32
+ * - Empty array → "Unknown"
33
+ * - Single unique value → that value
34
+ * - Multiple unique values → "Multiple"
35
+ */
36
+ export declare function toSingleTitle(values: ReadonlyArray<string>): string;
@@ -1,10 +1,9 @@
1
1
  import type { LegendStrategy } from '../types/legendStrategy.type';
2
- import type { LegendOptionConfig } from '../types/legendType';
2
+ import type { LegendBadgeOptionConfig, LegendMarkerOptionConfig } from '../types/legendType';
3
3
  export interface InitialValues {
4
4
  readonly isEnabled?: boolean;
5
- readonly selectedMarkerOption?: LegendOptionConfig;
6
- readonly selectedBadgeOption?: LegendOptionConfig;
7
- readonly selectedBadgeTextOptions?: Record<string, string>;
5
+ readonly selectedMarkerOption?: LegendMarkerOptionConfig;
6
+ readonly selectedBadgeOption?: LegendBadgeOptionConfig;
8
7
  }
9
8
  /**
10
9
  * Ensures that a legend exists in all relevant stores. If the legend already exists,
@@ -11,7 +11,6 @@ export interface LegendStoreActions {
11
11
  setIsEnabled: (legendId: LegendId, isEnabled: boolean) => void;
12
12
  setSelectedMarkerOption: (legendId: LegendId, option: LegendState['selectedMarkerOption']) => void;
13
13
  setSelectedBadgeOption: (legendId: LegendId, option: LegendState['selectedBadgeOption']) => void;
14
- setSelectedBadgeTextOptions: (legendId: LegendId, options: LegendState['selectedBadgeTextOptions']) => void;
15
14
  }
16
15
  type LegendStore = LegendStoreData & LegendStoreActions;
17
16
  /**
@@ -1,7 +1,7 @@
1
- import type { SelectionFeedbackType } from '../../../globalSelection/components/SelectionActionBar/selectionFeedback.types';
1
+ import type { SelectionBarFeedbackType } from '@equinor/echo-components';
2
2
  import { MarkerId } from '../../components/pdfMarkers/utils/markerId.utils';
3
3
  import { LegendId } from '../../types/legendType';
4
- export type { SelectionFeedbackType };
4
+ export type { SelectionBarFeedbackType } from '@equinor/echo-components';
5
5
  export type LegendFeedbackVariant = 'error' | 'info' | 'warning';
6
6
  export interface LegendUIState {
7
7
  readonly accordionFeedback?: {
@@ -13,7 +13,7 @@ export interface LegendUIState {
13
13
  readonly hiddenBadges: string[];
14
14
  }
15
15
  export type LegendUIDictionary = Record<LegendId, LegendUIState>;
16
- export type MarkersOutsideSelectionVisibility = 'Show' | 'Ghost' | 'Hide';
16
+ export type MarkersOutsideSelectionVisibility = 'show' | 'ghost' | 'hide';
17
17
  export type LegendUIStoreValues = {
18
18
  readonly legends: LegendUIDictionary;
19
19
  readonly activePopover: {
@@ -21,7 +21,7 @@ export type LegendUIStoreValues = {
21
21
  readonly elements: ReadonlyArray<React.ReactElement>;
22
22
  readonly selectionFeedback?: {
23
23
  readonly isLoading: boolean;
24
- readonly feedbackType: SelectionFeedbackType | null;
24
+ readonly feedbackType: SelectionBarFeedbackType | null;
25
25
  };
26
26
  };
27
27
  readonly selectionLegend: {
@@ -54,7 +54,7 @@ export interface LegendUIStoreActions {
54
54
  setActivePopoverElements: (elements: ReadonlyArray<React.ReactElement>) => void;
55
55
  setPopoverSelectionFeedback: (feedback: {
56
56
  isLoading: boolean;
57
- feedbackType: SelectionFeedbackType | null;
57
+ feedbackType: SelectionBarFeedbackType | null;
58
58
  } | undefined) => void;
59
59
  setShouldDelayPopoverUpdate: (delay: boolean) => void;
60
60
  setAccordionFeedback: (legendId: LegendId, feedback: {