@equinor/echo-framework 2.2.3 → 2.3.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/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "2.2.3",
3
+ "version": "2.3.0",
4
4
  "peerDependencies": {
5
- "@equinor/echo-base": ">= 2.2.3 < 3.0.0",
6
- "@equinor/echo-components": ">= 2.2.3 < 3.0.0",
7
- "@equinor/echo-core": ">= 2.2.3 < 3.0.0",
8
- "@equinor/echo-search": ">= 2.2.3 < 3.0.0",
9
- "@equinor/echo-utils": ">= 2.2.3 < 3.0.0",
5
+ "@equinor/echo-base": ">= 2.3.0 < 3.0.0",
6
+ "@equinor/echo-components": ">= 2.3.0 < 3.0.0",
7
+ "@equinor/echo-core": ">= 2.3.0 < 3.0.0",
8
+ "@equinor/echo-search": ">= 2.3.0 < 3.0.0",
9
+ "@equinor/echo-utils": ">= 2.3.0 < 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",
package/src/index.d.ts CHANGED
@@ -77,6 +77,7 @@ export { getPdmsPlantCodeForTag } from './lib/utils/getPdmsPlantCodeForTag';
77
77
  export { isImage, isVideo } from './lib/utils/mediaTypeUtils';
78
78
  export { convertPathNameToReadableString } from './lib/utils/moduleNameUtils';
79
79
  export * from './lib/utils/startup';
80
+ export type { ProcosysProject } from './types/procosysProject';
80
81
  export declare const registerEchopediaComponent: ({ name, component }: {
81
82
  name: import("./lib/services/componentRegistry/componentRegistry").RegisteredComponentName;
82
83
  component: import("react").FunctionComponent<any>;
@@ -0,0 +1,7 @@
1
+ import { GlobalSelectionItemType, GlobalSelectionObject } from '../globalSelectionStore/globalSelectionStore.types';
2
+ /**
3
+ *
4
+ * @param {GlobalSelectionItemType} itemType
5
+ * @returns Map of given item types stored in global selection.
6
+ */
7
+ export declare function useGlobalSelectionItemsByTypeAsMap<T extends GlobalSelectionItemType>(itemType: T): GlobalSelectionObject[T];
@@ -5,6 +5,7 @@ export { useAreAllItemsVisible } from './hooks/useAreAllItemsVisible';
5
5
  export { useGlobalSelectionByItemId } from './hooks/useGlobalSelectionByItemId';
6
6
  export { useGlobalSelectionItems } from './hooks/useGlobalSelectionItems';
7
7
  export { useGlobalSelectionItemsByType } from './hooks/useGlobalSelectionItemsByType';
8
+ export { useGlobalSelectionItemsByTypeAsMap } from './hooks/useGlobalSelectionItemsByTypeAsMap';
8
9
  export { useGlobalSelectionLists } from './hooks/useGlobalSelectionLists';
9
10
  export { useGlobalSelectionTags } from './hooks/useGlobalSelectionTags';
10
11
  export { useGlobalSelectionWorkOrders } from './hooks/useGlobalSelectionWorkOrders';
@@ -1,8 +1,7 @@
1
- import React from 'react';
2
- interface LegendTextSelectorProps {
3
- options: ReadonlyArray<string>;
4
- selectedOption: string;
5
- onOptionSelected?: (option: string) => void;
1
+ interface LegendTextSelectorProps<T extends string> {
2
+ options: ReadonlyArray<T>;
3
+ selectedOption: T;
4
+ onOptionSelected?: (option: T, e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
6
5
  }
7
6
  /**
8
7
  * LegendTextSelector renders a group of selectable buttons for legend text options.
@@ -17,5 +16,5 @@ interface LegendTextSelectorProps {
17
16
  * @param {(option: string) => void} [props.onOptionSelected] - Callback invoked when a new option is selected.
18
17
  * @returns {JSX.Element | null} The rendered button group, or null if no options are provided.
19
18
  */
20
- export declare const LegendTextSelector: React.FC<LegendTextSelectorProps>;
19
+ export declare const LegendTextSelector: <T extends string>(props: LegendTextSelectorProps<T>) => import("react/jsx-runtime").JSX.Element | null;
21
20
  export {};
@@ -1,12 +1,12 @@
1
1
  import { ItemMarkerSize } from '@equinor/echo-components';
2
2
  import React from 'react';
3
- import { Marker } from '../../../types/legendMarkerBadge.type';
3
+ import { GroupedMarker } from '../utils/splitMarkerByBadgeSelectionGroup.types';
4
4
  interface LegendColoredMarkerIconProps {
5
5
  hasPointer: boolean;
6
6
  isActive: boolean;
7
7
  onClick: () => void;
8
8
  hiddenBadges: string[];
9
- marker: Marker;
9
+ marker: GroupedMarker;
10
10
  }
11
11
  /**
12
12
  * Renders a colored marker icon with optional pointer and badges.
@@ -1 +1 @@
1
- export declare const SelectionLegendRenderer: import("react").MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
1
+ export declare const SelectionLegendRenderer: import("react").MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element | null>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * SelectionLegendActions renders the action buttons for the Selection Legend.
3
+ * It provides options to toggle the visibility of highlights around selection group markers.
4
+ */
5
+ export declare const SelectionLegendActions: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Allows the user to select how to display markers that are not in any selection group.
3
+ */
4
+ export declare const SelectionLegendOtherMarkers: () => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { Guid } from '@equinor/echo-utils';
2
2
  import { GlobalSelectionTypes, SelectionGroup } from '../../../globalSelection';
3
- import { GroupKey } from '../pdfMarkers/utils/splitMarkerByBadgeSelectionGroup.types';
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
6
6
  * Flag to enable/disable Selection Legend feature
@@ -32,3 +32,11 @@ export declare const getSelectionGroupMostUsedColor: (selectionGroup: SelectionG
32
32
  * @returns The standardized group key
33
33
  */
34
34
  export declare const createSelectionGroupKey: (groupId: Guid, color: string) => GroupKey;
35
+ /**
36
+ * Checks if a marker belongs to the "Not in Selection" group.
37
+ *
38
+ * @param marker - The marker to check.
39
+ *
40
+ * @returns True if the marker is in the "Not in Selection" group, false otherwise.
41
+ */
42
+ export declare const isMarkerOutsideSelection: (marker: GroupedMarker) => boolean;
@@ -30,3 +30,9 @@ export declare const useLegendUIStore: import("zustand").UseBoundStore<Omit<impo
30
30
  export declare function useLegendUIById(legendId: LegendId): LegendUIState | undefined;
31
31
  export declare function useLegendUIById<T>(legendId: LegendId, selector: (legend: LegendUIState | undefined) => T): T;
32
32
  export declare function legendExistsInLegendUIStore(legendId: LegendId): boolean;
33
+ /**
34
+ * Helper function to toggle visibility of an item in an array.
35
+ * Adds the item if isHidden is true and it's not present, removes it if isHidden is false and it exists.
36
+ * @internal - Exported for testing purposes only
37
+ */
38
+ export declare function toggleItemInArray(array: string[], item: string, isHidden: boolean): void;
@@ -5,8 +5,13 @@ export interface LegendUIState {
5
5
  readonly hiddenBadges: string[];
6
6
  }
7
7
  export type LegendUIDictionary = Record<LegendId, LegendUIState>;
8
+ export type MarkersOutsideSelectionVisibility = 'Show' | 'Ghost' | 'Hide';
8
9
  export type LegendUIStoreValues = {
9
- legends: LegendUIDictionary;
10
+ readonly legends: LegendUIDictionary;
11
+ readonly selectionLegend: {
12
+ readonly isHighlightVisible: boolean;
13
+ readonly markersOutsideSelectionVisibility: MarkersOutsideSelectionVisibility;
14
+ };
10
15
  };
11
16
  export interface LegendUIStoreActions {
12
17
  toggleAccordion: (legendId: LegendId, newValue: boolean) => void;
@@ -20,6 +25,8 @@ export interface LegendUIStoreActions {
20
25
  badge: string;
21
26
  isHidden: boolean;
22
27
  }) => void;
28
+ setMarkersOutsideSelectionVisibility: (visibility: MarkersOutsideSelectionVisibility) => void;
23
29
  initializeLegendInStore: (legendId: LegendId) => void;
30
+ setSelectionLegendIsHighlightVisible: (visible: boolean) => void;
24
31
  }
25
32
  export type LegendUIStore = LegendUIStoreValues & LegendUIStoreActions;
@@ -1,23 +1,38 @@
1
1
  import { WritableDraft } from 'immer';
2
- interface PanelUserSettings {
3
- readonly isTagsVisible: boolean;
4
- readonly isWorkOrdersVisible: boolean;
5
- readonly isEquipmentsVisible: boolean;
6
- readonly isIocAnnotationsVisible: boolean;
2
+ export interface PanelUserSettings {
3
+ isTagsVisible: boolean;
4
+ isTagsFromDocumentVisible: boolean;
5
+ isTagsFromSelectionVisible: boolean;
6
+ isWorkOrdersVisible: boolean;
7
+ isWorkOrdersFromDocumentVisible: boolean;
8
+ isWorkOrdersFromSelectionVisible: boolean;
9
+ isEquipmentsVisible: boolean;
10
+ isEquipmentsFromDocumentVisible: boolean;
11
+ isEquipmentsFromSelectionVisible: boolean;
12
+ isIocAnnotationsVisible: boolean;
13
+ isDataFromStidAnnoDetails: boolean;
7
14
  }
8
- interface DataLayerPanelState {
9
- readonly isOpen: boolean;
15
+ export interface DataLayerPanelState {
16
+ isOpen: boolean;
10
17
  readonly userSettings: PanelUserSettings;
11
18
  }
12
19
  interface DataLayerPanelActions {
13
20
  togglePanel: () => void;
21
+ toggleTags: () => void;
22
+ toggleTagsFromDocumentVisible: () => void;
23
+ toggleTagsFromSelectionVisible: () => void;
14
24
  toggleWorkOrders: () => void;
25
+ toggleWorkOrdersFromDocumentVisible: () => void;
26
+ toggleWorkOrdersFromSelectionVisible: () => void;
15
27
  toggleEquipments: () => void;
16
- toggleTags: () => void;
28
+ toggleEquipmentsFromDocumentVisible: () => void;
29
+ toggleEquipmentsFromSelectionVisible: () => void;
30
+ setEquipmentsForEcm: () => void;
17
31
  toggleIocAnnotations: () => void;
32
+ setIsDataFromStidAnnoDetails: (value: boolean) => void;
18
33
  }
19
34
  type DataLayerPanelStore = DataLayerPanelState & DataLayerPanelActions;
20
- export declare const useDataLayerPanelStore: import("zustand").UseBoundStore<Omit<Omit<Omit<Omit<import("zustand").StoreApi<DataLayerPanelStore>, "setState"> & {
35
+ export declare const useDataLayerPanelStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<DataLayerPanelStore>, "setState"> & {
21
36
  setState<A extends string | {
22
37
  type: string;
23
38
  }>(partial: DataLayerPanelStore | Partial<DataLayerPanelStore> | ((state: DataLayerPanelStore) => DataLayerPanelStore | Partial<DataLayerPanelStore>), replace?: boolean | undefined, action?: A | undefined): void;
@@ -29,16 +44,6 @@ export declare const useDataLayerPanelStore: import("zustand").UseBoundStore<Omi
29
44
  fireImmediately?: boolean;
30
45
  } | undefined): () => void;
31
46
  };
32
- }, "persist"> & {
33
- persist: {
34
- setOptions: (options: Partial<import("zustand/middleware").PersistOptions<DataLayerPanelStore, unknown>>) => void;
35
- clearStorage: () => void;
36
- rehydrate: () => Promise<void> | void;
37
- hasHydrated: () => boolean;
38
- onHydrate: (fn: (state: DataLayerPanelStore) => void) => () => void;
39
- onFinishHydration: (fn: (state: DataLayerPanelStore) => void) => () => void;
40
- getOptions: () => Partial<import("zustand/middleware").PersistOptions<DataLayerPanelStore, unknown>>;
41
- };
42
47
  }, "setState"> & {
43
48
  setState(nextStateOrUpdater: DataLayerPanelStore | Partial<DataLayerPanelStore> | ((state: WritableDraft<DataLayerPanelStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
44
49
  type: string;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * ProcosysProject represents a project from the ProCoSys API.
3
+ * This is the canonical type for project data throughout the application.
4
+ */
5
+ export interface ProcosysProject {
6
+ projectCode: string;
7
+ stidDeliveryCode: number;
8
+ description: string;
9
+ isRevProject: string;
10
+ filter: {
11
+ value: string;
12
+ text: string;
13
+ };
14
+ instCode: string;
15
+ insertedDate: string;
16
+ insertedBy: string;
17
+ updatedDate: string;
18
+ updatedBy: string;
19
+ validFlg: string;
20
+ }
@@ -1,6 +0,0 @@
1
- /**
2
- * Decides if selection legend should be visible or not.
3
- * Will be visible if Selection has items. Does not check if Selection has items
4
- * that are visible on the current PDF.
5
- */
6
- export declare const useIsSelectionLegendVisible: () => boolean;