@equinor/echo-framework 6.0.0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +2 -2
- package/package.json +8 -8
- package/src/index.d.ts +1 -1
- package/src/lib/components/panel/panelNavigation.helper.d.ts +1 -2
- package/src/lib/feature/globalSelection/coordinate/coordinate.clean.d.ts +6 -0
- package/src/lib/feature/globalSelection/coordinate/coordinate.logic.d.ts +3 -0
- package/src/lib/feature/globalSelection/coordinate/coordinate.types.d.ts +19 -0
- package/src/lib/feature/globalSelection/globalSelection.api.d.ts +4 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/setRelatedTo.action.d.ts +7 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.d.ts +242 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.mutableSelectionItem.d.ts +2 -1
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.testHelpers.d.ts +5 -0
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +25 -6
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.utils.d.ts +3 -1
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStoreHelpers.d.ts +3 -1
- package/src/lib/feature/globalSelection/globalSelectionStore/itemIdTypeGuards.d.ts +3 -1
- package/src/lib/feature/globalSelection/globalSelectionStore/nullItems/createNullCoordinate.d.ts +3 -0
- package/src/lib/feature/globalSelection/index.d.ts +1 -0
- package/src/lib/feature/globalSelection/selectionMenu/hooks/useFetchSelectionHistory.d.ts +1 -1
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/colorConflictHandling/SelectionColorConflictDialog.d.ts +1 -1
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.d.ts +18 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +3 -6
- package/src/lib/feature/globalSelection/strategies/coordinateSelection.strategy.d.ts +3 -0
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendColoredMarkerIcon.d.ts +6 -9
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/MarkerWithPopover.d.ts +6 -7
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/components/MultipleMarkersBySingleLegend/multipleMarkersBySingleLegend.logic.d.ts +5 -7
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/components/MultipleMarkersBySingleLegend/useStalePopoverMarkers.d.ts +3 -3
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/hooks/useMarkerPopover.d.ts +2 -2
- package/src/lib/feature/legend/components/pdfMarkers/utils/markerId.utils.d.ts +11 -3
- package/src/lib/feature/legend/components/popover/LegendPopoverContent.logic.d.ts +14 -21
- package/src/lib/feature/legend/components/selectionLegend/hooks/useAllMarkerItemIdsForEnabledLegends.d.ts +4 -4
- package/src/lib/feature/legend/components/selectionLegend/selectionLegend.utils.d.ts +9 -9
- package/src/lib/feature/legend/hooks/useLegendBadgeChips.d.ts +7 -0
- package/src/lib/feature/legend/hooks/useLegendHiddenItemsSubscription.d.ts +4 -14
- package/src/lib/feature/legend/hooks/useLegendMarkerChips.d.ts +7 -0
- package/src/lib/feature/legend/hooks/useLegendMarkers/useLegendMarkers.d.ts +17 -0
- package/src/lib/feature/legend/hooks/useLegendMarkers/useLegendMarkers.logic.d.ts +65 -0
- package/src/lib/feature/legend/hooks/useLegendMarkers/useLegendMarkers.utils.d.ts +14 -0
- package/src/lib/feature/legend/hooks/useWorkOrdersByTagsQuery.d.ts +1 -1
- package/src/lib/feature/legend/index.d.ts +8 -6
- package/src/lib/feature/legend/legendFacade.d.ts +9 -15
- package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/api/iocAnnotationLegend.api.d.ts +3 -0
- package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/hooks/useIocAnnotationMarkers.d.ts +3 -0
- package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/hooks/useIocAnnotationMarkers.utils.d.ts +21 -0
- package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/iocAnnotationStrategy.d.ts +1 -0
- package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/iocAnnotationStrategy.types.d.ts +25 -0
- package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/optionConfigs/iocAnnotationBadgeLegendOptionConfig.d.ts +3 -0
- package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/optionConfigs/iocAnnotationMarkerLegendOptionConfig.d.ts +3 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/hooks/useNotificationDetailsByIds.d.ts +1 -1
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/hooks/useNotificationRawMarkers.d.ts +10 -0
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/logic/notificationLegend.logic.d.ts +5 -5
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/utils/getNotificationTitlesByPropertyName.d.ts +1 -1
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/utils/notificationLegend.utils.d.ts +2 -4
- package/src/lib/feature/legend/legendStrategies/workOrderStrategy/useCreateWorkOrderMarkers.d.ts +7 -4
- package/src/lib/feature/legend/logic/displayKeys.logic.d.ts +11 -0
- package/src/lib/feature/legend/logic/legendChips.logic.d.ts +8 -0
- package/src/lib/feature/legend/logic/propertyAccessor.utils.d.ts +5 -16
- package/src/lib/feature/legend/stores/legendUIStore/legendUIStore.d.ts +2 -2
- package/src/lib/feature/legend/stores/legendUIStore/legendUIStore.types.d.ts +25 -12
- package/src/lib/feature/legend/types/legendMarkerBadge.type.d.ts +74 -11
- package/src/lib/feature/legend/types/legendStrategy.type.d.ts +10 -5
- package/src/lib/feature/legend/types/legendType.d.ts +17 -6
- package/src/lib/feature/measuringPoint/components/lastRecordedMeasurement/lastRecordedMeasurement.logic.d.ts +1 -6
- package/src/lib/feature/measuringPoint/components/lastRecordedMeasurement/lastRecordedMeasurement.types.d.ts +5 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/measuringPointImageList.logic.d.ts +6 -0
- package/src/lib/feature/measuringPoint/components/measuringPointDetails/type/attachment.d.ts +4 -4
- package/src/lib/feature/measuringPoint/components/measuringPoints.utils.d.ts +2 -0
- package/src/lib/feature/measuringPoint/hooks/useDocumentRelationships.d.ts +1 -1
- package/src/lib/feature/measuringPoint/types/documentRelationships.d.ts +7 -7
- package/src/lib/feature/measuringPoint/types/measuringPoint.d.ts +14 -14
- package/src/lib/services/echoViewService/echoView.type.d.ts +0 -1
- package/src/lib/types/hookLibrary.d.ts +34 -22
- package/src/lib/feature/legend/components/basicLegendRenderer.logic.d.ts +0 -5
- package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByColor.d.ts +0 -34
- package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByColor.types.d.ts +0 -37
- package/src/lib/feature/legend/hooks/useGroupedMarkers.d.ts +0 -23
- package/src/lib/feature/legend/hooks/useGroupedMarkers.utils.d.ts +0 -9
- package/src/lib/feature/legend/hooks/useLegendMarker/useLegendMarker.d.ts +0 -19
- package/src/lib/feature/legend/hooks/useLegendMarker/useLegendMarker.utils.d.ts +0 -21
- package/src/lib/feature/legend/hooks/useLegendUniqueBadges.d.ts +0 -7
- package/src/lib/feature/legend/hooks/useLegendUniqueMarkers.d.ts +0 -7
- package/src/lib/feature/legend/hooks/useUniqueSelectionOnlyBadgeIdStrings.d.ts +0 -8
- package/src/lib/feature/legend/legendStrategies/notificationStrategy/hooks/useNotificationMarkers.d.ts +0 -10
- package/src/lib/feature/legend/logic/hiddenLegendChips.logic.d.ts +0 -6
package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.d.ts
CHANGED
|
@@ -84,6 +84,15 @@ export declare const useSelectionTreeStore: import("zustand").UseBoundStore<Omit
|
|
|
84
84
|
label: string;
|
|
85
85
|
items: Map<import("../..").GlobalSelectionTypes.ItemIdString, {
|
|
86
86
|
id: {
|
|
87
|
+
x: number;
|
|
88
|
+
y: number;
|
|
89
|
+
z: number;
|
|
90
|
+
name: string;
|
|
91
|
+
description: string | undefined;
|
|
92
|
+
instCode: string;
|
|
93
|
+
plantCode: string;
|
|
94
|
+
plantNo: string;
|
|
95
|
+
} | {
|
|
87
96
|
workOrderId: string;
|
|
88
97
|
} | {
|
|
89
98
|
instCode: string;
|
|
@@ -102,6 +111,15 @@ export declare const useSelectionTreeStore: import("zustand").UseBoundStore<Omit
|
|
|
102
111
|
type: import("../..").GlobalSelectionItemType;
|
|
103
112
|
relatedTo?: {
|
|
104
113
|
id: {
|
|
114
|
+
x: number;
|
|
115
|
+
y: number;
|
|
116
|
+
z: number;
|
|
117
|
+
name: string;
|
|
118
|
+
description: string | undefined;
|
|
119
|
+
instCode: string;
|
|
120
|
+
plantCode: string;
|
|
121
|
+
plantNo: string;
|
|
122
|
+
} | {
|
|
105
123
|
workOrderId: string;
|
|
106
124
|
} | {
|
|
107
125
|
instCode: string;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import { Guid } from '@equinor/echo-utils';
|
|
2
|
-
import { GlobalSelectionItemType, GlobalSelectionTypes,
|
|
2
|
+
import { GlobalSelectionItemType, GlobalSelectionTypes, RelatedToItem, SelectionItemTypeToItemIdMap } from '../../globalSelectionStore/globalSelectionStore.types';
|
|
3
3
|
import { AddItemArgs, AddItemsResponse, SelectionTreeActionResult } from './actions/selectionTree.action.types';
|
|
4
4
|
export declare enum GlobalSelectionCategoryId {
|
|
5
5
|
Tags = "DEFAULT_TAG_LIST_ID",
|
|
6
6
|
WorkOrders = "DEFAULT_WORK_ORDER_LIST_ID",
|
|
7
7
|
Equipments = "DEFAULT_EQUIPMENT_LIST_ID",
|
|
8
|
-
MeasuringPoints = "DEFAULT_MEASURING_POINT_LIST_ID"
|
|
8
|
+
MeasuringPoints = "DEFAULT_MEASURING_POINT_LIST_ID",
|
|
9
|
+
Coordinates = "DEFAULT_COORDINATE_LIST_ID"
|
|
9
10
|
}
|
|
10
11
|
export declare const globalSelectionDefaultGroupId: Guid;
|
|
11
|
-
export interface RelatedToItem {
|
|
12
|
-
readonly id: RelatedToItemTypeToIdMap[RelatedToItemType];
|
|
13
|
-
readonly type: RelatedToItemType;
|
|
14
|
-
}
|
|
15
12
|
export type SelectionTreeItem<T extends GlobalSelectionItemType> = {
|
|
16
13
|
readonly id: SelectionItemTypeToItemIdMap[T];
|
|
17
14
|
readonly type: T;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { GlobalSelectionItemType } from '../globalSelectionStore/globalSelectionStore.types';
|
|
2
|
+
import type { SelectionItemTypeStrategy } from './selectionItemTypeStrategy.types';
|
|
3
|
+
export declare const coordinateSelectionStrategy: SelectionItemTypeStrategy<GlobalSelectionItemType.Coordinate>;
|
package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendColoredMarkerIcon.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { ItemMarkerSize } from '@equinor/echo-components';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { CombinedMarker } from '../../../types/legendMarkerBadge.type';
|
|
4
4
|
interface LegendColoredMarkerIconProps {
|
|
5
|
-
hasPointer: boolean;
|
|
6
|
-
isActive: boolean;
|
|
7
|
-
onClick: () => void;
|
|
8
|
-
|
|
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 {
|
|
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 {
|
|
3
|
-
import { ColorGroupedMarker } from '../../../utils/splitMarkerByColor.types';
|
|
2
|
+
import { CombinedMarker } from '../../../../../types/legendMarkerBadge.type';
|
|
4
3
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
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
|
|
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 {
|
|
2
|
+
import { CombinedMarker } from '../../../../../types/legendMarkerBadge.type';
|
|
3
3
|
interface UseStalePopoverMarkersProps {
|
|
4
|
-
readonly markersToRender: ReadonlyArray<
|
|
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<
|
|
18
|
+
export declare function useStalePopoverMarkers({ markersToRender, markerIds, selectionMarkerIds }: UseStalePopoverMarkersProps): ReadonlyArray<CombinedMarker> | null;
|
|
19
19
|
export {};
|
package/src/lib/feature/legend/components/pdfMarkers/subComponents/hooks/useMarkerPopover.d.ts
CHANGED
|
@@ -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:
|
|
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
|
|
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:
|
|
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):
|
|
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 {
|
|
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<
|
|
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
|
-
|
|
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 {
|
|
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
|
|
7
|
+
export declare const useRawMarkersFromEnabledLegend: (legendId: LegendId, itemIds: LegendDataId[]) => readonly RawMarkerData[];
|
|
8
8
|
/**
|
|
9
|
-
* Returns all enabled legend's marker itemIDs
|
|
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 {
|
|
3
|
+
import type { LegendSelectionGroupKey } from '../../stores/legendUIStore/legendUIStore.types';
|
|
4
|
+
import { CombinedMarker } from '../../types/legendMarkerBadge.type';
|
|
4
5
|
/**
|
|
5
|
-
* Key used for
|
|
6
|
+
* Key used for markers that don't belong to any selection group
|
|
6
7
|
*/
|
|
7
|
-
export declare const NOT_IN_SELECTION_GROUP_KEY:
|
|
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) =>
|
|
29
|
+
export declare const createSelectionGroupKey: (groupId: Guid, color: string, itemType?: GlobalSelectionItemType) => LegendSelectionGroupKey;
|
|
29
30
|
/**
|
|
30
|
-
* Checks if a marker
|
|
31
|
-
*
|
|
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:
|
|
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 {
|
|
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
|
-
* @
|
|
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
|
-
*
|
|
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:
|
|
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[]
|
|
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,
|
|
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 {
|
|
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,
|
|
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
|
-
|
|
34
|
+
hiddenItems: {
|
|
35
35
|
setHidden: (params: {
|
|
36
36
|
legendId: LegendId;
|
|
37
|
-
|
|
37
|
+
item: ToggleableLegend;
|
|
38
38
|
isHidden: boolean;
|
|
39
39
|
}) => void;
|
|
40
40
|
setHiddenBatch: (updates: Array<{
|
|
41
41
|
legendId: LegendId;
|
|
42
|
-
|
|
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:
|
|
165
|
-
tagLegendId:
|
|
166
|
-
workOrderLegendId:
|
|
167
|
-
notificationLegendId:
|
|
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,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>;
|
package/src/lib/feature/legend/legendStrategies/iocAnnotationStrategy/iocAnnotationStrategy.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { IocAnnotationData } from '@equinor/echo-search';
|
|
2
|
+
import { LegendStatus } from '../../../legacyLegend/legend';
|
|
3
|
+
import { type LegendId } from '../../types/legendType';
|
|
4
|
+
export declare const iocAnnotationLegendId: LegendId;
|
|
5
|
+
export type IocAnnotationDto = IocAnnotationData;
|
|
6
|
+
export type InstCode = string;
|
|
7
|
+
export type TagNo = string;
|
|
8
|
+
export type FunctionalLocation = string;
|
|
9
|
+
export type IocAnnotationTagKey = string;
|
|
10
|
+
export type IocAnnotationMarkerOptions = 'status';
|
|
11
|
+
export type IocAnnotationBadgeOptions = 'count';
|
|
12
|
+
export interface IocAnnotationTagLookup {
|
|
13
|
+
readonly tagNo: TagNo;
|
|
14
|
+
readonly instCode: InstCode;
|
|
15
|
+
}
|
|
16
|
+
export interface IocAnnotationFunctionalLocationLookup extends IocAnnotationTagLookup {
|
|
17
|
+
readonly functionalLocation: FunctionalLocation;
|
|
18
|
+
}
|
|
19
|
+
export type IocAnnotationState = LegendStatus.OnWatch | LegendStatus.InProgress | LegendStatus.IocAnnotationError | LegendStatus.Note | LegendStatus.Archived | LegendStatus.Unknown;
|
|
20
|
+
export interface IocAnnotationMarkerData {
|
|
21
|
+
readonly status: IocAnnotationState;
|
|
22
|
+
readonly tagNo: TagNo;
|
|
23
|
+
readonly iocAnnotations: ReadonlyArray<IocAnnotationDto>;
|
|
24
|
+
}
|
|
25
|
+
export type IocAnnotationMarkerDataByTagKey = ReadonlyMap<IocAnnotationTagKey, IocAnnotationMarkerData>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { type LegendBadgeOptionConfig } from '../../../types/legendType';
|
|
2
|
+
import type { IocAnnotationBadgeOptions } from '../iocAnnotationStrategy.types';
|
|
3
|
+
export declare const IOC_ANNOTATION_LEGEND_BADGE_OPTIONS: ReadonlyArray<LegendBadgeOptionConfig<IocAnnotationBadgeOptions>>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { LegendMarkerOptionConfig } from '../../../types/legendType';
|
|
2
|
+
import type { IocAnnotationMarkerOptions } from '../iocAnnotationStrategy.types';
|
|
3
|
+
export declare const IOC_ANNOTATION_LEGEND_MARKER_OPTIONS: ReadonlyArray<LegendMarkerOptionConfig<IocAnnotationMarkerOptions>>;
|