@equinor/echo-framework 0.23.2 → 0.23.4-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 (45) 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 +8 -2
  6. package/package.json +6 -5
  7. package/src/index.d.ts +2 -2
  8. package/src/lib/components/index.d.ts +1 -0
  9. package/src/lib/components/plantSelector/plantSelector.d.ts +2 -2
  10. package/src/lib/components/plantSelector/plantSelectorHelper.d.ts +4 -3
  11. package/src/lib/components/prepview/notification/header/NotificationHeader.d.ts +1 -1
  12. package/src/lib/components/searchListItem/searchListItem.d.ts +86 -0
  13. package/src/lib/feature/equipment/components/equipmentItemHeader/equipmentItemHeader.d.ts +2 -2
  14. package/src/lib/feature/equipment/components/equipmentItemHeader/equipmentItemSubHeader.d.ts +2 -4
  15. package/src/lib/feature/equipment/components/equipmentItemHeader/linkToSapEquipment.d.ts +2 -2
  16. package/src/lib/feature/equipment/components/equipmentItemHeader/showEquipmentIn3dButton.d.ts +3 -4
  17. package/src/lib/feature/equipment/components/equipmentItemInfo/equipmentItemInfo.d.ts +2 -2
  18. package/src/lib/feature/equipment/components/equipmentListItem.d.ts +9 -4
  19. package/src/lib/feature/equipment/components/equipmentTabs/equipmentTabs.d.ts +2 -2
  20. package/src/lib/feature/equipment/components/fullEquipmentItem/fullEquipmentItem.d.ts +2 -2
  21. package/src/lib/feature/equipment/hooks/useOpenEquipmentDetails.d.ts +2 -2
  22. package/src/lib/feature/equipment/utils/equipmentUtils.d.ts +2 -2
  23. package/src/lib/feature/globalSelection/components/SelectionActionBar.d.ts +1 -2
  24. package/src/lib/feature/globalSelection/globalSelection.api.d.ts +5 -19
  25. package/src/lib/feature/globalSelection/globalSelectionStore/actions/addEquipmentsToSelection.action.d.ts +6 -0
  26. package/src/lib/feature/globalSelection/globalSelectionStore/actions/addItemsToSelectionFactory.d.ts +17 -0
  27. package/src/lib/feature/globalSelection/globalSelectionStore/actions/addTagsToSelection.action.d.ts +7 -0
  28. package/src/lib/feature/globalSelection/globalSelectionStore/actions/addWorkOrdersToSelection.action.d.ts +6 -0
  29. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.types.d.ts +17 -6
  30. package/src/lib/feature/globalSelection/globalSelectionStore/nullItems/createNullEquipment.d.ts +2 -0
  31. package/src/lib/feature/globalSelection/globalSelectionStore/nullItems/createNullTag.d.ts +2 -0
  32. package/src/lib/feature/globalSelection/globalSelectionStore/nullItems/createNullWorkOrder.d.ts +3 -0
  33. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addEquipments.action.d.ts +2 -0
  34. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addTags.action.d.ts +2 -13
  35. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addWorkOrders.action.d.ts +2 -6
  36. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/createAddItemsFactory.d.ts +5 -8
  37. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/selectionTree.action.types.d.ts +5 -4
  38. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/initialData.d.ts +1 -0
  39. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +9 -18
  40. package/src/lib/feature/hooks/useAddTagToLegendRegistry.d.ts +2 -2
  41. package/src/lib/utils/highlightTextUtil.d.ts +26 -0
  42. package/src/lib/utils/index.d.ts +1 -0
  43. package/src/lib/utils/stringUtils.d.ts +5 -0
  44. package/src/lib/feature/globalSelection/globalSelectionStore/actions/addItemsToSelection.action.d.ts +0 -18
  45. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionNullItems.d.ts +0 -4
@@ -1,22 +1,12 @@
1
- import { ResultArray, TagSummaryDto } from '@equinor/echo-search';
2
1
  import { Guid } from '@equinor/echo-utils';
3
- import { GlobalSelectionItemType, GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
2
+ import { GlobalSelectionItemType, GlobalSelectionTypes, SelectionItemTypeToItemIdMap } from '../../globalSelectionStore/globalSelectionStore.types';
4
3
  import { AddByLabel, AddItemArgs, AddItemsResponse, SelectionTreeActionResult } from './actions/selectionTree.action.types';
5
- export type SelectionItemTypeToItemIdMap = {
6
- [GlobalSelectionItemType.Tag]: GlobalSelectionTypes.TagId;
7
- [GlobalSelectionItemType.WorkOrder]: GlobalSelectionTypes.WorkOrderId;
8
- [GlobalSelectionItemType.Equipment]: GlobalSelectionTypes.EquipmentId;
9
- };
10
4
  export declare enum GlobalSelectionCategoryId {
11
5
  Tags = "DEFAULT_TAG_LIST_ID",
12
- WorkOrders = "DEFAULT_WORK_ORDER_LIST_ID"
6
+ WorkOrders = "DEFAULT_WORK_ORDER_LIST_ID",
7
+ Equipments = "DEFAULT_EQUIPMENT_LIST_ID"
13
8
  }
14
9
  export declare const globalSelectionDefaultGroupId: Guid;
15
- /** @deprecated Use GlobalSelectionCategoryId instead */
16
- export declare enum SelectionMenuDefaultListIds {
17
- TagList = "DEFAULT_TAG_LIST_ID",
18
- WorkOrderList = "DEFAULT_WORK_ORDER_LIST_ID"
19
- }
20
10
  export type SelectionTreeItem<T extends GlobalSelectionItemType> = {
21
11
  id: SelectionItemTypeToItemIdMap[T];
22
12
  type: T;
@@ -48,13 +38,12 @@ export interface SelectionTreeData {
48
38
  }
49
39
  export interface SelectionTreeStore {
50
40
  groups: SelectionGroup[];
51
- addTags: <T extends boolean | undefined = undefined>(args: AddItemArgs<GlobalSelectionTypes.TagId> & {
52
- getActionResult?: T;
53
- }) => Promise<AddTagsReturnType<T>>;
54
- addWorkOrders: (args: AddItemArgs<GlobalSelectionTypes.WorkOrderId>) => void;
55
41
  addItems: (args: {
56
42
  itemIds: GlobalSelectionTypes.ItemId[];
57
43
  } & AddByLabel) => void;
44
+ addTags: (args: AddItemArgs<GlobalSelectionTypes.TagId>) => AddTagsReturnType;
45
+ addWorkOrders: (args: AddItemArgs<GlobalSelectionTypes.WorkOrderId>) => AddWorkOrdersReturnType;
46
+ addEquipments: (args: AddItemArgs<GlobalSelectionTypes.EquipmentId>) => AddEquipmentsReturnType;
58
47
  createGroup: (args: {
59
48
  label: string;
60
49
  subLabel: string;
@@ -86,4 +75,6 @@ export declare namespace SelectionTreeTypes {
86
75
  type Group = SelectionGroup;
87
76
  type ActionResult = SelectionTreeActionResult;
88
77
  }
89
- export type AddTagsReturnType<T extends boolean | undefined = undefined> = T extends true ? AddItemsResponse<ResultArray<TagSummaryDto>[]> : ResultArray<TagSummaryDto>[];
78
+ export type AddTagsReturnType = Promise<AddItemsResponse<GlobalSelectionItemType.Tag>>;
79
+ export type AddWorkOrdersReturnType = Promise<AddItemsResponse<GlobalSelectionItemType.WorkOrder>>;
80
+ export type AddEquipmentsReturnType = Promise<AddItemsResponse<GlobalSelectionItemType.Equipment>>;
@@ -6,7 +6,7 @@ import { LegendItemStatus } from '../legacyLegend';
6
6
  * Adds one given tag item to the legend registry service, which tracks the legend status of the registered items.
7
7
  * Returns with the updated itemIdToStatusMap, which contains this newly added item by id as well.
8
8
  *
9
- * @param {string} tagId The given tag's id to be stored in the registry.
9
+ * @param {string} tagNo The given tag's id to be stored in the registry.
10
10
  * @returns {Record<string, LegendItemStatus>} A legend status map: keys are the item ids, values are the legend statuses.
11
11
  */
12
- export declare function useAddTagToLegendRegistry(tagId: string): Record<string, LegendItemStatus>;
12
+ export declare function useAddTagToLegendRegistry(tagNo: string): Record<string, LegendItemStatus>;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * CSS class name to be added to components that should be highlightable.
3
+ *
4
+ * @example
5
+ * // Add this class to the `className` of a component to make it highlightable.
6
+ * <div className={highlightableComponentCssClass}>...</div>
7
+ */
8
+ export declare const highlightableComponentCssClass = "highlightableComponentCssClass";
9
+ /**
10
+ * Highlights text within elements that have the `highlightableComponentCssClass` class.
11
+ *
12
+ * This function uses the `mark.js` library to highlight text matching the `search` query parameter
13
+ * in the URL. It applies the `highlightedText` CSS class to the matched text. The styling for
14
+ * `highlightedText` should be defined in `./public/index.css`.
15
+ *
16
+ * @example
17
+ * // Add the following to a React component to enable text highlighting:
18
+ * useEffect(() => {
19
+ * highlightText();
20
+ * }, []);
21
+ *
22
+ * @remarks
23
+ * - The `search` query parameter is retrieved using `getLinkParams` from `@equinor/echo-utils`.
24
+ * - Punctuation characters are ignored during the matching process.
25
+ */
26
+ export declare const highlightText: () => void;
@@ -1,5 +1,6 @@
1
1
  export { echopediaWebReactPortalUtils } from './echopediaWebReactPortal.utils';
2
2
  export * from './formatTimeHelpers';
3
+ export * from './highlightTextUtil';
3
4
  export * from './navigationUtils';
4
5
  export * from './openIn3d';
5
6
  export * from './plantInfo';
@@ -1 +1,6 @@
1
+ /**
2
+ * @deprecated This is a duplicate, we plan to remove this. Please use the same function from "@equinor/echo-utils".
3
+ * @param inputString
4
+ * @returns {string}
5
+ */
1
6
  export declare function removeLeadingZeros(inputString: string): string;
@@ -1,18 +0,0 @@
1
- import { ResultArray } from '@equinor/echo-search';
2
- import { StoreApi } from 'zustand';
3
- import { GlobalSelectionItemType, GlobalSelectionItemTypeToDataMap, GlobalSelectionStore, GlobalSelectionTypes } from '../globalSelectionStore.types';
4
- type FetchFunction<T, U> = (itemIds: Readonly<U[]>) => Promise<ResultArray<T>[]>;
5
- type NullItemGenerator<T, U> = (itemId: U) => T;
6
- type ItemIdTypeMap = {
7
- [GlobalSelectionItemType.WorkOrder]: GlobalSelectionTypes.WorkOrderId;
8
- [GlobalSelectionItemType.Tag]: GlobalSelectionTypes.TagId;
9
- [GlobalSelectionItemType.Equipment]: GlobalSelectionTypes.EquipmentId;
10
- };
11
- type SetFunction = (set: (state: GlobalSelectionStore) => void, shouldReplace?: boolean | undefined, action?: string) => void;
12
- export declare function addItemsToSelection<T extends GlobalSelectionItemType>(set: SetFunction, get: StoreApi<GlobalSelectionStore>['getState'], args: {
13
- itemIds: ItemIdTypeMap[T][];
14
- }, itemType: T, fetchFunction: FetchFunction<GlobalSelectionItemTypeToDataMap[T], ItemIdTypeMap[T]>, nullItemGenerator: NullItemGenerator<GlobalSelectionItemTypeToDataMap[T], ItemIdTypeMap[T]>): Promise<{
15
- fetchResult: ResultArray<GlobalSelectionItemTypeToDataMap[T]>[];
16
- actionResult: GlobalSelectionTypes.ActionResult;
17
- }>;
18
- export {};
@@ -1,4 +0,0 @@
1
- import { WorkOrderData } from '@equinor/echo-search';
2
- import { GlobalSelectionTypes } from './globalSelectionStore.types';
3
- export declare function createNullTagSummaryDb(itemId: GlobalSelectionTypes.TagId): GlobalSelectionTypes.TagDto;
4
- export declare function createNullWorkOrderData(itemId: GlobalSelectionTypes.WorkOrderId): WorkOrderData;