@equinor/echo-framework 0.21.0-beta-2 → 0.21.1-beta-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 (33) hide show
  1. package/{47deeba42768c5d1.svg → 063009f06499d102.svg} +8 -8
  2. package/README.md +28 -28
  3. package/{1bd97dd2170d0f64.svg → f4c85313e79b1662.svg} +850 -850
  4. package/index.cjs.d.ts +2 -2
  5. package/index.cjs.js +1 -1
  6. package/package.json +2 -2
  7. package/src/index.d.ts +3 -4
  8. package/src/lib/components/prepview/api/api.d.ts +1 -0
  9. package/src/lib/components/prepview/context/PrepviewContext.d.ts +1 -1
  10. package/src/lib/components/prepview/panels/attachments/AttachmentItem.d.ts +1 -1
  11. package/src/lib/components/prepview/types/shared.d.ts +1 -0
  12. package/src/lib/feature/globalSelection/components/SelectionActionBar.d.ts +2 -1
  13. package/src/lib/feature/globalSelection/globalSelection.api.d.ts +88 -105
  14. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +7 -1
  15. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.utils.d.ts +1 -1
  16. package/src/lib/feature/globalSelection/hooks/useSelectionCategoriesByGroupId.d.ts +11 -0
  17. package/src/lib/feature/globalSelection/index.d.ts +4 -1
  18. package/src/lib/feature/globalSelection/selectionMenu/hooks/{useAllItemsHiddenByUser.d.ts → useIsAllIGlobalSelectionItemsHidden.d.ts} +9 -2
  19. package/src/lib/feature/globalSelection/selectionMenu/hooks/useSelectionMenuGroups.d.ts +7 -0
  20. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addTag.action.d.ts +13 -0
  21. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addTag.action.types.d.ts +18 -0
  22. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/initialData.d.ts +10 -0
  23. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.d.ts +22 -0
  24. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +83 -0
  25. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.utils.d.ts +70 -0
  26. package/src/lib/feature/legacyLegend/legend.d.ts +5 -3
  27. package/src/lib/hooks/useCommPackSearch.d.ts +2 -0
  28. package/src/lib/hooks/useMcPackSearch.d.ts +2 -0
  29. package/src/lib/utils/mediaTypeUtils.d.ts +2 -0
  30. package/src/lib/feature/globalSelection/selectionMenu/hooks/useSelectionMenuLists.d.ts +0 -7
  31. package/src/lib/feature/globalSelection/selectionMenu/selectionMenuStore/selectionMenu.store.d.ts +0 -28
  32. package/src/lib/feature/globalSelection/selectionMenu/selectionMenuStore/selectionMenu.store.types.d.ts +0 -56
  33. package/src/lib/feature/globalSelection/selectionMenu/selectionMenuStore/selectionMenu.store.utils.d.ts +0 -56
@@ -0,0 +1,70 @@
1
+ import { Guid } from '@equinor/echo-utils';
2
+ import { GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
3
+ import { GlobalSelectionCategoryId, SelectionTreeTypes } from './selectionTree.store.types';
4
+ /**
5
+ * Check if an item ID is present in the selection tree.
6
+ *
7
+ * This function checks if a given item ID is present in the selection tree within a specific group and category.
8
+ * If groupId or categoryId is not provided, it checks all groups and categories.
9
+ *
10
+ * @param {Object} args - The function arguments.
11
+ * @param {GlobalSelectionTypes.ItemId} args.itemId - The ID of the item to check.
12
+ * @param {string} [args.groupId] - The ID of the group to check within (optional).
13
+ * @param {string} [args.categoryId] - The ID of the category to check within (optional).
14
+ * @param {SelectionTreeTypes.Group[]} args.groups - The selection tree groups to check within.
15
+ * @returns {boolean} True if the item ID is present in the selection tree, false otherwise.
16
+ */
17
+ export declare function isItemIdInSelectionTree(args: {
18
+ itemId: GlobalSelectionTypes.ItemId;
19
+ groupId?: string;
20
+ categoryId?: string;
21
+ groups: SelectionTreeTypes.Group[];
22
+ }): boolean;
23
+ /**
24
+ * Find a selection category by group ID and optionally category ID.
25
+ *
26
+ * This function finds the group and optionally the category within the selection tree groups.
27
+ *
28
+ * @param {Object} args - The function arguments.
29
+ * @param {string} args.groupId - The ID of the group to search within.
30
+ * @param {string} [args.categoryId] - The ID of the category to search for (optional).
31
+ * @param {SelectionTreeTypes.Group[]} args.groups - The selection tree groups to search within.
32
+ * @returns {Object | undefined} The group and optionally the category, or undefined if not found.
33
+ */
34
+ export declare function findSelectionCategoryById(args: {
35
+ groupId: string;
36
+ categoryId?: string;
37
+ groups: SelectionTreeTypes.Group[];
38
+ }): {
39
+ group: SelectionTreeTypes.Group;
40
+ category?: SelectionTreeTypes.Category;
41
+ } | undefined;
42
+ /**
43
+ * Retrieves an array of itemIds that were not found in the selection menu.
44
+ *
45
+ * @param {Object} args - The arguments containing the list and itemIds to check.
46
+ * @param {SelectionTreeTypes.Group[]} args.groups - The list of SelectionMenuList objects to search through.
47
+ * @param {GlobalSelectionTypes.ItemId[]} args.itemIds - An array of ItemId objects to check for presence in the list.
48
+ * @returns {GlobalSelectionTypes.ItemId[]} An array of itemId strings that correspond to counts of 0 in the selection menu.
49
+ * itemIds object values are concatenated via '-' char
50
+ */
51
+ export declare function itemsNotFoundInSelectionTree(args: {
52
+ groups: SelectionTreeTypes.Group[];
53
+ itemIds: GlobalSelectionTypes.ItemId[];
54
+ }): GlobalSelectionTypes.ItemId[];
55
+ /**
56
+ * Checks if the items in a given group's category are the same as the provided item IDs.
57
+ *
58
+ * @param args - The arguments object.
59
+ * @param args.itemIds - An array of item IDs to compare.
60
+ * @param args.groups - An array of groups to search within.
61
+ * @param args.groupId - The ID of the group to check.
62
+ * @param args.categoryId - The ID of the category within the group to check.
63
+ * @returns `true` if the items in the group are the same as the provided item IDs, otherwise `false`.
64
+ */
65
+ export declare function areItemsTheSameInGroup(args: {
66
+ itemIds: GlobalSelectionTypes.TagId[];
67
+ groups: SelectionTreeTypes.Group[];
68
+ groupId: Guid;
69
+ categoryId: GlobalSelectionCategoryId;
70
+ }): boolean;
@@ -34,9 +34,11 @@ export declare enum LegendStatus {
34
34
  PM20 = "PM20",
35
35
  LC = "LC",
36
36
  LO = "LO",
37
- OnWatch = "OnWatch",
38
- InProgress = "InProgress",
39
- IocAnnotationError = "IocAnnotationError"
37
+ OnWatch = "On watch",
38
+ InProgress = "In progress",
39
+ IocAnnotationError = "IocAnnotationError",
40
+ Note = "Note",
41
+ Archived = "Archived"
40
42
  }
41
43
  /**
42
44
  * Renaming these strings are BREAKING: since it's saved with zustand store.
@@ -0,0 +1,2 @@
1
+ import { SetActiveCommPackNo } from '../types/hookLibrary';
2
+ export declare function useCommPackSearch(): SetActiveCommPackNo;
@@ -0,0 +1,2 @@
1
+ import { SetActiveMcPackNo } from '../types/hookLibrary';
2
+ export declare function useMcPackSearch(): SetActiveMcPackNo;
@@ -0,0 +1,2 @@
1
+ export declare function isImage(fileName: string): boolean;
2
+ export declare function isVideo(fileName: string): boolean;
@@ -1,7 +0,0 @@
1
- import { SelectionMenuList } from '../selectionMenuStore/selectionMenu.store.types';
2
- /**
3
- * Custom hook to get the selection menu lists from the selection menu store, displayed in the left selection panel.
4
- *
5
- * @returns {SelectionMenuList[]} - An array of selection menu lists.
6
- */
7
- export declare function useSelectionMenuLists(): SelectionMenuList[];
@@ -1,28 +0,0 @@
1
- import { SelectionMenuStore } from './selectionMenu.store.types';
2
- export declare enum SelectionMenuDefaultListIds {
3
- TagList = "DEFAULT_TAG_LIST_ID",
4
- WorkOrderList = "DEFAULT_WORK_ORDER_LIST_ID"
5
- }
6
- export declare const useSelectionMenuStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<SelectionMenuStore>, "setState"> & {
7
- setState<A extends string | {
8
- type: string;
9
- }>(partial: SelectionMenuStore | Partial<SelectionMenuStore> | ((state: SelectionMenuStore) => SelectionMenuStore | Partial<SelectionMenuStore>), replace?: boolean | undefined, action?: A | undefined): void;
10
- }, "subscribe"> & {
11
- subscribe: {
12
- (listener: (selectedState: SelectionMenuStore, previousSelectedState: SelectionMenuStore) => void): () => void;
13
- <U>(selector: (state: SelectionMenuStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
14
- equalityFn?: ((a: U, b: U) => boolean) | undefined;
15
- fireImmediately?: boolean;
16
- } | undefined): () => void;
17
- };
18
- }, "setState"> & {
19
- setState(nextStateOrUpdater: SelectionMenuStore | Partial<SelectionMenuStore> | ((state: import("immer").WritableDraft<SelectionMenuStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
20
- type: string;
21
- } | undefined): void;
22
- }>;
23
- /**
24
- * Get a snapshot of the current selection menu store state.
25
- *
26
- * Selection menu: left panel, which holds items from global selection.
27
- */
28
- export declare function getSelectionMenuStoreSnapshot(): SelectionMenuStore;
@@ -1,56 +0,0 @@
1
- import { ResultArray, TagSummaryDto } from '@equinor/echo-search';
2
- import { Guid } from '@equinor/echo-utils';
3
- import { GlobalSelectionItemType, GlobalSelectionTypes, OptimizedWorkOrderDto } from '../../globalSelectionStore/globalSelectionStore.types';
4
- import { SelectionMenuDefaultListIds } from './selectionMenu.store';
5
- export type SelectionMenuItem = SelectionMenuTag | SelectionMenuWorkOrder | SelectionMenuEquipment;
6
- export interface SelectionMenuTag {
7
- id: GlobalSelectionTypes.TagId;
8
- type: GlobalSelectionItemType.Tag;
9
- }
10
- export interface SelectionMenuWorkOrder {
11
- id: GlobalSelectionTypes.WorkOrderId;
12
- type: GlobalSelectionItemType.WorkOrder;
13
- }
14
- export interface SelectionMenuEquipment {
15
- id: GlobalSelectionTypes.EquipmentId;
16
- type: GlobalSelectionItemType.Equipment;
17
- }
18
- export type SelectionMenuList = SelectionMenuWithItems | SelectionMenuWithSubLists;
19
- interface SelectionMenuBase {
20
- id: Guid | SelectionMenuDefaultListIds;
21
- label: string;
22
- }
23
- interface SelectionMenuWithItems extends SelectionMenuBase {
24
- items: SelectionMenuItem[];
25
- subLists?: never;
26
- }
27
- interface SelectionMenuWithSubLists extends SelectionMenuBase {
28
- subLists: SelectionMenuWithItems[];
29
- items?: never;
30
- }
31
- export interface SelectionMenuStore {
32
- lists: SelectionMenuList[];
33
- addItems: (args: {
34
- listId?: string;
35
- itemIds: (GlobalSelectionTypes.TagId | OptimizedWorkOrderDto)[];
36
- }) => void;
37
- addTags: (args: {
38
- listId?: string;
39
- itemIds: Readonly<GlobalSelectionTypes.TagId[]>;
40
- }) => Promise<ResultArray<TagSummaryDto>[]>;
41
- addWorkOrders: (args: {
42
- listId?: string;
43
- items: Readonly<Readonly<OptimizedWorkOrderDto>[]>;
44
- }) => void;
45
- addList: (args: SelectionMenuList) => void;
46
- removeItemsByListId: (args: {
47
- listId: string;
48
- itemIds: GlobalSelectionTypes.ItemId[];
49
- }) => void;
50
- setVisibilityByListId: (args: {
51
- listId: string;
52
- isVisible: boolean;
53
- }) => void;
54
- resetState: () => void;
55
- }
56
- export {};
@@ -1,56 +0,0 @@
1
- import { GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
2
- import { SelectionMenuList } from './selectionMenu.store.types';
3
- /**
4
- * Finds a selection list by its ID from a given list of selection menu lists.
5
- * If the list is not found at the top level, it searches within the sublists of each top-level list.
6
- *
7
- * @param args - The arguments object.
8
- * @param {string} args.listId - The ID of the selection list to find.
9
- * @param {SelectionMenuList[]} args.lists - An optional array of selection menu lists to search within.
10
- * If not provided, the function will use the lists from the selection menu store state.
11
- * If you want to alter the store state, you should provide the lists as an argument.
12
- * @returns {SelectionMenuList | undefined} The selection menu list with the specified ID, or `undefined` if not found.
13
- */
14
- export declare function findSelectionListById(args: {
15
- listId: string;
16
- lists: SelectionMenuList[];
17
- }): SelectionMenuList | undefined;
18
- /**
19
- * Checks if a given item ID is present in a specified list.
20
- *
21
- * @param args - An object containing the item ID and the list ID.
22
- * @param {GlobalSelectionTypes.ItemId} args.itemId - The ID of the item to check for.
23
- * @param {string} args.listId - The ID of the list to search within.
24
- * @param {SelectionMenuList[]} args.lists - The selection menu lists where you would like to search for the given item.
25
- * @returns {boolean} A boolean indicating whether the item ID is found in the list.
26
- */
27
- export declare function isItemIdInList(args: {
28
- itemId: GlobalSelectionTypes.ItemId;
29
- listId: string;
30
- lists: SelectionMenuList[];
31
- }): boolean;
32
- /**
33
- * Checks if a given item ID is present in the selection lists.
34
- *
35
- * @param args - An object containing the item ID to check.
36
- * @param {GlobalSelectionTypes.ItemId} args.itemId - The item ID to check for presence in the selection lists.
37
- * @param {SelectionMenuList[]} args.lists - The selection menu lists where you would like to search for the given item.
38
- * @returns {boolean} A boolean indicating whether the item ID is present in the selection lists.
39
- */
40
- export declare function isItemIdInTheSelection(args: {
41
- itemId?: GlobalSelectionTypes.ItemId;
42
- lists: SelectionMenuList[];
43
- }): boolean;
44
- /**
45
- * Retrieves an array of itemIds that were not found in the selection menu.
46
- *
47
- * @param {Object} args - The arguments containing the list and itemIds to check.
48
- * @param {SelectionMenuList[]} args.list - The list of SelectionMenuList objects to search through.
49
- * @param {GlobalSelectionTypes.ItemId[]} args.itemIds - An array of ItemId objects to check for presence in the list.
50
- * @returns {string[]} An array of itemId strings that correspond to counts of 0 in the selection menu.
51
- * itemIds object values are concatenated via '-' char
52
- */
53
- export declare function itemsNotFoundInSelectionMenu(args: {
54
- lists: SelectionMenuList[];
55
- itemIds: GlobalSelectionTypes.ItemId[];
56
- }): string[];