@equinor/echo-framework 6.1.0 → 6.2.1-edsv2-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 (69) hide show
  1. package/{47deeba42768c5d1.svg → 063009f06499d102.svg} +8 -8
  2. package/{1bd97dd2170d0f64.svg → f4c85313e79b1662.svg} +850 -850
  3. package/index.cjs.js +2 -2
  4. package/index.d.ts +2 -2
  5. package/package.json +8 -8
  6. package/src/index.d.ts +1 -1
  7. package/src/lib/components/panel/panelNavigation.helper.d.ts +1 -2
  8. package/src/lib/feature/globalSelection/selectionMenu/hooks/useFetchSelectionHistory.d.ts +1 -1
  9. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/colorConflictHandling/SelectionColorConflictDialog.d.ts +1 -1
  10. package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendColoredMarkerIcon.d.ts +6 -9
  11. package/src/lib/feature/legend/components/pdfMarkers/subComponents/MarkerWithPopover.d.ts +6 -7
  12. package/src/lib/feature/legend/components/pdfMarkers/subComponents/components/MultipleMarkersBySingleLegend/multipleMarkersBySingleLegend.logic.d.ts +5 -7
  13. package/src/lib/feature/legend/components/pdfMarkers/subComponents/components/MultipleMarkersBySingleLegend/useStalePopoverMarkers.d.ts +3 -3
  14. package/src/lib/feature/legend/components/pdfMarkers/subComponents/hooks/useMarkerPopover.d.ts +2 -2
  15. package/src/lib/feature/legend/components/pdfMarkers/utils/markerId.utils.d.ts +11 -3
  16. package/src/lib/feature/legend/components/popover/LegendPopoverContent.logic.d.ts +14 -21
  17. package/src/lib/feature/legend/components/selectionLegend/hooks/useAllMarkerItemIdsForEnabledLegends.d.ts +4 -4
  18. package/src/lib/feature/legend/components/selectionLegend/selectionLegend.utils.d.ts +9 -9
  19. package/src/lib/feature/legend/hooks/useLegendBadgeChips.d.ts +7 -0
  20. package/src/lib/feature/legend/hooks/useLegendHiddenItemsSubscription.d.ts +4 -14
  21. package/src/lib/feature/legend/hooks/useLegendMarkerChips.d.ts +7 -0
  22. package/src/lib/feature/legend/hooks/useLegendMarkers/useLegendMarkers.d.ts +17 -0
  23. package/src/lib/feature/legend/hooks/useLegendMarkers/useLegendMarkers.logic.d.ts +65 -0
  24. package/src/lib/feature/legend/hooks/useLegendMarkers/useLegendMarkers.utils.d.ts +14 -0
  25. package/src/lib/feature/legend/hooks/useWorkOrdersByTagsQuery.d.ts +1 -1
  26. package/src/lib/feature/legend/index.d.ts +8 -6
  27. package/src/lib/feature/legend/legendFacade.d.ts +9 -15
  28. package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/api/iocAnnotationLegend.api.d.ts +3 -0
  29. package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/hooks/useIocAnnotationMarkers.d.ts +3 -0
  30. package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/hooks/useIocAnnotationMarkers.utils.d.ts +21 -0
  31. package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/iocAnnotationStrategy.d.ts +1 -0
  32. package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/iocAnnotationStrategy.types.d.ts +25 -0
  33. package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/optionConfigs/iocAnnotationBadgeLegendOptionConfig.d.ts +3 -0
  34. package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/optionConfigs/iocAnnotationMarkerLegendOptionConfig.d.ts +3 -0
  35. package/src/lib/feature/legend/legendStrategies/notificationStrategy/hooks/useNotificationDetailsByIds.d.ts +1 -1
  36. package/src/lib/feature/legend/legendStrategies/notificationStrategy/hooks/useNotificationRawMarkers.d.ts +10 -0
  37. package/src/lib/feature/legend/legendStrategies/notificationStrategy/logic/notificationLegend.logic.d.ts +5 -5
  38. package/src/lib/feature/legend/legendStrategies/notificationStrategy/utils/getNotificationTitlesByPropertyName.d.ts +1 -1
  39. package/src/lib/feature/legend/legendStrategies/notificationStrategy/utils/notificationLegend.utils.d.ts +2 -4
  40. package/src/lib/feature/legend/legendStrategies/workOrderStrategy/useCreateWorkOrderMarkers.d.ts +7 -4
  41. package/src/lib/feature/legend/logic/displayKeys.logic.d.ts +11 -0
  42. package/src/lib/feature/legend/logic/legendChips.logic.d.ts +8 -0
  43. package/src/lib/feature/legend/logic/propertyAccessor.utils.d.ts +5 -16
  44. package/src/lib/feature/legend/stores/legendUIStore/legendUIStore.d.ts +2 -2
  45. package/src/lib/feature/legend/stores/legendUIStore/legendUIStore.types.d.ts +25 -12
  46. package/src/lib/feature/legend/types/legendMarkerBadge.type.d.ts +74 -11
  47. package/src/lib/feature/legend/types/legendStrategy.type.d.ts +10 -5
  48. package/src/lib/feature/legend/types/legendType.d.ts +17 -6
  49. package/src/lib/feature/measuringPoint/components/lastRecordedMeasurement/lastRecordedMeasurement.logic.d.ts +1 -6
  50. package/src/lib/feature/measuringPoint/components/lastRecordedMeasurement/lastRecordedMeasurement.types.d.ts +5 -0
  51. package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointImageList.logic.d.ts +6 -0
  52. package/src/lib/feature/measuringPoint/components/measuringPointDetails/type/attachment.d.ts +4 -4
  53. package/src/lib/feature/measuringPoint/components/measuringPoints.utils.d.ts +2 -0
  54. package/src/lib/feature/measuringPoint/hooks/useDocumentRelationships.d.ts +1 -1
  55. package/src/lib/feature/measuringPoint/types/documentRelationships.d.ts +7 -7
  56. package/src/lib/feature/measuringPoint/types/measuringPoint.d.ts +14 -14
  57. package/src/lib/types/hookLibrary.d.ts +34 -22
  58. package/src/lib/feature/legend/components/basicLegendRenderer.logic.d.ts +0 -5
  59. package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByColor.d.ts +0 -34
  60. package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByColor.types.d.ts +0 -37
  61. package/src/lib/feature/legend/hooks/useGroupedMarkers.d.ts +0 -23
  62. package/src/lib/feature/legend/hooks/useGroupedMarkers.utils.d.ts +0 -9
  63. package/src/lib/feature/legend/hooks/useLegendMarker/useLegendMarker.d.ts +0 -19
  64. package/src/lib/feature/legend/hooks/useLegendMarker/useLegendMarker.utils.d.ts +0 -21
  65. package/src/lib/feature/legend/hooks/useLegendUniqueBadges.d.ts +0 -7
  66. package/src/lib/feature/legend/hooks/useLegendUniqueMarkers.d.ts +0 -7
  67. package/src/lib/feature/legend/hooks/useUniqueSelectionOnlyBadgeIdStrings.d.ts +0 -8
  68. package/src/lib/feature/legend/legendStrategies/notificationStrategy/hooks/useNotificationMarkers.d.ts +0 -10
  69. package/src/lib/feature/legend/logic/hiddenLegendChips.logic.d.ts +0 -6
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": "6.1.0",
3
+ "version": "6.2.1-edsv2-beta-0",
4
4
  "peerDependencies": {
5
- "@equinor/echo-base": ">= 6.1.0 < 7.0.0",
6
- "@equinor/echo-components": ">= 6.1.0 < 7.0.0",
7
- "@equinor/echo-core": ">= 6.1.0 < 7.0.0",
8
- "@equinor/echo-search": ">= 6.1.0 < 7.0.0",
9
- "@equinor/echo-utils": ">= 6.1.0 < 7.0.0",
5
+ "@equinor/echo-base": ">= 6.2.1 < 7.0.0",
6
+ "@equinor/echo-components": "6.2.1-edsv2-beta-0",
7
+ "@equinor/echo-core": ">= 6.2.1 < 7.0.0",
8
+ "@equinor/echo-search": ">= 6.2.1 < 7.0.0",
9
+ "@equinor/echo-utils": ">= 6.2.1 < 7.0.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",
@@ -20,10 +20,10 @@
20
20
  "zustand": ">= 4.4.7 < 5",
21
21
  "immer": ">= 11.1.4 < 12.0.0",
22
22
  "msw": ">= 2.0.0 < 3",
23
- "date-fns": "4.1.0"
23
+ "date-fns": "4.4.0"
24
24
  },
25
25
  "dependencies": {
26
- "dexie": "4.4.2",
26
+ "dexie": "4.4.3",
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
@@ -36,7 +36,7 @@ export { PopoverLoading } from './lib/feature/legend/components/pdfMarkers/subCo
36
36
  export * from './lib/feature/legend/index';
37
37
  export { legendVisibleTagsSubscribeToStore } from './lib/feature/legend/stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore';
38
38
  export { knownLegendIds } from './lib/feature/legend/types/legendType';
39
- export type { LegendDataId, LegendEquipmentId, LegendId, LegendState, LegendTagId, LegendWorkOrderId } from './lib/feature/legend/types/legendType';
39
+ export type { LegendDataId, LegendEquipmentId, LegendId, LegendIocAnnotationId, LegendState, LegendTagId, LegendWorkOrderId } from './lib/feature/legend/types/legendType';
40
40
  export { echoMapsIcon } from './lib/icons/echoMapsIcon';
41
41
  export type { Brand } from '@equinor/echo-utils';
42
42
  export { NewLegendToggler } from './lib/feature/legend/components/NewLegendToggler';
@@ -1,4 +1,3 @@
1
- import React from 'react';
2
1
  import { LeftPanelNavigationContent } from '../../services/leftPanelNavigation/leftPanelNavigation.store.types';
3
2
  /**
4
3
  * Hook for support the search panel navigation: it supports the "breadcumb" functionality, where the currently open item
@@ -9,6 +8,6 @@ import { LeftPanelNavigationContent } from '../../services/leftPanelNavigation/l
9
8
  * activeSearchItem: the currently opened search item in the search flow.
10
9
  */
11
10
  export declare const useLeftPanelNavigation: () => {
12
- previousButton: React.ReactNode;
11
+ previousButton: import("react/jsx-runtime").JSX.Element | undefined;
13
12
  activeSearchItem: LeftPanelNavigationContent | undefined;
14
13
  };
@@ -1,5 +1,5 @@
1
1
  export declare const historySelectionQueryKey = "historySelection";
2
2
  export declare const useFetchSelectionHistory: () => {
3
3
  status: "error" | "success" | "pending";
4
- data: import("../..").ApiSelectionHistory[] | undefined;
4
+ data: NoInfer<import("../..").ApiSelectionHistory[] | undefined> | undefined;
5
5
  };
@@ -4,7 +4,7 @@ import React from 'react';
4
4
  *
5
5
  * This dialog informs the user that one or more items being added to the selection already exist and have assigned colors.
6
6
  * It notifies the user that the latest (incoming) color will be assigned to these items.
7
- * The dialog is rendered via a portal and adapts its width for mobile devices.
7
+ * The dialog is rendered via a portal and adapts its width responsively.
8
8
  *
9
9
  * @returns {React.JSX.Element} The portal-rendered dialog component.
10
10
  */
@@ -1,12 +1,11 @@
1
1
  import { ItemMarkerSize } from '@equinor/echo-components';
2
2
  import React from 'react';
3
- import { ColorGroupedMarker } from '../utils/splitMarkerByColor.types';
3
+ import { CombinedMarker } from '../../../types/legendMarkerBadge.type';
4
4
  interface LegendColoredMarkerIconProps {
5
- hasPointer: boolean;
6
- isActive: boolean;
7
- onClick: () => void;
8
- hiddenBadges: string[];
9
- marker: ColorGroupedMarker;
5
+ readonly hasPointer: boolean;
6
+ readonly isActive: boolean;
7
+ readonly onClick: () => void;
8
+ readonly marker: CombinedMarker;
10
9
  }
11
10
  /**
12
11
  * Renders a colored marker icon with optional pointer and badges.
@@ -14,8 +13,7 @@ interface LegendColoredMarkerIconProps {
14
13
  * @param {boolean} hasPointer - Flag to indicate if the marker should have a pointer, currently in lower right corner.
15
14
  * @param {boolean} isActive - Flag to indicate if the marker is active (selected).
16
15
  * @param {() => void} onClick - Callback invoked when the marker is clicked.
17
- * @param {string[]} hiddenBadges - Array of badge titles that should be hidden.
18
- * @param {Marker} marker - The marker data to be rendered.
16
+ * @param {CombinedMarker} marker - The marker data to be rendered.
19
17
  *
20
18
  * @returns {React.JSX.Element | null} The rendered colored marker icon or null if no marker is provided.
21
19
  *
@@ -24,7 +22,6 @@ interface LegendColoredMarkerIconProps {
24
22
  * hasPointer={true}
25
23
  * isActive={false}
26
24
  * onClick={() => console.log('Marker clicked')}
27
- * hiddenBadges={['Badge1', 'Badge2']}
28
25
  * marker={markerData}
29
26
  * />
30
27
  */
@@ -1,13 +1,12 @@
1
1
  import type { MarkerId } from '../../../../shared/markerId.types';
2
+ import { CombinedMarker } from '../../../types/legendMarkerBadge.type';
2
3
  import { LegendDataId, LegendId } from '../../../types/legendType';
3
- import { ColorGroupedMarker } from '../utils/splitMarkerByColor.types';
4
4
  interface MarkerWithPopoverProps {
5
- legendId: LegendId;
6
- hasPointer: boolean;
7
- hiddenBadges: string[];
8
- marker: ColorGroupedMarker;
9
- itemId: LegendDataId;
10
- markerId: MarkerId;
5
+ readonly legendId: LegendId;
6
+ readonly hasPointer: boolean;
7
+ readonly marker: CombinedMarker;
8
+ readonly itemId: LegendDataId;
9
+ readonly markerId: MarkerId;
11
10
  }
12
11
  export declare const MarkerWithPopover: (props: MarkerWithPopoverProps) => import("react/jsx-runtime").JSX.Element;
13
12
  export {};
@@ -1,13 +1,11 @@
1
1
  import type { MarkerId } from '../../../../../../shared/markerId.types';
2
- import { Marker } from '../../../../../types/legendMarkerBadge.type';
3
- import { ColorGroupedMarker } from '../../../utils/splitMarkerByColor.types';
2
+ import { CombinedMarker } from '../../../../../types/legendMarkerBadge.type';
4
3
  /**
5
- * Builds the list of color-grouped markers to render for a single legend item.
6
- *
7
- * When the item has no selection grouping, wraps the raw marker as a single transparent-key variant.
8
- * Always returns markers sorted by color key for stable render order.
4
+ * Sorts markers by their highlight color key, with a fallback to alphabetical order.
5
+ * The transparent fallback marker (with TRANSPARENT_COLOR_KEY) is always sorted last.
6
+ * Returns an empty array if input is undefined or empty.
9
7
  */
10
- export declare function buildMarkersToRender(marker: Marker, groupedMarkers: ReadonlyArray<ColorGroupedMarker> | null | undefined): ColorGroupedMarker[];
8
+ export declare function sortMarkersByHighlightColor(markers: ReadonlyArray<CombinedMarker> | undefined): ReadonlyArray<CombinedMarker>;
11
9
  /**
12
10
  * Finds the best new markerId to migrate the active popover to after the old marker disappears.
13
11
  * Prefers a marker with the same color key, falls back to the first available.
@@ -1,7 +1,7 @@
1
1
  import type { MarkerId } from '../../../../../../shared/markerId.types';
2
- import { ColorGroupedMarker } from '../../../utils/splitMarkerByColor.types';
2
+ import { CombinedMarker } from '../../../../../types/legendMarkerBadge.type';
3
3
  interface UseStalePopoverMarkersProps {
4
- readonly markersToRender: ReadonlyArray<ColorGroupedMarker> | null;
4
+ readonly markersToRender: ReadonlyArray<CombinedMarker> | null;
5
5
  readonly markerIds: ReadonlyArray<MarkerId>;
6
6
  readonly selectionMarkerIds: ReadonlyArray<MarkerId>;
7
7
  }
@@ -15,5 +15,5 @@ interface UseStalePopoverMarkersProps {
15
15
  *
16
16
  * @returns The markers that should be rendered — either the stale snapshot or the live `markersToRender`.
17
17
  */
18
- export declare function useStalePopoverMarkers({ markersToRender, markerIds, selectionMarkerIds }: UseStalePopoverMarkersProps): ReadonlyArray<ColorGroupedMarker> | null;
18
+ export declare function useStalePopoverMarkers({ markersToRender, markerIds, selectionMarkerIds }: UseStalePopoverMarkersProps): ReadonlyArray<CombinedMarker> | null;
19
19
  export {};
@@ -1,6 +1,6 @@
1
1
  import type { MarkerId } from '../../../../../shared/markerId.types';
2
+ import type { CombinedMarker } from '../../../../types/legendMarkerBadge.type';
2
3
  import { LegendDataId, LegendId } from '../../../../types/legendType';
3
- import { ColorGroupedMarker } from '../../utils/splitMarkerByColor.types';
4
4
  /**
5
5
  * Hook to manage popover state and async content loading for legend markers.
6
6
  * When fetching, it will show a loading spinner if content takes too long to load.
@@ -11,7 +11,7 @@ import { ColorGroupedMarker } from '../../utils/splitMarkerByColor.types';
11
11
  * @param marker - The grouped marker data containing badges
12
12
  * @returns Object with isActive state, elements array, and handlers for open/close
13
13
  */
14
- export declare function useMarkerPopover(markerId: MarkerId, legendId: LegendId, itemId: LegendDataId, marker: ColorGroupedMarker): {
14
+ export declare function useMarkerPopover(markerId: MarkerId, legendId: LegendId, itemId: LegendDataId, marker: CombinedMarker): {
15
15
  isPopoverActive: boolean;
16
16
  elements: readonly import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>[];
17
17
  handleOpen: () => Promise<void>;
@@ -1,14 +1,17 @@
1
+ import { Brand } from '@equinor/echo-utils';
1
2
  import type { MarkerId } from '../../../../shared/markerId.types';
3
+ import { CombinedMarker } from '../../../types/legendMarkerBadge.type';
2
4
  import { LegendId } from '../../../types/legendType';
5
+ export type MarkerSelectionColorGroupKey = Brand<string, 'MarkerSelectionColorGroupKey'>;
3
6
  /**
4
7
  * Color key used when a marker is not in any selection group (fallback/transparent state).
5
8
  */
6
- export declare const TRANSPARENT_COLOR_KEY = "color_transparent";
9
+ export declare const TRANSPARENT_COLOR_KEY: MarkerSelectionColorGroupKey;
7
10
  /**
8
11
  * Creates a unique marker ID from its component parts.
9
12
  * Format: positionId::legendId::groupKey
10
13
  */
11
- export declare function createMarkerId(positionId: string, legendId: LegendId, groupKey: string): MarkerId;
14
+ export declare function createMarkerId(positionId: string, legendId: LegendId, groupKey: MarkerSelectionColorGroupKey): MarkerId;
12
15
  /**
13
16
  * Extracts the position ID from a marker ID.
14
17
  * Returns undefined if the marker ID is invalid.
@@ -23,4 +26,9 @@ export declare function isMarkerAtPosition(markerId: MarkerId | undefined, posit
23
26
  * Extracts the color/group key from a marker ID.
24
27
  * Returns undefined if the marker ID is invalid.
25
28
  */
26
- export declare function getColorKeyFromMarkerId(markerId: MarkerId): string | undefined;
29
+ export declare function getColorKeyFromMarkerId(markerId: MarkerId): MarkerSelectionColorGroupKey | undefined;
30
+ /**
31
+ * Derives a colorKey from a marker's highlightColor.
32
+ * Used for creating unique marker IDs.
33
+ */
34
+ export declare function getColorKeyFromMarker(marker: CombinedMarker): MarkerSelectionColorGroupKey;
@@ -1,27 +1,20 @@
1
1
  import { LegendState } from '../../types/legendType';
2
- import { Marker } from './../../types/legendMarkerBadge.type';
3
- /**
4
- * Returns an array of visible PopoverChip for the given markers and legend state.
5
- *
6
- * Filters out markers and badges that are hidden (using isHiddenMarker/isHiddenBadge) or whose titles match any value in the
7
- * excludedLegendTitles array (case-insensitive). Badge chips are only included if selectedMarkerOption !== selectedBadgeOption.
8
- *
9
- * @param {object} params - The function parameters.
10
- * @param {ReadonlyArray<Marker>} params.markers - The list of marker objects to process.
11
- * @param {LegendState} params.legend - The legend state, used for filtering and selection logic.
12
- * @param {ReadonlyArray<string>} [params.excludedLegendTitles] - Optional array of titles to exclude from the chips (case-insensitive).
13
- * @returns {PopoverChip[]} The filtered and mapped array of PopoverChip for rendering.
14
- */
2
+ import { RawMarkerData } from './../../types/legendMarkerBadge.type';
15
3
  interface GetPopoverChipsParams {
16
- markers: ReadonlyArray<Marker>;
17
- legendSelectedBadgeOption?: LegendState['selectedBadgeOption'];
18
- legendSelectedMarkerOption?: LegendState['selectedMarkerOption'];
19
- excludedLegendTitles?: ReadonlyArray<string>;
4
+ readonly markers: ReadonlyArray<RawMarkerData>;
5
+ readonly legendSelectedBadgeOption?: LegendState['selectedBadgeOption'];
6
+ readonly legendSelectedMarkerOption?: LegendState['selectedMarkerOption'];
7
+ readonly excludedLegendTitles?: ReadonlyArray<string>;
20
8
  }
21
9
  interface PopoverChip {
22
- text: string;
23
- backgroundColor: string;
24
- textColor: string;
10
+ readonly text: string;
11
+ readonly backgroundColor: string;
12
+ readonly textColor: string;
25
13
  }
26
- export declare function getPopoverChips({ markers, legendSelectedBadgeOption, legendSelectedMarkerOption, excludedLegendTitles }: GetPopoverChipsParams): PopoverChip[];
14
+ /**
15
+ * Generates an array of chips to be displayed in the legend popover based on the provided markers and legend options.
16
+ * It includes marker appearances and, if the selected marker and badge options are different, badge appearances as well.
17
+ * Chips with titles included in the excludedLegendTitles array will be filtered out (case-insensitive).
18
+ */
19
+ export declare function getPopoverChips({ markers, legendSelectedBadgeOption, legendSelectedMarkerOption, excludedLegendTitles }: GetPopoverChipsParams): ReadonlyArray<PopoverChip>;
27
20
  export {};
@@ -1,12 +1,12 @@
1
- import { Marker } from '../../../types/legendMarkerBadge.type';
1
+ import { RawMarkerData } from '../../../types/legendMarkerBadge.type';
2
2
  import { LegendDataId, LegendId } from '../../../types/legendType';
3
3
  /**
4
- * Returns all markers for a specific legend based on the provided item IDs.
4
+ * Returns all raw markers for a specific legend based on the provided item IDs.
5
5
  * The markers are only returned if the legend is enabled.
6
6
  */
7
- export declare const useMarkersFromEnabledLegend: (legendId: LegendId, itemIds: LegendDataId[]) => readonly Marker[];
7
+ export declare const useRawMarkersFromEnabledLegend: (legendId: LegendId, itemIds: LegendDataId[]) => readonly RawMarkerData[];
8
8
  /**
9
- * Returns all enabled legend's marker itemIDs, including those from badges on markers.
9
+ * Returns all enabled legend's marker itemIDs from raw markers.
10
10
  * Only returns item IDs that actually have markers from enabled legends.
11
11
  */
12
12
  export declare const useAllMarkerItemIdsForEnabledLegends: () => LegendDataId[];
@@ -1,10 +1,11 @@
1
1
  import { Guid } from '@equinor/echo-utils';
2
2
  import { GlobalSelectionItemType } from '../../../globalSelection';
3
- import { ColorGroupedMarker, GroupKey } from '../pdfMarkers/utils/splitMarkerByColor.types';
3
+ import type { LegendSelectionGroupKey } from '../../stores/legendUIStore/legendUIStore.types';
4
+ import { CombinedMarker } from '../../types/legendMarkerBadge.type';
4
5
  /**
5
- * Key used for badges that don't belong to any selection group
6
+ * Key used for markers that don't belong to any selection group
6
7
  */
7
- export declare const NOT_IN_SELECTION_GROUP_KEY: GroupKey;
8
+ export declare const NOT_IN_SELECTION_GROUP_KEY: LegendSelectionGroupKey;
8
9
  /**
9
10
  * Determines if groups should be split by item type.
10
11
  * Only true for the default local selection group (Local Selection).
@@ -25,13 +26,12 @@ export declare const shouldSplitGroupsByItemType: (groupId: Guid) => boolean;
25
26
  * @param itemType - Optional item type for local selection which will be split by type
26
27
  * @returns The standardized group key
27
28
  */
28
- export declare const createSelectionGroupKey: (groupId: Guid, color: string, itemType?: GlobalSelectionItemType) => GroupKey;
29
+ export declare const createSelectionGroupKey: (groupId: Guid, color: string, itemType?: GlobalSelectionItemType) => LegendSelectionGroupKey;
29
30
  /**
30
- * Checks if a marker belongs to the "Not in Selection" group.
31
- * With color-based grouping, this checks if all badges are outside any selection.
31
+ * Checks if a marker is outside any selection group.
32
+ * A marker is outside selection if its highlight color is 'transparent'.
32
33
  *
33
34
  * @param marker - The marker to check.
34
- *
35
- * @returns True if the marker is in the "Not in Selection" group, false otherwise.
35
+ * @returns True if the marker is not in any selection group, false otherwise.
36
36
  */
37
- export declare const isMarkerOutsideSelection: (marker: ColorGroupedMarker) => boolean;
37
+ export declare const isMarkerOutsideSelection: (marker: CombinedMarker) => boolean;
@@ -0,0 +1,7 @@
1
+ import type { LegendChipProps } from '@equinor/echo-components';
2
+ import type { LegendId } from '../types/legendType';
3
+ /**
4
+ * Returns legend chip props for all unique badges for the given legendId.
5
+ * Handles hide/show state and the showChipsInViewportOnly option.
6
+ */
7
+ export declare function useLegendBadgeChips(legendId: LegendId): ReadonlyArray<LegendChipProps>;
@@ -1,7 +1,5 @@
1
- import { LegendUIState } from '../stores/legendUIStore/legendUIStore.types';
1
+ import type { ToggleableLegend } from '../stores/legendUIStore/legendUIStore.types';
2
2
  import { LegendId } from '../types/legendType';
3
- /** Explicit keys from LegendUIState that contain hidden items. Will error if keys don't exist. */
4
- type HiddenItemsKey = keyof Pick<LegendUIState, 'hiddenMarkers' | 'hiddenBadges'>;
5
3
  /**
6
4
  * Subscribes to hidden state changes for multiple keys (e.g., all group keys from a marker).
7
5
  *
@@ -15,19 +13,11 @@ type HiddenItemsKey = keyof Pick<LegendUIState, 'hiddenMarkers' | 'hiddenBadges'
15
13
  *
16
14
  * @param legendId - The legend ID to subscribe to
17
15
  * @param potentialKeys - Array of keys to watch for visibility changes (e.g., group keys, badge keys)
18
- * @param storeKey - Which hidden array to subscribe to (from LegendUIState)
19
- * @returns The full hidden items array from the store (for filtering logic)
16
+ * @returns The full hiddenItems array from the store (for filtering logic)
20
17
  *
21
18
  * @example
22
19
  * ```tsx
23
- * // Get all potential group keys for this marker's badges
24
- * const groupKeys = useMemo(() =>
25
- * getPotentialGroupKeysForMarker(marker, itemToGroupsMap).map(k => k.toString()).sort(),
26
- * [marker, itemToGroupsMap]
27
- * );
28
- * // Subscribe to visibility changes for ALL these group keys
29
- * const hiddenMarkers = useLegendHiddenItemsSubscription(legendId, groupKeys, 'hiddenMarkers');
20
+ * const hiddenMarkers = useLegendHiddenItemsSubscription(legendId, groupKeys);
30
21
  * ```
31
22
  */
32
- export declare const useLegendHiddenItemsSubscription: (legendId: LegendId, potentialKeys: string[], storeKey: HiddenItemsKey) => string[];
33
- export {};
23
+ export declare const useLegendHiddenItemsSubscription: (legendId: LegendId, potentialKeys: ReadonlyArray<ToggleableLegend>) => ReadonlyArray<ToggleableLegend>;
@@ -0,0 +1,7 @@
1
+ import type { LegendChipProps } from '@equinor/echo-components';
2
+ import type { LegendId } from '../types/legendType';
3
+ /**
4
+ * Returns legend chip props for all unique markers for the given legendId.
5
+ * Handles hide/show state and the showChipsInViewportOnly option.
6
+ */
7
+ export declare function useLegendMarkerChips(legendId: LegendId): ReadonlyArray<LegendChipProps>;
@@ -0,0 +1,17 @@
1
+ import type { CombinedMarker } from '../../types/legendMarkerBadge.type';
2
+ import type { LegendDataId, LegendId } from '../../types/legendType';
3
+ export interface UseLegendMarkersProps {
4
+ readonly legendId: LegendId;
5
+ readonly itemIds: LegendDataId[];
6
+ }
7
+ /**
8
+ * Resolves the given itemIds against the legend strategy into combined markers for the PDF,
9
+ * with one marker per unique highlight color. Hidden display keys and hidden
10
+ * selection groups are excluded. Returns undefined when the legend is disabled
11
+ * or no markers remain visible.
12
+ *
13
+ * @param props.legendId - The legend to get markers from
14
+ * @param props.itemIds - The item IDs to create markers from
15
+ * @returns Markers grouped by highlight color, or undefined if the legend is disabled or empty
16
+ */
17
+ export declare function useLegendMarkers(props: UseLegendMarkersProps): ReadonlyArray<CombinedMarker> | undefined;
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Pure logic functions for legend marker processing.
3
+ *
4
+ * All functions in this module are pure (no hooks, no React imports).
5
+ * They handle: filtering, processing raw→processed markers, selection info lookup,
6
+ * grouping by highlight color, and badge combination.
7
+ */
8
+ import { GlobalSelectionTypes } from '../../../globalSelection/globalSelectionStore/globalSelectionStore.types';
9
+ import type { LegendDisplayKey, LegendSelectionGroupKey, ToggleableLegend } from '../../stores/legendUIStore/legendUIStore.types';
10
+ import type { Badge, CombinedMarker, ProcessedMarker, RawMarkerData } from '../../types/legendMarkerBadge.type';
11
+ import { type LegendBadgeColorMode, type LegendBadgeOptionConfig, type LegendDataId } from '../../types/legendType';
12
+ /**
13
+ * Collects displayKeys from raw markers AND their badges for early hidden state subscription.
14
+ * This is cheap - just computes title+color hash without selection lookups.
15
+ * Includes badge displayKeys so hiding a badge type hides the entire marker.
16
+ */
17
+ export declare const collectRawDisplayKeys: (rawMarkers: ReadonlyArray<RawMarkerData>) => ReadonlyArray<LegendDisplayKey>;
18
+ /**
19
+ * Filters hidden appearances from raw markers BEFORE expensive processing.
20
+ * - Removes individual hidden markerAppearances and badgeAppearances from each marker.
21
+ * - Drops the marker entirely only when no visible markerAppearances remain.
22
+ *
23
+ * This ensures the surviving appearance determines the final color when one is toggled off.
24
+ */
25
+ export declare const filterHiddenRawMarkers: (rawMarkers: ReadonlyArray<RawMarkerData>, hiddenItems: ReadonlyArray<ToggleableLegend>) => ReadonlyArray<RawMarkerData>;
26
+ /**
27
+ * Processes raw badge data into full badges.
28
+ * When badgeColorMode is 'marker', resolves badge color from the marker's appearances:
29
+ * - If all marker appearances share a single color, uses that color.
30
+ * - If multiple distinct marker colors exist, uses the "multiple" color.
31
+ */
32
+ export declare const processRawBadges: (rawMarker: RawMarkerData, markerColor: string, badgeColorMode?: LegendBadgeColorMode) => ReadonlyArray<Badge>;
33
+ /**
34
+ * Collects toggleable groupKeys from processed markers for selection group visibility subscription.
35
+ */
36
+ export declare const collectGroupKeys: (markers: ReadonlyArray<ProcessedMarker>) => ReadonlyArray<LegendSelectionGroupKey>;
37
+ /**
38
+ * Filters out markers whose selection group is hidden.
39
+ */
40
+ export declare const filterHiddenGroups: (markers: ReadonlyArray<ProcessedMarker>, hiddenGroups: ReadonlyArray<ToggleableLegend>) => ReadonlyArray<ProcessedMarker>;
41
+ /**
42
+ * Groups markers by highlight color and combines each group into a single marker.
43
+ * Returns an array of final markers (without processing data), one per unique highlight color.
44
+ */
45
+ export declare const groupAndFinalizeMarkersByHighlightColor: (markers: ReadonlyArray<ProcessedMarker>, selectedBadgeOption?: LegendBadgeOptionConfig, combinedMarkerIcon?: string) => ReadonlyArray<CombinedMarker>;
46
+ /**
47
+ * Collects all item ID strings from raw markers for selection subscription.
48
+ */
49
+ export declare const collectSelectionItemIdStrings: (rawMarkers: ReadonlyArray<RawMarkerData>) => ReadonlyArray<GlobalSelectionTypes.ItemIdString>;
50
+ /**
51
+ * Processes raw marker data into full markers.
52
+ * Highlight colors and group keys are frozen at creation time (not read dynamically)
53
+ * so that stale markers preserve their old colors during transitions.
54
+ */
55
+ export declare const processRawMarkers: (rawMarkers: ReadonlyArray<RawMarkerData>, selectedBadgeOption?: LegendBadgeOptionConfig) => ReadonlyArray<ProcessedMarker>;
56
+ interface SelectionInfo {
57
+ readonly highlightColor: string;
58
+ readonly groupKey: LegendSelectionGroupKey;
59
+ }
60
+ /**
61
+ * Gets the selection info (highlight color and group key) for an item from global selection.
62
+ * Returns transparent color and NOT_IN_SELECTION_GROUP_KEY if not in any selection group.
63
+ */
64
+ export declare const getSelectionInfoForItem: (itemId: LegendDataId) => SelectionInfo;
65
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { RawMarkerData } from '../../types/legendMarkerBadge.type';
2
+ import { type LegendDataId, type LegendId } from '../../types/legendType';
3
+ /**
4
+ * Development helper to track hook calls
5
+ */
6
+ export declare const trackMarkerCallsInDevelopment: () => void;
7
+ /**
8
+ * Helper to get unique data from the legend visible data store
9
+ */
10
+ export declare const useUniqueVisibleData: () => LegendDataId[];
11
+ /**
12
+ * Gets raw marker data from the strategy.
13
+ */
14
+ export declare const useRawMarkerData: (legendId: LegendId, data: LegendDataId[]) => ReadonlyArray<RawMarkerData>;
@@ -12,4 +12,4 @@ import { WorkOrderDto } from '@equinor/echo-search';
12
12
  * ```
13
13
  *
14
14
  */
15
- export declare function useWorkOrdersByTagsQuery(tagNos: string[]): import("@tanstack/react-query").UseQueryResult<readonly WorkOrderDto[], Error>;
15
+ export declare function useWorkOrdersByTagsQuery(tagNos: string[]): import("@tanstack/react-query").UseQueryResult<NoInfer<readonly WorkOrderDto[]>, Error>;
@@ -1,6 +1,6 @@
1
+ import './legendStrategies/iocAnnotationStrategy/iocAnnotationStrategy';
1
2
  import './legendStrategies/notificationStrategy/notificationStrategy';
2
3
  import './legendStrategies/workOrderStrategy/WorkOrderLegend';
3
- export { getBadgeChips, getMarkerChips } from './components/basicLegendRenderer.logic';
4
4
  export { LegendList } from './components/LegendList';
5
5
  export { LegendSelectorContainer } from './components/LegendSelectorContainer';
6
6
  export { PositionalItem } from './components/pdfMarkers/PositionalItem';
@@ -9,18 +9,20 @@ export { LegendPopoverContent } from './components/popover/LegendPopoverContent'
9
9
  export type { LegendPopoverContentProps } from './components/popover/LegendPopoverContent';
10
10
  export { trackEventNewLegendAccordionToggled, trackEventNewLegendSelectedBadgeOptionChanged, trackEventNewLegendSelectedMarkerOptionChanged } from './legendAnalytics';
11
11
  export { legendFacade } from './legendFacade';
12
+ export { convertIocAnnotationStateToLegendStatus, getPrioritizedIocAnnotationLegendStatus } from './legendStrategies/iocAnnotationStrategy/hooks/useIocAnnotationMarkers.utils';
13
+ export type { IocAnnotationState } from './legendStrategies/iocAnnotationStrategy/iocAnnotationStrategy.types';
12
14
  export { getLegendStrategy } from './legendStrategies/legendCollections';
13
15
  export { legendSnapShot } from './stores/legendDataStore/legendStore';
14
- export type { Badge, Marker } from './types/legendMarkerBadge.type';
16
+ export type { Badge, CombinedMarker, LegendChipData, RawItemAppearance, RawMarkerData } from './types/legendMarkerBadge.type';
15
17
  export type { LegendStrategy } from './types/legendStrategy.type';
16
- export type { LegendBadgeOptionConfig, LegendId, LegendMarkerOptionConfig, LegendOptionConfig, LegendOptionDisplayOption } from './types/legendType';
17
- export { useLegendUniqueBadges } from './hooks/useLegendUniqueBadges';
18
- export { useLegendUniqueMarkers } from './hooks/useLegendUniqueMarkers';
18
+ export type { LegendBadgeColorMode, LegendBadgeOptionConfig, LegendId, LegendMarkerOptionConfig, LegendOptionConfig, LegendOptionDisplayOption } from './types/legendType';
19
+ export { useLegendMarkerChips } from './hooks/useLegendMarkerChips';
19
20
  export { useOpenWorkOrdersByTagNos } from './hooks/useWorkOrdersByTagNos';
20
21
  export { useWorkOrdersByTagsQuery } from './hooks/useWorkOrdersByTagsQuery';
21
22
  export { isCountMode, isIdMode, normalizeBadges } from './logic/normalizeBadges';
22
23
  export { getColorForLegendStatus } from './logic/getColorForLegendStatus';
23
- export { createArrayAccessor, createCountAccessor, createDateAccessor, createStringAccessor, getPropertyValues, toSingleTitle } from './logic/propertyAccessor.utils';
24
+ export { createArrayAccessor, createDateAccessor, createStringAccessor, getPropertyValues } from './logic/propertyAccessor.utils';
24
25
  export type { PropertyAccessor } from './logic/propertyAccessor.utils';
25
26
  export { useLegendUIStore } from './stores/legendUIStore/legendUIStore';
26
27
  export { useLegendVisibleDataStore } from './stores/legendVisibleDataStore/legendVisibleDataStore';
28
+ export { createDisplayKey } from './logic/displayKeys.logic';
@@ -2,7 +2,7 @@ import { getLegendStrategy, injectLegendStrategy } from './legendStrategies/lege
2
2
  import { isLegendDataIdEqualWithTag } from './logic/isLegendDataIdEqualWithTag';
3
3
  import { legendExistsInLegendStore, legendSnapShot, legendStoreSubscribe, useAllLegends, useLegendById } from './stores/legendDataStore/legendStore';
4
4
  import { legendExistsInLegendUIStore, useLegendUIById } from './stores/legendUIStore/legendUIStore';
5
- import type { LegendFeedbackVariant } from './stores/legendUIStore/legendUIStore.types';
5
+ import type { LegendFeedbackVariant, ToggleableLegend } from './stores/legendUIStore/legendUIStore.types';
6
6
  import { visibleDataAsTagsSnapshot } from './stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore';
7
7
  import { LegendId } from './types/legendType';
8
8
  /**
@@ -31,25 +31,18 @@ export declare const legendFacade: Readonly<{
31
31
  } | undefined) => void;
32
32
  resetFeedback: (legendId: LegendId) => void;
33
33
  };
34
- markers: {
34
+ hiddenItems: {
35
35
  setHidden: (params: {
36
36
  legendId: LegendId;
37
- marker: string;
37
+ item: ToggleableLegend;
38
38
  isHidden: boolean;
39
39
  }) => void;
40
40
  setHiddenBatch: (updates: Array<{
41
41
  legendId: LegendId;
42
- marker: string;
42
+ item: ToggleableLegend;
43
43
  isHidden: boolean;
44
44
  }>) => void;
45
45
  };
46
- badges: {
47
- setHidden: (params: {
48
- legendId: LegendId;
49
- badge: string;
50
- isHidden: boolean;
51
- }) => void;
52
- };
53
46
  };
54
47
  exists: (legendId: LegendId) => boolean;
55
48
  visibleData: {
@@ -161,9 +154,10 @@ export declare const legendFacade: Readonly<{
161
154
  };
162
155
  };
163
156
  knownLegendIds: {
164
- equipmentLegendId: LegendId;
165
- tagLegendId: LegendId;
166
- workOrderLegendId: LegendId;
167
- notificationLegendId: LegendId;
157
+ equipmentLegendId: "Equipment Legend";
158
+ tagLegendId: "Tag Legend";
159
+ workOrderLegendId: "Work Order Legend";
160
+ notificationLegendId: "Notification Legend";
161
+ iocAnnotationLegendId: "IOC Annotation Legend";
168
162
  };
169
163
  }>;
@@ -0,0 +1,3 @@
1
+ import type { FunctionalLocation, IocAnnotationDto, IocAnnotationFunctionalLocationLookup, IocAnnotationTagLookup } from '../iocAnnotationStrategy.types';
2
+ export declare function fetchIocAnnotationFunctionalLocationLookups(tagLookups: ReadonlyArray<IocAnnotationTagLookup>): Promise<ReadonlyArray<IocAnnotationFunctionalLocationLookup>>;
3
+ export declare function fetchIocAnnotationsByFunctionalLocations(functionalLocations: ReadonlyArray<FunctionalLocation>): Promise<ReadonlyArray<IocAnnotationDto>>;
@@ -0,0 +1,3 @@
1
+ import type { RawMarkerData } from '../../../types/legendMarkerBadge.type';
2
+ import type { LegendDataId } from '../../../types/legendType';
3
+ export declare function useIocAnnotationMarkers(itemIds: ReadonlyArray<LegendDataId>): ReadonlyArray<RawMarkerData>;
@@ -0,0 +1,21 @@
1
+ import type { RawItemAppearance, RawMarkerData } from '../../../types/legendMarkerBadge.type';
2
+ import type { IocAnnotationDto, IocAnnotationFunctionalLocationLookup, IocAnnotationMarkerData, IocAnnotationMarkerDataByTagKey, IocAnnotationState, IocAnnotationTagKey, IocAnnotationTagLookup } from '../iocAnnotationStrategy.types';
3
+ /**
4
+ * Maps an IOC annotation state code (e.g. `ow`, `ip`, `er`) to its corresponding
5
+ * `LegendStatus`. Single source of truth for the conversion — re-exported via
6
+ * `@equinor/echo-framework` so legacy code paths in echopedia-web can consume
7
+ * the same mapping while the new legend rolls out behind a feature flag.
8
+ */
9
+ export declare function convertIocAnnotationStateToLegendStatus(state: string): IocAnnotationState;
10
+ export declare function getPrioritizedIocAnnotationLegendStatus(iocAnnotationStates: ReadonlyArray<string>): IocAnnotationState;
11
+ export declare function createIocAnnotationTagKey(tagLookup: IocAnnotationTagLookup): IocAnnotationTagKey;
12
+ export declare function getUniqueSortedIocAnnotationTagLookups(tagLookups: ReadonlyArray<IocAnnotationTagLookup>): ReadonlyArray<IocAnnotationTagLookup>;
13
+ export declare function createIocAnnotationTagLookupQueryKey(sortedTagLookups: ReadonlyArray<IocAnnotationTagLookup>): ReadonlyArray<IocAnnotationTagKey>;
14
+ export declare function createIocAnnotationTagLookupsFromQueryKey(tagLookupQueryKey: ReadonlyArray<IocAnnotationTagKey>): ReadonlyArray<IocAnnotationTagLookup>;
15
+ export declare function buildIocAnnotationMarkerDataByTagKey({ iocAnnotations, functionalLocationLookups }: {
16
+ readonly iocAnnotations: ReadonlyArray<IocAnnotationDto>;
17
+ readonly functionalLocationLookups: ReadonlyArray<IocAnnotationFunctionalLocationLookup>;
18
+ }): IocAnnotationMarkerDataByTagKey;
19
+ export declare function createIocAnnotationMarkers(markerData: IocAnnotationMarkerData): ReadonlyArray<RawMarkerData>;
20
+ export declare const getIOCMarkerAppearances: (iocAnnotation: IocAnnotationDto) => ReadonlyArray<RawItemAppearance>;
21
+ export declare const getIOCBadgeAppearances: (iocAnnotation: IocAnnotationDto) => ReadonlyArray<RawItemAppearance>;