@equinor/echo-framework 2.3.0 → 2.4.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 +3 -3
- package/package.json +12 -8
- package/src/index.d.ts +7 -3
- package/src/lib/components/index.d.ts +2 -0
- package/src/lib/components/prepview/Prepview.d.ts +11 -1
- package/src/lib/components/prepview/context/PrepviewContext.d.ts +1 -1
- package/src/lib/components/prepview/panels/objects/EquipmentListItem.d.ts +9 -0
- package/src/lib/components/prepview/panels/objects/NotificationListItem.d.ts +9 -0
- package/src/lib/components/requestAccess/MissingAccessInfoButton.d.ts +6 -0
- package/src/lib/components/requestAccess/RequestAccessButton.d.ts +2 -1
- package/src/lib/components/requestAccess/RequestProCoSysAccess.d.ts +0 -1
- package/src/lib/components/verticalTabsSplitView/VerticalTabsSplitView.d.ts +1 -1
- package/src/lib/coreApplication/EchoUserInterfaceStore.d.ts +5 -0
- package/src/lib/feature/equipment/hooks/useEquipmentWithMeasuringPoints.d.ts +1 -1
- package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.d.ts +205 -2
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/persist/selectionTree.load.utils.d.ts +7 -0
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.d.ts +78 -2
- package/src/lib/feature/legend/components/pdfMarkers/PositionalItem.d.ts +1 -1
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendMarkersRenderer.d.ts +1 -1
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/MarkerWithPopover.d.ts +13 -0
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/MultipleMarkersByLegends.d.ts +1 -5
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/MultipleMarkersBySingleLegend.d.ts +1 -2
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/hooks/useMarkerPopover.d.ts +19 -0
- package/src/lib/feature/legend/components/pdfMarkers/utils/markerId.utils.d.ts +18 -0
- package/src/lib/feature/legend/components/pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.types.d.ts +4 -1
- package/src/lib/feature/legend/components/selectionLegend/SelectionLegendChip.d.ts +1 -1
- package/src/lib/feature/legend/components/selectionLegend/hooks/useSelectionGroupsForLegendRenderer.d.ts +5 -0
- package/src/lib/feature/legend/components/selectionLegend/hooks/useSelectionGroupsForLegendRenderer.utils.d.ts +17 -0
- package/src/lib/feature/legend/components/selectionLegend/selectionLegend.utils.d.ts +9 -6
- package/src/lib/feature/legend/legendFacade.d.ts +36 -9
- package/src/lib/feature/legend/stores/legendDataStore/legendStore.d.ts +35 -39
- package/src/lib/feature/legend/stores/legendUIStore/legendUIStore.d.ts +2 -3
- package/src/lib/feature/legend/stores/legendUIStore/legendUIStore.types.d.ts +7 -0
- package/src/lib/feature/legend/stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore.d.ts +34 -1
- package/src/lib/feature/legend/stores/legendVisibleDataStore/legendVisibleDataStore.d.ts +20 -1
- package/src/lib/feature/legend/types/legendStrategy.type.d.ts +7 -3
- package/src/lib/hooks/useOpenPrepview.d.ts +1 -1
- package/src/lib/services/dataLayerPanel/dataLayerPanel.store.d.ts +29 -2
- package/src/lib/services/leftPanelNavigation/leftPanelNavigation.store.d.ts +14 -11
- package/src/lib/services/userSetting/userSettingStore.d.ts +8 -4
- package/src/lib/utils/dataAccess/accessGuidanceSections.d.ts +27 -0
- package/src/lib/{types → utils}/dataAccess/dataAccessLinks.d.ts +6 -1
- package/src/lib/utils/dataAccess/dataAccessLinks.utils.d.ts +9 -0
- package/src/lib/components/requestAccess/RequestSapAccess.d.ts +0 -7
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/hooks/usePopoverHandler.d.ts +0 -7
- package/src/lib/feature/legend/components/pdfMarkers/subComponents/hooks/usePopoverHandler.types.d.ts +0 -14
- package/src/lib/types/dataAccess/index.d.ts +0 -1
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Guid } from '@equinor/echo-utils';
|
|
2
|
+
import { GlobalSelectionItemType } from '../../../../globalSelection';
|
|
2
3
|
import { Badge, Marker } from '../../../types/legendMarkerBadge.type';
|
|
3
4
|
export interface GroupKey {
|
|
4
|
-
/** Helper to get the full string representation of the group key based on groupId and
|
|
5
|
+
/** Helper to get the full string representation of the group key based on groupId, color, and optional itemType */
|
|
5
6
|
toString: () => string;
|
|
6
7
|
groupId: Guid;
|
|
7
8
|
color: string;
|
|
9
|
+
/** Optional item type for local selection which will be split by type */
|
|
10
|
+
itemType?: GlobalSelectionItemType;
|
|
8
11
|
}
|
|
9
12
|
export interface BadgeGroup {
|
|
10
13
|
groupKey: GroupKey;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
interface LegendItemProps {
|
|
2
2
|
label: string;
|
|
3
|
-
backgroundColor?: string;
|
|
4
3
|
onClick: (isDisabled: boolean) => void;
|
|
4
|
+
colors: string[];
|
|
5
5
|
}
|
|
6
6
|
export declare const SelectionLegendChip: import("react").MemoExoticComponent<(props: LegendItemProps) => import("react/jsx-runtime").JSX.Element>;
|
|
7
7
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Guid } from '@equinor/echo-utils';
|
|
2
|
+
import { GlobalSelectionItemType, SelectionGroup } from '../../../../globalSelection';
|
|
3
|
+
import { GroupedMarker } from '../../pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.types';
|
|
4
|
+
export interface SelectionGroupDisplay {
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly highlightColors: string[];
|
|
7
|
+
readonly selectionGroupId: Guid;
|
|
8
|
+
readonly itemType?: GlobalSelectionItemType;
|
|
9
|
+
}
|
|
10
|
+
type GroupMapKey = string;
|
|
11
|
+
type GroupMap = Record<GroupMapKey, SelectionGroupDisplay>;
|
|
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.
|
|
15
|
+
*/
|
|
16
|
+
export declare function buildSelectionGroupMap(allGroupedMarkers: GroupedMarker[] | undefined, selectionGroups: SelectionGroup[]): GroupMap;
|
|
17
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Guid } from '@equinor/echo-utils';
|
|
2
|
-
import { GlobalSelectionTypes, SelectionGroup } from '../../../globalSelection';
|
|
2
|
+
import { GlobalSelectionItemType, GlobalSelectionTypes, SelectionGroup } from '../../../globalSelection';
|
|
3
3
|
import { GroupedMarker, GroupKey } from '../pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.types';
|
|
4
4
|
/**
|
|
5
5
|
* TODO: Remove this flag when Selection Legend is stable and ready for production
|
|
@@ -15,23 +15,26 @@ export declare const NOT_IN_SELECTION_GROUP_KEY: GroupKey;
|
|
|
15
15
|
*/
|
|
16
16
|
export declare const extractSelectionGroupItemIds: (selectionGroup: SelectionGroup) => GlobalSelectionTypes.ItemId[];
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
18
|
+
* Determines if groups should be split by item type.
|
|
19
|
+
* Only true for the default local selection group (Local Selection).
|
|
19
20
|
*/
|
|
20
|
-
export declare const
|
|
21
|
+
export declare const shouldSplitGroupsByItemType: (groupId: Guid) => boolean;
|
|
21
22
|
/**
|
|
22
23
|
* Creates a standardized group key for a selection group.
|
|
23
|
-
*
|
|
24
|
+
*
|
|
25
|
+
* Used across the legend system to:
|
|
24
26
|
* - Identify marker variants split by selection groups (viewport)
|
|
25
27
|
* - Toggle visibility of selection groups (SelectionLegendRenderer)
|
|
26
28
|
* - Filter hidden selection groups (groupMarkersBySelection)
|
|
27
29
|
*
|
|
28
|
-
* Format
|
|
30
|
+
* Format: `group_${groupId}_${color}` or `group_${groupId}_${itemType}_${color}` for global selection
|
|
29
31
|
*
|
|
30
32
|
* @param groupId - The unique identifier of the selection group
|
|
31
33
|
* @param color - The highlight color for the group
|
|
34
|
+
* @param itemType - Optional item type for local selection which will be split by type
|
|
32
35
|
* @returns The standardized group key
|
|
33
36
|
*/
|
|
34
|
-
export declare const createSelectionGroupKey: (groupId: Guid, color: string) => GroupKey;
|
|
37
|
+
export declare const createSelectionGroupKey: (groupId: Guid, color: string, itemType?: GlobalSelectionItemType) => GroupKey;
|
|
35
38
|
/**
|
|
36
39
|
* Checks if a marker belongs to the "Not in Selection" group.
|
|
37
40
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getLegendStrategy, injectLegendStrategy } from './legendStrategies/legendCollections';
|
|
2
2
|
import { isLegendDataIdEqualWithTag } from './logic/isLegendDataIdEqualWithTag';
|
|
3
|
-
import { legendExistsInLegendStore, legendSnapShot, useAllLegends, useLegendById } from './stores/legendDataStore/legendStore';
|
|
3
|
+
import { legendExistsInLegendStore, legendSnapShot, legendStoreSubscribe, useAllLegends, useLegendById } from './stores/legendDataStore/legendStore';
|
|
4
4
|
import { legendExistsInLegendUIStore, useLegendUIById } from './stores/legendUIStore/legendUIStore';
|
|
5
5
|
import { visibleDataAsTagsSnapshot } from './stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore';
|
|
6
6
|
import { LegendId } from './types/legendType';
|
|
@@ -17,13 +17,7 @@ export declare const legendFacade: Readonly<{
|
|
|
17
17
|
useById: typeof useLegendById;
|
|
18
18
|
exists: typeof legendExistsInLegendStore;
|
|
19
19
|
snapshot: typeof legendSnapShot;
|
|
20
|
-
subscribe:
|
|
21
|
-
(listener: (selectedState: import("./stores/legendDataStore/legendStore").LegendStoreData & import("./stores/legendDataStore/legendStore").LegendStoreActions, previousSelectedState: import("./stores/legendDataStore/legendStore").LegendStoreData & import("./stores/legendDataStore/legendStore").LegendStoreActions) => void): () => void;
|
|
22
|
-
<U>(selector: (state: import("./stores/legendDataStore/legendStore").LegendStoreData & import("./stores/legendDataStore/legendStore").LegendStoreActions) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
23
|
-
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
24
|
-
fireImmediately?: boolean;
|
|
25
|
-
} | undefined): () => void;
|
|
26
|
-
};
|
|
20
|
+
subscribe: typeof legendStoreSubscribe;
|
|
27
21
|
};
|
|
28
22
|
ui: {
|
|
29
23
|
useById: typeof useLegendUIById;
|
|
@@ -97,7 +91,40 @@ export declare const legendFacade: Readonly<{
|
|
|
97
91
|
} | undefined): () => void;
|
|
98
92
|
};
|
|
99
93
|
}, "setState"> & {
|
|
100
|
-
setState(nextStateOrUpdater: import("./stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore").VisibleDataAsTagsStore | Partial<import("./stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore").VisibleDataAsTagsStore> | ((state:
|
|
94
|
+
setState(nextStateOrUpdater: import("./stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore").VisibleDataAsTagsStore | Partial<import("./stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore").VisibleDataAsTagsStore> | ((state: {
|
|
95
|
+
tags: {
|
|
96
|
+
tagNo: string;
|
|
97
|
+
instCode: string;
|
|
98
|
+
equipmentId: string | undefined;
|
|
99
|
+
tagSummary: {
|
|
100
|
+
instCode: string;
|
|
101
|
+
pdmsPlantCode: string | undefined;
|
|
102
|
+
tagCategoryDescription: string;
|
|
103
|
+
tagCategory: number;
|
|
104
|
+
tagStatus: import("@equinor/echo-search").TagStatus;
|
|
105
|
+
tagType: string;
|
|
106
|
+
updatedDate: Date;
|
|
107
|
+
locationCode: string;
|
|
108
|
+
contrCode: string;
|
|
109
|
+
plantNo: string;
|
|
110
|
+
poNo: string;
|
|
111
|
+
xCoordinate?: number | undefined;
|
|
112
|
+
yCoordinate?: number | undefined;
|
|
113
|
+
zCoordinate?: number | undefined;
|
|
114
|
+
additionalFields: {
|
|
115
|
+
type: string;
|
|
116
|
+
value: string;
|
|
117
|
+
}[];
|
|
118
|
+
tagNo: string;
|
|
119
|
+
description: string;
|
|
120
|
+
projectCode: string;
|
|
121
|
+
system: string;
|
|
122
|
+
};
|
|
123
|
+
}[];
|
|
124
|
+
isPending: boolean;
|
|
125
|
+
updateTags: (tags: import("./stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore.type").TagWithEquipmentId[]) => void;
|
|
126
|
+
setIsPending: (isPending: boolean) => void;
|
|
127
|
+
}) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
101
128
|
type: string;
|
|
102
129
|
} | undefined): void;
|
|
103
130
|
}>;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PersistOptions } from 'zustand/middleware';
|
|
2
1
|
import { LegendId, LegendState } from '../../types/legendType';
|
|
3
2
|
type LegendsDictionary = Record<LegendId, LegendState>;
|
|
4
3
|
export interface LegendStoreData {
|
|
@@ -12,37 +11,6 @@ export interface LegendStoreActions {
|
|
|
12
11
|
initializeLegendInStore: (legendId: LegendId) => void;
|
|
13
12
|
}
|
|
14
13
|
type LegendStore = LegendStoreData & LegendStoreActions;
|
|
15
|
-
type PersistedLegendState = Omit<LegendState, 'isLoading'>;
|
|
16
|
-
type PersistedLegendStoreData = {
|
|
17
|
-
legends: Record<LegendId, PersistedLegendState>;
|
|
18
|
-
};
|
|
19
|
-
export declare const useLegendStore: import("zustand").UseBoundStore<Omit<Omit<Omit<Omit<import("zustand").StoreApi<LegendStore>, "setState"> & {
|
|
20
|
-
setState<A extends string | {
|
|
21
|
-
type: string;
|
|
22
|
-
}>(partial: LegendStore | Partial<LegendStore> | ((state: LegendStore) => LegendStore | Partial<LegendStore>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
23
|
-
}, "subscribe"> & {
|
|
24
|
-
subscribe: {
|
|
25
|
-
(listener: (selectedState: LegendStore, previousSelectedState: LegendStore) => void): () => void;
|
|
26
|
-
<U>(selector: (state: LegendStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
27
|
-
equalityFn?: ((a: U, b: U) => boolean) | undefined;
|
|
28
|
-
fireImmediately?: boolean;
|
|
29
|
-
} | undefined): () => void;
|
|
30
|
-
};
|
|
31
|
-
}, "persist"> & {
|
|
32
|
-
persist: {
|
|
33
|
-
setOptions: (options: Partial<PersistOptions<LegendStore, PersistedLegendStoreData>>) => void;
|
|
34
|
-
clearStorage: () => void;
|
|
35
|
-
rehydrate: () => Promise<void> | void;
|
|
36
|
-
hasHydrated: () => boolean;
|
|
37
|
-
onHydrate: (fn: (state: LegendStore) => void) => () => void;
|
|
38
|
-
onFinishHydration: (fn: (state: LegendStore) => void) => () => void;
|
|
39
|
-
getOptions: () => Partial<PersistOptions<LegendStore, PersistedLegendStoreData>>;
|
|
40
|
-
};
|
|
41
|
-
}, "setState"> & {
|
|
42
|
-
setState(nextStateOrUpdater: LegendStore | Partial<LegendStore> | ((state: import("immer").WritableDraft<LegendStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
43
|
-
type: string;
|
|
44
|
-
} | undefined): void;
|
|
45
|
-
}>;
|
|
46
14
|
/**
|
|
47
15
|
* Hook to access a legend by ID with optional property selection for optimized re-renders.
|
|
48
16
|
*
|
|
@@ -90,11 +58,39 @@ export declare function legendExistsInLegendStore(legendId: LegendId): boolean;
|
|
|
90
58
|
export declare function useAllLegends(): LegendState[];
|
|
91
59
|
export declare function useAllLegends<T>(selector: (legends: LegendState[]) => T): T;
|
|
92
60
|
export declare function legendSnapShot(): LegendStore;
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Subscribe to legend store changes with optional selector for granular updates.
|
|
63
|
+
*
|
|
64
|
+
* NOTE: This wrapper is required because useLegendStore has an explicit type annotation
|
|
65
|
+
* (UseBoundStore<StoreApi<T>>) to prevent rollup build errors with useLegacyTypescriptPlugin: false.
|
|
66
|
+
*
|
|
67
|
+
* Without explicit type, TypeScript infers Immer's internal types (WritableNonArrayDraft, etc.)
|
|
68
|
+
* which use complex generics that rollup's @rollup/plugin-typescript cannot "name" in generated
|
|
69
|
+
* .d.ts files, causing TS4023: "Exported variable has or is using name 'X' but cannot be named."
|
|
70
|
+
*
|
|
71
|
+
* The explicit type hides these internals from rollup, but also removes subscribeWithSelector's
|
|
72
|
+
* enhanced subscribe(selector, listener) signature. This wrapper manually restores both overloads.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* // Watch entire store:
|
|
76
|
+
* const unsubscribe = legendStoreSubscribe((state) => console.log('Changed:', state));
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* // Watch specific property:
|
|
80
|
+
* const unsubscribe = legendStoreSubscribe(
|
|
81
|
+
* (state) => state.legends['Tag Legend']?.isEnabled,
|
|
82
|
+
* (isEnabled, prevIsEnabled) => console.log('Enabled changed:', isEnabled)
|
|
83
|
+
* );
|
|
84
|
+
*/
|
|
85
|
+
export declare function legendStoreSubscribe(listener: (state: LegendStore, prevState: LegendStore) => void): () => void;
|
|
86
|
+
export declare function legendStoreSubscribe<U>(selector: (state: LegendStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
|
|
87
|
+
equalityFn?: (a: U, b: U) => boolean;
|
|
88
|
+
fireImmediately?: boolean;
|
|
89
|
+
}): () => void;
|
|
90
|
+
export declare const getLegendStoreState: () => LegendStore;
|
|
91
|
+
/**
|
|
92
|
+
* TEST ONLY: Reset legend store to a specific state.
|
|
93
|
+
* Only use this in tests for setup/cleanup.
|
|
94
|
+
*/
|
|
95
|
+
export declare const __TEST__resetLegendStore: (state: Partial<LegendStoreData>) => void;
|
|
100
96
|
export {};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
import { type StoreApi, type UseBoundStore } from 'zustand';
|
|
1
2
|
import { LegendId } from '../../types/legendType';
|
|
2
3
|
import { LegendUIState, LegendUIStore } from './legendUIStore.types';
|
|
3
4
|
/**
|
|
4
5
|
* Non-persisted store for managing UI state of legends, such as accordion expansion and hidden markers/badges.
|
|
5
6
|
*/
|
|
6
|
-
export declare const useLegendUIStore:
|
|
7
|
-
setState(nextStateOrUpdater: LegendUIStore | Partial<LegendUIStore> | ((state: import("immer").WritableDraft<LegendUIStore>) => void), shouldReplace?: boolean | undefined): void;
|
|
8
|
-
}>;
|
|
7
|
+
export declare const useLegendUIStore: UseBoundStore<StoreApi<LegendUIStore>>;
|
|
9
8
|
/**
|
|
10
9
|
* Hook to access a legend by ID with optional property selection for optimized re-renders.
|
|
11
10
|
*
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MarkerId } from '../../components/pdfMarkers/utils/markerId.utils';
|
|
1
2
|
import { LegendId } from '../../types/legendType';
|
|
2
3
|
export interface LegendUIState {
|
|
3
4
|
readonly isAccordionExpanded: boolean;
|
|
@@ -8,6 +9,10 @@ export type LegendUIDictionary = Record<LegendId, LegendUIState>;
|
|
|
8
9
|
export type MarkersOutsideSelectionVisibility = 'Show' | 'Ghost' | 'Hide';
|
|
9
10
|
export type LegendUIStoreValues = {
|
|
10
11
|
readonly legends: LegendUIDictionary;
|
|
12
|
+
readonly activePopover: {
|
|
13
|
+
readonly id?: MarkerId;
|
|
14
|
+
readonly elements: ReadonlyArray<React.ReactElement>;
|
|
15
|
+
};
|
|
11
16
|
readonly selectionLegend: {
|
|
12
17
|
readonly isHighlightVisible: boolean;
|
|
13
18
|
readonly markersOutsideSelectionVisibility: MarkersOutsideSelectionVisibility;
|
|
@@ -28,5 +33,7 @@ export interface LegendUIStoreActions {
|
|
|
28
33
|
setMarkersOutsideSelectionVisibility: (visibility: MarkersOutsideSelectionVisibility) => void;
|
|
29
34
|
initializeLegendInStore: (legendId: LegendId) => void;
|
|
30
35
|
setSelectionLegendIsHighlightVisible: (visible: boolean) => void;
|
|
36
|
+
setActivePopoverId: (popoverId: MarkerId | undefined) => void;
|
|
37
|
+
setActivePopoverElements: (elements: ReadonlyArray<React.ReactElement>) => void;
|
|
31
38
|
}
|
|
32
39
|
export type LegendUIStore = LegendUIStoreValues & LegendUIStoreActions;
|
package/src/lib/feature/legend/stores/legendVisibleDataAsTagsStore/legendVisibleDataAsTagsStore.d.ts
CHANGED
|
@@ -32,7 +32,40 @@ export declare const useVisibleDataAsTagsStore: import("zustand").UseBoundStore<
|
|
|
32
32
|
} | undefined): () => void;
|
|
33
33
|
};
|
|
34
34
|
}, "setState"> & {
|
|
35
|
-
setState(nextStateOrUpdater: VisibleDataAsTagsStore | Partial<VisibleDataAsTagsStore> | ((state:
|
|
35
|
+
setState(nextStateOrUpdater: VisibleDataAsTagsStore | Partial<VisibleDataAsTagsStore> | ((state: {
|
|
36
|
+
tags: {
|
|
37
|
+
tagNo: string;
|
|
38
|
+
instCode: string;
|
|
39
|
+
equipmentId: string | undefined;
|
|
40
|
+
tagSummary: {
|
|
41
|
+
instCode: string;
|
|
42
|
+
pdmsPlantCode: string | undefined;
|
|
43
|
+
tagCategoryDescription: string;
|
|
44
|
+
tagCategory: number;
|
|
45
|
+
tagStatus: import("@equinor/echo-search").TagStatus;
|
|
46
|
+
tagType: string;
|
|
47
|
+
updatedDate: Date;
|
|
48
|
+
locationCode: string;
|
|
49
|
+
contrCode: string;
|
|
50
|
+
plantNo: string;
|
|
51
|
+
poNo: string;
|
|
52
|
+
xCoordinate?: number | undefined;
|
|
53
|
+
yCoordinate?: number | undefined;
|
|
54
|
+
zCoordinate?: number | undefined;
|
|
55
|
+
additionalFields: {
|
|
56
|
+
type: string;
|
|
57
|
+
value: string;
|
|
58
|
+
}[];
|
|
59
|
+
tagNo: string;
|
|
60
|
+
description: string;
|
|
61
|
+
projectCode: string;
|
|
62
|
+
system: string;
|
|
63
|
+
};
|
|
64
|
+
}[];
|
|
65
|
+
isPending: boolean;
|
|
66
|
+
updateTags: (tags: TagWithEquipmentId[]) => void;
|
|
67
|
+
setIsPending: (isPending: boolean) => void;
|
|
68
|
+
}) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
36
69
|
type: string;
|
|
37
70
|
} | undefined): void;
|
|
38
71
|
}>;
|
|
@@ -55,7 +55,26 @@ export declare const useLegendVisibleDataStore: import("zustand").UseBoundStore<
|
|
|
55
55
|
} | undefined): () => void;
|
|
56
56
|
};
|
|
57
57
|
}, "setState"> & {
|
|
58
|
-
setState(nextStateOrUpdater: LegendVisibleDataStore | Partial<LegendVisibleDataStore> | ((state:
|
|
58
|
+
setState(nextStateOrUpdater: LegendVisibleDataStore | Partial<LegendVisibleDataStore> | ((state: {
|
|
59
|
+
data: {
|
|
60
|
+
Tag: {
|
|
61
|
+
[x: string]: {
|
|
62
|
+
instCode: string;
|
|
63
|
+
tagNo: string;
|
|
64
|
+
}[];
|
|
65
|
+
};
|
|
66
|
+
Equipment: {
|
|
67
|
+
[x: string]: {
|
|
68
|
+
equipmentId: string;
|
|
69
|
+
}[];
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
addData: <T extends KnownDataTypeKeys>(type: T, key: string, value: ResolvedDataType<T>[]) => void;
|
|
73
|
+
removeData: (key: string) => void;
|
|
74
|
+
getData: <T extends KnownDataTypeKeys>(type: T) => ResolvedDataType<T>[];
|
|
75
|
+
useDataByType: <T extends KnownDataTypeKeys>(type: T) => ResolvedDataType<T>[];
|
|
76
|
+
getAll: () => LegendDataId[];
|
|
77
|
+
}) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
59
78
|
type: string;
|
|
60
79
|
} | undefined): void;
|
|
61
80
|
}>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { GlobalSelectionTypes } from '../../globalSelection';
|
|
1
2
|
import { Marker } from './legendMarkerBadge.type';
|
|
2
3
|
import { LegendDataId, LegendId, LegendOptionConfig } from './legendType';
|
|
3
4
|
/**
|
|
@@ -28,14 +29,17 @@ export interface LegendStrategy {
|
|
|
28
29
|
*/
|
|
29
30
|
useMarkers: (itemIds: ReadonlyArray<LegendDataId>, isViewport?: boolean) => ReadonlyArray<Marker>;
|
|
30
31
|
/**
|
|
31
|
-
* Returns popover content that supports pagination for the given
|
|
32
|
+
* Returns popover content that supports pagination for the given legendDataId.
|
|
33
|
+
* One legendDataId can have multiple items associated with it, for example a tag can have multiple work orders.
|
|
34
|
+
* Often we don't want to show all items (eg. when items are grouped), so we provide itemIds to filter the content to only relevant items.
|
|
32
35
|
*
|
|
33
36
|
* This function is asynchronous because the popover content may depend on data that needs to be fetched before rendering,
|
|
34
37
|
* such as related equipment, work orders, or other resources.
|
|
35
|
-
* @param {LegendDataId}
|
|
38
|
+
* @param {LegendDataId} legendDataId - The identifier for the legend item for which to render popover content.
|
|
39
|
+
* @param {ReadonlyArray<GlobalSelectionTypes.ItemId>} itemIds - The item ids to be included in the popover content.
|
|
36
40
|
* @returns A Promise resolving to one or more React elements to display in the popover.
|
|
37
41
|
*/
|
|
38
|
-
popoverContent: (
|
|
42
|
+
popoverContent: (legendDataId: LegendDataId, itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>) => Promise<React.ReactElement | ReadonlyArray<React.ReactElement>>;
|
|
39
43
|
/**
|
|
40
44
|
* Returns the custom legend component for the legend, if this is omitted the default basicLegendRenderer will be used
|
|
41
45
|
*/
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { WritableDraft } from 'immer';
|
|
2
1
|
export interface PanelUserSettings {
|
|
3
2
|
isTagsVisible: boolean;
|
|
4
3
|
isTagsFromDocumentVisible: boolean;
|
|
@@ -45,7 +44,35 @@ export declare const useDataLayerPanelStore: import("zustand").UseBoundStore<Omi
|
|
|
45
44
|
} | undefined): () => void;
|
|
46
45
|
};
|
|
47
46
|
}, "setState"> & {
|
|
48
|
-
setState(nextStateOrUpdater: DataLayerPanelStore | Partial<DataLayerPanelStore> | ((state:
|
|
47
|
+
setState(nextStateOrUpdater: DataLayerPanelStore | Partial<DataLayerPanelStore> | ((state: {
|
|
48
|
+
isOpen: boolean;
|
|
49
|
+
userSettings: {
|
|
50
|
+
isTagsVisible: boolean;
|
|
51
|
+
isTagsFromDocumentVisible: boolean;
|
|
52
|
+
isTagsFromSelectionVisible: boolean;
|
|
53
|
+
isWorkOrdersVisible: boolean;
|
|
54
|
+
isWorkOrdersFromDocumentVisible: boolean;
|
|
55
|
+
isWorkOrdersFromSelectionVisible: boolean;
|
|
56
|
+
isEquipmentsVisible: boolean;
|
|
57
|
+
isEquipmentsFromDocumentVisible: boolean;
|
|
58
|
+
isEquipmentsFromSelectionVisible: boolean;
|
|
59
|
+
isIocAnnotationsVisible: boolean;
|
|
60
|
+
isDataFromStidAnnoDetails: boolean;
|
|
61
|
+
};
|
|
62
|
+
togglePanel: () => void;
|
|
63
|
+
toggleTags: () => void;
|
|
64
|
+
toggleTagsFromDocumentVisible: () => void;
|
|
65
|
+
toggleTagsFromSelectionVisible: () => void;
|
|
66
|
+
toggleWorkOrders: () => void;
|
|
67
|
+
toggleWorkOrdersFromDocumentVisible: () => void;
|
|
68
|
+
toggleWorkOrdersFromSelectionVisible: () => void;
|
|
69
|
+
toggleEquipments: () => void;
|
|
70
|
+
toggleEquipmentsFromDocumentVisible: () => void;
|
|
71
|
+
toggleEquipmentsFromSelectionVisible: () => void;
|
|
72
|
+
setEquipmentsForEcm: () => void;
|
|
73
|
+
toggleIocAnnotations: () => void;
|
|
74
|
+
setIsDataFromStidAnnoDetails: (value: boolean) => void;
|
|
75
|
+
}) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
49
76
|
type: string;
|
|
50
77
|
} | undefined): void;
|
|
51
78
|
}>;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
+
import { StoreApi, UseBoundStore } from 'zustand';
|
|
1
2
|
import { LeftPanelNavigationStore } from './leftPanelNavigation.store.types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
/**
|
|
4
|
+
* IMPORTANT: Explicit type annotation required for rollup builds with useLegacyTypescriptPlugin: false
|
|
5
|
+
*
|
|
6
|
+
* Without explicit type, TypeScript infers the full type including Immer's internal types like
|
|
7
|
+
* WritableNonArrayDraft which use complex generics that rollup's @rollup/plugin-typescript cannot
|
|
8
|
+
* "name" in generated .d.ts files, causing TS4023 errors.
|
|
9
|
+
*
|
|
10
|
+
* Trade-off: UseBoundStore<StoreApi<T>> removes subscribeWithSelector's enhanced subscribe(selector, listener)
|
|
11
|
+
* signature, leaving only the base subscribe(listener). Store still fully functional via hook and .getState().
|
|
12
|
+
*
|
|
13
|
+
* Stores NOT exported from public API (index.ts) can omit this explicit type and preserve middleware signatures.
|
|
14
|
+
*/
|
|
15
|
+
export declare const useLeftPanelNavigationStore: UseBoundStore<StoreApi<LeftPanelNavigationStore>>;
|
|
13
16
|
export declare function getLeftPanelNavigationState(): LeftPanelNavigationStore;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { SelectedLegend } from '../../feature/legacyLegend/legend';
|
|
1
|
+
import { LegendType, SelectedLegend } from '../../feature/legacyLegend/legend';
|
|
2
2
|
interface UserSettings {
|
|
3
|
-
measuringPointsEnabled: boolean;
|
|
4
3
|
selectedLegacyLegend: SelectedLegend;
|
|
5
4
|
}
|
|
6
5
|
interface UserSettingsActions {
|
|
7
|
-
setMeasuringPointsEnabled: (value: boolean) => void;
|
|
8
6
|
setSelectedLegacyLegend: (selectedLegend: SelectedLegend) => void;
|
|
9
7
|
}
|
|
10
8
|
type UserSettingsStore = UserSettings & UserSettingsActions;
|
|
@@ -31,7 +29,13 @@ export declare const useUserSettingsStore: import("zustand").UseBoundStore<Omit<
|
|
|
31
29
|
getOptions: () => Partial<import("zustand/middleware").PersistOptions<UserSettingsStore, unknown>>;
|
|
32
30
|
};
|
|
33
31
|
}, "setState"> & {
|
|
34
|
-
setState(nextStateOrUpdater: UserSettingsStore | Partial<UserSettingsStore> | ((state:
|
|
32
|
+
setState(nextStateOrUpdater: UserSettingsStore | Partial<UserSettingsStore> | ((state: {
|
|
33
|
+
selectedLegacyLegend: {
|
|
34
|
+
isEnabled: boolean;
|
|
35
|
+
legendType: LegendType;
|
|
36
|
+
};
|
|
37
|
+
setSelectedLegacyLegend: (selectedLegend: SelectedLegend) => void;
|
|
38
|
+
}) => void), shouldReplace?: boolean | undefined, action?: string | {
|
|
35
39
|
type: string;
|
|
36
40
|
} | undefined): void;
|
|
37
41
|
}>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a single link the user can follow to request or understand access.
|
|
3
|
+
*/
|
|
4
|
+
type AccessRequestLink = {
|
|
5
|
+
label: string;
|
|
6
|
+
url: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Group of related access request links, optionally with a heading describing who it applies to.
|
|
10
|
+
*/
|
|
11
|
+
type AccessRequestLinkGroup = {
|
|
12
|
+
heading?: string;
|
|
13
|
+
requestLinks: AccessRequestLink[];
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Higher-level guidance section combining descriptive text and one or more link groups.
|
|
17
|
+
*/
|
|
18
|
+
export type AccessGuidanceSection = {
|
|
19
|
+
description: string;
|
|
20
|
+
descriptionBold?: string;
|
|
21
|
+
requestLinkGroups: AccessRequestLinkGroup[];
|
|
22
|
+
note?: string;
|
|
23
|
+
};
|
|
24
|
+
export declare const SapAccessGuidanceSection: AccessGuidanceSection;
|
|
25
|
+
export declare const ProCoSysAccessGuidanceSection: (plantName: string) => AccessGuidanceSection;
|
|
26
|
+
export declare const IocAccessGuidanceSection: AccessGuidanceSection;
|
|
27
|
+
export {};
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Central repository of link metadata used across the application.
|
|
3
|
+
*
|
|
4
|
+
* Keep raw URLs explicit (rather than generated) for traceability and to avoid
|
|
5
|
+
* accidental term changes when AccessIT search semantics evolve.
|
|
6
|
+
*/
|
|
1
7
|
export declare const dataAccessLinks: {
|
|
2
8
|
YO900: {
|
|
3
9
|
label: string;
|
|
@@ -44,4 +50,3 @@ export declare const dataAccessLinks: {
|
|
|
44
50
|
url: string;
|
|
45
51
|
};
|
|
46
52
|
};
|
|
47
|
-
export declare function createPlantNameQueryParam(plantName: string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert the displayed Echo plant name into the AccessIT search term.
|
|
3
|
+
*
|
|
4
|
+
* 1. Attempt to match any defined special-case fragment (substring match)
|
|
5
|
+
* 2. Fall back to taking the first N words of the raw plant name (default 3)
|
|
6
|
+
*
|
|
7
|
+
* Encoding is handled via encodeURIComponent; callers should not add additional encoding.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createPlantNameQueryParam(plantName: string): string;
|
package/src/lib/feature/legend/components/pdfMarkers/subComponents/hooks/usePopoverHandler.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { LegendDataId, LegendId } from '../../../../types/legendType';
|
|
2
|
-
import { PopoverContent } from './usePopoverHandler.types';
|
|
3
|
-
export declare function usePopoverHandler(): {
|
|
4
|
-
currentPopover: PopoverContent | undefined;
|
|
5
|
-
handleOpenPopover: (itemId: LegendDataId, legendId: LegendId, uniqueIdentifier: string, fetchPopoverContent: () => Promise<ReadonlyArray<React.JSX.Element>>) => Promise<void>;
|
|
6
|
-
handleClosePopover: () => void;
|
|
7
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { LegendDataId, LegendId } from '../../../../types/legendType';
|
|
2
|
-
export type RequestPopoverHandler = (itemId: LegendDataId, legendId: LegendId, uniqueIdentifier: string, fetchPopoverContent: () => Promise<ReadonlyArray<React.JSX.Element>>) => void;
|
|
3
|
-
export interface PopoverContent {
|
|
4
|
-
elements: ReadonlyArray<JSX.Element>;
|
|
5
|
-
activeItem: ActiveItem;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* We use active for the icon. Several icons might be active if they have the same tagNo on the PDF, but only 1 of them is open.
|
|
9
|
-
*/
|
|
10
|
-
export interface ActiveItem {
|
|
11
|
-
itemId: LegendDataId;
|
|
12
|
-
legendId: LegendId;
|
|
13
|
-
uniqueIdentifier: string;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { dataAccessLinks } from './dataAccessLinks';
|