@equinor/echo-framework 6.2.1-edsv2-beta-1 → 6.2.2
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/{f4c85313e79b1662.svg → 1bd97dd2170d0f64.svg} +850 -850
- package/{063009f06499d102.svg → 47deeba42768c5d1.svg} +8 -8
- package/index.cjs.js +2 -2
- package/index.d.ts +2 -2
- package/package.json +9 -9
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/addItemsByStrategy.action.d.ts +3 -1
- package/src/lib/feature/globalSelection/globalSelectionStore/actions/setRelatedTo.action.d.ts +3 -1
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addItemsByType.action.d.ts +2 -3
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/addItemsToSelectionTreeFactory.d.ts +1 -2
- package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/actions/removeAllItemsById.action.d.ts +1 -3
- package/src/lib/types/navigation/internalApplicationLinks.d.ts +1 -0
- package/src/lib/utils/documentUtils.d.ts +27 -0
- package/src/lib/utils/index.d.ts +1 -0
package/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./src
|
|
2
|
-
export { default } from "./src
|
|
1
|
+
export * from "./src/index";
|
|
2
|
+
export { default } from "./src/index";
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/echo-framework",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.2",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@equinor/echo-base": ">= 6.2.
|
|
6
|
-
"@equinor/echo-components": "6.2.
|
|
7
|
-
"@equinor/echo-core": ">= 6.2.
|
|
8
|
-
"@equinor/echo-search": ">= 6.2.
|
|
9
|
-
"@equinor/echo-utils": ">= 6.2.
|
|
10
|
-
"@equinor/eds-core-react": "
|
|
11
|
-
"@equinor/eds-icons": "
|
|
12
|
-
"@equinor/eds-tokens": "2.
|
|
5
|
+
"@equinor/echo-base": ">= 6.2.2 < 7.0.0",
|
|
6
|
+
"@equinor/echo-components": ">= 6.2.2 < 7.0.0",
|
|
7
|
+
"@equinor/echo-core": ">= 6.2.2 < 7.0.0",
|
|
8
|
+
"@equinor/echo-search": ">= 6.2.2 < 7.0.0",
|
|
9
|
+
"@equinor/echo-utils": ">= 6.2.2 < 7.0.0",
|
|
10
|
+
"@equinor/eds-core-react": "0.49.0",
|
|
11
|
+
"@equinor/eds-icons": "0.22.0",
|
|
12
|
+
"@equinor/eds-tokens": "2.1.0",
|
|
13
13
|
"react": ">= 19.2.4",
|
|
14
14
|
"react-dom": ">= 19.2.4",
|
|
15
15
|
"@tanstack/react-query": ">= 5.14.2 < 6",
|
package/src/lib/feature/globalSelection/globalSelectionStore/actions/addItemsByStrategy.action.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import type { ResultArray } from '@equinor/echo-search';
|
|
|
2
2
|
import type { StoreApi } from 'zustand';
|
|
3
3
|
import type { SelectionItemTypeStrategy } from '../../strategies/selectionItemTypeStrategy.types';
|
|
4
4
|
import type { GlobalSelectionAddItemResult, GlobalSelectionItemType, GlobalSelectionItemTypeToDataMap, GlobalSelectionStore, SelectionItemTypeToItemIdMap } from '../globalSelectionStore.types';
|
|
5
|
-
type SetFunction = (updater: (state: GlobalSelectionStore) => void, shouldReplace?: boolean, action?: string
|
|
5
|
+
type SetFunction = (updater: (state: GlobalSelectionStore) => void, shouldReplace?: boolean | undefined, action?: string | {
|
|
6
|
+
type: string;
|
|
7
|
+
} | undefined) => void;
|
|
6
8
|
/**
|
|
7
9
|
* Generic store action that adds items of any type to the global selection store.
|
|
8
10
|
*
|
package/src/lib/feature/globalSelection/globalSelectionStore/actions/setRelatedTo.action.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { GlobalSelectionStore, GlobalSelectionTypes, RelatedToItem } from '../globalSelectionStore.types';
|
|
2
|
-
type SetFunction = (updater: (state: GlobalSelectionStore) => void, shouldReplace?: boolean, action?: string
|
|
2
|
+
type SetFunction = (updater: (state: GlobalSelectionStore) => void, shouldReplace?: boolean | undefined, action?: string | {
|
|
3
|
+
type: string;
|
|
4
|
+
} | undefined) => void;
|
|
3
5
|
export declare function setRelatedToAction(set: SetFunction, args: ReadonlyArray<{
|
|
4
6
|
readonly itemId: GlobalSelectionTypes.ItemId;
|
|
5
7
|
readonly relatedTo: ReadonlyArray<RelatedToItem>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { StoreApi } from 'zustand';
|
|
2
2
|
import { GlobalSelectionItemType, SelectionItemTypeToItemIdMap } from '../../../globalSelectionStore/globalSelectionStore.types';
|
|
3
3
|
import { SelectionTreeStore } from '../selectionTree.store.types';
|
|
4
|
+
import { SetFunction } from './common.action.types';
|
|
4
5
|
import { AddItemArgs, AddItemsResponse } from './selectionTree.action.types';
|
|
5
|
-
type SetFunction = (set: (state: SelectionTreeStore) => void, shouldReplace: boolean | undefined, action: string | undefined) => void;
|
|
6
6
|
/**
|
|
7
7
|
* Generic tree action for adding items of any registered type to the selection tree.
|
|
8
8
|
* Replaces the 4 per-type action files (addTags, addWorkOrders, addEquipments, addMeasuringPoints).
|
|
@@ -10,6 +10,5 @@ type SetFunction = (set: (state: SelectionTreeStore) => void, shouldReplace: boo
|
|
|
10
10
|
* Reads category config (categoryId, categoryOrderIndex) from the strategy registry so no
|
|
11
11
|
* per-type branching is needed here or in the store.
|
|
12
12
|
*/
|
|
13
|
-
export declare function createAddItemsByTypeAction<T extends GlobalSelectionItemType>(itemType: T): (set:
|
|
13
|
+
export declare function createAddItemsByTypeAction<T extends GlobalSelectionItemType>(itemType: T): (set: SetFunction, get: StoreApi<SelectionTreeStore>["getState"], args: AddItemArgs<SelectionItemTypeToItemIdMap[T]>) => Promise<AddItemsResponse<T>>;
|
|
14
14
|
export declare function addItemsByTypeAction<T extends GlobalSelectionItemType>(set: SetFunction, get: StoreApi<SelectionTreeStore>['getState'], itemType: T, args: AddItemArgs<SelectionItemTypeToItemIdMap[T]>): Promise<AddItemsResponse<T>>;
|
|
15
|
-
export {};
|
|
@@ -2,12 +2,11 @@ import { ResultArray } from '@equinor/echo-search';
|
|
|
2
2
|
import { StoreApi } from 'zustand';
|
|
3
3
|
import { GlobalSelectionAddItemResult, GlobalSelectionItemType, GlobalSelectionItemTypeToDataMap, SelectionItemTypeToItemIdMap } from '../../../globalSelectionStore/globalSelectionStore.types';
|
|
4
4
|
import { GlobalSelectionCategoryId, SelectionTreeStore } from '../selectionTree.store.types';
|
|
5
|
+
import { SetFunction } from './common.action.types';
|
|
5
6
|
import { AddItemArgs, AddItemsResponse } from './selectionTree.action.types';
|
|
6
|
-
type SetFunction = (set: (state: SelectionTreeStore) => void, shouldReplace?: boolean | undefined, action?: string) => void;
|
|
7
7
|
export declare function addItemsToSelectionTreeActionFactory<G_ItemType extends GlobalSelectionItemType>(args: {
|
|
8
8
|
addItemsToGlobalSelection: (uniqueNewItems: SelectionItemTypeToItemIdMap[G_ItemType][], color?: string) => Promise<GlobalSelectionAddItemResult<ResultArray<GlobalSelectionItemTypeToDataMap[G_ItemType]>[]>>;
|
|
9
9
|
itemType: G_ItemType;
|
|
10
10
|
itemCategory: GlobalSelectionCategoryId;
|
|
11
11
|
categoryOrderIndex: number;
|
|
12
12
|
}): (set: SetFunction, get: StoreApi<SelectionTreeStore>["getState"], args: AddItemArgs<SelectionItemTypeToItemIdMap[G_ItemType]>) => Promise<AddItemsResponse<G_ItemType>>;
|
|
13
|
-
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { GlobalSelectionTypes } from '../../../globalSelectionStore/globalSelectionStore.types';
|
|
2
|
-
import {
|
|
3
|
-
type SetFunction = (set: (state: SelectionTreeStore) => void, shouldReplace?: boolean | undefined, action?: string) => void;
|
|
2
|
+
import { SetFunction } from './common.action.types';
|
|
4
3
|
/**
|
|
5
4
|
* Removes all items by their IDs, from all groups, from the state.
|
|
6
5
|
*
|
|
@@ -12,4 +11,3 @@ type SetFunction = (set: (state: SelectionTreeStore) => void, shouldReplace?: bo
|
|
|
12
11
|
export declare function removeAllItemsById(set: SetFunction, args: {
|
|
13
12
|
itemIds: ReadonlyArray<GlobalSelectionTypes.ItemId>;
|
|
14
13
|
}): void;
|
|
15
|
-
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns the best-matching file for a given `prodViewCode` prefix from a
|
|
3
|
+
* document's file list, optionally narrowed by file extension.
|
|
4
|
+
*
|
|
5
|
+
* The selection algorithm:
|
|
6
|
+
* 1. Filter files by `fileTypeFilter` extension (e.g. `'pdf'`). If no files
|
|
7
|
+
* remain after filtering, returns `undefined`.
|
|
8
|
+
* 2. Among the filtered files, keep only those whose `prodViewCode` contains
|
|
9
|
+
* the `prodViewCode` parameter (case-insensitive, default `'v'` for view
|
|
10
|
+
* files).
|
|
11
|
+
* 3. Return the file with the lowest `fileOrder` value.
|
|
12
|
+
*
|
|
13
|
+
* @param files - The document's file list.
|
|
14
|
+
* @param fileTypeFilter - File extension to match (e.g. `'pdf'`). Pass
|
|
15
|
+
* `undefined` to skip extension filtering.
|
|
16
|
+
* @param prodViewCode - The prodViewCode prefix to match. Defaults to `'v'`
|
|
17
|
+
* (view files).
|
|
18
|
+
* @returns The best-matching file, or `undefined` if none qualifies.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* const pdfFile = getFileByProdViewCode(document.files, 'pdf');
|
|
22
|
+
*/
|
|
23
|
+
export declare function getFileByProdViewCode<File extends {
|
|
24
|
+
prodViewCode: string;
|
|
25
|
+
fileName: string;
|
|
26
|
+
fileOrder: number;
|
|
27
|
+
}>(files: ReadonlyArray<File>, fileTypeFilter: string | undefined, prodViewCode?: string): File | undefined;
|
package/src/lib/utils/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { fireAndForget } from './asyncUtils';
|
|
2
|
+
export { getFileByProdViewCode } from './documentUtils';
|
|
2
3
|
export { echopediaWebReactPortalUtils } from './echopediaWebReactPortal.utils';
|
|
3
4
|
export * from './endDateStatus/getEndDateStatus';
|
|
4
5
|
export * from './formatTimeHelpers';
|