@equinor/echo-framework 0.26.11 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/index.cjs.js +8 -8
  2. package/package.json +11 -11
  3. package/src/index.d.ts +2 -0
  4. package/src/lib/components/prepview/notification/details/DetailsNotification.d.ts +1 -1
  5. package/src/lib/feature/echoView/ReturnToExternalAppButton.d.ts +6 -0
  6. package/src/lib/feature/globalSelection/globalSelection.api.d.ts +1 -1
  7. package/src/lib/feature/globalSelection/globalSelection.internal.d.ts +5 -1
  8. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionSaveState.d.ts +9 -0
  9. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.d.ts +1 -11
  10. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.repository.d.ts +2 -6
  11. package/src/lib/feature/globalSelection/index.d.ts +1 -0
  12. package/src/lib/feature/globalSelection/selectionLogOptions.d.ts +5 -0
  13. package/src/lib/feature/globalSelection/selectionMenu/hooks/useCurrentSelectionId.d.ts +4 -0
  14. package/src/lib/feature/globalSelection/selectionMenu/hooks/useGlobalSelectionColorsSortedByFrequency.d.ts +8 -0
  15. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/api/selectionTree.api.d.ts +9 -7
  16. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/currentSelectionId.repository.d.ts +10 -0
  17. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/legacyPersistedSelection.d.ts +14 -0
  18. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.api.types.d.ts +29 -0
  19. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.d.ts +1 -11
  20. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.repository.d.ts +2 -7
  21. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +5 -17
  22. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/useSelectionTreeAutoSave.d.ts +5 -0
  23. package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendColoredMarkerIcon.d.ts +2 -0
  24. package/src/lib/feature/legend/components/popover/LegendPopoverContent.logic.d.ts +3 -3
  25. package/src/lib/feature/legend/index.d.ts +1 -1
  26. package/src/lib/feature/legend/legendStore.d.ts +6 -2
  27. package/src/lib/feature/legend/types/legendMarkerBadge.type.d.ts +2 -1
  28. package/src/lib/feature/legend/types/legendStrategy.type.d.ts +3 -3
  29. package/src/lib/feature/legend/types/legendType.d.ts +14 -2
  30. package/src/lib/services/echoViewService/echoView.type.d.ts +7 -1
  31. package/src/lib/services/echoViewService/echoViewService.d.ts +1 -0
package/package.json CHANGED
@@ -1,31 +1,31 @@
1
1
  {
2
2
  "name": "@equinor/echo-framework",
3
- "version": "0.26.11",
3
+ "version": "1.1.0",
4
4
  "peerDependencies": {
5
- "@equinor/echo-base": ">= 0.26.8 < 0.27.0",
6
- "@equinor/echo-components": ">= 0.26.10 < 0.27.0",
7
- "@equinor/echo-core": ">= 0.26.9 < 0.27.0",
8
- "@equinor/echo-search": ">= 0.26.8 < 0.27.0",
9
- "@equinor/echo-utils": ">= 0.26.11 < 0.27.0",
5
+ "@equinor/echo-base": ">= 1.0.0 < 2.0.0",
6
+ "@equinor/echo-components": ">= 1.0.0 < 2.0.0",
7
+ "@equinor/echo-core": ">= 1.0.0 < 2.0.0",
8
+ "@equinor/echo-search": ">= 1.0.0 < 2.0.0",
9
+ "@equinor/echo-utils": ">= 1.1.0 < 2.0.0",
10
10
  "@equinor/eds-core-react": "0.43.0",
11
11
  "@equinor/eds-icons": "0.22.0",
12
12
  "react": ">= 17.0.2",
13
13
  "react-dom": ">= 17.0.2",
14
14
  "@tanstack/react-query": ">= 5.14.2 < 6",
15
- "@microsoft/signalr": "8.0.7",
15
+ "@microsoft/signalr": "9.0.6",
16
16
  "classnames": "2.5.1",
17
17
  "history": "5.3.0",
18
18
  "lodash": "4.17.21",
19
19
  "react-router-dom": "5.3.4",
20
20
  "zustand": ">= 4.4.7 < 5",
21
21
  "immer": "10.1.1",
22
- "ag-charts-enterprise": "12.0.2"
22
+ "ag-charts-enterprise": "12.1.2"
23
23
  },
24
24
  "dependencies": {
25
- "dexie": "4.0.11",
25
+ "dexie": "4.2.0",
26
26
  "mark.js": "8.11.1",
27
- "ag-charts-community": "12.0.2",
28
- "ag-charts-react": "12.0.2"
27
+ "ag-charts-community": "12.1.2",
28
+ "ag-charts-react": "12.1.2"
29
29
  },
30
30
  "main": "./index.cjs.js",
31
31
  "type": "commonjs",
package/src/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export { RequestSapAccess } from './lib/components/requestAccess/RequestSapAcces
12
12
  export { WorkOrderListItem } from './lib/components/workOrderListItem';
13
13
  export type { WorkOrderListItemData } from './lib/components/workOrderListItem/types/types';
14
14
  export * from './lib/coreApplication';
15
+ export { ReturnToExternalAppButton } from './lib/feature/echoView/ReturnToExternalAppButton';
15
16
  export { fetchEquipmentFromApi } from './lib/feature/equipment/api/api-equipmentWithMeasuringPoints';
16
17
  export * from './lib/feature/equipment/index';
17
18
  export * from './lib/feature/globalSelection';
@@ -20,6 +21,7 @@ export { PanTo3DButton } from './lib/feature/globalSelection/panToEcho3d/panTo3D
20
21
  export { useGlobalSelectionColorsSortedByFrequency } from './lib/feature/globalSelection/selectionMenu/hooks/useGlobalSelectionColorsSortedByFrequency';
21
22
  export { useIsAllIGlobalSelectionItemsHidden } from './lib/feature/globalSelection/selectionMenu/hooks/useIsAllIGlobalSelectionItemsHidden';
22
23
  export { GlobalSelectionCategoryId } from './lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types';
24
+ export { useSelectionTreeAutoSave } from './lib/feature/globalSelection/selectionMenu/selectionTreeStore/useSelectionTreeAutoSave';
23
25
  export * from './lib/feature/legacyLegend/index';
24
26
  export { PositionalLegendMarkers } from './lib/feature/legend/components/pdfMarkers/PositionalLegendMarkers';
25
27
  export { PopoverLoading } from './lib/feature/legend/components/pdfMarkers/subComponents/components/PopoverLoading';
@@ -3,5 +3,5 @@ export interface Props {
3
3
  details: NotificationDetails;
4
4
  isLoading?: boolean;
5
5
  }
6
- declare function DetailsNotification({ details }: Props): JSX.Element;
6
+ declare function DetailsNotification({ details }: Readonly<Props>): JSX.Element;
7
7
  export { DetailsNotification };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * When an user has entered the application through an echo view from another application,
3
+ * this button enables them to return to said application with the correct selectionId as
4
+ * an url parameter.
5
+ */
6
+ export declare const ReturnToExternalAppButton: () => import("react/jsx-runtime").JSX.Element | undefined;
@@ -111,7 +111,7 @@ export declare const globalSelectionApi: Readonly<{
111
111
  addItems: (args: {
112
112
  itemIds: GlobalSelectionTypes.ItemId[];
113
113
  groupId?: import("@equinor/echo-utils").Guid;
114
- } & import("./selectionMenu/selectionTreeStore/actions/selectionTree.action.types").AddByGroupIdAndLabel) => void;
114
+ } & import("./selectionMenu/selectionTreeStore/actions/selectionTree.action.types").AddByGroupIdAndLabel) => Promise<void>;
115
115
  }>;
116
116
  search: {
117
117
  /**
@@ -1,8 +1,12 @@
1
+ import { Guid } from '@equinor/echo-utils';
2
+ import { deleteSelectionId, fetchUserSelectionIds } from './selectionMenu/selectionTreeStore/api/selectionTree.api';
1
3
  /**
2
4
  * Internal that should only be used by echopedia
3
5
  */
4
6
  export declare const globalSelectionInternal: Readonly<{
5
7
  loadFromApi: typeof loadFromApi;
8
+ deleteSelectionId: typeof deleteSelectionId;
9
+ fetchUserSelectionIds: typeof fetchUserSelectionIds;
6
10
  }>;
7
- declare function loadFromApi(idToLoad: string): Promise<void>;
11
+ declare function loadFromApi(idToLoad: Guid): Promise<void>;
8
12
  export {};
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Loading state that tells if saving to api is enabled
3
+ */
4
+ export declare function isGlobalSelectionSaveEnabled(): boolean;
5
+ /**
6
+ * Loading state that tells if saving to api is enabled
7
+ * Always set this in a `try / finally`, to avoid infinite loading state
8
+ */
9
+ export declare function setGlobalSelectionSaveEnabled(isEnabled: boolean): void;
@@ -21,7 +21,7 @@ export declare const initialMeasuringPointList: GlobalSelectionTypes.MeasuringPo
21
21
  *
22
22
  * For accessing and using global selection features, use the globalSelectionApi from echo-framework.
23
23
  */
24
- export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Omit<Omit<Omit<Omit<import("zustand").StoreApi<GlobalSelectionStore>, "setState"> & {
24
+ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<GlobalSelectionStore>, "setState"> & {
25
25
  setState<A extends string | {
26
26
  type: string;
27
27
  }>(partial: GlobalSelectionStore | Partial<GlobalSelectionStore> | ((state: GlobalSelectionStore) => GlobalSelectionStore | Partial<GlobalSelectionStore>), replace?: boolean | undefined, action?: A | undefined): void;
@@ -33,16 +33,6 @@ export declare const useGlobalSelectionStore: import("zustand").UseBoundStore<Om
33
33
  fireImmediately?: boolean;
34
34
  } | undefined): () => void;
35
35
  };
36
- }, "persist"> & {
37
- persist: {
38
- setOptions: (options: Partial<import("zustand/middleware").PersistOptions<GlobalSelectionStore, GlobalSelectionStore>>) => void;
39
- clearStorage: () => void;
40
- rehydrate: () => Promise<void> | void;
41
- hasHydrated: () => boolean;
42
- onHydrate: (fn: (state: GlobalSelectionStore) => void) => () => void;
43
- onFinishHydration: (fn: (state: GlobalSelectionStore) => void) => () => void;
44
- getOptions: () => Partial<import("zustand/middleware").PersistOptions<GlobalSelectionStore, GlobalSelectionStore>>;
45
- };
46
36
  }, "setState"> & {
47
37
  setState(nextStateOrUpdater: GlobalSelectionStore | Partial<GlobalSelectionStore> | ((state: import("immer").WritableDraft<GlobalSelectionStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
48
38
  type: string;
@@ -1,11 +1,7 @@
1
- import { PersistOptions } from 'zustand/middleware';
2
- import { PersistedSelectionGroup } from '../selectionMenu/selectionTreeStore/selectionTree.store.types';
1
+ import { ApiSelectionGroup } from '../selectionMenu/selectionTreeStore/selectionTree.api.types';
3
2
  import { GlobalSelectionStore } from './globalSelectionStore.types';
4
- declare function loadAndPopulateStoreMetadataFromDisk(store: GlobalSelectionStore): Promise<void>;
5
- declare function loadAndPopulateStoreMetadataFromApi(store: GlobalSelectionStore, data: PersistedSelectionGroup[]): Promise<void>;
3
+ declare function loadAndPopulateStoreMetadataFromApi(store: GlobalSelectionStore, data: ApiSelectionGroup[]): Promise<void>;
6
4
  export declare const globalSelectionRepository: {
7
- loadAndPopulateStoreMetadataFromDisk: typeof loadAndPopulateStoreMetadataFromDisk;
8
5
  loadAndPopulateStoreMetadataFromApi: typeof loadAndPopulateStoreMetadataFromApi;
9
- persistOptions: PersistOptions<GlobalSelectionStore, GlobalSelectionStore>;
10
6
  };
11
7
  export {};
@@ -8,6 +8,7 @@ export { useGlobalSelectionLists } from './hooks/useGlobalSelectionLists';
8
8
  export { useGlobalSelectionTags } from './hooks/useGlobalSelectionTags';
9
9
  export { useGlobalSelectionWorkOrders } from './hooks/useGlobalSelectionWorkOrders';
10
10
  export { useSelectionCategoriesByGroupId } from './hooks/useSelectionCategoriesByGroupId';
11
+ export { useCurrentSelectionId } from './selectionMenu/hooks/useCurrentSelectionId';
11
12
  export { useGlobalSelectionGroups } from './selectionMenu/hooks/useGlobalSelectionGroups';
12
13
  export { useMoveSelectionTreeItems } from './selectionMenu/hooks/useMoveSelectionTreeItems';
13
14
  export { loadEchoViewIdAndSelectionIdFromUrl } from '../../services/echoViewService/loadEchoViewIdAndSelectionIdFromUrl';
@@ -0,0 +1,5 @@
1
+ export declare const SelectionLogOptions: Readonly<{
2
+ addItemsIsLogEnabled: false;
3
+ saveToApiIsLogEnabled: false;
4
+ loadFromApiIsLogEnabled: false;
5
+ }>;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Returns current selection id that is active in the selection tree.
3
+ */
4
+ export declare function useCurrentSelectionId(): import("@equinor/echo-utils").Guid | undefined;
@@ -1,2 +1,10 @@
1
1
  import { SelectionTreeTypes } from '../selectionTreeStore/selectionTree.store.types';
2
+ /**
3
+ * Returns a list of colors sorted by frequency from the given categories.
4
+ * This hook is optimized to only recalculate when the items in the global selection store
5
+ * that match the given categories change their colors.
6
+ *
7
+ * @param categories - The categories to get colors from
8
+ * @returns An array of colors sorted by frequency
9
+ */
2
10
  export declare function useGlobalSelectionColorsSortedByFrequency(categories: SelectionTreeTypes.Category[]): string[];
@@ -1,7 +1,9 @@
1
- import { PersistedSelectionGroup } from '../selectionTree.store.types';
2
- export declare function fetchSelectionTreeById(id: string): Promise<PersistedSelectionTreeDto | undefined>;
3
- interface PersistedSelectionTreeDto {
4
- readonly id: string;
5
- readonly data: PersistedSelectionGroup[];
6
- }
7
- export {};
1
+ import { Guid } from '@equinor/echo-utils';
2
+ import { ApiSelectionTreeRoot } from '../selectionTree.api.types';
3
+ import { SelectionGroup } from '../selectionTree.store.types';
4
+ export declare function saveSelectionTreeToApi(id: string | undefined, data: {
5
+ data: SelectionGroup[];
6
+ }): Promise<void>;
7
+ export declare function fetchSelectionTreeById(id: string): Promise<ApiSelectionTreeRoot | undefined>;
8
+ export declare function fetchUserSelectionIds(): Promise<Guid[]>;
9
+ export declare function deleteSelectionId(id: string): Promise<void>;
@@ -0,0 +1,10 @@
1
+ import { Guid } from '@equinor/echo-utils';
2
+ declare function setCurrentSelectionId(id: Guid): void;
3
+ declare function getCurrentSelectionId(): Guid | undefined;
4
+ declare function clearCurrentSelectionId(): void;
5
+ export declare const currentSelectionIdRepository: Readonly<{
6
+ set: typeof setCurrentSelectionId;
7
+ get: typeof getCurrentSelectionId;
8
+ clear: typeof clearCurrentSelectionId;
9
+ }>;
10
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * This file loads the old data saved to disk. New approach is to instead save and load it from the api.
3
+ *
4
+ * This file can be deleted after a few months, when we expect all the users to have migrated this old data.
5
+ *
6
+ * Keep the rest of the code private, so we easily can delete this
7
+ */
8
+ export declare const legacyPersistedSelection: {
9
+ loadFromDisk: typeof loadLegacyDataFromDiskAndPopulateStore;
10
+ deleteFromDisk: typeof deleteFromDisk;
11
+ };
12
+ declare function deleteFromDisk(): Promise<void>;
13
+ declare function loadLegacyDataFromDiskAndPopulateStore(): Promise<boolean>;
14
+ export {};
@@ -0,0 +1,29 @@
1
+ import { Guid } from '@equinor/echo-utils';
2
+ import { GlobalSelectionItemType, GlobalSelectionMetaData, SelectionItemTypeToItemIdMap } from '../../globalSelectionStore/globalSelectionStore.types';
3
+ export type ApiSelectionTreeItemId = SelectionItemTypeToItemIdMap[GlobalSelectionItemType];
4
+ export type ApiGlobalSelectionMetaData = Partial<Pick<GlobalSelectionMetaData, 'color' | 'isHiddenByUser'>>;
5
+ export interface ApiSelectionTreeRoot {
6
+ id?: Guid;
7
+ data: ApiSelectionGroup[];
8
+ versionNo?: string;
9
+ /**
10
+ * Short is used by 3rd party apps, it should not be visible/selectable by user
11
+ * Long will show up in recent sessions in UI.
12
+ */
13
+ lifetime: 'Short' | 'Long';
14
+ }
15
+ export interface ApiSelectionGroup {
16
+ readonly groupId: Guid;
17
+ readonly label: string;
18
+ readonly subLabel: string;
19
+ readonly categories: ApiSelectionCategory[];
20
+ }
21
+ export interface ApiSelectionCategory {
22
+ readonly items: ApiSelectionTreeItem[];
23
+ }
24
+ export interface ApiSelectionTreeItem {
25
+ readonly type: GlobalSelectionItemType;
26
+ readonly id: ApiSelectionTreeItemId;
27
+ readonly metaData?: ApiGlobalSelectionMetaData;
28
+ }
29
+ export declare function cleanApiSelectionTreeRoot(root: ApiSelectionTreeRoot): ApiSelectionTreeRoot;
@@ -1,5 +1,5 @@
1
1
  import { SelectionTreeStore } from './selectionTree.store.types';
2
- export declare const useSelectionTreeStore: import("zustand").UseBoundStore<Omit<Omit<Omit<Omit<import("zustand").StoreApi<SelectionTreeStore>, "setState"> & {
2
+ export declare const useSelectionTreeStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<SelectionTreeStore>, "setState"> & {
3
3
  setState<A extends string | {
4
4
  type: string;
5
5
  }>(partial: SelectionTreeStore | Partial<SelectionTreeStore> | ((state: SelectionTreeStore) => SelectionTreeStore | Partial<SelectionTreeStore>), replace?: boolean | undefined, action?: A | undefined): void;
@@ -11,16 +11,6 @@ export declare const useSelectionTreeStore: import("zustand").UseBoundStore<Omit
11
11
  fireImmediately?: boolean;
12
12
  } | undefined): () => void;
13
13
  };
14
- }, "persist"> & {
15
- persist: {
16
- setOptions: (options: Partial<import("zustand/middleware").PersistOptions<SelectionTreeStore, SelectionTreeStore>>) => void;
17
- clearStorage: () => void;
18
- rehydrate: () => Promise<void> | void;
19
- hasHydrated: () => boolean;
20
- onHydrate: (fn: (state: SelectionTreeStore) => void) => () => void;
21
- onFinishHydration: (fn: (state: SelectionTreeStore) => void) => () => void;
22
- getOptions: () => Partial<import("zustand/middleware").PersistOptions<SelectionTreeStore, SelectionTreeStore>>;
23
- };
24
14
  }, "setState"> & {
25
15
  setState(nextStateOrUpdater: SelectionTreeStore | Partial<SelectionTreeStore> | ((state: import("immer").WritableDraft<SelectionTreeStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
26
16
  type: string;
@@ -1,10 +1,5 @@
1
- import { PersistOptions } from 'zustand/middleware';
2
- import { SelectionTreeStore } from './selectionTree.store.types';
3
- declare function loadAndPopulateStoreFromDisk(store: SelectionTreeStore): Promise<void>;
4
- declare function loadAndPopulateStoreFromApi(store: SelectionTreeStore, idToLoad: string): Promise<void>;
1
+ import { Guid } from '@equinor/echo-utils';
2
+ export declare function loadAndPopulateStoreFromApi(idToLoad: Guid): Promise<void>;
5
3
  export declare const selectionTreeRepository: {
6
- loadAndPopulateStoreFromDisk: typeof loadAndPopulateStoreFromDisk;
7
4
  loadAndPopulateStoreFromApi: typeof loadAndPopulateStoreFromApi;
8
- persistOptions: PersistOptions<SelectionTreeStore, SelectionTreeStore>;
9
5
  };
10
- export {};
@@ -1,5 +1,5 @@
1
1
  import { Guid } from '@equinor/echo-utils';
2
- import { GlobalSelectionItemType, GlobalSelectionTypes, PersistedGlobalSelectionMetaData, SelectionItemTypeToItemIdMap } from '../../globalSelectionStore/globalSelectionStore.types';
2
+ import { GlobalSelectionItemType, GlobalSelectionTypes, SelectionItemTypeToItemIdMap } from '../../globalSelectionStore/globalSelectionStore.types';
3
3
  import { AddByGroupIdAndLabel, AddItemArgs, AddItemsResponse, SelectionTreeActionResult } from './actions/selectionTree.action.types';
4
4
  export declare enum GlobalSelectionCategoryId {
5
5
  Tags = "DEFAULT_TAG_LIST_ID",
@@ -12,11 +12,6 @@ export type SelectionTreeItem<T extends GlobalSelectionItemType> = {
12
12
  readonly id: SelectionItemTypeToItemIdMap[T];
13
13
  readonly type: T;
14
14
  };
15
- export type PersistedSelectionTreeItem<T extends GlobalSelectionItemType> = {
16
- readonly id: SelectionItemTypeToItemIdMap[T];
17
- readonly type: T;
18
- readonly metaData: PersistedGlobalSelectionMetaData;
19
- };
20
15
  export interface SelectionBase {
21
16
  readonly groupId: Guid;
22
17
  readonly label: string;
@@ -27,26 +22,19 @@ export interface SelectionCategory {
27
22
  readonly label: string;
28
23
  items: Map<GlobalSelectionTypes.ItemIdString, SelectionTreeItem<GlobalSelectionItemType>>;
29
24
  }
30
- export interface PersistedSelectionCategory {
31
- readonly id: GlobalSelectionCategoryId;
32
- readonly label: string;
33
- readonly items: PersistedSelectionTreeItem<GlobalSelectionItemType>[];
34
- }
35
25
  export interface SelectionGroup extends SelectionBase {
36
26
  readonly categories: SelectionCategory[];
37
27
  }
38
- export interface PersistedSelectionGroup extends SelectionBase {
39
- readonly categories: PersistedSelectionCategory[];
40
- }
41
28
  export interface SelectionTreeData {
29
+ currentSelectionId?: Guid;
42
30
  readonly groups: SelectionGroup[];
43
31
  }
44
- export interface SelectionTreeStore {
45
- groups: SelectionGroup[];
32
+ export interface SelectionTreeStore extends SelectionTreeData {
33
+ setCurrentSelectionId: (id: Guid) => void;
46
34
  addItems: (args: {
47
35
  itemIds: GlobalSelectionTypes.ItemId[];
48
36
  groupId?: Guid;
49
- } & AddByGroupIdAndLabel) => void;
37
+ } & AddByGroupIdAndLabel) => Promise<void>;
50
38
  addTags: (args: AddItemArgs<GlobalSelectionTypes.TagId>) => AddTagsReturnType;
51
39
  addWorkOrders: (args: AddItemArgs<GlobalSelectionTypes.WorkOrderId>) => AddWorkOrdersReturnType;
52
40
  addEquipments: (args: AddItemArgs<GlobalSelectionTypes.EquipmentId>) => AddEquipmentsReturnType;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Auto saves if the selection tree or global selection change by: Add/remove/rename items/groups, or metadata.color/isHiddenByUser
3
+ * Ignores saving if only data object changes, or metadata.error/status
4
+ */
5
+ export declare function useSelectionTreeAutoSave(): void;
@@ -1,3 +1,4 @@
1
+ import { ItemMarkerSize } from '@equinor/echo-components';
1
2
  import React from 'react';
2
3
  import { LegendDataId, LegendId } from '../../../types/legendType';
3
4
  interface LegendColoredMarkerIconProps {
@@ -8,4 +9,5 @@ interface LegendColoredMarkerIconProps {
8
9
  onClick: () => void;
9
10
  }
10
11
  export declare const MemoizedLegendColoredMarkerIcon: React.NamedExoticComponent<LegendColoredMarkerIconProps>;
12
+ export declare const MARKER_ICON_WIDTH = ItemMarkerSize.Default;
11
13
  export {};
@@ -1,5 +1,5 @@
1
- import { LegendChipProps } from "@equinor/echo-components";
2
- import { LegendState } from "../../types/legendType";
1
+ import { LegendChipProps } from '@equinor/echo-components';
2
+ import { LegendState } from '../../types/legendType';
3
3
  import { Marker } from './../../types/legendMarkerBadge.type';
4
4
  /**
5
5
  * Returns an array of visible LegendChipProps for the given markers and legend state.
@@ -13,7 +13,7 @@ import { Marker } from './../../types/legendMarkerBadge.type';
13
13
  * @param {ReadonlyArray<string>} [params.excludedLegendTitles] - Optional array of titles to exclude from the chips (case-insensitive).
14
14
  * @returns {LegendChipProps[]} The filtered and mapped array of LegendChipProps for rendering.
15
15
  */
16
- export declare function getVisibleLegendChips({ markers, legend, excludedLegendTitles, }: {
16
+ export declare function getVisibleLegendChips({ markers, legend, excludedLegendTitles }: {
17
17
  markers: ReadonlyArray<Marker>;
18
18
  legend: LegendState;
19
19
  excludedLegendTitles?: ReadonlyArray<string>;
@@ -7,4 +7,4 @@ export type { LegendPopoverContentProps, LegendPopoverTertiaryLabels } from './c
7
7
  export { legendFacade } from './legendFacade';
8
8
  export type { Badge, Marker } from './types/legendMarkerBadge.type';
9
9
  export type { LegendStrategy } from './types/legendStrategy.type';
10
- export type { LegendId } from './types/legendType';
10
+ export type { LegendId, LegendOptionConfig } from './types/legendType';
@@ -21,6 +21,10 @@ export interface LegendStoreActions {
21
21
  getLegendById: (legendId: LegendId) => LegendState | undefined;
22
22
  }
23
23
  type LegendStore = LegendStoreData & LegendStoreActions;
24
+ type PersistedLegendState = Omit<LegendState, 'isLoading' | 'hiddenMarkers' | 'hiddenBadges'>;
25
+ type PersistedLegendStoreData = {
26
+ legends: Record<LegendId, PersistedLegendState>;
27
+ };
24
28
  export declare const useLegendStore: import("zustand").UseBoundStore<Omit<Omit<Omit<Omit<import("zustand").StoreApi<LegendStore>, "setState"> & {
25
29
  setState<A extends string | {
26
30
  type: string;
@@ -35,13 +39,13 @@ export declare const useLegendStore: import("zustand").UseBoundStore<Omit<Omit<O
35
39
  };
36
40
  }, "persist"> & {
37
41
  persist: {
38
- setOptions: (options: Partial<PersistOptions<LegendStore, LegendStore>>) => void;
42
+ setOptions: (options: Partial<PersistOptions<LegendStore, PersistedLegendStoreData>>) => void;
39
43
  clearStorage: () => void;
40
44
  rehydrate: () => Promise<void> | void;
41
45
  hasHydrated: () => boolean;
42
46
  onHydrate: (fn: (state: LegendStore) => void) => () => void;
43
47
  onFinishHydration: (fn: (state: LegendStore) => void) => () => void;
44
- getOptions: () => Partial<PersistOptions<LegendStore, LegendStore>>;
48
+ getOptions: () => Partial<PersistOptions<LegendStore, PersistedLegendStoreData>>;
45
49
  };
46
50
  }, "setState"> & {
47
51
  setState(nextStateOrUpdater: LegendStore | Partial<LegendStore> | ((state: import("immer").WritableDraft<LegendStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
@@ -2,9 +2,10 @@ export interface Marker {
2
2
  getTitle: () => string;
3
3
  getColor: () => string;
4
4
  getIcon: () => string;
5
+ getMarkerKey: () => string;
5
6
  badges: Badge[];
7
+ showAsPlainLabel?: boolean;
6
8
  }
7
- export declare function markerKey(marker: Marker): string;
8
9
  export interface Badge {
9
10
  getColor: () => string;
10
11
  getTitle: () => string;
@@ -1,5 +1,5 @@
1
1
  import { Marker } from './legendMarkerBadge.type';
2
- import { LegendDataId, LegendId } from './legendType';
2
+ import { LegendDataId, LegendId, LegendOptionConfig } from './legendType';
3
3
  /**
4
4
  * A general interface for the legend strategy. This enables us to automatically render all the legend ui parts: the ui with selectable options, the markers & the badges.
5
5
  * The specific implementation (like tagStrategy, equipmentStrategy, etc) will implement this, and inject it with legendFacade.injectLegendStrategy.
@@ -12,11 +12,11 @@ export interface LegendStrategy {
12
12
  /**
13
13
  * Marker options that is selectable by the user.
14
14
  */
15
- markerOptions?: ReadonlyArray<string>;
15
+ markerOptions?: ReadonlyArray<LegendOptionConfig>;
16
16
  /**
17
17
  * Badge options that is selectable by the user.
18
18
  */
19
- badgeOptions?: ReadonlyArray<string>;
19
+ badgeOptions?: ReadonlyArray<LegendOptionConfig>;
20
20
  /**
21
21
  * Returns ONE marker per itemId.
22
22
  */
@@ -15,12 +15,24 @@ export interface LegendState {
15
15
  isLoading: boolean;
16
16
  hiddenMarkers: string[];
17
17
  hiddenBadges: string[];
18
- selectedMarkerOption: string;
19
- selectedBadgeOption: string;
18
+ selectedMarkerOption: LegendOptionConfig;
19
+ selectedBadgeOption: LegendOptionConfig;
20
20
  isExpanded: boolean;
21
21
  }
22
22
  export type LegendTagId = GlobalSelectionTypes.TagId;
23
23
  export type LegendEquipmentId = GlobalSelectionTypes.EquipmentId;
24
24
  export type LegendWorkOrderId = GlobalSelectionTypes.WorkOrderId;
25
25
  export type LegendDataId = LegendTagId | LegendEquipmentId | LegendWorkOrderId;
26
+ export interface LegendOptionConfig<T = string> {
27
+ propertyName: T;
28
+ /**
29
+ * The idea with this is to use it with general rules for strategies US.
30
+ * Indicates whether the propertyName corresponds to a field in an object structure.
31
+ * When true, propertyName refers to an actual field in a data object.
32
+ * When false, propertyName is just a string identifier not tied to object fields.
33
+ * Comment it in when it is needed.
34
+ */
35
+ displayName: string;
36
+ showChipsInViewportOnly?: boolean;
37
+ }
26
38
  export {};
@@ -4,7 +4,7 @@ export interface EchoViewBaseItem {
4
4
  }
5
5
  export interface EchoView extends EchoViewBaseItem {
6
6
  readonly owner: string;
7
- readonly selectionId: string | undefined;
7
+ readonly selectionId: Guid | undefined;
8
8
  readonly instCode: string | undefined;
9
9
  readonly tagNo: string | undefined;
10
10
  readonly search: string | undefined;
@@ -14,6 +14,12 @@ export interface EchoView extends EchoViewBaseItem {
14
14
  readonly ecmPdfInspectionTool: EchoViewEcmPdfInspectionToolConfig | undefined;
15
15
  readonly echo3D: Record<string, unknown> | undefined;
16
16
  readonly version: string;
17
+ readonly returnToApp: EchoViewReturnToApp | undefined;
18
+ }
19
+ export interface EchoViewReturnToApp {
20
+ readonly callbackUrl: string | undefined;
21
+ readonly returnButtonTextSuffix: string | undefined;
22
+ readonly returnButtonTextOverride: string | undefined;
17
23
  }
18
24
  export interface EchoViewSyncSettings {
19
25
  readonly enablePunches: boolean | undefined;
@@ -1,3 +1,4 @@
1
1
  import { EchoView } from './echoView.type';
2
2
  export declare function setEchoView(echoView: EchoView): void;
3
+ export declare function clearEchoView(): void;
3
4
  export declare function echoViewService(): EchoView | undefined;