@equinor/echo-framework 1.1.0 → 1.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.
Files changed (73) hide show
  1. package/index.cjs.js +8 -8
  2. package/package.json +6 -6
  3. package/src/index.d.ts +2 -2
  4. package/src/lib/components/fullScreenButtons/index.d.ts +0 -2
  5. package/src/lib/components/panel/useCalculateLegendHeight.d.ts +1 -0
  6. package/src/lib/components/prepview/panels/tagInformation/TagInformation.d.ts +1 -1
  7. package/src/lib/coreApplication/EchoContentPanels.d.ts +1 -5
  8. package/src/lib/feature/equipment/components/equipmentItemHeader/showEquipmentIn3dButton.d.ts +1 -1
  9. package/src/lib/feature/globalSelection/globalSelection.api.d.ts +30 -4
  10. package/src/lib/feature/globalSelection/globalSelection.internal.d.ts +3 -2
  11. package/src/lib/feature/globalSelection/globalSelectionColorService.d.ts +57 -0
  12. package/src/lib/feature/globalSelection/globalSelectionColorService.types.d.ts +3 -0
  13. package/src/lib/feature/globalSelection/globalSelectionStore/actions/addEquipmentsToSelection.action.d.ts +1 -0
  14. package/src/lib/feature/globalSelection/globalSelectionStore/actions/addItemsToSelectionFactory.d.ts +1 -0
  15. package/src/lib/feature/globalSelection/globalSelectionStore/actions/addMeasuringPointsToSelection.action.d.ts +1 -0
  16. package/src/lib/feature/globalSelection/globalSelectionStore/actions/addTagsToSelection.action.d.ts +1 -0
  17. package/src/lib/feature/globalSelection/globalSelectionStore/actions/addWorkOrdersToSelection.action.d.ts +1 -0
  18. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.repository.d.ts +2 -2
  19. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +7 -5
  20. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.utils.d.ts +24 -4
  21. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStoreHelpers.d.ts +12 -2
  22. package/src/lib/feature/globalSelection/hooks/useGlobalSelectionLists.d.ts +0 -2
  23. package/src/lib/feature/globalSelection/index.d.ts +7 -2
  24. package/src/lib/feature/globalSelection/selectionMenu/hooks/useFetchSelectionHistory.d.ts +5 -0
  25. package/src/lib/feature/globalSelection/selectionMenu/hooks/useGlobalSelectionGroups.d.ts +24 -1
  26. package/src/lib/feature/globalSelection/selectionMenu/hooks/useSelectionColorFrequency.d.ts +18 -0
  27. package/src/lib/feature/globalSelection/selectionMenu/invalidateHistorySelectionQuery.d.ts +1 -0
  28. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addItems.action.d.ts +16 -0
  29. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addItemsToSelectionTreeFactory.d.ts +1 -1
  30. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/common.action.types.d.ts +5 -0
  31. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/createGroup.action.d.ts +20 -0
  32. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/moveItems.action.d.ts +31 -0
  33. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/removeGroupById.action.d.ts +21 -0
  34. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/removeItemsById.action.d.ts +24 -0
  35. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/selectionTree.action.types.d.ts +14 -15
  36. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/setVisibility.action.d.ts +21 -0
  37. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/api/selectionTree.api.d.ts +16 -5
  38. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/api/selectionTree.equipment.d.ts +5 -0
  39. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/colorConflictHandling/SelectionColorConflictDialog.d.ts +11 -0
  40. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/colorConflictHandling/selectionColorConflict.store.d.ts +27 -0
  41. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/persist/devOnlySimulateOffline.d.ts +7 -0
  42. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/persist/diskId.type.d.ts +2 -0
  43. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/persist/persistError.d.ts +5 -0
  44. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/persist/selectionTree.diskBackup.d.ts +45 -0
  45. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/persist/selectionTree.diskBackupStatus.d.ts +19 -0
  46. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/persist/selectionTree.load.d.ts +8 -0
  47. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/persist/selectionTree.load.utils.d.ts +54 -0
  48. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/persist/selectionTree.save.d.ts +1 -0
  49. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/persist/selectionTreeLoader.service.d.ts +42 -0
  50. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/{useSelectionTreeAutoSave.d.ts → persist/useSelectionTreeAutoSave.d.ts} +2 -0
  51. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.api.types.d.ts +14 -3
  52. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.d.ts +15 -0
  53. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +16 -3
  54. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.utils.d.ts +64 -2
  55. package/src/lib/feature/legacyLegend/legend.d.ts +1 -0
  56. package/src/lib/feature/legend/components/legendTextSelector/LegendTextSelector.d.ts +21 -0
  57. package/src/lib/feature/legend/components/popover/LegendPopoverContent.d.ts +4 -0
  58. package/src/lib/feature/legend/components/popover/LegendPopoverContent.logic.d.ts +1 -1
  59. package/src/lib/feature/legend/index.d.ts +6 -0
  60. package/src/lib/feature/legend/types/legendMarkerBadge.type.d.ts +9 -2
  61. package/src/lib/feature/legend/types/legendStrategy.type.d.ts +1 -0
  62. package/src/lib/feature/legend/types/legendType.d.ts +1 -0
  63. package/src/lib/services/api/api-plants.d.ts +4 -0
  64. package/src/lib/services/echoViewService/loadEchoViewIdAndSelectionIdFromUrl.d.ts +5 -4
  65. package/src/lib/types/dataAccess/dataAccessLinks.d.ts +1 -0
  66. package/src/lib/utils/startup.d.ts +1 -0
  67. package/src/lib/components/fullScreenButtons/FullScreenChip.d.ts +0 -7
  68. package/src/lib/components/fullScreenButtons/FullScreenModeChip.d.ts +0 -14
  69. package/src/lib/feature/globalSelection/selectionMenu/hooks/useGlobalSelectionColorsSortedByFrequency.d.ts +0 -10
  70. package/src/lib/feature/globalSelection/selectionMenu/hooks/useMoveSelectionTreeItems.d.ts +0 -10
  71. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.repository.d.ts +0 -5
  72. /package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/{currentSelectionId.repository.d.ts → persist/currentSelectionId.repository.d.ts} +0 -0
  73. /package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/{legacyPersistedSelection.d.ts → persist/legacyPersistedSelection.d.ts} +0 -0
@@ -2,11 +2,18 @@ export interface Marker {
2
2
  getTitle: () => string;
3
3
  getColor: () => string;
4
4
  getIcon: () => string;
5
- getMarkerKey: () => string;
5
+ /**
6
+ * Returns a key that can be used for clustering or grouping markers together if they share the same key.
7
+ */
8
+ getGroupKey: () => string;
6
9
  badges: Badge[];
7
10
  showAsPlainLabel?: boolean;
8
11
  }
9
12
  export interface Badge {
10
- getColor: () => string;
11
13
  getTitle: () => string;
14
+ getColor: () => string;
15
+ /**
16
+ * Returns a key that can be used for clustering or grouping badges together if they share the same key.
17
+ */
18
+ getGroupKey: () => string;
12
19
  }
@@ -17,6 +17,7 @@ export interface LegendStrategy {
17
17
  * Badge options that is selectable by the user.
18
18
  */
19
19
  badgeOptions?: ReadonlyArray<LegendOptionConfig>;
20
+ getBadgeTextOptions?: (selectedBadgeOption: LegendOptionConfig) => ReadonlyArray<string> | undefined;
20
21
  /**
21
22
  * Returns ONE marker per itemId.
22
23
  */
@@ -17,6 +17,7 @@ export interface LegendState {
17
17
  hiddenBadges: string[];
18
18
  selectedMarkerOption: LegendOptionConfig;
19
19
  selectedBadgeOption: LegendOptionConfig;
20
+ selectedBadgeTextOptions: Record<string, string>;
20
21
  isExpanded: boolean;
21
22
  }
22
23
  export type LegendTagId = GlobalSelectionTypes.TagId;
@@ -6,3 +6,7 @@ import { Plant } from '@equinor/echo-core';
6
6
  */
7
7
  export declare function getPlantsFromApi(): Promise<Plant[]>;
8
8
  export declare function getPlantsCachedOrApi(): Promise<ReadonlyArray<Plant>>;
9
+ /**
10
+ * Keeps only plants that satisfy all eligibility checks.
11
+ */
12
+ export declare function filterEligiblePlants(plants?: readonly Plant[]): Plant[];
@@ -1,6 +1,7 @@
1
- import { EchoView } from './echoView.type';
1
+ import { Guid } from '@equinor/echo-utils';
2
2
  /**
3
- * Load echo view with selection on startup. Don't add any slow api calls here, since we want to render the app as fast as possible.
4
- * This DOES NOT THROW, but handles errors internally.
3
+ * Load echo view from url with or without echo selection
4
+ * Or load only echo selection from url
5
5
  */
6
- export declare function loadEchoViewIdAndSelectionIdFromUrl(): Promise<EchoView | undefined>;
6
+ export declare function loadEchoViewIdAndSelectionIdFromUrl(selectionId: Guid | undefined, echoViewId: Guid | undefined): Promise<boolean>;
7
+ export declare function extractAndClearFromUrl(parameterName: string): string | undefined;
@@ -44,3 +44,4 @@ export declare const dataAccessLinks: {
44
44
  url: string;
45
45
  };
46
46
  };
47
+ export declare function createPlantNameQueryParam(plantName: string): string;
@@ -4,3 +4,4 @@
4
4
  * @return {*} {Promise<void>}
5
5
  */
6
6
  export declare function echoFrameworkStartup(): Promise<void>;
7
+ export declare function loadEchoSelectionAndView(): Promise<void>;
@@ -1,7 +0,0 @@
1
- import React from 'react';
2
- export interface FullScreenChipProps {
3
- active: boolean;
4
- onClick: () => void;
5
- onDelete: () => void;
6
- }
7
- export declare const FullScreenChip: React.FC<FullScreenChipProps>;
@@ -1,14 +0,0 @@
1
- interface FullScreenModeChipProps {
2
- className?: string;
3
- }
4
- /**
5
- * Renders a chip component that allows users to toggle full screen mode.
6
- * This makes the application header and sidebar disappear, providing a more immersive experience.
7
- * The chip is only visible when full screen mode is enabled and the chip visibility state is true.
8
- *
9
- * The chip provides two actions:
10
- * - Clicking the chip toggles the full screen mode.
11
- * - Deleting the chip hides it from view.
12
- */
13
- export declare const FullScreenModeChip: ({ className }: FullScreenModeChipProps) => false | import("react/jsx-runtime").JSX.Element;
14
- export {};
@@ -1,10 +0,0 @@
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
- */
10
- export declare function useGlobalSelectionColorsSortedByFrequency(categories: SelectionTreeTypes.Category[]): string[];
@@ -1,10 +0,0 @@
1
- import { Guid } from '@equinor/echo-utils';
2
- import { GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
3
- import { GlobalSelectionCategoryId } from '../selectionTreeStore/selectionTree.store.types';
4
- type MoveSelectionArgs = {
5
- sourceGroupId: Guid;
6
- sourceCategoryId?: GlobalSelectionCategoryId;
7
- sourceItemId?: GlobalSelectionTypes.ItemId;
8
- };
9
- export declare const useMoveSelectionTreeItems: (args: MoveSelectionArgs) => ((newGroupId: Guid) => void) | undefined;
10
- export {};
@@ -1,5 +0,0 @@
1
- import { Guid } from '@equinor/echo-utils';
2
- export declare function loadAndPopulateStoreFromApi(idToLoad: Guid): Promise<void>;
3
- export declare const selectionTreeRepository: {
4
- loadAndPopulateStoreFromApi: typeof loadAndPopulateStoreFromApi;
5
- };