@equinor/echo-framework 2.4.2 → 2.4.3

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 (45) hide show
  1. package/index.cjs.js +3 -3
  2. package/package.json +6 -6
  3. package/src/lib/components/searchListItem/searchListItem.d.ts +2 -0
  4. package/src/lib/feature/globalSelection/globalSelectionStore/actions/addTagsToSelection.action.d.ts +8 -4
  5. package/src/lib/feature/globalSelection/globalSelectionStore/actions/tagFetch.logic.d.ts +10 -0
  6. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.d.ts +30 -2
  7. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +42 -31
  8. package/src/lib/feature/globalSelection/index.d.ts +2 -0
  9. package/src/lib/feature/globalSelection/pdmsTag/pdmsTag.types.d.ts +13 -0
  10. package/src/lib/feature/globalSelection/pdmsTag/pdmsTag.utils.d.ts +6 -0
  11. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.d.ts +7 -0
  12. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +1 -0
  13. package/src/lib/feature/legend/components/LegendFeedbackMessage.d.ts +12 -0
  14. package/src/lib/feature/legend/components/pdfMarkers/PositionalItem.d.ts +1 -1
  15. package/src/lib/feature/legend/components/pdfMarkers/PositionalLegendMarkers.d.ts +1 -9
  16. package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendColoredMarkerIcon.d.ts +2 -2
  17. package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendMarkersRenderer.d.ts +1 -4
  18. package/src/lib/feature/legend/components/pdfMarkers/subComponents/MarkerWithPopover.d.ts +2 -2
  19. package/src/lib/feature/legend/components/pdfMarkers/subComponents/{MultipleMarkersBySingleLegend.d.ts → components/MultipleMarkersBySingleLegend/MultipleMarkersBySingleLegend.d.ts} +2 -3
  20. package/src/lib/feature/legend/components/pdfMarkers/subComponents/components/MultipleMarkersBySingleLegend/MultipleMarkersBySingleLegendContainer.d.ts +4 -0
  21. package/src/lib/feature/legend/components/pdfMarkers/subComponents/hooks/useMarkerPopover.d.ts +2 -2
  22. package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByColor.d.ts +34 -0
  23. package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByColor.types.d.ts +37 -0
  24. package/src/lib/feature/legend/components/selectionLegend/hooks/useAllMarkerItemIdsForEnabledLegends.d.ts +12 -0
  25. package/src/lib/feature/legend/components/selectionLegend/hooks/useSelectionGroupsForLegendRenderer.d.ts +4 -1
  26. package/src/lib/feature/legend/components/selectionLegend/hooks/useSelectionGroupsForLegendRenderer.utils.d.ts +8 -4
  27. package/src/lib/feature/legend/components/selectionLegend/selectionLegend.utils.d.ts +4 -7
  28. package/src/lib/feature/legend/hooks/useGroupedMarkers.d.ts +17 -10
  29. package/src/lib/feature/legend/hooks/useGroupedMarkers.utils.d.ts +13 -0
  30. package/src/lib/feature/legend/hooks/useItemToSelectionGroupsMapSubscription.d.ts +29 -0
  31. package/src/lib/feature/legend/hooks/useLegendHiddenItemsSubscription.d.ts +33 -0
  32. package/src/lib/feature/legend/hooks/useLegendMarker/useLegendMarker.d.ts +10 -2
  33. package/src/lib/feature/legend/hooks/useSelectionItemColorSubscription.d.ts +16 -0
  34. package/src/lib/feature/legend/hooks/useUniqueBadgeItemIdStrings.d.ts +6 -0
  35. package/src/lib/feature/legend/legendFacade.d.ts +11 -0
  36. package/src/lib/feature/legend/stores/itemToSelectionGroupsMapStore/itemToSelectionGroupsMapStore.d.ts +22 -0
  37. package/src/lib/feature/legend/stores/itemToSelectionGroupsMapStore/itemToSelectionGroupsMapStore.types.d.ts +21 -0
  38. package/src/lib/feature/legend/stores/itemToSelectionGroupsMapStore/itemToSelectionGroupsMapStore.utils.d.ts +14 -0
  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 +14 -0
  41. package/src/lib/feature/legend/stores/legendVisibleDataStore/legendVisibleDataStore.d.ts +9 -2
  42. package/src/lib/feature/legend/types/legendMarkerBadge.type.d.ts +2 -2
  43. package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.d.ts +0 -22
  44. package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.types.d.ts +0 -22
  45. package/src/lib/feature/legend/components/selectionLegend/hooks/useAllGroupedMarkersForLegends.d.ts +0 -5
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "peerDependencies": {
5
- "@equinor/echo-base": ">= 2.4.2 < 3.0.0",
6
- "@equinor/echo-components": ">= 2.4.2 < 3.0.0",
5
+ "@equinor/echo-base": ">= 2.4.3 < 3.0.0",
6
+ "@equinor/echo-components": ">= 2.4.3 < 3.0.0",
7
7
  "@equinor/echo-core": ">= 2.4.2 < 3.0.0",
8
- "@equinor/echo-search": ">= 2.4.2 < 3.0.0",
9
- "@equinor/echo-utils": ">= 2.4.2 < 3.0.0",
8
+ "@equinor/echo-search": ">= 2.4.3 < 3.0.0",
9
+ "@equinor/echo-utils": ">= 2.4.3 < 3.0.0",
10
10
  "@equinor/eds-core-react": "0.49.0",
11
11
  "@equinor/eds-icons": "0.22.0",
12
12
  "react": ">= 17.0.2",
@@ -15,7 +15,7 @@
15
15
  "@microsoft/signalr": "9.0.6",
16
16
  "classnames": "2.5.1",
17
17
  "history": "5.3.0",
18
- "lodash": "4.17.21",
18
+ "lodash": "4.17.23",
19
19
  "react-router-dom": "5.3.4",
20
20
  "zustand": ">= 4.4.7 < 5",
21
21
  "immer": "11.1.3",
@@ -36,6 +36,7 @@ type BaseProps = {
36
36
  isHighlightable?: boolean;
37
37
  itemActions?: React.ReactNode;
38
38
  footer?: React.ReactNode;
39
+ showChevron?: boolean;
39
40
  };
40
41
  type SearchListItemProps = BaseProps & WithVisualOrIconOptions;
41
42
  export {};
@@ -54,6 +55,7 @@ export {};
54
55
  * @property {boolean} [isHighlightable] - Whether the text is highlightable.
55
56
  * @property {React.ReactNode} [itemActions] - Custom actions to display in the list item.
56
57
  * @property {React.ReactNode} [footer] - Footer content for the list item.
58
+ * @property {boolean} [showChevron] - Whether to show the navigation chevron. Defaults to true.
57
59
  */
58
60
  /**
59
61
  * Visual component properties for the SearchListItem component.
@@ -1,8 +1,12 @@
1
- import { GlobalSelectionTypes } from '../globalSelectionStore.types';
2
- export declare const addTagsToSelectionAction: (set: (set: (state: import("../globalSelectionStore.types").GlobalSelectionStore) => void, shouldReplace?: boolean | undefined, action?: string) => void, get: import("zustand").StoreApi<import("../globalSelectionStore.types").GlobalSelectionStore>["getState"], args: {
1
+ import type { ResultArray, TagSummaryDto } from '@equinor/echo-search';
2
+ import type { StoreApi } from 'zustand';
3
+ import { GlobalSelectionStore, GlobalSelectionTypes } from '../globalSelectionStore.types';
4
+ export declare function addTagsToSelectionAction(set: SetFunction, get: StoreApi<GlobalSelectionStore>['getState'], args: {
3
5
  itemIds: GlobalSelectionTypes.TagId[];
4
6
  color?: string;
5
- }) => Promise<{
6
- fetchResult: import("@equinor/echo-search").ResultArray<import("@equinor/echo-search").TagSummaryDto>[];
7
+ }): Promise<{
8
+ fetchResult: ResultArray<TagSummaryDto>[];
7
9
  actionResult: GlobalSelectionTypes.ActionResult;
8
10
  }>;
11
+ type SetFunction = (set: (state: GlobalSelectionStore) => void, shouldReplace?: boolean | undefined, action?: string) => void;
12
+ export {};
@@ -0,0 +1,10 @@
1
+ import { type TagSummaryDto } from '@equinor/echo-search';
2
+ import type { GlobalSelectionTypes } from '../globalSelectionStore.types';
3
+ export type TagFetchResult = {
4
+ result: {
5
+ values: TagSummaryDto[];
6
+ isSuccess: boolean;
7
+ };
8
+ itemIdsUsed: GlobalSelectionTypes.TagId[];
9
+ };
10
+ export declare function fetchStidTags(stidTags: readonly GlobalSelectionTypes.TagId[]): Promise<TagFetchResult[]>;
@@ -55,11 +55,11 @@ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Om
55
55
  itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
56
56
  }) => void;
57
57
  setColorByItemIds: (args: {
58
- itemIds: ReadonlyArray<Readonly<GlobalSelectionTypes.ItemId>>;
58
+ itemIds: readonly Readonly<GlobalSelectionTypes.ItemId>[];
59
59
  color: string;
60
60
  }) => void;
61
61
  setVisibilityByItemIds: (args: {
62
- itemIds: ReadonlyArray<Readonly<GlobalSelectionTypes.ItemId>>;
62
+ itemIds: readonly Readonly<GlobalSelectionTypes.ItemId>[];
63
63
  isVisible: boolean;
64
64
  }) => void;
65
65
  setAllItemsVisibility: (args: {
@@ -80,9 +80,16 @@ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Om
80
80
  items: Map<GlobalSelectionTypes.ItemIdString, {
81
81
  id: {
82
82
  workOrderId: string;
83
+ } | {
84
+ tagNo: string;
85
+ instCode: string;
86
+ internalTagType: import("..").PdmsInternalTagType;
87
+ plantNo: string;
88
+ plantCode: string;
83
89
  } | {
84
90
  instCode: string;
85
91
  tagNo: string;
92
+ internalTagType?: never | undefined;
86
93
  } | {
87
94
  equipmentId: string;
88
95
  } | {
@@ -120,9 +127,16 @@ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Om
120
127
  items: Map<GlobalSelectionTypes.ItemIdString, {
121
128
  id: {
122
129
  workOrderId: string;
130
+ } | {
131
+ tagNo: string;
132
+ instCode: string;
133
+ internalTagType: import("..").PdmsInternalTagType;
134
+ plantNo: string;
135
+ plantCode: string;
123
136
  } | {
124
137
  instCode: string;
125
138
  tagNo: string;
139
+ internalTagType?: never | undefined;
126
140
  } | {
127
141
  equipmentId: string;
128
142
  } | {
@@ -165,9 +179,16 @@ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Om
165
179
  items: Map<GlobalSelectionTypes.ItemIdString, {
166
180
  id: {
167
181
  workOrderId: string;
182
+ } | {
183
+ tagNo: string;
184
+ instCode: string;
185
+ internalTagType: import("..").PdmsInternalTagType;
186
+ plantNo: string;
187
+ plantCode: string;
168
188
  } | {
169
189
  instCode: string;
170
190
  tagNo: string;
191
+ internalTagType?: never | undefined;
171
192
  } | {
172
193
  equipmentId: string;
173
194
  } | {
@@ -203,9 +224,16 @@ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Om
203
224
  items: Map<GlobalSelectionTypes.ItemIdString, {
204
225
  id: {
205
226
  workOrderId: string;
227
+ } | {
228
+ tagNo: string;
229
+ instCode: string;
230
+ internalTagType: import("..").PdmsInternalTagType;
231
+ plantNo: string;
232
+ plantCode: string;
206
233
  } | {
207
234
  instCode: string;
208
235
  tagNo: string;
236
+ internalTagType?: never | undefined;
209
237
  } | {
210
238
  equipmentId: string;
211
239
  } | {
@@ -1,5 +1,6 @@
1
1
  import type { EquipmentData, MeasuringPointData, ResultArray, TagSummaryDto, WorkOrderData } from '@equinor/echo-search';
2
2
  import { Brand } from '@equinor/echo-utils';
3
+ import type { PdmsTagId } from '../pdmsTag/pdmsTag.types';
3
4
  export declare enum GlobalSelectionItemType {
4
5
  WorkOrder = "WorkOrder",
5
6
  Tag = "Tag",
@@ -106,36 +107,46 @@ export type GlobalSelectionAddItemResult<DataType> = {
106
107
  };
107
108
  export type PersistedGlobalSelectionMetaData = Pick<GlobalSelectionMetaData, 'color' | 'isHiddenByUser'>;
108
109
  export declare namespace GlobalSelectionTypes {
109
- type WorkOrderId = Pick<GlobalSelectionWorkOrderDto, 'workOrderId'>;
110
- type EquipmentId = Pick<GlobalSelectionEquipmentDto, 'equipmentId'>;
111
- type TagId = Pick<GlobalSelectionTagDto, 'tagNo' | 'instCode'>;
112
- type MeasuringPointId = Pick<GlobalSelectionMeasuringPointDto, 'measuringPointId'>;
113
- type ItemId = WorkOrderId | EquipmentId | TagId | MeasuringPointId;
114
- type ItemIdString = Brand<string, 'ItemIdString'>;
115
- type TagDto = GlobalSelectionTagDto;
116
- type WorkOrderDto = GlobalSelectionWorkOrderDto;
117
- type EquipmentDto = GlobalSelectionEquipmentDto;
118
- type MeasuringPointDto = GlobalSelectionMeasuringPointDto;
119
- type EquipmentItem = GlobalSelectionGenericItem<GlobalSelectionItemType.Equipment>;
120
- type WorkOrderItem = GlobalSelectionGenericItem<GlobalSelectionItemType.WorkOrder>;
121
- type TagItem = GlobalSelectionGenericItem<GlobalSelectionItemType.Tag>;
122
- type MeasuringPointItem = GlobalSelectionGenericItem<GlobalSelectionItemType.MeasuringPoint>;
123
- type List<T extends GlobalSelectionItemType> = GlobalSelectionList<T>;
124
- type SelectionItem = EquipmentItem | WorkOrderItem | TagItem | MeasuringPointItem;
125
- type SelectionItemList = EquipmentItem[] | WorkOrderItem[] | TagItem[] | MeasuringPointItem[];
126
- type GenericItem<T extends GlobalSelectionItemType> = GlobalSelectionGenericItem<T>;
127
- type Store = GlobalSelectionStore;
128
- type ItemErrorStatusUpdate = ItemErrorStatusUpdates;
129
- type WorkOrderList = WorkOrderGlobalSelectionList;
130
- type TagList = TagGlobalSelectionList;
131
- type EquipmentList = EquipmentGlobalSelectionList;
132
- type MeasuringPointList = MeasuringPointGlobalSelectionList;
133
- type ListUnion = GlobalSelectionListUnion;
134
- type ItemTypeToDataMap = GlobalSelectionItemTypeToDataMap;
135
- type AddTagResult = GlobalSelectionAddItemResult<ResultArray<TagSummaryDto>[]>;
136
- type AddEquipmentsResult = GlobalSelectionAddItemResult<ResultArray<EquipmentData>[]>;
137
- type AddMeasuringPointResult = GlobalSelectionAddItemResult<ResultArray<MeasuringPointData>[]>;
138
- type ActionResult = GlobalSelectionActionResult;
139
- type ItemSystemStatus = SelectionItemSystemStatus;
110
+ export type WorkOrderId = Pick<GlobalSelectionWorkOrderDto, 'workOrderId'>;
111
+ export type EquipmentId = Pick<GlobalSelectionEquipmentDto, 'equipmentId'>;
112
+ /**
113
+ * TagId is the identifier for tags in the global selection.
114
+ * - For STID tags: { tagNo, instCode }
115
+ * - For internal tags (PDMS): { tagNo, instCode, internalTagType, plantNo, plantCode }
116
+ */
117
+ type BaseTagId = Pick<GlobalSelectionTagDto, 'tagNo' | 'instCode'>;
118
+ type StidTagId = BaseTagId & {
119
+ readonly internalTagType?: never;
120
+ };
121
+ export type TagId = StidTagId | PdmsTagId;
122
+ export type MeasuringPointId = Pick<GlobalSelectionMeasuringPointDto, 'measuringPointId'>;
123
+ export type ItemId = WorkOrderId | EquipmentId | TagId | MeasuringPointId;
124
+ export type ItemIdString = Brand<string, 'ItemIdString'>;
125
+ export type TagDto = GlobalSelectionTagDto;
126
+ export type WorkOrderDto = GlobalSelectionWorkOrderDto;
127
+ export type EquipmentDto = GlobalSelectionEquipmentDto;
128
+ export type MeasuringPointDto = GlobalSelectionMeasuringPointDto;
129
+ export type EquipmentItem = GlobalSelectionGenericItem<GlobalSelectionItemType.Equipment>;
130
+ export type WorkOrderItem = GlobalSelectionGenericItem<GlobalSelectionItemType.WorkOrder>;
131
+ export type TagItem = GlobalSelectionGenericItem<GlobalSelectionItemType.Tag>;
132
+ export type MeasuringPointItem = GlobalSelectionGenericItem<GlobalSelectionItemType.MeasuringPoint>;
133
+ export type List<T extends GlobalSelectionItemType> = GlobalSelectionList<T>;
134
+ export type SelectionItem = EquipmentItem | WorkOrderItem | TagItem | MeasuringPointItem;
135
+ export type SelectionItemList = EquipmentItem[] | WorkOrderItem[] | TagItem[] | MeasuringPointItem[];
136
+ export type GenericItem<T extends GlobalSelectionItemType> = GlobalSelectionGenericItem<T>;
137
+ export type Store = GlobalSelectionStore;
138
+ export type ItemErrorStatusUpdate = ItemErrorStatusUpdates;
139
+ export type WorkOrderList = WorkOrderGlobalSelectionList;
140
+ export type TagList = TagGlobalSelectionList;
141
+ export type EquipmentList = EquipmentGlobalSelectionList;
142
+ export type MeasuringPointList = MeasuringPointGlobalSelectionList;
143
+ export type ListUnion = GlobalSelectionListUnion;
144
+ export type ItemTypeToDataMap = GlobalSelectionItemTypeToDataMap;
145
+ export type AddTagResult = GlobalSelectionAddItemResult<ResultArray<TagSummaryDto>[]>;
146
+ export type AddEquipmentsResult = GlobalSelectionAddItemResult<ResultArray<EquipmentData>[]>;
147
+ export type AddMeasuringPointResult = GlobalSelectionAddItemResult<ResultArray<MeasuringPointData>[]>;
148
+ export type ActionResult = GlobalSelectionActionResult;
149
+ export type ItemSystemStatus = SelectionItemSystemStatus;
150
+ export {};
140
151
  }
141
152
  export {};
@@ -1,4 +1,5 @@
1
1
  export * from './globalSelectionStore/globalSelectionStore.types';
2
+ export * from './pdmsTag/pdmsTag.types';
2
3
  export * from './selectionMenu/selectionTreeStore/selectionTree.api.types';
3
4
  export * from './selectionMenu/selectionTreeStore/selectionTree.store.types';
4
5
  export { useAreAllItemsVisible } from './hooks/useAreAllItemsVisible';
@@ -26,3 +27,4 @@ export { invalidateHistorySelectionQuery } from './selectionMenu/invalidateHisto
26
27
  export { saveEquipmentAsNewSelectionToApi } from './selectionMenu/selectionTreeStore/api/selectionTree.equipment';
27
28
  export { SelectionColorConflictDialog } from './selectionMenu/selectionTreeStore/colorConflictHandling/SelectionColorConflictDialog';
28
29
  export { simulatedSelectionTreeApiError } from './selectionMenu/selectionTreeStore/persist/devOnlySimulateOffline';
30
+ export { createPdmsTagSummaryDto, isPdmsTagId, isPdmsTagSummaryDto } from './pdmsTag/pdmsTag.utils';
@@ -0,0 +1,13 @@
1
+ import type { TagSummaryDto } from '@equinor/echo-search';
2
+ export declare const PDMS_INTERNAL_TAG_TYPES: readonly ["PdmsTag", "PdmsPart"];
3
+ export type PdmsInternalTagType = (typeof PDMS_INTERNAL_TAG_TYPES)[number];
4
+ export declare const isPdmsInternalTagType: (value: string) => value is PdmsInternalTagType;
5
+ export interface PdmsTagId {
6
+ readonly tagNo: string;
7
+ readonly instCode: string;
8
+ readonly internalTagType: PdmsInternalTagType;
9
+ readonly plantNo: string;
10
+ readonly plantCode: string;
11
+ }
12
+ export interface PdmsTagSummaryDto extends TagSummaryDto, PdmsTagId {
13
+ }
@@ -0,0 +1,6 @@
1
+ import { type TagSummaryDto } from '@equinor/echo-search';
2
+ import type { GlobalSelectionTypes } from '../globalSelectionStore/globalSelectionStore.types';
3
+ import type { PdmsTagId, PdmsTagSummaryDto } from './pdmsTag.types';
4
+ export declare function isPdmsTagId(itemId: GlobalSelectionTypes.ItemId): itemId is PdmsTagId;
5
+ export declare function isPdmsTagSummaryDto(dto: TagSummaryDto): dto is PdmsTagSummaryDto;
6
+ export declare function createPdmsTagSummaryDto(pdmsTagId: PdmsTagId): PdmsTagSummaryDto;
@@ -88,9 +88,16 @@ export declare const useSelectionTreeStore: import("zustand").UseBoundStore<Omit
88
88
  items: Map<GlobalSelectionTypes.ItemIdString, {
89
89
  id: {
90
90
  workOrderId: string;
91
+ } | {
92
+ tagNo: string;
93
+ instCode: string;
94
+ internalTagType: import("../..").PdmsInternalTagType;
95
+ plantNo: string;
96
+ plantCode: string;
91
97
  } | {
92
98
  instCode: string;
93
99
  tagNo: string;
100
+ internalTagType?: never | undefined;
94
101
  } | {
95
102
  equipmentId: string;
96
103
  } | {
@@ -86,6 +86,7 @@ export declare namespace SelectionTreeTypes {
86
86
  type Category = SelectionCategory;
87
87
  type Group = SelectionGroup;
88
88
  type ActionResult = SelectionTreeActionResult;
89
+ type Item = SelectionTreeItem<GlobalSelectionItemType>;
89
90
  }
90
91
  export type AddTagsReturnType = Promise<AddItemsResponse<GlobalSelectionItemType.Tag>>;
91
92
  export type AddWorkOrdersReturnType = Promise<AddItemsResponse<GlobalSelectionItemType.WorkOrder>>;
@@ -0,0 +1,12 @@
1
+ export type LegendFeedbackVariant = 'error' | 'info' | 'warning';
2
+ interface LegendFeedbackMessageProps {
3
+ className?: string;
4
+ variant?: LegendFeedbackVariant;
5
+ message: string;
6
+ }
7
+ /**
8
+ * Component to display a feedback message in the legend accordion.
9
+ * Will default to 'info' variant if none is provided.
10
+ */
11
+ export declare const LegendFeedbackMessage: (props: LegendFeedbackMessageProps) => import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -10,5 +10,5 @@ interface PositionalItemProps {
10
10
  /**
11
11
  * An item that can be positioned anywhere in the absolute container.
12
12
  */
13
- export declare const PositionalItem: React.FC<PositionalItemProps>;
13
+ export declare const PositionalItem: React.MemoExoticComponent<(props: PositionalItemProps) => import("react/jsx-runtime").JSX.Element>;
14
14
  export {};
@@ -12,13 +12,5 @@ interface PositionalLegendMarkersProps {
12
12
  currentPageScale: number;
13
13
  pdfZoom: number;
14
14
  }
15
- /**
16
- * Component that renders positional legend markers on a PDF or on other view.
17
- *
18
- * @param {ReadonlyArray<LegendPositionItem>} items - Array of position items.
19
- * @param {number} pdfRotation - The rotation angle of the PDF.
20
- * @param {number} currentPageScale - The current scale of the PDF page.
21
- * @param {number} pdfZoom - The zoom level of the PDF.
22
- */
23
- export declare const PositionalLegendMarkers: React.FC<PositionalLegendMarkersProps>;
15
+ export declare const PositionalLegendMarkers: React.NamedExoticComponent<PositionalLegendMarkersProps>;
24
16
  export {};
@@ -1,12 +1,12 @@
1
1
  import { ItemMarkerSize } from '@equinor/echo-components';
2
2
  import React from 'react';
3
- import { GroupedMarker } from '../utils/splitMarkerByBadgeSelectionGroup.types';
3
+ import { ColorGroupedMarker } from '../utils/splitMarkerByColor.types';
4
4
  interface LegendColoredMarkerIconProps {
5
5
  hasPointer: boolean;
6
6
  isActive: boolean;
7
7
  onClick: () => void;
8
8
  hiddenBadges: string[];
9
- marker: GroupedMarker;
9
+ marker: ColorGroupedMarker;
10
10
  }
11
11
  /**
12
12
  * Renders a colored marker icon with optional pointer and badges.
@@ -10,8 +10,5 @@ interface LegendPositionItem {
10
10
  interface LegendMarkersRendererProps {
11
11
  positionItems: ReadonlyArray<LegendPositionItem>;
12
12
  }
13
- /**
14
- * Renders all the position items, with markers for each legends. And has 1 popover which is the last active item clicked.
15
- */
16
- export declare const LegendMarkersRenderer: React.FC<LegendMarkersRendererProps>;
13
+ export declare const LegendMarkersRenderer: React.NamedExoticComponent<LegendMarkersRendererProps>;
17
14
  export {};
@@ -1,11 +1,11 @@
1
1
  import { LegendDataId, LegendId } from '../../../types/legendType';
2
2
  import { MarkerId } from '../utils/markerId.utils';
3
- import { GroupedMarker } from '../utils/splitMarkerByBadgeSelectionGroup.types';
3
+ import { ColorGroupedMarker } from '../utils/splitMarkerByColor.types';
4
4
  interface MarkerWithPopoverProps {
5
5
  legendId: LegendId;
6
6
  hasPointer: boolean;
7
7
  hiddenBadges: string[];
8
- marker: GroupedMarker;
8
+ marker: ColorGroupedMarker;
9
9
  itemId: LegendDataId;
10
10
  markerId: MarkerId;
11
11
  }
@@ -1,9 +1,8 @@
1
- import { LegendDataId, LegendId } from '../../../types/legendType';
2
- interface MultipleMarkersBySingleLegendComponentProps {
1
+ import { LegendDataId, LegendId } from '../../../../../types/legendType';
2
+ export interface MultipleMarkersBySingleLegendComponentProps {
3
3
  legendId: LegendId;
4
4
  itemId: LegendDataId;
5
5
  hasPointer: boolean;
6
6
  positionId: string;
7
7
  }
8
8
  export declare const MultipleMarkersBySingleLegend: import("react").MemoExoticComponent<(props: MultipleMarkersBySingleLegendComponentProps) => import("react/jsx-runtime").JSX.Element[] | null>;
9
- export {};
@@ -0,0 +1,4 @@
1
+ import { MultipleMarkersBySingleLegendComponentProps } from './MultipleMarkersBySingleLegend';
2
+ type MultipleMarkersBySingleLegendContainerProps = MultipleMarkersBySingleLegendComponentProps;
3
+ export declare const MultipleMarkersBySingleLegendContainer: import("react").MemoExoticComponent<(props: MultipleMarkersBySingleLegendContainerProps) => import("react/jsx-runtime").JSX.Element | null>;
4
+ export {};
@@ -1,6 +1,6 @@
1
1
  import { LegendDataId, LegendId } from '../../../../types/legendType';
2
2
  import { MarkerId } from '../../utils/markerId.utils';
3
- import { GroupedMarker } from '../../utils/splitMarkerByBadgeSelectionGroup.types';
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 { GroupedMarker } from '../../utils/splitMarkerByBadgeSelectionGroup.type
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: GroupedMarker): {
14
+ export declare function useMarkerPopover(markerId: MarkerId, legendId: LegendId, itemId: LegendDataId, marker: ColorGroupedMarker): {
15
15
  isPopoverActive: boolean;
16
16
  elements: readonly import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>[];
17
17
  handleOpen: () => Promise<void>;
@@ -0,0 +1,34 @@
1
+ import { ItemToSelectionGroupsMap } from '../../../stores/itemToSelectionGroupsMapStore/itemToSelectionGroupsMapStore.types';
2
+ import { Marker } from '../../../types/legendMarkerBadge.type';
3
+ import { ColorGroupedMarker } from './splitMarkerByColor.types';
4
+ /**
5
+ * Splits a marker into variants based on selection color only (not selection group).
6
+ *
7
+ * The selection color is the color assigned to items in the global selection store
8
+ * (item.metaData.color). This is used for the marker highlight color on the PDF.
9
+
10
+ * Example: Marker with 3 equipment badges:
11
+ * - Badge A (group1, red selection color)
12
+ * - Badge B (group2, red selection color)
13
+ * - Badge C (group3, blue selection color)
14
+ *
15
+ * Returns 2 marker variants:
16
+ * - Red variant: [BadgeA(from group1), BadgeB(from group2)]
17
+ * - Blue variant: [BadgeC(from group3)]
18
+ *
19
+ * When group2 is hidden, red variant filters to [BadgeA] only.
20
+ *
21
+ * @param itemToGroupsMap - Pre-built map of itemIdString -> SelectionGroup[] for lookup
22
+ * @param marker - The marker containing badges to be split by selection color
23
+ * @returns Array of selection-color-grouped marker variants
24
+ */
25
+ export declare const splitMarkerByColor: (itemToGroupsMap: ItemToSelectionGroupsMap, marker?: Marker) => ColorGroupedMarker[];
26
+ /**
27
+ * Filters a color-grouped marker's badges by hidden groups.
28
+ * Returns undefined if all badges are hidden (marker should not render).
29
+ *
30
+ * @param marker - The color-grouped marker to filter
31
+ * @param hiddenGroupKeys - Array of hidden group key strings
32
+ * @returns Marker with filtered badges, or undefined if all hidden
33
+ */
34
+ export declare const filterBadgesByHiddenGroups: (marker: ColorGroupedMarker, hiddenGroupKeys: string[]) => ColorGroupedMarker | undefined;
@@ -0,0 +1,37 @@
1
+ import { Guid } from '@equinor/echo-utils';
2
+ import { GlobalSelectionItemType } from '../../../../globalSelection';
3
+ import { Badge, Marker } from '../../../types/legendMarkerBadge.type';
4
+ export interface GroupKey {
5
+ /** Helper to get the full string representation of the group key based on groupId, color, and optional itemType */
6
+ toString: () => string;
7
+ groupId: Guid;
8
+ color: string;
9
+ /** Optional item type for local selection which will be split by type */
10
+ itemType?: GlobalSelectionItemType;
11
+ }
12
+ /**
13
+ * Badge with its associated group key for visibility filtering.
14
+ */
15
+ export interface BadgeWithGroup {
16
+ badge: Badge;
17
+ /** The group key this badge belongs to, for visibility filtering */
18
+ groupKey: GroupKey;
19
+ }
20
+ /**
21
+ * A group of badges that share the same selection color.
22
+ */
23
+ export interface SelectionColorGroup {
24
+ selectionColor: string;
25
+ badgesWithGroups: BadgeWithGroup[];
26
+ }
27
+ /**
28
+ * A color-grouped marker variant.
29
+ * Contains badges of the same color, each tracking its own group for filtering.
30
+ */
31
+ export interface ColorGroupedMarker extends Marker {
32
+ /** Color-based key for this marker variant.
33
+ * We could use Marker.getHighlightColor() here, but using a key allows for future flexibility only related to PDF rendering.*/
34
+ getColorKey: () => string;
35
+ /** Badges with their group info for filtering */
36
+ badgesWithGroups: BadgeWithGroup[];
37
+ }
@@ -0,0 +1,12 @@
1
+ import { Marker } from '../../../types/legendMarkerBadge.type';
2
+ import { LegendDataId, LegendId } from '../../../types/legendType';
3
+ /**
4
+ * Returns all markers for a specific legend based on the provided item IDs.
5
+ * The markers are only returned if the legend is enabled.
6
+ */
7
+ export declare const useMarkersFromEnabledLegend: (legendId: LegendId, itemIds: LegendDataId[]) => readonly Marker[];
8
+ /**
9
+ * Returns all enabled legend's marker itemIDs, including those from badges on markers.
10
+ * Only returns item IDs that actually have markers from enabled legends.
11
+ */
12
+ export declare const useAllMarkerItemIdsForEnabledLegends: () => LegendDataId[];
@@ -1,5 +1,8 @@
1
1
  import { SelectionGroupDisplay } from './useSelectionGroupsForLegendRenderer.utils';
2
2
  /**
3
- * Hook to get selection groups formatted for the legend renderer.
3
+ * Builds selection display groups directly from selection groups and visible item IDs
4
+ * on the current PDF, NOT from filtered grouped markers. This ensures legend chips
5
+ * are always shown even when all markers in a group are hidden, allowing users
6
+ * to unhide them.
4
7
  */
5
8
  export declare const useSelectionGroupsForLegendRenderer: () => SelectionGroupDisplay[];
@@ -1,6 +1,6 @@
1
1
  import { Guid } from '@equinor/echo-utils';
2
2
  import { GlobalSelectionItemType, SelectionGroup } from '../../../../globalSelection';
3
- import { GroupedMarker } from '../../pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.types';
3
+ import { LegendDataId } from '../../../types/legendType';
4
4
  export interface SelectionGroupDisplay {
5
5
  readonly label: string;
6
6
  readonly highlightColors: string[];
@@ -10,8 +10,12 @@ export interface SelectionGroupDisplay {
10
10
  type GroupMapKey = string;
11
11
  type GroupMap = Record<GroupMapKey, SelectionGroupDisplay>;
12
12
  /**
13
- * Builds a map of selection groups with their colors from grouped markers.
14
- * Groups markers by selection group, collecting all unique colors for each group.
13
+ * Builds a map of selection groups directly from selection groups and visible item IDs.
14
+ * This function does NOT depend on filtered grouped markers, so it shows all groups
15
+ * even when their markers are hidden.
16
+ *
17
+ * @param selectionGroups - All selection groups
18
+ * @param visibleItemIds - Item IDs visible on the current PDF (from legend visible data)
15
19
  */
16
- export declare function buildSelectionGroupMap(allGroupedMarkers: GroupedMarker[] | undefined, selectionGroups: SelectionGroup[]): GroupMap;
20
+ export declare function buildSelectionGroupMapFromVisibleItems(selectionGroups: SelectionGroup[], visibleItemIds: LegendDataId[]): GroupMap;
17
21
  export {};
@@ -1,6 +1,6 @@
1
1
  import { Guid } from '@equinor/echo-utils';
2
- import { GlobalSelectionItemType, GlobalSelectionTypes, SelectionGroup } from '../../../globalSelection';
3
- import { GroupedMarker, GroupKey } from '../pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.types';
2
+ import { GlobalSelectionItemType } from '../../../globalSelection';
3
+ import { ColorGroupedMarker, GroupKey } from '../pdfMarkers/utils/splitMarkerByColor.types';
4
4
  /**
5
5
  * TODO: Remove this flag when Selection Legend is stable and ready for production
6
6
  * Flag to enable/disable Selection Legend feature
@@ -10,10 +10,6 @@ export declare const isSelectionLegendEnabled: () => boolean;
10
10
  * Key used for badges that don't belong to any selection group
11
11
  */
12
12
  export declare const NOT_IN_SELECTION_GROUP_KEY: GroupKey;
13
- /**
14
- * Extracts all item IDs from selection group categories
15
- */
16
- export declare const extractSelectionGroupItemIds: (selectionGroup: SelectionGroup) => GlobalSelectionTypes.ItemId[];
17
13
  /**
18
14
  * Determines if groups should be split by item type.
19
15
  * Only true for the default local selection group (Local Selection).
@@ -37,9 +33,10 @@ export declare const shouldSplitGroupsByItemType: (groupId: Guid) => boolean;
37
33
  export declare const createSelectionGroupKey: (groupId: Guid, color: string, itemType?: GlobalSelectionItemType) => GroupKey;
38
34
  /**
39
35
  * Checks if a marker belongs to the "Not in Selection" group.
36
+ * With color-based grouping, this checks if all badges are outside any selection.
40
37
  *
41
38
  * @param marker - The marker to check.
42
39
  *
43
40
  * @returns True if the marker is in the "Not in Selection" group, false otherwise.
44
41
  */
45
- export declare const isMarkerOutsideSelection: (marker: GroupedMarker) => boolean;
42
+ export declare const isMarkerOutsideSelection: (marker: ColorGroupedMarker) => boolean;
@@ -1,16 +1,23 @@
1
- import { GroupedMarker } from '../components/pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.types';
1
+ import { ColorGroupedMarker } from '../components/pdfMarkers/utils/splitMarkerByColor.types';
2
2
  import { Marker } from '../types/legendMarkerBadge.type';
3
3
  import { LegendId } from '../types/legendType';
4
4
  /**
5
- * Will process markers and group them based on groups in Selection.
6
- * This also adds additional logic for counting badges where this is needed.
7
- * @param legendId
8
- * @param markers
9
- * @param hiddenMarkers If included hidden markers will be filtered out
10
- * @returns
5
+ * Processes a marker and groups them by color, filtering badges by hidden groups.
6
+ *
7
+ * This hook splits marker into variants based on badge color (not selection group),
8
+ * then filters individual badges based on whether their group is hidden.
9
+ *
10
+ * Rules:
11
+ * - marker are grouped by **color only**
12
+ * - Badges track their selection group for visibility filtering
13
+ * - When a group is hidden, badges from that group are filtered out
14
+ * - Marker variant hides only when ALL its badges are hidden
15
+ *
16
+ * @param args.legendId - The legend ID for UI state subscriptions
17
+ * @param args.marker - The marker to process (typically a single marker)
18
+ * @returns Array of color-grouped marker variants, or undefined if selection legend is disabled
11
19
  */
12
20
  export declare const useGroupedMarkers: (args: {
13
21
  legendId: LegendId;
14
- markers: Marker[];
15
- hiddenMarkers?: string[];
16
- }) => GroupedMarker[] | undefined;
22
+ marker?: Marker;
23
+ }) => ColorGroupedMarker[] | undefined;
@@ -0,0 +1,13 @@
1
+ import { SelectionGroup } from '../../globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types';
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
+ /**
8
+ * Gets all potential group keys a marker could generate.
9
+ * Used for per-marker hidden state subscriptions.
10
+ * @param marker - The marker to get group keys for
11
+ * @param itemToGroupsMap - Pre-built map of itemIdString -> selectionGroups - handled in store
12
+ */
13
+ export declare const getPotentialGroupKeysForMarker: (marker: Marker, itemToGroupsMap: Map<string, SelectionGroup[]>) => string[];